doitsujin / dxvk

Vulkan-based implementation of D3D8, 9, 10 and 11 for Linux / Wine
zlib License
13.34k stars 859 forks source link

World of Warcraft: Flickering textures on geometry #3802

Open alphabitserial opened 10 months ago

alphabitserial commented 10 months ago

Geometry in the game sometimes has flickering textures. I've provided a video so you can see what I mean. Screencast_20240117_232417.webm

Software information

World of Warcraft, DirectX 11 renderer. I've tried DX11 Legacy renderer with no changes. 60 FPS cap. Most graphics options set to "Good" although lowering or raising them doesn't have any effect on the issue. I am using the game's built-in FSR support to run at a lower rendering resolution for performance reasons, but changing it to 100% doesn't resolve the issue either.

System information

Apitrace file(s)

Note: I was not able to disable dxvk to grab the trace. When I disable dxvk the game does not launch on my system. https://drive.google.com/file/d/15bN4ymWw1W7D8cTWYhYQw5_CranG1XKh/view?usp=sharing

Log files

wow-log.txt

Please let me know if there's any other information I can provide that will help in debugging the issue.

Blisto91 commented 10 months ago

I'm not seeing the issue when replaying the trace on my RX 6800 with either amdvlk or radv. Could be a driver issue

alphabitserial commented 10 months ago

@Blisto91 That seems likely, unfortunately - having a very similar issue with Genshin Impact as well.

mbriar commented 10 months ago

Report it on the Mesa gitlab.

alphabitserial commented 10 months ago

@mbriar Done: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10480

alphabitserial commented 10 months ago

I wasn't seeing the flicker in the repacked apitrace either but I do see it in the apitrace without repacking. I've uploaded it here: https://drive.google.com/file/d/1m6bbC-9gWVOhVcj73MqZQo1_5b1i1fR8/view?usp=sharing

Blisto91 commented 10 months ago

Sadly it still looks fine on my AMD card

alphabitserial commented 10 months ago

Thanks for checking. I've uploaded it on the mesa tracker as well so hopefully someone can help me get to the bottom of this!

alphabitserial commented 9 months ago

Apparently there are a lot of validation errors in the trace. Here are the types of errors caught:

VUID-vkCmdDrawIndexed-None-06479
VUID-vkCmdDrawIndexed-renderPass-02684
VUID-vkCmdDraw-renderPass-02684
VUID-VkRenderPassBeginInfo-renderPass-00904

And here are some individual examples of each:

VUID-vkCmdDrawIndexed-None-06479(ERROR / SPEC): msgNum: 1397510317 - Validation Error: [ VUID-vkCmdDrawIndexed-None-06479 ] Object 0: handle = 0x8455ff0000013dbd, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; Object 1: handle = 0x3eb07000000000c8, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x534c50ad | vkCmdDrawIndexed():  the descriptor (VkDescriptorSet 0x8455ff0000013dbd[], binding 22, index 0) has VkImageView 0x3eb07000000000c8[] with format of VK_FORMAT_R32_SFLOAT which is missing VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT in its features (VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT|VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT|VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT|VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT|VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT|VK_FORMAT_FEATURE_2_BLIT_SRC_BIT|VK_FORMAT_FEATURE_2_BLIT_DST_BIT|VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT|VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT|VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT|VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT|VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT|VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT). The Vulkan spec states: If a VkImageView is sampled with depth comparison, the image view's format features must contain VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT (https://vulkan.lunarg.com/doc/view/1.3.268.0/linux/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-None-06479)
    Objects: 2
        [0] 0x8455ff0000013dbd, type: 23, name: NULL
        [1] 0x3eb07000000000c8, type: 14, name: NULL
