mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/hlsl: Support exp2() intrinsic.
This commit is contained in:
committed by
Alexandre Julliard
parent
fa971f32bc
commit
8ca2f65bc1
Notes:
Alexandre Julliard
2023-01-26 23:11:43 +01:00
Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/72
@@ -2491,6 +2491,17 @@ static bool intrinsic_dot(struct hlsl_ctx *ctx,
|
|||||||
return !!add_binary_dot_expr(ctx, params->instrs, params->args[0], params->args[1], loc);
|
return !!add_binary_dot_expr(ctx, params->instrs, params->args[0], params->args[1], loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool intrinsic_exp2(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[0], loc)))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return !!add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_EXP2, arg, loc);
|
||||||
|
}
|
||||||
|
|
||||||
static bool intrinsic_floor(struct hlsl_ctx *ctx,
|
static bool intrinsic_floor(struct hlsl_ctx *ctx,
|
||||||
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
|
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
|
||||||
{
|
{
|
||||||
@@ -2932,6 +2943,7 @@ intrinsic_functions[] =
|
|||||||
{"cos", 1, true, intrinsic_cos},
|
{"cos", 1, true, intrinsic_cos},
|
||||||
{"cross", 2, true, intrinsic_cross},
|
{"cross", 2, true, intrinsic_cross},
|
||||||
{"dot", 2, true, intrinsic_dot},
|
{"dot", 2, true, intrinsic_dot},
|
||||||
|
{"exp2", 1, true, intrinsic_exp2},
|
||||||
{"floor", 1, true, intrinsic_floor},
|
{"floor", 1, true, intrinsic_floor},
|
||||||
{"frac", 1, true, intrinsic_frac},
|
{"frac", 1, true, intrinsic_frac},
|
||||||
{"ldexp", 2, true, intrinsic_ldexp},
|
{"ldexp", 2, true, intrinsic_ldexp},
|
||||||
|
Reference in New Issue
Block a user