mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Add helper to quickly check for if DXIL is in use
This commit is contained in:
@@ -690,18 +690,33 @@ bool DXBCContainer::CheckForDebugInfo(const void *ByteCode, size_t ByteCodeLengt
|
||||
{
|
||||
uint32_t *fourcc = (uint32_t *)(data + chunkOffsets[chunkIdx]);
|
||||
|
||||
if(*fourcc == FOURCC_SDBG)
|
||||
{
|
||||
if(*fourcc == FOURCC_SDBG || *fourcc == FOURCC_SPDB || *fourcc == FOURCC_ILDB)
|
||||
return true;
|
||||
}
|
||||
else if(*fourcc == FOURCC_SPDB)
|
||||
{
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DXBCContainer::CheckForDXIL(const void *ByteCode, size_t ByteCodeLength)
|
||||
{
|
||||
FileHeader *header = (FileHeader *)ByteCode;
|
||||
|
||||
char *data = (char *)ByteCode; // just for convenience
|
||||
|
||||
if(header->fourcc != FOURCC_DXBC)
|
||||
return false;
|
||||
|
||||
if(header->fileLength != (uint32_t)ByteCodeLength)
|
||||
return false;
|
||||
|
||||
uint32_t *chunkOffsets = (uint32_t *)(header + 1); // right after the header
|
||||
|
||||
for(uint32_t chunkIdx = 0; chunkIdx < header->numChunks; chunkIdx++)
|
||||
{
|
||||
uint32_t *fourcc = (uint32_t *)(data + chunkOffsets[chunkIdx]);
|
||||
|
||||
if(*fourcc == FOURCC_ILDB || *fourcc == FOURCC_DXIL)
|
||||
return true;
|
||||
}
|
||||
else if(*fourcc == FOURCC_ILDB)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -195,6 +195,7 @@ public:
|
||||
static void GetHash(uint32_t hash[4], const void *ByteCode, size_t BytecodeLength);
|
||||
|
||||
static bool CheckForDebugInfo(const void *ByteCode, size_t ByteCodeLength);
|
||||
static bool CheckForDXIL(const void *ByteCode, size_t ByteCodeLength);
|
||||
static rdcstr GetDebugBinaryPath(const void *ByteCode, size_t ByteCodeLength);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user