perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / arb_gl_spirv / execution / xfb / vs_aoa.shader_test
blobc1f20b61335c1c66d1a55644a22ecb8725c9891a
1 # XFB test using an array of arrays input variable
3 [require]
4 SPIRV YES
5 GL >= 3.3
6 GLSL >= 4.50
7 GL_ARB_gl_spirv
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: 41
15 ; Schema: 0
16                OpCapability Shader
17                OpCapability TransformFeedback
18           %1 = OpExtInstImport "GLSL.std.450"
19                OpMemoryModel Logical GLSL450
20                OpEntryPoint Vertex %main "main" %color %var %extra %gl_VertexID %gl_InstanceID
21                OpExecutionMode %main Xfb
22                OpSource GLSL 450
23                OpDecorate %color Location 0
24                OpDecorate %color XfbBuffer 0
25                OpDecorate %color XfbStride 28
26                OpDecorate %var Location 1
27                OpDecorate %var XfbBuffer 0
28                OpDecorate %var XfbStride 28
29                OpDecorate %var Offset 0
30                OpDecorate %extra Location 10
31                OpDecorate %extra XfbBuffer 0
32                OpDecorate %extra XfbStride 28
33                OpDecorate %extra Offset 24
34                OpDecorate %gl_VertexID BuiltIn VertexId
35                OpDecorate %gl_InstanceID BuiltIn InstanceId
36        %void = OpTypeVoid
37           %3 = OpTypeFunction %void
38       %float = OpTypeFloat 32
39     %v4float = OpTypeVector %float 4
40 %_ptr_Output_v4float = OpTypePointer Output %v4float
41       %color = OpVariable %_ptr_Output_v4float Output
42     %float_0 = OpConstant %float 0
43     %float_1 = OpConstant %float 1
44          %12 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1
45        %uint = OpTypeInt 32 0
46      %uint_3 = OpConstant %uint 3
47 %_arr_float_uint_3 = OpTypeArray %float %uint_3
48      %uint_2 = OpConstant %uint 2
49 %_arr__arr_float_uint_3_uint_2 = OpTypeArray %_arr_float_uint_3 %uint_2
50 %_ptr_Output__arr__arr_float_uint_3_uint_2 = OpTypePointer Output %_arr__arr_float_uint_3_uint_2
51         %var = OpVariable %_ptr_Output__arr__arr_float_uint_3_uint_2 Output
52         %int = OpTypeInt 32 1
53       %int_0 = OpConstant %int 0
54 %_ptr_Output_float = OpTypePointer Output %float
55       %int_1 = OpConstant %int 1
56     %float_2 = OpConstant %float 2
57       %int_2 = OpConstant %int 2
58     %float_3 = OpConstant %float 3
59     %float_4 = OpConstant %float 4
60     %float_5 = OpConstant %float 5
61     %float_6 = OpConstant %float 6
62       %extra = OpVariable %_ptr_Output_float Output
63    %float_16 = OpConstant %float 16
64 %_ptr_Input_int = OpTypePointer Input %int
65 %gl_VertexID = OpVariable %_ptr_Input_int Input
66 %gl_InstanceID = OpVariable %_ptr_Input_int Input
67        %main = OpFunction %void None %3
68           %5 = OpLabel
69                OpStore %color %12
70          %23 = OpAccessChain %_ptr_Output_float %var %int_0 %int_0
71                OpStore %23 %float_1
72          %26 = OpAccessChain %_ptr_Output_float %var %int_0 %int_1
73                OpStore %26 %float_2
74          %29 = OpAccessChain %_ptr_Output_float %var %int_0 %int_2
75                OpStore %29 %float_3
76          %31 = OpAccessChain %_ptr_Output_float %var %int_1 %int_0
77                OpStore %31 %float_4
78          %33 = OpAccessChain %_ptr_Output_float %var %int_1 %int_1
79                OpStore %33 %float_5
80          %35 = OpAccessChain %_ptr_Output_float %var %int_1 %int_2
81                OpStore %35 %float_6
82                OpStore %extra %float_16
83                OpReturn
84                OpFunctionEnd
86 [vertex shader]
87 #version 450
89 layout(location=0) out vec4 color;
90 layout(location=1, xfb_offset=0, xfb_buffer=0) out float var[2][3];
92 //variable below added as a canary, to check that variables get
93 //properly assigned after the aoa
95 layout(location=10, xfb_offset=24, xfb_buffer=0) out float extra;
97 void main() {
98   color = vec4(0.0, 1.0, 0.0, 1.0);
100   var[0][0] = 1.0;
101   var[0][1] = 2.0;
102   var[0][2] = 3.0;
104   var[1][0] = 4.0;
105   var[1][1] = 5.0;
106   var[1][2] = 6.0;
108   extra = 16.0;
111 [test]
112 xfb buffer object 0 64
114 xfb draw arrays GL_POINTS 0 1
116 verify query_object GL_PRIMITIVES_GENERATED 1
117 verify query_object GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 1
119 probe xfb buffer float 0 0 1.0
120 probe xfb buffer float 0 1 2.0
121 probe xfb buffer float 0 2 3.0
122 probe xfb buffer float 0 3 4.0
123 probe xfb buffer float 0 4 5.0
124 probe xfb buffer float 0 5 6.0
125 probe xfb buffer float 0 6 16.0
127 # 3 varyings: var[0], var[1], and extra
128 verify program_query GL_TRANSFORM_FEEDBACK_VARYINGS 3