GLSL: Make gl_Layer and gl_ViewportIndex always be outside blocks.

There was some ambiguity/contradiction in this behavior, and
Khronos decided glslang should always have these outside blocks,
rather than have stage/vendor/target variations.
This commit is contained in:
John Kessenich
2017-09-13 13:22:50 -06:00
parent aab3bcffea
commit ba6a3c290e
7 changed files with 104 additions and 115 deletions

View File

@@ -3,6 +3,7 @@ spv.viewportArray2.tesc
// Generated by (magic number): 80001
// Id's are bound by 25
Capability Geometry
Capability Tessellation
Capability MultiViewport
Capability ShaderViewportIndexLayerNV
@@ -11,47 +12,47 @@ spv.viewportArray2.tesc
Extension "SPV_NV_viewport_array2"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint TessellationControl 4 "main" 14 16
EntryPoint TessellationControl 4 "main" 14 16 22 24
ExecutionMode 4 OutputVertices 4
Source GLSL 450
SourceExtension "GL_NV_viewport_array2"
Name 4 "main"
Name 10 "gl_PerVertex"
MemberName 10(gl_PerVertex) 0 "gl_ViewportIndex"
MemberName 10(gl_PerVertex) 1 "gl_Layer"
MemberName 10(gl_PerVertex) 2 "gl_ViewportMask"
MemberName 10(gl_PerVertex) 0 "gl_ViewportMask"
Name 14 "gl_out"
Name 16 "gl_InvocationID"
MemberDecorate 10(gl_PerVertex) 0 BuiltIn ViewportIndex
MemberDecorate 10(gl_PerVertex) 1 BuiltIn Layer
MemberDecorate 10(gl_PerVertex) 1 ViewportRelativeNV
MemberDecorate 10(gl_PerVertex) 2 BuiltIn ViewportMaskNV
Name 22 "gl_ViewportIndex"
Name 24 "gl_Layer"
MemberDecorate 10(gl_PerVertex) 0 BuiltIn ViewportMaskNV
Decorate 10(gl_PerVertex) Block
Decorate 16(gl_InvocationID) BuiltIn InvocationId
Decorate 22(gl_ViewportIndex) BuiltIn ViewportIndex
Decorate 24(gl_Layer) BuiltIn Layer
Decorate 24(gl_Layer) ViewportRelativeNV
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypeInt 32 0
8: 7(int) Constant 2
9: TypeArray 6(int) 8
10(gl_PerVertex): TypeStruct 6(int) 6(int) 9
10(gl_PerVertex): TypeStruct 9
11: 7(int) Constant 4
12: TypeArray 10(gl_PerVertex) 11
13: TypePointer Output 12
14(gl_out): 13(ptr) Variable Output
15: TypePointer Input 6(int)
16(gl_InvocationID): 15(ptr) Variable Input
18: 6(int) Constant 2
19: 6(int) Constant 0
20: 6(int) Constant 1
21: TypePointer Output 6(int)
18: 6(int) Constant 0
19: 6(int) Constant 1
20: TypePointer Output 6(int)
22(gl_ViewportIndex): 20(ptr) Variable Output
23: 6(int) Constant 2
24(gl_Layer): 20(ptr) Variable Output
4(main): 2 Function None 3
5: Label
17: 6(int) Load 16(gl_InvocationID)
22: 21(ptr) AccessChain 14(gl_out) 17 18 19
Store 22 20
23: 6(int) Load 16(gl_InvocationID)
24: 21(ptr) AccessChain 14(gl_out) 23 19
Store 24 18
21: 20(ptr) AccessChain 14(gl_out) 17 18 18
Store 21 19
Store 22(gl_ViewportIndex) 23
Return
FunctionEnd