mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 08:15:59 +03:00
[PR #1013] [MERGED] shader_recompiler: Additional scope handling and user data as push constants #1880
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#1880
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/1013
Author: @raphaelthegreat
Created: 9/21/2024
Status: ✅ Merged
Merged: 9/23/2024
Merged by: @psucien
Base:
main← Head:some-changes📝 Commits (10+)
58d9218shader_recompiler: Use push constants for user data regs94d8feashader: Add some GR2 instructionsfdd699ashader: Add some instructionsa1eee4ashader: Add instructions for knackdd0773dtouchupsdd0abc5spirv: Better namesc15fa4fbuffer_cache: Ignore non gpu modified imagesf37ca9cclang formatf98a73bAdd logbf16608more fixes📊 Changes
23 files changed (+180 additions, -87 deletions)
View changed files
📝
CMakeLists.txt(+1 -0)📝
src/shader_recompiler/backend/bindings.h(+4 -4)📝
src/shader_recompiler/backend/spirv/emit_spirv.cpp(+1 -1)📝
src/shader_recompiler/backend/spirv/emit_spirv.h(+2 -1)📝
src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp(+8 -1)📝
src/shader_recompiler/backend/spirv/emit_spirv_image.cpp(+1 -0)📝
src/shader_recompiler/backend/spirv/spirv_emit_context.cpp(+20 -14)📝
src/shader_recompiler/backend/spirv/spirv_emit_context.h(+3 -2)📝
src/shader_recompiler/frontend/control_flow_graph.cpp(+15 -7)📝
src/shader_recompiler/frontend/translate/scalar_alu.cpp(+11 -0)📝
src/shader_recompiler/frontend/translate/translate.cpp(+1 -1)📝
src/shader_recompiler/frontend/translate/translate.h(+1 -0)📝
src/shader_recompiler/frontend/translate/vector_alu.cpp(+18 -0)📝
src/shader_recompiler/info.h(+38 -5)📝
src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp(+5 -4)📝
src/shader_recompiler/specialization.h(+5 -4)📝
src/video_core/buffer_cache/buffer_cache.cpp(+5 -3)📝
src/video_core/renderer_vulkan/vk_compute_pipeline.cpp(+11 -12)📝
src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp(+14 -14)📝
src/video_core/renderer_vulkan/vk_pipeline_cache.cpp(+7 -7)...and 3 more files
📄 Description
The initial goal of this PR was to handle some additional cases of divergence spotted in some Bloodborne particle shaders which caused certain branches to be entirely missed.
However this fix by itself, actually regressed the game because some compute shaders used for copying data around had some bounds checks implemented that fell under this category. So the change made the branches work properly, but the limit was stored in user data regs. The compiler treated user data regs as compiler constants and expected they would not change between the same shader. However these shaders can be bound multiple times with different limits depending on how much game was copying.
So the control flow improvement is also bundled with a different change that moves user data regs to the push constant block. I've also added some minor additions from various tests that don't deserve their own PR. This may improve some particle effects in BB but I have not noticed any visual change
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.