Hi Phil,

On Phil <[email protected]> wrote:

> I have compiled Clutter 1.2.5 with the eglnative/gles backend. The colour
> channels of textures seem to be switched when the format is not RGBA.

This is my fault. Before Clutter 1.2 we would always convert the texture
using the Cogl bitmap code when a Cogl texture is created with a
different internal format from the image format. However for 1.2 I
changed it so that it would just pass the image format and the internal
format directly to GL so that the GL driver could do the conversion. The
assumption is that the GL driver is likely to be faster (or at least our
code isn't at all optimized so it can't be any slower) and support more
formats. I didn't realize that GLES doesn't support the format
conversions when uploading data so of course it broke for that backend.

I've attached a couple of patches to the bug report¹ which should
hopefully fix the problem.

> Furthermore, can anybody tell me where the convertion should be
> triggered ideally? As far as I have seen, the
> _cogl_texture_prepare_for_upload () seems to be the right place. There
> also, the GL pixel format conversion is invoked, which in turn is
> performed by the gles specific function. However, I am wondering why
> no conversion is triggered there when the CoglPixelFormat does not
> match the GL internal format (since the OpenGL ES does not provide the
> necessary conversion)?

Yes, that looks like the right place and it is indeed where I've put the
conversion in the patches.

Thanks for the report

- Neil

¹ http://bugzilla.openedhand.com/show_bug.cgi?id=2059
--
To unsubscribe send a mail to [email protected]

Reply via email to