diff --git a/renderdoc/core/core.h b/renderdoc/core/core.h index 9b0a01322..27efa2f24 100644 --- a/renderdoc/core/core.h +++ b/renderdoc/core/core.h @@ -203,10 +203,6 @@ enum class RDCDriver : uint32_t DECLARE_REFLECTION_ENUM(RDCDriver); -namespace DXBC -{ -class DXBCFile; -} namespace Callstack { class StackResolver; diff --git a/renderdoc/driver/d3d11/d3d11_debug.h b/renderdoc/driver/d3d11/d3d11_debug.h index dba1abda1..444c713b8 100644 --- a/renderdoc/driver/d3d11/d3d11_debug.h +++ b/renderdoc/driver/d3d11/d3d11_debug.h @@ -115,9 +115,9 @@ public: void PixelHistoryCopyPixel(CopyPixelParams ¶ms, uint32_t x, uint32_t y); ShaderDebug::State CreateShaderDebugState(ShaderDebugTrace &trace, int quadIdx, - DXBC::DXBCFile *dxbc, const ShaderReflection &refl, + DXBC::DXBCContainer *dxbc, const ShaderReflection &refl, bytebuf *cbufData); - void CreateShaderGlobalState(ShaderDebug::GlobalState &global, DXBC::DXBCFile *dxbc, + void CreateShaderGlobalState(ShaderDebug::GlobalState &global, DXBC::DXBCContainer *dxbc, uint32_t UAVStartSlot, ID3D11UnorderedAccessView **UAVs, ID3D11ShaderResourceView **SRVs); diff --git a/renderdoc/driver/d3d11/d3d11_postvs.cpp b/renderdoc/driver/d3d11/d3d11_postvs.cpp index 5463bac0a..b20e53404 100644 --- a/renderdoc/driver/d3d11/d3d11_postvs.cpp +++ b/renderdoc/driver/d3d11/d3d11_postvs.cpp @@ -204,11 +204,11 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) ((drawcall->flags & DrawFlags::Instanced) && drawcall->numInstances == 0)) return; - DXBC::DXBCFile *dxbcVS = wrappedVS->GetDXBC(); + DXBC::DXBCContainer *dxbcVS = wrappedVS->GetDXBC(); RDCASSERT(dxbcVS); - DXBC::DXBCFile *dxbcGS = NULL; + DXBC::DXBCContainer *dxbcGS = NULL; if(gs) { @@ -226,7 +226,7 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) RDCASSERT(dxbcGS); } - DXBC::DXBCFile *dxbcDS = NULL; + DXBC::DXBCContainer *dxbcDS = NULL; if(ds) { @@ -661,7 +661,7 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) posidx = -1; numPosComponents = 0; - DXBC::DXBCFile *lastShader = dxbcGS; + DXBC::DXBCContainer *lastShader = dxbcGS; if(dxbcDS) lastShader = dxbcDS; diff --git a/renderdoc/driver/d3d11/d3d11_renderstate.cpp b/renderdoc/driver/d3d11/d3d11_renderstate.cpp index 20cf6fce6..4164d3cd8 100644 --- a/renderdoc/driver/d3d11/d3d11_renderstate.cpp +++ b/renderdoc/driver/d3d11/d3d11_renderstate.cpp @@ -1182,7 +1182,7 @@ bool D3D11RenderState::Shader::Used_CB(uint32_t slot) const if(shad == NULL) return false; - DXBC::DXBCFile *dxbc = shad->GetDXBC(); + DXBC::DXBCContainer *dxbc = shad->GetDXBC(); // have to assume it's used if there's no DXBC if(dxbc == NULL) @@ -1205,7 +1205,7 @@ bool D3D11RenderState::Shader::Used_SRV(uint32_t slot) const if(shad == NULL) return false; - DXBC::DXBCFile *dxbc = shad->GetDXBC(); + DXBC::DXBCContainer *dxbc = shad->GetDXBC(); // have to assume it's used if there's no DXBC if(dxbc == NULL) @@ -1225,7 +1225,7 @@ bool D3D11RenderState::Shader::Used_UAV(uint32_t slot) const if(shad == NULL) return false; - DXBC::DXBCFile *dxbc = shad->GetDXBC(); + DXBC::DXBCContainer *dxbc = shad->GetDXBC(); // have to assume it's used if there's no DXBC if(dxbc == NULL) diff --git a/renderdoc/driver/d3d11/d3d11_replay.cpp b/renderdoc/driver/d3d11/d3d11_replay.cpp index 91512864c..2ebbb84b7 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.cpp +++ b/renderdoc/driver/d3d11/d3d11_replay.cpp @@ -479,7 +479,7 @@ std::string D3D11Replay::DisassembleShader(ResourceId pipeline, const ShaderRefl if(it == WrappedShader::m_ShaderList.end()) return "; Invalid Shader Specified"; - DXBC::DXBCFile *dxbc = it->second->GetDXBC(); + DXBC::DXBCContainer *dxbc = it->second->GetDXBC(); if(target == DXBCDisassemblyTarget || target.empty()) return dxbc->GetDisassembly(); diff --git a/renderdoc/driver/d3d11/d3d11_resources.cpp b/renderdoc/driver/d3d11/d3d11_resources.cpp index a5afc2778..6395c908d 100644 --- a/renderdoc/driver/d3d11/d3d11_resources.cpp +++ b/renderdoc/driver/d3d11/d3d11_resources.cpp @@ -74,13 +74,13 @@ const GUID RENDERDOC_ID3D11ShaderGUID_ShaderDebugMagicValue = RENDERDOC_ShaderDe void WrappedShader::ShaderEntry::TryReplaceOriginalByteCode() { - if(!DXBC::DXBCFile::CheckForDebugInfo((const void *)&m_Bytecode[0], m_Bytecode.size())) + if(!DXBC::DXBCContainer::CheckForDebugInfo((const void *)&m_Bytecode[0], m_Bytecode.size())) { std::string originalPath = m_DebugInfoPath; if(originalPath.empty()) originalPath = - DXBC::DXBCFile::GetDebugBinaryPath((const void *)&m_Bytecode[0], m_Bytecode.size()); + DXBC::DXBCContainer::GetDebugBinaryPath((const void *)&m_Bytecode[0], m_Bytecode.size()); if(!originalPath.empty()) { @@ -166,8 +166,8 @@ void WrappedShader::ShaderEntry::TryReplaceOriginalByteCode() memcpy(&originalBytecode[0], &decompressed[0], originalBytecode.size()); } - if(DXBC::DXBCFile::CheckForDebugInfo((const void *)&originalBytecode[0], - originalBytecode.size())) + if(DXBC::DXBCContainer::CheckForDebugInfo((const void *)&originalBytecode[0], + originalBytecode.size())) { m_Bytecode.swap(originalBytecode); } diff --git a/renderdoc/driver/d3d11/d3d11_resources.h b/renderdoc/driver/d3d11/d3d11_resources.h index 8456585cd..2986e12bd 100644 --- a/renderdoc/driver/d3d11/d3d11_resources.h +++ b/renderdoc/driver/d3d11/d3d11_resources.h @@ -28,7 +28,7 @@ #include #include "driver/d3d11/d3d11_device.h" #include "driver/d3d11/d3d11_manager.h" -#include "driver/shaders/dxbc/dxbc_inspect.h" +#include "driver/shaders/dxbc/dxbc_container.h" D3D11ResourceType IdentifyTypeByPtr(IUnknown *ptr); ResourceId GetIDForDeviceChild(ID3D11DeviceChild *ptr); @@ -921,12 +921,12 @@ public: } void SetDebugInfoPath(const std::string &path) { m_DebugInfoPath = path; } - DXBC::DXBCFile *GetDXBC() + DXBC::DXBCContainer *GetDXBC() { if(m_DXBCFile == NULL && !m_Bytecode.empty()) { TryReplaceOriginalByteCode(); - m_DXBCFile = new DXBC::DXBCFile((const void *)&m_Bytecode[0], m_Bytecode.size()); + m_DXBCFile = new DXBC::DXBCContainer((const void *)&m_Bytecode[0], m_Bytecode.size()); } return m_DXBCFile; } @@ -962,7 +962,7 @@ public: std::vector m_Bytecode; bool m_Built = false; - DXBC::DXBCFile *m_DXBCFile; + DXBC::DXBCContainer *m_DXBCFile; ShaderReflection m_Details; ShaderBindpointMapping m_Mapping; }; @@ -992,7 +992,7 @@ public: } } - DXBC::DXBCFile *GetDXBC() + DXBC::DXBCContainer *GetDXBC() { SCOPED_LOCK(m_ShaderListLock); return m_ShaderList[m_ID]->GetDXBC(); diff --git a/renderdoc/driver/d3d11/d3d11_shader_cache.cpp b/renderdoc/driver/d3d11/d3d11_shader_cache.cpp index 4b44ac12b..cf659b4c7 100644 --- a/renderdoc/driver/d3d11/d3d11_shader_cache.cpp +++ b/renderdoc/driver/d3d11/d3d11_shader_cache.cpp @@ -25,7 +25,7 @@ #include "d3d11_shader_cache.h" #include "common/shader_cache.h" #include "driver/dx/official/d3dcompiler.h" -#include "driver/shaders/dxbc/dxbc_inspect.h" +#include "driver/shaders/dxbc/dxbc_container.h" #include "strings/string_utils.h" #include "d3d11_device.h" #include "d3d11_resources.h" diff --git a/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp b/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp index b31967b67..f1fe37f48 100644 --- a/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp +++ b/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp @@ -243,7 +243,7 @@ static void FlattenVariables(const rdcarray &constants, class D3D11DebugAPIWrapper : public ShaderDebug::DebugAPIWrapper { public: - D3D11DebugAPIWrapper(WrappedID3D11Device *device, DXBC::DXBCFile *dxbc, + D3D11DebugAPIWrapper(WrappedID3D11Device *device, DXBC::DXBCContainer *dxbc, const ShaderDebug::GlobalState &globalState); void SetCurrentInstruction(uint32_t instruction) { m_instruction = instruction; } @@ -268,12 +268,12 @@ public: private: D3D11_ShaderType GetShaderType() { return m_dxbc ? m_dxbc->m_Type : D3D11_ShaderType_Pixel; } WrappedID3D11Device *m_pDevice; - DXBC::DXBCFile *m_dxbc; + DXBC::DXBCContainer *m_dxbc; const ShaderDebug::GlobalState &m_globalState; uint32_t m_instruction; }; -D3D11DebugAPIWrapper::D3D11DebugAPIWrapper(WrappedID3D11Device *device, DXBC::DXBCFile *dxbc, +D3D11DebugAPIWrapper::D3D11DebugAPIWrapper(WrappedID3D11Device *device, DXBC::DXBCContainer *dxbc, const ShaderDebug::GlobalState &globalState) : m_pDevice(device), m_dxbc(dxbc), m_globalState(globalState), m_instruction(0) { @@ -1603,7 +1603,7 @@ bool D3D11DebugAPIWrapper::CalculateMathIntrinsic(DXBC::OpcodeType opcode, } ShaderDebug::State D3D11DebugManager::CreateShaderDebugState(ShaderDebugTrace &trace, int quadIdx, - DXBC::DXBCFile *dxbc, + DXBC::DXBCContainer *dxbc, const ShaderReflection &refl, bytebuf *cbufData) { @@ -1768,7 +1768,7 @@ ShaderDebug::State D3D11DebugManager::CreateShaderDebugState(ShaderDebugTrace &t } void D3D11DebugManager::CreateShaderGlobalState(ShaderDebug::GlobalState &global, - DXBC::DXBCFile *dxbc, uint32_t UAVStartSlot, + DXBC::DXBCContainer *dxbc, uint32_t UAVStartSlot, ID3D11UnorderedAccessView **UAVs, ID3D11ShaderResourceView **SRVs) { @@ -2125,7 +2125,7 @@ ShaderDebugTrace D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, uin if(!vs) return empty; - DXBCFile *dxbc = vs->GetDXBC(); + DXBCContainer *dxbc = vs->GetDXBC(); const ShaderReflection &refl = vs->GetDetails(); if(!dxbc) @@ -2545,7 +2545,7 @@ ShaderDebugTrace D3D11Replay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t D3D11RenderState *rs = m_pImmediateContext->GetCurrentPipelineState(); - DXBCFile *dxbc = ps->GetDXBC(); + DXBCContainer *dxbc = ps->GetDXBC(); const ShaderReflection &refl = ps->GetDetails(); if(!dxbc) @@ -2553,7 +2553,7 @@ ShaderDebugTrace D3D11Replay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t dxbc->GetDisassembly(); - DXBCFile *prevdxbc = NULL; + DXBCContainer *prevdxbc = NULL; if(prevdxbc == NULL && gs != NULL) prevdxbc = gs->GetDXBC(); @@ -3810,7 +3810,7 @@ ShaderDebugTrace D3D11Replay::DebugThread(uint32_t eventId, const uint32_t group if(!cs) return empty; - DXBCFile *dxbc = cs->GetDXBC(); + DXBCContainer *dxbc = cs->GetDXBC(); const ShaderReflection &refl = cs->GetDetails(); if(!dxbc) diff --git a/renderdoc/driver/d3d12/d3d12_device_wrap.cpp b/renderdoc/driver/d3d12/d3d12_device_wrap.cpp index 8ef3132d4..bdf3b588b 100644 --- a/renderdoc/driver/d3d12/d3d12_device_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_device_wrap.cpp @@ -396,8 +396,8 @@ bool WrappedID3D12Device::Serialise_CreateGraphicsPipelineState( { if(shaders[i]->BytecodeLength > 0 && shaders[i]->pShaderBytecode) { - if(!DXBC::DXBCFile::CheckForShaderCode(shaders[i]->pShaderBytecode, - shaders[i]->BytecodeLength)) + if(!DXBC::DXBCContainer::CheckForShaderCode(shaders[i]->pShaderBytecode, + shaders[i]->BytecodeLength)) { RDCERR( "No shader code found in %s bytecode in pipeline state. " @@ -532,8 +532,8 @@ HRESULT WrappedID3D12Device::CreateGraphicsPipelineState(const D3D12_GRAPHICS_PI { if(shaders[i]->BytecodeLength > 0 && shaders[i]->pShaderBytecode) { - if(!DXBC::DXBCFile::CheckForShaderCode(shaders[i]->pShaderBytecode, - shaders[i]->BytecodeLength)) + if(!DXBC::DXBCContainer::CheckForShaderCode(shaders[i]->pShaderBytecode, + shaders[i]->BytecodeLength)) { RDCERR( "No shader code found in %s bytecode in pipeline state. " @@ -654,8 +654,8 @@ bool WrappedID3D12Device::Serialise_CreateComputePipelineState( // check for bytecode - if the user is wrongly using DXIL we will hard-fail instead of producing // a corrupted capture. - if(!DXBC::DXBCFile::CheckForShaderCode(unwrappedDesc.CS.pShaderBytecode, - unwrappedDesc.CS.BytecodeLength)) + if(!DXBC::DXBCContainer::CheckForShaderCode(unwrappedDesc.CS.pShaderBytecode, + unwrappedDesc.CS.BytecodeLength)) { RDCERR( "No shader code found in CS bytecode in pipeline state. " @@ -719,8 +719,8 @@ HRESULT WrappedID3D12Device::CreateComputePipelineState(const D3D12_COMPUTE_PIPE { // check for bytecode - if the user is wrongly using DXIL we will hard-fail instead of producing // a corrupted capture. - if(!DXBC::DXBCFile::CheckForShaderCode(unwrappedDesc.CS.pShaderBytecode, - unwrappedDesc.CS.BytecodeLength)) + if(!DXBC::DXBCContainer::CheckForShaderCode(unwrappedDesc.CS.pShaderBytecode, + unwrappedDesc.CS.BytecodeLength)) { RDCERR( "No shader code found in CS bytecode in pipeline state. " diff --git a/renderdoc/driver/d3d12/d3d12_postvs.cpp b/renderdoc/driver/d3d12/d3d12_postvs.cpp index ab0ad599f..4078a9595 100644 --- a/renderdoc/driver/d3d12/d3d12_postvs.cpp +++ b/renderdoc/driver/d3d12/d3d12_postvs.cpp @@ -192,11 +192,11 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) if(drawcall->numIndices == 0 || drawcall->numInstances == 0) return; - DXBC::DXBCFile *dxbcVS = vs->GetDXBC(); + DXBC::DXBCContainer *dxbcVS = vs->GetDXBC(); RDCASSERT(dxbcVS); - DXBC::DXBCFile *dxbcGS = NULL; + DXBC::DXBCContainer *dxbcGS = NULL; WrappedID3D12Shader *gs = origPSO->GS(); @@ -207,7 +207,7 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) RDCASSERT(dxbcGS); } - DXBC::DXBCFile *dxbcDS = NULL; + DXBC::DXBCContainer *dxbcDS = NULL; WrappedID3D12Shader *ds = origPSO->DS(); @@ -779,7 +779,7 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) posidx = -1; numPosComponents = 0; - DXBC::DXBCFile *lastShader = dxbcGS; + DXBC::DXBCContainer *lastShader = dxbcGS; if(dxbcDS) lastShader = dxbcDS; diff --git a/renderdoc/driver/d3d12/d3d12_rendertexture.cpp b/renderdoc/driver/d3d12/d3d12_rendertexture.cpp index 4799ec8f9..00e85b580 100644 --- a/renderdoc/driver/d3d12/d3d12_rendertexture.cpp +++ b/renderdoc/driver/d3d12/d3d12_rendertexture.cpp @@ -526,7 +526,7 @@ bool D3D12Replay::RenderTextureInternal(D3D12_CPU_DESCRIPTOR_HANDLE rtv, Texture if(FAILED(hr)) return false; - DXBC::DXBCFile *dxbc = shader->GetDXBC(); + DXBC::DXBCContainer *dxbc = shader->GetDXBC(); RDCASSERT(dxbc); RDCASSERT(dxbc->m_Type == D3D11_ShaderType_Pixel); diff --git a/renderdoc/driver/d3d12/d3d12_replay.cpp b/renderdoc/driver/d3d12/d3d12_replay.cpp index 891f99226..c7692851c 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.cpp +++ b/renderdoc/driver/d3d12/d3d12_replay.cpp @@ -504,7 +504,7 @@ std::string D3D12Replay::DisassembleShader(ResourceId pipeline, const ShaderRefl if(!sh) return "; Invalid Shader Specified"; - DXBC::DXBCFile *dxbc = sh->GetDXBC(); + DXBC::DXBCContainer *dxbc = sh->GetDXBC(); if(target == DXBCDisassemblyTarget || target.empty()) return dxbc->GetDisassembly(); diff --git a/renderdoc/driver/d3d12/d3d12_resources.cpp b/renderdoc/driver/d3d12/d3d12_resources.cpp index ebad45867..459f15fbd 100644 --- a/renderdoc/driver/d3d12/d3d12_resources.cpp +++ b/renderdoc/driver/d3d12/d3d12_resources.cpp @@ -36,13 +36,13 @@ const GUID RENDERDOC_ID3D12ShaderGUID_ShaderDebugMagicValue = RENDERDOC_ShaderDe void WrappedID3D12Shader::TryReplaceOriginalByteCode() { - if(!DXBC::DXBCFile::CheckForDebugInfo((const void *)&m_Bytecode[0], m_Bytecode.size())) + if(!DXBC::DXBCContainer::CheckForDebugInfo((const void *)&m_Bytecode[0], m_Bytecode.size())) { std::string originalPath = m_DebugInfoPath; if(originalPath.empty()) originalPath = - DXBC::DXBCFile::GetDebugBinaryPath((const void *)&m_Bytecode[0], m_Bytecode.size()); + DXBC::DXBCContainer::GetDebugBinaryPath((const void *)&m_Bytecode[0], m_Bytecode.size()); if(!originalPath.empty()) { @@ -128,8 +128,8 @@ void WrappedID3D12Shader::TryReplaceOriginalByteCode() memcpy(&originalBytecode[0], &decompressed[0], originalBytecode.size()); } - if(DXBC::DXBCFile::CheckForDebugInfo((const void *)&originalBytecode[0], - originalBytecode.size())) + if(DXBC::DXBCContainer::CheckForDebugInfo((const void *)&originalBytecode[0], + originalBytecode.size())) { m_Bytecode.swap(originalBytecode); } diff --git a/renderdoc/driver/d3d12/d3d12_resources.h b/renderdoc/driver/d3d12/d3d12_resources.h index 76880c425..7130e860d 100644 --- a/renderdoc/driver/d3d12/d3d12_resources.h +++ b/renderdoc/driver/d3d12/d3d12_resources.h @@ -24,7 +24,7 @@ #pragma once -#include "driver/shaders/dxbc/dxbc_inspect.h" +#include "driver/shaders/dxbc/dxbc_container.h" #include "d3d12_device.h" #include "d3d12_manager.h" @@ -639,7 +639,7 @@ public: DXBCKey(const D3D12_SHADER_BYTECODE &byteCode) { byteLen = (uint32_t)byteCode.BytecodeLength; - DXBC::DXBCFile::GetHash(hash, byteCode.pShaderBytecode, byteCode.BytecodeLength); + DXBC::DXBCContainer::GetHash(hash, byteCode.pShaderBytecode, byteCode.BytecodeLength); } // assume that byte length + hash is enough to uniquely identify a shader bytecode @@ -750,12 +750,12 @@ public: return ret; } - DXBC::DXBCFile *GetDXBC() + DXBC::DXBCContainer *GetDXBC() { if(m_DXBCFile == NULL && !m_Bytecode.empty()) { TryReplaceOriginalByteCode(); - m_DXBCFile = new DXBC::DXBCFile((const void *)&m_Bytecode[0], m_Bytecode.size()); + m_DXBCFile = new DXBC::DXBCContainer((const void *)&m_Bytecode[0], m_Bytecode.size()); } return m_DXBCFile; } @@ -790,7 +790,7 @@ public: std::vector m_Bytecode; bool m_Built; - DXBC::DXBCFile *m_DXBCFile; + DXBC::DXBCContainer *m_DXBCFile; ShaderReflection m_Details; ShaderBindpointMapping m_Mapping; diff --git a/renderdoc/driver/d3d12/d3d12_shader_cache.cpp b/renderdoc/driver/d3d12/d3d12_shader_cache.cpp index 6c9987989..c5082d55e 100644 --- a/renderdoc/driver/d3d12/d3d12_shader_cache.cpp +++ b/renderdoc/driver/d3d12/d3d12_shader_cache.cpp @@ -25,7 +25,7 @@ #include "d3d12_shader_cache.h" #include "common/shader_cache.h" #include "driver/dx/official/d3dcompiler.h" -#include "driver/shaders/dxbc/dxbc_inspect.h" +#include "driver/shaders/dxbc/dxbc_container.h" #include "strings/string_utils.h" typedef HRESULT(WINAPI *pD3DCreateBlob)(SIZE_T Size, ID3DBlob **ppBlob); diff --git a/renderdoc/driver/ihv/amd/amd_isa.h b/renderdoc/driver/ihv/amd/amd_isa.h index 3a0b70cf4..975bc0bef 100644 --- a/renderdoc/driver/ihv/amd/amd_isa.h +++ b/renderdoc/driver/ihv/amd/amd_isa.h @@ -27,11 +27,6 @@ #include #include "api/replay/renderdoc_replay.h" -namespace DXBC -{ -class DXBCFile; -}; - namespace GCNISA { void GetTargets(GraphicsAPI api, std::vector &targets); diff --git a/renderdoc/driver/shaders/dxbc/dxbc_inspect.cpp b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp similarity index 98% rename from renderdoc/driver/shaders/dxbc/dxbc_inspect.cpp rename to renderdoc/driver/shaders/dxbc/dxbc_container.cpp index 454f7746b..435f5c515 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_inspect.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp @@ -23,7 +23,7 @@ * THE SOFTWARE. ******************************************************************************/ -#include "dxbc_inspect.h" +#include "dxbc_container.h" #include #include "api/app/renderdoc_app.h" #include "common/common.h" @@ -354,7 +354,8 @@ std::string TypeName(CBufferVariableType::Descriptor desc) return ret; } -CBufferVariableType DXBCFile::ParseRDEFType(RDEFHeader *h, char *chunkContents, uint32_t typeOffset) +CBufferVariableType DXBCContainer::ParseRDEFType(RDEFHeader *h, char *chunkContents, + uint32_t typeOffset) { if(m_Variables.find(typeOffset) != m_Variables.end()) return m_Variables[typeOffset]; @@ -451,7 +452,7 @@ CBufferVariableType DXBCFile::ParseRDEFType(RDEFHeader *h, char *chunkContents, return ret; } -void DXBCFile::GetHash(uint32_t hash[4], const void *ByteCode, size_t BytecodeLength) +void DXBCContainer::GetHash(uint32_t hash[4], const void *ByteCode, size_t BytecodeLength) { if(BytecodeLength < sizeof(FileHeader)) { @@ -464,7 +465,7 @@ void DXBCFile::GetHash(uint32_t hash[4], const void *ByteCode, size_t BytecodeLe memcpy(hash, header->hashValue, sizeof(header->hashValue)); } -bool DXBCFile::CheckForDebugInfo(const void *ByteCode, size_t ByteCodeLength) +bool DXBCContainer::CheckForDebugInfo(const void *ByteCode, size_t ByteCodeLength) { FileHeader *header = (FileHeader *)ByteCode; @@ -495,7 +496,7 @@ bool DXBCFile::CheckForDebugInfo(const void *ByteCode, size_t ByteCodeLength) return false; } -bool DXBCFile::CheckForShaderCode(const void *ByteCode, size_t ByteCodeLength) +bool DXBCContainer::CheckForShaderCode(const void *ByteCode, size_t ByteCodeLength) { FileHeader *header = (FileHeader *)ByteCode; @@ -520,7 +521,7 @@ bool DXBCFile::CheckForShaderCode(const void *ByteCode, size_t ByteCodeLength) return false; } -std::string DXBCFile::GetDebugBinaryPath(const void *ByteCode, size_t ByteCodeLength) +std::string DXBCContainer::GetDebugBinaryPath(const void *ByteCode, size_t ByteCodeLength) { std::string debugPath; FileHeader *header = (FileHeader *)ByteCode; @@ -559,7 +560,7 @@ std::string DXBCFile::GetDebugBinaryPath(const void *ByteCode, size_t ByteCodeLe return debugPath; } -DXBCFile::DXBCFile(const void *ByteCode, size_t ByteCodeLength) +DXBCContainer::DXBCContainer(const void *ByteCode, size_t ByteCodeLength) { m_DebugInfo = NULL; @@ -1308,7 +1309,7 @@ DXBCFile::DXBCFile(const void *ByteCode, size_t ByteCodeLength) } } -void DXBCFile::GuessResources() +void DXBCContainer::GuessResources() { char buf[64] = {0}; diff --git a/renderdoc/driver/shaders/dxbc/dxbc_inspect.h b/renderdoc/driver/shaders/dxbc/dxbc_container.h similarity index 98% rename from renderdoc/driver/shaders/dxbc/dxbc_inspect.h rename to renderdoc/driver/shaders/dxbc/dxbc_container.h index 8579b2105..b31aad5f8 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_inspect.h +++ b/renderdoc/driver/shaders/dxbc/dxbc_container.h @@ -338,11 +338,11 @@ ShaderCompileFlags EncodeFlags(const uint32_t flags); // declare one of these and pass in your shader bytecode, then inspect // the members that are populated with the shader information. -class DXBCFile +class DXBCContainer { public: - DXBCFile(const void *ByteCode, size_t ByteCodeLength); - ~DXBCFile() { SAFE_DELETE(m_DebugInfo); } + DXBCContainer(const void *ByteCode, size_t ByteCodeLength); + ~DXBCContainer() { SAFE_DELETE(m_DebugInfo); } D3D11_ShaderType m_Type; struct { @@ -396,8 +396,8 @@ public: static std::string GetDebugBinaryPath(const void *ByteCode, size_t ByteCodeLength); private: - DXBCFile(const DXBCFile &o); - DXBCFile &operator=(const DXBCFile &o); + DXBCContainer(const DXBCContainer &o); + DXBCContainer &operator=(const DXBCContainer &o); void FetchComputeProperties(); void FetchTypeVersion(); diff --git a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp index 1137a59b5..187ce9d05 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp @@ -26,7 +26,7 @@ #include "dxbc_debug.h" #include #include "maths/formatpacking.h" -#include "dxbc_inspect.h" +#include "dxbc_container.h" using namespace DXBC; diff --git a/renderdoc/driver/shaders/dxbc/dxbc_debug.h b/renderdoc/driver/shaders/dxbc/dxbc_debug.h index e6ab49416..788c8ce17 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_debug.h +++ b/renderdoc/driver/shaders/dxbc/dxbc_debug.h @@ -31,7 +31,7 @@ namespace DXBC { -class DXBCFile; +class DXBCContainer; struct CBufferVariable; } @@ -208,7 +208,7 @@ public: dxbc = NULL; RDCEraseEl(semantics); } - State(int quadIdx, const ShaderDebugTrace *t, DXBC::DXBCFile *f) + State(int quadIdx, const ShaderDebugTrace *t, DXBC::DXBCContainer *f) { quadIndex = quadIdx; nextInstruction = 0; @@ -268,7 +268,7 @@ private: VarType OperationType(const DXBC::OpcodeType &op) const; bool OperationFlushing(const DXBC::OpcodeType &op) const; - DXBC::DXBCFile *dxbc; + DXBC::DXBCContainer *dxbc; const ShaderDebugTrace *trace; }; diff --git a/renderdoc/driver/shaders/dxbc/dxbc_disassemble.cpp b/renderdoc/driver/shaders/dxbc/dxbc_disassemble.cpp index 17cd38740..9e1c8ad3b 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_disassemble.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_disassemble.cpp @@ -29,7 +29,7 @@ #include "core/core.h" #include "serialise/serialiser.h" #include "strings/string_utils.h" -#include "dxbc_inspect.h" +#include "dxbc_container.h" namespace DXBC { @@ -281,7 +281,7 @@ bool ASMOperand::operator==(const ASMOperand &o) const return true; } -void DXBCFile::FetchTypeVersion() +void DXBCContainer::FetchTypeVersion() { if(m_HexDump.empty()) return; @@ -294,7 +294,7 @@ void DXBCFile::FetchTypeVersion() m_Version.Minor = VersionToken::MinorVersion.Get(cur[0]); } -void DXBCFile::FetchComputeProperties() +void DXBCContainer::FetchComputeProperties() { if(m_HexDump.empty()) return; @@ -375,7 +375,7 @@ void DXBCFile::FetchComputeProperties() } } -void DXBCFile::DisassembleHexDump() +void DXBCContainer::DisassembleHexDump() { if(m_Disassembled) return; @@ -470,7 +470,7 @@ void DXBCFile::DisassembleHexDump() m_Instructions.push_back(implicitRet); } -void DXBCFile::MakeDisassemblyString() +void DXBCContainer::MakeDisassemblyString() { DisassembleHexDump(); @@ -633,7 +633,7 @@ void DXBCFile::MakeDisassemblyString() } } -bool DXBCFile::IsDeclaration(OpcodeType op) +bool DXBCContainer::IsDeclaration(OpcodeType op) { // isDecl means not a real instruction, just a declaration type token bool isDecl = false; @@ -646,7 +646,7 @@ bool DXBCFile::IsDeclaration(OpcodeType op) return isDecl; } -bool DXBCFile::ExtractOperand(uint32_t *&tokenStream, ToString flags, ASMOperand &retOper) +bool DXBCContainer::ExtractOperand(uint32_t *&tokenStream, ToString flags, ASMOperand &retOper) { uint32_t OperandToken0 = tokenStream[0]; @@ -837,7 +837,7 @@ const CBufferVariable *FindCBufferVar(const uint32_t minOffset, const uint32_t m return NULL; } -std::string ASMOperand::toString(DXBCFile *dxbc, ToString flags) const +std::string ASMOperand::toString(DXBCContainer *dxbc, ToString flags) const { std::string str, regstr; @@ -1287,7 +1287,7 @@ std::string ASMOperand::toString(DXBCFile *dxbc, ToString flags) const return str; } -bool DXBCFile::ExtractDecl(uint32_t *&tokenStream, ASMDecl &retDecl, bool friendlyName) +bool DXBCContainer::ExtractDecl(uint32_t *&tokenStream, ASMDecl &retDecl, bool friendlyName) { uint32_t *begin = tokenStream; uint32_t OpcodeToken0 = tokenStream[0]; @@ -2149,7 +2149,7 @@ bool DXBCFile::ExtractDecl(uint32_t *&tokenStream, ASMDecl &retDecl, bool friend return true; } -bool DXBCFile::ExtractOperation(uint32_t *&tokenStream, ASMOperation &retOp, bool friendlyName) +bool DXBCContainer::ExtractOperation(uint32_t *&tokenStream, ASMOperation &retOp, bool friendlyName) { uint32_t *begin = tokenStream; uint32_t OpcodeToken0 = tokenStream[0]; @@ -2427,7 +2427,7 @@ bool DXBCFile::ExtractOperation(uint32_t *&tokenStream, ASMOperation &retOp, boo // see http://msdn.microsoft.com/en-us/library/windows/desktop/bb219840(v=vs.85).aspx // for details of these opcodes -size_t DXBCFile::NumOperands(OpcodeType op) +size_t DXBCContainer::NumOperands(OpcodeType op) { switch(op) { diff --git a/renderdoc/driver/shaders/dxbc/dxbc_disassemble.h b/renderdoc/driver/shaders/dxbc/dxbc_disassemble.h index cd2daca61..2d1a68375 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_disassemble.h +++ b/renderdoc/driver/shaders/dxbc/dxbc_disassemble.h @@ -682,7 +682,7 @@ enum ComponentType // Main structures ///////////////////////////////////////////////////////////////////////// -class DXBCFile; +class DXBCContainer; struct ASMIndex; struct ASMDecl; @@ -721,7 +721,7 @@ struct ASMOperand bool operator==(const ASMOperand &o) const; - std::string toString(DXBCFile *dxbc, ToString flags) const; + std::string toString(DXBCContainer *dxbc, ToString flags) const; /////////////////////////////////////// diff --git a/renderdoc/driver/shaders/dxbc/dxbc_reflect.cpp b/renderdoc/driver/shaders/dxbc/dxbc_reflect.cpp index c58428c72..345fa9e99 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_reflect.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_reflect.cpp @@ -25,7 +25,7 @@ #include "dxbc_reflect.h" #include "api/replay/renderdoc_replay.h" #include "core/core.h" -#include "dxbc_inspect.h" +#include "dxbc_container.h" static ShaderConstant MakeConstantBufferVariable(const DXBC::CBufferVariable &var); @@ -99,7 +99,7 @@ static ShaderConstant MakeConstantBufferVariable(const DXBC::CBufferVariable &va return ret; } -static void MakeResourceList(bool srv, DXBC::DXBCFile *dxbc, +static void MakeResourceList(bool srv, DXBC::DXBCContainer *dxbc, const std::vector &in, rdcarray &mapping, rdcarray &refl) { @@ -195,7 +195,7 @@ static void MakeResourceList(bool srv, DXBC::DXBCFile *dxbc, } } -void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl, +void MakeShaderReflection(DXBC::DXBCContainer *dxbc, ShaderReflection *refl, ShaderBindpointMapping *mapping) { if(dxbc == NULL || !RenderDoc::Inst().IsReplayApp()) diff --git a/renderdoc/driver/shaders/dxbc/dxbc_reflect.h b/renderdoc/driver/shaders/dxbc/dxbc_reflect.h index 526342ce9..9c69aa977 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_reflect.h +++ b/renderdoc/driver/shaders/dxbc/dxbc_reflect.h @@ -26,7 +26,7 @@ namespace DXBC { -class DXBCFile; +class DXBCContainer; } struct ShaderReflection; @@ -34,5 +34,5 @@ struct ShaderBindpointMapping; #define D3Dx_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT 32 -void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl, +void MakeShaderReflection(DXBC::DXBCContainer *dxbc, ShaderReflection *refl, ShaderBindpointMapping *mapping); \ No newline at end of file diff --git a/renderdoc/driver/shaders/dxbc/dxbc_sdbg.cpp b/renderdoc/driver/shaders/dxbc/dxbc_sdbg.cpp index dfd37f6e2..e70a0e4bc 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_sdbg.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_sdbg.cpp @@ -23,7 +23,7 @@ * THE SOFTWARE. ******************************************************************************/ -#include "dxbc_inspect.h" +#include "dxbc_container.h" #include "dxbc_sdbg.h" diff --git a/renderdoc/driver/shaders/dxbc/dxbc_spdb.cpp b/renderdoc/driver/shaders/dxbc/dxbc_spdb.cpp index db0f7c07d..1ed5f4cbe 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_spdb.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_spdb.cpp @@ -24,7 +24,7 @@ ******************************************************************************/ #include -#include "dxbc_inspect.h" +#include "dxbc_container.h" #include "official/cvinfo.h" #include "dxbc_spdb.h" @@ -40,7 +40,7 @@ namespace DXBC { static const uint32_t FOURCC_SPDB = MAKE_FOURCC('S', 'P', 'D', 'B'); -SPDBChunk::SPDBChunk(DXBCFile *dxbc, void *chunk) +SPDBChunk::SPDBChunk(DXBCContainer *dxbc, void *chunk) { m_HasDebugInfo = false; diff --git a/renderdoc/driver/shaders/dxbc/dxbc_spdb.h b/renderdoc/driver/shaders/dxbc/dxbc_spdb.h index b10c1ce69..c882a5c85 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_spdb.h +++ b/renderdoc/driver/shaders/dxbc/dxbc_spdb.h @@ -259,7 +259,7 @@ struct LocalMapping class SPDBChunk : public DXBCDebugChunk { public: - SPDBChunk(DXBCFile *dxbc, void *data); + SPDBChunk(DXBCContainer *dxbc, void *data); SPDBChunk(const SPDBChunk &) = delete; SPDBChunk &operator=(const SPDBChunk &o) = delete; diff --git a/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj b/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj index 1f2f1351d..23650e805 100644 --- a/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj +++ b/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj @@ -102,7 +102,7 @@ - + @@ -114,7 +114,7 @@ - + diff --git a/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj.filters b/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj.filters index 45adb513d..ab9e157e8 100644 --- a/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj.filters +++ b/renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj.filters @@ -3,7 +3,6 @@ - PCH @@ -11,11 +10,11 @@ + - @@ -29,6 +28,7 @@ official +