VUID-vkCmdDrawIndexed-renderPass-02684(ERROR / SPEC): msgNum: -1934215230 - Validation Error: [ VUID-vkCmdDrawIndexed-renderPass-02684 ] Object 0: handle = 0x779ad50000000407, type = VK_OBJECT_TYPE_RENDER_PASS; Object 1: handle = 0xca0b160000000085, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0x8cb637c2 | vkCmdDrawIndexed():  RenderPasses incompatible between active render pass w/ VkRenderPass 0x779ad50000000407[] with a dependencyCount of 3 and pipeline state object w/ VkRenderPass 0xca0b160000000085[] with a dependencyCount of 1. The Vulkan spec states: The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS (https://vulkan.lunarg.com/doc/view/1.3.268.0/linux/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-renderPass-02684)
    Objects: 2
        [0] 0x779ad50000000407, type: 18, name: NULL
        [1] 0xca0b160000000085, type: 18, name: NULL
VUID-vkCmdDraw-renderPass-02684(ERROR / SPEC): msgNum: 1349015333 - Validation Error: [ VUID-vkCmdDraw-renderPass-02684 ] Object 0: handle = 0x779ad50000000407, type = VK_OBJECT_TYPE_RENDER_PASS; Object 1: handle = 0xca0b160000000085, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0x50685725 | vkCmdDraw():  RenderPasses incompatible between active render pass w/ VkRenderPass 0x779ad50000000407[] with a dependencyCount of 3 and pipeline state object w/ VkRenderPass 0xca0b160000000085[] with a dependencyCount of 1. The Vulkan spec states: The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS (https://vulkan.lunarg.com/doc/view/1.3.268.0/linux/1.3-extensions/vkspec.html#VUID-vkCmdDraw-renderPass-02684)
    Objects: 2
        [0] 0x779ad50000000407, type: 18, name: NULL
        [1] 0xca0b160000000085, type: 18, name: NULL
VUID-VkRenderPassBeginInfo-renderPass-00904(ERROR / SPEC): msgNum: 861854874 - Validation Error: [ VUID-VkRenderPassBeginInfo-renderPass-00904 ] Object 0: handle = 0x779ad50000000407, type = VK_OBJECT_TYPE_RENDER_PASS; Object 1: handle = 0xca0b160000000085, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0x335edc9a | vkCmdBeginRenderPass(): pRenderPassBegin RenderPasses incompatible between render pass w/ VkRenderPass 0x779ad50000000407[] with a dependencyCount of 3 and framebuffer w/ VkRenderPass 0xca0b160000000085[] with a dependencyCount of 1. The Vulkan spec states: renderPass must be compatible with the renderPass member of the VkFramebufferCreateInfo structure specified when creating framebuffer (https://vulkan.lunarg.com/doc/view/1.3.268.0/linux/1.3-extensions/vkspec.html#VUID-VkRenderPassBeginInfo-renderPass-00904)
    Objects: 2
        [0] 0x779ad50000000407, type: 18, name: NULL
        [1] 0xca0b160000000085, type: 18, name: NULL
doitsujin commented 9 months ago

DXVK 2.x does not even use VkRenderPass, were you using some sort of Vulkan overlay (mangohud?) together with validation layers?

Either way, based on the video in the original post this really just looks like the game computes vertex positions differently in different render passes and depth testing spuriously fails as a result. Common game bug, we already mark vertex positions as invariant to prevent this, but some games just straight-up use different math and expect that to produce the same result.

tpalli commented 9 months ago

For clarification, validation output was produced with wine apitrace-11.1-win64/bin/d3dretrace.exe ./Wow.trace, not sure if that matches with the issue environment or what DXVK would do but that is what happens when replaying the trace.

alphabitserial commented 9 months ago

When I recorded the trace I wasn't using any extra overlays, no. The validation error logs were brought up by tpalli on the mesa issue tracker and I was just relaying it here.

Blisto91 commented 4 months ago

Fwiw i tried replaying both the trace and testing the same spot ingame on Nvidia now while messing with all the settings, but I've still not been able to reproduce the issue. Also not getting any validation errors from the trace.