[Mesa-dev] [PATCH] Only change and restore viewport 0 in mesa meta mode

Mike Stroyan mike at lunarg.com
Fri Jun 26 14:43:07 PDT 2015


There isn't any bugzilla entry for this yet.  I just saw it in the source
code so far rather than in a misbehaving program.
Perhaps piglit could use a few tests for whether meta operations damage
context attributes.

On Fri, Jun 26, 2015 at 3:26 PM, Kenneth Graunke <kenneth at whitecape.org>
wrote:

> On Friday, June 26, 2015 03:15:46 PM Mike Stroyan wrote:
> > The meta code was setting a default depth range for all viewports
> > and 'restoring' all viewports to depth range values saved from viewport
> 0.
> > ---
> >  src/mesa/drivers/common/meta.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/mesa/drivers/common/meta.c
> b/src/mesa/drivers/common/meta.c
> > index 214a68a..9a75019 100644
> > --- a/src/mesa/drivers/common/meta.c
> > +++ b/src/mesa/drivers/common/meta.c
> > @@ -728,7 +728,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield
> state)
> >        save->DepthNear = ctx->ViewportArray[0].Near;
> >        save->DepthFar = ctx->ViewportArray[0].Far;
> >        /* set depth range to default */
> > -      _mesa_DepthRange(0.0, 1.0);
> > +      _mesa_set_depth_range(ctx, 0, 0.0, 1.0);
> >     }
> >
> >     if (state & MESA_META_CLAMP_FRAGMENT_COLOR) {
> > @@ -1129,7 +1129,7 @@ _mesa_meta_end(struct gl_context *ctx)
> >           _mesa_set_viewport(ctx, 0, save->ViewportX, save->ViewportY,
> >                              save->ViewportW, save->ViewportH);
> >        }
> > -      _mesa_DepthRange(save->DepthNear, save->DepthFar);
> > +      _mesa_set_depth_range(ctx, 0, save->DepthNear, save->DepthFar);
> >     }
> >
> >     if (state & MESA_META_CLAMP_FRAGMENT_COLOR &&
> >
>
> Good catch - this code predates GL_ARB_viewport_array, and really ought
> to only change viewport 0.  Thanks, Mike!
>
> Cc: "10.6 10.5" <mesa-stable at lists.freedesktop.org>
> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
>
> Is there a bugzilla entry related to this patch?
>
> I'll plan to push this tonight/tomorrow unless someone else objects.
>



-- 

 Mike Stroyan - Software Architect
 LunarG, Inc.  - The Graphics Experts
 Cell:  (970) 219-7905
 Email: Mike at LunarG.com
 Website: http://www.lunarg.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150626/d25dbba4/attachment-0001.html>


More information about the mesa-dev mailing list