Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions SPIRV/GlslangToSpv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6028,6 +6028,19 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy
}
}
debugInfo.debugTypeOverride = builder.getDebugType(typeId);
} else if (glslangMember.type->getQualifier().builtIn != glslang::EbvNone) {
// TODO - The built-in currently are not provide the correct line/column and spirv-val will validate these when using shaderDebugInfo
//
// There is a larger issue because even defining the builtIn such as
//
// out gl_PerVertex {
// vec4 gl_Position;
// };
//
// in the shader also doesn't produce the correct line/column
// So for now, provide zero, as that is a valid value here
debugInfo.line = 0;
debugInfo.column = 0;
}

memberDebugInfo.push_back(debugInfo);
Expand Down
68 changes: 32 additions & 36 deletions Test/baseResults/spv.debuginfo.continued.glsl.vert.out
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
spv.debuginfo.continued.glsl.vert
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 73
// Id's are bound by 69

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" 57
EntryPoint Vertex 14 "main" 53
2: String "spv.debuginfo.continued.glsl.vert"
8: String "uint"
16: String "main"
Expand Down Expand Up @@ -3796,19 +3796,19 @@ void main()
"
33: String "float"
41: String "gl_Position"
44: String "gl_PointSize"
47: String "gl_ClipDistance"
50: String "gl_CullDistance"
53: String "gl_PerVertex"
59: String ""
62: String "int"
43: String "gl_PointSize"
45: String "gl_ClipDistance"
47: String "gl_CullDistance"
49: String "gl_PerVertex"
55: String ""
58: String "int"
Name 14 "main"
Name 39 "gl_PerVertex"
MemberName 39(gl_PerVertex) 0 "gl_Position"
MemberName 39(gl_PerVertex) 1 "gl_PointSize"
MemberName 39(gl_PerVertex) 2 "gl_ClipDistance"
MemberName 39(gl_PerVertex) 3 "gl_CullDistance"
Name 57 ""
Name 53 ""
Decorate 39(gl_PerVertex) Block
MemberDecorate 39(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 39(gl_PerVertex) 1 BuiltIn PointSize
Expand Down Expand Up @@ -3839,37 +3839,33 @@ void main()
37: TypeArray 32(float) 26
38: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(DebugTypeArray) 34 26
39(gl_PerVertex): TypeStruct 35(fvec4) 32(float) 37 37
42: 7(int) Constant 24
40: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(DebugTypeMember) 41 36 18 26 42 12 12 13
45: 7(int) Constant 42
43: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(DebugTypeMember) 44 34 18 26 45 12 12 13
48: 7(int) Constant 61
46: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(DebugTypeMember) 47 38 18 26 48 12 12 13
51: 7(int) Constant 85
49: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(DebugTypeMember) 50 38 18 26 51 12 12 13
54: 7(int) Constant 3778
52: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(DebugTypeComposite) 53 26 18 54 12 25 53 12 13 40 43 46 49
55: TypePointer Output 39(gl_PerVertex)
56: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 52 13 12
57: 55(ptr) Variable Output
60: 7(int) Constant 8
58: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 59 52 18 54 12 25 59 57 60
61: TypeInt 32 1
63: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(DebugTypeBasic) 62 10 27 12
64: 61(int) Constant 0
65: 32(float) Constant 1065353216
66: 35(fvec4) ConstantComposite 65 65 65 65
67: TypePointer Output 35(fvec4)
68: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 36 13 12
72: 7(int) Constant 3779
40: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(DebugTypeMember) 41 36 18 12 12 12 12 13
42: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(DebugTypeMember) 43 34 18 12 12 12 12 13
44: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(DebugTypeMember) 45 38 18 12 12 12 12 13
46: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(DebugTypeMember) 47 38 18 12 12 12 12 13
50: 7(int) Constant 3778
48: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(DebugTypeComposite) 49 26 18 50 12 25 49 12 13 40 42 44 46
51: TypePointer Output 39(gl_PerVertex)
52: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 48 13 12
53: 51(ptr) Variable Output
56: 7(int) Constant 8
54: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(DebugGlobalVariable) 55 48 18 50 12 25 55 53 56
57: TypeInt 32 1
59: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(DebugTypeBasic) 58 10 27 12
60: 57(int) Constant 0
61: 32(float) Constant 1065353216
62: 35(fvec4) ConstantComposite 61 61 61 61
63: TypePointer Output 35(fvec4)
64: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 3(DebugTypePointer) 36 13 12
68: 7(int) Constant 3779
14(main): 4 Function None 5
15: Label
30: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 17
31: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 24 24 12 12
29: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101(DebugFunctionDefinition) 17 14(main)
70: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 54 54 12 12
69: 67(ptr) AccessChain 57 64
Store 69 66
71: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 72 72 12 12
66: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 50 50 12 12
65: 63(ptr) AccessChain 53 60
Store 65 62
67: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 18 68 68 12 12
Return
FunctionEnd
Loading
Loading