From 492304e2150ac4f3c4b529342b81347def3b69d6 Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Tue, 28 Apr 2026 22:30:13 -0700 Subject: [PATCH] renderer_vulkan: Fix `ConvertDS24S8ToRGBA8` image targets Ensure that the Multi-Sample texture is used for the destination color image as well. Should the dest image be MSAA too? Or should all the values be resolved into a minimum depth and some combination of stencil-values here? --- .../format_reinterpreter/vulkan_d24s8_to_rgba8_ms.comp | 4 ++-- src/video_core/renderer_vulkan/vk_blit_helper.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/video_core/host_shaders/format_reinterpreter/vulkan_d24s8_to_rgba8_ms.comp b/src/video_core/host_shaders/format_reinterpreter/vulkan_d24s8_to_rgba8_ms.comp index 3dca7c91e..62297a202 100644 --- a/src/video_core/host_shaders/format_reinterpreter/vulkan_d24s8_to_rgba8_ms.comp +++ b/src/video_core/host_shaders/format_reinterpreter/vulkan_d24s8_to_rgba8_ms.comp @@ -17,10 +17,10 @@ layout(push_constant, std140) uniform ComputeInfo { }; void main() { - int sample_count = textureSamples(depth); - ivec2 src_coord = src_offset + ivec2(gl_GlobalInvocationID.xy); ivec2 dst_coord = dst_offset + ivec2(gl_GlobalInvocationID.xy); + + int sample_count = textureSamples(depth); for(int sample_index = 0; sample_index < sample_count; ++sample_index) { highp uint depth_val = uint(texelFetch(depth, src_coord, sample_index).x * (exp2(32.0) - 1.0)); diff --git a/src/video_core/renderer_vulkan/vk_blit_helper.cpp b/src/video_core/renderer_vulkan/vk_blit_helper.cpp index dc758c13f..0d530ac95 100644 --- a/src/video_core/renderer_vulkan/vk_blit_helper.cpp +++ b/src/video_core/renderer_vulkan/vk_blit_helper.cpp @@ -421,12 +421,12 @@ bool BlitHelper::ConvertDS24S8ToRGBA8(Surface& source, Surface& dest, update_queue.AddImageSampler(descriptor_set, 1, 0, source.ImageView(ViewType::Stencil, src_type), VK_NULL_HANDLE, vk::ImageLayout::eDepthStencilReadOnlyOptimal); - update_queue.AddStorageImage(descriptor_set, 2, dest.ImageView()); + update_queue.AddStorageImage(descriptor_set, 2, dest.ImageView(ViewType::Sample, src_type)); renderpass_cache.EndRendering(); - scheduler.Record([this, pipeline, descriptor_set, copy, src_image = source.Image(), - dst_image = dest.Image()](vk::CommandBuffer cmdbuf) { + scheduler.Record([this, pipeline, descriptor_set, copy, src_image = source.Image(src_type), + dst_image = dest.Image(src_type)](vk::CommandBuffer cmdbuf) { const std::array pre_barriers = { vk::ImageMemoryBarrier{ .srcAccessMask = vk::AccessFlagBits::eDepthStencilAttachmentWrite,