Sanitize debug source location tracking for implicit branch and return

This patch tries to attach debug location of a branch/return instruction to its predecessor or the closing brace. If none could be found, no debug info should be emitted.
This commit is contained in:
Qingyuan Zheng 2024-08-26 03:53:07 +00:00 committed by arcady-lunarg
parent b1fac200c4
commit a496a34b43
30 changed files with 4713 additions and 4253 deletions

View file

@ -1,14 +1,14 @@
spv.debuginfo.multiline.glsl.frag
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 105
// Id's are bound by 109
Capability Shader
Extension "SPV_KHR_non_semantic_info"
1: ExtInstImport "NonSemantic.Shader.DebugInfo.100"
3: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 14 "main" 73 79
EntryPoint Fragment 14 "main" 75 81
ExecutionMode 14 OriginUpperLeft
2: String "spv.debuginfo.multiline.glsl.frag"
8: String "uint"
@ -50,20 +50,20 @@ void main() {
44: String "y"
47: String "z"
49: String "main"
75: String "outx"
81: String "inx"
77: String "outx"
83: String "inx"
Name 14 "main"
Name 27 "add(f1;f1;f1;"
Name 24 "x"
Name 25 "y"
Name 26 "z"
Name 73 "outx"
Name 79 "inx"
Name 97 "param"
Name 100 "param"
Name 101 "param"
Decorate 73(outx) Location 0
Decorate 79(inx) Location 0
Name 75 "outx"
Name 81 "inx"
Name 99 "param"
Name 102 "param"
Name 103 "param"
Decorate 75(outx) Location 0
Decorate 81(inx) Location 0
4: TypeVoid
5: TypeFunction 4
7: TypeInt 32 0
@ -95,47 +95,50 @@ void main() {
55: 7(int) Constant 8
58: 7(int) Constant 10
62: 7(int) Constant 12
71: TypePointer Output 16(float)
72: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 18 13 12
73(outx): 71(ptr) Variable Output
76: 7(int) Constant 17
74: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 75 18 31 76 12 33 75 73(outx) 55
77: TypePointer Input 16(float)
78: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 18 34 12
79(inx): 77(ptr) Variable Input
82: 7(int) Constant 20
80: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 81 18 31 82 12 33 81 79(inx) 55
85: 16(float) Constant 1065353216
89: 7(int) Constant 21
90: 16(float) Constant 1073741824
94: 7(int) Constant 22
95: 16(float) Constant 1077936128
99: 7(int) Constant 23
104: 7(int) Constant 18
69: 7(int) Constant 14
73: TypePointer Output 16(float)
74: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 18 13 12
75(outx): 73(ptr) Variable Output
78: 7(int) Constant 17
76: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 77 18 31 78 12 33 77 75(outx) 55
79: TypePointer Input 16(float)
80: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 18 34 12
81(inx): 79(ptr) Variable Input
84: 7(int) Constant 20
82: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 83 18 31 84 12 33 83 81(inx) 55
87: 16(float) Constant 1065353216
91: 7(int) Constant 21
92: 16(float) Constant 1073741824
96: 7(int) Constant 22
97: 16(float) Constant 1077936128
101: 7(int) Constant 23
106: 7(int) Constant 18
108: 7(int) Constant 25
14(main): 4 Function None 5
15: Label
97(param): 19(ptr) Variable Function
100(param): 19(ptr) Variable Function
101(param): 19(ptr) Variable Function
69: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 50
70: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 31 51 51 12 12
68: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101(DebugFunctionDefinition) 50 14(main)
84: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 31 82 82 12 12
83: 16(float) Load 79(inx)
86: 16(float) FAdd 83 85
88: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 31 89 89 12 12
87: 16(float) Load 79(inx)
91: 16(float) FAdd 87 90
93: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 31 94 94 12 12
92: 16(float) Load 79(inx)
96: 16(float) FAdd 92 95
98: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 31 99 99 12 12
Store 97(param) 86
Store 100(param) 91
Store 101(param) 96
102: 16(float) FunctionCall 27(add(f1;f1;f1;) 97(param) 100(param) 101(param)
103: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 31 104 104 12 12
Store 73(outx) 102
99(param): 19(ptr) Variable Function
102(param): 19(ptr) Variable Function
103(param): 19(ptr) Variable Function
71: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 50
72: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 31 51 51 12 12
70: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101(DebugFunctionDefinition) 50 14(main)
86: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 31 84 84 12 12
85: 16(float) Load 81(inx)
88: 16(float) FAdd 85 87
90: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 31 91 91 12 12
89: 16(float) Load 81(inx)
93: 16(float) FAdd 89 92
95: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 31 96 96 12 12
94: 16(float) Load 81(inx)
98: 16(float) FAdd 94 97
100: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 31 101 101 12 12
Store 99(param) 88
Store 102(param) 93
Store 103(param) 98
104: 16(float) FunctionCall 27(add(f1;f1;f1;) 99(param) 102(param) 103(param)
105: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 31 106 106 12 12
Store 75(outx) 104
107: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 31 108 108 12 12
Return
FunctionEnd
27(add(f1;f1;f1;): 16(float) Function None 22