summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Piñeiro <apinheiro@igalia.com>2018-03-19 16:47:00 +0100
committerAlejandro Piñeiro <apinheiro@igalia.com>2018-08-21 12:00:50 +0200
commit2fa9b8fa3e81e230977c2b16ca5b03dd6d85d69b (patch)
tree6a8dcff6d0eadc4bb350f99da5b6d1cdf4692672
parent2dfad1d8066d0784de307075885fb6d265ad6825 (diff)
arb_gl_spirv: adding basic va64 test
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
-rw-r--r--tests/spec/arb_gl_spirv/execution/va64-simple.shader_test136
1 files changed, 136 insertions, 0 deletions
diff --git a/tests/spec/arb_gl_spirv/execution/va64-simple.shader_test b/tests/spec/arb_gl_spirv/execution/va64-simple.shader_test
new file mode 100644
index 000000000..bcd87081e
--- /dev/null
+++ b/tests/spec/arb_gl_spirv/execution/va64-simple.shader_test
@@ -0,0 +1,136 @@
+# Very basic 64bit vertex attribute test.
+
+[require]
+SPIRV YES
+GL >= 3.3
+GLSL >= 4.50
+GL_ARB_gl_spirv
+
+[vertex 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; 7
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability Float64
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %main "main" %_ %piglit_vertex %fs_color %value0 %gl_VertexID %gl_InstanceID
+ OpSource GLSL 450
+ OpName %_ ""
+ 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 1
+ OpDecorate %fs_color Location 0
+ OpDecorate %value0 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
+ %fs_color = OpVariable %_ptr_Output_v4float Output
+ %double = OpTypeFloat 64
+ %v4double = OpTypeVector %double 4
+%_ptr_Input_v4double = OpTypePointer Input %v4double
+ %value0 = OpVariable %_ptr_Input_v4double Input
+%_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
+ %26 = OpLoad %v4double %value0
+ %27 = OpFConvert %v4float %26
+ OpStore %fs_color %27
+ OpReturn
+ OpFunctionEnd
+
+[vertex shader]
+#version 450
+
+layout(location = 0) in dvec4 value0;
+layout(location = 1) in vec4 piglit_vertex;
+
+layout(location = 0) out vec4 fs_color;
+
+void main()
+{
+ gl_Position = piglit_vertex;
+
+ fs_color = vec4(value0);
+}
+
+[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; 7
+; Bound: 13
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %color %fs_color
+ OpExecutionMode %main OriginLowerLeft
+ OpSource GLSL 450
+ OpDecorate %color Location 0
+ OpDecorate %fs_color Location 0
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %color = OpVariable %_ptr_Output_v4float Output
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+ %fs_color = OpVariable %_ptr_Input_v4float Input
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %12 = OpLoad %v4float %fs_color
+ OpStore %color %12
+ OpReturn
+ OpFunctionEnd
+
+[fragment shader]
+#version 450
+
+layout(location = 0) in vec4 fs_color;
+layout(location = 0) out vec4 color;
+
+void main()
+{
+ color = fs_color;
+}
+
+[vertex data]
+ 0/double/dvec4 1/float/vec4
+ 0.2 0.3 0.4 0.5 -1.0 -1.0 0.0 1.0
+ 0.2 0.3 0.4 0.5 1.0 -1.0 0.0 1.0
+ 0.2 0.3 0.4 0.5 1.0 1.0 0.0 1.0
+ 0.2 0.3 0.4 0.5 -1.0 1.0 0.0 1.0
+
+
+[test]
+
+clear color 1.0 1.0 1.0 1.0
+clear
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.2 0.3 0.4 0.5