Promote textures to depth if they use depth tiling

This commit is contained in:
psucien 2024-09-01 23:26:46 +02:00
parent 40c9b2addb
commit 266cca5654
4 changed files with 2 additions and 4 deletions

View file

@ -448,7 +448,6 @@ void GraphicsPipeline::BindResources(const Liverpool::Regs& regs,
const auto tsharp = image_desc.GetSharp(*stage);
if (tsharp) {
tsharps.emplace_back(tsharp);
VideoCore::ImageInfo image_info{tsharp};
VideoCore::ImageInfo image_info{tsharp, image_desc.is_depth};
VideoCore::ImageViewInfo view_info{tsharp, image_desc.is_storage};
const auto& image_view = texture_cache.FindTexture(image_info, view_info);

View file

@ -1,4 +1,4 @@
// SPDX-License-Identifier: MPL-2.0
// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright © 2023 Skyline Team and Contributors (https://github.com/skyline-emu/)
// Copyright © 2015-2023 The Khronos Group Inc.
// Copyright © 2015-2023 Valve Corporation

View file

@ -204,7 +204,7 @@ ImageInfo::ImageInfo(const AmdGpu::Image& image, bool force_depth /*= false*/) n
tiling_mode = image.GetTilingMode();
pixel_format = LiverpoolToVK::SurfaceFormat(image.GetDataFmt(), image.GetNumberFmt());
// Override format if image is forced to be a depth target
if (force_depth) {
if (force_depth || tiling_mode == AmdGpu::TilingMode::Depth_MacroTiled) {
if (pixel_format == vk::Format::eR32Sfloat) {
pixel_format = vk::Format::eD32SfloatS8Uint;
} else if (pixel_format == vk::Format::eR16Sfloat) {

View file

@ -209,7 +209,6 @@ ImageId TextureCache::FindImage(const ImageInfo& info) {
cache_image.info.size == info.size) {
ASSERT(cache_image.info.type == info.type);
ASSERT(cache_image.info.num_bits == info.num_bits);
if (IsVulkanFormatCompatible((VkFormat)info.pixel_format,
(VkFormat)cache_image.info.pixel_format)) {
image_id = cache_id;