2
0
Бранимир Караџић 2 жил өмнө
parent
commit
0b66150e9b

+ 8 - 3
3rdparty/glslang/SPIRV/GlslangToSpv.cpp

@@ -1580,7 +1580,12 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
     builder.setSource(TranslateSourceLanguage(glslangIntermediate->getSource(), glslangIntermediate->getProfile()),
     builder.setSource(TranslateSourceLanguage(glslangIntermediate->getSource(), glslangIntermediate->getProfile()),
                       glslangIntermediate->getVersion());
                       glslangIntermediate->getVersion());
 
 
-    if (options.generateDebugInfo) {
+    if (options.emitNonSemanticShaderDebugSource)
+            this->options.emitNonSemanticShaderDebugInfo = true;
+    if (options.emitNonSemanticShaderDebugInfo)
+            this->options.generateDebugInfo = true;
+
+    if (this->options.generateDebugInfo) {
         builder.setEmitOpLines();
         builder.setEmitOpLines();
         builder.setSourceFile(glslangIntermediate->getSourceFile());
         builder.setSourceFile(glslangIntermediate->getSourceFile());
 
 
@@ -1607,8 +1612,8 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
             builder.addInclude(iItr->first, iItr->second);
             builder.addInclude(iItr->first, iItr->second);
     }
     }
 
 
-    builder.setEmitNonSemanticShaderDebugInfo(options.emitNonSemanticShaderDebugInfo);
-    builder.setEmitNonSemanticShaderDebugSource(options.emitNonSemanticShaderDebugSource);
+    builder.setEmitNonSemanticShaderDebugInfo(this->options.emitNonSemanticShaderDebugInfo);
+    builder.setEmitNonSemanticShaderDebugSource(this->options.emitNonSemanticShaderDebugSource);
 
 
     stdBuiltins = builder.import("GLSL.std.450");
     stdBuiltins = builder.import("GLSL.std.450");
 
 

+ 2 - 0
3rdparty/glslang/SPIRV/spvIR.h

@@ -97,6 +97,8 @@ public:
     explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { }
     explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { }
     virtual ~Instruction() {}
     virtual ~Instruction() {}
     void addIdOperand(Id id) {
     void addIdOperand(Id id) {
+        // ids can't be 0
+        assert(id);
         operands.push_back(id);
         operands.push_back(id);
         idOperand.push_back(true);
         idOperand.push_back(true);
     }
     }