spirv: Add 0.5 to integer coordinates for OpImageSampleExplicitLod
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 1 Sep 2020 00:33:51 +0000 (19:33 -0500)
committerKarol Herbst <kherbst@redhat.com>
Tue, 20 Oct 2020 21:46:42 +0000 (23:46 +0200)
commit589d918a4f9da83e3ae441aa674372a141d23349
tree6e12e8f9c306e2cbceac80879debdb9c9ca52033
parent2015a109ff287cdf04607d5acc540aae2e87daa3
spirv: Add 0.5 to integer coordinates for OpImageSampleExplicitLod

Just casting to a float is insufficient because that gives us the upper-left corner
of the texel rather than the center.

Fixes: 701cb9d60c03 "nir/vtn: Handle integer sampling coordinates"

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
src/compiler/spirv/spirv_to_nir.c