[vk] Extended PixelFormat for Depth/Stencil
This commit is contained in:
parent
d0b5866ad1
commit
f5a5e50705
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue