[PR #2892] [MERGED] vulkan: Handle incompatible depth format using null binding. #3059

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2892
Author: @squidbus
Created: 5/9/2025
Status: Merged
Merged: 5/9/2025
Merged by: @squidbus

Base: mainHead: depth-null


📝 Commits (1)

  • 3b703f7 vulkan: Handle incompatible depth format using null binding.

📊 Changes

7 files changed (+55 additions, -17 deletions)

View changed files

📝 src/shader_recompiler/info.h (+5 -0)
📝 src/shader_recompiler/ir/passes/resource_tracking_pass.cpp (+6 -0)
📝 src/video_core/amdgpu/resource.h (+13 -0)
📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+3 -2)
📝 src/video_core/texture_cache/image_view.h (+0 -2)
📝 src/video_core/texture_cache/texture_cache.cpp (+24 -13)
📝 src/video_core/texture_cache/texture_cache.h (+4 -0)

📄 Description

Builds on latest version of https://github.com/shadps4-emu/shadPS4/pull/2818 a bit with some additional parts to bind the dummy depth image to a proper Vulkan-side image.

Essentially, for a complete view of what this does:

  • If we encounter a depth image instruction operating on a non-depth image in a shader, we replace it with a stand-in null depth image, using a format compatible with depth.
  • On the Vulkan texture cache side, when we would normally return the fixed null image ID, now we try to return a null image that is appropriately typed to the request. This ensures that we won't try to resolve the new null depth image to a Vulkan image that still isn't compatible with depth formats.

I believe this will allow the depth promote workaround here to also pass Vulkan validation. Please test with some games that hit this issue and see if they get past it. If you know how, please also check to make sure there aren't any weird format incompatibility validation errors when the assert would normally happen.


🔄 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/2892 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 5/9/2025 **Status:** ✅ Merged **Merged:** 5/9/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `depth-null` --- ### 📝 Commits (1) - [`3b703f7`](https://github.com/shadps4-emu/shadPS4/commit/3b703f738094d9c671057e4da18ecb5e04d307a9) vulkan: Handle incompatible depth format using null binding. ### 📊 Changes **7 files changed** (+55 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `src/shader_recompiler/info.h` (+5 -0) 📝 `src/shader_recompiler/ir/passes/resource_tracking_pass.cpp` (+6 -0) 📝 `src/video_core/amdgpu/resource.h` (+13 -0) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+3 -2) 📝 `src/video_core/texture_cache/image_view.h` (+0 -2) 📝 `src/video_core/texture_cache/texture_cache.cpp` (+24 -13) 📝 `src/video_core/texture_cache/texture_cache.h` (+4 -0) </details> ### 📄 Description Builds on latest version of https://github.com/shadps4-emu/shadPS4/pull/2818 a bit with some additional parts to bind the dummy depth image to a proper Vulkan-side image. Essentially, for a complete view of what this does: * If we encounter a depth image instruction operating on a non-depth image in a shader, we replace it with a stand-in null depth image, using a format compatible with depth. * On the Vulkan texture cache side, when we would normally return the fixed null image ID, now we try to return a null image that is appropriately typed to the request. This ensures that we won't try to resolve the new null depth image to a Vulkan image that still isn't compatible with depth formats. I believe this will allow the depth promote workaround here to also pass Vulkan validation. Please test with some games that hit this issue and see if they get past it. If you know how, please also check to make sure there aren't any weird format incompatibility validation errors when the assert would normally happen. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:02:17 +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#3059
No description provided.