Fix resizing of gl_PrimitiveIndicesNV[] to max_primitives*geomSize
- This change also allows redeclaration of gl_PrimitiveIndicesNV and adds error checks against incorrect explicit array size. - Also modifies gtests to check array bound limits and redeclare gl_PrimitiveIndicesNV[].
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
spv.meshShaderBuiltins.mesh
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80007
|
||||
// Id's are bound by 146
|
||||
// Id's are bound by 148
|
||||
|
||||
Capability ClipDistance
|
||||
Capability CullDistance
|
||||
@@ -14,7 +14,7 @@ spv.meshShaderBuiltins.mesh
|
||||
Extension "SPV_NV_viewport_array2"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint MeshNV 4 "main" 11 17 34 88 128 139 143
|
||||
EntryPoint MeshNV 4 "main" 11 17 34 88 129 142 146
|
||||
ExecutionMode 4 LocalSize 32 1 1
|
||||
ExecutionMode 4 OutputVertices 81
|
||||
ExecutionMode 4 OutputPrimitivesNV 32
|
||||
@@ -43,9 +43,9 @@ spv.meshShaderBuiltins.mesh
|
||||
MemberName 84(gl_MeshPerPrimitiveNV) 4 "gl_LayerPerViewNV"
|
||||
MemberName 84(gl_MeshPerPrimitiveNV) 5 "gl_ViewportMaskPerViewNV"
|
||||
Name 88 "gl_MeshPrimitivesNV"
|
||||
Name 128 "gl_PrimitiveIndicesNV"
|
||||
Name 139 "gl_DrawID"
|
||||
Name 143 "gl_PrimitiveCountNV"
|
||||
Name 129 "gl_PrimitiveIndicesNV"
|
||||
Name 142 "gl_DrawID"
|
||||
Name 146 "gl_PrimitiveCountNV"
|
||||
Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId
|
||||
Decorate 17(gl_WorkGroupID) BuiltIn WorkgroupId
|
||||
MemberDecorate 30(gl_MeshPerVertexNV) 0 BuiltIn Position
|
||||
@@ -74,10 +74,10 @@ spv.meshShaderBuiltins.mesh
|
||||
MemberDecorate 84(gl_MeshPerPrimitiveNV) 5 PerViewNV
|
||||
MemberDecorate 84(gl_MeshPerPrimitiveNV) 5 BuiltIn ViewportMaskPerViewNV
|
||||
Decorate 84(gl_MeshPerPrimitiveNV) Block
|
||||
Decorate 128(gl_PrimitiveIndicesNV) BuiltIn PrimitiveIndicesNV
|
||||
Decorate 139(gl_DrawID) BuiltIn DrawIndex
|
||||
Decorate 143(gl_PrimitiveCountNV) BuiltIn PrimitiveCountNV
|
||||
Decorate 145 BuiltIn WorkgroupSize
|
||||
Decorate 129(gl_PrimitiveIndicesNV) BuiltIn PrimitiveIndicesNV
|
||||
Decorate 142(gl_DrawID) BuiltIn DrawIndex
|
||||
Decorate 146(gl_PrimitiveCountNV) BuiltIn PrimitiveCountNV
|
||||
Decorate 147 BuiltIn WorkgroupSize
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 0
|
||||
@@ -130,17 +130,18 @@ spv.meshShaderBuiltins.mesh
|
||||
94: 36(int) Constant 7
|
||||
97: 36(int) Constant 8
|
||||
100: 36(int) Constant 9
|
||||
126: TypeArray 6(int) 31
|
||||
127: TypePointer Output 126
|
||||
128(gl_PrimitiveIndicesNV): 127(ptr) Variable Output
|
||||
129: 6(int) Constant 257
|
||||
130: TypePointer Output 6(int)
|
||||
138: TypePointer Input 36(int)
|
||||
139(gl_DrawID): 138(ptr) Variable Input
|
||||
142: 6(int) Constant 16909060
|
||||
143(gl_PrimitiveCountNV): 130(ptr) Variable Output
|
||||
144: 6(int) Constant 96
|
||||
145: 9(ivec3) ConstantComposite 85 27 27
|
||||
126: 6(int) Constant 96
|
||||
127: TypeArray 6(int) 126
|
||||
128: TypePointer Output 127
|
||||
129(gl_PrimitiveIndicesNV): 128(ptr) Variable Output
|
||||
130: 6(int) Constant 257
|
||||
131: TypePointer Output 6(int)
|
||||
133: 36(int) Constant 95
|
||||
141: TypePointer Input 36(int)
|
||||
142(gl_DrawID): 141(ptr) Variable Input
|
||||
145: 6(int) Constant 16909060
|
||||
146(gl_PrimitiveCountNV): 131(ptr) Variable Output
|
||||
147: 9(ivec3) ConstantComposite 85 27 27
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
8(iid): 7(ptr) Variable Function
|
||||
@@ -239,19 +240,21 @@ spv.meshShaderBuiltins.mesh
|
||||
Store 125 124
|
||||
MemoryBarrier 27 55
|
||||
ControlBarrier 56 56 55
|
||||
131: 130(ptr) AccessChain 128(gl_PrimitiveIndicesNV) 37
|
||||
Store 131 129
|
||||
132: 6(int) Load 16(gid)
|
||||
133: 6(int) Load 16(gid)
|
||||
134: 6(int) ISub 133 27
|
||||
135: 130(ptr) AccessChain 128(gl_PrimitiveIndicesNV) 134
|
||||
136: 6(int) Load 135
|
||||
137: 130(ptr) AccessChain 128(gl_PrimitiveIndicesNV) 132
|
||||
Store 137 136
|
||||
140: 36(int) Load 139(gl_DrawID)
|
||||
141: 6(int) Bitcast 140
|
||||
142: 141 WritePackedPrimitiveIndices4x8NV
|
||||
Store 143(gl_PrimitiveCountNV) 144
|
||||
132: 131(ptr) AccessChain 129(gl_PrimitiveIndicesNV) 37
|
||||
Store 132 130
|
||||
134: 131(ptr) AccessChain 129(gl_PrimitiveIndicesNV) 133
|
||||
Store 134 56
|
||||
135: 6(int) Load 16(gid)
|
||||
136: 6(int) Load 16(gid)
|
||||
137: 6(int) ISub 136 27
|
||||
138: 131(ptr) AccessChain 129(gl_PrimitiveIndicesNV) 137
|
||||
139: 6(int) Load 138
|
||||
140: 131(ptr) AccessChain 129(gl_PrimitiveIndicesNV) 135
|
||||
Store 140 139
|
||||
143: 36(int) Load 142(gl_DrawID)
|
||||
144: 6(int) Bitcast 143
|
||||
145: 144 WritePackedPrimitiveIndices4x8NV
|
||||
Store 146(gl_PrimitiveCountNV) 126
|
||||
MemoryBarrier 27 55
|
||||
ControlBarrier 56 56 55
|
||||
Return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
spv.meshShaderRedeclBuiltins.mesh
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80007
|
||||
// Id's are bound by 120
|
||||
// Id's are bound by 129
|
||||
|
||||
Capability ClipDistance
|
||||
Capability CullDistance
|
||||
@@ -12,7 +12,7 @@ spv.meshShaderRedeclBuiltins.mesh
|
||||
Extension "SPV_NV_viewport_array2"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint MeshNV 4 "main" 11 17 28 81
|
||||
EntryPoint MeshNV 4 "main" 11 17 28 81 122 127
|
||||
ExecutionMode 4 LocalSize 32 1 1
|
||||
ExecutionMode 4 OutputVertices 81
|
||||
ExecutionMode 4 OutputPrimitivesNV 32
|
||||
@@ -36,6 +36,8 @@ spv.meshShaderRedeclBuiltins.mesh
|
||||
MemberName 77(gl_MeshPerPrimitiveNV) 2 "gl_ViewportIndex"
|
||||
MemberName 77(gl_MeshPerPrimitiveNV) 3 "gl_ViewportMask"
|
||||
Name 81 "gl_MeshPrimitivesNV"
|
||||
Name 122 "gl_PrimitiveIndicesNV"
|
||||
Name 127 "gl_PrimitiveCountNV"
|
||||
Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId
|
||||
Decorate 17(gl_WorkGroupID) BuiltIn WorkgroupId
|
||||
MemberDecorate 24(gl_MeshPerVertexNV) 0 BuiltIn Position
|
||||
@@ -52,7 +54,9 @@ spv.meshShaderRedeclBuiltins.mesh
|
||||
MemberDecorate 77(gl_MeshPerPrimitiveNV) 3 PerPrimitiveNV
|
||||
MemberDecorate 77(gl_MeshPerPrimitiveNV) 3 BuiltIn ViewportMaskNV
|
||||
Decorate 77(gl_MeshPerPrimitiveNV) Block
|
||||
Decorate 119 BuiltIn WorkgroupSize
|
||||
Decorate 122(gl_PrimitiveIndicesNV) BuiltIn PrimitiveIndicesNV
|
||||
Decorate 127(gl_PrimitiveCountNV) BuiltIn PrimitiveCountNV
|
||||
Decorate 128 BuiltIn WorkgroupSize
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 0
|
||||
@@ -98,7 +102,14 @@ spv.meshShaderRedeclBuiltins.mesh
|
||||
87: 30(int) Constant 7
|
||||
90: 30(int) Constant 8
|
||||
93: 30(int) Constant 9
|
||||
119: 9(ivec3) ConstantComposite 78 49 49
|
||||
119: 6(int) Constant 96
|
||||
120: TypeArray 6(int) 119
|
||||
121: TypePointer Output 120
|
||||
122(gl_PrimitiveIndicesNV): 121(ptr) Variable Output
|
||||
123: TypePointer Output 6(int)
|
||||
125: 30(int) Constant 95
|
||||
127(gl_PrimitiveCountNV): 123(ptr) Variable Output
|
||||
128: 9(ivec3) ConstantComposite 78 49 49
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
8(iid): 7(ptr) Variable Function
|
||||
@@ -197,5 +208,10 @@ spv.meshShaderRedeclBuiltins.mesh
|
||||
Store 118 117
|
||||
MemoryBarrier 49 50
|
||||
ControlBarrier 51 51 50
|
||||
124: 123(ptr) AccessChain 122(gl_PrimitiveIndicesNV) 31
|
||||
Store 124 49
|
||||
126: 123(ptr) AccessChain 122(gl_PrimitiveIndicesNV) 125
|
||||
Store 126 51
|
||||
Store 127(gl_PrimitiveCountNV) 119
|
||||
Return
|
||||
FunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user