Module: Mesa
Branch: main
Commit: 427ac51c10eb05a27e0c53f8195c5189ed977da7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=427ac51c10eb05a27e0c53f8195c5189ed977da7

Author: Roland Scheidegger <[email protected]>
Date:   Sat Feb 18 17:11:04 2023 +0100

llvmpipe: only use accurate_a0 hack if there are no textures bound

This hack caused problems with some dx9 tests before (due to mipgen
test using nearest filter sampling with tex coords exactly between two
texels hence being extremely sensitive to arithmetic inaccuracies),
and we can no longer distinguish this by using pixel_offset to not get
it enabled. But to pass other tests we don't really need the hack when
there's texture sampling involved anyway.

Reviewed-by: Jose Fonseca <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21407>

---

 src/gallium/drivers/llvmpipe/lp_setup_tri.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c 
b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 45553da0e38..97384962664 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -394,7 +394,8 @@ do_triangle_ccw(struct lp_setup_context *setup,
        setup->pixel_offset == 0.5f &&
        key->num_inputs == 1 &&
        (key->inputs[0].interp == LP_INTERP_LINEAR ||
-        key->inputs[0].interp == LP_INTERP_PERSPECTIVE)) {
+        key->inputs[0].interp == LP_INTERP_PERSPECTIVE) &&
+        setup->fs.current_tex_num == 0) {
       float dist0 = v0[0][0] * v0[0][0] + v0[0][1] * v0[0][1];
       float dist1 = v1[0][0] * v1[0][0] + v1[0][1] * v1[0][1];
       float dist2 = v2[0][0] * v2[0][0] + v2[0][1] * v2[0][1];

Reply via email to