From: Francisco Casas fcasas@codeweavers.com
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(). --- libs/vkd3d-shader/hlsl.y | 7 +++---- tests/pow.shader_test | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 91daa482..8f3b1c90 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2633,16 +2633,15 @@ static bool intrinsic_pow(struct hlsl_ctx *ctx, if (!elementwise_intrinsic_convert_args(ctx, params, true, loc)) 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; - list_add_tail(params->instrs, &log->entry);
if (!(mul = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, params->args[1], log, loc))) 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; - list_add_tail(params->instrs, &exp->entry); + return true; }
diff --git a/tests/pow.shader_test b/tests/pow.shader_test index 0c1d7de3..1bb3bd94 100644 --- a/tests/pow.shader_test +++ b/tests/pow.shader_test @@ -10,7 +10,7 @@ draw quad probe all rgba (0.512, 0.101192884, 0.64, 0.25) 4
-[pixel shader todo] +[pixel shader] float4 main() : sv_target { float2x3 a = {1, 2, 3, 4, 5, 6}; @@ -21,8 +21,8 @@ float4 main() : sv_target }
[test] -todo draw quad -todo probe all rgba (1.0, 32.0, 256.0, 125.0) +draw quad +probe all rgba (1.0, 32.0, 256.0, 125.0) 2
[pixel shader fail]