Browse Source

[vk] Extended PixelFormat for Depth/Stencil

eds-true-adreno-fixes
CamilleLaVey 3 weeks ago
committed by Caio Oliveira
parent
commit
54d6a2015d
No known key found for this signature in database GPG Key ID: AAAE6C7FD4186B0C
  1. 6
      src/video_core/compatible_formats.cpp
  2. 6
      src/video_core/renderer_vulkan/vk_texture_cache.cpp

6
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;
}

6
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;
}

Loading…
Cancel
Save