mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 08:15:59 +03:00
[PR #543] [MERGED] video_core: Bloodborne stabilization pt1 #1622
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#1622
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/543
Author: @raphaelthegreat
Created: 8/23/2024
Status: ✅ Merged
Merged: 8/24/2024
Merged by: @raphaelthegreat
Base:
main← Head:bb-stab📝 Commits (10+)
4eda045shader_recompiler: Writelane elimination pass + null image fix03c8b35spirv: Implement image derivatives64bba7ftexture_cache: Reduce page bit size95a9772clang formatf5bf701slot_vector: Back to debug asserta8c4f44vk_graphics_pipeline: Handle null tsharpeb306bbspirv: Revert some change9f0b9bavk_instance: Support primitive restart on list topologye7dcd9cpage_manager: Adjust windows exception handler2395546clang format📊 Changes
25 files changed (+187 additions, -107 deletions)
View changed files
📝
src/common/slot_vector.h(+7 -15)📝
src/core/libraries/kernel/thread_management.cpp(+0 -1)📝
src/shader_recompiler/backend/spirv/emit_spirv_image.cpp(+28 -5)📝
src/shader_recompiler/backend/spirv/emit_spirv_instructions.h(+5 -2)📝
src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp(+12 -0)📝
src/shader_recompiler/frontend/translate/data_share.cpp(+9 -7)📝
src/shader_recompiler/frontend/translate/scalar_alu.cpp(+5 -2)📝
src/shader_recompiler/frontend/translate/vector_memory.cpp(+18 -6)📝
src/shader_recompiler/ir/ir_emitter.cpp(+12 -4)📝
src/shader_recompiler/ir/ir_emitter.h(+3 -1)📝
src/shader_recompiler/ir/opcodes.inc(+14 -12)📝
src/shader_recompiler/ir/passes/constant_propogation_pass.cpp(+14 -0)📝
src/shader_recompiler/ir/passes/resource_tracking_pass.cpp(+14 -17)📝
src/shader_recompiler/ir/passes/ssa_rewrite_pass.cpp(+1 -19)📝
src/shader_recompiler/ir/reg.h(+1 -0)📝
src/shader_recompiler/recompiler.cpp(+1 -1)📝
src/video_core/amdgpu/resource.h(+4 -0)📝
src/video_core/page_manager.cpp(+4 -2)📝
src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp(+12 -7)📝
src/video_core/renderer_vulkan/vk_instance.cpp(+8 -0)...and 5 more files
📄 Description
Implements some missing features in shader recompiler. When this is merged we wont have to skip any graphics shaders anymore (for compute it's still needed due to usage of DS_APPEND)
Most sharp related crashes were in shaders that used a specific pattern of preserving SGPRs. Because these registers are much fewer than VGPRs the compiler might choose to broadcast them to certain scratch VGPRs of specific lanes with V_WRITELANE_B32. When they are needed V_READLANE_B32 is used to read them back. The pattern is as follows:
Our writelane stub proved to be wrong here, since it would overwrite the VGPR completely, making all previous lane writes invisible. To fix this, dedicated IR instructions for ReadLane and WriteLane have been added. The WriteLane IR op interface is based on WriteInvocationAMD added in SPV_AMD_shader_ballot. A constant propagation pass has been added which detects ReadLane instructions whose value comes directly from a WriteLane (no operations that modify the VGPR in between) and eliminates it with the actual SSA value. This allows the resource tracking pass to work properly and fix invalid trackings.
Also implemented image derivatives specifically for 2D images (supporting more than that is a bit tricky, for later ig).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.