vkd3d-shader/ir: Introduce shader_instruction_array_append().

This commit is contained in:
Francisco Casas
2025-09-15 09:33:45 -03:00
committed by Henri Verbeet
parent b7a36fef6a
commit e935e06e23
Notes: Henri Verbeet 2025-09-29 13:04:35 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1739
2 changed files with 11 additions and 8 deletions

View File

@@ -502,6 +502,14 @@ bool shader_instruction_array_insert_at(struct vkd3d_shader_instruction_array *a
return true;
}
struct vkd3d_shader_instruction *shader_instruction_array_append(struct vkd3d_shader_instruction_array *array)
{
if (!shader_instruction_array_insert_at(array, array->count, 1))
return NULL;
return &array->elements[array->count - 1];
}
bool vsir_program_add_icb(struct vsir_program *program, struct vkd3d_shader_immediate_constant_buffer *icb)
{
if (!vkd3d_array_reserve((void **)&program->icbs, &program->icb_capacity,