[Piglit] [PATCH 13/25] arb_gl_spirv: add execution test for multi-dimensional (aoa) uniform

Alejandro PiƱeiro apinheiro at igalia.com
Tue Apr 17 14:37:19 UTC 2018


---
 .../execution/uniform/arrays-of-arrays.shader_test | 77 ++++++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 tests/spec/arb_gl_spirv/execution/uniform/arrays-of-arrays.shader_test

diff --git a/tests/spec/arb_gl_spirv/execution/uniform/arrays-of-arrays.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/arrays-of-arrays.shader_test
new file mode 100644
index 000000000..07e32560b
--- /dev/null
+++ b/tests/spec/arb_gl_spirv/execution/uniform/arrays-of-arrays.shader_test
@@ -0,0 +1,77 @@
+# Array of arrays of uniforms test
+
+[require]
+SPIRV YES
+GL >= 3.3
+GLSL >= 4.50
+
+[vertex shader passthrough]
+
+[fragment shader spirv]
+; Automatically generated from the GLSL by shader_test_spirv.py. DO NOT EDIT
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 4
+; Bound: 25
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %main "main" %color
+               OpExecutionMode %main OriginLowerLeft
+               OpSource GLSL 450
+               OpName %main "main"
+               OpName %color "color"
+               OpName %u_color "u_color"
+               OpDecorate %color Location 0
+               OpDecorate %u_color Location 10
+       %void = OpTypeVoid
+          %3 = OpTypeFunction %void
+      %float = OpTypeFloat 32
+    %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+      %color = OpVariable %_ptr_Output_v4float Output
+       %uint = OpTypeInt 32 0
+     %uint_2 = OpConstant %uint 2
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr__arr_v4float_uint_2_uint_2 = OpTypeArray %_arr_v4float_uint_2 %uint_2
+%_ptr_UniformConstant__arr__arr_v4float_uint_2_uint_2 = OpTypePointer UniformConstant %_arr__arr_v4float_uint_2_uint_2
+    %u_color = OpVariable %_ptr_UniformConstant__arr__arr_v4float_uint_2_uint_2 UniformConstant
+        %int = OpTypeInt 32 1
+      %int_0 = OpConstant %int 0
+%_ptr_UniformConstant_v4float = OpTypePointer UniformConstant %v4float
+      %int_1 = OpConstant %int 1
+       %main = OpFunction %void None %3
+          %5 = OpLabel
+         %19 = OpAccessChain %_ptr_UniformConstant_v4float %u_color %int_0 %int_0
+         %20 = OpLoad %v4float %19
+         %22 = OpAccessChain %_ptr_UniformConstant_v4float %u_color %int_1 %int_1
+         %23 = OpLoad %v4float %22
+         %24 = OpFAdd %v4float %20 %23
+               OpStore %color %24
+               OpReturn
+               OpFunctionEnd
+
+[fragment shader]
+#version 450
+
+layout (location = 0) out vec4 color;
+
+layout (location = 10) uniform vec4 u_color[2][2];
+
+void main()
+{
+	color = u_color[0][0] + u_color[1][1];
+}
+
+[test]
+clear color 0.2 0.2 0.2 0.2
+clear
+
+uniform vec4 10 0.0 0.1 0.2 0.3
+uniform vec4 11 0.4 0.5 0.6 0.7
+uniform vec4 12 0.8 0.9 1.0 1.1
+uniform vec4 13 0.1 0.2 0.3 0.4
+
+draw rect -1 -1 1 1
+relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (0.1, 0.3, 0.5)
-- 
2.14.1



More information about the Piglit mailing list