[SDL2] Bug in NV12/NV21 shaders in OpenGLES2


#1

Hi everyone,

it looks like the NV12/NV21 shaders are broken in OpenGLES2 renderer.
This fixes the problem for me:

Index: SDL_shaders_gles2.c

— SDL_shaders_gles2.c (revision 9799)
+++ SDL_shaders_gles2.c (revision 9800)
@@ -197,7 +197,7 @@
“\n”
" // Get the YUV values \n"
" yuv.x = texture2D(u_texture, v_texCoord).r;\n"
-" yuv.yz = texture2D(u_texture_u, v_texCoord).ra;\n"
+" yuv.yz = texture2D(u_texture_u, v_texCoord).ar;\n"
“\n”
" // Do the color transform \n"
" yuv += offset;\n"
@@ -217,7 +217,7 @@
“\n”
" // Get the YUV values \n"
" yuv.x = texture2D(u_texture, v_texCoord).r;\n"
-" yuv.yz = texture2D(u_texture_u, v_texCoord).ar;\n"
+" yuv.yz = texture2D(u_texture_u, v_texCoord).ra;\n"
“\n”
" // Do the color transform \n"
" yuv += offset;\n" \


#2

I put this in Bugzilla so we don’t lose it:

https://bugzilla.libsdl.org/show_bug.cgi?id=4431