[PR #1997] [CLOSED] Fix PromoteFormatToDepth #2429

Closed
opened 2026-02-27 21:16:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1997
Author: @Xphalnos
Created: 12/31/2024
Status: Closed

Base: mainHead: Fix_PromoteFormatToDepth


📝 Commits (4)

  • e7c5d3b Fix PromoteFormatToDepth
  • 4bae39f Adding R8G8B8A8Srgb
  • 076bd74 Show missing format before crash
  • 7d02688 Merge branch 'shadps4-emu:main' into Fix_PromoteFormatToDepth

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 src/video_core/renderer_vulkan/liverpool_to_vk.h (+5 -1)

📄 Description

Adding to image_view.cpp line 43: LOG_ERROR(Render_Vulkan, "Depht Format {}", vk::to_string(format));

And to image_info.cpp line 315: LOG_ERROR(Render_Vulkan, "Depht Format {}", vk::to_string(pixel_format));

When I launched a Unity game that had this error (Pure Farming 2018), the log showed me that R8G8B8A8Unorm was needed. I added it to liverpool_to_vk.h and log changed.

Before:
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xe08b6588
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x7beef78d
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xb9c471f8c7cc37ff
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x54cd30c3f090d822
[Render.Vulkan] sampler.cpp:Sampler:14: Texture requires gamma correction
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0x4ae148a6c30c94ab
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0xa3590771bc26c480
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0x4364ba6b95ea889c
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x616f852af090d822
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xc01241ce766d0a0f
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x8b450099f090d822
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xc3bff6e3b6212b64
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x812ec1a2f090d822
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x812ec1a2f090d822
[Debug] liverpool_to_vk.h:PromoteFormatToDepth:82: Unreachable code!

After:
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xe08b6588
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x7beef78d
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xb9c471f8c7cc37ff
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x54cd30c3f090d822
[Render.Vulkan] sampler.cpp:Sampler:14: Texture requires gamma correction
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0x4ae148a6c30c94ab
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0xa3590771bc26c480
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0x4364ba6b95ea889c
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x616f852af090d822
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xc01241ce766d0a0f
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x8b450099f090d822
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xc3bff6e3b6212b64
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x812ec1a2f090d822

<941 shader compilation (I wasn't going to copy everything.)>

[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x3192b094029c07d4
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0x86479a572b36012
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0x86479a572b36012
[Debug] resource_tracking_pass.cpp:operator():326: Assertion Failed!

If interested:

Log Before (Main):
shad_log.txt

Log After (My PR):
shad_log.txt

I made it return R32Uint because I was inspired by tile_manager.cpp which returns R32Uint to R8G8B8A8Unorm.
Always ready for modifications or testing!


🔄 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/1997 **Author:** [@Xphalnos](https://github.com/Xphalnos) **Created:** 12/31/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `Fix_PromoteFormatToDepth` --- ### 📝 Commits (4) - [`e7c5d3b`](https://github.com/shadps4-emu/shadPS4/commit/e7c5d3ba86d9f6034172fb876bbc00e59678fb82) Fix PromoteFormatToDepth - [`4bae39f`](https://github.com/shadps4-emu/shadPS4/commit/4bae39f0c88a8d5298d5335181ffcc60225127ee) Adding R8G8B8A8Srgb - [`076bd74`](https://github.com/shadps4-emu/shadPS4/commit/076bd749e18aa79af777ff9e1278e2ce2c46a314) Show missing format before crash - [`7d02688`](https://github.com/shadps4-emu/shadPS4/commit/7d02688f966b3c5c9edabf4ae15345bbbd36ed8a) Merge branch 'shadps4-emu:main' into Fix_PromoteFormatToDepth ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/video_core/renderer_vulkan/liverpool_to_vk.h` (+5 -1) </details> ### 📄 Description Adding to [**image_view.cpp line 43**](https://github.com/shadps4-emu/shadPS4/blob/65cd3be4cae48c9479a83092b2d7b4a28ffaf0e4/src/video_core/texture_cache/image_view.cpp#L43): `LOG_ERROR(Render_Vulkan, "Depht Format {}", vk::to_string(format));` And to [**image_info.cpp line 315**](https://github.com/shadps4-emu/shadPS4/blob/174b5c0f954c1348be29c0b9177a6b89145dd6c9/src/video_core/texture_cache/image_info.cpp#L315): `LOG_ERROR(Render_Vulkan, "Depht Format {}", vk::to_string(pixel_format));` When I launched a Unity game that had this error (Pure Farming 2018), the log showed me that **R8G8B8A8Unorm** was needed. I added it to `liverpool_to_vk.h` and log changed. Before: [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xe08b6588 [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x7beef78d [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xb9c471f8c7cc37ff [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x54cd30c3f090d822 [Render.Vulkan] <Warning> sampler.cpp:Sampler:14: Texture requires gamma correction [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0x4ae148a6c30c94ab [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0xa3590771bc26c480 [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0x4364ba6b95ea889c [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x616f852af090d822 [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xc01241ce766d0a0f [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x8b450099f090d822 [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xc3bff6e3b6212b64 [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x812ec1a2f090d822 [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x812ec1a2f090d822 [Debug] <Critical> liverpool_to_vk.h:PromoteFormatToDepth:82: Unreachable code! After: [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xe08b6588 [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x7beef78d [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xb9c471f8c7cc37ff [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x54cd30c3f090d822 [Render.Vulkan] <Warning> sampler.cpp:Sampler:14: Texture requires gamma correction [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0x4ae148a6c30c94ab [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0xa3590771bc26c480 [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0x4364ba6b95ea889c [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x616f852af090d822 [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xc01241ce766d0a0f [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x8b450099f090d822 [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xc3bff6e3b6212b64 [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x812ec1a2f090d822 <941 shader compilation (I wasn't going to copy everything.)> [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling vs shader 0x3192b094029c07d4 [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0x86479a572b36012 [Render.Vulkan] <Info> vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0x86479a572b36012 [Debug] <Critical> resource_tracking_pass.cpp:operator():326: Assertion Failed! If interested: Log Before (Main): [shad_log.txt](https://github.com/user-attachments/files/18283103/shad_log.txt) Log After (My PR): [shad_log.txt](https://github.com/user-attachments/files/18283105/shad_log.txt) I made it return **R32Uint** because I was inspired by `tile_manager.cpp` which returns **R32Uint** to **R8G8B8A8Unorm**. Always ready for modifications or testing! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:16:29 +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#2429
No description provided.