Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Task] rsx: Programmable blending #15061

Open
kd-11 opened this issue Jan 19, 2024 · 3 comments
Open

[Task] rsx: Programmable blending #15061

kd-11 opened this issue Jan 19, 2024 · 3 comments
Assignees

Comments

@kd-11
Copy link
Contributor

kd-11 commented Jan 19, 2024

Some Vanillaware titles use subtraction blending with underflow on integer framebuffers. On PC, the values get clamped to zero, but it would appear that on PS3 the conversion is unsigned. This means that subtract output less than 0 wraps around to 1.
Obviously this behavior cannot be emulated with fixed-function blending but programmable blending has questionable support on PC especially on AMD windows (linux is ok).
Another reason for this is that PS3 supports 2 blending sign modes. Normal blending takes the absolute values of source and dest while signed blending preserves the sign on the source.
So far we've been able to ignore this but it causes some annoying bugs especially in 2D games where minor errors are very obvious.

@kd-11
Copy link
Contributor Author

kd-11 commented Jan 21, 2024

Logical portions have been implemented in #15065
The only thing that remains is deciding where to source the data from. There are no good options here, but replacing MRT writes with image-store could work around the nasty issue of framebuffer loops.

@kd-11
Copy link
Contributor Author

kd-11 commented Jan 30, 2024

Ftr, I already implemented this locally and it works fine, bar some distracting flicker that requires fragment-shader-interlock to fix.
We also need to emulate several "signed" blend modes that aren't supported on PC, such as "signed" variants that do not clamp the input to [0..1]
These are some of the hardware tests that need to be validated on PS3 first:

  • ARGB fbo with blend reverse-subtract underflow (it seems RGB components clamp, but not A?)
  • ARGB fbo with blend reverse-subract-signed underflow
  • ARGB fbo with blend subtract underflow
  • ARGB fbo with blend subtract signed underflow
  • General tests for the other "signed" blend modes.

@kd-11
Copy link
Contributor Author

kd-11 commented Jun 27, 2024

Need to verify INT8 clamp/wrap behavior on real PS3 when blending with subtraction modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant