mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Convert Spirv Debugger to run Thread steps via the JobSystem
Enabled by default : config option "Vulkan_Debug_EnableShaderDebugMT"
This commit is contained in:
@@ -37,6 +37,9 @@ RDOC_DEBUG_CONFIG(
|
||||
bool, Vulkan_Hack_EnableGroupCaps, false,
|
||||
"Work in progress allow shaders to be debugged with subgroup/workgroup requirements.");
|
||||
|
||||
RDOC_CONFIG(bool, Vulkan_Debug_EnableShaderDebugMT, true,
|
||||
"Use multiple threads to run the shader debugger simulation.");
|
||||
|
||||
using namespace rdcshaders;
|
||||
|
||||
// this could be cleaner if ShaderVariable wasn't a very public struct, but it's not worth it so
|
||||
@@ -4827,7 +4830,11 @@ void Debugger::QueueJob(uint32_t lane, rdcarray<ShaderDebugState> *ret)
|
||||
CHECK_DEBUGGER_THREAD();
|
||||
ThreadState &thread = workgroup[lane];
|
||||
thread.SetStepQueued();
|
||||
StepThread(lane, StepThreadMode::RUN_SINGLE_STEP, ret);
|
||||
if(Vulkan_Debug_EnableShaderDebugMT())
|
||||
Threading::JobSystem::AddJob(
|
||||
[this, lane, ret]() { StepThread(lane, StepThreadMode::RUN_MULTIPLE_STEPS, ret); });
|
||||
else
|
||||
StepThread(lane, StepThreadMode::RUN_SINGLE_STEP, ret);
|
||||
}
|
||||
|
||||
// Must be called from the replay manager thread (the debugger thread)
|
||||
|
||||
@@ -6655,6 +6655,7 @@ rdcarray<ShaderDebugState> VulkanReplay::ContinueDebug(ShaderDebugger *debugger)
|
||||
}
|
||||
|
||||
rdcarray<ShaderDebugState> ret = spvDebugger->ContinueDebug();
|
||||
Threading::JobSystem::SyncAllJobs();
|
||||
|
||||
VulkanAPIWrapper *api = (VulkanAPIWrapper *)spvDebugger->GetAPIWrapper();
|
||||
api->ResetReplay();
|
||||
|
||||
Reference in New Issue
Block a user