From a6b0783a5108aca10b54908d6a76e9d0649d9d61 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 5 Jul 2022 18:56:43 +0200 Subject: [PATCH] [dxvk] Add config option for graphics pipeline library enablement --- dxvk.conf | 14 ++++++++++++++ src/dxvk/dxvk_device.cpp | 3 ++- src/dxvk/dxvk_options.cpp | 1 + src/dxvk/dxvk_options.h | 3 +++ src/dxvk/dxvk_pipemanager.cpp | 3 ++- 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dxvk.conf b/dxvk.conf index ebab3557..dbb0e225 100644 --- a/dxvk.conf +++ b/dxvk.conf @@ -272,6 +272,20 @@ # dxvk.shrinkNvidiaHvvHeap = Auto +# Controls graphics pipeline library behaviour +# +# Can be used to change VK_EXT_graphics_pipeline_library usage for +# debugging purpose. Doing so will likely result in increased stutter +# or degraded performance. +# +# Supported values: +# - Auto: Enable if supported, and compile optimized pipelines in the background +# - True: Enable if supported, but do not compile optimized pipelines +# - False: Always disable the feature + +# dxvk.enableGraphicsPipelineLibrary = Auto + + # Sets enabled HUD elements # # Behaves like the DXVK_HUD environment variable if the diff --git a/src/dxvk/dxvk_device.cpp b/src/dxvk/dxvk_device.cpp index 49421bc8..74b2d0b9 100644 --- a/src/dxvk/dxvk_device.cpp +++ b/src/dxvk/dxvk_device.cpp @@ -46,7 +46,8 @@ namespace dxvk { // cannot use this effectively in many games since no client API provides // interpoation qualifiers in vertex shaders. return m_features.extGraphicsPipelineLibrary.graphicsPipelineLibrary - && m_properties.extGraphicsPipelineLibrary.graphicsPipelineLibraryIndependentInterpolationDecoration; + && m_properties.extGraphicsPipelineLibrary.graphicsPipelineLibraryIndependentInterpolationDecoration + && m_options.enableGraphicsPipelineLibrary != Tristate::False; } diff --git a/src/dxvk/dxvk_options.cpp b/src/dxvk/dxvk_options.cpp index ea82eedc..87f26186 100644 --- a/src/dxvk/dxvk_options.cpp +++ b/src/dxvk/dxvk_options.cpp @@ -6,6 +6,7 @@ namespace dxvk { enableDebugUtils = config.getOption ("dxvk.enableDebugUtils", false); enableStateCache = config.getOption ("dxvk.enableStateCache", true); numCompilerThreads = config.getOption ("dxvk.numCompilerThreads", 0); + enableGraphicsPipelineLibrary = config.getOption("dxvk.enableGraphicsPipelineLibrary", Tristate::Auto); useRawSsbo = config.getOption("dxvk.useRawSsbo", Tristate::Auto); shrinkNvidiaHvvHeap = config.getOption("dxvk.shrinkNvidiaHvvHeap", Tristate::Auto); hud = config.getOption("dxvk.hud", ""); diff --git a/src/dxvk/dxvk_options.h b/src/dxvk/dxvk_options.h index 992ec764..18210fa6 100644 --- a/src/dxvk/dxvk_options.h +++ b/src/dxvk/dxvk_options.h @@ -18,6 +18,9 @@ namespace dxvk { /// when using the state cache int32_t numCompilerThreads; + /// Enable graphics pipeline library + Tristate enableGraphicsPipelineLibrary; + /// Shader-related options Tristate useRawSsbo; diff --git a/src/dxvk/dxvk_pipemanager.cpp b/src/dxvk/dxvk_pipemanager.cpp index c6c7ab89..7aa02b81 100644 --- a/src/dxvk/dxvk_pipemanager.cpp +++ b/src/dxvk/dxvk_pipemanager.cpp @@ -167,7 +167,8 @@ namespace dxvk { m_cache (device), m_workers (device, &m_cache), m_stateCache(device, this, &m_workers) { - + Logger::info(str::format("DXVK: Graphics pipeline libraries ", + (m_device->canUseGraphicsPipelineLibrary() ? "supported" : "not supported"))); }