yuq / mesa-lima

Deprecated, new place: https://gitlab.freedesktop.org/lima
https://github.com/yuq/mesa-lima/wiki
165 stars 18 forks source link

Blue/Red channels of texture are swapped #32

Closed anarsoul closed 6 years ago

anarsoul commented 6 years ago

With the FBO test app, seems texture support has some problem Blue/Red channel swap: test app render buffer is PIPE_FORMAT_B8G8R8A8_UNORM, while texture is PIPE_FORMAT_R8G8B8A8_UNORM, the final result is B/R channel swap

anarsoul commented 6 years ago

@yuq I don't understand how lima chooses render buffer formats, looks like it always uses RGBA8888 regardless of what app is specified, see: https://github.com/yuq/mesa-lima/blob/lima-17.3/src/gallium/drivers/lima/lima_draw.c#L1003

So far it doesn't look like a bug in texturing code, but I can fix it.

yuq commented 6 years ago

Oh right, so this get the first draw of FBO test wrong format. You may get the render buffer format from ctx->framebuffer->cbuf.