• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!amber
2
3# Copyright 2022 Google LLC.
4# Copyright 2022 The Khronos Group Inc.
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10#     https://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17
18SHADER vertex vert_shader PASSTHROUGH
19
20SHADER fragment frag_shader GLSL
21#version 430
22layout(location = 0) out vec4 color_out;
23uniform layout(set=0, binding=0) sampler2DShadow tex;
24void main()
25{
26    // Sample border color of opaque white which makes the depth comparison 0.5 > 1.0 false.
27    color_out = vec4(texture(tex, vec3(2.0, 2.0, 0.5)), 0.0, 0.0, 1.0);
28}
29END
30
31IMAGE texture FORMAT D32_SFLOAT DIM_2D WIDTH 32 HEIGHT 32 FILL 0.0
32IMAGE framebuffer FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
33
34SAMPLER sampler_float_opaque_white \
35  ADDRESS_MODE_U clamp_to_border \
36  ADDRESS_MODE_V clamp_to_border \
37  BORDER_COLOR float_opaque_white \
38  COMPARE on \
39  COMPARE_OP greater
40
41PIPELINE graphics pipeline_float_opaque_white
42  ATTACH vert_shader
43  ATTACH frag_shader
44  BIND BUFFER texture AS combined_image_sampler SAMPLER sampler_float_opaque_white DESCRIPTOR_SET 0 BINDING 0
45  FRAMEBUFFER_SIZE 32 32
46  BIND BUFFER framebuffer AS color LOCATION 0
47END
48
49RUN pipeline_float_opaque_white DRAW_RECT POS 0 0 SIZE 32 32
50
51EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 0 0 255
52