[vlc-devel] [PATCH] opengl: converter_sw: reset UNPACK_ROW_LENGTH after usage

Alexandre Janniaux ajanni at videolabs.io
Thu Dec 5 17:53:35 CET 2019


Hi,

I don't know whether it fixes #22267 as I cannot reproduce,
and it seemed to me that the reporter was using d3d11 instead
of OpenGL. But it's likely the same kind of bug yes, and
should fix similar issue that happened too. I heared that the
issue happened with some DVD SPU in particular.

Regards,
--
Alexandre Janniaux
Videolabs

On Thu, Dec 05, 2019 at 05:17:30PM +0100, Thomas Guillem wrote:
> LGTM,
>
> Thanks for  this patch !
>
> I really think it will fix #22267
>
> On Wed, Dec 4, 2019, at 18:09, Alexandre Janniaux wrote:
> > From: Louis Segretin <lsegretin.contrib at gmail.com>
> >
> > 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.
> > ---
> >  modules/video_output/opengl/converter_sw.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/modules/video_output/opengl/converter_sw.c
> > b/modules/video_output/opengl/converter_sw.c
> > index b5746a637b..3eb3eeb3ae 100644
> > --- a/modules/video_output/opengl/converter_sw.c
> > +++ b/modules/video_output/opengl/converter_sw.c
> > @@ -190,6 +190,8 @@ tc_pbo_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);
> >      }
> >
> >      /* turn off pbo */
> > @@ -267,6 +269,7 @@ upload_plane(const opengl_tex_converter_t *tc,
> > unsigned tex_idx,
> >          tc->vt->PixelStorei(GL_UNPACK_ROW_LENGTH, pitch * width /
> > (visible_pitch ? visible_pitch : 1));
> >          tc->vt->TexSubImage2D(tc->tex_target, 0, 0, 0, width, height,
> >                                tex_format, tex_type, pixels);
> > +        tc->vt->PixelStorei(GL_UNPACK_ROW_LENGTH, 0);
> >      }
> >      return VLC_SUCCESS;
> >  }
> > --
> > 2.24.0
> >
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list