rsx: Fix support for gamma pack/unpack instructions #10406
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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):