• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!amber
2# Copyright 2024 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  float x = gl_FragCoord.x;
22  // Small busy loop.
23  // x final result will be zero.
24  for(int i= 0;i <10;i++) {
25    x = x*0.00001;
26  }
27  color_out = vec4(x, 0.0, 0.0, 1.0);
28}
29END
30
31BUFFER framebuffer FORMAT B8G8R8A8_UNORM
32
33PIPELINE graphics my_pipeline
34  ATTACH vert_shader
35  ATTACH frag_shader
36  FRAMEBUFFER_SIZE 1024 1024
37  BIND BUFFER framebuffer AS color LOCATION 0
38END
39
40RUN TIMED_EXECUTION my_pipeline DRAW_RECT POS 0 0 SIZE 1024 1024
41EXPECT framebuffer IDX 0 0 SIZE 1024 1024 EQ_RGBA 0 0 0 255
42