summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-03-07 18:11:56 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-03-19 00:38:16 +0000
commit176e4de5f14b5332d58f02dc6088ea751189ebba (patch)
treeb2ff0c4bbb60a71c170fa0877bcb93ede42694a7 /Graphics/GraphicsEngineD3D12
parentUnified resource signature handling by pipeline state in D3D12, Vk and GL (diff)
downloadDiligentCore-176e4de5f14b5332d58f02dc6088ea751189ebba.tar.gz
DiligentCore-176e4de5f14b5332d58f02dc6088ea751189ebba.zip
Reworked non-separable programs in GL; added more PSO and PRS validation
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/D3D12DynamicHeap.cpp3
-rw-r--r--Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp8
-rw-r--r--Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp6
3 files changed, 10 insertions, 7 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/D3D12DynamicHeap.cpp b/Graphics/GraphicsEngineD3D12/src/D3D12DynamicHeap.cpp
index 03f52354..aac0bf87 100644
--- a/Graphics/GraphicsEngineD3D12/src/D3D12DynamicHeap.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/D3D12DynamicHeap.cpp
@@ -58,7 +58,8 @@ D3D12DynamicPage::D3D12DynamicPage(ID3D12Device* pd3d12Device, Uint64 Size)
ResourceDesc.Width = Size;
auto hr = pd3d12Device->CreateCommittedResource(&HeapProps, D3D12_HEAP_FLAG_NONE, &ResourceDesc,
- DefaultUsage, nullptr, __uuidof(m_pd3d12Buffer), reinterpret_cast<void**>(static_cast<ID3D12Resource**>(&m_pd3d12Buffer)));
+ DefaultUsage, nullptr, __uuidof(m_pd3d12Buffer),
+ reinterpret_cast<void**>(static_cast<ID3D12Resource**>(&m_pd3d12Buffer)));
if (FAILED(hr))
{
LOG_D3D_ERROR(hr, "Failed to create dynamic page");
diff --git a/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp
index 7d913990..088a052e 100644
--- a/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp
@@ -63,7 +63,7 @@ inline bool ResourcesCompatible(const PipelineResourceSignatureD3D12Impl::Resour
// clang-format on
}
-void ValidateD3D12PipelineResourceSignatureDesc(const PipelineResourceSignatureDesc& Desc) noexcept(false)
+void ValidatePipelineResourceSignatureDescD3D12(const PipelineResourceSignatureDesc& Desc) noexcept(false)
{
{
std::unordered_multimap<HashMapStringKey, SHADER_TYPE, HashMapStringKey::Hasher> ResNameToShaderStages;
@@ -113,7 +113,7 @@ void ValidateD3D12PipelineResourceSignatureDesc(const PipelineResourceSignatureD
else
{
LOG_ERROR_AND_THROW("Pipeline resource signature '", (Desc.Name != nullptr ? Desc.Name : ""),
- "' defines immutable sampler with the name '", Name, "' in shader stages ",
+ "' defines separate immutable samplers with the name '", Name, "' in shader stages ",
GetShaderStagesString(multi_stage_it->second), " and ",
GetShaderStagesString(it->second),
". In Direct3D12 backend, only one immutable sampler in the group of samplers with the same name can be shared between more than "
@@ -135,10 +135,10 @@ PipelineResourceSignatureD3D12Impl::PipelineResourceSignatureD3D12Impl(IReferenc
TPipelineResourceSignatureBase{pRefCounters, pDevice, Desc, bIsDeviceInternal},
m_SRBMemAllocator{GetRawAllocator()}
{
- ValidateD3D12PipelineResourceSignatureDesc(Desc);
-
try
{
+ ValidatePipelineResourceSignatureDescD3D12(Desc);
+
auto& RawAllocator{GetRawAllocator()};
auto MemPool = ReserveSpace(RawAllocator, Desc,
[&Desc](FixedLinearAllocator& MemPool) //
diff --git a/Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp
index ce8b702f..9958d158 100644
--- a/Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp
@@ -229,7 +229,8 @@ TextureD3D12Impl::TextureD3D12Impl(IReferenceCounters* pRefCounters,
CComPtr<ID3D12Resource> UploadBuffer;
hr = pd3d12Device->CreateCommittedResource(&UploadHeapProps, D3D12_HEAP_FLAG_NONE,
&BufferDesc, D3D12_RESOURCE_STATE_GENERIC_READ,
- nullptr, __uuidof(UploadBuffer), reinterpret_cast<void**>(static_cast<ID3D12Resource**>(&UploadBuffer)));
+ nullptr, __uuidof(UploadBuffer),
+ reinterpret_cast<void**>(static_cast<ID3D12Resource**>(&UploadBuffer)));
if (FAILED(hr))
LOG_ERROR_AND_THROW("Failed to create committed resource in an upload heap");
@@ -333,7 +334,8 @@ TextureD3D12Impl::TextureD3D12Impl(IReferenceCounters* pRefCounters,
// on some ARM systems, to marshal data between the CPU and GPU through memory addresses with write-back behavior.
// https://docs.microsoft.com/en-us/windows/desktop/api/d3d12/nf-d3d12-id3d12resource-map
auto hr = pd3d12Device->CreateCommittedResource(&StaginHeapProps, D3D12_HEAP_FLAG_NONE, &BufferDesc, D3D12State,
- nullptr, __uuidof(m_pd3d12Resource), reinterpret_cast<void**>(static_cast<ID3D12Resource**>(&m_pd3d12Resource)));
+ nullptr, __uuidof(m_pd3d12Resource),
+ reinterpret_cast<void**>(static_cast<ID3D12Resource**>(&m_pd3d12Resource)));
if (FAILED(hr))
LOG_ERROR_AND_THROW("Failed to create staging buffer");