-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Reinterpret framebuffer formats as needed. Outrun reflections partial fix #13636
Conversation
5dd67fd
to
18d4bfa
Compare
}; | ||
|
||
// TODO: We could have an option to preserve any extra color precision. But gonna start without it. | ||
// Requires full size integer math. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah let's think more about this. I feel that it should be possible somehow but...
More work on reinterpret Buildsystem fixes
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
2cb78e5
to
d81522a
Compare
@@ -983,6 +989,8 @@ Pipeline *D3D11DrawContext::CreateGraphicsPipeline(const PipelineDesc &desc) { | |||
std::vector<D3D11ShaderModule *> shaders; | |||
D3D11ShaderModule *vshader = nullptr; | |||
for (auto iter : desc.shaders) { | |||
iter->AddRef(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, seems like we'd need a Release() for this in the destructor of the pipeline?
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is right! Thanks for the catch!
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: