#include "util/u_transfer.h"
#include "util/u_surface.h"
#include "util/u_pack_color.h"
+#include "util/u_math.h"
#include "util/u_memory.h"
#include "util/u_inlines.h"
#include "util/u_framebuffer.h"
#include "evergreen_compute_internal.h"
#include <inttypes.h>
+#define ITEM_ALIGNMENT 1024
/**
* Creates a new pool
*/
return last_end;
}
- last_end = item->start_in_dw + item->size_in_dw;
- last_end += (1024 - last_end % 1024);
+ last_end = item->start_in_dw + align(item->size_in_dw, ITEM_ALIGNMENT);
}
}
if (pool->shadow == NULL)
return -1;
} else {
- new_size_in_dw += 1024 - (new_size_in_dw % 1024);
+ new_size_in_dw = align(new_size_in_dw, ITEM_ALIGNMENT);
COMPUTE_DBG(pool->screen, " Aligned size = %d (%d bytes)\n",
new_size_in_dw, new_size_in_dw * 4);
need = pool->size_in_dw / 10;
}
- need += 1024 - (need % 1024);
+ need = align(need, ITEM_ALIGNMENT);
err = compute_memory_grow_pool(pool,
pipe,