[d3d9] Implement d3d9.forceSwapchainMSAA

Works good enough for some titles like Vampire The Masquerade: Bloodlines.
This commit is contained in:
Joshua Ashton 2020-01-11 02:34:37 +00:00
parent 3ebd4b28a3
commit 64ece36349
4 changed files with 16 additions and 0 deletions

View File

@ -289,3 +289,9 @@
# d3d9.enableDialogMode = False
# Overrides the application's MSAA level on the swapchain
#
# Supported values: -1 (application) and 0 to 16 (user override)
# d3d9.forceSwapchainMSAA = -1

View File

@ -62,6 +62,7 @@ namespace dxvk {
this->supportVCache = config.getOption<bool> ("d3d9.supportVCache", vendorId == 0x10de);
this->enableDialogMode = config.getOption<bool> ("d3d9.enableDialogMode", false);
this->forceSamplerTypeSpecConstants = config.getOption<bool> ("d3d9.forceSamplerTypeSpecConstants", false);
this->forceSwapchainMSAA = config.getOption<int32_t> ("d3d9.forceSwapchainMSAA", -1);
this->forceAspectRatio = config.getOption<std::string>("d3d9.forceAspectRatio", "");

View File

@ -116,6 +116,9 @@ namespace dxvk {
/// Always use a spec constant to determine sampler type (instead of just in PS 1.x)
/// Works around a game bug in Halo CE where it gives cube textures to 2d/volume samplers
bool forceSamplerTypeSpecConstants;
/// Forces an MSAA level on the swapchain
int32_t forceSwapchainMSAA;
};
}

View File

@ -417,6 +417,12 @@ namespace dxvk {
pPresentParams->BackBufferCount = std::max(pPresentParams->BackBufferCount, 1u);
const int32_t forcedMSAA = m_parent->GetOptions()->forceSwapchainMSAA;
if (forcedMSAA != -1) {
pPresentParams->MultiSampleType = D3DMULTISAMPLE_TYPE(forcedMSAA);
pPresentParams->MultiSampleQuality = 0;
}
if (pPresentParams->Windowed) {
GetWindowClientSize(pPresentParams->hDeviceWindow,
pPresentParams->BackBufferWidth ? nullptr : &pPresentParams->BackBufferWidth,