DragonMinded / libdragon

Open source library for N64 development.
https://libdragon.dev
The Unlicense
746 stars 109 forks source link

rdpq_tex_upload_tlut forces num_colors to be multiples of 8 - which is not required by hw. #621

Closed nopjne closed 1 month ago

nopjne commented 1 month ago

When patching single colors in the palette (for instance for transparency) the current API requires the surrounding palette colors to be captured and held allocated until the end of the frame. This means there need to be as many active copies of the patches with other colors copied in as there are blits. This also leads to a combinatorial explosion, if pal entry 0 needs to be patched but colors around pal[0] change every change needs to have an active copy until the frame is done.

It woudl be good to scope the TLUT operation to just 1 color that needs to be update.