[Mesa-dev] [PATCH] i965: Allow primitive restart on Haswell for additional primitive types.

Kenneth Graunke kenneth at whitecape.org
Fri Sep 7 13:04:13 PDT 2012


These are supported in hardware; no need for software fallbacks.

Not actually hit in any of our test cases, since they appear to count
primitives generated which currently causes software fallbacks anyway.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_primitive_restart.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_primitive_restart.c b/src/mesa/drivers/dri/i965/brw_primitive_restart.c
index 38b5243..fc36897 100644
--- a/src/mesa/drivers/dri/i965/brw_primitive_restart.c
+++ b/src/mesa/drivers/dri/i965/brw_primitive_restart.c
@@ -79,6 +79,7 @@ can_cut_index_handle_prims(struct gl_context *ctx,
                            const struct _mesa_index_buffer *ib)
 {
    struct brw_context *brw = brw_context(ctx);
+   struct intel_context *intel = intel_context(ctx);
 
    if (brw->sol.counting_primitives_generated ||
        brw->sol.counting_primitives_written) {
@@ -105,19 +106,18 @@ can_cut_index_handle_prims(struct gl_context *ctx,
       case GL_TRIANGLES:
       case GL_TRIANGLE_STRIP:
          /* Cut index supports these primitive types */
-         break;
-      default:
-         /* Cut index does not support these primitive types */
-      //case GL_LINE_LOOP:
-      //case GL_TRIANGLE_FAN:
-      //case GL_QUADS:
-      //case GL_QUAD_STRIP:
-      //case GL_POLYGON:
-         return false;
+         return true;
+      case GL_LINE_LOOP:
+      case GL_TRIANGLE_FAN:
+      case GL_QUADS:
+      case GL_QUAD_STRIP:
+      case GL_POLYGON:
+         /* Haswell supports cut index on additional primitive types */
+         return intel->is_haswell;
       }
    }
 
-   return true;
+   return false;
 }
 
 /**
-- 
1.7.11.4



More information about the mesa-dev mailing list