summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorazhirnov <zh1dron@gmail.com>2021-03-04 13:23:50 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-03-19 00:38:14 +0000
commit44fe2cc66cdc8d81f8e1595689ed1ec7ffea56b6 (patch)
tree2859d94f4f907c744e95c5ffdbb91788125ca682 /Graphics/GraphicsEngineD3D12
parentVulkan: update for new Vulkan SDK (diff)
downloadDiligentCore-44fe2cc66cdc8d81f8e1595689ed1ec7ffea56b6.tar.gz
DiligentCore-44fe2cc66cdc8d81f8e1595689ed1ec7ffea56b6.zip
OpenGL: added SRB memory allocator, some minor improvements
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/include/PipelineResourceSignatureD3D12Impl.hpp5
-rw-r--r--Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.hpp2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.hpp8
-rw-r--r--Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp10
5 files changed, 9 insertions, 18 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/PipelineResourceSignatureD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/PipelineResourceSignatureD3D12Impl.hpp
index 99148ae7..4dc06446 100644
--- a/Graphics/GraphicsEngineD3D12/include/PipelineResourceSignatureD3D12Impl.hpp
+++ b/Graphics/GraphicsEngineD3D12/include/PipelineResourceSignatureD3D12Impl.hpp
@@ -233,11 +233,6 @@ public:
bool IsCompatibleWith(const PipelineResourceSignatureD3D12Impl& Other) const;
- bool IsIncompatibleWith(const PipelineResourceSignatureD3D12Impl& Other) const
- {
- return GetHash() != Other.GetHash();
- }
-
SRBMemoryAllocator& GetSRBMemoryAllocator()
{
return m_SRBMemAllocator;
diff --git a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.hpp
index f054f210..dd9f2344 100644
--- a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.hpp
+++ b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.hpp
@@ -101,6 +101,8 @@ private:
SHADER_TYPE Type = SHADER_TYPE_UNKNOWN;
std::vector<ShaderD3D12Impl*> Shaders;
std::vector<CComPtr<ID3DBlob>> ByteCodes;
+
+ friend SHADER_TYPE GetShaderStageType(const ShaderStageInfo& Stage) { return Stage.Type; }
};
using TShaderStages = std::vector<ShaderStageInfo>;
diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp
index 395cc66b..498c6ea4 100644
--- a/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp
+++ b/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp
@@ -67,7 +67,7 @@ private:
void Destruct();
ShaderResourceCacheD3D12 m_ShaderResourceCache;
- ShaderVariableManagerD3D12* m_pShaderVarMgrs = nullptr;
+ ShaderVariableManagerD3D12* m_pShaderVarMgrs = nullptr; // [GetNumShaders()]
};
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.hpp b/Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.hpp
index 5923c5b8..ddcb29bf 100644
--- a/Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.hpp
+++ b/Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.hpp
@@ -167,10 +167,10 @@ public:
{}
// clang-format off
- ShaderVariableD3D12Impl (const ShaderVariableD3D12Impl&) = delete;
- ShaderVariableD3D12Impl (ShaderVariableD3D12Impl&&) = delete;
- ShaderVariableD3D12Impl& operator= (const ShaderVariableD3D12Impl&) = delete;
- ShaderVariableD3D12Impl& operator= (ShaderVariableD3D12Impl&&) = delete;
+ ShaderVariableD3D12Impl (const ShaderVariableD3D12Impl&) = delete;
+ ShaderVariableD3D12Impl ( ShaderVariableD3D12Impl&&) = delete;
+ ShaderVariableD3D12Impl& operator= (const ShaderVariableD3D12Impl&) = delete;
+ ShaderVariableD3D12Impl& operator= ( ShaderVariableD3D12Impl&&) = delete;
// clang-format on
virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final
diff --git a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp
index 2dfd4587..c240b4ab 100644
--- a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp
@@ -553,14 +553,8 @@ void PipelineStateD3D12Impl::InitRootSignature(const PipelineStateCreateInfo& Cr
}
else
{
- Uint32 MaxSignatureBindingIndex = 0;
- for (Uint32 i = 0; i < CreateInfo.ResourceSignaturesCount; ++i)
- {
- const auto* pSignature = ValidatedCast<const PipelineResourceSignatureD3D12Impl>(CreateInfo.ppResourceSignatures[i]);
- VERIFY(pSignature != nullptr, "Pipeline resource signature at index ", i, " is null. This error should've been caught by ValidatePipelineResourceSignatures.");
- MaxSignatureBindingIndex = std::max(MaxSignatureBindingIndex, Uint32{pSignature->GetDesc().BindingIndex});
- }
- SignatureCount = MaxSignatureBindingIndex + 1;
+ Uint32 MaxSignatureBindingIndex = PipelineResourceSignatureD3D12Impl::CalcMaxSignatureBindIndex(CreateInfo.ResourceSignaturesCount, CreateInfo.ppResourceSignatures);
+ SignatureCount = MaxSignatureBindingIndex + 1;
m_ResourceSignatures.reset(new RefCntAutoPtr<PipelineResourceSignatureD3D12Impl>[SignatureCount]);
auto DbgMaxSignatureBindingIndex =