From 4fe5929799c979d4aa627cc19e26dbe1dd0eb901 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 8 Jan 2019 20:58:18 +0100 Subject: [PATCH] [dxbc] Add options to enable/disble early discard and raw ssbo use --- src/dxbc/dxbc_options.cpp | 6 +++++- src/dxvk/dxvk_options.cpp | 2 ++ src/dxvk/dxvk_options.h | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/dxbc/dxbc_options.cpp b/src/dxbc/dxbc_options.cpp index 05f51c08..12f1c39f 100644 --- a/src/dxbc/dxbc_options.cpp +++ b/src/dxbc/dxbc_options.cpp @@ -26,11 +26,15 @@ namespace dxvk { zeroInitWorkgroupMemory = options.zeroInitWorkgroupMemory; - // Disable early discard on AMD due to GPU hangs + // Disable early discard on RADV due to GPU hangs // Disable early discard on Nvidia because it may hurt performance if (adapter->matchesDriver(DxvkGpuVendor::Amd, VK_DRIVER_ID_MESA_RADV_KHR, 0, 0) || adapter->matchesDriver(DxvkGpuVendor::Nvidia, VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, 0)) useSubgroupOpsForEarlyDiscard = false; + + // Apply shader-related options + applyTristate(useSubgroupOpsForEarlyDiscard, device->config().useEarlyDiscard); + applyTristate(useRawSsbo, device->config().useRawSsbo); } } \ No newline at end of file diff --git a/src/dxvk/dxvk_options.cpp b/src/dxvk/dxvk_options.cpp index 6a15abea..15c60c03 100644 --- a/src/dxvk/dxvk_options.cpp +++ b/src/dxvk/dxvk_options.cpp @@ -6,6 +6,8 @@ namespace dxvk { allowMemoryOvercommit = config.getOption ("dxvk.allowMemoryOvercommit", false); enableStateCache = config.getOption ("dxvk.enableStateCache", true); numCompilerThreads = config.getOption ("dxvk.numCompilerThreads", 0); + useRawSsbo = config.getOption("dxvk.useRawSsbo", Tristate::Auto); + useEarlyDiscard = config.getOption("dxvk.useEarlyDiscard", Tristate::Auto); } } \ No newline at end of file diff --git a/src/dxvk/dxvk_options.h b/src/dxvk/dxvk_options.h index 4e1c39f5..f29e9fc7 100644 --- a/src/dxvk/dxvk_options.h +++ b/src/dxvk/dxvk_options.h @@ -18,6 +18,10 @@ namespace dxvk { /// Number of compiler threads /// when using the state cache int32_t numCompilerThreads; + + /// Shader-related options + Tristate useRawSsbo; + Tristate useEarlyDiscard; }; } \ No newline at end of file