vkd3d-shader/hlsl: Use add_unary_arithmetic_expr() in intrinsic_pow().

Using add_unary_arithmetic_expr() instead of hlsl_new_unary_expr()
allows the intrinsic to work with matrices.

Otherwise we get:

E5017: Aborting due to not yet implemented feature: Copying from unsupported node type.

because an HLSL_IR_EXPR reaches split_matrix_copies().
This commit is contained in:
Francisco Casas 2022-11-07 19:20:01 -03:00 committed by Alexandre Julliard
parent 6770ecbdf4
commit 5b1030e0cb
Notes: Alexandre Julliard 2023-01-11 22:39:00 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
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/53
2 changed files with 6 additions and 7 deletions

View File

@ -2661,16 +2661,15 @@ static bool intrinsic_pow(struct hlsl_ctx *ctx,
if (!elementwise_intrinsic_float_convert_args(ctx, params, loc)) if (!elementwise_intrinsic_float_convert_args(ctx, params, loc))
return false; return false;
if (!(log = hlsl_new_unary_expr(ctx, HLSL_OP1_LOG2, params->args[0], *loc))) if (!(log = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_LOG2, params->args[0], loc)))
return false; return false;
list_add_tail(params->instrs, &log->entry);
if (!(mul = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, params->args[1], log, loc))) if (!(mul = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, params->args[1], log, loc)))
return false; return false;
if (!(exp = hlsl_new_unary_expr(ctx, HLSL_OP1_EXP2, mul, *loc))) if (!(exp = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_EXP2, mul, loc)))
return false; return false;
list_add_tail(params->instrs, &exp->entry);
return true; return true;
} }

View File

@ -10,7 +10,7 @@ draw quad
probe all rgba (0.512, 0.101192884, 0.64, 0.25) 4 probe all rgba (0.512, 0.101192884, 0.64, 0.25) 4
[pixel shader todo] [pixel shader]
float4 main() : sv_target float4 main() : sv_target
{ {
float2x3 a = {1, 2, 3, 4, 5, 6}; float2x3 a = {1, 2, 3, 4, 5, 6};
@ -21,8 +21,8 @@ float4 main() : sv_target
} }
[test] [test]
todo draw quad draw quad
todo probe all rgba (1.0, 32.0, 256.0, 125.0) probe all rgba (1.0, 32.0, 256.0, 125.0) 2
[pixel shader fail] [pixel shader fail]