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

rsx: Improved 24-bit format handling and shader refactoring #15065

Merged
merged 5 commits into from Jan 21, 2024

Conversation

kd-11
Copy link
Contributor

@kd-11 kd-11 commented Jan 19, 2024

Changes

  1. Do not write to host channels that are disabled. This largely applies to RGBX formats where on PS3 the alpha channel is disabled. On PC we were writing to this non-existent channel which is wrong.
  2. Refactor shader ROP stuff in preparation for programmable blending down the line. The full implementation will come in a later PR.
  3. Correctly perform float->fixed conversion for 8-bit formats. During the vanillaware investigation it became clear that PS3 wraps negatives before clamping.

@Megamouse Megamouse added RSX Refactoring Refactors or simplifies existing code labels Jan 19, 2024
@JimScript
Copy link

Hey the hollowed out part of issue #10754 has been fixed by this:
BCUS98127_screenshot_2024_01_19_16_26_35
It still overdraws both opaque and translucent parts like hundreds of times each, and there's still only one plant(several in some R:FOM maps) visible at a time, but this is still progress.

@JimScript
Copy link

JimScript commented Jan 20, 2024

Also this almost fixes my new #15063 issue, but on Windows it now displays only one plant at a time like TOD does on every platform.
Before:
BCUS98124_screenshot_2024_01_18_21_03_30
After:
Highlighted_ACIT_Plant
Edit: Wait I just noticed the stray pixels in the first image, so I guess #10754 and #15063 are related, but why does only ACIT work differently on Linux/Steam Deck? But since this fixes what was distictly broken I can close #15063 with this PR.

@JimScript
Copy link

Well I might as well show how this PR fixes ACIT on Steam Deck too.
Before:
screenshot_2024_01_18_21_38_11
After:
screenshot_2024_01_19_21_34_29

- Some formats may have dummy channels on host. Never write to them!
- This means that XRGB formats correctly only write 24 bits, not 32.
@kd-11
Copy link
Contributor Author

kd-11 commented Jan 21, 2024

Hey the hollowed out part of issue #10754 has been fixed by this: BCUS98127_screenshot_2024_01_19_16_26_35 It still overdraws both opaque and translucent parts like hundreds of times each, and there's still only one plant(several in some R:FOM maps) visible at a time, but this is still progress.

I think I know what this issue is. I'll revisit some time in the near future.

@JimScript
Copy link

JimScript commented Jan 21, 2024

This PR is making every game with Shader Quality on "Low" crash on startup with it stating:
F {RSX Worker 5} SIG: Thread terminated due to fatal error: Failed to compile fragment shader (in file D:\a\1\s\rpcs3\Emu\RSX\VK\VKProgramPipeline.cpp:29[:25], in function compile)
Although it's :29[:5] on Linux.

#ifdef _32_BIT_OUTPUT
// Default. Used when we're not utilizing native fp16
#define round_to_8bit(v4) (floor(fma(v4, vec4(255.), vec4(0.5))) / vec4(255.))
// Everything is fp32 on ouput channels
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Everything is fp32 on ouput channels
// Everything is fp32 on output channels

@kd-11 kd-11 merged commit 8eae8cb into RPCS3:master Jan 21, 2024
6 checks passed
@mwsimmonite
Copy link

Hi - I’ve just finished Resistance 2 (another Insomniac game) on the steam deck and had the exact same issue with a lot of the grass there being bright green and luminescent (lots of it in the prologue level).

By eye, it looks like it could be the same asset. I tried various settings that were suggested for other Insomniac games in case that may do something but didn’t have any luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactoring Refactors or simplifies existing code RSX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants