Commit 69c8dfd4 authored by Eric Anholt's avatar Eric Anholt Committed by Marge Bot

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: b4df115d ("freedreno/a6xx: pre-calculate userconst stateobj size")
Part-of: <mesa/mesa!4621>
parent 8b221e09
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment