mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader/dxil: Allocate instructions directly in sm6_parser_emit_dx_binary().
This commit is contained in:
committed by
Henri Verbeet
parent
c5607e1935
commit
0fa24de3a1
Notes:
Henri Verbeet
2025-12-11 19:10:50 +01:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1865
@@ -5270,20 +5270,31 @@ static enum vkd3d_shader_opcode map_dx_binary_op(enum dx_intrinsic_opcode op,
|
||||
}
|
||||
}
|
||||
|
||||
static void sm6_parser_emit_dx_binary(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
||||
static void sm6_parser_emit_dx_binary(struct sm6_parser *dxil, enum dx_intrinsic_opcode op,
|
||||
const struct sm6_value **operands, struct function_emission_state *state)
|
||||
{
|
||||
struct vkd3d_shader_instruction *ins = state->ins;
|
||||
struct vkd3d_shader_instruction *ins;
|
||||
struct vsir_src_operand *src_params;
|
||||
uint32_t type_flags;
|
||||
|
||||
vsir_instruction_init(ins, &sm6->p.location, map_dx_binary_op(op, operands[0]->type, &type_flags));
|
||||
if (!(src_params = instruction_src_params_alloc(ins, 2, sm6)))
|
||||
if (!(ins = sm6_parser_add_function_instruction(dxil, state)))
|
||||
return;
|
||||
src_param_init_from_value(&src_params[0], operands[0], type_flags, sm6);
|
||||
src_param_init_from_value(&src_params[1], operands[1], type_flags, sm6);
|
||||
|
||||
instruction_dst_param_init_ssa_scalar(ins, type_flags, sm6);
|
||||
state->pushed_instruction = true;
|
||||
|
||||
vsir_instruction_init(ins, &dxil->p.location, map_dx_binary_op(op, operands[0]->type, &type_flags));
|
||||
|
||||
if (!(src_params = instruction_src_params_alloc(ins, 2, dxil)))
|
||||
{
|
||||
vkd3d_shader_instruction_make_nop(ins);
|
||||
return;
|
||||
}
|
||||
|
||||
src_param_init_from_value(&src_params[0], operands[0], type_flags, dxil);
|
||||
src_param_init_from_value(&src_params[1], operands[1], type_flags, dxil);
|
||||
|
||||
if (!instruction_dst_param_init_ssa_scalar(ins, type_flags, dxil))
|
||||
vkd3d_shader_instruction_make_nop(ins);
|
||||
}
|
||||
|
||||
static enum vkd3d_shader_opcode map_dx_atomic_binop(const struct sm6_value *operand, struct sm6_parser *sm6)
|
||||
|
||||
Reference in New Issue
Block a user