diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index b38eee08..2856cd09 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -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( diff --git a/src/spirv/spirv_module.cpp b/src/spirv/spirv_module.cpp index 73d51a14..caf90fef 100644 --- a/src/spirv/spirv_module.cpp +++ b/src/spirv/spirv_module.cpp @@ -133,12 +133,16 @@ 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); - m_debugNames.putStr (source); + + if (source != nullptr) + m_debugNames.putStr(source); } void SpirvModule::setDebugName(