[vk, msaa] Rewrite MSAA texture upload/download handling #133

Open
MrPurple666 wants to merge 1 commit from MrPurple666/eden:msaa-new into master
Owner

This pull request significantly improves the robustness and flexibility of MSAA texture handling in the Vulkan backend. It replaces the previous MSAACopyPass-based method, which relied on limited and unstable logic, with an explicit and well-defined blit path that leverages Vulkan’s transfer and layout semantics. During texture uploads, MSAA images now receive data via an intermediate non-MSAA image followed by a vkCmdBlitImage operation, ensuring compliance with Vulkan’s constraints and providing a generalized solution for various image formats. Likewise, for downloads, the process is reversed: MSAA images are blitted into a temporary non-MSAA image before copying to the target buffer. Layout transitions and synchronization are handled with explicit barriers, enhancing clarity and correctness. This approach not only improves reliability and maintainability but also sets the foundation for supporting more complex formats like depth/stencil in future work. Furthermore, a minor change ensures that images flagged for storage use are initialized with a standard RGBA swizzle to avoid undefined shader behavior.

PS: Tested on Android only.

This pull request significantly improves the robustness and flexibility of MSAA texture handling in the Vulkan backend. It replaces the previous MSAACopyPass-based method, which relied on limited and unstable logic, with an explicit and well-defined blit path that leverages Vulkan’s transfer and layout semantics. During texture uploads, MSAA images now receive data via an intermediate non-MSAA image followed by a vkCmdBlitImage operation, ensuring compliance with Vulkan’s constraints and providing a generalized solution for various image formats. Likewise, for downloads, the process is reversed: MSAA images are blitted into a temporary non-MSAA image before copying to the target buffer. Layout transitions and synchronization are handled with explicit barriers, enhancing clarity and correctness. This approach not only improves reliability and maintainability but also sets the foundation for supporting more complex formats like depth/stencil in future work. Furthermore, a minor change ensures that images flagged for storage use are initialized with a standard RGBA swizzle to avoid undefined shader behavior. PS: Tested on Android only.
Shinmegumi force-pushed msaa-new from 9be971f59b to 7672704731 2025-07-26 23:21:12 +02:00 Compare
MaranBr force-pushed msaa-new from 7672704731 to e8c49be369 2025-07-27 02:26:24 +02:00 Compare
Shinmegumi force-pushed msaa-new from e8c49be369 to e12a500720 2025-08-02 00:11:15 +02:00 Compare
crueter force-pushed msaa-new from e12a500720 to 55c1b9ddcd 2025-08-03 01:57:37 +02:00 Compare
crueter force-pushed msaa-new from 55c1b9ddcd to f6b227ebfd 2025-08-04 23:56:58 +02:00 Compare
Member

@MrPurple666 Is this PR still valid?

@MrPurple666 Is this PR still valid?
All checks were successful
eden-license / license-header (pull_request) Successful in 37s
Required
Details
This pull request has changes conflicting with the target branch.
  • src/video_core/renderer_vulkan/vk_texture_cache.cpp
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u msaa-new:MrPurple666-msaa-new
git checkout MrPurple666-msaa-new
Sign in to join this conversation.
No description provided.