From 238212660376399ed7c0e0964763a169c7670700 Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Sun, 3 Mar 2019 18:56:18 +0000 Subject: [PATCH] Make palette binding lazy --- GL/texture.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/GL/texture.c b/GL/texture.c index f2d6f8b..2b2b974 100644 --- a/GL/texture.c +++ b/GL/texture.c @@ -32,6 +32,8 @@ void _glApplyColorTable() { * - Store the active palette, don't resubmit eah time */ + static TexturePalette* last_bound = NULL; + TexturePalette* src = NULL; if(_glIsSharedTexturePaletteEnabled()) { @@ -50,6 +52,13 @@ void _glApplyColorTable() { src = active->palette; } + /* Don't reapply the palette if it was the last one we applied */ + if(src == last_bound) { + return; + } + + last_bound = src; + pvr_set_pal_format(PVR_PAL_ARGB8888); GLushort i = 0;