protonscr

Far Cry 3 - waterfalls show corruption with MSAA

dxvkclosed game bug
doitsujin/dxvk#2863 · opened 2022-08-22 by aufkrawall · updated 2022-08-25 · 26 comments · github
Aaufkrawall 2022-08-22 github

D3D11:
farcry3_d3d11_2022_08_22_21_31_39_480

DXVK (missing parts in rectangular shape that change with camera perspective):
farcry3_d3d11_2022_08_22_21_25_08_924

RTX 3060, Windows 11, driver 516.94, DXVK 17959640c3bfe96a96a600ab14b96658f6acf4d6 , latest game version via Ubisoft Connect, maximum visual details
If it's a regression, it's not a too recent one, as this occurred already months ago with older DXVK and drivers on Linux.

Logs:
farcry3_d3d11_d3d11.log
farcry3_d3d11_dxgi.log

apitrace:
https://drive.google.com/file/d/1VbwMO7_36qzpXXZxRr_ZQDk6QOBq7b1A/view?usp=sharing

Ddoitsujin maintainer 2022-08-22 github

Can you try dxgi.nvapiHack = True?

We actually set it to false by default for this game because it requires a clear value of 0.5 to map to different integer values depending on the GPU vendor, which othersie can cause lighting issues with these rectangular shapes. This used to work in the past, but it's possible that Nvidia's Vulkan driver behaviour changed or that somethig else isn't quite consistent with what the game expects.

If that doesn't work, well, not sure what to do. It's really a game issue since they hard-coded weird behaviour into their game that may not even hold true on future hardware.

KK0bin maintainer 2022-08-22 github

That apitrace doesn't work.

Aaufkrawall 2022-08-22 github

dxgi.nvapiHack = True doesn't help with the waterfalls and additionally introduces semi-transparent rectangles floating around in some parts of the scene.

No idea why the apitrace doesn't work. I made sure all overlays were disabled and the game seemed to have terminated normally after alt + f4.

Ddoitsujin maintainer 2022-08-22 github

Probably not fixable then.

Xxpander69 2022-08-24 github

FarCry_24082022_11 54 30
Looks fine here with nvidia 515.49.14 drivers and proton-experimental (not sure what version of DXVK experimental exactly uses, but should be recent enough i think)

Aaufkrawall 2022-08-24 github

MSAA enabled? Looks like the issue only occurs with it enabled.

Ddoitsujin maintainer 2022-08-24 github

Might be a different issue than the clear value thing if it only happens with MSAA.

Can you post validation layer output?

Aaufkrawall 2022-08-24 github

I'll see to it.

Aaufkrawall 2022-08-24 github

Game just freezes for me when run in Proton. It works on Windows with Vulkan SDK installed and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, but no idea where I'd find any output of it.

KK0bin maintainer 2022-08-24 github

The output is in stdout. If you set PROTON_LOG=1, Proton/Steam will redirect that into a file called steam-APPID_OF_YOUR_GAME.txt in your home directory. That should have the validation messages.

Xxpander69 2022-08-24 github

Confirming the MSAA breaks waterfalls on linux also.
steam-220240.log

i think i got the validation layers enabled, let me know if its wrong.
Used command in steam VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation PROTON_LOG=1 %command%

Aaufkrawall 2022-08-24 github

The output is in stdout. If you set PROTON_LOG=1, Proton/Steam will redirect that into a file called steam-APPID_OF_YOUR_GAME.txt in your home directory. That should have the validation messages.

Thanks! I got the game running by renaming farcry3_d3d11.exe to FC3Updater.exe, as Ubisoft Connect starts the latter first and something with that goes wrong with the regular Ubisoft Connect game version manually added to be run via Proton in Steam.

xpander69 beat me to it, but I'll try regardless now. I'm sure the relevant information regarding VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and stdout can be found when following the links to Khronos docs, but I suppose it could be made a bit more obvious in the DXVK wiki. As unlike pressing a button in RenderDoc, it's not really self-explanatory.

KK0bin maintainer 2022-08-24 github

xpander69 beat me to it, but I'll try regardless now.

His logs don't contain any validation messages. He likely didn't have 32 bit validation layers installed.

but I suppose it could be made a bit more obvious in the DXVK wiki

Usually we prefer an apitrace which we can just run it with validation layers ourselves. But we already tried that here and it didnt work so there's that.

Xxpander69 2022-08-24 github

No i didnt beat you do it. Game doesnt launch for me.. I didnt have 32bit validation layers. So my log is useless

Aaufkrawall 2022-08-24 github

Indeed lib32-vulkan-validation-layers also isn't included in Arch vulkan-devel meta package, how treacherous.

But with it installed, the game crashes on launch with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Oh my...

Xxpander69 2022-08-24 github

Yeah tried to replace executables also but still crashes right after splash screen coming up with the good old
Unhandled exception: page fault on read access to 0x00000158 in 32-bit code (0xf26cf7ba).

I think its doomed :(

Aaufkrawall 2022-08-24 github

I guess I can try diverting stdout to a log file on Windows, I had the game running with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation there (at least that's my conclusion after it ran with only ~15fps). If not something else breaks, that is... :hurtrealbad:

Xxpander69 2022-08-24 github

I recorded a video about the effect/bug, just in case maybe some other games have had same issue and it rings a bell to someone:
https://www.youtube.com/watch?v=PknyM_nOof0

Aaufkrawall 2022-08-24 github

Looks like the linked apitrace version is outdated? I can replay a capture with version 11.1 (DXVK wiki links 10.0). Uploading...

KK0bin maintainer 2022-08-24 github

Thanks. I updated the links.

Ddoitsujin maintainer 2022-08-24 github
VUID-vkCmdDrawIndexed-None-02699(ERROR / SPEC): msgNum: -1539028524 - Validation Error: [ VUID-vkCmdDrawIndexed-None-02699 ] Object 0: handle = 0x20ffe40000018bb6, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; | MessageID = 0xa44449d4 | Descriptor set VkDescriptorSet 0x20ffe40000018bb6[] encountered the following validation error at vkCmdDrawIndexed time: Descriptor in binding #9 index 0 requires bound image to have VK_SAMPLE_COUNT_1_BIT but got VK_SAMPLE_COUNT_4_BIT. The Vulkan spec states: Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the VkPipeline bound to the pipeline bind point used by this command (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-None-02699)

So yeah, it's that good old MSAA bug again. Unfortunately the only way to fix this is to disable MSAA, this cannot be worked around in DXVK in any reasonable way.

Renders fine on AMD fwiw.

Aaufkrawall 2022-08-24 github

Well, was worth a try. :) Thanks anyway!

KK0bin maintainer 2022-08-25 github

Out of pure curiosity, does it work if you use the D3D9 renderer?

Aaufkrawall 2022-08-25 github

With D3D9, the MSAA and AO options aren't available/get grayed out.

Ddoitsujin maintainer 2022-08-25 github

On the bright side, the trace uncovered an actual bug, see 5117210c93d7736f36719cf62d1780c4ae62ebfa. This won't affect these rendering issues though.

Proton versions

Launch options

Launch lines