diff --git a/src/video_core/compatible_formats.cpp b/src/video_core/compatible_formats.cpp index 87d69ebc53..22137c69bc 100644 --- a/src/video_core/compatible_formats.cpp +++ b/src/video_core/compatible_formats.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -235,6 +238,9 @@ constexpr Table MakeViewTable() { EnableRange(view, VIEW_CLASS_ASTC_10x10_RGBA); EnableRange(view, VIEW_CLASS_ASTC_12x10_RGBA); EnableRange(view, VIEW_CLASS_ASTC_12x12_RGBA); + Enable(view, PixelFormat::D24_UNORM_S8_UINT, PixelFormat::S8_UINT); + Enable(view, PixelFormat::S8_UINT_D24_UNORM, PixelFormat::S8_UINT); + Enable(view, PixelFormat::D32_FLOAT_S8_UINT, PixelFormat::S8_UINT); return view; } diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index d85afb8db4..faf9a0e904 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -48,6 +48,7 @@ using VideoCore::Surface::HasAlpha; using VideoCore::Surface::IsPixelFormatASTC; using VideoCore::Surface::IsPixelFormatInteger; using VideoCore::Surface::SurfaceType; +using VideoCore::Surface::PixelFormat; using VideoCore::Surface::PixelFormatNumeric; namespace { @@ -2362,7 +2363,10 @@ VkImageView ImageView::StencilView(Shader::TextureType texture_type) { if (view) { return *view; } - const auto& info = MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, format); + const auto surface_type = VideoCore::Surface::GetFormatType(format); + const PixelFormat view_format = + surface_type == SurfaceType::DepthStencil ? PixelFormat::S8_UINT : format; + const auto& info = MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, view_format); view = MakeView(info.format, VK_IMAGE_ASPECT_STENCIL_BIT, texture_type); return *view; }