From 2771c71fad9cc4311c287ad119d078662ef52c29 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sat, 22 Aug 2020 20:26:49 -0700 Subject: Added USAGE_UNIFIED usage type (API 240066) --- Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Graphics/GraphicsEngineD3D11') diff --git a/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp index bd0eaaf1..65b49ba0 100644 --- a/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp @@ -55,10 +55,15 @@ BufferD3D11Impl::BufferD3D11Impl(IReferenceCounters* pRefCounters, } // clang-format on { -#define LOG_BUFFER_ERROR_AND_THROW(...) LOG_ERROR_AND_THROW("Buffer \"", m_Desc.Name ? m_Desc.Name : "", "\": ", ##__VA_ARGS__); + ValidateBufferInitData(BuffDesc, pBuffData); - if (m_Desc.Usage == USAGE_STATIC && (pBuffData == nullptr || pBuffData->pData == nullptr)) - LOG_BUFFER_ERROR_AND_THROW("Static buffer must be initialized with data at creation time"); + if (m_Desc.Usage == USAGE_UNIFIED) + { + DecayUnifiedBuffer(); + } + + if (m_Desc.Usage == USAGE_STATIC) + VERIFY(pBuffData != nullptr && pBuffData->pData != nullptr, "Initial data must not be null for static buffers"); if (m_Desc.BindFlags & BIND_UNIFORM_BUFFER) { -- cgit v1.2.3