summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-09-17 20:28:10 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-09-17 20:28:10 +0000
commit6bccf55c08b641ee2b0ae0df1e5908e28e52e612 (patch)
tree7237eed479980235e6987e6868eacb88f9ae96b8 /Graphics/GraphicsEngineD3D12
parentAdded UnifiedMemoryCPUAccess member to GraphicsAdapterInfo struct (API Versio... (diff)
parentdon't link with vulkan if used volk, added shader name to log message (diff)
downloadDiligentCore-6bccf55c08b641ee2b0ae0df1e5908e28e52e612.tar.gz
DiligentCore-6bccf55c08b641ee2b0ae0df1e5908e28e52e612.zip
Merge branch 'mesh_shader_fix' of https://github.com/azhirnov/DiligentCore into azhirnov-mesh_shader_fix
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.hpp3
-rw-r--r--Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.hpp2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/RootSignature.hpp4
-rw-r--r--Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp6
-rw-r--r--Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp1
5 files changed, 7 insertions, 9 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.hpp
index e14903dd..91c1610a 100644
--- a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.hpp
+++ b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.hpp
@@ -260,9 +260,6 @@ public:
/// Implementation of IDeviceContextD3D12::ID3D12GraphicsCommandList() in Direct3D12 backend.
virtual ID3D12GraphicsCommandList* DILIGENT_CALL_TYPE GetD3D12CommandList() override final;
- ///// Number of different shader types (Vertex, Pixel, Geometry, Domain, Hull, Compute)
- //static constexpr int NumShaderTypes = 6;
-
void UpdateBufferRegion(class BufferD3D12Impl* pBuffD3D12,
D3D12DynamicAllocation& Allocation,
Uint64 DstOffset,
diff --git a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.hpp
index 7e5b5fdd..b4d2fce9 100644
--- a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.hpp
+++ b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.hpp
@@ -129,7 +129,7 @@ private:
ShaderResourceCacheD3D12* m_pStaticResourceCaches = nullptr;
ShaderVariableManagerD3D12* m_pStaticVarManagers = nullptr;
// Resource layout index in m_ResourceLayouts[] array for every shader stage
- Int8 m_ResourceLayoutIndex[6] = {-1, -1, -1, -1, -1, -1};
+ std::array<Int8, NUM_SHADER_TYPES> m_ResourceLayoutIndex;
};
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineD3D12/include/RootSignature.hpp b/Graphics/GraphicsEngineD3D12/include/RootSignature.hpp
index a3bc8d11..c62c8198 100644
--- a/Graphics/GraphicsEngineD3D12/include/RootSignature.hpp
+++ b/Graphics/GraphicsEngineD3D12/include/RootSignature.hpp
@@ -474,9 +474,9 @@ private:
// in m_RootParams (NOT the Root Index!), for every variable type
// (static, mutable, dynamic) and every shader type,
// or -1, if the table is not yet assigned to the combination
- std::array<Uint8, SHADER_RESOURCE_VARIABLE_TYPE_NUM_TYPES * 6> m_SrvCbvUavRootTablesMap;
+ std::array<Uint8, SHADER_RESOURCE_VARIABLE_TYPE_NUM_TYPES * NUM_SHADER_TYPES> m_SrvCbvUavRootTablesMap;
// This array contains the same data for Sampler root table
- std::array<Uint8, SHADER_RESOURCE_VARIABLE_TYPE_NUM_TYPES * 6> m_SamplerRootTablesMap;
+ std::array<Uint8, SHADER_RESOURCE_VARIABLE_TYPE_NUM_TYPES * NUM_SHADER_TYPES> m_SamplerRootTablesMap;
RootParamsManager m_RootParams;
diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp
index 09854e17..7c83ddbf 100644
--- a/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp
+++ b/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp
@@ -80,9 +80,9 @@ private:
ShaderResourceCacheD3D12 m_ShaderResourceCache;
ShaderVariableManagerD3D12* m_pShaderVarMgrs = nullptr;
// Resource layout index in m_ResourceLayouts[] array for every shader stage
- Int8 m_ResourceLayoutIndex[6] = {-1, -1, -1, -1, -1, -1};
- bool m_bStaticResourcesInitialized = false;
- const Uint8 m_NumShaders = 0;
+ std::array<Int8, NUM_SHADER_TYPES> m_ResourceLayoutIndex;
+ bool m_bStaticResourcesInitialized = false;
+ const Uint8 m_NumShaders = 0;
};
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp
index 19ad36bc..94d65cda 100644
--- a/Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp
@@ -48,6 +48,7 @@ ShaderResourceBindingD3D12Impl::ShaderResourceBindingD3D12Impl(IReferenceCounter
m_NumShaders {static_cast<decltype(m_NumShaders)>(pPSO->GetNumShaders())}
// clang-format on
{
+ m_ResourceLayoutIndex.fill(-1);
auto* ppShaders = pPSO->GetShaders();
auto* pRenderDeviceD3D12Impl = ValidatedCast<RenderDeviceD3D12Impl>(pPSO->GetDevice());