radeonsi: Use TRUNC_COORD on samplers
authorJoshua Ashton <joshua@froggi.es>
Wed, 22 Apr 2020 04:30:36 +0000 (05:30 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 15 May 2020 21:56:44 +0000 (21:56 +0000)
commitd573d1d82524b8a2e5f56938069cabc0f0176a0e
tree184eb58842014826f37fb8453cfe30eb125764e6
parent65c2362e88578575899bd208713d87b1206ad360
radeonsi: Use TRUNC_COORD on samplers

The default behaviour (0) is: "round-nearest-even to n.6 and drop fraction when point sampling" whereas the OpenGL spec simply wants us to floor it (1) "truncate when point sampling".
See 8.14.2 in the OpenGL spec:

https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf

The Direct3D spec also mandates this (https://microsoft.github.io/DirectX-Specs/d3d/archive/D3D11_3_FunctionalSpec.htm#7.18.7%20Point%20Sample%20Addressing)

On WineD3D:
This fixes some point-sampling texture precision issues in some Direct3D 9 titles such as Guild Wars 2 and htoL#NiQ: The Firefly Diary that are not present on other vendors.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3953>
src/gallium/drivers/radeonsi/si_state.c