[d3d9] Always enable STORAGE_BUFFER usage

Fixes a validation error. Drivers don't care about buffer usage bits anyway.
This commit is contained in:
Robin Kertels 2024-05-20 18:46:45 +02:00 committed by Philip Rebohle
parent dfc3776b24
commit 65dd3c7df3
2 changed files with 1 additions and 23 deletions

View File

@ -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;
}
}

View File

@ -80,11 +80,6 @@ namespace dxvk {
VkDeviceSize getAlignment(const Rc<DxvkDevice>& device) const;
static VkBufferUsageFlags getBufferUsage(
D3D9DeviceEx* pDevice,
DxsoProgramType ShaderStage,
DxsoConstantBuffers BufferType);
};
}