[virglrenderer-devel] [PATCH] renderer: Call glDepthRange if we move from default value

Elie Tournier tournier.elie at gmail.com
Tue Jun 5 09:50:53 UTC 2018


On Mon, Jun 04, 2018 at 09:44:53AM -0700, Gurchetan Singh wrote:
> On Fri, Jun 1, 2018 at 7:54 AM Elie Tournier <tournier.elie at gmail.com> wrote:
> >
> > Virglrender holds the values in a structure vrend_sub_context that is zeroed
> > out when it is initialized.
> > So, when the first state change set the near_val and far_val to zero,
> > the check assumes it is the old state and doesn't call glDepthRange.
> >
> > Fixes: dEQP-GLES2.functional.depth_range.write.zero_to_zero
> >
> > Suggested-by: Gert Wollny <gert.wollny at collabora.com>
> > Signed-off-by: Elie Tournier <elie.tournier at collabora.com>
> > ---
> >  src/vrend_renderer.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
> > index df575b1..ef4e483 100644
> > --- a/src/vrend_renderer.c
> > +++ b/src/vrend_renderer.c
> > @@ -1735,7 +1735,8 @@ void vrend_set_viewport_states(struct vrend_context *ctx,
> >        }
> >
> >        if (ctx->sub->vps[idx].near_val != near_val ||
> > -          ctx->sub->vps[idx].far_val != far_val) {
> > +          ctx->sub->vps[idx].far_val != far_val ||
> > +          ctx->sub->vps[idx].far_val != 1.0) {
> 
> Isn't the purpose of this to avoid extraneous state changes?  What if
> we set the far_val to .5, and keep it that way?  We'll have a
> glDepthRange call every time.

My bad.
> 
> Can't vrend_renderer_create_sub_ctx just set far_val to 1.0
> PIPE_MAX_VIEWPORTS times?

Yep, it's a way better idea.
I will send a new patch later today.
> 
> >           ctx->sub->vps[idx].near_val = near_val;
> >           ctx->sub->vps[idx].far_val = far_val;
> >
> > --
> > 2.17.1
> >
> > _______________________________________________
> > virglrenderer-devel mailing list
> > virglrenderer-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel


More information about the virglrenderer-devel mailing list