[Mesa-dev] [RFC PATCH] virgl: Always assume that ORIGIN_UPPER_LEFT and PIXEL_CENTER* are supported

Gert Wollny gert.wollny at collabora.com
Fri May 25 06:51:25 UTC 2018


Am Dienstag, den 22.05.2018, 18:27 -0700 schrieb Gurchetan Singh:
> Reviewed-by: Gurchetan Singh <gurchetansingh at chromium.org>

Thanks for the review Gurchetan. 
The patch was originally sent as RFC, because there seemed to be
regressions, but that is not the case, so could someone please push it,
because I don't have commit rights yet? 

https://patchwork.freedesktop.org/patch/223764/

Many thanks, 
Gert 


> 
> 
> On Mon, May 21, 2018 at 12:37 AM Gert Wollny <gert.wollny at collabora.c
> om> wrote:
> > Am Donnerstag, den 17.05.2018, 12:33 +0200 schrieb Gert Wollny:
> > > The driver must support at least one of
> > > 
> > >   PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT
> > >   PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT
> > > 
> > > and one of
> > > 
> > >   PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER
> > >   PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER
> > > 
> > > otherwise glsl_to_tgsi will fire an assert.
> > > 
> > > ORIGIN_UPPER_LEFT is the default convention, and is supported by
> > > all mesa drivers, hence it seems reasonable to always report the
> > caps
> > > to be enabled.  On gles ORIGIN_LOWER_LEFT is generally not
> > supported,
> > > so we rely on the caps reported by the host that depend on
> > whether we
> > > run on an GL or an EGL host.
> > > 
> > > For PIXEL_CENTER it is completely host driver dependend on what
> > is
> > > supported, and since we do not report the actual host driver
> > > capabilities
> > > it is best to mark both as supported, this is how it works for a
> > GL
> > > host too.
> > > 
> > > Fixes:
> > >   dEQP-GLES3.functional.shaders.builtin_variable.fragcoord_xyz
> > >   dEQP-
> > GLES3.functional.shaders.metamorphic.bubblesort_flag.variant_1
> > >   dEQP-
> > GLES3.functional.shaders.metamorphic.bubblesort_flag.variant_2
> > > 
> > > Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
> > > ---
> > > When I return 1 for  PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT
> > too,
> > > the test fail on an r600g gle host. Likewise, when I disable one
> > of
> > > the two PIXEL_CENTER caps. 
> > > 
> > > However, I send this as an RFC, because there are some of the
> > > *texture* tests that flip: some start to pass with this patch and
> > > some start to fail, in total 16 test are fixed with this patch
> > and 15
> > > regress on Intel. I have not yet established whether these tests
> > are
> > > actually unstable.
> > 
> > After quite some testing I've come to the conclusion that the tests
> > that flip between Pass and Fail are tests that are generally
> > unstable
> > when run inside Qemu, so it should be save to apply it. 
> > 
> > Best, 
> > Gert 
> > 
> > > 
> > > thanks for any comments.
> > > Gert
> > > 
> > >  src/gallium/drivers/virgl/virgl_screen.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/src/gallium/drivers/virgl/virgl_screen.c
> > > b/src/gallium/drivers/virgl/virgl_screen.c
> > > index 1ca9e85de7..f4fdc61b14 100644
> > > --- a/src/gallium/drivers/virgl/virgl_screen.c
> > > +++ b/src/gallium/drivers/virgl/virgl_screen.c
> > > @@ -88,9 +88,10 @@ virgl_get_param(struct pipe_screen *screen,
> > enum
> > > pipe_cap param)
> > >     case PIPE_CAP_INDEP_BLEND_FUNC:
> > >        return vscreen->caps.caps.v1.bset.indep_blend_func;
> > >     case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
> > > -   case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
> > >     case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
> > >     case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
> > > +      return 1;
> > > +   case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
> > >        return vscreen-
> > >caps.caps.v1.bset.fragment_coord_conventions;
> > >     case PIPE_CAP_DEPTH_CLIP_DISABLE:
> > >        return vscreen->caps.caps.v1.bset.depth_clip_disable;
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list