[PR #2177] [MERGED] texture_cache: Fix image mip overlap. #2541

Closed
opened 2026-02-27 22:00:19 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2177
Author: @squidbus
Created: 1/18/2025
Status: Merged
Merged: 1/18/2025
Merged by: @psucien

Base: mainHead: fix-mip-overlap


📝 Commits (1)

  • 50abf9e texture_cache: Fix image mip overlap.

📊 Changes

3 files changed (+7 additions, -6 deletions)

View changed files

📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+0 -2)
📝 src/video_core/texture_cache/image_info.cpp (+1 -1)
📝 src/video_core/texture_cache/image_view.cpp (+6 -3)

📄 Description

A check in IsMipOf was inverted to return a negative result if tiling is compatible, when it should return a negative result if tiling is not compatible. Additionally, an assert for rebinding color attachments seems to be invalid, as it is not necessarily true that the current state width/height will equal the old image size, if it was not previously the smallest bound attachment.

Additionally, I added level and layer info to image view debug names to help my debugging in this process.

Fixes passes in Hedgehog Engine 2 games where an image's base level would be used as a render target, and then subsequent levels would be rendered to from that base to generate mips.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2177 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 1/18/2025 **Status:** ✅ Merged **Merged:** 1/18/2025 **Merged by:** [@psucien](https://github.com/psucien) **Base:** `main` ← **Head:** `fix-mip-overlap` --- ### 📝 Commits (1) - [`50abf9e`](https://github.com/shadps4-emu/shadPS4/commit/50abf9e75a570c2942ec4ca5896455aa801f5a89) texture_cache: Fix image mip overlap. ### 📊 Changes **3 files changed** (+7 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+0 -2) 📝 `src/video_core/texture_cache/image_info.cpp` (+1 -1) 📝 `src/video_core/texture_cache/image_view.cpp` (+6 -3) </details> ### 📄 Description A check in `IsMipOf` was inverted to return a negative result if tiling is compatible, when it should return a negative result if tiling is not compatible. Additionally, an assert for rebinding color attachments seems to be invalid, as it is not necessarily true that the current state width/height will equal the old image size, if it was not previously the smallest bound attachment. Additionally, I added level and layer info to image view debug names to help my debugging in this process. Fixes passes in Hedgehog Engine 2 games where an image's base level would be used as a render target, and then subsequent levels would be rendered to from that base to generate mips. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:00:19 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2541
No description provided.