summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2018-10-21 11:29:37 -0700
committerChristian Gmeiner <[email protected]>2018-10-22 20:37:07 +0200
commite0c267c7521acfa7923bf13b2ac769eac6e13230 (patch)
treea3a88f4817c5286f9d69691df24e943803cb29e9 /src
parent4e785fb383eaa80e7def0d639eddefb781ec3f4f (diff)
mesa/st: Only call nir_lower_io_to_scalar_early on scalar ISAs
On scalar ISAs, nir_lower_io_to_scalar_early enables significant optimizations. However, on vector ISAs, it is counterproductive and impedes optimal codegen. This patch only calls nir_lower_io_to_scalar_early for scalar ISAs. It appears that at present there are no upstreamed drivers using Gallium, NIR, and a vector ISA, so for existing code, this should be a no-op. However, this patch is necessary for the upcoming Panfrost (Midgard) and Lima (Utgard) compilers, which are vector. With this patch, Panfrost is able to consume NIR directly, rather than TGSI with the TGSI->NIR conversion. For how this affects Lima, see https://www.mail-archive.com/[email protected]/msg189216.html Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_nir.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 24776f7f9c4..911284401e0 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -665,7 +665,10 @@ st_link_nir(struct gl_context *ctx,
mask = (nir_variable_mode)(mask | nir_var_shader_out);
nir_shader *nir = shader->Program->nir;
- NIR_PASS_V(nir, nir_lower_io_to_scalar_early, mask);
+
+ if (is_scalar[i])
+ NIR_PASS_V(nir, nir_lower_io_to_scalar_early, mask);
+
st_nir_opts(nir, is_scalar[i]);
}