[PATCH] SDL-1.3 GL_YCBCR_MESA shall be both format and internal format for glTexImage2D

Currently SDL uses GL_RGB for internalFormat when GL_YCBCR_MESA is passed as format for glTextImage2D when using Linux Mesa’s OpenGL. However this is wrong and makes glTextImage2D fail with invalid argument error. GL_YCBCR_MESA should be also internalFormat (not GL_RGB) there and this is what can be found googling various source codes using GL_YCBCR_MESA.

Attached patch fixes the issue.

Aside of that I found that SDL’s YUV->RGB fragment shader is bit faster than GL_YCBCR_MESA (implemented in software?), I wonder if there’s any way to force using shader from SDL application instead of GL_YCBCR_MESA any other than disabling it in SDL source code???

Regards,–
Adam Strzelecki

-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL-SVN-GL_YCBCR_MESA-has-to-be-internal-format-too.patch
Type: application/octet-stream
Size: 913 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20091125/a3b65d55/attachment.obj

Thanks! Your patch is in subversion.

You can disable any extension by setting an environment variable with
that extension with the value 0, e.g. GL_MESA_ycbcr_texture=0

Keep in mind that the shader doesn’t handle blending or source
resampling at the moment.On Wed, Nov 25, 2009 at 7:41 AM, Adam Strzelecki wrote:

Currently SDL uses GL_RGB for internalFormat when GL_YCBCR_MESA is passed as format for glTextImage2D when using Linux Mesa’s OpenGL. However this is wrong and makes glTextImage2D fail with invalid argument error. GL_YCBCR_MESA should be also internalFormat (not GL_RGB) there and this is what can be found googling various source codes using GL_YCBCR_MESA.

Attached patch fixes the issue.

Aside of that I found that SDL’s YUV->RGB fragment shader is bit faster than GL_YCBCR_MESA (implemented in software?), I wonder if there’s any way to force using shader from SDL application instead of GL_YCBCR_MESA any other than disabling it in SDL source code???

Regards,

Adam Strzelecki


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC