mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Don't rely on ReplaceChunk silently doing nothing for missing chunks
This commit is contained in:
@@ -56,9 +56,12 @@ ProgramEditor::ProgramEditor(const DXBC::DXBCContainer *container, bytebuf &outB
|
||||
ProgramEditor::~ProgramEditor()
|
||||
{
|
||||
rdcarray<uint32_t> encoded = EncodeProgram();
|
||||
// only one of these fourcc's will be present, so we just try to replace both
|
||||
DXBC::DXBCContainer::ReplaceChunk(m_OutBlob, MAKE_FOURCC('S', 'H', 'E', 'X'), encoded);
|
||||
DXBC::DXBCContainer::ReplaceChunk(m_OutBlob, MAKE_FOURCC('S', 'H', 'D', 'R'), encoded);
|
||||
// only one of these fourcc's will be present
|
||||
size_t dummy = 0;
|
||||
if(DXBC::DXBCContainer::FindChunk(m_OutBlob, DXBC::FOURCC_SHEX, dummy))
|
||||
DXBC::DXBCContainer::ReplaceChunk(m_OutBlob, MAKE_FOURCC('S', 'H', 'E', 'X'), encoded);
|
||||
if(DXBC::DXBCContainer::FindChunk(m_OutBlob, DXBC::FOURCC_SHDR, dummy))
|
||||
DXBC::DXBCContainer::ReplaceChunk(m_OutBlob, MAKE_FOURCC('S', 'H', 'D', 'R'), encoded);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user