diff --git a/renderdoc/driver/shaders/dxil/dxil_bytecode.h b/renderdoc/driver/shaders/dxil/dxil_bytecode.h index 0ff1bec60..96c38b36a 100644 --- a/renderdoc/driver/shaders/dxil/dxil_bytecode.h +++ b/renderdoc/driver/shaders/dxil/dxil_bytecode.h @@ -1144,9 +1144,9 @@ private: void assignTypeId(const Constant *c); }; -struct EntryPoint +struct EntryPointInterface { - EntryPoint(const Metadata *entryPoint); + EntryPointInterface(const Metadata *entryPoint); struct Signature { @@ -1276,7 +1276,7 @@ protected: uint32_t GetMetaSlot(const DebugLocation *l) const; void AssignMetaSlot(rdcarray &metaSlots, uint32_t &nextMetaSlot, DebugLocation &l); - void FetchEntryPoints(rdcarray &entryPoints); + void FetchEntryPointInterfaces(rdcarray &entryPointInterfaces); const Metadata *FindMetadata(uint32_t slot) const; rdcstr ArgToString(const Value *v, bool withTypes, const rdcstr &attrString = "") const; rdcstr DisassembleComDats(int &instructionLine) const; diff --git a/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp b/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp index 523876cff..b8620b5a8 100644 --- a/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp @@ -2193,11 +2193,11 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection) m_Disassembly += DisassembleGlobalVars(m_DisassemblyInstructionLine); // Decode entry points - rdcarray entryPoints; - FetchEntryPoints(entryPoints); + rdcarray entryPoints; + FetchEntryPointInterfaces(entryPoints); for(size_t e = 0; e < entryPoints.size(); ++e) { - EntryPoint &entryPoint = entryPoints[e]; + EntryPointInterface &entryPoint = entryPoints[e]; m_Disassembly += entryPoint.name + "()"; DisassemblyAddNewLine(); m_Disassembly += "{"; @@ -2205,7 +2205,7 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection) for(size_t i = 0; i < entryPoint.inputs.size(); ++i) { - EntryPoint::Signature &sig = entryPoint.inputs[i]; + EntryPointInterface::Signature &sig = entryPoint.inputs[i]; VarType varType = VarTypeForComponentType(sig.type); m_Disassembly += " Input[" + ToStr(i) + "] " + ToStr(varType).c_str(); @@ -2222,7 +2222,7 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection) for(size_t i = 0; i < entryPoint.outputs.size(); ++i) { - EntryPoint::Signature &sig = entryPoint.outputs[i]; + EntryPointInterface::Signature &sig = entryPoint.outputs[i]; VarType varType = VarTypeForComponentType(sig.type); m_Disassembly += " Output[" + ToStr(i) + "] " + ToStr(varType).c_str(); @@ -2240,7 +2240,7 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection) for(size_t i = 0; i < entryPoint.srvs.size(); ++i) { - EntryPoint::SRV &srv = entryPoint.srvs[i]; + EntryPointInterface::SRV &srv = entryPoint.srvs[i]; if(srv.name.empty() && reflection) { for(DXBC::ShaderInputBind bind : reflection->SRVs) @@ -2267,7 +2267,7 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection) for(size_t i = 0; i < entryPoint.uavs.size(); ++i) { - EntryPoint::UAV &uav = entryPoint.uavs[i]; + EntryPointInterface::UAV &uav = entryPoint.uavs[i]; if(uav.name.empty() && reflection) { for(DXBC::ShaderInputBind bind : reflection->UAVs) @@ -2293,7 +2293,7 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection) for(size_t i = 0; i < entryPoint.cbuffers.size(); ++i) { - EntryPoint::CBuffer &cbuffer = entryPoint.cbuffers[i]; + EntryPointInterface::CBuffer &cbuffer = entryPoint.cbuffers[i]; const DXBC::CBuffer *cbufferRefl = NULL; if(reflection) { @@ -2344,7 +2344,7 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection) for(size_t i = 0; i < entryPoint.samplers.size(); ++i) { - EntryPoint::Sampler &sampler = entryPoint.samplers[i]; + EntryPointInterface::Sampler &sampler = entryPoint.samplers[i]; if(sampler.name.empty() && reflection) { for(DXBC::ShaderInputBind s : reflection->Samplers) @@ -2371,7 +2371,7 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection) DisassemblyAddNewLine(); - EntryPoint &entryPoint = entryPoints[0]; + EntryPointInterface &entryPoint = entryPoints[0]; for(size_t i = 0; i < m_Functions.size(); i++) { const Function &func = *m_Functions[i]; @@ -2381,7 +2381,7 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection) if(func.external) continue; - for(EntryPoint &ep : entryPoints) + for(EntryPointInterface &ep : entryPoints) { if(func.name == ep.name) { diff --git a/renderdoc/driver/shaders/dxil/dxil_reflect.cpp b/renderdoc/driver/shaders/dxil/dxil_reflect.cpp index 5109cfaa8..7470471c5 100644 --- a/renderdoc/driver/shaders/dxil/dxil_reflect.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_reflect.cpp @@ -268,7 +268,7 @@ struct TypeInfo } }; -EntryPoint::Signature::Signature(const Metadata *signature) +EntryPointInterface::Signature::Signature(const Metadata *signature) { /* // Extended properties @@ -287,7 +287,7 @@ EntryPoint::Signature::Signature(const Metadata *signature) startCol = getival(signature->children[SignatureElement::StartCol]); } -EntryPoint ::ResourceBase::ResourceBase(const Metadata *resourceBase) +EntryPointInterface::ResourceBase::ResourceBase(const Metadata *resourceBase) { id = getival(resourceBase->children[(size_t)ResField::ID]); type = resourceBase->children[(size_t)ResField::VarDecl]->type; @@ -297,7 +297,7 @@ EntryPoint ::ResourceBase::ResourceBase(const Metadata *resourceBase) regCount = getival(resourceBase->children[(size_t)ResField::RegCount]); } -EntryPoint::SRV::SRV(const Metadata *srv) : ResourceBase(srv) +EntryPointInterface::SRV::SRV(const Metadata *srv) : ResourceBase(srv) { shape = getival(srv->children[(size_t)ResField::SRVShape]); sampleCount = getival(srv->children[(size_t)ResField::SRVSampleCount]); @@ -319,7 +319,7 @@ EntryPoint::SRV::SRV(const Metadata *srv) : ResourceBase(srv) } } -EntryPoint::UAV::UAV(const Metadata *uav) : ResourceBase(uav) +EntryPointInterface::UAV::UAV(const Metadata *uav) : ResourceBase(uav) { shape = getival(uav->children[(size_t)ResField::UAVShape]); globallCoherent = (getival(uav->children[(size_t)ResField::UAVGloballyCoherent]) == 1); @@ -349,7 +349,7 @@ EntryPoint::UAV::UAV(const Metadata *uav) : ResourceBase(uav) } } -EntryPoint::CBuffer::CBuffer(const Metadata *cbuffer) : ResourceBase(cbuffer) +EntryPointInterface::CBuffer::CBuffer(const Metadata *cbuffer) : ResourceBase(cbuffer) { sizeInBytes = getival(cbuffer->children[(size_t)ResField::CBufferByteSize]); const Metadata *tags = cbuffer->children[(size_t)ResField::CBufferTags]; @@ -362,12 +362,12 @@ EntryPoint::CBuffer::CBuffer(const Metadata *cbuffer) : ResourceBase(cbuffer) } } -EntryPoint::Sampler::Sampler(const Metadata *sampler) : ResourceBase(sampler) +EntryPointInterface::Sampler::Sampler(const Metadata *sampler) : ResourceBase(sampler) { samplerType = getival(sampler->children[(size_t)ResField::SamplerType]); } -EntryPoint::EntryPoint(const Metadata *entryPoint) +EntryPointInterface::EntryPointInterface(const Metadata *entryPoint) { function = entryPoint->children[0]->type; name = entryPoint->children[1]->str; @@ -457,20 +457,6 @@ EntryPoint::EntryPoint(const Metadata *entryPoint) } } -struct EntryPointsInfo -{ - EntryPointsInfo(const Metadata *entryPoints) - { - if(!entryPoints) - return; - - for(size_t c = 0; c < entryPoints->children.size(); ++c) - entryPointsData.emplace_back(entryPoints->children[c]); - } - - rdcarray entryPointsData; -}; - static DXBC::CBufferVariableType MakePayloadType(const TypeInfo &typeInfo, const Type *t) { using namespace DXBC; @@ -557,12 +543,16 @@ static DXBC::CBufferVariableType MakePayloadType(const TypeInfo &typeInfo, const return ret; } -void Program::FetchEntryPoints(rdcarray &entryPoints) +void Program::FetchEntryPointInterfaces(rdcarray &entryPointInterfaces) { DXMeta dx(m_NamedMeta); - EntryPointsInfo entryPointsInfo(dx.entryPoints); - entryPoints = entryPointsInfo.entryPointsData; + entryPointInterfaces.clear(); + if(!dx.entryPoints) + return; + + for(size_t c = 0; c < dx.entryPoints->children.size(); ++c) + entryPointInterfaces.emplace_back(dx.entryPoints->children[c]); } void Program::FetchComputeProperties(DXBC::Reflection *reflection)