From 65dd3c7df31b36afcdb40813c20c915ec2a10d4e Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Mon, 20 May 2024 18:46:45 +0200 Subject: [PATCH] [d3d9] Always enable STORAGE_BUFFER usage Fixes a validation error. Drivers don't care about buffer usage bits anyway. --- src/d3d9/d3d9_constant_buffer.cpp | 19 +------------------ src/d3d9/d3d9_constant_buffer.h | 5 ----- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/d3d9/d3d9_constant_buffer.cpp b/src/d3d9/d3d9_constant_buffer.cpp index 5bbd9a1d9..5f6bdf0f4 100644 --- a/src/d3d9/d3d9_constant_buffer.cpp +++ b/src/d3d9/d3d9_constant_buffer.cpp @@ -13,7 +13,7 @@ namespace dxvk { DxsoProgramType ShaderStage, DxsoConstantBuffers BufferType, VkDeviceSize Size) - : D3D9ConstantBuffer(pDevice, getBufferUsage(pDevice, ShaderStage, BufferType), GetShaderStage(ShaderStage), + : D3D9ConstantBuffer(pDevice, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, GetShaderStage(ShaderStage), computeResourceSlotId(ShaderStage, DxsoBindingType::ConstantBuffer, BufferType), Size) { @@ -135,21 +135,4 @@ namespace dxvk { device->properties().extRobustness2.robustUniformBufferAccessSizeAlignment); } - - VkBufferUsageFlags D3D9ConstantBuffer::getBufferUsage( - D3D9DeviceEx* pDevice, - DxsoProgramType ShaderStage, - DxsoConstantBuffers BufferType) { - VkBufferUsageFlags result = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT; - - // We won't always need this, but the only buffer that - // this applies to is so large that it will not matter. - if (pDevice->CanSWVP() - && ShaderStage == DxsoProgramType::VertexShader - && BufferType == DxsoConstantBuffers::VSConstantBuffer) - result |= VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; - - return result; - } - } diff --git a/src/d3d9/d3d9_constant_buffer.h b/src/d3d9/d3d9_constant_buffer.h index 22abe2225..469e7a014 100644 --- a/src/d3d9/d3d9_constant_buffer.h +++ b/src/d3d9/d3d9_constant_buffer.h @@ -80,11 +80,6 @@ namespace dxvk { VkDeviceSize getAlignment(const Rc& device) const; - static VkBufferUsageFlags getBufferUsage( - D3D9DeviceEx* pDevice, - DxsoProgramType ShaderStage, - DxsoConstantBuffers BufferType); - }; } \ No newline at end of file