From: Chad Versace Date: Fri, 26 Jun 2015 22:07:59 +0000 (-0700) Subject: vk: Rename functions ALIGN_*32 -> align_*32 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=55752fe94a2001433631cc504f37d23f8f050b8f;p=mesa.git vk: Rename functions ALIGN_*32 -> align_*32 ALIGN_U32 and ALIGN_I32 are functions, not macros. So stop using allcaps. --- diff --git a/src/vulkan/allocator.c b/src/vulkan/allocator.c index 6a7e845ef37..2d0d255721b 100644 --- a/src/vulkan/allocator.c +++ b/src/vulkan/allocator.c @@ -537,7 +537,7 @@ anv_state_stream_alloc(struct anv_state_stream *stream, struct anv_state state; uint32_t block; - state.offset = ALIGN_U32(stream->next, alignment); + state.offset = align_u32(stream->next, alignment); if (state.offset + size > stream->end) { block = anv_block_pool_alloc(stream->block_pool); void *current_map = stream->block_pool->map; @@ -548,7 +548,7 @@ anv_state_stream_alloc(struct anv_state_stream *stream, stream->current_block = block; stream->next = block + sizeof(*sb); stream->end = block + stream->block_pool->block_size; - state.offset = ALIGN_U32(stream->next, alignment); + state.offset = align_u32(stream->next, alignment); assert(state.offset + size <= stream->end); } diff --git a/src/vulkan/aub.c b/src/vulkan/aub.c index e3f333a54aa..42d4611eb6e 100644 --- a/src/vulkan/aub.c +++ b/src/vulkan/aub.c @@ -149,7 +149,7 @@ aub_write_trace_block(struct anv_aub_writer *writer, uint32_t type, type | AUB_TRACE_OP_DATA_WRITE); aub_out(writer, subtype); aub_out(writer, gtt_offset + offset); - aub_out(writer, ALIGN_U32(block_size, 4)); + aub_out(writer, align_u32(block_size, 4)); if (writer->gen >= 8) aub_out(writer, 0); @@ -258,7 +258,7 @@ anv_cmd_buffer_dump(struct anv_cmd_buffer *cmd_buffer) aub_bos[i].map = anv_gem_mmap(device, bo->gem_handle, 0, bo->size); aub_bos[i].relocated = aub_bos[i].map; aub_bos[i].offset = offset; - offset = ALIGN_U32(offset + bo->size + 4095, 4096); + offset = align_u32(offset + bo->size + 4095, 4096); } struct anv_batch_bo *first_bbo; diff --git a/src/vulkan/compiler.cpp b/src/vulkan/compiler.cpp index 144dd986260..b220331408c 100644 --- a/src/vulkan/compiler.cpp +++ b/src/vulkan/compiler.cpp @@ -1007,7 +1007,7 @@ add_compiled_stage(struct anv_pipeline *pipeline, uint32_t stage, pipeline->active_stages |= 1 << stage; pipeline->scratch_start[stage] = pipeline->total_scratch; pipeline->total_scratch = - ALIGN_U32(pipeline->total_scratch, 1024) + + align_u32(pipeline->total_scratch, 1024) + prog_data->total_scratch * max_threads[stage]; } diff --git a/src/vulkan/device.c b/src/vulkan/device.c index e637d2064ec..b6d0984d93d 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -2710,7 +2710,7 @@ anv_cmd_buffer_alloc_surface_state(struct anv_cmd_buffer *cmd_buffer, { struct anv_state state; - state.offset = ALIGN_U32(cmd_buffer->surface_next, alignment); + state.offset = align_u32(cmd_buffer->surface_next, alignment); if (state.offset + size > cmd_buffer->surface_batch_bo->bo.size) return (struct anv_state) { 0 }; diff --git a/src/vulkan/image.c b/src/vulkan/image.c index 9cf9d35a0f7..a2f76ef27d6 100644 --- a/src/vulkan/image.c +++ b/src/vulkan/image.c @@ -161,9 +161,9 @@ VkResult anv_image_create( /* The format has a color or depth component. Calculate space for it. */ uint32_t aligned_height; - image_stride = ALIGN_I32(extent->width * format_info->cpp, + image_stride = align_i32(extent->width * format_info->cpp, tile_info->width); - aligned_height = ALIGN_I32(extent->height, tile_info->height); + aligned_height = align_i32(extent->height, tile_info->height); image_size = image_stride * aligned_height; } @@ -177,9 +177,9 @@ VkResult anv_image_create( uint32_t aligned_height; uint32_t stencil_size; - stencil_offset = ALIGN_U32(image_size, w_info->surface_alignment); - stencil_stride = ALIGN_I32(extent->width, w_info->width); - aligned_height = ALIGN_I32(extent->height, w_info->height); + stencil_offset = align_u32(image_size, w_info->surface_alignment); + stencil_stride = align_i32(extent->width, w_info->width); + aligned_height = align_i32(extent->height, w_info->height); stencil_size = stencil_stride * aligned_height; image_size = stencil_offset + stencil_size; } diff --git a/src/vulkan/private.h b/src/vulkan/private.h index 23755c7e9ac..e9943062807 100644 --- a/src/vulkan/private.h +++ b/src/vulkan/private.h @@ -61,13 +61,13 @@ extern "C" { #define MAX(a, b) ((a) > (b) ? (a) : (b)) static inline uint32_t -ALIGN_U32(uint32_t v, uint32_t a) +align_u32(uint32_t v, uint32_t a) { return (v + a - 1) & ~(a - 1); } static inline int32_t -ALIGN_I32(int32_t v, int32_t a) +align_i32(int32_t v, int32_t a) { return (v + a - 1) & ~(a - 1); } diff --git a/src/vulkan/util.c b/src/vulkan/util.c index cbeb663b5ef..21cb6484670 100644 --- a/src/vulkan/util.c +++ b/src/vulkan/util.c @@ -108,7 +108,7 @@ anv_vector_add(struct anv_vector *vector) data = malloc(size); if (data == NULL) return NULL; - split = ALIGN_U32(vector->tail, vector->size); + split = align_u32(vector->tail, vector->size); tail = vector->tail & (vector->size - 1); if (vector->head - split < vector->size) { memcpy(data + tail,