ilo: track if primitive restart has changed
Re-emit 3DSTATE_INDEX_BUFFER to enable/disable primitive restart.
This commit is contained in:
parent
e071812e46
commit
cabc7b44c0
|
@ -187,6 +187,7 @@ struct ilo_3d_pipeline {
|
||||||
struct ilo_3d_pipeline_state {
|
struct ilo_3d_pipeline_state {
|
||||||
bool has_gen6_wa_pipe_control;
|
bool has_gen6_wa_pipe_control;
|
||||||
|
|
||||||
|
bool primitive_restart;
|
||||||
int reduced_prim;
|
int reduced_prim;
|
||||||
int so_num_vertices, so_max_vertices;
|
int so_num_vertices, so_max_vertices;
|
||||||
|
|
||||||
|
|
|
@ -399,7 +399,8 @@ gen6_pipeline_vf(struct ilo_3d_pipeline *p,
|
||||||
struct gen6_pipeline_session *session)
|
struct gen6_pipeline_session *session)
|
||||||
{
|
{
|
||||||
/* 3DSTATE_INDEX_BUFFER */
|
/* 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,
|
p->gen6_3DSTATE_INDEX_BUFFER(p->dev,
|
||||||
&ilo->ib, ilo->draw->primitive_restart, p->cp);
|
&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->state_bo_changed = true;
|
||||||
session->kernel_bo_changed = true;
|
session->kernel_bo_changed = true;
|
||||||
session->prim_changed = true;
|
session->prim_changed = true;
|
||||||
|
session->primitive_restart_changed = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/*
|
/*
|
||||||
|
@ -1325,6 +1327,8 @@ gen6_pipeline_prepare(const struct ilo_3d_pipeline *p,
|
||||||
session->kernel_bo_changed =
|
session->kernel_bo_changed =
|
||||||
(p->invalidate_flags & ILO_3D_PIPELINE_INVALIDATE_KERNEL_BO);
|
(p->invalidate_flags & ILO_3D_PIPELINE_INVALIDATE_KERNEL_BO);
|
||||||
session->prim_changed = (p->state.reduced_prim != session->reduced_prim);
|
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);
|
assert(used <= estimate);
|
||||||
|
|
||||||
p->state.reduced_prim = session->reduced_prim;
|
p->state.reduced_prim = session->reduced_prim;
|
||||||
|
p->state.primitive_restart = ilo->draw->primitive_restart;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -44,6 +44,7 @@ struct gen6_pipeline_session {
|
||||||
bool state_bo_changed;
|
bool state_bo_changed;
|
||||||
bool kernel_bo_changed;
|
bool kernel_bo_changed;
|
||||||
bool prim_changed;
|
bool prim_changed;
|
||||||
|
bool primitive_restart_changed;
|
||||||
|
|
||||||
void (*emit_draw_states)(struct ilo_3d_pipeline *p,
|
void (*emit_draw_states)(struct ilo_3d_pipeline *p,
|
||||||
const struct ilo_context *ilo,
|
const struct ilo_context *ilo,
|
||||||
|
|
Loading…
Reference in New Issue