glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out
Alejandro Piñeiro 0f66082d1d ParseHelper: don't assign xfb_offset for struct members
This commit undoes the code on the commit "ParseHelper: assign
xfb_offset for struct members too" (commit
af8c1bdb161e4b2ddf019b61bdfca61f84cb1ca8), except the method renaming,
and updates the tests.

During the review of the implementation of Vulkan extension
VK_EXT_transform_feedback for the Linux Intel driver, it was pointed
that the Vulkan environment spec for SPIR-V only ever refers to block
or block members being decorated. It would be strange to not do the
same for OpenGL (ARB_gl_spirv). That would also fit better to what
GLSL does, where setting explicit xfb offsets for struct members is
not allowed.

FWIW, the original patch was proposed based on the fact that
ARB_gl_spirv is relying on OpenGL for how xfb offsets should be
assigned to members, and it was not clear (at least to me) which is
the responsible of such.
2019-01-31 17:09:30 +01:00

92 lines
4.7 KiB
Plaintext

spv.xfbOffsetOnStructMembersAssignment.vert
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 40
Capability Shader
Capability TransformFeedback
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 9 21 34 38 39
ExecutionMode 4 Xfb
Source GLSL 450
Name 4 "main"
Name 7 "S"
MemberName 7(S) 0 "x1_out"
MemberName 7(S) 1 "x2_out"
Name 9 "s1"
Name 19 "S2"
MemberName 19(S2) 0 "y1_out"
MemberName 19(S2) 1 "y2_out"
Name 21 "s2"
Name 32 "gl_PerVertex"
MemberName 32(gl_PerVertex) 0 "gl_Position"
MemberName 32(gl_PerVertex) 1 "gl_PointSize"
MemberName 32(gl_PerVertex) 2 "gl_ClipDistance"
MemberName 32(gl_PerVertex) 3 "gl_CullDistance"
Name 34 ""
Name 38 "gl_VertexID"
Name 39 "gl_InstanceID"
Decorate 9(s1) Location 0
Decorate 9(s1) XfbBuffer 2
Decorate 9(s1) XfbStride 24
Decorate 9(s1) Offset 16
Decorate 21(s2) Location 5
Decorate 21(s2) XfbBuffer 1
Decorate 21(s2) XfbStride 28
Decorate 21(s2) Offset 8
MemberDecorate 32(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 32(gl_PerVertex) 1 BuiltIn PointSize
MemberDecorate 32(gl_PerVertex) 2 BuiltIn ClipDistance
MemberDecorate 32(gl_PerVertex) 3 BuiltIn CullDistance
Decorate 32(gl_PerVertex) Block
Decorate 34 XfbBuffer 0
Decorate 34 XfbStride 0
Decorate 38(gl_VertexID) BuiltIn VertexId
Decorate 39(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7(S): TypeStruct 6(float) 6(float)
8: TypePointer Output 7(S)
9(s1): 8(ptr) Variable Output
10: TypeInt 32 1
11: 10(int) Constant 0
12: 6(float) Constant 1084227584
13: TypePointer Output 6(float)
15: 10(int) Constant 1
16: 6(float) Constant 1086324736
18: TypeVector 6(float) 4
19(S2): TypeStruct 6(float) 18(fvec4)
20: TypePointer Output 19(S2)
21(s2): 20(ptr) Variable Output
22: 6(float) Constant 1088421888
24: 6(float) Constant 1065353216
25: 6(float) Constant 0
26: 18(fvec4) ConstantComposite 24 25 25 24
27: TypePointer Output 18(fvec4)
29: TypeInt 32 0
30: 29(int) Constant 1
31: TypeArray 6(float) 30
32(gl_PerVertex): TypeStruct 18(fvec4) 6(float) 31 31
33: TypePointer Output 32(gl_PerVertex)
34: 33(ptr) Variable Output
35: 18(fvec4) ConstantComposite 25 25 25 25
37: TypePointer Input 10(int)
38(gl_VertexID): 37(ptr) Variable Input
39(gl_InstanceID): 37(ptr) Variable Input
4(main): 2 Function None 3
5: Label
14: 13(ptr) AccessChain 9(s1) 11
Store 14 12
17: 13(ptr) AccessChain 9(s1) 15
Store 17 16
23: 13(ptr) AccessChain 21(s2) 11
Store 23 22
28: 27(ptr) AccessChain 21(s2) 15
Store 28 26
36: 27(ptr) AccessChain 34 11
Store 36 35
Return
FunctionEnd