1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-29 17:52:18 +01:00

[d3d11] Add d3d11.disableMsaa option to disable multisampling

Aims to be mostly transparent to the application, although breakage
can still happen if shaders query the sample count and do not handle
a sample count of 1.
This commit is contained in:
Philip Rebohle 2021-07-02 04:39:26 +02:00
parent e379f472f6
commit 3b857d93b5
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
5 changed files with 11 additions and 5 deletions

View File

@ -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

View File

@ -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(),

View File

@ -16,6 +16,7 @@ namespace dxvk {
this->samplerAnisotropy = config.getOption<int32_t>("d3d11.samplerAnisotropy", -1);
this->invariantPosition = config.getOption<bool>("d3d11.invariantPosition", true);
this->floatControls = config.getOption<bool>("d3d11.floatControls", true);
this->disableMsaa = config.getOption<bool>("d3d11.disableMsaa", false);
this->deferSurfaceCreation = config.getOption<bool>("dxgi.deferSurfaceCreation", false);
this->numBackBuffers = config.getOption<int32_t>("dxgi.numBackBuffers", 0);
this->maxFrameLatency = config.getOption<int32_t>("dxgi.maxFrameLatency", 0);

View File

@ -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;

View File

@ -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