Vulkan/D3D12: Fix HDR rendering, ribbon shaders, and pipeline barriers#18734
Merged
LibretroAdmin merged 3 commits intolibretro:masterfrom Feb 16, 2026
Merged
Conversation
Contributor
Author
|
@warmenhoven Here's the PR with all the Vulkan validation errors fixed AND the addition of the ribbon shaders adhering to the rest of the menu system and using the menu alpha instead of 1.0. The HDR version of XMB looks much more in line with the SDR version now. If you have the time please let me know if this fixes the issues you were seeing on MacOS and/or iOS so that we can get this merged. Thanks |
Save point for in-progress gfx driver changes including Vulkan ribbon shader updates and D3D12 fixes.
Fix render pass / framebuffer format mismatch when rendering through the SDR offscreen buffer in HDR mode. The filter chain's final pass and the frame render pass were using vk->render_pass (A2B10G10R10) while the offscreen buffer framebuffer was created with vk->sdr_render_pass (B8G8R8A8), causing a Vulkan validation error. Select the correct render pass at frame time based on use_offscreen_buffer, and rebuild the filter chain's final pass pipeline to use the SDR render pass both at shader preset load and at swapchain recreation. Also fix an incorrect srcStageMask in the image layout transition after the HDR pipeline: SHADER_READ_BIT requires FRAGMENT_SHADER_BIT, not COLOR_ATTACHMENT_OUTPUT_BIT.
Change the alpha blend operation from ADD to MAX in the blend-enabled pipeline states for both Vulkan and D3D12. This ensures the render target alpha channel is always 1.0 (since the background establishes alpha=1.0 and max(src, 1.0) preserves it) while leaving RGB blending with SRC_ALPHA / ONE_MINUS_SRC_ALPHA completely unchanged.
aa16bba to
5c5382a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vk->render_pass(A2B10G10R10) while the offscreen buffer framebuffer was created withvk->sdr_render_pass(B8G8R8A8), causing a validation error onvkCmdBeginRenderPasssrcStageMaskin Vulkan image layout transition after HDR pipeline (SHADER_READ_BITrequiresFRAGMENT_SHADER_BIT, notCOLOR_ATTACHMENT_OUTPUT_BIT)