From b981b4a269cdca5cfb78df741a2016e3c9c9afb8 Mon Sep 17 00:00:00 2001 From: assiduous Date: Thu, 18 Feb 2021 13:27:48 -0800 Subject: Few minor updates to BufferD3D12Impl and BufferViewD3D12Impl --- .../include/BufferD3D12Impl.hpp | 24 +++++++++++----------- .../include/BufferViewD3D12Impl.hpp | 2 -- .../GraphicsEngineD3D12/src/BufferD3D12Impl.cpp | 4 +++- 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.hpp index 74d5c38c..33dde6e4 100644 --- a/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.hpp +++ b/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.hpp @@ -49,18 +49,18 @@ class BufferD3D12Impl final : public BufferBase; - BufferD3D12Impl(IReferenceCounters* pRefCounters, - FixedBlockMemoryAllocator& BuffViewObjMemAllocator, - class RenderDeviceD3D12Impl* pDeviceD3D12, - const BufferDesc& BuffDesc, - const BufferData* pBuffData = nullptr); - - BufferD3D12Impl(IReferenceCounters* pRefCounters, - FixedBlockMemoryAllocator& BuffViewObjMemAllocator, - class RenderDeviceD3D12Impl* pDeviceD3D12, - const BufferDesc& BuffDesc, - RESOURCE_STATE InitialState, - ID3D12Resource* pd3d12Buffer); + BufferD3D12Impl(IReferenceCounters* pRefCounters, + FixedBlockMemoryAllocator& BuffViewObjMemAllocator, + RenderDeviceD3D12Impl* pDeviceD3D12, + const BufferDesc& BuffDesc, + const BufferData* pBuffData = nullptr); + + BufferD3D12Impl(IReferenceCounters* pRefCounters, + FixedBlockMemoryAllocator& BuffViewObjMemAllocator, + RenderDeviceD3D12Impl* pDeviceD3D12, + const BufferDesc& BuffDesc, + RESOURCE_STATE InitialState, + ID3D12Resource* pd3d12Buffer); ~BufferD3D12Impl(); IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_BufferD3D12, TBufferBase) diff --git a/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.hpp index 326bee06..74d541e1 100644 --- a/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.hpp +++ b/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.hpp @@ -39,8 +39,6 @@ namespace Diligent { -class FixedBlockMemoryAllocator; - /// Buffer view implementation in Direct3D12 backend. class BufferViewD3D12Impl final : public BufferViewBase { diff --git a/Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp index ac5d94d1..5bb96c8c 100644 --- a/Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp @@ -94,7 +94,9 @@ BufferD3D12Impl::BufferD3D12Impl(IReferenceCounters* pRefCounters, m_Desc.uiSizeInBytes = (m_Desc.uiSizeInBytes + AlignmentMask) & (~AlignmentMask); - if (m_Desc.Usage == USAGE_DYNAMIC && (m_Desc.BindFlags & BIND_UNORDERED_ACCESS) == 0 && BuffDesc.Mode != BUFFER_MODE_FORMATTED) + if ((m_Desc.Usage == USAGE_DYNAMIC) && + (m_Desc.BindFlags & BIND_UNORDERED_ACCESS) == 0 && + (BuffDesc.Mode == BUFFER_MODE_UNDEFINED || BuffDesc.Mode == BUFFER_MODE_STRUCTURED)) { // Dynamic constant/vertex/index buffers are suballocated in the upload heap when Map() is called. // Dynamic buffers with UAV flags as well as formatted buffers need to be allocated in GPU-only memory. -- cgit v1.2.3