diff --git a/dxvk.conf b/dxvk.conf index efc24bc0f..89d204d72 100644 --- a/dxvk.conf +++ b/dxvk.conf @@ -177,12 +177,12 @@ # d3d9.invariantPosition = False -# Replaces NaN outputs from fragment shaders with zeroes for floating -# point render target. Used in some games to prevent artifacting. +# Forces the sample count of all textures to 1, and performs +# the needed fixups in resolve operations and shaders. # # Supported values: True, False -# d3d11.enableRtOutputNanFixup = False +# d3d11.disableMsaa = False # Clears workgroup memory in compute shaders to zero. Some games don't do diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 21853c2f0..575e6a52a 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -1161,7 +1161,7 @@ namespace dxvk { srcSubresource.mipLevel, srcSubresource.arrayLayer, 1 }; - if (srcDesc.SampleDesc.Count == 1) { + if (srcDesc.SampleDesc.Count == 1 || m_parent->GetOptions()->disableMsaa) { EmitCs([ cDstImage = dstTextureInfo->GetImage(), cSrcImage = srcTextureInfo->GetImage(), diff --git a/src/d3d11/d3d11_options.cpp b/src/d3d11/d3d11_options.cpp index 558829d60..15406749a 100644 --- a/src/d3d11/d3d11_options.cpp +++ b/src/d3d11/d3d11_options.cpp @@ -16,6 +16,7 @@ namespace dxvk { this->samplerAnisotropy = config.getOption("d3d11.samplerAnisotropy", -1); this->invariantPosition = config.getOption("d3d11.invariantPosition", true); this->floatControls = config.getOption("d3d11.floatControls", true); + this->disableMsaa = config.getOption("d3d11.disableMsaa", false); this->deferSurfaceCreation = config.getOption("dxgi.deferSurfaceCreation", false); this->numBackBuffers = config.getOption("dxgi.numBackBuffers", 0); this->maxFrameLatency = config.getOption("dxgi.maxFrameLatency", 0); diff --git a/src/d3d11/d3d11_options.h b/src/d3d11/d3d11_options.h index a948aa0af..8a1095209 100644 --- a/src/d3d11/d3d11_options.h +++ b/src/d3d11/d3d11_options.h @@ -91,6 +91,10 @@ namespace dxvk { /// for a single window that may interfere with each other. bool deferSurfaceCreation; + /// Forces the sample count of all textures to be 1, and + /// performs the required shader and resolve fixups. + bool disableMsaa; + /// Apitrace mode: Maps all buffers in cached memory. /// Enabled automatically if dxgitrace.dll is attached. bool apitraceMode; diff --git a/src/d3d11/d3d11_texture.cpp b/src/d3d11/d3d11_texture.cpp index 45e0f2763..7f17a2e73 100644 --- a/src/d3d11/d3d11_texture.cpp +++ b/src/d3d11/d3d11_texture.cpp @@ -37,7 +37,8 @@ namespace dxvk { imageInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; imageInfo.shared = vkImage != VK_NULL_HANDLE; - DecodeSampleCount(m_desc.SampleDesc.Count, &imageInfo.sampleCount); + if (!pDevice->GetOptions()->disableMsaa) + DecodeSampleCount(m_desc.SampleDesc.Count, &imageInfo.sampleCount); // Integer clear operations on UAVs are implemented using // a view with a bit-compatible integer format, so we'll