Module: vkd3d Branch: master Commit: e55b6a7fa1cc93e4e53bf758d231c477e9c766c1 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/e55b6a7fa1cc93e4e53bf758d231c4...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Thu Nov 16 01:14:09 2023 +0100
vkd3d-shader/hlsl: Add constants to the block for log()/log10() builtins.
---
libs/vkd3d-shader/hlsl.y | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 242e8307..c25b101a 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -3171,6 +3171,7 @@ static bool intrinsic_log(struct hlsl_ctx *ctx, /* ln(2) */ if (!(coeff = hlsl_new_float_constant(ctx, 0.69314718055f, loc))) return false; + hlsl_block_add_instr(params->instrs, coeff);
return !!add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, log, coeff, loc); } @@ -3189,6 +3190,7 @@ static bool intrinsic_log10(struct hlsl_ctx *ctx, /* 1 / log2(10) */ if (!(coeff = hlsl_new_float_constant(ctx, 0.301029996f, loc))) return false; + hlsl_block_add_instr(params->instrs, coeff);
return !!add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, log, coeff, loc); }