SPV: Add OpSource shader source code and file name.
This commit is contained in:
parent
136b1e2d5d
commit
121853f4df
12 changed files with 243 additions and 22 deletions
|
|
@ -728,6 +728,11 @@ bool ProcessDeferred(
|
|||
intermediate.setOriginUpperLeft();
|
||||
if ((messages & EShMsgHlslOffsets) || (messages & EShMsgReadHlsl))
|
||||
intermediate.setHlslOffsets();
|
||||
if (messages & EShMsgDebugInfo) {
|
||||
intermediate.setSourceFile(names[numPre]);
|
||||
for (int s = 0; s < numStrings; ++s)
|
||||
intermediate.addSourceText(strings[numPre]);
|
||||
}
|
||||
SetupBuiltinSymbolTable(version, profile, spvVersion, source);
|
||||
|
||||
TSymbolTable* cachedTable = SharedSymbolTables[MapVersionToIndex(version)]
|
||||
|
|
|
|||
|
|
@ -451,6 +451,11 @@ public:
|
|||
return semanticNameSet.insert(name).first->c_str();
|
||||
}
|
||||
|
||||
void setSourceFile(const char* file) { sourceFile = file; }
|
||||
const std::string& getSourceFile() const { return sourceFile; }
|
||||
void addSourceText(const char* text) { sourceText = sourceText + text; }
|
||||
const std::string& getSourceText() const { return sourceText; }
|
||||
|
||||
const char* const implicitThisName = "@this";
|
||||
|
||||
protected:
|
||||
|
|
@ -541,6 +546,10 @@ protected:
|
|||
|
||||
EShTextureSamplerTransformMode textureSamplerTransformMode;
|
||||
|
||||
// source code of shader, useful as part of debug information
|
||||
std::string sourceFile;
|
||||
std::string sourceText;
|
||||
|
||||
private:
|
||||
void operator=(TIntermediate&); // prevent assignments
|
||||
};
|
||||
|
|
|
|||
|
|
@ -157,6 +157,7 @@ enum EShMessages {
|
|||
EShMsgCascadingErrors = (1 << 7), // get cascading errors; risks error-recovery issues, instead of an early exit
|
||||
EShMsgKeepUncalled = (1 << 8), // for testing, don't eliminate uncalled functions
|
||||
EShMsgHlslOffsets = (1 << 9), // allow block offsets to follow HLSL rules instead of GLSL rules
|
||||
EShMsgDebugInfo = (1 << 10), // save debug information
|
||||
};
|
||||
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue