From 41148132f042af08d9cce452238d2e4f6ab00665 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 27 Nov 2025 19:28:35 -0400 Subject: [PATCH] [vk] Added support for sample locations in depth and depth-stencil surfaces --- src/video_core/renderer_vulkan/vk_texture_cache.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index f544990067..ca9c0d41e5 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -137,6 +137,13 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { if (info.type == ImageType::e3D) { flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT; } + if (device.IsExtSampleLocationsSupported()) { + const auto surface_type = VideoCore::Surface::GetFormatType(info.format); + if (surface_type == VideoCore::Surface::SurfaceType::Depth || + surface_type == VideoCore::Surface::SurfaceType::DepthStencil) { + flags |= VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT; + } + } const auto [samples_x, samples_y] = VideoCommon::SamplesLog2(info.num_samples); return VkImageCreateInfo{ .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,