arb_program_interface_query: set vs_input2[1][0] as valid name
[piglit.git] / tests / spec / arb_bindless_texture / execution / samplers / fs-struct-non-const-index.shader_test
blob09dfdcc06a9b1f6492159eecb56e5e74c6493034
1 # This test verifies that dynamically uniform indexing of sampler arrays
2 # in the fragment shader with resident textures behaves correctly.
3 # Based on arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index.shader_test.
4 [require]
5 GLSL >= 3.30
6 GL_ARB_gpu_shader5
7 GL_ARB_arrays_of_arrays
8 GL_ARB_bindless_texture
10 [vertex shader passthrough]
12 [fragment shader]
13 #version 330
14 #extension GL_ARB_gpu_shader5: require
15 #extension GL_ARB_arrays_of_arrays: enable
16 #extension GL_ARB_bindless_texture: enable
18 layout (bindless_sampler) uniform;
20 struct S {
21         sampler2D tex;
24 uniform S s[2][2];
26 uniform int n;
27 uniform int m;
29 out vec4 color;
31 void main()
33         color = texture(s[n][m].tex, vec2(0.75, 0.25));
36 [test]
37 clear color 0.2 0.2 0.2 0.2
38 clear
40 texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0)
41 texparameter 2D min nearest
42 texparameter 2D mag nearest
43 texparameter 2D border_color 0.0 0.0 0.0 0.0
44 resident texture 0
45 uniform handle s[0][0].tex 0
47 texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0)
48 texparameter 2D min nearest
49 texparameter 2D mag nearest
50 texparameter 2D border_color 0.0 0.0 0.0 0.0
51 resident texture 1
52 uniform handle s[0][1].tex 1
54 texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0)
55 texparameter 2D min nearest
56 texparameter 2D mag nearest
57 texparameter 2D border_color 0.0 0.0 0.0 0.0
58 resident texture 2
59 uniform handle s[1][0].tex 2
61 texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0)
62 texparameter 2D min nearest
63 texparameter 2D mag nearest
64 texparameter 2D border_color 0.0 0.0 0.0 0.0
65 resident texture 3
66 uniform handle s[1][1].tex 3
68 uniform int n 0
69 uniform int m 0
70 draw rect -1 -1 1 1
72 relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0)
74 uniform int n 0
75 uniform int m 1
76 draw rect 0 -1 1 1
78 relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0)
80 uniform int n 1
81 uniform int m 0
82 draw rect -1 0 1 1
84 relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0)
86 uniform int n 1
87 uniform int m 1
88 draw rect 0 0 1 1
90 relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0)