anv: use align/align64 instead ALIGN, as the input is size_t/uint64_t

When the input is size_t, cast the input to uint32_t, as the output is expect uint32_t not size_t

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38365>
This commit is contained in:
Yonggang Luo 2025-11-11 15:15:35 +08:00 committed by Marge Bot
parent db767eb7e0
commit ee4c3e790f
2 changed files with 3 additions and 3 deletions

View file

@ -248,7 +248,7 @@ get_bvh_layout(VkGeometryTypeKHR geometry_type, uint32_t leaf_count,
offset += leaf_count * sizeof(uint64_t);
}
/* The BVH and hence bvh_offset needs 64 byte alignment for RT nodes. */
offset = ALIGN(offset, 64);
offset = align64(offset, 64);
/* This is where internal_nodes/leaves start to be encoded */
layout->bvh_offset = offset;

View file

@ -1246,7 +1246,7 @@ anv_h264_encode_video(struct anv_cmd_buffer *cmd, const VkVideoEncodeInfoKHR *en
slice_header_data_len_in_bits -= 8;
length_in_dw = ALIGN(slice_header_data_len_in_bits, 32) >> 5;
length_in_dw = align((uint32_t)slice_header_data_len_in_bits, 32) >> 5;
data_bits_in_last_dw = slice_header_data_len_in_bits & 0x1f;
dw = anv_batch_emitn(&cmd->batch, length_in_dw + 2, GENX(MFX_PAK_INSERT_OBJECT),
@ -2355,7 +2355,7 @@ anv_h265_encode_video(struct anv_cmd_buffer *cmd, const VkVideoEncodeInfoKHR *en
uint32_t length_in_dw;
uint32_t data_bits_in_last_dw;
length_in_dw = ALIGN(slice_header_data_len_in_bits, 32) >> 5;
length_in_dw = align((uint32_t)slice_header_data_len_in_bits, 32) >> 5;
data_bits_in_last_dw = slice_header_data_len_in_bits & 0x1f;
dw = anv_batch_emitn(&cmd->batch, length_in_dw + 2, GENX(HCP_PAK_INSERT_OBJECT),