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???
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???