• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 The Amber Authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15[vertex shader]
16#version 450
17
18layout(push_constant) uniform PushConstants {
19  vec2 in_val[4];
20} u_pushConstants;
21
22void main() {
23  gl_Position = vec4(u_pushConstants.in_val[gl_VertexIndex], 0.0, 1.0);
24}
25
26[fragment shader]
27#version 430
28layout(location = 0) out vec4 outColor;
29void main() {
30    outColor = vec4(0.5, 0.5, 0.5, 1.0);
31}
32
33[test]
34
35uniform float 0 -1.0 -1.0 1.0 -1.0 -1.0 0.0 1.0 0.0
36clear
37draw rect -1 -1 2 2
38
39probe rect rgba (0,   0, 250, 125) (0.5 0.5 0.5 1.0)
40probe rect rgba (0, 125, 250, 125) (0.0 0.0 0.0 0.0)
41