1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 10:24:12 +01:00

[dxbc] Omit empty source string in OpSource instruction

This parameter is optional and confuses RenderDoc if present.
This commit is contained in:
Philip Rebohle 2018-05-02 13:07:26 +02:00
parent 5683422208
commit 27d3a78d79
2 changed files with 8 additions and 4 deletions

View File

@ -28,7 +28,7 @@ namespace dxvk {
m_module.setDebugSource(
spv::SourceLanguageUnknown, 0,
m_module.addDebugString(fileName.c_str()),
"");
nullptr);
// Set the memory model. This is the same for all shaders.
m_module.setMemoryModel(

View File

@ -133,11 +133,15 @@ namespace dxvk {
uint32_t version,
uint32_t file,
const char* source) {
m_debugNames.putIns (spv::OpSource,
4 + m_debugNames.strLen(source));
uint32_t strLen = source != nullptr
? m_debugNames.strLen(source) : 0;
m_debugNames.putIns (spv::OpSource, 4 + strLen);
m_debugNames.putWord(language);
m_debugNames.putWord(version);
m_debugNames.putWord(file);
if (source != nullptr)
m_debugNames.putStr(source);
}