From 6f0756c6dd4e9fb22621a87276e2c6d68f4f841e Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 20 Dec 2017 17:16:09 +0000 Subject: [PATCH] When trying to find a section by name, try known sections names * In theory all sections of a known type should be written with their proper normalised name, but just in case a capture is a bit misformed let's try to look it up by type. --- renderdoc/serialise/rdcfile.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/renderdoc/serialise/rdcfile.cpp b/renderdoc/serialise/rdcfile.cpp index 15e403e28..a3cc27ef8 100644 --- a/renderdoc/serialise/rdcfile.cpp +++ b/renderdoc/serialise/rdcfile.cpp @@ -696,6 +696,12 @@ int RDCFile::SectionIndex(const char *name) const if(m_Sections[i].name == name) return int(i); + // last ditch, see if name is a known section type and search for that type. This should have been + // normalised on write, but maybe it didn't + for(SectionType s : values()) + if(ToStr(s) == name) + return SectionIndex(s); + return -1; }