Module: Mesa
Branch: 23.0
Commit: 6b139c2be7db715bd10a7f50d66545b2c9f7e34b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6b139c2be7db715bd10a7f50d66545b2c9f7e34b

Author: Alyssa Rosenzweig <[email protected]>
Date:   Fri Jan 13 16:35:48 2023 -0500

panfrost: Enable NV_primitive_restart on Valhall

Unlike literally every other mesa/st emulation, for some inexplicable reason we
need to pretend to support the CAP and then set a different EMULATE cap instead
of the emulation keying off the lack of support for the CAP. Set the CAPs
accordingly so we get NV_primitive_restart (with emulation of non-fixed
indices).

This gets Mesa to advertise GL 3.1 on Mali-G57 as intended.

Fixes: 30c14f54cf2 ("panfrost: Disable PIPE_CAP_PRIMITIVE_RESTART on v9")
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20702>
(cherry picked from commit fe4dc59e99dd745b6b42613d199cf61e7b2da995)

---

 .pick_status.json                         | 2 +-
 src/gallium/drivers/panfrost/pan_screen.c | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 0aa1dd8c4c8..b2c3e857d61 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -589,7 +589,7 @@
         "description": "panfrost: Enable NV_primitive_restart on Valhall",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "30c14f54cf2bbf86f3d8f16a3d46edad6d0fce7c"
     },
diff --git a/src/gallium/drivers/panfrost/pan_screen.c 
b/src/gallium/drivers/panfrost/pan_screen.c
index 00ad57e03cf..ba74c19ccd6 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -135,6 +135,7 @@ panfrost_get_param(struct pipe_screen *screen, enum 
pipe_cap param)
       return 1;
 
    case PIPE_CAP_OCCLUSION_QUERY:
+   case PIPE_CAP_PRIMITIVE_RESTART:
    case PIPE_CAP_PRIMITIVE_RESTART_FIXED_INDEX:
       return true;
 
@@ -312,8 +313,8 @@ panfrost_get_param(struct pipe_screen *screen, enum 
pipe_cap param)
    /* Removed in v9 (Valhall). PRIMTIIVE_RESTART_FIXED_INDEX is of course
     * still supported as it is core GLES3.0 functionality
     */
-   case PIPE_CAP_PRIMITIVE_RESTART:
-      return dev->arch <= 7;
+   case PIPE_CAP_EMULATE_NONFIXED_PRIMITIVE_RESTART:
+      return dev->arch >= 9;
 
    case PIPE_CAP_FLATSHADE:
    case PIPE_CAP_TWO_SIDED_COLOR:

Reply via email to