aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2020-04-17 10:45:17 -0700
committerMarge Bot <[email protected]>2020-04-27 22:10:10 +0000
commit69c8dfd49f565283f599b3be9af3f1327ea78803 (patch)
treedda2876a1de9ed081ec5bbdf6b2c3cf1e55845d3 /src/gallium/drivers/freedreno
parent8b221e091427a749499179511d1c8438fd0dcd64 (diff)
freedreno: Fix calculation of the const buffer cmdstream size.
The HW packet requires padding the number of pointers you emit, and we would assertion fail about running out of buffer space if the number of UBOs to be uploaded was odd. Fixes: b4df115d3f3c ("freedreno/a6xx: pre-calculate userconst stateobj size") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4621>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_program.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_program.c b/src/gallium/drivers/freedreno/a6xx/fd6_program.c
index 6e19deee03e..fa98aae546f 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_program.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_program.c
@@ -1030,7 +1030,7 @@ fd6_shader_state_create(struct pipe_context *pctx, const struct pipe_shader_stat
/* also account for UBO addresses: */
packets += 1;
- size += 2 * shader->const_state.num_ubos;
+ size += 2 * align(shader->const_state.num_ubos, 2);
unsigned sizedwords = (4 * packets) + size;
shader->ubo_state.cmdstream_size = sizedwords * 4;