mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Parse the abs() intrinsic.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@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
75a1a24d63
commit
c5e50ae658
@@ -1555,6 +1555,14 @@ static const struct hlsl_ir_function_decl *find_function_call(struct hlsl_ctx *c
|
||||
return args.decl;
|
||||
}
|
||||
|
||||
static bool intrinsic_abs(struct hlsl_ctx *ctx,
|
||||
const struct parse_initializer *params, struct vkd3d_shader_location loc)
|
||||
{
|
||||
struct hlsl_ir_node *args[3] = {params->args[0]};
|
||||
|
||||
return !!add_expr(ctx, params->instrs, HLSL_OP1_ABS, args, &loc);
|
||||
}
|
||||
|
||||
static bool intrinsic_clamp(struct hlsl_ctx *ctx,
|
||||
const struct parse_initializer *params, struct vkd3d_shader_location loc)
|
||||
{
|
||||
@@ -1594,6 +1602,7 @@ static const struct intrinsic_function
|
||||
}
|
||||
intrinsic_functions[] =
|
||||
{
|
||||
{"abs", 1, true, intrinsic_abs},
|
||||
{"clamp", 3, true, intrinsic_clamp},
|
||||
{"max", 2, true, intrinsic_max},
|
||||
{"saturate", 1, true, intrinsic_saturate},
|
||||
|
||||
Reference in New Issue
Block a user