[Mesa-dev] [PATCH] egl: reset 'ViewportInitialized' when unbinding current context

Emil Velikov emil.l.velikov at gmail.com
Tue Aug 23 11:23:47 UTC 2016


On 15 August 2016 at 23:58, Dongwon Kim <dongwon.kim at intel.com> wrote:
> 'ViewportInitialized' flag in gl_context has to be reset to '0'
> when the current context is unbound via a eglMakeCurrent call with
> all of 'NULL' resources (surfaces and context).
>
> This is to make sure the viewport of the context is re-initialized
> when the same context is bound to new read and draw surfaces
> (or same surfaces but with different size.) next time when the
> context is made current again.
>
The spec is pretty clear about this:

"The first time a OpenGL or OpenGL ES context is made current the
viewport and scissor dimensions are set to the size of the draw
surface (as though glViewport(0, 0, w, h) and glScissor(0, 0, w, h)
were called, where w and h are the width and height of the surface,
respectively). However, the viewport and scissor dimensions are not
modified when ctx is subsequently made current."

So unless coffee hasn't kicked this patch is wrong.
Emil


More information about the mesa-dev mailing list