1 # Really simple XFB test
10 ; Automatically generated from the GLSL by shader_test_spirv.py. DO NOT EDIT
13 ; Generator: Khronos Glslang Reference Front End; 7
17 OpCapability TransformFeedback
18 %1 = OpExtInstImport "GLSL.std.450"
19 OpMemoryModel Logical GLSL450
20 OpEntryPoint Vertex %main "main" %color %xfb_out %gl_VertexID %gl_InstanceID
21 OpExecutionMode %main Xfb
25 OpName %xfb_out "xfb_out"
26 OpName %gl_VertexID "gl_VertexID"
27 OpName %gl_InstanceID "gl_InstanceID"
28 OpDecorate %color Location 0
29 OpDecorate %color XfbBuffer 0
30 OpDecorate %color XfbStride 4
31 OpDecorate %xfb_out Location 1
32 OpDecorate %xfb_out XfbBuffer 0
33 OpDecorate %xfb_out XfbStride 4
34 OpDecorate %xfb_out Offset 0
35 OpDecorate %gl_VertexID BuiltIn VertexId
36 OpDecorate %gl_InstanceID BuiltIn InstanceId
38 %3 = OpTypeFunction %void
39 %float = OpTypeFloat 32
40 %v4float = OpTypeVector %float 4
41 %_ptr_Output_v4float = OpTypePointer Output %v4float
42 %color = OpVariable %_ptr_Output_v4float Output
43 %float_0 = OpConstant %float 0
44 %float_1 = OpConstant %float 1
45 %12 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1
46 %_ptr_Output_float = OpTypePointer Output %float
47 %xfb_out = OpVariable %_ptr_Output_float Output
48 %float_1_23099995 = OpConstant %float 1.23099995
50 %_ptr_Input_int = OpTypePointer Input %int
51 %gl_VertexID = OpVariable %_ptr_Input_int Input
52 %gl_InstanceID = OpVariable %_ptr_Input_int Input
53 %main = OpFunction %void None %3
56 %19 = OpLoad %int %gl_VertexID
57 %20 = OpConvertSToF %float %19
58 %21 = OpFAdd %float %float_1_23099995 %20
66 layout(location = 0) out vec4 color;
67 layout(location = 1, xfb_buffer=0, xfb_offset = 0) out float xfb_out;
70 color = vec4(0.0, 1.0, 0.0, 1.0);
71 xfb_out = 1.231 + gl_VertexID;
78 xfb draw arrays GL_LINES 0 2
80 verify query_object GL_PRIMITIVES_GENERATED 1
81 verify query_object GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 1
83 probe xfb buffer float 0 0 1.231
84 probe xfb buffer float 0 1 2.231
86 verify program_query GL_TRANSFORM_FEEDBACK_VARYINGS 1