mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Enable debug information for Vulkan shaders (#3193)
* Enable debug information for Vulkan shaders * Enable debug information for Metal shaders
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user