1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-23 19:54:16 +01:00

[dxvk] Rename and repurpose ignoreGraphicsBarriers option

Less nuclear approach that hopefully works just as well in practice.
This commit is contained in:
Philip Rebohle 2025-02-15 00:46:01 +01:00
parent d24dba21ee
commit ff2faa4b1b
9 changed files with 21 additions and 22 deletions

View File

@ -147,10 +147,7 @@ namespace dxvk {
DxvkBarrierControlFlags flags = parent->GetOptionsBarrierControlFlags();
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);
flags.set(DxvkBarrierControl::IgnoreComputeWriteAfterWrite, DxvkBarrierControl::IgnoreGraphicsWriteAfterWrite);
m_ctx->EmitCs([cFlags = flags] (DxvkContext* ctx) {
ctx->setBarrierControl(cFlags);

View File

@ -475,10 +475,10 @@ namespace dxvk {
DxvkBarrierControlFlags barrierControl;
if (m_d3d11Options.relaxedBarriers)
barrierControl.set(DxvkBarrierControl::IgnoreWriteAfterWrite);
barrierControl.set(DxvkBarrierControl::IgnoreComputeWriteAfterWrite);
if (m_d3d11Options.ignoreGraphicsBarriers)
barrierControl.set(DxvkBarrierControl::IgnoreGraphicsBarriers);
if (m_d3d11Options.relaxedBarriers || m_d3d11Options.relaxedGraphicsBarriers)
barrierControl.set(DxvkBarrierControl::IgnoreGraphicsWriteAfterWrite);
return barrierControl;
}

View File

@ -24,7 +24,9 @@ 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,
// Removed:
// D3D11_VK_BARRIER_CONTROL_IGNORE_GRAPHICS_UAV = 1 << 1,
};

View File

@ -17,7 +17,7 @@ namespace dxvk {
this->zeroInitWorkgroupMemory = config.getOption<bool>("d3d11.zeroInitWorkgroupMemory", false);
this->forceVolatileTgsmAccess = config.getOption<bool>("d3d11.forceVolatileTgsmAccess", false);
this->relaxedBarriers = config.getOption<bool>("d3d11.relaxedBarriers", false);
this->ignoreGraphicsBarriers = config.getOption<bool>("d3d11.ignoreGraphicsBarriers", false);
this->relaxedGraphicsBarriers = config.getOption<bool>("d3d11.relaxedGraphicsBarriers", false);
this->maxTessFactor = config.getOption<int32_t>("d3d11.maxTessFactor", 0);
this->samplerAnisotropy = config.getOption<int32_t>("d3d11.samplerAnisotropy", -1);
this->samplerLodBias = config.getOption<float>("d3d11.samplerLodBias", 0.0f);
@ -61,4 +61,4 @@ namespace dxvk {
this->shaderDumpPath = env::getEnvVar("DXVK_SHADER_DUMP_PATH");
}
}
}

View File

@ -43,7 +43,7 @@ namespace dxvk {
///
/// May improve performance in some games,
/// but might also cause rendering issues.
bool ignoreGraphicsBarriers = false;
bool relaxedGraphicsBarriers = false;
/// Maximum tessellation factor.
///
@ -114,4 +114,4 @@ namespace dxvk {
std::string shaderDumpPath;
};
}
}

View File

@ -6817,9 +6817,6 @@ namespace dxvk {
template<bool Indexed, bool Indirect>
bool DxvkContext::checkGraphicsHazards() {
if (m_barrierControl.test(DxvkBarrierControl::IgnoreGraphicsBarriers))
return false;
// Check shader resources on every draw to handle WAW hazards, and to make
// sure that writes are handled properly. If the pipeline does not have any
// storage descriptors, we only need to check dirty resources.

View File

@ -1786,7 +1786,11 @@ namespace dxvk {
template<VkPipelineBindPoint BindPoint>
bool canIgnoreWawHazards() {
if (!m_barrierControl.test(DxvkBarrierControl::IgnoreWriteAfterWrite))
constexpr auto controlFlag = BindPoint == VK_PIPELINE_BIND_POINT_GRAPHICS
? DxvkBarrierControl::IgnoreGraphicsWriteAfterWrite
: DxvkBarrierControl::IgnoreComputeWriteAfterWrite;
if (!m_barrierControl.test(controlFlag))
return false;
if (BindPoint == VK_PIPELINE_BIND_POINT_COMPUTE) {

View File

@ -86,8 +86,8 @@ namespace dxvk {
* synchronize implicitly.
*/
enum class DxvkBarrierControl : uint32_t {
IgnoreWriteAfterWrite = 1,
IgnoreGraphicsBarriers = 2,
IgnoreComputeWriteAfterWrite = 0,
IgnoreGraphicsWriteAfterWrite = 1,
};
using DxvkBarrierControlFlags = Flags<DxvkBarrierControl>;

View File

@ -291,12 +291,11 @@ namespace dxvk {
/* Final Fantasy XV: VXAO does thousands of *
* draw calls with the same UAV bound */
{ R"(\\ffxv_s\.exe$)", {{
{ "d3d11.ignoreGraphicsBarriers", "True" },
{ "d3d11.relaxedGraphicsBarriers", "True" },
}} },
/* God of War - relies on NVAPI/AMDAGS for *
* barrier stuff, needs nvapi for DLSS */
{ R"(\\GoW\.exe$)", {{
{ "d3d11.ignoreGraphicsBarriers", "True" },
{ "d3d11.relaxedBarriers", "True" },
{ "dxgi.hideNvidiaGpu", "False" },
{ "dxgi.maxFrameLatency", "1" },
@ -334,7 +333,7 @@ namespace dxvk {
* presumably for culling, which doesn't play *
* nicely with D3D11 without vendor libraries */
{ R"(\\Stray-Win64-Shipping\.exe$)", {{
{ "d3d11.ignoreGraphicsBarriers", "True" },
{ "d3d11.relaxedGraphicsBarriers", "True" },
}} },
/* Metal Gear Solid V: Ground Zeroes *
* Texture quality can break at high vram */
@ -433,7 +432,7 @@ namespace dxvk {
* and assumes that AMD GPUs do not expose *
* native command lists for AGS usage */
{ R"(\\granblue_fantasy_relink\.exe$)", {{
{ "d3d11.ignoreGraphicsBarriers", "True" },
{ "d3d11.relaxedGraphicsBarriers", "True" },
{ "d3d11.exposeDriverCommandLists", "False" },
{ "dxgi.hideNvidiaGpu", "False" },
}} },