-
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
Investigate alternative ways to do depal, to fix performance in Sonic Rivals and MGS: Acid 2 #10908
Comments
Implemented shader depal for Vulkan in #10911 , Unknown later implemented it for OpenGL. Leaving open since it's not implemented for all backends, but bumping to 1.8 (at least). |
But how about OpenGL label? |
The faster depal implementation is done for OpenGL. It's however not fully utilized yet to fix the perf in these games (by reordering render passes) so yeah, I suppose it should be added. |
Did Rock Band Unplugged use Depal? |
Kurohyo 2 expensive effects belongs here? since is related to depal #8390 (comment). |
This is implemented in all backends that can reasonably implement it. Closing. |
When games use palettized (CLUT, color look up table) texturing when texturing from a framebuffer, we currently "depalettize" (index) it into a full color texture, and then texture using that. This has the great advantage that texture filtering works as normal, but is quite expensive since we do this in a pixel shader and thus need to start up a render pass, which is not cheap on mobile.
An alternative would be to "depalettize" directly in the shader when reading these textures, but to do that we need to handle filtering ourselves since that needs to happen after the depalettization. So the pixel shader gets heavier but we lose the extra render pass. An additional alternative may be to use a compute shader to do the work, in order to avoid starting up a render pass, but I don't think it's that much cheaper and has obvious compatibility issues with older devices.
Now, the issue is that a few games, like Sonic Rivals, Metal Gear Solid Acid 2 and, IIRC, Test Drive Unlimited, use the depal functionality with color ramps as palettes to perform various forms of color correction. They do this in little tiles across the screen, resulting in many tens or hundreds of render passes per frame. The cost of the above-mentioned alternative with in-shader manual filtering would be much smaller, so might be worth implementing to get acceptable performance out of these games on mobile.
The text was updated successfully, but these errors were encountered: