mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-09 00:01:07 +00:00
Add a SPIR-V editor helper to insert a sequence of operations at once
This commit is contained in:
@@ -472,6 +472,17 @@ Id Editor::AddOperation(Iter iter, const Operation &op)
|
||||
return OpDecoder(iter).result;
|
||||
}
|
||||
|
||||
Iter Editor::AddOperations(Iter iter, const OperationList &ops)
|
||||
{
|
||||
for(const rdcspv::Operation &op : ops)
|
||||
{
|
||||
AddOperation(iter, op);
|
||||
++iter;
|
||||
}
|
||||
|
||||
return iter;
|
||||
}
|
||||
|
||||
void Editor::RegisterOp(Iter it)
|
||||
{
|
||||
Processor::RegisterOp(it);
|
||||
|
||||
@@ -76,6 +76,7 @@ public:
|
||||
Id MakeId();
|
||||
|
||||
Id AddOperation(Iter iter, const Operation &op);
|
||||
Iter AddOperations(Iter iter, const OperationList &ops);
|
||||
|
||||
// callbacks to allow us to update our internal structures over changes
|
||||
|
||||
|
||||
@@ -975,13 +975,7 @@ void AnnotateShader(const ShaderReflection &refl, const SPIRVPatchData &patchDat
|
||||
++it;
|
||||
|
||||
if(funcId == entryID)
|
||||
{
|
||||
for(const rdcspv::Operation &op : locationGather)
|
||||
{
|
||||
editor.AddOperation(it, op);
|
||||
++it;
|
||||
}
|
||||
}
|
||||
editor.AddOperations(it, locationGather);
|
||||
|
||||
// now patch accesses in the function body
|
||||
for(; it; ++it)
|
||||
|
||||
Reference in New Issue
Block a user