gallivm/nir: lower implicit lod to tex.
authorDave Airlie <airlied@redhat.com>
Tue, 7 Apr 2020 23:04:50 +0000 (09:04 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 15 Apr 2020 04:26:08 +0000 (14:26 +1000)
Fixes some sampling issues in vertex shaders

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4560>

src/gallium/auxiliary/gallivm/lp_bld_nir.c

index b0ab92651571cc816f54940d39a79de25a372bb7..8336d7b2c992f9b00f38787694dafef473314a08 100644 (file)
@@ -1875,6 +1875,9 @@ void lp_build_opt_nir(struct nir_shader *nir)
       NIR_PASS_V(nir, nir_opt_constant_folding);
       NIR_PASS_V(nir, nir_opt_algebraic);
       NIR_PASS_V(nir, nir_lower_pack);
+
+      nir_lower_tex_options options = { .lower_tex_without_implicit_lod = true };
+      NIR_PASS_V(nir, nir_lower_tex, &options);
    } while (progress);
    nir_lower_bool_to_int32(nir);
 }