From a8a14bc31780d2eb83fceee303a90ef99e858014 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 1 May 2025 15:40:23 +0100 Subject: [PATCH] When possible reject aliased pdb names using HASH --- .../driver/shaders/dxbc/dxbc_container.cpp | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp index 61c8782b6..b3dcbd60d 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp @@ -152,6 +152,8 @@ struct DebugFile } } + RDCDEBUG("lz4 decompressed %s", path.c_str()); + RDCASSERT(ret > 0, ret); // we resize and memcpy instead of just doing .swap() because that would @@ -162,7 +164,10 @@ struct DebugFile if(DXBC::IsPDBFile(&contents[0], contents.size())) { + size_t oldSize = contents.size(); DXBC::UnwrapEmbeddedPDBData(contents); + if(oldSize != contents.size()) + RDCDEBUG("PDB unwrapped %s", path.c_str()); pdb = true; } @@ -1534,7 +1539,15 @@ void DXBCContainer::TryFetchSeparateDebugInfo(bytebuf &byteCode, const rdcstr &d found.path = tempPath; else if(!hasSuffix && FileIO::exists(tempPath + ".pdb")) found.path = tempPath + ".pdb"; - continue; + + if(!found.empty()) + { + RDCDEBUG("Found %s (matched using leaf %s) when looking for %s", found.path.c_str(), + tempPath.c_str(), originalPath.c_str()); + + // this may empty out found, if the hash doesn't match + found.ReadAndProcess(lz4, desiredHash); + } } else { @@ -1546,18 +1559,18 @@ void DXBCContainer::TryFetchSeparateDebugInfo(bytebuf &byteCode, const rdcstr &d found.path = checkPath; else if(!hasSuffix && FileIO::exists(checkPath + ".pdb")) found.path = checkPath + ".pdb"; + + if(!found.empty()) + { + RDCDEBUG("Found %s (matched using leaf %s) when looking for %s", found.path.c_str(), + tempPath.c_str(), originalPath.c_str()); + + // this may empty out found, if the hash doesn't match + found.ReadAndProcess(lz4, desiredHash); + } } } - if(!found.empty()) - { - RDCDEBUG("Found %s (matched using leaf %s) when looking for %s", found.path.c_str(), - tempPath.c_str(), originalPath.c_str()); - - // this may empty out found, if the hash doesn't match - found.ReadAndProcess(lz4, desiredHash); - } - if(found.empty()) { // the "documented" behaviour for D3D debug info names is that when presented with a