mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-04 05:41:06 +00:00
Add a testing option to step to DebugValue instructions
This commit is contained in:
@@ -26,11 +26,15 @@
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
#include "common/formatting.h"
|
||||
#include "core/settings.h"
|
||||
#include "maths/half_convert.h"
|
||||
#include "os/os_specific.h"
|
||||
#include "spirv_op_helpers.h"
|
||||
#include "var_dispatch_helpers.h"
|
||||
|
||||
RDOC_CONFIG(bool, Vulkan_Debug_StepToDebugValue, false,
|
||||
"Treat DebugValue as a steppable executable instruction.");
|
||||
|
||||
static bool ContainsNaNInf(const ShaderVariable &var)
|
||||
{
|
||||
bool ret = false;
|
||||
@@ -581,8 +585,19 @@ void ThreadState::SkipIgnoredInstructions()
|
||||
{
|
||||
if(debugger.IsDebugExtInstSet(Id::fromWord(it.word(3))))
|
||||
{
|
||||
nextInstruction++;
|
||||
continue;
|
||||
if(Vulkan_Debug_StepToDebugValue())
|
||||
{
|
||||
if(ShaderDbg(it.word(4)) != ShaderDbg::Value || !debugger.InDebugScope(nextInstruction))
|
||||
{
|
||||
nextInstruction++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nextInstruction++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -350,6 +350,7 @@ public:
|
||||
const Decorations &GetDecorations(Id typeId);
|
||||
bool IsDebugExtInstSet(Id id) const;
|
||||
bool HasDebugInfo() const { return m_DebugInfo.valid; }
|
||||
bool InDebugScope(uint32_t inst) const;
|
||||
rdcstr GetRawName(Id id) const;
|
||||
rdcstr GetHumanName(Id id);
|
||||
void AddSourceVars(rdcarray<SourceVariableMapping> &sourceVars, const ShaderVariable &var, Id id);
|
||||
|
||||
@@ -2725,6 +2725,11 @@ bool Debugger::IsDebugExtInstSet(Id id) const
|
||||
return knownExtSet[ExtSet_ShaderDbg] == id;
|
||||
}
|
||||
|
||||
bool Debugger::InDebugScope(uint32_t inst) const
|
||||
{
|
||||
return m_DebugInfo.lineScope.find(instructionOffsets[inst]) != m_DebugInfo.lineScope.end();
|
||||
}
|
||||
|
||||
const ScopeData *Debugger::GetScope(size_t offset) const
|
||||
{
|
||||
auto it = m_DebugInfo.lineScope.find(offset);
|
||||
|
||||
Reference in New Issue
Block a user