From 3058958d8b601479c51c655d891e0fd156c6025a Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Tue, 25 Nov 2025 23:34:41 +0100 Subject: [PATCH] vkd3d-shader/dxil: Allocate instructions directly in sm6_parser_emit_atomicrmw(). --- libs/vkd3d-shader/dxil.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index b68e1fac8..5bf09ac90 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -4648,12 +4648,18 @@ static void sm6_parser_emit_atomicrmw(struct sm6_parser *sm6, struct function_em return; } - ins = state->ins; + if (!(ins = sm6_parser_add_function_instruction(sm6, state))) + return; + state->pushed_instruction = true; + vsir_instruction_init(ins, &sm6->p.location, op); ins->flags = is_volatile ? VKD3DARF_VOLATILE : 0; if (!(src_params = instruction_src_params_alloc(ins, 2, sm6))) + { + vkd3d_shader_instruction_make_nop(ins); return; + } if (ptr->structure_stride) src_param_init_vector_from_reg(&src_params[0], &coord); else @@ -4663,7 +4669,10 @@ static void sm6_parser_emit_atomicrmw(struct sm6_parser *sm6, struct function_em sm6_parser_init_ssa_value(sm6, dst); if (!(dst_params = instruction_dst_params_alloc(ins, 2, sm6))) + { + vkd3d_shader_instruction_make_nop(ins); return; + } vsir_register_from_dxil_value(&dst_params[0].reg, dst, 0, sm6); dst_param_init(&dst_params[0]);