From 49d3fa30a79d65e69d3f39d3b4cccf06d0e512a8 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 23 Oct 2020 14:00:18 +0200 Subject: [PATCH] vkd3d: Enable offset buffer as necessary. Signed-off-by: Philip Rebohle --- libs/vkd3d/state.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 8484696c..83859ce9 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -3457,13 +3457,17 @@ static uint32_t vkd3d_bindless_state_get_bindless_flags(struct d3d12_device *dev /* Normally, we would be able to use SSBOs conditionally even when maxSSBOAlignment > 4, but * applications (RE2 being one example) are of course buggy and don't match descriptor and shader usage of resources, - * so we cannot rely on alignment analysis to select the appropriate resource type. - * TODO: Implement an offset buffer system so that we can remove the minStorageBufferOffsetAlignment requirement. */ + * so we cannot rely on alignment analysis to select the appropriate resource type. */ if (device_info->descriptor_indexing_properties.maxPerStageDescriptorUpdateAfterBindStorageBuffers >= 1000000 && device_info->descriptor_indexing_features.descriptorBindingStorageBufferUpdateAfterBind && - device_info->properties2.properties.limits.minStorageBufferOffsetAlignment <= 4) + device_info->properties2.properties.limits.minStorageBufferOffsetAlignment <= 16) + { flags |= VKD3D_BINDLESS_RAW_SSBO; + if (device_info->properties2.properties.limits.minStorageBufferOffsetAlignment > 4) + flags |= VKD3D_SSBO_OFFSET_BUFFER; + } + if (device_info->buffer_device_address_features.bufferDeviceAddress && (flags & VKD3D_BINDLESS_UAV)) flags |= VKD3D_RAW_VA_UAV_COUNTER;