[PR #224] [MERGED] video_core: First batch of fixes for Persona5 #1409

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/224
Author: @raphaelthegreat
Created: 7/1/2024
Status: Merged
Merged: 7/1/2024
Merged by: @raphaelthegreat

Base: mainHead: p5_part1


📝 Commits (10+)

  • 3a04571 spirv: Add fragdepth and implement image query
  • 51a9980 image: Fix image type of 1D Array
  • 68a9f2c tls: Fix linux crash
  • eee9365 video_core: Fix a few problems
  • c59c987 video_core: Track renderpass scopes properly
  • 42ad6da renderer_vulkan: Prefer depth stencil read-only layout when possible
  • ebb99bc shader_recompiler: Apply buffer swizzle on vertex attribs
  • 5d3e93f tls: Switch to trace logs
  • d6d3d94 code: Add additional logging during init
  • 92d52a4 clang format

📊 Changes

51 files changed (+695 additions, -306 deletions)

View changed files

📝 src/core/libraries/gnmdriver/gnmdriver.cpp (+1 -0)
📝 src/core/libraries/kernel/thread_management.cpp (+5 -0)
📝 src/core/libraries/libs.cpp (+1 -0)
📝 src/core/libraries/videoout/driver.cpp (+2 -2)
📝 src/core/libraries/videoout/video_out.cpp (+1 -1)
📝 src/core/memory.cpp (+3 -0)
📝 src/core/tls.cpp (+6 -6)
📝 src/emulator.cpp (+3 -6)
📝 src/emulator.h (+2 -0)
📝 src/shader_recompiler/backend/spirv/emit_spirv.cpp (+4 -0)
📝 src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp (+4 -4)
📝 src/shader_recompiler/backend/spirv/emit_spirv_composite.cpp (+6 -6)
📝 src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp (+28 -0)
📝 src/shader_recompiler/backend/spirv/emit_spirv_image.cpp (+60 -13)
📝 src/shader_recompiler/backend/spirv/emit_spirv_instructions.h (+4 -5)
📝 src/shader_recompiler/backend/spirv/emit_spirv_select.cpp (+1 -1)
📝 src/shader_recompiler/backend/spirv/emit_spirv_undefined.cpp (+3 -3)
📝 src/shader_recompiler/backend/spirv/spirv_emit_context.cpp (+14 -7)
📝 src/shader_recompiler/backend/spirv/spirv_emit_context.h (+1 -0)
📝 src/shader_recompiler/frontend/translate/scalar_alu.cpp (+2 -2)

...and 31 more files

📄 Description

  • Load libSceFiber LLE if present in sys_modules. We have no HLE for this yet (soon) but it is required for game to boot (removed for now, we need to properly test on windows)
  • Switch IREmitter exceptions to assertions as these should fail compilation entirely and help debugging a lot more.
  • Fix image type of 1DArray. Add more shaders instructions like textureGather(), textureOffset and textureSize() used by the game.
  • Apply buffer swizzles on fetch shader parsing
  • Not related to game specifically, but this PR also includes renderpass state tracking so the renderdoc captures are less noisy and we have better performance with validation layers enabled.
  • Fixed depth feedback loop of sorts that spammed validation errors. For depth images we try to prefer VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL when possible. So if image is depth we transit to that when bound as texture, and if depth write is disabled we also transit to that when used as attachment. The game can't both write and read to depth, so this will always work and the layout allows depth image to be both attachment and sampled at same time.

🔄 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/224 **Author:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Created:** 7/1/2024 **Status:** ✅ Merged **Merged:** 7/1/2024 **Merged by:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Base:** `main` ← **Head:** `p5_part1` --- ### 📝 Commits (10+) - [`3a04571`](https://github.com/shadps4-emu/shadPS4/commit/3a04571d56e53d7e9a7d3280f407d00b74a5756e) spirv: Add fragdepth and implement image query - [`51a9980`](https://github.com/shadps4-emu/shadPS4/commit/51a9980d6786c21f846103ece774f08a69643365) image: Fix image type of 1D Array - [`68a9f2c`](https://github.com/shadps4-emu/shadPS4/commit/68a9f2cf48af41308d316d01e917e0855b055d3a) tls: Fix linux crash - [`eee9365`](https://github.com/shadps4-emu/shadPS4/commit/eee93651e74f5c7054c912168b7d46cee2745a56) video_core: Fix a few problems - [`c59c987`](https://github.com/shadps4-emu/shadPS4/commit/c59c987ed2218165cb2375d27311273d46556d75) video_core: Track renderpass scopes properly - [`42ad6da`](https://github.com/shadps4-emu/shadPS4/commit/42ad6daa0e909b4b65f9837271c4dccdab50fa55) renderer_vulkan: Prefer depth stencil read-only layout when possible - [`ebb99bc`](https://github.com/shadps4-emu/shadPS4/commit/ebb99bcaf0f571791c4e99d3a00406b501993820) shader_recompiler: Apply buffer swizzle on vertex attribs - [`5d3e93f`](https://github.com/shadps4-emu/shadPS4/commit/5d3e93f1f3b70033a06c2510d26dbbc39c1725a4) tls: Switch to trace logs - [`d6d3d94`](https://github.com/shadps4-emu/shadPS4/commit/d6d3d94346bef9a5b5a2f6ea02e8652b846e288b) code: Add additional logging during init - [`92d52a4`](https://github.com/shadps4-emu/shadPS4/commit/92d52a4701f9c9b7b34135df996b88078e63fd38) clang format ### 📊 Changes **51 files changed** (+695 additions, -306 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/gnmdriver/gnmdriver.cpp` (+1 -0) 📝 `src/core/libraries/kernel/thread_management.cpp` (+5 -0) 📝 `src/core/libraries/libs.cpp` (+1 -0) 📝 `src/core/libraries/videoout/driver.cpp` (+2 -2) 📝 `src/core/libraries/videoout/video_out.cpp` (+1 -1) 📝 `src/core/memory.cpp` (+3 -0) 📝 `src/core/tls.cpp` (+6 -6) 📝 `src/emulator.cpp` (+3 -6) 📝 `src/emulator.h` (+2 -0) 📝 `src/shader_recompiler/backend/spirv/emit_spirv.cpp` (+4 -0) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp` (+4 -4) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_composite.cpp` (+6 -6) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp` (+28 -0) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_image.cpp` (+60 -13) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_instructions.h` (+4 -5) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_select.cpp` (+1 -1) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_undefined.cpp` (+3 -3) 📝 `src/shader_recompiler/backend/spirv/spirv_emit_context.cpp` (+14 -7) 📝 `src/shader_recompiler/backend/spirv/spirv_emit_context.h` (+1 -0) 📝 `src/shader_recompiler/frontend/translate/scalar_alu.cpp` (+2 -2) _...and 31 more files_ </details> ### 📄 Description * ~~Load libSceFiber LLE if present in sys_modules. We have no HLE for this yet (soon) but it is required for game to boot~~ (removed for now, we need to properly test on windows) * Switch IREmitter exceptions to assertions as these should fail compilation entirely and help debugging a lot more. * Fix image type of 1DArray. Add more shaders instructions like textureGather(), textureOffset and textureSize() used by the game. * Apply buffer swizzles on fetch shader parsing * Not related to game specifically, but this PR also includes renderpass state tracking so the renderdoc captures are less noisy and we have better performance with validation layers enabled. * Fixed depth feedback loop of sorts that spammed validation errors. For depth images we try to prefer VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL when possible. So if image is depth we transit to that when bound as texture, and if depth write is disabled we also transit to that when used as attachment. The game can't both write and read to depth, so this will always work and the layout allows depth image to be both attachment and sampled at same time. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:12:25 +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#1409
No description provided.