[vk] Extended PixelFormat for Depth/Stencil

This commit is contained in:
CamilleLaVey 2025-12-01 01:24:15 -04:00 committed by lizzie
parent 68d599e214
commit 829e58aa31
2 changed files with 11 additions and 1 deletions

View file

@ -50,6 +50,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 {
@ -2445,7 +2446,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;
}