Fix debug info file and source strings

The file and source text was not being set correctly in the test output.
This change makes the test fixture consistent with the command line
behavior, "-gVS", which was my original intent when I added these tests.
This commit is contained in:
Jeremy Hayes 2023-10-24 13:07:31 -06:00 committed by arcady-lunarg
parent b0df68c490
commit bf08e1db5c
12 changed files with 2155 additions and 1268 deletions

View file

@ -1,15 +1,15 @@
spv.debuginfo.glsl.vert
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 444
// Id's are bound by 445
Capability Shader
Extension "SPV_KHR_non_semantic_info"
1: ExtInstImport "NonSemantic.Shader.DebugInfo.100"
3: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 14 "main" 35 42 47 55 65 83 305 323 328 353 370 389 427 436
2: String ""
EntryPoint Vertex 14 "main" 35 42 47 55 65 83 305 323 328 353 371 390 428 437
2: String "spv.debuginfo.glsl.vert"
8: String "uint"
16: String "main"
19: String "// OpModuleProcessed auto-map-locations
@ -19,6 +19,111 @@ spv.debuginfo.glsl.vert
// OpModuleProcessed keep-uncalled
// OpModuleProcessed entry-point main
#line 1
/*
The MIT License (MIT)
Copyright (c) 2022 Sascha Willems
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#version 450
// Vertex attributes
layout (location = 0) in vec3 inPos;
layout (location = 1) in vec3 inNormal;
layout (location = 2) in vec2 inUV;
layout (location = 3) in vec3 inColor;
// Instanced attributes
layout (location = 4) in vec3 instancePos;
layout (location = 5) in vec3 instanceRot;
layout (location = 6) in float instanceScale;
layout (location = 7) in int instanceTexIndex;
layout (binding = 0) uniform UBO
{
mat4 projection;
mat4 modelview;
vec4 lightPos;
float locSpeed;
float globSpeed;
} ubo;
layout (location = 0) out vec3 outNormal;
layout (location = 1) out vec3 outColor;
layout (location = 2) out vec3 outUV;
layout (location = 3) out vec3 outViewVec;
layout (location = 4) out vec3 outLightVec;
void main()
{
outColor = inColor;
outUV = vec3(inUV, instanceTexIndex);
mat3 mx, my, mz;
// rotate around x
float s = sin(instanceRot.x + ubo.locSpeed);
float c = cos(instanceRot.x + ubo.locSpeed);
mx[0] = vec3(c, s, 0.0);
mx[1] = vec3(-s, c, 0.0);
mx[2] = vec3(0.0, 0.0, 1.0);
// rotate around y
s = sin(instanceRot.y + ubo.locSpeed);
c = cos(instanceRot.y + ubo.locSpeed);
my[0] = vec3(c, 0.0, s);
my[1] = vec3(0.0, 1.0, 0.0);
my[2] = vec3(-s, 0.0, c);
// rot around z
s = sin(instanceRot.z + ubo.locSpeed);
c = cos(instanceRot.z + ubo.locSpeed);
mz[0] = vec3(1.0, 0.0, 0.0);
mz[1] = vec3(0.0, c, s);
mz[2] = vec3(0.0, -s, c);
mat3 rotMat = mz * my * mx;
mat4 gRotMat;
s = sin(instanceRot.y + ubo.globSpeed);
c = cos(instanceRot.y + ubo.globSpeed);
gRotMat[0] = vec4(c, 0.0, s, 0.0);
gRotMat[1] = vec4(0.0, 1.0, 0.0, 0.0);
gRotMat[2] = vec4(-s, 0.0, c, 0.0);
gRotMat[3] = vec4(0.0, 0.0, 0.0, 1.0);
vec4 locPos = vec4(inPos.xyz * rotMat, 1.0);
vec4 pos = vec4((locPos.xyz * instanceScale) + instancePos, 1.0);
gl_Position = ubo.projection * ubo.modelview * gRotMat * pos;
outNormal = mat3(ubo.modelview * gRotMat) * inverse(rotMat) * inNormal;
pos = ubo.modelview * vec4(inPos.xyz + instancePos, 1.0);
vec3 lPos = mat3(ubo.modelview) * ubo.lightPos.xyz;
outLightVec = lPos - pos.xyz;
outViewVec = -pos.xyz;
}
"
29: String "float"
37: String "outColor"
@ -50,11 +155,12 @@ spv.debuginfo.glsl.vert
344: String "gl_PointSize"
346: String "gl_CullDistance"
349: String "gl_PerVertex"
372: String "outNormal"
391: String "inNormal"
408: String "lPos"
429: String "outLightVec"
438: String "outViewVec"
355: String ""
373: String "outNormal"
392: String "inNormal"
409: String "lPos"
430: String "outLightVec"
439: String "outViewVec"
Name 14 "main"
Name 35 "outColor"
Name 42 "inColor"
@ -87,11 +193,11 @@ spv.debuginfo.glsl.vert
MemberName 339(gl_PerVertex) 2 "gl_ClipDistance"
MemberName 339(gl_PerVertex) 3 "gl_CullDistance"
Name 353 ""
Name 370 "outNormal"
Name 389 "inNormal"
Name 406 "lPos"
Name 427 "outLightVec"
Name 436 "outViewVec"
Name 371 "outNormal"
Name 390 "inNormal"
Name 407 "lPos"
Name 428 "outLightVec"
Name 437 "outViewVec"
Decorate 35(outColor) Location 1
Decorate 42(inColor) Location 3
Decorate 47(outUV) Location 2
@ -118,10 +224,10 @@ spv.debuginfo.glsl.vert
MemberDecorate 339(gl_PerVertex) 2 BuiltIn ClipDistance
MemberDecorate 339(gl_PerVertex) 3 BuiltIn CullDistance
Decorate 339(gl_PerVertex) Block
Decorate 370(outNormal) Location 0
Decorate 389(inNormal) Location 1
Decorate 427(outLightVec) Location 4
Decorate 436(outViewVec) Location 3
Decorate 371(outNormal) Location 0
Decorate 390(inNormal) Location 1
Decorate 428(outLightVec) Location 4
Decorate 437(outViewVec) Location 3
4: TypeVoid
5: TypeFunction 4
7: TypeInt 32 0
@ -272,27 +378,27 @@ spv.debuginfo.glsl.vert
351: TypePointer Output 339(gl_PerVertex)
352: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 348 13 12
353: 351(ptr) Variable Output
354: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 2 348 18 350 12 21 2 353 39
355: TypePointer Uniform 92
356: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 93 24 12
367: TypePointer Output 90(fvec4)
368: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 91 13 12
370(outNormal): 33(ptr) Variable Output
373: 7(int) Constant 99
371: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 372 32 18 373 12 21 372 370(outNormal) 39
389(inNormal): 40(ptr) Variable Input
390: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 391 32 18 373 12 21 391 389(inNormal) 39
396: 7(int) Constant 101
409: 7(int) Constant 102
407: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(DebugLocalVariable) 408 32 18 409 12 17 23
421: TypePointer Uniform 90(fvec4)
422: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 91 24 12
427(outLightVec): 33(ptr) Variable Output
430: 7(int) Constant 103
428: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 429 32 18 430 12 21 429 427(outLightVec) 39
436(outViewVec): 33(ptr) Variable Output
439: 7(int) Constant 104
437: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 438 32 18 439 12 21 438 436(outViewVec) 39
354: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 355 348 18 350 12 21 355 353 39
356: TypePointer Uniform 92
357: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 93 24 12
368: TypePointer Output 90(fvec4)
369: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 91 13 12
371(outNormal): 33(ptr) Variable Output
374: 7(int) Constant 99
372: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 373 32 18 374 12 21 373 371(outNormal) 39
390(inNormal): 40(ptr) Variable Input
391: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 392 32 18 374 12 21 392 390(inNormal) 39
397: 7(int) Constant 101
410: 7(int) Constant 102
408: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(DebugLocalVariable) 409 32 18 410 12 17 23
422: TypePointer Uniform 90(fvec4)
423: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 91 24 12
428(outLightVec): 33(ptr) Variable Output
431: 7(int) Constant 103
429: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 430 32 18 431 12 21 430 428(outLightVec) 39
437(outViewVec): 33(ptr) Variable Output
440: 7(int) Constant 104
438: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 439 32 18 440 12 21 439 437(outViewVec) 39
14(main): 4 Function None 5
15: Label
76(s): 73(ptr) Variable Function
@ -304,7 +410,7 @@ spv.debuginfo.glsl.vert
272(gRotMat): 270(ptr) Variable Function
299(locPos): 281(ptr) Variable Function
315(pos): 281(ptr) Variable Function
406(lPos): 151(ptr) Variable Function
407(lPos): 151(ptr) Variable Function
26: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 17
27: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 20 20 12 12
25: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101(DebugFunctionDefinition) 17 14(main)
@ -487,74 +593,74 @@ spv.debuginfo.glsl.vert
335: 28(float) CompositeExtract 332 2
336: 90(fvec4) CompositeConstruct 333 334 335 163
Store 315(pos) 336
358: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 350 350 12 12
357: 355(ptr) AccessChain 114(ubo) 146
359: 92 Load 357
360: 355(ptr) AccessChain 114(ubo) 154
361: 92 Load 360
362: 92 MatrixTimesMatrix 359 361
363: 92 Load 272(gRotMat)
364: 92 MatrixTimesMatrix 362 363
365: 90(fvec4) Load 315(pos)
366: 90(fvec4) MatrixTimesVector 364 365
369: 367(ptr) AccessChain 353 146
Store 369 366
375: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 373 373 12 12
374: 355(ptr) AccessChain 114(ubo) 154
376: 92 Load 374
377: 92 Load 272(gRotMat)
378: 92 MatrixTimesMatrix 376 377
379: 90(fvec4) CompositeExtract 378 0
380: 31(fvec3) VectorShuffle 379 379 0 1 2
381: 90(fvec4) CompositeExtract 378 1
382: 31(fvec3) VectorShuffle 381 381 0 1 2
383: 90(fvec4) CompositeExtract 378 2
384: 31(fvec3) VectorShuffle 383 383 0 1 2
385: 136 CompositeConstruct 380 382 384
386: 136 Load 242(rotMat)
387: 136 ExtInst 3(GLSL.std.450) 34(MatrixInverse) 386
388: 136 MatrixTimesMatrix 385 387
392: 31(fvec3) Load 389(inNormal)
393: 31(fvec3) MatrixTimesVector 388 392
Store 370(outNormal) 393
395: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 396 396 12 12
394: 355(ptr) AccessChain 114(ubo) 154
397: 92 Load 394
398: 31(fvec3) Load 305(inPos)
399: 31(fvec3) Load 328(instancePos)
400: 31(fvec3) FAdd 398 399
401: 28(float) CompositeExtract 400 0
402: 28(float) CompositeExtract 400 1
403: 28(float) CompositeExtract 400 2
404: 90(fvec4) CompositeConstruct 401 402 403 163
405: 90(fvec4) MatrixTimesVector 397 404
Store 315(pos) 405
411: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 409 409 12 12
410: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(DebugDeclare) 407 406(lPos) 81
412: 355(ptr) AccessChain 114(ubo) 154
413: 92 Load 412
414: 90(fvec4) CompositeExtract 413 0
415: 31(fvec3) VectorShuffle 414 414 0 1 2
416: 90(fvec4) CompositeExtract 413 1
417: 31(fvec3) VectorShuffle 416 416 0 1 2
418: 90(fvec4) CompositeExtract 413 2
419: 31(fvec3) VectorShuffle 418 418 0 1 2
420: 136 CompositeConstruct 415 417 419
423: 421(ptr) AccessChain 114(ubo) 162
424: 90(fvec4) Load 423
425: 31(fvec3) VectorShuffle 424 424 0 1 2
426: 31(fvec3) MatrixTimesVector 420 425
Store 406(lPos) 426
432: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 430 430 12 12
431: 31(fvec3) Load 406(lPos)
433: 90(fvec4) Load 315(pos)
434: 31(fvec3) VectorShuffle 433 433 0 1 2
435: 31(fvec3) FSub 431 434
Store 427(outLightVec) 435
441: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 439 439 12 12
440: 90(fvec4) Load 315(pos)
442: 31(fvec3) VectorShuffle 440 440 0 1 2
443: 31(fvec3) FNegate 442
Store 436(outViewVec) 443
359: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 350 350 12 12
358: 356(ptr) AccessChain 114(ubo) 146
360: 92 Load 358
361: 356(ptr) AccessChain 114(ubo) 154
362: 92 Load 361
363: 92 MatrixTimesMatrix 360 362
364: 92 Load 272(gRotMat)
365: 92 MatrixTimesMatrix 363 364
366: 90(fvec4) Load 315(pos)
367: 90(fvec4) MatrixTimesVector 365 366
370: 368(ptr) AccessChain 353 146
Store 370 367
376: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 374 374 12 12
375: 356(ptr) AccessChain 114(ubo) 154
377: 92 Load 375
378: 92 Load 272(gRotMat)
379: 92 MatrixTimesMatrix 377 378
380: 90(fvec4) CompositeExtract 379 0
381: 31(fvec3) VectorShuffle 380 380 0 1 2
382: 90(fvec4) CompositeExtract 379 1
383: 31(fvec3) VectorShuffle 382 382 0 1 2
384: 90(fvec4) CompositeExtract 379 2
385: 31(fvec3) VectorShuffle 384 384 0 1 2
386: 136 CompositeConstruct 381 383 385
387: 136 Load 242(rotMat)
388: 136 ExtInst 3(GLSL.std.450) 34(MatrixInverse) 387
389: 136 MatrixTimesMatrix 386 388
393: 31(fvec3) Load 390(inNormal)
394: 31(fvec3) MatrixTimesVector 389 393
Store 371(outNormal) 394
396: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 397 397 12 12
395: 356(ptr) AccessChain 114(ubo) 154
398: 92 Load 395
399: 31(fvec3) Load 305(inPos)
400: 31(fvec3) Load 328(instancePos)
401: 31(fvec3) FAdd 399 400
402: 28(float) CompositeExtract 401 0
403: 28(float) CompositeExtract 401 1
404: 28(float) CompositeExtract 401 2
405: 90(fvec4) CompositeConstruct 402 403 404 163
406: 90(fvec4) MatrixTimesVector 398 405
Store 315(pos) 406
412: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 410 410 12 12
411: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(DebugDeclare) 408 407(lPos) 81
413: 356(ptr) AccessChain 114(ubo) 154
414: 92 Load 413
415: 90(fvec4) CompositeExtract 414 0
416: 31(fvec3) VectorShuffle 415 415 0 1 2
417: 90(fvec4) CompositeExtract 414 1
418: 31(fvec3) VectorShuffle 417 417 0 1 2
419: 90(fvec4) CompositeExtract 414 2
420: 31(fvec3) VectorShuffle 419 419 0 1 2
421: 136 CompositeConstruct 416 418 420
424: 422(ptr) AccessChain 114(ubo) 162
425: 90(fvec4) Load 424
426: 31(fvec3) VectorShuffle 425 425 0 1 2
427: 31(fvec3) MatrixTimesVector 421 426
Store 407(lPos) 427
433: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 431 431 12 12
432: 31(fvec3) Load 407(lPos)
434: 90(fvec4) Load 315(pos)
435: 31(fvec3) VectorShuffle 434 434 0 1 2
436: 31(fvec3) FSub 432 435
Store 428(outLightVec) 436
442: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 440 440 12 12
441: 90(fvec4) Load 315(pos)
443: 31(fvec3) VectorShuffle 441 441 0 1 2
444: 31(fvec3) FNegate 443
Store 437(outViewVec) 444
Return
FunctionEnd