vkd3d-shader/dxil: Allocate instructions directly in sm6_parser_emit_dx_dot().

This commit is contained in:
Giovanni Mascellani
2025-12-04 14:16:11 +01:00
committed by Henri Verbeet
parent 10449755a3
commit 52bae288c5
Notes: Henri Verbeet 2025-12-10 16:12:08 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1864

View File

@@ -5746,7 +5746,7 @@ static void sm6_parser_emit_dx_domain_location(struct sm6_parser *dxil, enum dx_
vkd3d_shader_instruction_make_nop(ins);
}
static void sm6_parser_emit_dx_dot(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
static void sm6_parser_emit_dx_dot(struct sm6_parser *dxil, enum dx_intrinsic_opcode op,
const struct sm6_value **operands, struct function_emission_state *state)
{
struct vkd3d_shader_instruction *ins;
@@ -5773,19 +5773,29 @@ static void sm6_parser_emit_dx_dot(struct sm6_parser *sm6, enum dx_intrinsic_opc
vkd3d_unreachable();
}
if (!sm6_parser_emit_composite_construct(sm6, &operands[0], component_count, state, &regs[0]))
if (!sm6_parser_emit_composite_construct(dxil, &operands[0], component_count, state, &regs[0]))
return;
if (!sm6_parser_emit_composite_construct(sm6, &operands[component_count], component_count, state, &regs[1]))
if (!sm6_parser_emit_composite_construct(dxil, &operands[component_count], component_count, state, &regs[1]))
return;
ins = state->ins;
vsir_instruction_init(ins, &sm6->p.location, opcode);
if (!(src_params = instruction_src_params_alloc(ins, 2, sm6)))
if (!(ins = sm6_parser_add_function_instruction(dxil, state)))
return;
state->pushed_instruction = true;
vsir_instruction_init(ins, &dxil->p.location, opcode);
if (!(src_params = instruction_src_params_alloc(ins, 2, dxil)))
{
vkd3d_shader_instruction_make_nop(ins);
return;
}
src_param_init_vector_from_reg(&src_params[0], &regs[0]);
src_param_init_vector_from_reg(&src_params[1], &regs[1]);
instruction_dst_param_init_ssa_scalar(ins, 0, sm6);
if (!instruction_dst_param_init_ssa_scalar(ins, 0, dxil))
vkd3d_shader_instruction_make_nop(ins);
}
static void sm6_parser_emit_dx_eval_attrib(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,