Mesa (master): zink: run nir_lower_tex for offsets if shaderImageGatherExtended is missing

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 4 16:00:01 UTC 2021


Module: Mesa
Branch: master
Commit: 6bbd7cc370fb0b545eee7b79455b9e5940a40255
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6bbd7cc370fb0b545eee7b79455b9e5940a40255

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Dec 24 10:38:15 2020 -0500

zink: run nir_lower_tex for offsets if shaderImageGatherExtended is missing

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8151>

---

 src/gallium/drivers/zink/zink_compiler.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c
index 76e5ed590e7..7e5c9532574 100644
--- a/src/gallium/drivers/zink/zink_compiler.c
+++ b/src/gallium/drivers/zink/zink_compiler.c
@@ -404,6 +404,13 @@ zink_shader_create(struct zink_screen *screen, struct nir_shader *nir,
    ret->shader_id = p_atomic_inc_return(&screen->shader_id);
    ret->programs = _mesa_pointer_set_create(NULL);
 
+   if (!screen->info.feats.features.shaderImageGatherExtended) {
+      nir_lower_tex_options tex_opts = {};
+      tex_opts.lower_tg4_offsets = true;
+      tex_opts.lower_txf_offset = true;
+      NIR_PASS_V(nir, nir_lower_tex, &tex_opts);
+   }
+
    /* only do uniforms -> ubo if we have uniforms, otherwise we're just
     * screwing with the bindings for no reason
     */



More information about the mesa-commit mailing list