Fix: Targa with Palette Shows Grayscale in Viewport. #106047
|
@ -679,7 +679,7 @@ ImBuf *imb_loadtarga(const uchar *mem, size_t mem_size, int flags, char colorspa
|
|||
/* Set the planes based on the number of planes of the palette. Planes are
|
||||
|
||||
* used to optimize the storage on the GPU. When planes are not set correctly the image can
|
||||
* draw as if it was a grayscale image. */
|
||||
ibuf->planes = (tga.mapbits >> 3) * 8;
|
||||
ibuf->planes = tga.mapbits;
|
||||
|
||||
if (tga.mapbits != 32) { /* Set alpha bits. */
|
||||
cmap[0] &= BIG_LONG(0x00ffffffl);
|
||||
|
|
Loading…
Reference in New Issue
Not sure the comment is that useful. It is not the only place where the assignment to the planes happens, and the GPU sides optimizations might change in the future.
To me the
ibuf->places = tga.mapbits
seems clear by itself.