gallivm: use lp_build_log2_safe for pow
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 27 Jul 2021 12:28:44 +0000 (14:28 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 5 Aug 2021 17:18:57 +0000 (17:18 +0000)
lp_build_log2 isn't robust enough to handle special cases for pow, so
let's use lp_build_log2_safe instead.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11800>

src/gallium/auxiliary/gallivm/lp_bld_arit.c
src/gallium/drivers/llvmpipe/ci/traces-llvmpipe.yml
src/gallium/frontends/lavapipe/ci/deqp-lvp-fails.txt

index 96ba8c0..14fda8d 100644 (file)
@@ -3043,7 +3043,7 @@ lp_build_pow(struct lp_build_context *bld,
    }
 
    LLVMValueRef cmp = lp_build_cmp(bld, PIPE_FUNC_EQUAL, x, lp_build_const_vec(bld->gallivm, bld->type, 0.0f));
-   LLVMValueRef res = lp_build_exp2(bld, lp_build_mul(bld, lp_build_log2(bld, x), y));
+   LLVMValueRef res = lp_build_exp2(bld, lp_build_mul(bld, lp_build_log2_safe(bld, x), y));
 
    res = lp_build_select(bld, cmp, lp_build_const_vec(bld->gallivm, bld->type, 0.0f), res);
    return res;
index 54869e7..3fbd5eb 100644 (file)
@@ -73,7 +73,7 @@ traces:
   - path: bgfx/07-callback.rdc
     expectations:
       - device: gl-vmware-llvmpipe
-        checksum: 77381f3eb028306e028ab54267a1926a
+        checksum: 488d471efb84824f2d4be1c75e455881
   - path: bgfx/09-hdr.rdc
     expectations:
       - device: gl-vmware-llvmpipe
index a4c5846..a1023dd 100644 (file)
@@ -28,9 +28,6 @@ dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.2d.r8g8b8a8_unorm.r1
 dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.2d.r8g8b8a8_unorm.r16g16b16a16_unorm.optimal_general_linear,Fail
 dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.2d.r8g8b8a8_unorm.r16g16b16a16_unorm.optimal_linear_linear,Fail
 dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.ctimeolor.2d.a8b8g8r8_unorm_pack32.r16_unorm.general_optimal_linear,Fail
-dEQP-VK.glsl.builtin.precision.pow.highp.vec2,Fail
-dEQP-VK.glsl.builtin.precision.pow.highp.vec3,Fail
-dEQP-VK.glsl.builtin.precision.pow.highp.vec4,Fail
 dEQP-VK.glsl.texture_functions.query.texturequerylod.isampler2d_fragment,Fail
 dEQP-VK.glsl.texture_functions.query.texturequerylod.sampler1d_fixed_fragment,Fail
 dEQP-VK.glsl.texture_functions.query.texturequerylod.sampler1darray_float_fragment,Fail