1cb93a386Sopenharmony_ci// Copyright 2020 The Tint Authors.
2cb93a386Sopenharmony_ci//
3cb93a386Sopenharmony_ci// Licensed under the Apache License, Version 2.0 (the "License");
4cb93a386Sopenharmony_ci// you may not use this file except in compliance with the License.
5cb93a386Sopenharmony_ci// You may obtain a copy of the License at
6cb93a386Sopenharmony_ci//
7cb93a386Sopenharmony_ci//     http://www.apache.org/licenses/LICENSE-2.0
8cb93a386Sopenharmony_ci//
9cb93a386Sopenharmony_ci// Unless required by applicable law or agreed to in writing, software
10cb93a386Sopenharmony_ci// distributed under the License is distributed on an "AS IS" BASIS,
11cb93a386Sopenharmony_ci// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12cb93a386Sopenharmony_ci// See the License for the specific language governing permissions and
13cb93a386Sopenharmony_ci// limitations under the License.
14cb93a386Sopenharmony_ci
15cb93a386Sopenharmony_ci// Vertex shader
16cb93a386Sopenharmony_ci[[stage(vertex)]]
17cb93a386Sopenharmony_cifn vtx_main([[builtin(vertex_index)]] VertexIndex : u32)
18cb93a386Sopenharmony_ci         -> [[builtin(position)]] vec4<f32> {
19cb93a386Sopenharmony_ci  var pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
20cb93a386Sopenharmony_ci      vec2<f32>(0.0, 0.5),
21cb93a386Sopenharmony_ci      vec2<f32>(-0.5, -0.5),
22cb93a386Sopenharmony_ci      vec2<f32>(0.5, -0.5));
23cb93a386Sopenharmony_ci  return vec4<f32>(pos[VertexIndex], 0.0, 1.0);
24cb93a386Sopenharmony_ci}
25cb93a386Sopenharmony_ci
26cb93a386Sopenharmony_ci// Fragment shader
27cb93a386Sopenharmony_ci[[stage(fragment)]]
28cb93a386Sopenharmony_cifn frag_main() -> [[location(0)]] vec4<f32> {
29cb93a386Sopenharmony_ci  return vec4<f32>(1.0, 0.0, 0.0, 1.0);
30cb93a386Sopenharmony_ci}
31