Allow redeclaration of builtin interface blocks in mesh shader
Apart from allowing redeclaration of gl_MeshPerVertexNV and gl_MeshPerPrimitiveNV blocks, this change also - - Resize clip/cull perview distances based on static index use - Error out use of both single-view and per-view builtins - Add new gtests with redeclared blocks and edit existing test output - Fix couple of typos
This commit is contained in:
187
Test/baseResults/spv.meshShaderRedeclPerViewBuiltins.mesh.out
Normal file
187
Test/baseResults/spv.meshShaderRedeclPerViewBuiltins.mesh.out
Normal file
@@ -0,0 +1,187 @@
|
||||
spv.meshShaderRedeclPerViewBuiltins.mesh
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80007
|
||||
// Id's are bound by 120
|
||||
|
||||
Capability PerViewAttributesNV
|
||||
Capability MeshShadingNV
|
||||
Extension "SPV_NVX_multiview_per_view_attributes"
|
||||
Extension "SPV_NV_mesh_shader"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint MeshNV 4 "main" 11 20 21 35 67
|
||||
ExecutionMode 4 LocalSize 32 1 1
|
||||
ExecutionMode 4 OutputVertices 81
|
||||
ExecutionMode 4 OutputPrimitivesNV 32
|
||||
ExecutionMode 4 OutputTrianglesNV
|
||||
Source GLSL 450
|
||||
SourceExtension "GL_NV_mesh_shader"
|
||||
Name 4 "main"
|
||||
Name 8 "iid"
|
||||
Name 11 "gl_LocalInvocationID"
|
||||
Name 16 "viewID"
|
||||
Name 20 "gl_MeshViewIndicesNV"
|
||||
Name 21 "gl_MeshViewCountNV"
|
||||
Name 31 "gl_MeshPerVertexNV"
|
||||
MemberName 31(gl_MeshPerVertexNV) 0 "gl_PositionPerViewNV"
|
||||
MemberName 31(gl_MeshPerVertexNV) 1 "gl_ClipDistancePerViewNV"
|
||||
MemberName 31(gl_MeshPerVertexNV) 2 "gl_CullDistancePerViewNV"
|
||||
Name 35 "gl_MeshVerticesNV"
|
||||
Name 63 "gl_MeshPerPrimitiveNV"
|
||||
MemberName 63(gl_MeshPerPrimitiveNV) 0 "gl_LayerPerViewNV"
|
||||
MemberName 63(gl_MeshPerPrimitiveNV) 1 "gl_ViewportMaskPerViewNV"
|
||||
Name 67 "gl_MeshPrimitivesNV"
|
||||
Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId
|
||||
Decorate 20(gl_MeshViewIndicesNV) BuiltIn MeshViewIndicesNV
|
||||
Decorate 21(gl_MeshViewCountNV) BuiltIn MeshViewCountNV
|
||||
MemberDecorate 31(gl_MeshPerVertexNV) 0 PerViewNV
|
||||
MemberDecorate 31(gl_MeshPerVertexNV) 0 BuiltIn PositionPerViewNV
|
||||
MemberDecorate 31(gl_MeshPerVertexNV) 1 PerViewNV
|
||||
MemberDecorate 31(gl_MeshPerVertexNV) 1 BuiltIn ClipDistancePerViewNV
|
||||
MemberDecorate 31(gl_MeshPerVertexNV) 2 PerViewNV
|
||||
MemberDecorate 31(gl_MeshPerVertexNV) 2 BuiltIn CullDistancePerViewNV
|
||||
Decorate 31(gl_MeshPerVertexNV) Block
|
||||
MemberDecorate 63(gl_MeshPerPrimitiveNV) 0 PerPrimitiveNV
|
||||
MemberDecorate 63(gl_MeshPerPrimitiveNV) 0 PerViewNV
|
||||
MemberDecorate 63(gl_MeshPerPrimitiveNV) 0 BuiltIn LayerPerViewNV
|
||||
MemberDecorate 63(gl_MeshPerPrimitiveNV) 1 PerPrimitiveNV
|
||||
MemberDecorate 63(gl_MeshPerPrimitiveNV) 1 PerViewNV
|
||||
MemberDecorate 63(gl_MeshPerPrimitiveNV) 1 BuiltIn ViewportMaskPerViewNV
|
||||
Decorate 63(gl_MeshPerPrimitiveNV) Block
|
||||
Decorate 119 BuiltIn WorkgroupSize
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 0
|
||||
7: TypePointer Function 6(int)
|
||||
9: TypeVector 6(int) 3
|
||||
10: TypePointer Input 9(ivec3)
|
||||
11(gl_LocalInvocationID): 10(ptr) Variable Input
|
||||
12: 6(int) Constant 0
|
||||
13: TypePointer Input 6(int)
|
||||
17: 6(int) Constant 4
|
||||
18: TypeArray 6(int) 17
|
||||
19: TypePointer Input 18
|
||||
20(gl_MeshViewIndicesNV): 19(ptr) Variable Input
|
||||
21(gl_MeshViewCountNV): 13(ptr) Variable Input
|
||||
26: TypeFloat 32
|
||||
27: TypeVector 26(float) 4
|
||||
28: TypeArray 27(fvec4) 17
|
||||
29: TypeArray 26(float) 17
|
||||
30: TypeArray 29 17
|
||||
31(gl_MeshPerVertexNV): TypeStruct 28 30 30
|
||||
32: 6(int) Constant 81
|
||||
33: TypeArray 31(gl_MeshPerVertexNV) 32
|
||||
34: TypePointer Output 33
|
||||
35(gl_MeshVerticesNV): 34(ptr) Variable Output
|
||||
37: TypeInt 32 1
|
||||
38: 37(int) Constant 0
|
||||
40: 26(float) Constant 1065353216
|
||||
41: 26(float) Constant 1073741824
|
||||
42: 26(float) Constant 1077936128
|
||||
43: 26(float) Constant 1082130432
|
||||
44: 27(fvec4) ConstantComposite 40 41 42 43
|
||||
45: TypePointer Output 27(fvec4)
|
||||
48: 37(int) Constant 1
|
||||
50: 37(int) Constant 2
|
||||
51: 26(float) Constant 1084227584
|
||||
52: TypePointer Output 26(float)
|
||||
56: 37(int) Constant 3
|
||||
57: 26(float) Constant 1086324736
|
||||
59: TypeArray 37(int) 17
|
||||
60: 6(int) Constant 1
|
||||
61: TypeArray 37(int) 60
|
||||
62: TypeArray 61 17
|
||||
63(gl_MeshPerPrimitiveNV): TypeStruct 59 62
|
||||
64: 6(int) Constant 32
|
||||
65: TypeArray 63(gl_MeshPerPrimitiveNV) 64
|
||||
66: TypePointer Output 65
|
||||
67(gl_MeshPrimitivesNV): 66(ptr) Variable Output
|
||||
70: 37(int) Constant 7
|
||||
71: TypePointer Output 37(int)
|
||||
75: 37(int) Constant 8
|
||||
77: 6(int) Constant 264
|
||||
78: 6(int) Constant 2
|
||||
119: 9(ivec3) ConstantComposite 64 60 60
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
8(iid): 7(ptr) Variable Function
|
||||
16(viewID): 7(ptr) Variable Function
|
||||
14: 13(ptr) AccessChain 11(gl_LocalInvocationID) 12
|
||||
15: 6(int) Load 14
|
||||
Store 8(iid) 15
|
||||
22: 6(int) Load 21(gl_MeshViewCountNV)
|
||||
23: 6(int) UMod 22 17
|
||||
24: 13(ptr) AccessChain 20(gl_MeshViewIndicesNV) 23
|
||||
25: 6(int) Load 24
|
||||
Store 16(viewID) 25
|
||||
36: 6(int) Load 8(iid)
|
||||
39: 6(int) Load 16(viewID)
|
||||
46: 45(ptr) AccessChain 35(gl_MeshVerticesNV) 36 38 39
|
||||
Store 46 44
|
||||
47: 6(int) Load 8(iid)
|
||||
49: 6(int) Load 16(viewID)
|
||||
53: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 47 48 49 50
|
||||
Store 53 51
|
||||
54: 6(int) Load 8(iid)
|
||||
55: 6(int) Load 16(viewID)
|
||||
58: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 54 50 55 56
|
||||
Store 58 57
|
||||
68: 6(int) Load 8(iid)
|
||||
69: 6(int) Load 16(viewID)
|
||||
72: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 68 38 69
|
||||
Store 72 70
|
||||
73: 6(int) Load 8(iid)
|
||||
74: 6(int) Load 16(viewID)
|
||||
76: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 73 48 74 38
|
||||
Store 76 75
|
||||
MemoryBarrier 60 77
|
||||
ControlBarrier 78 78 77
|
||||
79: 6(int) Load 8(iid)
|
||||
80: 6(int) IAdd 79 60
|
||||
81: 6(int) Load 16(viewID)
|
||||
82: 6(int) Load 8(iid)
|
||||
83: 6(int) Load 16(viewID)
|
||||
84: 45(ptr) AccessChain 35(gl_MeshVerticesNV) 82 38 83
|
||||
85: 27(fvec4) Load 84
|
||||
86: 45(ptr) AccessChain 35(gl_MeshVerticesNV) 80 38 81
|
||||
Store 86 85
|
||||
87: 6(int) Load 8(iid)
|
||||
88: 6(int) IAdd 87 60
|
||||
89: 6(int) Load 16(viewID)
|
||||
90: 6(int) Load 8(iid)
|
||||
91: 6(int) Load 16(viewID)
|
||||
92: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 90 48 91 50
|
||||
93: 26(float) Load 92
|
||||
94: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 88 48 89 50
|
||||
Store 94 93
|
||||
95: 6(int) Load 8(iid)
|
||||
96: 6(int) IAdd 95 60
|
||||
97: 6(int) Load 16(viewID)
|
||||
98: 6(int) Load 8(iid)
|
||||
99: 6(int) Load 16(viewID)
|
||||
100: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 98 50 99 56
|
||||
101: 26(float) Load 100
|
||||
102: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 96 50 97 56
|
||||
Store 102 101
|
||||
103: 6(int) Load 8(iid)
|
||||
104: 6(int) IAdd 103 60
|
||||
105: 6(int) Load 16(viewID)
|
||||
106: 6(int) Load 8(iid)
|
||||
107: 6(int) Load 16(viewID)
|
||||
108: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 106 38 107
|
||||
109: 37(int) Load 108
|
||||
110: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 104 38 105
|
||||
Store 110 109
|
||||
111: 6(int) Load 8(iid)
|
||||
112: 6(int) IAdd 111 60
|
||||
113: 6(int) Load 16(viewID)
|
||||
114: 6(int) Load 8(iid)
|
||||
115: 6(int) Load 16(viewID)
|
||||
116: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 114 48 115 38
|
||||
117: 37(int) Load 116
|
||||
118: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 112 48 113 38
|
||||
Store 118 117
|
||||
MemoryBarrier 60 77
|
||||
ControlBarrier 78 78 77
|
||||
Return
|
||||
FunctionEnd
|
||||
Reference in New Issue
Block a user