1# Array of arrays of uniforms test
2
3[require]
4SPIRV YES
5GL >= 3.3
6GLSL >= 4.50
7
8[vertex shader passthrough]
9
10[fragment shader spirv]
11; Automatically generated from the GLSL by shader_test_spirv.py. DO NOT EDIT
12; SPIR-V
13; Version: 1.0
14; Generator: Khronos Glslang Reference Front End; 4
15; Bound: 25
16; Schema: 0
17               OpCapability Shader
18          %1 = OpExtInstImport "GLSL.std.450"
19               OpMemoryModel Logical GLSL450
20               OpEntryPoint Fragment %main "main" %color
21               OpExecutionMode %main OriginLowerLeft
22               OpSource GLSL 450
23               OpName %main "main"
24               OpName %color "color"
25               OpName %u_color "u_color"
26               OpDecorate %color Location 0
27               OpDecorate %u_color Location 10
28       %void = OpTypeVoid
29          %3 = OpTypeFunction %void
30      %float = OpTypeFloat 32
31    %v4float = OpTypeVector %float 4
32%_ptr_Output_v4float = OpTypePointer Output %v4float
33      %color = OpVariable %_ptr_Output_v4float Output
34       %uint = OpTypeInt 32 0
35     %uint_2 = OpConstant %uint 2
36%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
37%_arr__arr_v4float_uint_2_uint_2 = OpTypeArray %_arr_v4float_uint_2 %uint_2
38%_ptr_UniformConstant__arr__arr_v4float_uint_2_uint_2 = OpTypePointer UniformConstant %_arr__arr_v4float_uint_2_uint_2
39    %u_color = OpVariable %_ptr_UniformConstant__arr__arr_v4float_uint_2_uint_2 UniformConstant
40        %int = OpTypeInt 32 1
41      %int_0 = OpConstant %int 0
42%_ptr_UniformConstant_v4float = OpTypePointer UniformConstant %v4float
43      %int_1 = OpConstant %int 1
44       %main = OpFunction %void None %3
45          %5 = OpLabel
46         %19 = OpAccessChain %_ptr_UniformConstant_v4float %u_color %int_0 %int_0
47         %20 = OpLoad %v4float %19
48         %22 = OpAccessChain %_ptr_UniformConstant_v4float %u_color %int_1 %int_1
49         %23 = OpLoad %v4float %22
50         %24 = OpFAdd %v4float %20 %23
51               OpStore %color %24
52               OpReturn
53               OpFunctionEnd
54
55[fragment shader]
56#version 450
57
58layout (location = 0) out vec4 color;
59
60layout (location = 10) uniform vec4 u_color[2][2];
61
62void main()
63{
64	color = u_color[0][0] + u_color[1][1];
65}
66
67[test]
68clear color 0.2 0.2 0.2 0.2
69clear
70
71uniform vec4 10 0.0 0.1 0.2 0.3
72uniform vec4 11 0.4 0.5 0.6 0.7
73uniform vec4 12 0.8 0.9 1.0 1.1
74uniform vec4 13 0.1 0.2 0.3 0.4
75
76verify program_query GL_ACTIVE_UNIFORMS 2
77
78draw rect -1 -1 1 1
79relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (0.1, 0.3, 0.5)
80