perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / arb_gl_spirv / execution / vs-ps-simple.shader_test
blobdcaf01eba497f512e3bf933d62f3a696c024cdb2
1 # Test a very simple VS-PS shader pipeline. It doesn't even have
2 # uniforms.
4 [require]
5 SPIRV YES
6 GL >= 3.3
7 GLSL >= 4.50
9 [vertex shader spirv]
10 ; Automatically generated from the GLSL by shader_test_spirv.py. DO NOT EDIT
11 ; SPIR-V
12 ; Version: 1.0
13 ; Generator: Khronos Glslang Reference Front End; 7
14 ; Bound: 24
15 ; Schema: 0
16                OpCapability Shader
17           %1 = OpExtInstImport "GLSL.std.450"
18                OpMemoryModel Logical GLSL450
19                OpEntryPoint Vertex %main "main" %_ %piglit_vertex %gl_VertexID %gl_InstanceID
20                OpSource GLSL 450
21                OpName %_ ""
22                OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
23                OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize
24                OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance
25                OpMemberDecorate %gl_PerVertex 3 BuiltIn CullDistance
26                OpDecorate %gl_PerVertex Block
27                OpDecorate %piglit_vertex Location 0
28                OpDecorate %gl_VertexID BuiltIn VertexId
29                OpDecorate %gl_InstanceID BuiltIn InstanceId
30        %void = OpTypeVoid
31           %3 = OpTypeFunction %void
32       %float = OpTypeFloat 32
33     %v4float = OpTypeVector %float 4
34        %uint = OpTypeInt 32 0
35      %uint_1 = OpConstant %uint 1
36 %_arr_float_uint_1 = OpTypeArray %float %uint_1
37 %gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
38 %_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex
39           %_ = OpVariable %_ptr_Output_gl_PerVertex Output
40         %int = OpTypeInt 32 1
41       %int_0 = OpConstant %int 0
42 %_ptr_Input_v4float = OpTypePointer Input %v4float
43 %piglit_vertex = OpVariable %_ptr_Input_v4float Input
44 %_ptr_Output_v4float = OpTypePointer Output %v4float
45 %_ptr_Input_int = OpTypePointer Input %int
46 %gl_VertexID = OpVariable %_ptr_Input_int Input
47 %gl_InstanceID = OpVariable %_ptr_Input_int Input
48        %main = OpFunction %void None %3
49           %5 = OpLabel
50          %18 = OpLoad %v4float %piglit_vertex
51          %20 = OpAccessChain %_ptr_Output_v4float %_ %int_0
52                OpStore %20 %18
53                OpReturn
54                OpFunctionEnd
56 [vertex shader]
57 #version 450
59 layout(location = 0) in vec4 piglit_vertex;
61 void main() {
62    gl_Position = piglit_vertex;
65 [fragment shader spirv]
66 ; Automatically generated from the GLSL by shader_test_spirv.py. DO NOT EDIT
67 ; SPIR-V
68 ; Version: 1.0
69 ; Generator: Khronos Glslang Reference Front End; 7
70 ; Bound: 13
71 ; Schema: 0
72                OpCapability Shader
73           %1 = OpExtInstImport "GLSL.std.450"
74                OpMemoryModel Logical GLSL450
75                OpEntryPoint Fragment %main "main" %outcolor
76                OpExecutionMode %main OriginLowerLeft
77                OpSource GLSL 450
78                OpDecorate %outcolor Location 0
79        %void = OpTypeVoid
80           %3 = OpTypeFunction %void
81       %float = OpTypeFloat 32
82     %v4float = OpTypeVector %float 4
83 %_ptr_Output_v4float = OpTypePointer Output %v4float
84    %outcolor = OpVariable %_ptr_Output_v4float Output
85     %float_0 = OpConstant %float 0
86     %float_1 = OpConstant %float 1
87          %12 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1
88        %main = OpFunction %void None %3
89           %5 = OpLabel
90                OpStore %outcolor %12
91                OpReturn
92                OpFunctionEnd
94 [fragment shader]
95 #version 430
97 layout(location = 0) out vec4 outcolor;
99 void main() {
100     outcolor = vec4(0.0, 1.0, 0.0, 1.0);
103 [test]
104 clear color 1.0 0.0 0.0 0.0
105 clear
107 draw rect -1 -1 2 2
108 probe all rgba 0.0 1.0 0.0 1.0