summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-07-08 03:18:09 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-07-08 03:18:09 +0000
commit8e53afea612a5b4b17c995d4e24260a6e53d3de5 (patch)
treef490845f499f1b34ae4c626c2998af6a21fccc57 /Graphics/GraphicsEngineVulkan
parentHLSL converter: fixed issue in shader register removal logic (diff)
downloadDiligentCore-8e53afea612a5b4b17c995d4e24260a6e53d3de5.tar.gz
DiligentCore-8e53afea612a5b4b17c995d4e24260a6e53d3de5.zip
D3D12 and VK backends: disallowed mapping structured and formatted dynamic buffers with MAP_FLAG_NO_OVERWRITE flag
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
index 1681b456..76163513 100644
--- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
@@ -1318,6 +1318,16 @@ void DeviceContextVkImpl::MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAG
else
{
VERIFY_EXPR(MapFlags & MAP_FLAG_NO_OVERWRITE);
+
+ if (pBufferVk->m_VulkanBuffer != VK_NULL_HANDLE)
+ {
+ LOG_ERROR("Formatted or structured buffers require actual Vulkan backing resource and cannot be suballocated "
+ "from dynamic heap. In current implementation, the entire contents of the backing buffer is updated when the buffer is unmapped. "
+ "As a consequence, the buffer cannot be mapped with MAP_FLAG_NO_OVERWRITE flag because updating the whole "
+ "buffer will overwrite regions that may still be in use by the GPU.");
+ return;
+ }
+
// Reuse the same allocation
}