SPV: Plumb through XFB buffer and stride information.

Also, only emit this XFB information where the SPIR-V spec says
it should be emitted: essentially, on objects.

This and the previous commit together fix #1185.
This commit is contained in:
John Kessenich
2017-12-15 06:21:46 -07:00
parent be3842f6ae
commit edaf556778
7 changed files with 88 additions and 20 deletions

View File

@@ -20,8 +20,8 @@ spv.builtInXFB.vert
MemberDecorate 8(gl_PerVertex) 1 Offset 16
MemberDecorate 8(gl_PerVertex) 1 BuiltIn PointSize
Decorate 8(gl_PerVertex) Block
Decorate 8(gl_PerVertex) XfbBuffer 0
Decorate 10 XfbBuffer 0
Decorate 10 XfbBuffer 1
Decorate 10 XfbStride 64
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32

View File

@@ -0,0 +1,55 @@
spv.xfb.vert
// Module Version 10000
// Generated by (magic number): 80002
// Id's are bound by 16
Capability Shader
Capability TransformFeedback
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 8 11 14 15
ExecutionMode 4 Xfb
Source GLSL 450
Name 4 "main"
Name 8 "out1"
Name 9 "outXfb"
MemberName 9(outXfb) 0 "out2"
Name 11 ""
Name 12 "outXfb2"
MemberName 12(outXfb2) 0 "out3"
Name 14 ""
Name 15 "out4"
Decorate 8(out1) Location 0
Decorate 8(out1) XfbBuffer 3
Decorate 8(out1) XfbStride 48
Decorate 8(out1) Offset 12
MemberDecorate 9(outXfb) 0 Offset 8
Decorate 9(outXfb) Block
Decorate 11 Location 1
Decorate 11 XfbBuffer 2
Decorate 11 XfbStride 32
MemberDecorate 12(outXfb2) 0 Offset 60
Decorate 12(outXfb2) Block
Decorate 14 Location 3
Decorate 14 XfbBuffer 1
Decorate 14 XfbStride 64
Decorate 15(out4) Location 4
Decorate 15(out4) XfbBuffer 0
Decorate 15(out4) XfbStride 8
Decorate 15(out4) Offset 4
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypePointer Output 6(float)
8(out1): 7(ptr) Variable Output
9(outXfb): TypeStruct 6(float)
10: TypePointer Output 9(outXfb)
11: 10(ptr) Variable Output
12(outXfb2): TypeStruct 6(float)
13: TypePointer Output 12(outXfb2)
14: 13(ptr) Variable Output
15(out4): 7(ptr) Variable Output
4(main): 2 Function None 3
5: Label
Return
FunctionEnd