gallivm/sample: always square rho before fast log2
authorDave Airlie <airlied@redhat.com>
Tue, 14 Apr 2020 05:28:05 +0000 (15:28 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 15 Jul 2020 19:46:57 +0000 (05:46 +1000)
commit75e01d01a53bab40b468897e08b144a1393e1013
treec369b3e21d884a6d238a6252bef3d3723b3c967f
parenta9c94861063d16bd6f1f71b4dda7ddd1d3438313
gallivm/sample: always square rho before fast log2

The fast log2 works better if rho is squared, i.e.

fast_log2(sqrt(2)) == 0.4
0.5 * fast_log2(2) == 0.5

so just square rho, and always divide by 2 afterwards.

Fixes:
GTF-GL45.gtf30.GL3Tests.sgis_texture_lod.sgis_texture_lod_basic_lod_selection

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5820>
.gitlab-ci/deqp-llvmpipe-fails.txt
.gitlab-ci/deqp-virgl-gl-fails.txt
src/gallium/auxiliary/gallivm/lp_bld_sample.c