mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/dxil: Implement DX intrinsic FAbs.
This commit is contained in:
committed by
Alexandre Julliard
parent
33694f08fc
commit
4599d3c1cf
Notes:
Alexandre Julliard
2024-03-18 23:25:32 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/718
@@ -342,6 +342,7 @@ enum dx_intrinsic_opcode
|
||||
{
|
||||
DX_LOAD_INPUT = 4,
|
||||
DX_STORE_OUTPUT = 5,
|
||||
DX_FABS = 6,
|
||||
DX_ISNAN = 8,
|
||||
DX_ISINF = 9,
|
||||
DX_ISFINITE = 10,
|
||||
@@ -4267,6 +4268,21 @@ static void sm6_parser_emit_dx_create_handle(struct sm6_parser *sm6, enum dx_int
|
||||
ins->handler_idx = VKD3DSIH_NOP;
|
||||
}
|
||||
|
||||
static void sm6_parser_emit_dx_fabs(struct sm6_parser *sm6, 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_src_param *src_param;
|
||||
|
||||
vsir_instruction_init(ins, &sm6->p.location, VKD3DSIH_MOV);
|
||||
if (!(src_param = instruction_src_params_alloc(ins, 1, sm6)))
|
||||
return;
|
||||
src_param_init_from_value(src_param, operands[0]);
|
||||
src_param->modifiers = VKD3DSPSM_ABS;
|
||||
|
||||
instruction_dst_param_init_ssa_scalar(ins, sm6);
|
||||
}
|
||||
|
||||
static enum vkd3d_shader_opcode sm6_dx_map_ma_op(enum dx_intrinsic_opcode op, const struct sm6_type *type)
|
||||
{
|
||||
switch (op)
|
||||
@@ -5051,6 +5067,7 @@ static const struct sm6_dx_opcode_info sm6_dx_op_table[] =
|
||||
[DX_DERIV_FINEX ] = {"e", "R", sm6_parser_emit_dx_unary},
|
||||
[DX_DERIV_FINEY ] = {"e", "R", sm6_parser_emit_dx_unary},
|
||||
[DX_EXP ] = {"g", "R", sm6_parser_emit_dx_unary},
|
||||
[DX_FABS ] = {"g", "R", sm6_parser_emit_dx_fabs},
|
||||
[DX_FIRST_BIT_HI ] = {"i", "m", sm6_parser_emit_dx_unary},
|
||||
[DX_FIRST_BIT_LO ] = {"i", "m", sm6_parser_emit_dx_unary},
|
||||
[DX_FIRST_BIT_SHI ] = {"i", "m", sm6_parser_emit_dx_unary},
|
||||
|
Reference in New Issue
Block a user