mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 00:05:58 +03:00
[GH-ISSUE #296] [CUSA03173] [01.09] Sliders in Bloodborne are drawn incorrectly #45
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#45
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?
Originally created by @roamic on GitHub (Jul 16, 2024).
Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/296
The bar near 7 should be partly filled.
It seems to me that it is missing some constant buffer updates for some reason.
This shader code is responsible for the positioning:
It looks like a transform matrix multiplication.
This is the buffer content at the time of rendering:

@raphaelthegreat commented on GitHub (Jul 18, 2024):
Can you check if it uses inline constant buffers by any chance? Resource tracking pass has the pattern for them in gcn assembly.
@roamic commented on GitHub (Jul 18, 2024):
@raphaelthegreat no, doesn't seem so
@raphaelthegreat commented on GitHub (Jul 18, 2024):
Go to core/memory.cpp and comment out the return; statements in the vulkan functions. Then apply this patch
github.com/raphaelthegreat/shadPS4@a7c69c1512/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp (L346)@raphaelthegreat commented on GitHub (Jul 18, 2024):
Also the same in ComputePipeline just in case
@roamic commented on GitHub (Jul 18, 2024):
With
texture_cache.OnCpuWrite(address);it goesOutOfDeviceMemorybefore even showing the logos. Without it — it does nothing.@raphaelthegreat commented on GitHub (Jul 18, 2024):
Also add a check that address is not zero as I remember BB passes some invalid buffers
@roamic commented on GitHub (Jul 18, 2024):
It doesn't go OOM anymore even without the address check, but the original issue persists.
@roamic commented on GitHub (Aug 16, 2024):
Just for the history I recap what Turtle has uncovered:
The game uses user registers to supply a parameter to the shader. Those need to be detected and implemented with push constants.
@roamic commented on GitHub (Aug 17, 2024):
These artifacts are caused by the same issue. They use the same vertex shader.
And it's not about user registers, it's about constant buffers being invalid. The supplied CB contains two 2x4 2D transform matrices for vertex position and texcoords. Those matrices always contain values that were set during their initialization rather than current values. So either game cannot update them for some reason, or the emulator misses the update.
@roamic commented on GitHub (Aug 17, 2024):
One other possible cause is vertex buffers. Fragment shader has fragment alpha channel set to
vs_attr_0.wthat is directly copied from the VS input. And I can see that some values are0. This even seems more likely than CBs.@andrew101sanders commented on GitHub (Aug 17, 2024):
Ahh, I wish I had seen this issue before trying to track down the issue in renderdoc too, ha.
Just contributing the discussion that was had in the discord a few weeks back regarding it:

[7:26 PM]IndecisiveTurtle:
v_mac_f32 v2, s8, v8
[7:26 PM]IndecisiveTurtle: s8 doesn't appear to be set anywhere in shader so its a user data reg
[7:26 PM]IndecisiveTurtle: user data regs atm are hardcoded as compilation constants in the shader
[7:26 PM]IndecisiveTurtle: So if the game uses a UD value as a dynamic adjustment for slider it wont work and it will stay stuck
[7:27 PM]IndecisiveTurtle: UD regs need to be made into push constants
@raphaelthegreat commented on GitHub (Aug 17, 2024):
This turned out to be incorrect, I missed the place where s8 was being written in the shader
@roamic commented on GitHub (Aug 19, 2024):
fixed with #464