Mesa (master): etnaviv: enable triangle strips only when the hardware supports it

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 2 08:11:24 UTC 2019


Module: Mesa
Branch: master
Commit: c5da8230deb0b1f885392224cfd3613d099ec440
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c5da8230deb0b1f885392224cfd3613d099ec440

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Wed Oct  2 09:28:55 2019 +0200

etnaviv: enable triangle strips only when the hardware supports it

Some hardware has a bug with triangle strips and it is signalled by the
flag BUG_FIXED8 whether this bug has been fixed. So only enable triangle
strips when this flag is set.

Thanks: Jonathan Marek and Christian Gmeiner for the pointers

v2: Add TODO to indicate that the handling should be refined
    (Jonathan & Christian)

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>

---

 src/gallium/drivers/etnaviv/etnaviv_context.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c
index 82254f9c1c1..9af564440c0 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_context.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_context.c
@@ -479,9 +479,15 @@ etna_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
                          1 << PIPE_PRIM_LINES |
                          1 << PIPE_PRIM_LINE_STRIP |
                          1 << PIPE_PRIM_TRIANGLES |
-                         1 << PIPE_PRIM_TRIANGLE_STRIP |
                          1 << PIPE_PRIM_TRIANGLE_FAN;
 
+   /* TODO: The bug relates only to indexed draws, but here we signal
+    * that there is no support for triangle strips at all. This should
+    * be refined.
+    */
+   if (VIV_FEATURE(ctx->screen, chipMinorFeatures2, BUG_FIXES8))
+      ctx->prim_hwsupport |= 1 << PIPE_PRIM_TRIANGLE_STRIP;
+
    if (VIV_FEATURE(ctx->screen, chipMinorFeatures2, LINE_LOOP))
       ctx->prim_hwsupport |= 1 << PIPE_PRIM_LINE_LOOP;
 




More information about the mesa-commit mailing list