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_unary().
This commit is contained in:
committed by
Henri Verbeet
parent
9ddb815127
commit
8d0f82c45a
Notes:
Henri Verbeet
2025-12-04 20:17:40 +01:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1857
@@ -5206,18 +5206,27 @@ static enum vkd3d_shader_opcode map_dx_unary_op(enum dx_intrinsic_opcode op)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sm6_parser_emit_dx_unary(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
static void sm6_parser_emit_dx_unary(struct sm6_parser *dxil, enum dx_intrinsic_opcode op,
|
||||||
const struct sm6_value **operands, struct function_emission_state *state)
|
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_param;
|
struct vsir_src_operand *src_param;
|
||||||
|
|
||||||
vsir_instruction_init(ins, &sm6->p.location, map_dx_unary_op(op));
|
if (!(ins = sm6_parser_add_function_instruction(dxil, state)))
|
||||||
if (!(src_param = instruction_src_params_alloc(ins, 1, sm6)))
|
|
||||||
return;
|
return;
|
||||||
src_param_init_from_value(src_param, operands[0], 0, sm6);
|
|
||||||
|
|
||||||
instruction_dst_param_init_ssa_scalar(ins, 0, sm6);
|
state->pushed_instruction = true;
|
||||||
|
|
||||||
|
vsir_instruction_init(ins, &dxil->p.location, map_dx_unary_op(op));
|
||||||
|
if (!(src_param = instruction_src_params_alloc(ins, 1, dxil)))
|
||||||
|
{
|
||||||
|
vkd3d_shader_instruction_make_nop(ins);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
src_param_init_from_value(src_param, operands[0], 0, dxil);
|
||||||
|
|
||||||
|
if (!instruction_dst_param_init_ssa_scalar(ins, 0, dxil))
|
||||||
|
vkd3d_shader_instruction_make_nop(ins);
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum vkd3d_shader_opcode map_dx_binary_op(enum dx_intrinsic_opcode op,
|
static enum vkd3d_shader_opcode map_dx_binary_op(enum dx_intrinsic_opcode op,
|
||||||
|
|||||||
Reference in New Issue
Block a user