eden-miror/src
wildcard 4eb6d10d62
[Vk] Improve Stencil Handling and Fix Read-After-Write Hazard (#235)
1. Improves stencil handling:
   - Adds surface type detection to distinguish between color, depth, stencil, and depth-stencil formats
   - Only enables stencil load/store operations for surfaces that actually contain stencil data
   - Avoids unnecessary stencil operations for non-stencil formats (DONT_CARE)

2. Fixes read-after-write (RAW) synchronization hazards:
   - Adds a subpass self-dependency (subpass 0 → subpass 0)
   - Synchronizes color/depth writes with subsequent shader reads
   - Uses VK_DEPENDENCY_BY_REGION_BIT for efficient synchronization
   - Covers all possible relevant stages,
     • src: Color output + Early/Late fragment tests
     • dst: Fragment shader
     • Access: Write → Read transitions
here is what hazard looks like [1147.550616] Render.Vulkan <Critical> video_core/vulkan_common/vulkan_debug_callback.cpp:DebugUtilCallback:55: Validation Error: [ SYNC-HAZARD-READ-AFTER-WRITE ] Object 0: handle = 0x7409630000000192, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0xe4d96472 | vkCmdDrawIndexed: Hazard READ_AFTER_WRITE for VkImageView 0x7409630000000192[], in VkCommandBuffer 0xb400007cb003ea70[], and VkPipeline 0x44d3470000000213[], VkDescriptorSet 0x0[], type: VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, imageLayout: VK_IMAGE_LAYOUT_GENERAL, binding #2, index 0. Access info (usage: SYNC_FRAGMENT_SHADER_SHADER_SAMPLED_READ, prior_usage: SYNC_IMAGE_LAYOUT_TRANSITION, write_barriers: SYNC_FRAGMENT_SHADER_COLOR_ATTACHMENT_READ|SYNC_FRAGMENT_SHADER_DEPTH_STENCIL_ATTACHMENT_READ|SYNC_FRAGMENT_SHADER_INPUT_ATTACHMENT_READ|SYNC_EARLY_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_READ|SYNC_EARLY_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_WRITE|SYNC_LATE_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_READ|SYNC_LATE_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_WRITE|SYNC_COLOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_READ|SYNC_COLOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_WRITE|SYNC_SUBPASS_SHADER_HUAWEI_INPUT_ATTACHMENT_READ, command: vkCmdPipelineBarrier, seq_no: 45, reset_no: 129).

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/235
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev>
Co-authored-by: wildcard <nubieluv@gmail.com>
Co-committed-by: wildcard <nubieluv@gmail.com>
2025-08-23 20:04:48 +02:00
..
android updated the translation (#288) 2025-08-23 19:53:16 +02:00
audio_core [meta] remove MicroProfile (#185) 2025-08-06 07:48:11 +02:00
common [video_core] Add option to control the DMA precision level at runtime (#304) 2025-08-23 19:42:10 +02:00
core [cmake] refactor: SDL2 CI and CPMUtil::AddCIPackage (#284) 2025-08-23 19:42:49 +02:00
dedicated_room [cmake] fix regressions intr. CPM and packaging (#201) 2025-08-04 21:57:01 +02:00
dynarmic [ci, cmake] openssl updates, fix drpc and ci scripts (#283) 2025-08-19 21:29:36 +02:00
frontend_common [android] Fix key install and revert to old icon_bg 2025-07-13 01:17:32 -04:00
hid_core [icc] fix intel c++ compiler errors (#146) 2025-07-30 20:59:28 +02:00
input_common [icc] fix intel c++ compiler errors (#146) 2025-07-30 20:59:28 +02:00
network [ci, cmake] openssl updates, fix drpc and ci scripts (#283) 2025-08-19 21:29:36 +02:00
shader_recompiler [spirv] improved spir-v shader opt (#239) 2025-08-15 21:40:41 +02:00
tests feature/landscape-carousel (#196) 2025-06-26 20:52:54 +00:00
video_core [Vk] Improve Stencil Handling and Fix Read-After-Write Hazard (#235) 2025-08-23 20:04:48 +02:00
web_service [cmake] refactor: SDL2 CI and CPMUtil::AddCIPackage (#284) 2025-08-23 19:42:49 +02:00
yuzu [cmake] refactor: SDL2 CI and CPMUtil::AddCIPackage (#284) 2025-08-23 19:42:49 +02:00
yuzu_cmd [compat] fix solaris build and update instructions for CPM on solaris (#270) 2025-08-20 00:21:16 +02:00
yuzu_room_standalone Fix License headers & CI (#168) 2025-06-09 01:40:21 +00:00
.clang-format
CMakeLists.txt [cmake, frontend] feat: CPMUtil + dependency viewer (#238) 2025-08-11 22:27:29 +02:00
dep_hashes.h.in [cmake, frontend] feat: CPMUtil + dependency viewer (#238) 2025-08-11 22:27:29 +02:00