2 ms·
The lookup can be done in a trivial shader that runs on the GPU 10-100x faster than a C implementation on the CPU instead as a JS function that runs 10x slower
by corysama 10y ago
The lookup can be done in a trivial shader that runs on the GPU 10-100x faster than a C implementation on the CPU instead as a JS function that runs 10x slower than a C implementation.
Additionally, instead of uploading the complete, 24bit-per-pixel, post-indexed image across the PCI bus every frame; you only need to send the updated pallete. The CPU work approaches zero at that point.