*
* Immediates go last mostly because they are inserted in the CP pass
* after the nir -> ir3 frontend.
+ *
+ * Note UBO size in bytes should be aligned to vec4
*/
+ debug_assert((ctx->so->shader->ubo_state.size % 16) == 0);
unsigned constoff = align(ctx->so->shader->ubo_state.size / 16, 4);
unsigned ptrsz = ir3_pointer_size(ctx);
* the compiler (to worst-case value) since we don't know in
* the assembler what the max addr reg value can be:
*/
- v->constlen = MIN2(255, MAX2(v->constlen, v->info.max_const + 1));
+ v->constlen = MAX2(v->constlen, v->info.max_const + 1);
+ debug_assert(v->constlen < 256);
fixup_regfootprint(v, gpu_id);
if (state->range[i].start < state->range[i].end &&
constbuf->enabled_mask & (1 << i)) {
+ uint32_t size = state->range[i].end - state->range[i].start;
+ uint32_t offset = cb->buffer_offset + state->range[i].start;
+ debug_assert((state->range[i].offset % 16) == 0);
+ debug_assert((size % 16) == 0);
+ debug_assert((offset % 16) == 0);
ctx->emit_const(ring, v->type, state->range[i].offset / 4,
- cb->buffer_offset + state->range[i].start,
- (state->range[i].end - state->range[i].start) / 4,
- cb->user_buffer, cb->buffer);
+ offset, size / 4, cb->user_buffer, cb->buffer);
}
}
}