Repository navigation
Reinterpret framebuffer formats as needed. Outrun reflections partial fix - #13636
Merged
Merged
Conversation
hrydgard
force-pushed
the
reinterpret-framebuffer-formats
branch
from
November 7, 2020 23:12
5dd67fd to
18d4bfa
Compare
aliaspider
reviewed
Nov 8, 2020
aliaspider
reviewed
Nov 8, 2020
| }; | ||
|
|
||
| // TODO: We could have an option to preserve any extra color precision. But gonna start without it. | ||
| // Requires full size integer math. |
Contributor
There was a problem hiding this comment.
you could double the widths of the channels (10-12-10 instead of 5-6-5 etc.), although not sure if it is worth it ...
Edit: nvm, it wouldn't work out xD
Owner
Author
There was a problem hiding this comment.
Yeah let's think more about this. I feel that it should be possible somehow but...
More work on reinterpret Buildsystem fixes
hrydgard
force-pushed
the
reinterpret-framebuffer-formats
branch
from
November 8, 2020 09:52
18d4bfa to
2cb78e5
Compare
Buildfix
…it format. Car reflections in Outrun are better (see #11358) but have some blue/yellow color garbage that will need a different fix.
…t can't support it yet
hrydgard
force-pushed
the
reinterpret-framebuffer-formats
branch
from
November 8, 2020 10:33
2cb78e5 to
d81522a
Compare
| std::vector<D3D11ShaderModule *> shaders; | ||
| D3D11ShaderModule *vshader = nullptr; | ||
| for (auto iter : desc.shaders) { | ||
| iter->AddRef(); |
Collaborator
There was a problem hiding this comment.
Hmm, seems like we'd need a Release() for this in the destructor of the pipeline?
-[Unknown]
Owner
Author
There was a problem hiding this comment.
That is right! Thanks for the catch!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PSP games sometimes render to a framebuffer in one format, then keeps rendering using another format. For example, like Outrun, you can render to the alpha channel of an RGBA4444 texture by switching it to RGB565, rendering to the B channel with a 11110 mask, and then switching back. We don't internally store textures in these low bit depths, we always use 8888 for a variety of reasons, so when switching formats, this shader converts the color to the corresponding old 16-bit format, and converts back to 8888 from that using the new 16-bit format. This can be a minor speed it but should indeed be minor.
First step towards fixing car reflections in Outrun: Coast to Coast. See #11358 .
This also deletes the recent mistakenly added early version of this, ColorReinterpret.cpp/h.
This makes use of a lot of the infrastructure I've added or refactored recently... the new ShaderWriter etc.
I'm a little afraid of performance regressions so I'll enable this for all games later, so far restricting it to Outrun.
NOTE! Doesn't fully fix it, there's still some blue/yellow color distortion in the reflections. That will be fixed separately later - the color bitmasking part has still not been implemented so the write to alpha also stomps the top bit of the blue channel. See my comment in #11358 about that. Here's how it looks now (from a good angle):
It's at least better than before: