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: Fix support for gamma pack/unpack instructions #10406

Merged
merged 2 commits into from Jun 5, 2021

Conversation

kd-11
Copy link
Contributor

@kd-11 kd-11 commented Jun 5, 2021

PS3 gamma pack/unpack (PKG/UPG) are based on some obsolete nvidia-only instructions that were dropped from the published spec of NV_fragment_program. There are still references to them in some early Cg and CineFX manuals.
These instructions allow cheap and easy sRGB<->linear conversion which seems to be a trick some games are using.
e.g packGamma(value) ... unpackNoGamma(value2) will convert a value from sRGB to linear color space.
Fixes #7357

Additionally adds a debug view for OGL. This was crucial in debugging said problem because renderdoc has issues with some OpenGL commands. This is WIP, and will be migrated to use the overlay system when the debug text is being rewritten. It is only accessible programmatically for now until a proper debugging overlay is finished.
For those curious, here's what it looks like (linear depth buffer drawn at the bottom right):
image

PK4UBG and UP4UBG were dropped from the NV_fragment_program spec in 2002.
Not much information about them remains but seems pretty straightforward.
@kd-11 kd-11 marked this pull request as draft June 5, 2021 14:27
@kd-11 kd-11 marked this pull request as ready for review June 5, 2021 16:03
@kd-11 kd-11 merged commit 6ac9e6f into RPCS3:master Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shoot Many Robots (Demo) [NPUB30600] graphic glitches on Vulkan and Opengl
1 participant