opengles2: SDL_GL_BindTexture() should bind all YUV textures.

This matches what the non-GLES OpenGL renderer does.

Fixes #6070.
This commit is contained in:
Ryan C. Gordon 2022-10-03 11:57:10 -04:00
parent f8f562dace
commit 01c5554f0e
No known key found for this signature in database
GPG key ID: FA148B892AB48044

View file

@ -2024,6 +2024,23 @@ static int GLES2_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, flo
GLES2_TextureData *texturedata = (GLES2_TextureData *)texture->driverdata;
GLES2_ActivateRenderer(renderer);
#if SDL_HAVE_YUV
if (texturedata->yuv) {
data->glActiveTexture(GL_TEXTURE2);
data->glBindTexture(texturedata->texture_type, texturedata->texture_v);
data->glActiveTexture(GL_TEXTURE1);
data->glBindTexture(texturedata->texture_type, texturedata->texture_u);
data->glActiveTexture(GL_TEXTURE0);
} else if (texturedata->nv12) {
data->glActiveTexture(GL_TEXTURE1);
data->glBindTexture(texturedata->texture_type, texturedata->texture_u);
data->glActiveTexture(GL_TEXTURE0);
}
#endif
data->glBindTexture(texturedata->texture_type, texturedata->texture);
data->drawstate.texture = texture;