Просмотр исходного кода

vk: Rename functions ALIGN_*32 -> align_*32

ALIGN_U32 and ALIGN_I32 are functions, not macros. So stop using
allcaps.
tags/12.0-branchpoint
Chad Versace 10 лет назад
Родитель
Сommit
55752fe94a
7 измененных файлов: 14 добавлений и 14 удалений
  1. 2
    2
      src/vulkan/allocator.c
  2. 2
    2
      src/vulkan/aub.c
  3. 1
    1
      src/vulkan/compiler.cpp
  4. 1
    1
      src/vulkan/device.c
  5. 5
    5
      src/vulkan/image.c
  6. 2
    2
      src/vulkan/private.h
  7. 1
    1
      src/vulkan/util.c

+ 2
- 2
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);
}


+ 2
- 2
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;

+ 1
- 1
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];
}


+ 1
- 1
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 };


+ 5
- 5
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;
}

+ 2
- 2
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);
}

+ 1
- 1
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,

Загрузка…
Отмена
Сохранить