Skip to content

GS/Qt: Add librashader post-processing support#14433

Draft
SternXD wants to merge 14 commits into
PCSX2:masterfrom
SternXD:slangshaders
Draft

GS/Qt: Add librashader post-processing support#14433
SternXD wants to merge 14 commits into
PCSX2:masterfrom
SternXD:slangshaders

Conversation

@SternXD

@SternXD SternXD commented May 11, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

  • Moved Post-Processing settings out of the Graphics page into its own settings page (Settings > Post-Processing)
  • Added optional librashader support for applying .slangp shader presets as post-processing, including a preset picker and runtime parameter controls.

All in-game screenshots below are using the NewPixie CRT slang shader preset.

Settings page Post-Processing settings page
BIOS Librashader preset running in BIOS
NFS MW 2005 Librashader preset running in NFS MW 2005
Kingdom Hearts Librashader preset running in Kingdom Hearts

Rationale behind Changes

  • I think Post-Processing outgrew its spot on the Graphics page and deserved its own page alongside the other settings categories.
  • librashader lets users run RetroArch shader presets (CRT, scanlines, color correction, etc.) on the final image. Kept optional so builds without Rust/cargo aren't affected.

Suggested Testing Steps

  • Open Settings > Post-Processing, enable librashader, pick a .slangp preset.
  • Test on all renderers
  • And make sure the image changes, parameters work, and settings persist after reopening.

Did you use AI to help find, test, or implement this issue or feature?

No.

@SternXD

SternXD commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

rebased and hopefully fixed librashader not working on CMake builds

@Wolf-lbh

Wolf-lbh commented May 18, 2026

Copy link
Copy Markdown

This is fantastic! Is there any chance you would be interested in adding this functionality to Dolphin or PPSSPP? Those are the last of the CRT era systems that have better standalone emulators than RetroArch cores and it would mean the world to me if they had proper shader support. If you didn't try the component video out dock for the PSP you were really missing out.

@chyyran

chyyran commented May 20, 2026

Copy link
Copy Markdown

Would you be open to upstreaming your patch to spirv-cross2 or allowing me to use your patch, if it is fixing a real bug? spirv-cross2 is not just meant for librashader, there are a couple of other projects that use it as well as ergonomic bindings to SPIRV-Cross in the Rust ecosystem.

@TheLastRar

Copy link
Copy Markdown
Contributor

Would you be open to upstreaming your patch to spirv-cross2 or allowing me to use your patch, if it is fixing a real bug? spirv-cross2 is not just meant for librashader, there are a couple of other projects that use it as well as ergonomic bindings to SPIRV-Cross in the Rust ecosystem.

I can look at upstreaming it.
The patch fixes long startup time when the VS debugger is attached.
I believe the debugger inspects exceptions to see if it should break, and with the upstream code, a large amount of (caught) exceptions are raised when reflecting larger shaders.
I'm unsure if other debuggers are impacted.

@SternXD SternXD marked this pull request as ready for review June 27, 2026 15:52
@SternXD SternXD marked this pull request as draft June 27, 2026 16:08
@SternXD

SternXD commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

D3D11 crashing on some shaders pending new librashader release fixed

@Mrlinkwii Mrlinkwii modified the milestones: Release 2.10, Release 2.8 Jun 28, 2026
SternXD added 2 commits July 1, 2026 07:47
Signed-off-by: SternXD <stern@sidestore.io>
Signed-off-by: SternXD <stern@sidestore.io>
SternXD and others added 12 commits July 2, 2026 00:06
Signed-off-by: SternXD <stern@sidestore.io>
Co-authored-by: TheLastRar <TheLastRar@users.noreply.github.com>
Signed-off-by: SternXD <stern@sidestore.io>
Signed-off-by: SternXD <stern@sidestore.io>
Signed-off-by: SternXD <stern@sidestore.io>
Signed-off-by: SternXD <stern@sidestore.io>
Signed-off-by: SternXD <stern@sidestore.io>
Signed-off-by: SternXD <stern@sidestore.io>
Clear instead of invalidating to avoid undefined alpha being sampled by post-processing shaders.

Signed-off-by: SternXD <stern@sidestore.io>
Co-authored-by: chyyran <ronny@ronnychan.ca>
Signed-off-by: SternXD <stern@sidestore.io>
@SternXD SternXD marked this pull request as ready for review July 2, 2026 11:15
@chaoticgd

Copy link
Copy Markdown
Member

Reading through the librashader readme, they recommend using librashader_ld.h to load the library at runtime rather than creating a build time dependency on it. I think this would be quite nice since it is quite big, so this way we'd only need to load it if it's actually enabled. Would that be possible?

@SternXD

SternXD commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Reading through the librashader readme, they recommend using librashader_ld.h to load the library at runtime rather than creating a build time dependency on it. I think this would be quite nice since it is quite big, so this way we'd only need to load it if it's actually enabled. Would that be possible?

Probably. It's not something I really considered at first. If we went that route though, I don't think I'd be able to get it into the 2.8 cycle.

@chaoticgd

Copy link
Copy Markdown
Member

Probably. It's not something I really considered at first. If we went that route though, I don't think I'd be able to get it into the 2.8 cycle.

Okay, so maybe that's an idea for a separate PR then.

@Mrlinkwii Mrlinkwii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

runs well

@TellowKrinkle

Copy link
Copy Markdown
Member

Probably. It's not something I really considered at first. If we went that route though, I don't think I'd be able to get it into the 2.8 cycle.

Personally I'm not a huge fan of the size of the librashader dependency in general and am trying to make it so we don't need it.

@SternXD SternXD marked this pull request as draft July 4, 2026 19:47
@Mrlinkwii Mrlinkwii modified the milestones: Release 2.8, Release 2.10 Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.