summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2013-08-13 16:11:27 +0800
committerChia-I Wu <[email protected]>2013-08-13 16:26:03 +0800
commit0f8a86682f311615e5a74ddd7d480fa0c7ac6f7d (patch)
treed6892eee650042636968d6ab84d1404e4d87f593 /src
parentc6e1e0157b9bd9ec416062a21bbd30ca9b69f363 (diff)
ilo: no binding table change when constants are pushed
When constants can be pushed, and nothing else requires new SURFACE_STATEs, there is no need to emit BINDING_TABLE_STATE.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
index dca49311ab3..245efa20c43 100644
--- a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
+++ b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
@@ -1005,40 +1005,34 @@ gen6_pipeline_state_surfaces_const(struct ilo_3d_pipeline *p,
{
const struct ilo_cbuf_state *cbuf = &ilo->cbuf[shader_type];
uint32_t *surface_state;
+ bool *binding_table_changed;
int offset, count, i;
- bool skip = false;
+
+ if (!DIRTY(CBUF))
+ return;
/* SURFACE_STATEs for constant buffers */
switch (shader_type) {
case PIPE_SHADER_VERTEX:
- if (DIRTY(CBUF)) {
- offset = ILO_VS_CONST_SURFACE(0);
- surface_state = &p->state.vs.SURFACE_STATE[offset];
-
- session->binding_table_vs_changed = true;
- }
- else {
- skip = true;
- }
+ offset = ILO_VS_CONST_SURFACE(0);
+ surface_state = &p->state.vs.SURFACE_STATE[offset];
+ binding_table_changed = &session->binding_table_vs_changed;
break;
case PIPE_SHADER_FRAGMENT:
- if (DIRTY(CBUF)) {
- offset = ILO_WM_CONST_SURFACE(0);
- surface_state = &p->state.wm.SURFACE_STATE[offset];
-
- session->binding_table_fs_changed = true;
- }
- else {
- skip = true;
- }
+ offset = ILO_WM_CONST_SURFACE(0);
+ surface_state = &p->state.wm.SURFACE_STATE[offset];
+ binding_table_changed = &session->binding_table_fs_changed;
break;
default:
- skip = true;
+ return;
break;
}
- if (skip)
+ /* constants are pushed via PCB */
+ if (cbuf->enabled_mask == 0x1 && !cbuf->cso[0].resource) {
+ memset(surface_state, 0, ILO_MAX_CONST_BUFFERS * 4);
return;
+ }
count = util_last_bit(cbuf->enabled_mask);
for (i = 0; i < count; i++) {
@@ -1055,6 +1049,8 @@ gen6_pipeline_state_surfaces_const(struct ilo_3d_pipeline *p,
if (count && session->num_surfaces[shader_type] < offset + count)
session->num_surfaces[shader_type] = offset + count;
+
+ *binding_table_changed = true;
}
static void