virgl: Always assume that ORIGIN_UPPER_LEFT and PIXEL_CENTER* are supported
authorGert Wollny <gert.wollny@collabora.com>
Wed, 16 May 2018 16:35:29 +0000 (18:35 +0200)
committerJakob Bornecrantz <jakob@collabora.com>
Fri, 1 Jun 2018 11:04:21 +0000 (12:04 +0100)
commitef3a6e3d9814b2edde705bd326d27ef505573f7a
tree6572e405c12b8c1302f02ae58e7f5ecc406d2d96
parent01a2414045bd819267821423dbf77c3655cc214d
virgl: Always assume that ORIGIN_UPPER_LEFT and PIXEL_CENTER* are supported

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

Reviewed-by: Gurchetan Singh <gurcetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
src/gallium/drivers/virgl/virgl_screen.c