From a531ee5fd4ea19898b9f793414533ffd88937dd6 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Wed, 13 Jan 2021 15:31:34 +0100 Subject: [PATCH] vkd3d: Remove force_bindless_texel_buffer workaround. Obsolete now that we fully split typed and untyped buffer descriptors. Signed-off-by: Hans-Kristian Arntzen --- README.md | 2 -- libs/vkd3d/device.c | 9 --------- libs/vkd3d/state.c | 21 +++++++++------------ libs/vkd3d/vkd3d_private.h | 5 ++--- 4 files changed, 11 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 21b49649..3ca5b911 100644 --- a/README.md +++ b/README.md @@ -148,8 +148,6 @@ commas or semicolons. - `vk_debug` - enables Vulkan debug extensions and loads validation layer. - `skip_application_workarounds` - Skips all application workarounds. For debugging purposes. - - `force_bindless_texel_buffer` - Forces use of texel buffers for bindless Raw/Structured buffers. - For game workarounds only! - `VKD3D_DEBUG` - controls the debug level for log messages produced by vkd3d-proton. Accepts the following values: none, err, info, fixme, warn, trace. - `VKD3D_SHADER_DEBUG` - controls the debug level for log messages produced by diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 524bad5b..96ad933c 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -405,9 +405,6 @@ static const struct vkd3d_debug_option vkd3d_config_options[] = { /* Enable Vulkan debug extensions. */ {"vk_debug", VKD3D_CONFIG_FLAG_VULKAN_DEBUG}, - /* Never use VKD3D_BINDLESS_RAW_SSBO. - * Works around buggy games which mix typed and raw buffer types. */ - {"force_bindless_texel_buffer", VKD3D_CONFIG_FLAG_FORCE_BINDLESS_TEXEL_BUFFER}, {"skip_application_workarounds", VKD3D_CONFIG_FLAG_SKIP_APPLICATION_WORKAROUNDS}, {"disable_query_optimization", VKD3D_CONFIG_FLAG_DISABLE_QUERY_OPTIMIZATION}, }; @@ -433,12 +430,6 @@ struct vkd3d_instance_application_meta uint64_t global_flags_remove; }; static const struct vkd3d_instance_application_meta application_override[] = { - /* Application uses R32_UINT and misses raw buffer type. - * Fixes map rendering. */ - { "ds.exe", VKD3D_CONFIG_FLAG_FORCE_BINDLESS_TEXEL_BUFFER, 0 }, - /* Application has many bugs with descriptor handling. - * Not using this triggers weird flickering artifacts which are very distracting. */ - { "Cyberpunk2077.exe", VKD3D_CONFIG_FLAG_FORCE_BINDLESS_TEXEL_BUFFER, 0 }, /* Game changes render targets while occlusion queries are active */ { "ACValhalla.exe", VKD3D_CONFIG_FLAG_DISABLE_QUERY_OPTIMIZATION, 0 }, { "ACValhalla_Plus.exe", VKD3D_CONFIG_FLAG_DISABLE_QUERY_OPTIMIZATION, 0 }, diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index c3a14007..1471378b 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -3701,20 +3701,17 @@ static uint32_t vkd3d_bindless_state_get_bindless_flags(struct d3d12_device *dev device_info->descriptor_indexing_features.shaderStorageBufferArrayNonUniformIndexing) flags |= VKD3D_BINDLESS_CBV | VKD3D_BINDLESS_CBV_AS_SSBO; - if (!(device->vkd3d_instance->config_flags & VKD3D_CONFIG_FLAG_FORCE_BINDLESS_TEXEL_BUFFER)) + /* 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. */ + if (device_info->descriptor_indexing_properties.maxPerStageDescriptorUpdateAfterBindStorageBuffers >= 1000000 && + device_info->descriptor_indexing_features.descriptorBindingStorageBufferUpdateAfterBind && + device_info->properties2.properties.limits.minStorageBufferOffsetAlignment <= 16) { - /* 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. */ - if (device_info->descriptor_indexing_properties.maxPerStageDescriptorUpdateAfterBindStorageBuffers >= 1000000 && - device_info->descriptor_indexing_features.descriptorBindingStorageBufferUpdateAfterBind && - device_info->properties2.properties.limits.minStorageBufferOffsetAlignment <= 16) - { - flags |= VKD3D_BINDLESS_RAW_SSBO; + flags |= VKD3D_BINDLESS_RAW_SSBO; - if (device_info->properties2.properties.limits.minStorageBufferOffsetAlignment > 4) - flags |= VKD3D_SSBO_OFFSET_BUFFER; - } + if (device_info->properties2.properties.limits.minStorageBufferOffsetAlignment > 4) + flags |= VKD3D_SSBO_OFFSET_BUFFER; } /* Always use a typed offset buffer. Otherwise, we risk ending up with unbounded size on view maps. */ diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index abe2bd26..08d54563 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -158,9 +158,8 @@ struct vkd3d_vulkan_info enum vkd3d_config_flags { VKD3D_CONFIG_FLAG_VULKAN_DEBUG = 0x00000001, - VKD3D_CONFIG_FLAG_FORCE_BINDLESS_TEXEL_BUFFER = 0x00000002, - VKD3D_CONFIG_FLAG_SKIP_APPLICATION_WORKAROUNDS = 0x00000004, - VKD3D_CONFIG_FLAG_DISABLE_QUERY_OPTIMIZATION = 0x00000008, + VKD3D_CONFIG_FLAG_SKIP_APPLICATION_WORKAROUNDS = 0x00000002, + VKD3D_CONFIG_FLAG_DISABLE_QUERY_OPTIMIZATION = 0x00000004, }; struct vkd3d_instance