Turn on OpModuleProcessed, connected to vulkan1.1.
diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp
index 4360441..b906605 100644
--- a/SPIRV/SpvBuilder.cpp
+++ b/SPIRV/SpvBuilder.cpp
@@ -2431,7 +2431,6 @@
// Debug instructions
dumpInstructions(out, strings);
- dumpModuleProcesses(out);
dumpSourceInstructions(out);
for (int e = 0; e < (int)sourceExtensions.size(); ++e) {
Instruction sourceExtInst(0, 0, OpSourceExtension);
@@ -2439,7 +2438,7 @@
sourceExtInst.dump(out);
}
dumpInstructions(out, names);
- dumpInstructions(out, lines);
+ dumpModuleProcesses(out);
// Annotation instructions
dumpInstructions(out, decorations);
diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h
index 4696365..7a7471e 100755
--- a/SPIRV/SpvBuilder.h
+++ b/SPIRV/SpvBuilder.h
@@ -613,7 +613,6 @@
std::vector<std::unique_ptr<Instruction> > entryPoints;
std::vector<std::unique_ptr<Instruction> > executionModes;
std::vector<std::unique_ptr<Instruction> > names;
- std::vector<std::unique_ptr<Instruction> > lines;
std::vector<std::unique_ptr<Instruction> > decorations;
std::vector<std::unique_ptr<Instruction> > constantsTypesGlobals;
std::vector<std::unique_ptr<Instruction> > externals;
diff --git a/SPIRV/doc.cpp b/SPIRV/doc.cpp
index 975c6ce..3343a65 100644
--- a/SPIRV/doc.cpp
+++ b/SPIRV/doc.cpp
@@ -1200,6 +1200,7 @@
case 318: return "OpAtomicFlagTestAndSet";
case 319: return "OpAtomicFlagClear";
case 320: return "OpImageSparseRead";
+ case OpModuleProcessed: return "OpModuleProcesses";
case 333: return "OpGroupNonUniformElect";
case 334: return "OpGroupNonUniformAll";
case 335: return "OpGroupNonUniformAny";
@@ -1385,6 +1386,7 @@
InstructionDesc[OpReleaseEvent].setResultAndType(false, false);
InstructionDesc[OpGroupWaitEvents].setResultAndType(false, false);
InstructionDesc[OpAtomicFlagClear].setResultAndType(false, false);
+ InstructionDesc[OpModuleProcessed].setResultAndType(false, false);
// Specific additional context-dependent operands
@@ -3051,6 +3053,8 @@
InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Value'");
InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Index'");
+ InstructionDesc[OpModuleProcessed].operands.push(OperandLiteralString, "'process'");
+
#ifdef AMD_EXTENSIONS
InstructionDesc[OpGroupIAddNonUniformAMD].capabilities.push_back(CapabilityGroups);
InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandScope, "'Execution'");
diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp
index 485e396..3911e56 100644
--- a/StandAlone/StandAlone.cpp
+++ b/StandAlone/StandAlone.cpp
@@ -1276,8 +1276,9 @@
" using -S.\n"
" --suppress-warnings suppress GLSL warnings\n"
" (except as required by #extension : warn)\n"
- " --target-env {vulkan1.0|opengl} set the execution environment code will\n"
- " execute in (as opposed to language\n"
+ " --target-env {vulkan1.0 | vulkan1.1 | opengl} \n"
+ " set execution environment that emitted code\n"
+ " will execute in (as opposed to the language\n"
" semantics selected by --client) defaults:\n"
" 'vulkan1.0' under '--client vulkan<ver>'\n"
" 'opengl' under '--client opengl<ver>'\n"
diff --git a/Test/baseResults/spv.debugInfo.1.1.frag.out b/Test/baseResults/spv.debugInfo.1.1.frag.out
new file mode 100644
index 0000000..6cbaf93
--- /dev/null
+++ b/Test/baseResults/spv.debugInfo.1.1.frag.out
@@ -0,0 +1,279 @@
+spv.debugInfo.frag
+// Module Version 10300
+// Generated by (magic number): 80001
+// Id's are bound by 126
+
+ Capability Shader
+ 2: ExtInstImport "GLSL.std.450"
+ MemoryModel Logical GLSL450
+ EntryPoint Fragment 5 "main" 24 52
+ ExecutionMode 5 OriginLowerLeft
+ 1: String "spv.debugInfo.frag"
+ Source GLSL 450 1 "#version 450
+
+struct S {
+ int a;
+};
+
+uniform ubuf {
+ S s;
+};
+
+uniform sampler2D s2d;
+
+layout(location = 0) in vec4 inv;
+layout(location = 0) out vec4 outv;
+
+vec4 foo(S s)
+{
+ vec4 r = s.a * inv;
+ ++r;
+ if (r.x > 3.0)
+ --r;
+ else
+ r *= 2;
+
+ return r;
+}
+
+void main()
+{
+ outv = foo(s);
+ outv += texture(s2d, vec2(0.5));
+
+ switch (s.a) {
+ case 10:
+ ++outv;
+ break;
+ case 20:
+ outv = 2 * outv;
+ ++outv;
+ break;
+ default:
+ --outv;
+ break;
+ }
+
+ for (int i = 0; i < 10; ++i)
+ outv *= 3.0;
+
+ outv.x < 10.0 ?
+ outv = sin(outv) :
+ outv = cos(outv);
+}"
+ Name 5 "main"
+ Name 8 "S"
+ MemberName 8(S) 0 "a"
+ Name 14 "foo(struct-S-i11;"
+ Name 13 "s"
+ Name 17 "r"
+ Name 24 "inv"
+ Name 52 "outv"
+ Name 53 "S"
+ MemberName 53(S) 0 "a"
+ Name 54 "ubuf"
+ MemberName 54(ubuf) 0 "s"
+ Name 56 ""
+ Name 57 "S"
+ MemberName 57(S) 0 "a"
+ Name 59 "param"
+ Name 69 "s2d"
+ Name 99 "i"
+ ModuleProcesses "no-storage-format"
+ ModuleProcesses "resource-set-binding 3"
+ ModuleProcesses "auto-map-locations"
+ ModuleProcesses "client opengl100"
+ ModuleProcesses "target-env opengl"
+ ModuleProcesses "relaxed-errors"
+ ModuleProcesses "suppress-warnings"
+ ModuleProcesses "hlsl-offsets"
+ ModuleProcesses "entry-point main"
+ Decorate 24(inv) Location 0
+ Decorate 52(outv) Location 0
+ MemberDecorate 53(S) 0 Offset 0
+ MemberDecorate 54(ubuf) 0 Offset 0
+ Decorate 54(ubuf) Block
+ Decorate 56 DescriptorSet 3
+ Decorate 69(s2d) DescriptorSet 3
+ 3: TypeVoid
+ 4: TypeFunction 3
+ 7: TypeInt 32 1
+ 8(S): TypeStruct 7(int)
+ 9: TypePointer Function 8(S)
+ 10: TypeFloat 32
+ 11: TypeVector 10(float) 4
+ 12: TypeFunction 11(fvec4) 9(ptr)
+ 16: TypePointer Function 11(fvec4)
+ 18: 7(int) Constant 0
+ 19: TypePointer Function 7(int)
+ 23: TypePointer Input 11(fvec4)
+ 24(inv): 23(ptr) Variable Input
+ 28: 10(float) Constant 1065353216
+ 31: TypeInt 32 0
+ 32: 31(int) Constant 0
+ 33: TypePointer Function 10(float)
+ 36: 10(float) Constant 1077936128
+ 37: TypeBool
+ 45: 10(float) Constant 1073741824
+ 51: TypePointer Output 11(fvec4)
+ 52(outv): 51(ptr) Variable Output
+ 53(S): TypeStruct 7(int)
+ 54(ubuf): TypeStruct 53(S)
+ 55: TypePointer Uniform 54(ubuf)
+ 56: 55(ptr) Variable Uniform
+ 57(S): TypeStruct 7(int)
+ 58: TypePointer Function 57(S)
+ 60: TypePointer Uniform 53(S)
+ 66: TypeImage 10(float) 2D sampled format:Unknown
+ 67: TypeSampledImage 66
+ 68: TypePointer UniformConstant 67
+ 69(s2d): 68(ptr) Variable UniformConstant
+ 71: TypeVector 10(float) 2
+ 72: 10(float) Constant 1056964608
+ 73: 71(fvec2) ConstantComposite 72 72
+ 77: TypePointer Uniform 7(int)
+ 106: 7(int) Constant 10
+ 111: 7(int) Constant 1
+ 114: TypePointer Output 10(float)
+ 117: 10(float) Constant 1092616192
+ 5(main): 3 Function None 4
+ 6: Label
+ 59(param): 58(ptr) Variable Function
+ 99(i): 19(ptr) Variable Function
+ 113: 16(ptr) Variable Function
+ Line 1 30 0
+ 61: 60(ptr) AccessChain 56 18
+ 62: 53(S) Load 61
+ 63: 7(int) CompositeExtract 62 0
+ 64: 19(ptr) AccessChain 59(param) 18
+ Store 64 63
+ 65: 11(fvec4) FunctionCall 14(foo(struct-S-i11;) 59(param)
+ Store 52(outv) 65
+ Line 1 31 0
+ 70: 67 Load 69(s2d)
+ 74: 11(fvec4) ImageSampleImplicitLod 70 73
+ 75: 11(fvec4) Load 52(outv)
+ 76: 11(fvec4) FAdd 75 74
+ Store 52(outv) 76
+ Line 1 33 0
+ 78: 77(ptr) AccessChain 56 18 18
+ 79: 7(int) Load 78
+ SelectionMerge 83 None
+ Switch 79 82
+ case 10: 80
+ case 20: 81
+ 82: Label
+ Line 1 42 0
+ 94: 11(fvec4) Load 52(outv)
+ 95: 11(fvec4) CompositeConstruct 28 28 28 28
+ 96: 11(fvec4) FSub 94 95
+ Store 52(outv) 96
+ Line 1 43 0
+ Branch 83
+ 80: Label
+ Line 1 35 0
+ 84: 11(fvec4) Load 52(outv)
+ 85: 11(fvec4) CompositeConstruct 28 28 28 28
+ 86: 11(fvec4) FAdd 84 85
+ Store 52(outv) 86
+ Line 1 36 0
+ Branch 83
+ 81: Label
+ Line 1 38 0
+ 88: 11(fvec4) Load 52(outv)
+ 89: 11(fvec4) VectorTimesScalar 88 45
+ Store 52(outv) 89
+ Line 1 39 0
+ 90: 11(fvec4) Load 52(outv)
+ 91: 11(fvec4) CompositeConstruct 28 28 28 28
+ 92: 11(fvec4) FAdd 90 91
+ Store 52(outv) 92
+ Line 1 40 0
+ Branch 83
+ 83: Label
+ Line 1 46 0
+ Store 99(i) 18
+ Branch 100
+ 100: Label
+ LoopMerge 102 103 None
+ Branch 104
+ 104: Label
+ 105: 7(int) Load 99(i)
+ 107: 37(bool) SLessThan 105 106
+ BranchConditional 107 101 102
+ 101: Label
+ Line 1 47 0
+ 108: 11(fvec4) Load 52(outv)
+ 109: 11(fvec4) VectorTimesScalar 108 36
+ Store 52(outv) 109
+ Branch 103
+ 103: Label
+ Line 1 46 0
+ 110: 7(int) Load 99(i)
+ 112: 7(int) IAdd 110 111
+ Store 99(i) 112
+ Branch 100
+ 102: Label
+ Line 1 49 0
+ 115: 114(ptr) AccessChain 52(outv) 32
+ 116: 10(float) Load 115
+ 118: 37(bool) FOrdLessThan 116 117
+ SelectionMerge 120 None
+ BranchConditional 118 119 123
+ 119: Label
+ Line 1 50 0
+ 121: 11(fvec4) Load 52(outv)
+ 122: 11(fvec4) ExtInst 2(GLSL.std.450) 13(Sin) 121
+ Store 52(outv) 122
+ Store 113 122
+ Branch 120
+ 123: Label
+ Line 1 51 0
+ 124: 11(fvec4) Load 52(outv)
+ 125: 11(fvec4) ExtInst 2(GLSL.std.450) 14(Cos) 124
+ Store 52(outv) 125
+ Store 113 125
+ Branch 120
+ 120: Label
+ Return
+ FunctionEnd
+14(foo(struct-S-i11;): 11(fvec4) Function None 12
+ 13(s): 9(ptr) FunctionParameter
+ 15: Label
+ 17(r): 16(ptr) Variable Function
+ Line 1 18 0
+ 20: 19(ptr) AccessChain 13(s) 18
+ 21: 7(int) Load 20
+ 22: 10(float) ConvertSToF 21
+ 25: 11(fvec4) Load 24(inv)
+ 26: 11(fvec4) VectorTimesScalar 25 22
+ Store 17(r) 26
+ Line 1 19 0
+ 27: 11(fvec4) Load 17(r)
+ 29: 11(fvec4) CompositeConstruct 28 28 28 28
+ 30: 11(fvec4) FAdd 27 29
+ Store 17(r) 30
+ Line 1 20 0
+ 34: 33(ptr) AccessChain 17(r) 32
+ 35: 10(float) Load 34
+ 38: 37(bool) FOrdGreaterThan 35 36
+ SelectionMerge 40 None
+ BranchConditional 38 39 44
+ 39: Label
+ Line 1 21 0
+ 41: 11(fvec4) Load 17(r)
+ 42: 11(fvec4) CompositeConstruct 28 28 28 28
+ 43: 11(fvec4) FSub 41 42
+ Store 17(r) 43
+ Branch 40
+ 44: Label
+ Line 1 23 0
+ 46: 11(fvec4) Load 17(r)
+ 47: 11(fvec4) VectorTimesScalar 46 45
+ Store 17(r) 47
+ Branch 40
+ 40: Label
+ Line 1 25 0
+ 48: 11(fvec4) Load 17(r)
+ ReturnValue 48
+ FunctionEnd
diff --git a/Test/runtests b/Test/runtests
index b4a8ea3..353ba6b 100755
--- a/Test/runtests
+++ b/Test/runtests
@@ -121,6 +121,9 @@
$EXE -g --relaxed-errors --suppress-warnings --aml --hlsl-offsets --nsf \
-G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.frag.out
diff -b $BASEDIR/spv.debugInfo.frag.out $TARGETDIR/spv.debugInfo.frag.out || HASERROR=1
+$EXE -g --target-env vulkan1.1 --relaxed-errors --suppress-warnings --aml --hlsl-offsets --nsf \
+ -G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.1.1.frag.out
+diff -b $BASEDIR/spv.debugInfo.1.1.frag.out $TARGETDIR/spv.debugInfo.1.1.frag.out || HASERROR=1
$EXE -g -D -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \
--sep origMain -H spv.hlslDebugInfo.vert --rsb vert t0 0 0 > $TARGETDIR/spv.hlslDebugInfo.frag.out
diff -b $BASEDIR/spv.hlslDebugInfo.frag.out $TARGETDIR/spv.hlslDebugInfo.frag.out || HASERROR=1