From 1dd3f24b436cec25250118f088a7e3e5f5f3100d Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 14 Jul 2022 20:32:30 +0200 Subject: [PATCH] [dxbc] Drop workarounds for unsupported drivers --- src/dxbc/dxbc_compiler.cpp | 12 +++--------- src/dxbc/dxbc_options.cpp | 9 +-------- src/dxbc/dxbc_options.h | 4 ---- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 2fdf24d79..8e9d49cf8 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -5366,11 +5366,8 @@ namespace dxvk { result.type.ctype = DxbcScalarType::Sint32; result.type.ccount = 1; - const uint32_t typeId = getVectorTypeId(result.type); - - uint32_t offset = m_moduleInfo.options.useSdivForBufferIndex - ? m_module.opSDiv (typeId, structOffset.id, m_module.consti32(4)) - : m_module.opShiftRightLogical(typeId, structOffset.id, m_module.consti32(2)); + uint32_t typeId = getVectorTypeId(result.type); + uint32_t offset = m_module.opShiftRightLogical(typeId, structOffset.id, m_module.consti32(2)); result.id = m_module.opIAdd(typeId, m_module.opIMul(typeId, structId.id, m_module.consti32(structStride / 4)), @@ -5386,10 +5383,7 @@ namespace dxvk { result.type.ccount = 1; uint32_t typeId = getVectorTypeId(result.type); - - result.id = m_moduleInfo.options.useSdivForBufferIndex - ? m_module.opSDiv (typeId, byteOffset.id, m_module.consti32(4)) - : m_module.opShiftRightLogical(typeId, byteOffset.id, m_module.consti32(2)); + result.id = m_module.opShiftRightLogical(typeId, byteOffset.id, m_module.consti32(2)); return result; } diff --git a/src/dxbc/dxbc_options.cpp b/src/dxbc/dxbc_options.cpp index 17b239775..6d064e1f2 100644 --- a/src/dxbc/dxbc_options.cpp +++ b/src/dxbc/dxbc_options.cpp @@ -28,8 +28,6 @@ namespace dxvk { = (devInfo.vk11.subgroupSize >= 4) && (devInfo.vk11.subgroupSupportedStages & VK_SHADER_STAGE_FRAGMENT_BIT) && (devInfo.vk11.subgroupSupportedOperations & VK_SUBGROUP_FEATURE_BALLOT_BIT); - useSdivForBufferIndex - = adapter->matchesDriver(VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, 0); switch (device->config().useRawSsbo) { case Tristate::Auto: minSsboAlignment = devInfo.core.properties.limits.minStorageBufferOffsetAlignment; break; @@ -43,10 +41,6 @@ namespace dxvk { forceTgsmBarriers = options.forceTgsmBarriers; disableMsaa = options.disableMsaa; - // Disable subgroup early discard on Nvidia because it may hurt performance - if (adapter->matchesDriver(VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, 0)) - useSubgroupOpsForEarlyDiscard = false; - // Figure out float control flags to match D3D11 rules if (options.floatControls) { if (devInfo.vk12.shaderSignedZeroInfNanPreserveFloat32) @@ -62,8 +56,7 @@ namespace dxvk { } } - if (!devInfo.vk12.shaderSignedZeroInfNanPreserveFloat32 - || adapter->matchesDriver(VK_DRIVER_ID_MESA_RADV_KHR, 0, VK_MAKE_VERSION(20, 3, 0))) + if (!devInfo.vk12.shaderSignedZeroInfNanPreserveFloat32) enableRtOutputNanFixup = true; } diff --git a/src/dxbc/dxbc_options.h b/src/dxbc/dxbc_options.h index ed3993746..1edec4c7b 100644 --- a/src/dxbc/dxbc_options.h +++ b/src/dxbc/dxbc_options.h @@ -37,10 +37,6 @@ namespace dxvk { /// shader invocations if derivatives remain valid. bool useSubgroupOpsForEarlyDiscard = false; - /// Use SDiv instead of SHR to converte byte offsets to - /// dword offsets. Fixes RE2 and DMC5 on Nvidia drivers. - bool useSdivForBufferIndex = false; - /// Enables NaN fixup for render target outputs bool enableRtOutputNanFixup = false;