mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-16 00:59:22 +00:00
Make nextSSAId parameter a default pointer parameter
The SSAIds get computed once during SettleIDs() as part of DXIL disassembly (and DXIL debugger) Pass in local variable for usage in ProgramEditor
This commit is contained in:
1 parent
c3331146ff
commit
16e2802930
4 files changed
+14
-19
No files matched your search
@@ -2580,7 +2580,7 @@ void LLVMOrderAccumulator::processGlobals(Program *prog, bool doLiveChecking)
|
||||
}
|
||||
}
|
||||
|
||||
void LLVMOrderAccumulator::processFunction(const Function *f, uint32_t &nextSSAId)
|
||||
void LLVMOrderAccumulator::processFunction(const Function *f, uint32_t *nextSSAId)
|
||||
{
|
||||
const Function &func = *f;
|
||||
|
||||
@@ -2637,8 +2637,9 @@ void LLVMOrderAccumulator::processFunction(const Function *f, uint32_t &nextSSAI
|
||||
#if DISABLED(DXC_COMPATIBLE_DISASM)
|
||||
if(arg->slot == ~0U)
|
||||
{
|
||||
arg->slot = nextSSAId;
|
||||
nextSSAId++;
|
||||
RDCASSERT(!nextSSAId);
|
||||
arg->slot = *nextSSAId;
|
||||
(*nextSSAId)++;
|
||||
}
|
||||
#else
|
||||
if(arg->getName().isEmpty())
|
||||
@@ -2671,8 +2672,8 @@ void LLVMOrderAccumulator::processFunction(const Function *f, uint32_t &nextSSAI
|
||||
#if DISABLED(DXC_COMPATIBLE_DISASM)
|
||||
if(inst->slot == ~0U)
|
||||
{
|
||||
inst->slot = nextSSAId;
|
||||
nextSSAId++;
|
||||
inst->slot = *nextSSAId;
|
||||
(*nextSSAId)++;
|
||||
}
|
||||
#else
|
||||
if(inst->getName().isEmpty())
|
||||
|
||||
@@ -1387,7 +1387,7 @@ public:
|
||||
size_t firstFuncConst;
|
||||
size_t numFuncConsts;
|
||||
|
||||
void processFunction(const Function *f, uint32_t &nextSSAId);
|
||||
void processFunction(const Function *f, uint32_t *nextSSAId = NULL);
|
||||
void exitFunction();
|
||||
|
||||
private:
|
||||
|
||||
@@ -93,7 +93,7 @@ ProgramEditor::ProgramEditor(const DXBC::DXBCContainer *container, bytebuf &outB
|
||||
|
||||
for(Function *f : m_Functions)
|
||||
{
|
||||
accum.processFunction(f, ssaID);
|
||||
accum.processFunction(f, &ssaID);
|
||||
for(size_t idx = accum.firstFuncConst; idx < accum.firstFuncConst + accum.numFuncConsts; idx++)
|
||||
m_Constants.push_back((Constant *)cast<const Constant>(accum.values[idx]));
|
||||
accum.exitFunction();
|
||||
@@ -113,7 +113,7 @@ ProgramEditor::~ProgramEditor()
|
||||
rdcarray<const Function *> keep;
|
||||
for(Function *f : m_Functions)
|
||||
{
|
||||
accum.processFunction(f, ssaID);
|
||||
accum.processFunction(f, &ssaID);
|
||||
accum.exitFunction();
|
||||
}
|
||||
|
||||
@@ -1080,7 +1080,7 @@ bytebuf ProgramEditor::EncodeProgram()
|
||||
|
||||
writer.Record(LLVMBC::FunctionRecord::DECLAREBLOCKS, f->blocks.size());
|
||||
|
||||
accum.processFunction(f, ssaID);
|
||||
accum.processFunction(f, &ssaID);
|
||||
|
||||
if(accum.numFuncConsts)
|
||||
{
|
||||
|
||||
@@ -1064,7 +1064,7 @@ void Program::SettleIDs()
|
||||
uint32_t &nextMetaSlot = m_NextMetaSlot;
|
||||
for(size_t i = 0; i < m_Functions.size(); i++)
|
||||
{
|
||||
m_Accum.processFunction(m_Functions[i], m_NextSSAId);
|
||||
m_Accum.processFunction(m_Functions[i], &m_NextSSAId);
|
||||
|
||||
Function &func = *m_Functions[i];
|
||||
|
||||
@@ -1636,13 +1636,11 @@ void Program::MakeDXCDisassemblyString()
|
||||
m_Disassembly += DisassembleTypes(m_DisassemblyInstructionLine);
|
||||
m_Disassembly += DisassembleGlobalVars(m_DisassemblyInstructionLine);
|
||||
|
||||
uint32_t ssaID = 0;
|
||||
|
||||
for(size_t i = 0; i < m_Functions.size(); i++)
|
||||
{
|
||||
const Function &func = *m_Functions[i];
|
||||
|
||||
m_Accum.processFunction(m_Functions[i], ssaID);
|
||||
m_Accum.processFunction(m_Functions[i]);
|
||||
|
||||
if(func.attrs && func.attrs->functionSlot)
|
||||
{
|
||||
@@ -2711,13 +2709,11 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection)
|
||||
|
||||
const char *swizzle = "xyzw";
|
||||
|
||||
uint32_t ssaID = 0;
|
||||
|
||||
for(size_t i = 0; i < m_Functions.size(); i++)
|
||||
{
|
||||
const Function &func = *m_Functions[i];
|
||||
|
||||
m_Accum.processFunction(m_Functions[i], ssaID);
|
||||
m_Accum.processFunction(m_Functions[i]);
|
||||
|
||||
if(func.external)
|
||||
continue;
|
||||
@@ -4709,13 +4705,11 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection)
|
||||
|
||||
void Program::ParseReferences(const DXBC::Reflection *reflection)
|
||||
{
|
||||
uint32_t ssaID = 0;
|
||||
|
||||
for(size_t i = 0; i < m_Functions.size(); i++)
|
||||
{
|
||||
const Function &func = *m_Functions[i];
|
||||
|
||||
m_Accum.processFunction(m_Functions[i], ssaID);
|
||||
m_Accum.processFunction(m_Functions[i]);
|
||||
|
||||
if(func.external)
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user