Module: vkd3d Branch: master Commit: 6801c153309bfd709e2fb529680736ce11df6945 URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=6801c153309bfd709e2fb529...
Author: Józef Kucia jkucia@codeweavers.com Date: Thu May 2 16:02:38 2019 +0200
vkd3d: Forbid D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS for buffers.
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 ac2ff38..5bb76bf 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 dd13ddf..cb05b5e 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()))