summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-08-23 03:26:49 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-08-23 03:26:49 +0000
commit2771c71fad9cc4311c287ad119d078662ef52c29 (patch)
treea0cf76cd433d6cba40b8a1478ed9d415a2517481 /Graphics/GraphicsEngineD3D11
parentD3D12 backend: improved command list version detection (diff)
downloadDiligentCore-2771c71fad9cc4311c287ad119d078662ef52c29.tar.gz
DiligentCore-2771c71fad9cc4311c287ad119d078662ef52c29.zip
Added USAGE_UNIFIED usage type (API 240066)
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rw-r--r--Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp11
1 files changed, 8 insertions, 3 deletions
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)
{