summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/a6xx
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2018-10-25 15:27:10 -0400
committerRob Clark <[email protected]>2018-10-25 18:38:53 -0400
commit3c402d0dc2a39a7d6efd51400d3cab5b737dfafc (patch)
tree7c130e8aace7950d656fd87fffd98a3068dbeb5a /src/gallium/drivers/freedreno/a6xx
parentd53074d3f10dbeffb5b991dffd19b2c17f2711fb (diff)
freedreno/a6xx: disable unused groups
Don't leave vsconst/fsconst group enabled if we switch to shader with no uniforms. Fixes: abcdf5627a2 freedreno/a6xx: move const emit to state group Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a6xx')
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_emit.c17
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_emit.h2
2 files changed, 13 insertions, 6 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
index ae91e90e4a1..8c3336d5ea6 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
@@ -954,10 +954,19 @@ fd6_emit_state(struct fd_ringbuffer *ring, struct fd6_emit *emit)
struct fd6_state_group *g = &emit->groups[i];
unsigned n = fd_ringbuffer_size(g->stateobj) / 4;
- OUT_RING(ring, CP_SET_DRAW_STATE__0_COUNT(n) |
- CP_SET_DRAW_STATE__0_ENABLE_MASK(g->enable_mask) |
- CP_SET_DRAW_STATE__0_GROUP_ID(g->group_id));
- OUT_RB(ring, g->stateobj);
+ if (n == 0) {
+ OUT_RING(ring, CP_SET_DRAW_STATE__0_COUNT(0) |
+ CP_SET_DRAW_STATE__0_DISABLE |
+ CP_SET_DRAW_STATE__0_ENABLE_MASK(g->enable_mask) |
+ CP_SET_DRAW_STATE__0_GROUP_ID(g->group_id));
+ OUT_RING(ring, 0x00000000);
+ OUT_RING(ring, 0x00000000);
+ } else {
+ OUT_RING(ring, CP_SET_DRAW_STATE__0_COUNT(n) |
+ CP_SET_DRAW_STATE__0_ENABLE_MASK(g->enable_mask) |
+ CP_SET_DRAW_STATE__0_GROUP_ID(g->group_id));
+ OUT_RB(ring, g->stateobj);
+ }
fd_ringbuffer_del(g->stateobj);
}
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.h b/src/gallium/drivers/freedreno/a6xx/fd6_emit.h
index d7ab80ae7a4..dce131d6b27 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.h
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.h
@@ -110,8 +110,6 @@ fd6_emit_add_group(struct fd6_emit *emit, struct fd_ringbuffer *stateobj,
enum fd6_state_id group_id, unsigned enable_mask)
{
debug_assert(emit->num_groups < ARRAY_SIZE(emit->groups));
- if (fd_ringbuffer_size(stateobj) == 0)
- return;
struct fd6_state_group *g = &emit->groups[emit->num_groups++];
g->stateobj = fd_ringbuffer_ref(stateobj);
g->group_id = group_id;