Go to the documentation of this file.
34 #include <unordered_map>
63 return m_pShaderResources->GetTotalResources();
69 ResourceDesc = m_pShaderResources->GetHLSLShaderResourceDesc(Index);
75 ResourceDesc = m_pShaderResources->GetHLSLShaderResourceDesc(Index);
88 const std::shared_ptr<const ShaderResourcesD3D11>&
GetShaderResources()
const {
return m_pShaderResources; }
90 ID3D11DeviceChild*
GetD3D11Shader(ID3DBlob* pBlob) noexcept(
false);
96 CComPtr<ID3DBlob> pBlob;
98 explicit BlobHashKey(ID3DBlob* _pBlob) :
113 if (Hash != rhs.Hash)
116 const auto Size0 = pBlob->GetBufferSize();
117 const auto Size1 = rhs.pBlob->GetBufferSize();
121 return memcmp(pBlob->GetBufferPointer(), rhs.pBlob->GetBufferPointer(), Size0) == 0;
127 const auto* pData =
reinterpret_cast<const Uint32*
>(pBlob->GetBufferPointer());
128 const auto Size = pBlob->GetBufferSize();
129 VERIFY(Size % 4 == 0,
"Bytecode size is expected to be a multiple of 4");
131 for (
Uint32 i = 0; i < Size / 4; ++i)
139 std::mutex m_d3dShaderCacheMtx;
140 std::unordered_map<BlobHashKey, CComPtr<ID3D11DeviceChild>, BlobHashKey::Hasher> m_d3dShaderCache;
144 std::shared_ptr<const ShaderResourcesD3D11> m_pShaderResources;
~ShaderD3D11Impl()
Definition: ShaderD3D11Impl.cpp:110
Base interface for a reference counter object that stores the number of strong and weak references an...
Definition: ReferenceCounters.h:44
virtual void GetHLSLResource(Uint32 Index, HLSLShaderResourceDesc &ResourceDesc) const override final
Implementation of IShaderD3D::GetHLSLResource() method.
Definition: ShaderD3D11Impl.hpp:73
virtual void GetResourceDesc(Uint32 Index, ShaderResourceDesc &ResourceDesc) const override final
Implementation of IShader::GetResource() in Direct3D11 backend.
Definition: ShaderD3D11Impl.hpp:67
Base interface for all dynamic objects in the engine.
Definition: Object.h:41
HLSL resource description.
Definition: ShaderD3D.h:46
Template class implementing base functionality of the shader object.
Definition: ShaderBase.hpp:49
bool operator==(const Plane3D &p1, const Plane3D &p2)
Definition: AdvancedMath.hpp:442
virtual Uint32 GetResourceCount() const override final
Implementation of IShader::GetResourceCount() in Direct3D11 backend.
Definition: ShaderD3D11Impl.hpp:61
Shader creation attributes.
Definition: Shader.h:241
Unique interface identifier.
Definition: InterfaceID.h:37
ShaderD3D11Impl(IReferenceCounters *pRefCounters, class RenderDeviceD3D11Impl *pRenderDeviceD3D11, const ShaderCreateInfo &ShaderCI)
Definition: ShaderD3D11Impl.cpp:87
size_t operator()(const BlobHashKey &Key) const
Definition: ShaderD3D11Impl.hpp:105
ID3DBlob * GetBytecode()
Definition: ShaderD3D11Impl.hpp:86
virtual void QueryInterface(const INTERFACE_ID &IID, IObject **ppInterface) override final
Definition: ShaderD3D11Impl.cpp:114
#define DILIGENT_CALL_TYPE
Definition: CommonDefinitions.h:45
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
std::size_t ComputeHash(const ArgsType &... Args)
Definition: HashUtils.hpp:57
virtual ID3D11DeviceChild * GetD3D11Shader() override final
Implementation of IShaderD3D11::GetD3D11Shader() method.
Definition: ShaderD3D11Impl.hpp:79
Shader implementation in Direct3D11 backend.
Definition: ShaderD3D11Impl.hpp:48
Shader resource description.
Definition: Shader.h:390
Base implementation of a D3D shader.
Definition: ShaderD3DBase.hpp:40
Definition: ShaderD3D11Impl.hpp:103
#define VERIFY(...)
Definition: DebugUtilities.hpp:76
Render device implementation in Direct3D11 backend.
Definition: RenderDeviceD3D11Impl.hpp:40
const std::shared_ptr< const ShaderResourcesD3D11 > & GetShaderResources() const
Definition: ShaderD3D11Impl.hpp:88
CComPtr< ID3DBlob > m_pShaderByteCode
Definition: ShaderD3DBase.hpp:46
void HashCombine(std::size_t &Seed, const T &Val)
Definition: HashUtils.hpp:44
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37