mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-25 23:25:41 +00:00
Save machine ident in captures and compare to machine ident on open
* If the machine idents differ in significant ways that we'd consider it to be a different platform (currently just OS), and if so mark it as supported but suggested to be replayed remotely.
This commit is contained in:
@@ -1450,6 +1450,24 @@ void Serialiser::FlushToDisk()
|
||||
SAFE_DELETE_ARRAY(symbolDB);
|
||||
}
|
||||
|
||||
// write the machine identifier as an ASCII section
|
||||
{
|
||||
const char sectionName[] = "renderdoc/internal/machineid";
|
||||
|
||||
uint64_t machineID = OSUtility::GetMachineIdent();
|
||||
|
||||
BinarySectionHeader section = {0};
|
||||
section.isASCII = 0; // redundant but explicit
|
||||
section.sectionNameLength = sizeof(sectionName); // includes null terminator
|
||||
section.sectionType = eSectionType_MachineID;
|
||||
section.sectionFlags = eSectionFlag_None;
|
||||
section.sectionLength = sizeof(machineID);
|
||||
|
||||
FileIO::fwrite(§ion, 1, offsetof(BinarySectionHeader, name), binFile);
|
||||
FileIO::fwrite(sectionName, 1, sizeof(sectionName), binFile);
|
||||
FileIO::fwrite(&machineID, 1, sizeof(machineID), binFile);
|
||||
}
|
||||
|
||||
FileIO::fclose(binFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,6 +180,7 @@ public:
|
||||
eSectionType_Unknown = 0,
|
||||
eSectionType_FrameCapture, // renderdoc/internal/framecapture
|
||||
eSectionType_ResolveDatabase, // renderdoc/internal/resolvedb
|
||||
eSectionType_MachineID, // renderdoc/internal/machineid
|
||||
eSectionType_FrameBookmarks, // renderdoc/ui/bookmarks
|
||||
eSectionType_Notes, // renderdoc/ui/notes
|
||||
eSectionType_Num,
|
||||
@@ -281,6 +282,22 @@ public:
|
||||
Callstack::StackResolver *GetCallstackResolver() { return m_pResolver; }
|
||||
void SetCallstack(uint64_t *levels, size_t numLevels);
|
||||
|
||||
uint64_t GetSavedMachineIdent()
|
||||
{
|
||||
Section *id = m_KnownSections[eSectionType_MachineID];
|
||||
|
||||
// section might not be present on older captures (or if it was stripped out
|
||||
// by someone over-eager to remove information)
|
||||
if(id != NULL && id->data.size() >= sizeof(uint64_t))
|
||||
{
|
||||
uint64_t ident = 0;
|
||||
memcpy(&ident, &id->data[0], sizeof(ident));
|
||||
return ident;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// get the callstack associated with the last scope
|
||||
Callstack::Stackwalk *GetLastCallstack()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user