From 1ee42bd406754964f2d4fc82e090326b52df94ea Mon Sep 17 00:00:00 2001 From: Francisco Casas Date: Wed, 13 Aug 2025 18:17:45 -0400 Subject: [PATCH] vkd3d-shader/dxil: Use vsir_program_append() in sm6_parser_add_instruction(). --- libs/vkd3d-shader/dxil.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 5fe5eac22..6e9192169 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -3665,14 +3665,15 @@ static struct vkd3d_shader_instruction *sm6_parser_require_space(struct sm6_pars return &instructions->elements[instructions->count]; } -/* Space should be reserved before calling this. It is intended to require no checking of the returned pointer. */ static struct vkd3d_shader_instruction *sm6_parser_add_instruction(struct sm6_parser *sm6, - enum vkd3d_shader_opcode handler_idx) + enum vkd3d_shader_opcode op) { - struct vkd3d_shader_instruction *ins = sm6_parser_require_space(sm6, 1); - VKD3D_ASSERT(ins); - vsir_instruction_init(ins, &sm6->p.location, handler_idx); - ++sm6->program->instructions.count; + struct vkd3d_shader_instruction *ins; + + if (!(ins = vsir_program_append(sm6->program))) + return NULL; + vsir_instruction_init(ins, &sm6->p.location, op); + return ins; }