arb_gl_spirv: add xfb tests for lines and triangles

This adds some simple tests for primitives other than points.
Acked-by: Caio Marcelo de Oliveira Filho's avatarCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
parent 22646831
Pipeline #76584 passed with stages
in 2 minutes and 45 seconds
# Really simple XFB 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: 23
; Schema: 0
OpCapability Shader
OpCapability TransformFeedback
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %main "main" %color %xfb_out %gl_VertexID %gl_InstanceID
OpExecutionMode %main Xfb
OpSource GLSL 450
OpName %main "main"
OpName %color "color"
OpName %xfb_out "xfb_out"
OpName %gl_VertexID "gl_VertexID"
OpName %gl_InstanceID "gl_InstanceID"
OpDecorate %color Location 0
OpDecorate %color XfbBuffer 0
OpDecorate %color XfbStride 4
OpDecorate %xfb_out Location 1
OpDecorate %xfb_out XfbBuffer 0
OpDecorate %xfb_out XfbStride 4
OpDecorate %xfb_out Offset 0
OpDecorate %gl_VertexID BuiltIn VertexId
OpDecorate %gl_InstanceID BuiltIn InstanceId
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%color = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%12 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1
%_ptr_Output_float = OpTypePointer Output %float
%xfb_out = OpVariable %_ptr_Output_float Output
%float_1_23099995 = OpConstant %float 1.23099995
%int = OpTypeInt 32 1
%_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
OpStore %color %12
%19 = OpLoad %int %gl_VertexID
%20 = OpConvertSToF %float %19
%21 = OpFAdd %float %float_1_23099995 %20
OpStore %xfb_out %21
OpReturn
OpFunctionEnd
[vertex shader]
#version 450
layout(location = 0) out vec4 color;
layout(location = 1, xfb_buffer=0, xfb_offset = 0) out float xfb_out;
void main() {
color = vec4(0.0, 1.0, 0.0, 1.0);
xfb_out = 1.231 + gl_VertexID;
}
[test]
xfb buffer object 0 8
xfb draw arrays GL_LINES 0 2
verify query_object GL_PRIMITIVES_GENERATED 1
verify query_object GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 1
probe xfb buffer float 0 0 1.231
probe xfb buffer float 0 1 2.231
verify program_query GL_TRANSFORM_FEEDBACK_VARYINGS 1
# Really simple XFB 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: 23
; Schema: 0
OpCapability Shader
OpCapability TransformFeedback
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %main "main" %color %xfb_out %gl_VertexID %gl_InstanceID
OpExecutionMode %main Xfb
OpSource GLSL 450
OpName %main "main"
OpName %color "color"
OpName %xfb_out "xfb_out"
OpName %gl_VertexID "gl_VertexID"
OpName %gl_InstanceID "gl_InstanceID"
OpDecorate %color Location 0
OpDecorate %color XfbBuffer 0
OpDecorate %color XfbStride 4
OpDecorate %xfb_out Location 1
OpDecorate %xfb_out XfbBuffer 0
OpDecorate %xfb_out XfbStride 4
OpDecorate %xfb_out Offset 0
OpDecorate %gl_VertexID BuiltIn VertexId
OpDecorate %gl_InstanceID BuiltIn InstanceId
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%color = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%12 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1
%_ptr_Output_float = OpTypePointer Output %float
%xfb_out = OpVariable %_ptr_Output_float Output
%float_1_23099995 = OpConstant %float 1.23099995
%int = OpTypeInt 32 1
%_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
OpStore %color %12
%19 = OpLoad %int %gl_VertexID
%20 = OpConvertSToF %float %19
%21 = OpFAdd %float %float_1_23099995 %20
OpStore %xfb_out %21
OpReturn
OpFunctionEnd
[vertex shader]
#version 450
layout(location = 0) out vec4 color;
layout(location = 1, xfb_buffer=0, xfb_offset = 0) out float xfb_out;
void main() {
color = vec4(0.0, 1.0, 0.0, 1.0);
xfb_out = 1.231 + gl_VertexID;
}
[test]
xfb buffer object 0 12
xfb draw arrays GL_TRIANGLES 0 3
verify query_object GL_PRIMITIVES_GENERATED 1
verify query_object GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 1
probe xfb buffer float 0 0 1.231
probe xfb buffer float 0 1 2.231
probe xfb buffer float 0 2 3.231
verify program_query GL_TRANSFORM_FEEDBACK_VARYINGS 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment