mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 00:05:58 +03:00
[PR #3447] [MERGED] shader_recompiler: Improve shader exports accuracy (part 1) #3474
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#3474
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/3447
Author: @raphaelthegreat
Created: 8/23/2025
Status: ✅ Merged
Merged: 8/23/2025
Merged by: @squidbus
Base:
main← Head:comp_swap📝 Commits (3)
c8ed5c2video_core: support for RT layer outputs4985d7fexport: Rework render target exports0c2fe89vk_pipeline_cache: Apply swizzle to write masks📊 Changes
17 files changed (+286 additions, -272 deletions)
View changed files
📝
src/shader_recompiler/backend/spirv/emit_spirv.cpp(+3 -0)📝
src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp(+15 -51)📝
src/shader_recompiler/backend/spirv/spirv_emit_context.cpp(+19 -28)📝
src/shader_recompiler/backend/spirv/spirv_emit_context.h(+2 -0)📝
src/shader_recompiler/frontend/translate/export.cpp(+87 -121)📝
src/shader_recompiler/frontend/translate/translate.h(+1 -7)📝
src/shader_recompiler/info.h(+1 -0)📝
src/shader_recompiler/ir/passes/ring_access_elimination.cpp(+7 -5)📝
src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp(+4 -0)➕
src/shader_recompiler/ir/position.h(+53 -0)📝
src/shader_recompiler/runtime_info.h(+8 -6)📝
src/video_core/amdgpu/pixel_format.h(+11 -6)📝
src/video_core/renderer_vulkan/vk_instance.cpp(+1 -0)📝
src/video_core/renderer_vulkan/vk_pipeline_cache.cpp(+64 -47)📝
src/video_core/renderer_vulkan/vk_rasterizer.cpp(+7 -0)📝
src/video_core/renderer_vulkan/vk_scheduler.cpp(+2 -1)📝
src/video_core/renderer_vulkan/vk_scheduler.h(+1 -0)📄 Description
This includes 2 changes
Rebased version of https://github.com/shadps4-emu/shadPS4/pull/3226. The code there is relevant to the file being refactored so it would cause more conflict. It's also an effort to prevent that PR from code-rotting a second time
MRT swizzle is now applied to the color vector instead of the destination channels. This appears more accurate to what hardware does, I've also written an example in the commit description of a broken output because of it.
This is part 1 because this code also needs fixes to account for broken blending. The comp_swap swizzle is applied after blending on hardware, so swizzling shader output can break blending step because it swaps its inputs. In most cases when no swizzle is applied or simple BGR swizzles it's okay but when alpha and RGB components are swapped (e.g ARGB) it doesn't work, and iirc this affects some effects in Knack.
That probably needs to implement blending step in software with fragment shader interlock which is a big change in itself
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.