From bf2df1d09ad86c049d178f2d1455d7332d10b4d5 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 9 Mar 2023 13:23:33 +0000 Subject: [PATCH] Fix recompression of D3D12 files not being roundtrip identical --- renderdoc/serialise/codecs/xml_codec.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/renderdoc/serialise/codecs/xml_codec.cpp b/renderdoc/serialise/codecs/xml_codec.cpp index 99290538e..d8e10ffef 100644 --- a/renderdoc/serialise/codecs/xml_codec.cpp +++ b/renderdoc/serialise/codecs/xml_codec.cpp @@ -48,12 +48,14 @@ struct LiteralFileSection SectionType type; rdcstr filename; rdcstr chunkName; + SectionFlags sectionFlags; }; static const LiteralFileSection literalFileSections[] = { - {SectionType::EmbeddedLogfile, "diagnostic.log", "diagnostic_log"}, - {SectionType::D3D12Core, "D3D12Core.dll", "d3d12core"}, - {SectionType::D3D12SDKLayers, "D3D12SDKLayers.dll", "d3d12sdklayers"}, + {SectionType::EmbeddedLogfile, "diagnostic.log", "diagnostic_log", SectionFlags::LZ4Compressed}, + {SectionType::D3D12Core, "D3D12Core.dll", "d3d12core", SectionFlags::ZstdCompressed}, + {SectionType::D3D12SDKLayers, "D3D12SDKLayers.dll", "d3d12sdklayers", + SectionFlags::ZstdCompressed}, }; static bool isLiteralFileChunkName(const rdcstr &chunkName) @@ -738,7 +740,7 @@ static RDResult XML2Structured(const rdcstr &xml, const ThumbTypeAndData &thumb, SectionProperties props = {}; props.type = section.type; props.version = 1; - props.flags = SectionFlags::LZ4Compressed; + props.flags = section.sectionFlags; StreamWriter *w = rdc->WriteSection(props); w->Write(litIt->second.data(), litIt->second.size());