summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2013-06-27 18:19:16 +0800
committerChia-I Wu <[email protected]>2013-06-28 10:44:38 +0800
commitcabc7b44c0fef2122ee001363e4d6e5cb6e66012 (patch)
treec12fb8963254686d80c72a14012324e3a178bf00 /src
parente071812e46617b6f1d335aef6381de7b6afc269f (diff)
ilo: track if primitive restart has changed
Re-emit 3DSTATE_INDEX_BUFFER to enable/disable primitive restart.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/ilo/ilo_3d_pipeline.h1
-rw-r--r--src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c7
-rw-r--r--src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline.h b/src/gallium/drivers/ilo/ilo_3d_pipeline.h
index 7a867aaea27..f26fa83c2dc 100644
--- a/src/gallium/drivers/ilo/ilo_3d_pipeline.h
+++ b/src/gallium/drivers/ilo/ilo_3d_pipeline.h
@@ -187,6 +187,7 @@ struct ilo_3d_pipeline {
struct ilo_3d_pipeline_state {
bool has_gen6_wa_pipe_control;
+ bool primitive_restart;
int reduced_prim;
int so_num_vertices, so_max_vertices;
diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
index 190f6a9d9fb..5e9e9869ee1 100644
--- a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
+++ b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
@@ -399,7 +399,8 @@ gen6_pipeline_vf(struct ilo_3d_pipeline *p,
struct gen6_pipeline_session *session)
{
/* 3DSTATE_INDEX_BUFFER */
- if (DIRTY(INDEX_BUFFER) || session->batch_bo_changed) {
+ if (DIRTY(INDEX_BUFFER) || session->primitive_restart_changed ||
+ session->batch_bo_changed) {
p->gen6_3DSTATE_INDEX_BUFFER(p->dev,
&ilo->ib, ilo->draw->primitive_restart, p->cp);
}
@@ -1306,6 +1307,7 @@ gen6_pipeline_prepare(const struct ilo_3d_pipeline *p,
session->state_bo_changed = true;
session->kernel_bo_changed = true;
session->prim_changed = true;
+ session->primitive_restart_changed = true;
}
else {
/*
@@ -1325,6 +1327,8 @@ gen6_pipeline_prepare(const struct ilo_3d_pipeline *p,
session->kernel_bo_changed =
(p->invalidate_flags & ILO_3D_PIPELINE_INVALIDATE_KERNEL_BO);
session->prim_changed = (p->state.reduced_prim != session->reduced_prim);
+ session->primitive_restart_changed =
+ (p->state.primitive_restart != ilo->draw->primitive_restart);
}
}
@@ -1363,6 +1367,7 @@ gen6_pipeline_end(struct ilo_3d_pipeline *p,
assert(used <= estimate);
p->state.reduced_prim = session->reduced_prim;
+ p->state.primitive_restart = ilo->draw->primitive_restart;
}
static void
diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.h b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.h
index 11e3cb0b55f..a9c4051d2df 100644
--- a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.h
+++ b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.h
@@ -44,6 +44,7 @@ struct gen6_pipeline_session {
bool state_bo_changed;
bool kernel_bo_changed;
bool prim_changed;
+ bool primitive_restart_changed;
void (*emit_draw_states)(struct ilo_3d_pipeline *p,
const struct ilo_context *ilo,