From 9617a0f59887389e9b8126ef1aa64fb7ff493613 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Mon, 16 Nov 2020 17:16:43 +0100 Subject: [PATCH] vkd3d: Disable RAW_VA root CBVs on NVIDIA. BDA cannot map to their hardware, and we observe a large performance loss in games which use root CBVs. For this reason, fall back to push descriptors here. Signed-off-by: Hans-Kristian Arntzen --- libs/vkd3d/state.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 0d47da6b..f0f71d64 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -3562,8 +3562,18 @@ static uint32_t vkd3d_bindless_state_get_bindless_flags(struct d3d12_device *dev if (device_info->buffer_device_address_features.bufferDeviceAddress && (flags & VKD3D_BINDLESS_UAV)) flags |= VKD3D_RAW_VA_UAV_COUNTER; + /* We must use root SRV and UAV due to alignment requirements for 16-bit storage, + * but root CBV is more lax. */ if (device_info->buffer_device_address_features.bufferDeviceAddress) - flags |= VKD3D_RAW_VA_ROOT_DESCRIPTOR_CBV | VKD3D_RAW_VA_ROOT_DESCRIPTOR_SRV_UAV; + { + flags |= VKD3D_RAW_VA_ROOT_DESCRIPTOR_SRV_UAV; + /* CBV's really require push descriptors on NVIDIA to get maximum performance. + * The difference in performance is profound (~15% in some cases). + * On ACO, BDA with NonWritable can be promoted directly to scalar loads, + * which is great. */ + if (device_info->properties2.properties.vendorID != VKD3D_VENDOR_ID_NVIDIA) + flags |= VKD3D_RAW_VA_ROOT_DESCRIPTOR_CBV; + } return flags; }