• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!amber
2#
3# Copyright 2019 The Amber Authors.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     https://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17DEVICE_FEATURE vertexPipelineStoresAndAtomics
18
19SHADER vertex vtex_shader GLSL
20#version 430
21
22layout(location = 0) in vec4 position;
23layout(location = 0) out vec4 frag_color;
24
25layout(set = 0, binding = 0) readonly buffer block1 {
26  vec4 in_color;
27};
28
29void main() {
30  gl_Position = position;
31  frag_color = in_color;
32}
33END
34
35SHADER fragment frag_shader GLSL
36#version 430
37
38layout(location = 0) in vec4 frag_color;
39layout(location = 0) out vec4 final_color;
40
41void main() {
42  final_color = frag_color;
43}
44END
45
46BUFFER data_buf1 DATA_TYPE vec4<float> DATA  1 1  0 1 END
47
48
49BUFFER frame FORMAT B8G8R8A8_UNORM
50
51PIPELINE graphics pipeline1
52  ATTACH vtex_shader
53  ATTACH frag_shader
54
55  FRAMEBUFFER_SIZE 800 600
56  BIND BUFFER frame AS color LOCATION 0
57  BIND BUFFER data_buf1 AS storage DESCRIPTOR_SET 0 BINDING 0
58END
59
60CLEAR pipeline1
61RUN pipeline1 DRAW_RECT POS   0   0 SIZE 400 300
62
63EXPECT frame IDX   0   0 SIZE 400 300 EQ_RGBA 255   255   0 255
64