[PATCH vkd3d 4/8] vkd3d: Forbid D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS for buffers.
Józef Kucia
joseph.kucia at gmail.com
Thu May 2 09:02:38 CDT 2019
From: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
libs/vkd3d/resource.c | 6 ++++++
tests/d3d12.c | 3 +++
2 files changed, 9 insertions(+)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index ac2ff384cd3d..5bb76bf0c3e0 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -530,6 +530,12 @@ HRESULT vkd3d_create_buffer(struct d3d12_device *device,
buffer_info.usage |= VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT;
/* Buffers always have properties of D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS. */
+ if (desc->Flags & D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS)
+ {
+ WARN("D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS cannot be set for buffers.\n");
+ return E_INVALIDARG;
+ }
+
buffer_info.sharingMode = VK_SHARING_MODE_CONCURRENT;
buffer_info.queueFamilyIndexCount = device->queue_family_count;
buffer_info.pQueueFamilyIndices = device->queue_family_indices;
diff --git a/tests/d3d12.c b/tests/d3d12.c
index dd13ddf999b9..cb05b5e0d65d 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -1615,6 +1615,9 @@ static void test_create_committed_resource(void)
{D3D12_HEAP_TYPE_READBACK, D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET},
{D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS},
{D3D12_HEAP_TYPE_READBACK, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS},
+ {D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS},
+ {D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS},
+ {D3D12_HEAP_TYPE_READBACK, D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS},
};
if (!(device = create_device()))
--
2.21.0
More information about the wine-devel
mailing list