summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-06-19 20:25:43 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-10-11 12:05:49 +0200
commit49547a30d546dd5a6277c3c499f43c0f3a2b19f6 (patch)
tree0f4c92ac370e297901b155bd48c736994ebd27ab
parentf0867086ad5e8b35a564a030b40e85166b6abf29 (diff)
arb_gl_spirv: add basic test
-rw-r--r--tests/spec/arb_gl_spirv/execution/vs-ps.shader_test84
1 files changed, 84 insertions, 0 deletions
diff --git a/tests/spec/arb_gl_spirv/execution/vs-ps.shader_test b/tests/spec/arb_gl_spirv/execution/vs-ps.shader_test
new file mode 100644
index 000000000..7fa5ab6e3
--- /dev/null
+++ b/tests/spec/arb_gl_spirv/execution/vs-ps.shader_test
@@ -0,0 +1,84 @@
+# Test a very simple VS-PS shader pipeline with all names removed.
+
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_gl_spirv
+
+[vertex shader spirv]
+# #version 330
+#
+# layout(location = 0) in vec4 piglit_vertex;
+#
+# void main() {
+# gl_Position = piglit_vertex;
+# }
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %main "main" %_ %piglit_vertex
+ OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
+ OpDecorate %gl_PerVertex Block
+ OpDecorate %piglit_vertex Location 0
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%gl_PerVertex = OpTypeStruct %v4float
+%_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
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %18 = OpLoad %v4float %piglit_vertex
+ %20 = OpAccessChain %_ptr_Output_v4float %_ %int_0
+ OpStore %20 %18
+ OpReturn
+ OpFunctionEnd
+
+[fragment shader spirv]
+# #version 330
+# #extension GL_ARB_explicit_uniform_location : enable
+#
+# layout(location = 0) uniform vec4 color;
+#
+# layout(location = 0) out vec4 outcolor;
+#
+# void main() {
+# outcolor = color;
+# }
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %outcolor
+ OpExecutionMode %main OriginLowerLeft
+ 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
+
+[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