1#!amber
2# Copyright 2022 The Amber Authors.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     https://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16SHADER vertex vert_shader PASSTHROUGH
17SHADER fragment frag_shader GLSL
18#version 430
19layout(location = 0) out vec4 color_out;
20void main() {
21  color_out = vec4(0.0, 1.0, 0.0, 1.0);
22}
23END
24
25BUFFER position DATA_TYPE vec4<float> DATA
26-1.0  1.0 0.0 1.0
27 1.0  1.0 0.0 1.0
28 1.0 -1.0 0.0 1.0
29-1.0 -1.0 0.0 1.0
30END
31
32BUFFER indices DATA_TYPE uint16 DATA
333 2 1 0
34END
35
36IMAGE framebuffer FORMAT B8G8R8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64
37
38PIPELINE graphics pipeline
39  ATTACH vert_shader
40  ATTACH frag_shader
41  VERTEX_DATA position LOCATION 0
42  INDEX_DATA indices
43  FRAMEBUFFER_SIZE 64 64
44  BIND BUFFER framebuffer AS color LOCATION 0
45END
46
47RUN pipeline DRAW_ARRAY AS TRIANGLE_FAN INDEXED START_IDX 0 COUNT 4
48EXPECT framebuffer IDX 0 0 SIZE 64 64 EQ_RGBA 0 255 0 255
49