mirror of https://github.com/bkaradzic/bgfx
Enable debug information for Vulkan shaders (#3193)
* Enable debug information for Vulkan shaders * Enable debug information for Metal shaders
This commit is contained in:
parent
a23b128ae2
commit
b01c5d597a
|
@ -199,9 +199,12 @@ Options:
|
|||
--varyingdef <file path> A varying.def.sc's file path.
|
||||
--verbose Be verbose.
|
||||
|
||||
(DX9 and DX11 only):
|
||||
(Vulkan, DirectX and Metal):
|
||||
|
||||
--debug Debug information.
|
||||
|
||||
(DirectX only):
|
||||
|
||||
--disasm Disassemble a compiled shader.
|
||||
-O <level> Set optimization level.
|
||||
Can be 0–3.
|
||||
|
|
|
@ -1054,10 +1054,15 @@ namespace bgfx
|
|||
" --verbose Be verbose.\n"
|
||||
|
||||
"\n"
|
||||
"(DX9 and DX11 only):\n"
|
||||
"(Vulkan, DirectX and Metal):\n"
|
||||
|
||||
"\n"
|
||||
" --debug Debug information.\n"
|
||||
|
||||
"\n"
|
||||
"(DirectX only):\n"
|
||||
|
||||
"\n"
|
||||
" --disasm Disassemble compiled shader.\n"
|
||||
" -O <level> Set optimization level. Can be 0 to 3.\n"
|
||||
" --Werror Treat warnings as errors.\n"
|
||||
|
|
|
@ -286,6 +286,7 @@ namespace bgfx { namespace metal
|
|||
| EShMsgReadHlsl
|
||||
| EShMsgVulkanRules
|
||||
| EShMsgSpvRules
|
||||
| EShMsgDebugInfo
|
||||
);
|
||||
|
||||
shader->setEntryPoint("main");
|
||||
|
@ -494,7 +495,10 @@ namespace bgfx { namespace metal
|
|||
std::vector<uint32_t> spirv;
|
||||
|
||||
glslang::SpvOptions options;
|
||||
options.disableOptimizer = false;
|
||||
options.disableOptimizer = _options.debugInformation;
|
||||
options.generateDebugInfo = _options.debugInformation;
|
||||
options.emitNonSemanticShaderDebugInfo = _options.debugInformation;
|
||||
options.emitNonSemanticShaderDebugSource = _options.debugInformation;
|
||||
|
||||
glslang::GlslangToSpv(*intermediate, spirv, &options);
|
||||
|
||||
|
|
|
@ -461,6 +461,7 @@ namespace bgfx { namespace spirv
|
|||
| EShMsgReadHlsl
|
||||
| EShMsgVulkanRules
|
||||
| EShMsgSpvRules
|
||||
| EShMsgDebugInfo
|
||||
);
|
||||
|
||||
shader->setEntryPoint("main");
|
||||
|
@ -704,7 +705,10 @@ namespace bgfx { namespace spirv
|
|||
std::vector<uint32_t> spirv;
|
||||
|
||||
glslang::SpvOptions options;
|
||||
options.disableOptimizer = false;
|
||||
options.disableOptimizer = _options.debugInformation;
|
||||
options.generateDebugInfo = _options.debugInformation;
|
||||
options.emitNonSemanticShaderDebugInfo = _options.debugInformation;
|
||||
options.emitNonSemanticShaderDebugSource = _options.debugInformation;
|
||||
|
||||
glslang::GlslangToSpv(*intermediate, spirv, &options);
|
||||
|
||||
|
|
Loading…
Reference in New Issue