summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_primitive_restart.c
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-04-05 20:15:39 -0700
committerPaul Berry <stereotype441@gmail.com>2013-04-09 15:37:36 -0700
commit34efd9214d4daabb56f7f39bdbd6836472979b76 (patch)
treeaeefe7bb1b63d3dba82ab272df70420f0efa5b7d /src/mesa/drivers/dri/i965/brw_primitive_restart.c
parenta7388f8e6f72b31fa05c824ae1c42bf86794f878 (diff)
downloadexternal_mesa3d-34efd9214d4daabb56f7f39bdbd6836472979b76.zip
external_mesa3d-34efd9214d4daabb56f7f39bdbd6836472979b76.tar.gz
external_mesa3d-34efd9214d4daabb56f7f39bdbd6836472979b76.tar.bz2
i965/gen7.5: Allow HW primitive restart for all primitive types.
Gen7.5 (Haswell) hardware supports primitive restart for all primitive types. It also handles all possible primitive restart indices. Rather than specialize both can_cut_index_handle_restart_index() and the switch statement in can_cut_index_handle_prims() for Haswell, just return early if the hardware is Haswell because we know it can handle everything. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_primitive_restart.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_primitive_restart.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_primitive_restart.c b/src/mesa/drivers/dri/i965/brw_primitive_restart.c
index e6902b4..10581b3 100644
--- a/src/mesa/drivers/dri/i965/brw_primitive_restart.c
+++ b/src/mesa/drivers/dri/i965/brw_primitive_restart.c
@@ -36,18 +36,12 @@
/**
* Check if the hardware's cut index support can handle the primitive
- * restart index value.
+ * restart index value (pre-Haswell only).
*/
static bool
can_cut_index_handle_restart_index(struct gl_context *ctx,
const struct _mesa_index_buffer *ib)
{
- struct intel_context *intel = intel_context(ctx);
-
- /* Haswell supports an arbitrary cut index. */
- if (intel->is_haswell)
- return true;
-
bool cut_index_will_work;
switch (ib->type) {
@@ -78,6 +72,7 @@ can_cut_index_handle_prims(struct gl_context *ctx,
GLuint nr_prims,
const struct _mesa_index_buffer *ib)
{
+ struct intel_context *intel = intel_context(ctx);
struct brw_context *brw = brw_context(ctx);
if (brw->sol.counting_primitives_generated ||
@@ -90,6 +85,10 @@ can_cut_index_handle_prims(struct gl_context *ctx,
return false;
}
+ /* Otherwise Haswell can do it all. */
+ if (intel->is_haswell)
+ return true;
+
if (!can_cut_index_handle_restart_index(ctx, ib)) {
/* The primitive restart index can't be handled, so take
* the software path