struct draw_context *draw = fpme->draw;
struct draw_vertex_shader *shader = draw->vs.vertex_shader;
unsigned opt = fpme->opt;
- unsigned alloc_count = align_int( fetch_count, 4 );
+ unsigned alloc_count = align( fetch_count, 4 );
struct vertex_header *pipeline_verts =
(struct vertex_header *)MALLOC(fpme->vertex_size * alloc_count);
struct draw_context *draw = fpme->draw;
struct draw_vertex_shader *shader = draw->vs.vertex_shader;
unsigned opt = fpme->opt;
- unsigned alloc_count = align_int( count, 4 );
+ unsigned alloc_count = align( count, 4 );
struct vertex_header *pipeline_verts =
(struct vertex_header *)MALLOC(fpme->vertex_size * alloc_count);
struct draw_context *draw = fpme->draw;
struct draw_vertex_shader *shader = draw->vs.vertex_shader;
unsigned opt = fpme->opt;
- unsigned alloc_count = align_int( count, 4 );
+ unsigned alloc_count = align( count, 4 );
struct vertex_header *pipeline_verts =
(struct vertex_header *)MALLOC(fpme->vertex_size * alloc_count);
*/
if (pt->last_level > 0) {
unsigned mip1_nblocksx
- = align_int(pf_get_nblocksx(&pt->block, minify(width)), align_x)
+ = align(pf_get_nblocksx(&pt->block, minify(width)), align_x)
+ pf_get_nblocksx(&pt->block, minify(minify(width)));
if (mip1_nblocksx > nblocksx)
/* Pitch must be a whole number of dwords
*/
- tex->stride = align_int(tex->stride, 64);
+ tex->stride = align(tex->stride, 64);
tex->total_nblocksy = 0;
for (level = 0; level <= pt->last_level; level++) {
i915_miptree_set_level_info(tex, level, 1, width, height, 1);
i915_miptree_set_image_offset(tex, level, 0, x, y);
- nblocksy = align_int(nblocksy, align_y);
+ nblocksy = align(nblocksy, align_y);
/* Because the images are packed better, the final offset
* might not be the maximal one:
/* Layout_below: step right after second mipmap level.
*/
if (level == 1) {
- x += align_int(nblocksx, align_x);
+ x += align(nblocksx, align_x);
}
else {
y += nblocksy;
*/
if (pt->last_level > 0) {
unsigned mip1_nblocksx
- = align_int(pf_get_nblocksx(&pt->block, minify(width)), align_x)
+ = align(pf_get_nblocksx(&pt->block, minify(width)), align_x)
+ pf_get_nblocksx(&pt->block, minify(minify(width)));
if (mip1_nblocksx > nblocksx)
/* Pitch must be a whole number of dwords
*/
- tex->stride = align_int(tex->stride, 64);
+ tex->stride = align(tex->stride, 64);
tex->total_nblocksy = 0;
for (level = 0; level <= pt->last_level; level++) {
intel_miptree_set_level_info(tex, level, 1, x, y, width,
height, 1);
- nblocksy = align_int(nblocksy, align_y);
+ nblocksy = align(nblocksy, align_y);
/* Because the images are packed better, the final offset
* might not be the maximal one:
/* Layout_below: step right after second mipmap level.
*/
if (level == 1) {
- x += align_int(nblocksx, align_x);
+ x += align(nblocksx, align_x);
}
else {
y += nblocksy;
}
-static INLINE int align_int(int x, int align)
+static INLINE int align(int value, int alignment)
{
- return (x + align - 1) & ~(align - 1);
+ return (value + alignment - 1) & ~(alignment - 1);
}
+
#if defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86)
static INLINE unsigned ffs( unsigned u )
{
} while (0)
-static INLINE int align(int value, int alignment)
-{
- return (value + alignment - 1) & ~(alignment - 1);
-}
-
-
/* util/p_util.c
*/
extern void pipe_copy_rect(ubyte * dst, const struct pipe_format_block *block,