Mesa (main): asahi: Handle point coordinates

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Jul 11 22:41:36 UTC 2021


Module: Mesa
Branch: main
Commit: 3291779c21355066b9c9170cbe0b770f51803393
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3291779c21355066b9c9170cbe0b770f51803393

Author: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Date:   Sun Jul 11 17:27:55 2021 -0400

asahi: Handle point coordinates

Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11818>

---

 src/asahi/compiler/agx_compile.c     | 9 ++++++---
 src/gallium/drivers/asahi/agx_pipe.c | 3 ++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c
index 241d0e0c83e..ef1fe82b778 100644
--- a/src/asahi/compiler/agx_compile.c
+++ b/src/asahi/compiler/agx_compile.c
@@ -1254,9 +1254,12 @@ agx_remap_varyings_fs(nir_shader *nir, struct agx_varyings *varyings,
 
      for (int c = 0; c < sz; ++c) {
         agx_pack(packed, VARYING, cfg) {
-           cfg.type = (var->data.interpolation == INTERP_MODE_FLAT) ?
-              AGX_VARYING_TYPE_FLAT_LAST :
-              AGX_VARYING_TYPE_SMOOTH;
+           cfg.type = (var->data.location == VARYING_SLOT_PNTC) ?
+              AGX_VARYING_TYPE_POINT_COORDINATES :
+              (var->data.interpolation == INTERP_MODE_FLAT) ?
+                 AGX_VARYING_TYPE_FLAT_LAST :
+                 AGX_VARYING_TYPE_SMOOTH;
+
            cfg.components = channels;
            cfg.triangle_slot = cfg.point_slot = base;
         }
diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c
index 540cd7eeb41..bdb46b95f73 100644
--- a/src/gallium/drivers/asahi/agx_pipe.c
+++ b/src/gallium/drivers/asahi/agx_pipe.c
@@ -780,10 +780,11 @@ agx_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_TEXCOORD:
    case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL:
    case PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL:
-   case PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL:
    case PIPE_CAP_SEAMLESS_CUBE_MAP:
    case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
       return true;
+   case PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL:
+      return false;
 
    case PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET:
       return 0xffff;



More information about the mesa-commit mailing list