Use DebugDeclare for local variables

Previously we had decided to issue DebugValue directly in glslang.
However, this was incorrect and causing issues with RenderDoc.
This commit is contained in:
Jeremy Hayes 2022-09-23 09:17:44 -06:00
parent c0cf8ad876
commit ee442785dd
13 changed files with 5235 additions and 5347 deletions

View file

@ -2,7 +2,7 @@ spv.debuginfo.glsl.geom
Validation failed
// Module Version 10000
// Generated by (magic number): 8000a
// Id's are bound by 232
// Id's are bound by 231
Capability Geometry
Capability MultiViewport
@ -10,7 +10,7 @@ Validation failed
1: ExtInstImport "NonSemantic.Shader.DebugInfo.100"
2: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Geometry 13 "main" 52 85 104 112 116 145 181 189 206 216 221 225
EntryPoint Geometry 13 "main" 52 85 104 112 116 146 181 189 206 216 221 225
ExecutionMode 13 Triangles
ExecutionMode 13 Invocations 2
ExecutionMode 13 OutputTriangleStrip
@ -33,11 +33,11 @@ Validation failed
114: String "outColor"
118: String "inColor"
125: String "pos"
131: String "gl_Position"
134: String "gl_PointSize"
137: String "gl_CullDistance"
141: String "gl_PerVertex"
147: String "gl_in"
132: String "gl_Position"
135: String "gl_PointSize"
138: String "gl_CullDistance"
142: String "gl_PerVertex"
148: String "gl_in"
155: String "worldPos"
166: String "lPos"
183: String "outLightVec"
@ -59,12 +59,12 @@ Validation failed
Name 112 "outColor"
Name 116 "inColor"
Name 123 "pos"
Name 129 "gl_PerVertex"
MemberName 129(gl_PerVertex) 0 "gl_Position"
MemberName 129(gl_PerVertex) 1 "gl_PointSize"
MemberName 129(gl_PerVertex) 2 "gl_ClipDistance"
MemberName 129(gl_PerVertex) 3 "gl_CullDistance"
Name 145 "gl_in"
Name 130 "gl_PerVertex"
MemberName 130(gl_PerVertex) 0 "gl_Position"
MemberName 130(gl_PerVertex) 1 "gl_PointSize"
MemberName 130(gl_PerVertex) 2 "gl_ClipDistance"
MemberName 130(gl_PerVertex) 3 "gl_CullDistance"
Name 146 "gl_in"
Name 153 "worldPos"
Name 164 "lPos"
Name 181 "outLightVec"
@ -95,11 +95,11 @@ Validation failed
Decorate 104(inNormal) Location 0
Decorate 112(outColor) Location 1
Decorate 116(inColor) Location 1
MemberDecorate 129(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 129(gl_PerVertex) 1 BuiltIn PointSize
MemberDecorate 129(gl_PerVertex) 2 BuiltIn ClipDistance
MemberDecorate 129(gl_PerVertex) 3 BuiltIn CullDistance
Decorate 129(gl_PerVertex) Block
MemberDecorate 130(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 130(gl_PerVertex) 1 BuiltIn PointSize
MemberDecorate 130(gl_PerVertex) 2 BuiltIn ClipDistance
MemberDecorate 130(gl_PerVertex) 3 BuiltIn CullDistance
Decorate 130(gl_PerVertex) Block
Decorate 181(outLightVec) Location 3
Decorate 189(outViewVec) Location 2
MemberDecorate 196(gl_PerVertex) 0 BuiltIn Position
@ -130,8 +130,8 @@ Validation failed
27: TypePointer Function 24(int)
31: 6(int) Constant 49
29: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 30 26 16 31 11 15 20
32: 24(int) Constant 0
34: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt)
33: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt)
34: 24(int) Constant 0
41: 24(int) Constant 3
42: TypeBool
44: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 43 9 21 11
@ -186,45 +186,45 @@ Validation failed
122: TypePointer Function 57(fvec4)
126: 6(int) Constant 54
124: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 125 58 16 126 11 15 20
127: TypeArray 46(float) 19
128: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 48 19
129(gl_PerVertex): TypeStruct 57(fvec4) 46(float) 127 127
132: 6(int) Constant 23
130: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 131 58 16 21 132 11 11 12
135: 6(int) Constant 41
133: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 134 48 16 21 135 11 11 12
138: 6(int) Constant 84
136: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 137 128 16 21 138 11 11 12
139: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 137 128 16 21 138 11 11 12
140: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 141 19 16 126 11 18 141 11 12 130 133 136 139
142: TypeArray 129(gl_PerVertex) 12
143: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 140 12
144: TypePointer Input 142
145(gl_in): 144(ptr) Variable Input
146: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 147 143 16 126 11 18 147 145(gl_in) 56
149: TypePointer Input 57(fvec4)
128: TypeArray 46(float) 19
129: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 48 19
130(gl_PerVertex): TypeStruct 57(fvec4) 46(float) 128 128
133: 6(int) Constant 23
131: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 132 58 16 21 133 11 11 12
136: 6(int) Constant 41
134: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 135 48 16 21 136 11 11 12
139: 6(int) Constant 84
137: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 138 129 16 21 139 11 11 12
140: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 138 129 16 21 139 11 11 12
141: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 142 19 16 126 11 18 142 11 12 131 134 137 140
143: TypeArray 130(gl_PerVertex) 12
144: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 141 12
145: TypePointer Input 143
146(gl_in): 145(ptr) Variable Input
147: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 148 144 16 126 11 18 148 146(gl_in) 56
150: TypePointer Input 57(fvec4)
156: 6(int) Constant 55
154: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 155 58 16 156 11 15 20
163: TypePointer Function 49(fvec3)
167: 6(int) Constant 57
165: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 166 50 16 167 11 15 20
171: 24(int) Constant 2
172: TypePointer Uniform 57(fvec4)
172: 24(int) Constant 2
173: TypePointer Uniform 57(fvec4)
181(outLightVec): 51(ptr) Variable Output
184: 6(int) Constant 58
182: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 183 50 16 184 11 18 183 181(outLightVec) 56
189(outViewVec): 51(ptr) Variable Output
192: 6(int) Constant 59
190: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 191 50 16 192 11 18 191 189(outViewVec) 56
196(gl_PerVertex): TypeStruct 57(fvec4) 46(float) 127 127
196(gl_PerVertex): TypeStruct 57(fvec4) 46(float) 128 128
198: 6(int) Constant 215
197: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 131 58 16 21 198 11 11 12
197: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 132 58 16 21 198 11 11 12
200: 6(int) Constant 233
199: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 134 48 16 21 200 11 11 12
201: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 137 128 16 12 70 11 11 12
202: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 137 128 16 12 70 11 11 12
199: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 135 48 16 21 200 11 11 12
201: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 138 129 16 12 70 11 11 12
202: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 138 129 16 12 70 11 11 12
204: 6(int) Constant 61
203: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 141 19 16 204 11 18 141 11 12 197 199 201 202
203: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 142 19 16 204 11 18 142 11 12 197 199 201 202
205: TypePointer Output 196(gl_PerVertex)
206: 205(ptr) Variable Output
207: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 17 203 16 204 11 18 17 206 56
@ -245,8 +245,8 @@ Validation failed
153(worldPos): 122(ptr) Variable Function
164(lPos): 163(ptr) Variable Function
23: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 15 13(main)
Store 28(i) 32
33: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 29 32 34
32: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 29 28(i) 33
Store 28(i) 34
Branch 35
35: Label
LoopMerge 37 38 None
@ -275,30 +275,30 @@ Validation failed
120: 108(ptr) AccessChain 116(inColor) 119
121: 49(fvec3) Load 120
Store 112(outColor) 121
148: 24(int) Load 28(i)
150: 149(ptr) AccessChain 145(gl_in) 148 32
151: 57(fvec4) Load 150
Store 123(pos) 151
152: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 124 151 34
157: 24(int) Load 85(gl_InvocationID)
158: 89(ptr) AccessChain 80(ubo) 83 157
159: 59 Load 158
160: 57(fvec4) Load 123(pos)
161: 57(fvec4) MatrixTimesVector 159 160
Store 153(worldPos) 161
162: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 154 161 34
168: 24(int) Load 85(gl_InvocationID)
169: 89(ptr) AccessChain 80(ubo) 83 168
170: 59 Load 169
173: 172(ptr) AccessChain 80(ubo) 171
174: 57(fvec4) Load 173
175: 57(fvec4) MatrixTimesVector 170 174
176: 46(float) CompositeExtract 175 0
177: 46(float) CompositeExtract 175 1
178: 46(float) CompositeExtract 175 2
179: 49(fvec3) CompositeConstruct 176 177 178
Store 164(lPos) 179
180: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 165 179 34
127: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 124 123(pos) 33
149: 24(int) Load 28(i)
151: 150(ptr) AccessChain 146(gl_in) 149 34
152: 57(fvec4) Load 151
Store 123(pos) 152
157: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 154 153(worldPos) 33
158: 24(int) Load 85(gl_InvocationID)
159: 89(ptr) AccessChain 80(ubo) 83 158
160: 59 Load 159
161: 57(fvec4) Load 123(pos)
162: 57(fvec4) MatrixTimesVector 160 161
Store 153(worldPos) 162
168: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 165 164(lPos) 33
169: 24(int) Load 85(gl_InvocationID)
170: 89(ptr) AccessChain 80(ubo) 83 169
171: 59 Load 170
174: 173(ptr) AccessChain 80(ubo) 172
175: 57(fvec4) Load 174
176: 57(fvec4) MatrixTimesVector 171 175
177: 46(float) CompositeExtract 176 0
178: 46(float) CompositeExtract 176 1
179: 46(float) CompositeExtract 176 2
180: 49(fvec3) CompositeConstruct 177 178 179
Store 164(lPos) 180
185: 49(fvec3) Load 164(lPos)
186: 57(fvec4) Load 153(worldPos)
187: 49(fvec3) VectorShuffle 186 186 0 1 2
@ -309,11 +309,11 @@ Validation failed
195: 49(fvec3) FNegate 194
Store 189(outViewVec) 195
208: 24(int) Load 85(gl_InvocationID)
209: 89(ptr) AccessChain 80(ubo) 32 208
209: 89(ptr) AccessChain 80(ubo) 34 208
210: 59 Load 209
211: 57(fvec4) Load 153(worldPos)
212: 57(fvec4) MatrixTimesVector 210 211
214: 213(ptr) AccessChain 206 32
214: 213(ptr) AccessChain 206 34
Store 214 212
220: 24(int) Load 85(gl_InvocationID)
Store 216(gl_ViewportIndex) 220
@ -325,7 +325,6 @@ Validation failed
229: 24(int) Load 28(i)
230: 24(int) IAdd 229 83
Store 28(i) 230
231: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 29 230 34
Branch 35
37: Label
EndPrimitive