From 4154787b514a2dded36189858a34cdb34f3574e6 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Tue, 28 Jul 2026 01:55:25 -0400 Subject: [PATCH] [TEST] debug MSAA texture missing handling --- .../renderer_vulkan/vk_texture_cache.cpp | 9 ++++++++- .../renderer_vulkan/vk_texture_cache.h | 1 + .../vulkan_common/vulkan_device.cpp | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index b481c03013..cce454fa48 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1643,7 +1643,14 @@ void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src, const u32 num_samples = msaa_to_non_msaa ? src.info.num_samples : dst.info.num_samples; if (dst.AspectMask() != VK_IMAGE_ASPECT_COLOR_BIT || VideoCore::Surface::IsPixelFormatInteger(dst.info.format)) { - UNIMPLEMENTED_MSG("Copying images with different samples is not supported."); + const u64 key{(static_cast(dst.AspectMask()) << 32) | + static_cast(dst.info.format)}; + if (unsupported_msaa_resolves.insert(key).second) { + LOG_WARNING(Render_Vulkan, + "MSAA resolve unsupported: format={}, aspect={:#x}, samples {}->{}", + dst.info.format, dst.AspectMask(), src.info.num_samples, + dst.info.num_samples); + } return; } if (ENABLE_MSAA_RESOLVE_CONSUME && msaa_to_non_msaa && copies.size() == 1 && diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 41d9c38c70..90c9260873 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -168,6 +168,7 @@ public: std::array buffers{}; std::vector> pending_msaa_images; ankerl::unordered_dense::map resolve_shadows; + ankerl::unordered_dense::set unsupported_msaa_resolves; }; class Framebuffer { diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index ef6093494d..3a9dbca6a4 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -745,6 +745,25 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR vk::Check(vmaCreateAllocator(&allocator_info, &allocator)); + { + const auto& limits = properties.properties.limits; + LOG_INFO(Render_Vulkan, "MSAA sample count support:"); + LOG_INFO(Render_Vulkan, " framebufferColorSampleCounts: {:#x}", + limits.framebufferColorSampleCounts); + LOG_INFO(Render_Vulkan, " framebufferDepthSampleCounts: {:#x}", + limits.framebufferDepthSampleCounts); + LOG_INFO(Render_Vulkan, " framebufferStencilSampleCounts: {:#x}", + limits.framebufferStencilSampleCounts); + LOG_INFO(Render_Vulkan, " sampledImageColorSampleCounts: {:#x}", + limits.sampledImageColorSampleCounts); + LOG_INFO(Render_Vulkan, " sampledImageDepthSampleCounts: {:#x}", + limits.sampledImageDepthSampleCounts); + LOG_INFO(Render_Vulkan, " sampledImageIntegerSampleCounts:{:#x}", + limits.sampledImageIntegerSampleCounts); + LOG_INFO(Render_Vulkan, " storageImageSampleCounts: {:#x}", + limits.storageImageSampleCounts); + } + // Initialize GPU logging if enabled InitializeGPULogging(); }