1#!amber
2# Copyright 2019 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, 0.5, 0.0, 0.8);
22}
23END
24
25BUFFER framebuffer FORMAT B8G8R8A8_UNORM
26
27PIPELINE graphics my_pipeline
28  ATTACH vert_shader
29  ATTACH frag_shader
30  FRAMEBUFFER_SIZE 800 600
31  BIND BUFFER framebuffer AS color LOCATION 0
32END
33DERIVE_PIPELINE pipeline2 FROM my_pipeline
34END
35DERIVE_PIPELINE pipeline3 FROM my_pipeline
36END
37
38RUN my_pipeline DRAW_GRID POS 0 0 SIZE 250 250 CELLS 1 2
39RUN pipeline2 DRAW_GRID POS 250 250 SIZE 250 250 CELLS 3 4
40RUN pipeline3 DRAW_GRID POS 0 250 SIZE 250 250 CELLS 5 6
41
42EXPECT framebuffer IDX 250 250 SIZE 250 250 EQ_RGBA 0 127 0 204 TOLERANCE 0 1 0 1
43EXPECT framebuffer IDX 0 0 SIZE 250 250 EQ_RGBA 0 127 0 204 TOLERANCE 0 1 0 1
44EXPECT framebuffer IDX 0 250 SIZE 250 250 EQ_RGBA 0 127 0 204 TOLERANCE 0 1 0 1
45