NieRAutomata-LodMod
NieRAutomata-LodMod copied to clipboard
2021: Swapchain always uses MSAAx1 regardless of settings
For some reason the non-compat version of 2021 always creates a swapchain using DXGI_SAMPLE_DESC::Quality = 1, ignoring the users MSAA settings.
Meanwhile it seems depth buffers are created using the users chosen setting, that mismatch then leads renderdoc to display errors such as
Incorrect API Use - Invalid output merger - Depth target is different size or MS count to render target(s)
I'm not sure if this actually causes a problem yet though, maybe it could be a cause of the lod-AO-through-walls issue, or could turn out users MSAA setting makes no difference in 2021?
(E: actually this may be the cause of the black-dot-artifact issues around foliage with MSAA enabled, you can fix that by forcing MSAA through NVCP: https://steamcommunity.com/app/524220/discussions/0/5197701062320602423/ - I guess maybe NVCP is forcing the swap-chain to use matching MSAA?)
Oddly the 2021 NieRAutomataCompat.exe does use the users MSAA setting for it, as did the 2017 versions, not sure why 2021 non-compat has changed it like this, unless it's to work around some issue with the fakeHDR they added.
Unfortunately patching the Quality = 1 value they use to any different setting just causes game to show a Graphic::Startup() FAILED error.
Tried to trace where the error originates from, but I didn't see any difference between 2021 & 2021-compat in that code, so not really sure what's wrong with it, does MSAA sample count/quality get setup somewhere earlier before swap-chains are created? Not sure yet.
Maybe it turns out the compat version is better to use overall, doesn't use the fakeHDR they added, applies the proper MSAA setting... only drawback is that SK only supports the non-compat version, so compat can't have framelimit removed, maybe a PR could be submitted for it though...
I can't seem to replicate your findings in the compat version. both are broken just the same.
about MSAA:
it seems like QLOC just left the rendering layout as is from the 2017 version. which means the same texture used for the swapchain is used just like before. and in the 2017 patch they probably used swapchain MSAA, which is not possible if you use the flip model (FLIP_SEQUENTIAL in this case) for presentation. so they just set the swapchain texture to Count = 1 and Quality = 0 because otherwise the game will not start. this causes the link between the swapchain texture and the depth texture in the output merger to be invalid but not enough to cause a crash...
this is unfixable unless you create an additional texture, replace the swapchain one and Copy to the swapchain texture at the end.
idk if that causes the broken MSAA. seems likely though.
if that is the case though, Nvidia probably does something similar or the same which fixes the issue.
the compat version does not use the flip model for presentation since it wasn't available on Win7/8. but the texture desc is the same for me.