[d3d11] Introduce d3d11.ignoreGraphicsBarriers option

This commit is contained in:
Philip Rebohle 2021-09-08 15:20:01 +02:00
parent 5109000747
commit 67391a7bb0
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
6 changed files with 33 additions and 4 deletions

View File

@ -158,6 +158,16 @@
# d3d11.relaxedBarriers = False
# Ignores barriers around UAV writes from fragment shaders.
#
# This may improve performance in some games, but may also introduce
# rendering issues. Please don't report bugs with the option enabled.
#
# Supported values: True, False
# d3d11.ignoreGraphicsBarriers = False
# Overrides anisotropic filtering for all samplers. Set this to a positive
# value to enable AF for all samplers in the game, or to 0 in order to
# disable AF entirely. Negative values will have no effect.

View File

@ -128,7 +128,10 @@ namespace dxvk {
if (ControlFlags & D3D11_VK_BARRIER_CONTROL_IGNORE_WRITE_AFTER_WRITE)
flags.set(DxvkBarrierControl::IgnoreWriteAfterWrite);
if (ControlFlags & D3D11_VK_BARRIER_CONTROL_IGNORE_GRAPHICS_UAV)
flags.set(DxvkBarrierControl::IgnoreGraphicsBarriers);
m_ctx->EmitCs([cFlags = flags] (DxvkContext* ctx) {
ctx->setBarrierControl(cFlags);
});

View File

@ -16,13 +16,21 @@ namespace dxvk {
m_csThread(Device->createContext()),
m_videoContext(this, Device) {
EmitCs([
cDevice = m_device,
cRelaxedBarriers = pParent->GetOptions()->relaxedBarriers
cDevice = m_device,
cRelaxedBarriers = pParent->GetOptions()->relaxedBarriers,
cIgnoreGraphicsBarriers = pParent->GetOptions()->ignoreGraphicsBarriers
] (DxvkContext* ctx) {
ctx->beginRecording(cDevice->createCommandList());
DxvkBarrierControlFlags barrierControl;
if (cRelaxedBarriers)
ctx->setBarrierControl(DxvkBarrierControl::IgnoreWriteAfterWrite);
barrierControl.set(DxvkBarrierControl::IgnoreWriteAfterWrite);
if (cIgnoreGraphicsBarriers)
barrierControl.set(DxvkBarrierControl::IgnoreGraphicsBarriers);
ctx->setBarrierControl(barrierControl);
});
ClearState();

View File

@ -22,6 +22,7 @@ enum D3D11_VK_EXTENSION : uint32_t {
*/
enum D3D11_VK_BARRIER_CONTROL : uint32_t {
D3D11_VK_BARRIER_CONTROL_IGNORE_WRITE_AFTER_WRITE = 1 << 0,
D3D11_VK_BARRIER_CONTROL_IGNORE_GRAPHICS_UAV = 1 << 1,
};

View File

@ -12,6 +12,7 @@ namespace dxvk {
this->zeroInitWorkgroupMemory = config.getOption<bool>("d3d11.zeroInitWorkgroupMemory", false);
this->forceTgsmBarriers = config.getOption<bool>("d3d11.forceTgsmBarriers", false);
this->relaxedBarriers = config.getOption<bool>("d3d11.relaxedBarriers", false);
this->ignoreGraphicsBarriers = config.getOption<bool>("d3d11.ignoreGraphicsBarriers", false);
this->maxTessFactor = config.getOption<int32_t>("d3d11.maxTessFactor", 0);
this->samplerAnisotropy = config.getOption<int32_t>("d3d11.samplerAnisotropy", -1);
this->invariantPosition = config.getOption<bool>("d3d11.invariantPosition", true);

View File

@ -48,6 +48,12 @@ namespace dxvk {
/// but might also cause rendering issues.
bool relaxedBarriers;
/// Ignore graphics barriers
///
/// May improve performance in some games,
/// but might also cause rendering issues.
bool ignoreGraphicsBarriers;
/// Maximum tessellation factor.
///
/// Limits tessellation factors in tessellation