mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/hlsl: Parse the ldexp() intrinsic.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
c7198bc964
commit
bb32ffad18
@@ -2095,6 +2095,20 @@ static bool intrinsic_floor(struct hlsl_ctx *ctx,
|
||||
return !!add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_FLOOR, arg, loc);
|
||||
}
|
||||
|
||||
static bool intrinsic_ldexp(struct hlsl_ctx *ctx,
|
||||
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
|
||||
{
|
||||
struct hlsl_ir_node *arg;
|
||||
|
||||
if (!(arg = intrinsic_float_convert_arg(ctx, params, params->args[1], loc)))
|
||||
return false;
|
||||
|
||||
if (!(arg = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_EXP2, arg, loc)))
|
||||
return false;
|
||||
|
||||
return !!add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, params->args[0], arg, loc);
|
||||
}
|
||||
|
||||
static bool intrinsic_max(struct hlsl_ctx *ctx,
|
||||
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
|
||||
{
|
||||
@@ -2283,6 +2297,7 @@ intrinsic_functions[] =
|
||||
{"cross", 2, true, intrinsic_cross},
|
||||
{"dot", 2, true, intrinsic_dot},
|
||||
{"floor", 1, true, intrinsic_floor},
|
||||
{"ldexp", 2, true, intrinsic_ldexp},
|
||||
{"max", 2, true, intrinsic_max},
|
||||
{"min", 2, true, intrinsic_min},
|
||||
{"mul", 2, true, intrinsic_mul},
|
||||
|
Reference in New Issue
Block a user