util: Add align_uintptr and use it treewide to replace ALIGN that works on size_t and uintptr_t
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26866>
This commit is contained in:
@@ -55,12 +55,12 @@ get_geometry(const VkAccelerationStructureBuildGeometryInfoKHR *pInfo,
|
||||
|
||||
static size_t align_transient_size(size_t bytes)
|
||||
{
|
||||
return ALIGN(bytes, 64);
|
||||
return align_uintptr(bytes, 64);
|
||||
}
|
||||
|
||||
static size_t align_private_size(size_t bytes)
|
||||
{
|
||||
return ALIGN(bytes, 64);
|
||||
return align_uintptr(bytes, 64);
|
||||
}
|
||||
|
||||
static size_t get_scheduler_size(size_t num_builds)
|
||||
@@ -696,7 +696,7 @@ cmd_build_acceleration_structures(
|
||||
}
|
||||
|
||||
size_t geom_struct_size = bs->num_geometries * sizeof(struct Geo);
|
||||
size_t geom_prefix_sum_size = ALIGN(sizeof(uint32_t) * (bs->num_geometries + 1), 64);
|
||||
size_t geom_prefix_sum_size = align_uintptr(sizeof(uint32_t) * (bs->num_geometries + 1), 64);
|
||||
|
||||
bs->transient_size = geom_prefix_sum_size + geom_struct_size;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user