- if ((clut == &default_clut && ctx->compute_clut == -1) || ctx->compute_clut == 1)
- compute_default_clut(rect, rect->w, rect->h);
+ if ((clut == &default_clut && ctx->compute_clut == -1) || ctx->compute_clut == 1) {
+ if (!region->has_computed_clut) {
+ compute_default_clut(region->computed_clut, rect, rect->w, rect->h);
+ region->has_computed_clut = 1;
+ }
+
+ memcpy(rect->data[1], region->computed_clut, sizeof(region->computed_clut));
+ }