panfrost: Setup gl_FragCoord as sysval on Bifrost
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 1 May 2020 16:05:01 +0000 (12:05 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 4 May 2020 15:08:14 +0000 (11:08 -0400)
..rather than a varying.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>

src/gallium/drivers/panfrost/pan_cmdstream.c
src/gallium/drivers/panfrost/pan_screen.c

index 89d038f2e2293896994088b7a92e97f99625bb60..c99469a82d9c65aadafd1d9e05cd086c219dc19b 100644 (file)
@@ -1810,7 +1810,7 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
                 varyings[gl_FragCoord].elements = MALI_VARYING_FRAG_COORD;
 
         struct panfrost_device *device = pan_device(ctx->base.screen);
-        assert(!(device->quirks & IS_BIFROST) || !(reads_point_coord || fs->reads_face || fs->reads_frag_coord));
+        assert(!(device->quirks & IS_BIFROST) || !(reads_point_coord));
 
         /* Let's go ahead and link varying meta to the buffer in question, now
          * that that information is available. VARYING_SLOT_POS is mapped to
index 866c23adc93dfa3328769889345ad58e2f47d6d8..ecfac6cddb029da2339f971828a69a3b3a2cd7e4 100644 (file)
@@ -93,6 +93,7 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
 {
         /* We expose in-dev stuff for dEQP that we don't want apps to use yet */
         bool is_deqp = pan_debug & PAN_DBG_DEQP;
+        struct panfrost_device *dev = pan_device(screen);
 
         /* Our GLES3 implementation is WIP */
         bool is_gles3 = pan_debug & PAN_DBG_GLES3;
@@ -195,10 +196,10 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
         case PIPE_CAP_GENERATE_MIPMAP:
                 return 1;
 
-        /* We would prefer varyings */
+        /* We would prefer varyings on Midgard, but proper sysvals on Bifrost */
         case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL:
         case PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL:
-                return 0;
+                return dev->quirks & IS_BIFROST;
 
         /* I really don't want to set this CAP but let's not swim against the
          * tide.. */