summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/a6xx
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-05-16 11:34:13 -0700
committerRob Clark <[email protected]>2019-05-20 09:10:12 -0700
commitabfb31acdb673083296d010dfc6920992369989c (patch)
treefa58193fbcdd48cf9df113ba4f13066100884932 /src/gallium/drivers/freedreno/a6xx
parentd200d58e65d5e1836be1bd0dbea3c4c6b8edae48 (diff)
freedreno/a6xx: make sure binning pass constlen is large enough
Since we use same constant state for both binning pass program state and draw pass state, and it is possible for binning pass shader to use fewer consts, we need to make sure we program a large enough constlen. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a6xx')
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_program.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_program.c b/src/gallium/drivers/freedreno/a6xx/fd6_program.c
index 9888e51f86e..3603d800f04 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_program.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_program.c
@@ -285,6 +285,19 @@ setup_stages(struct fd6_program_state *state, struct stage *s, bool binning_pass
s[i].instrlen = 0;
}
}
+
+ /* since we share the constant state w/ VS we need to make sure
+ * constlen is sufficiently large for full VS, even if the binning
+ * pass shader doesn't use them all
+ */
+ if (binning_pass) {
+ s[VS].constlen = MAX2(s[VS].constlen, align(state->bs->constlen, 4));
+ } else {
+ /* It should be impossible for VS to have smaller constlen than BS
+ * since BS is just a subset of VS.
+ */
+ debug_assert(s[VS].constlen >= state->bs->constlen);
+ }
}
static inline uint32_t