vkd3d-shader/ir: Introduce vsir_program_append().

To append an instruction to the end of the vsir program.
This commit is contained in:
Giovanni Mascellani
2025-07-21 21:41:16 +02:00
committed by Henri Verbeet
parent b4bf2af315
commit 0789578175
Notes: Henri Verbeet 2025-07-22 17:21:09 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1635
2 changed files with 11 additions and 6 deletions

View File

@@ -1583,6 +1583,16 @@ bool vsir_instruction_init_with_params(struct vsir_program *program,
struct vkd3d_shader_instruction *ins, const struct vkd3d_shader_location *location,
enum vkd3d_shader_opcode opcode, unsigned int dst_count, unsigned int src_count);
static inline struct vkd3d_shader_instruction *vsir_program_append(struct vsir_program *program)
{
struct vkd3d_shader_instruction_array *array = &program->instructions;
if (!shader_instruction_array_insert_at(array, array->count, 1))
return NULL;
return &array->elements[array->count - 1];
}
static inline struct vkd3d_shader_dst_param *vsir_program_get_dst_params(
struct vsir_program *program, unsigned int count)
{