From 176e4de5f14b5332d58f02dc6088ea751189ebba Mon Sep 17 00:00:00 2001 From: assiduous Date: Sun, 7 Mar 2021 10:11:56 -0800 Subject: Reworked non-separable programs in GL; added more PSO and PRS validation --- Graphics/GraphicsEngineD3D12/src/D3D12DynamicHeap.cpp | 3 ++- .../src/PipelineResourceSignatureD3D12Impl.cpp | 8 ++++---- Graphics/GraphicsEngineD3D12/src/TextureD3D12Impl.cpp | 6 ++++-- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'Graphics/GraphicsEngineD3D12') 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(static_cast(&m_pd3d12Buffer))); + DefaultUsage, nullptr, __uuidof(m_pd3d12Buffer), + reinterpret_cast(static_cast(&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 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 UploadBuffer; hr = pd3d12Device->CreateCommittedResource(&UploadHeapProps, D3D12_HEAP_FLAG_NONE, &BufferDesc, D3D12_RESOURCE_STATE_GENERIC_READ, - nullptr, __uuidof(UploadBuffer), reinterpret_cast(static_cast(&UploadBuffer))); + nullptr, __uuidof(UploadBuffer), + reinterpret_cast(static_cast(&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(static_cast(&m_pd3d12Resource))); + nullptr, __uuidof(m_pd3d12Resource), + reinterpret_cast(static_cast(&m_pd3d12Resource))); if (FAILED(hr)) LOG_ERROR_AND_THROW("Failed to create staging buffer"); -- cgit v1.2.3