mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-05 22:31:08 +00:00
Re-hash container after modifying program
This commit is contained in:
@@ -652,7 +652,7 @@ void DXBCContainer::FillStateInstructionInfo(ShaderDebugState &state) const
|
||||
}
|
||||
}
|
||||
|
||||
void DXBCContainer::ReplaceProgram(bytebuf &ByteCode, DXBCBytecode::Program *program)
|
||||
void DXBCContainer::ReplaceDXBCBytecode(bytebuf &ByteCode, const rdcarray<uint32_t> &replacement)
|
||||
{
|
||||
FileHeader *header = (FileHeader *)ByteCode.data();
|
||||
|
||||
@@ -665,8 +665,6 @@ void DXBCContainer::ReplaceProgram(bytebuf &ByteCode, DXBCBytecode::Program *pro
|
||||
uint32_t *chunkOffsets =
|
||||
(uint32_t *)(ByteCode.data() + sizeof(FileHeader)); // right after the header
|
||||
|
||||
rdcarray<uint32_t> replacement = program->EncodeProgram();
|
||||
|
||||
for(uint32_t chunkIdx = 0; chunkIdx < header->numChunks; chunkIdx++)
|
||||
{
|
||||
uint32_t offs = chunkOffsets[chunkIdx];
|
||||
@@ -710,6 +708,8 @@ void DXBCContainer::ReplaceProgram(bytebuf &ByteCode, DXBCBytecode::Program *pro
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
HashContainer(ByteCode.data(), ByteCode.size());
|
||||
}
|
||||
|
||||
void DXBCContainer::GetHash(uint32_t hash[4], const void *ByteCode, size_t BytecodeLength)
|
||||
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
void FillTraceLineInfo(ShaderDebugTrace &trace) const;
|
||||
void FillStateInstructionInfo(ShaderDebugState &state) const;
|
||||
|
||||
static void ReplaceProgram(bytebuf &ByteCode, DXBCBytecode::Program *program);
|
||||
static void ReplaceDXBCBytecode(bytebuf &ByteCode, const rdcarray<uint32_t> &replacement);
|
||||
|
||||
const DXBCBytecode::Program *GetDXBCByteCode() const { return m_DXBCByteCode; }
|
||||
DXBCBytecode::Program *GetDXBCByteCode() { return m_DXBCByteCode; }
|
||||
|
||||
Reference in New Issue
Block a user