vlc/vlc-3.0 | branch: master | Louis Segretin <[email protected]> | 
Wed Dec  4 18:09:45 2019 +0100| [b9f0feba4f281e3b010ff513791f3aab0e53069c] | 
committer: Thomas Guillem

opengl: converter_sw: reset UNPACK_ROW_LENGTH after usage

Some drivers seem to use this value for glTexSubImage2D even with
GL_PIXEL_UNPACK_BUFFER set to 0. As the rest of the code is not
UNPACK_ROW_LENGTH aware, it is safer to reset it to a non-active value.

For example, this would cause glitches if pictures were uploaded with
this extension but SPU were not, or more generally if another client of
the OpenGL context is updating some textures by itself outside of the
OpenGL renderer.

Looks really close to an OpenGL version of #22267.

Signed-off-by: Thomas Guillem <[email protected]>
(cherry picked from commit 045f3ef28f86be7eed530f7079ad5ed182da9144)
Signed-off-by: Thomas Guillem <[email protected]>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=b9f0feba4f281e3b010ff513791f3aab0e53069c
---

 modules/video_output/opengl/converter_sw.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/video_output/opengl/converter_sw.c 
b/modules/video_output/opengl/converter_sw.c
index 5d91be7c84..d6acc1f070 100644
--- a/modules/video_output/opengl/converter_sw.c
+++ b/modules/video_output/opengl/converter_sw.c
@@ -343,6 +343,8 @@ tc_persistent_update(const opengl_tex_converter_t *tc, 
GLuint *textures,
 
         tc->vt->TexSubImage2D(tc->tex_target, 0, 0, 0, tex_width[i], 
tex_height[i],
                               tc->texs[i].format, tc->texs[i].type, NULL);
+
+        tc->vt->PixelStorei(GL_UNPACK_ROW_LENGTH, 0);
     }
 
     bool hold;

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to