Skip to content

Commit

Permalink
texture_cache: Fix image mip overlap. (shadps4-emu#2177)
Browse files Browse the repository at this point in the history
  • Loading branch information
squidbus authored Jan 18, 2025
1 parent 12364b1 commit d361579
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/video_core/renderer_vulkan/vk_rasterizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,6 @@ void Rasterizer::BeginRendering(const GraphicsPipeline& pipeline, RenderState& s
const auto mip = view.info.range.base.level;
state.width = std::min<u32>(state.width, std::max(image.info.size.width >> mip, 1u));
state.height = std::min<u32>(state.height, std::max(image.info.size.height >> mip, 1u));
ASSERT(old_img.info.size.width == state.width);
ASSERT(old_img.info.size.height == state.height);
}
auto& image = texture_cache.GetImage(image_id);
if (image.binding.force_general) {
Expand Down
2 changes: 1 addition & 1 deletion src/video_core/texture_cache/image_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ int ImageInfo::IsMipOf(const ImageInfo& info) const {
return -1;
}

if (IsTilingCompatible(info.tiling_idx, tiling_idx)) {
if (!IsTilingCompatible(info.tiling_idx, tiling_idx)) {
return -1;
}

Expand Down
9 changes: 6 additions & 3 deletions src/video_core/texture_cache/image_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@ ImageView::ImageView(const Vulkan::Instance& instance, const ImageViewInfo& info
const auto view_aspect = aspect & vk::ImageAspectFlagBits::eDepth ? "Depth"
: aspect & vk::ImageAspectFlagBits::eStencil ? "Stencil"
: "Color";
Vulkan::SetObjectName(instance.GetDevice(), *image_view, "ImageView {}x{}x{} {:#x}:{:#x} ({})",
image.info.size.width, image.info.size.height, image.info.size.depth,
image.info.guest_address, image.info.guest_size, view_aspect);
Vulkan::SetObjectName(
instance.GetDevice(), *image_view, "ImageView {}x{}x{} {:#x}:{:#x} {}:{} {}:{} ({})",
image.info.size.width, image.info.size.height, image.info.size.depth,
image.info.guest_address, image.info.guest_size, info.range.base.level,
info.range.base.level + info.range.extent.levels - 1, info.range.base.layer,
info.range.base.layer + info.range.extent.layers - 1, view_aspect);
}

ImageView::~ImageView() = default;
Expand Down

0 comments on commit d361579

Please sign in to comment.