mali_ptr
panfrost_upload(struct panfrost_memory *mem, const void *data, size_t sz)
{
- sz = ALIGN_POT(sz, ALIGNMENT);
+ size_t aligned_sz = ALIGN_POT(sz, ALIGNMENT);
/* Bounds check */
- if ((mem->stack_bottom + sz) >= mem->bo->size) {
+ if ((mem->stack_bottom + aligned_sz) >= mem->bo->size) {
printf("Out of memory, tried to upload %zd but only %zd available\n",
sz, mem->bo->size - mem->stack_bottom);
assert(0);
memcpy((uint8_t *) mem->bo->cpu + mem->stack_bottom, data, sz);
mali_ptr gpu = mem->bo->gpu + mem->stack_bottom;
- mem->stack_bottom += sz;
+ mem->stack_bottom += aligned_sz;
return gpu;
}