diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index ac2ff384..5bb76bf0 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 dd13ddf9..cb05b5e0 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()))