[10/24] arb_gl_spirv: add basic uniform test without names

Submitted by apinheiro on June 20, 2018, 12:40 p.m.

Details

Message ID 20180620124059.25917-11-apinheiro@igalia.com
State New
Headers show
Series "ARB_gl_spirv: support for loading SPIR-V binaries, plus first set of tests" ( rev: 2 ) in Piglit

Not browsing as part of any series.

Commit Message

apinheiro June 20, 2018, 12:40 p.m.
From: Nicolai Hähnle <nicolai.haehnle@amd.com>

The names were removed from the text-format SPIR-V by hand.

Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Nicolai Hähnle <nicolai.haenle@amd.com>
---
 .../uniform/simple-without-names.shader_test       | 111 +++++++++++++++++++++
 1 file changed, 111 insertions(+)
 create mode 100644 tests/spec/arb_gl_spirv/execution/uniform/simple-without-names.shader_test

Patch hide | download patch | download mbox

diff --git a/tests/spec/arb_gl_spirv/execution/uniform/simple-without-names.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/simple-without-names.shader_test
new file mode 100644
index 000000000..b9ccd1a40
--- /dev/null
+++ b/tests/spec/arb_gl_spirv/execution/uniform/simple-without-names.shader_test
@@ -0,0 +1,111 @@ 
+# Test a very simple VS-PS shader pipeline with all names removed.
+
+[require]
+SPIRV YES
+GL >= 3.3
+GLSL >= 4.50
+
+[vertex shader spirv]
+; Automatically generated from the GLSL by shader_test_spirv.py. Then manually edited to remove all names.
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 4
+; Bound: 24
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %main "main" %_ %piglit_vertex %gl_VertexID %gl_InstanceID
+               OpSource GLSL 450
+               OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
+               OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize
+               OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance
+               OpMemberDecorate %gl_PerVertex 3 BuiltIn CullDistance
+               OpDecorate %gl_PerVertex Block
+               OpDecorate %piglit_vertex Location 0
+               OpDecorate %gl_VertexID BuiltIn VertexId
+               OpDecorate %gl_InstanceID BuiltIn InstanceId
+       %void = OpTypeVoid
+          %3 = OpTypeFunction %void
+      %float = OpTypeFloat 32
+    %v4float = OpTypeVector %float 4
+       %uint = OpTypeInt 32 0
+     %uint_1 = OpConstant %uint 1
+%_arr_float_uint_1 = OpTypeArray %float %uint_1
+%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
+%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex
+          %_ = OpVariable %_ptr_Output_gl_PerVertex Output
+        %int = OpTypeInt 32 1
+      %int_0 = OpConstant %int 0
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%piglit_vertex = OpVariable %_ptr_Input_v4float Input
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%_ptr_Input_int = OpTypePointer Input %int
+%gl_VertexID = OpVariable %_ptr_Input_int Input
+%gl_InstanceID = OpVariable %_ptr_Input_int Input
+       %main = OpFunction %void None %3
+          %5 = OpLabel
+         %18 = OpLoad %v4float %piglit_vertex
+         %20 = OpAccessChain %_ptr_Output_v4float %_ %int_0
+               OpStore %20 %18
+               OpReturn
+               OpFunctionEnd
+
+[vertex shader]
+#version 450
+
+layout(location = 0) in vec4 piglit_vertex;
+
+void main() {
+   gl_Position = piglit_vertex;
+}
+
+[fragment shader spirv]
+; Automatically generated from the GLSL by shader_test_spirv.py. Then manually edited to remove all names.
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 4
+; Bound: 13
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %main "main" %outcolor
+               OpExecutionMode %main OriginLowerLeft
+               OpSource GLSL 450
+               OpDecorate %outcolor Location 0
+               OpDecorate %color Location 0
+       %void = OpTypeVoid
+          %3 = OpTypeFunction %void
+      %float = OpTypeFloat 32
+    %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+   %outcolor = OpVariable %_ptr_Output_v4float Output
+%_ptr_UniformConstant_v4float = OpTypePointer UniformConstant %v4float
+      %color = OpVariable %_ptr_UniformConstant_v4float UniformConstant
+       %main = OpFunction %void None %3
+          %5 = OpLabel
+         %12 = OpLoad %v4float %color
+               OpStore %outcolor %12
+               OpReturn
+               OpFunctionEnd
+
+[fragment shader]
+#version 450
+
+layout(location = 0) uniform vec4 color;
+
+layout(location = 0) out vec4 outcolor;
+
+void main() {
+    outcolor = color;
+}
+
+[test]
+clear color 1.0 0.0 0.0 0.0
+clear
+
+uniform vec4 0 0.0 1.0 0.0 1.0
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0