[Mesa-dev] Low interpolation precision for 8 bit textures using llvmpipe
Dominik Drees
dominik.drees at wwu.de
Thu Apr 11 16:00:36 UTC 2019
Running with the suggested flags in the environment does not change the
result for the test case I described below. The results with and without
the environment variables set are pixel-wise equal.
By the way, and if this of interest: For GL_NEAREST sampling the results
from hardware and llvmpipe are equal as well.
Best,
Dominik
On 4/11/19 4:36 PM, Ilia Mirkin wrote:
> llvmpipe takes a number of shortcuts in the interest of speed which
> cause inaccurate texturing. Try running with
>
> GALLIVM_DEBUG=no_rho_approx,no_brilinear,no_quad_lod
>
> and see if the issue still occurs.
>
> Cheers,
>
> -ilia
>
>
>
> On Thu, Apr 11, 2019 at 8:30 AM Dominik Drees <dominik.drees at wwu.de> wrote:
>>
>> Hello, everyone!
>>
>> I have a question regarding the interpolation precision of llvmpipe.
>> Feel free to redirect me to somewhere else if this is not the right
>> place to ask. Consider the following scenario: In a fragment shader we
>> are sampling from a 16x16, 8 bit texture with values between 0 and 3
>> using linear interpolation. Then we write white to the screen if the
>> sampled value is > 1/255 and black otherwise. The output looks very
>> different when rendered with llvmpipe compared to the result produced by
>> rendering hardware (for both intel (mesa i965) and nvidia (proprietary
>> driver)).
>>
>> I've uploaded examplary output images here (https://imgur.com/a/D1udpez)
>> and the corresponding fragment shader here (https://pastebin.com/pa808Req).
>>
>> My hypothesis is that llvmpipe (in contrast to hardware) only uses 8 bit
>> for the interpolation computation when reading from 8 bit textures and
>> thus loses precision in the lower bits. Is that correct? If so, does
>> anyone know of a workaround?
>>
>> A little bit of background about the use case: We are trying to move the
>> CI of Voreen (https://www.uni-muenster.de/Voreen/) to the Gitlab-CI
>> running in docker without any hardware dependencies. Using llvmpipe for
>> our regression tests works in principle, but shows significant
>> differences in the raycasting rendering of an 8-bit-per-voxel dataset.
>> (The effect is of course less visible than the constructed example case
>> linked above, but still quite noticeable for a human.)
>>
>> Any help or pointers would be appreciated!
>>
>> Best,
>> Dominik
>>
>> --
>> Dominik Drees
>>
>> Department of Computer Science
>> Westfaelische Wilhelms-Universitaet Muenster
>>
>> email: dominik.drees at wwu.de
>> web: https://www.wwu.de/PRIA/personen/drees.shtml
>> phone: +49 251 83 - 38448
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
--
Dominik Drees
Department of Computer Science
Westfaelische Wilhelms-Universitaet Muenster
email: dominik.drees at wwu.de
web: https://www.wwu.de/PRIA/personen/drees.shtml
phone: +49 251 83 - 38448
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5572 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190411/ea957497/attachment-0001.bin>
More information about the mesa-dev
mailing list