aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/midgard/midgard_compile.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-11-21 08:45:27 -0500
committerTomeu Vizoso <[email protected]>2019-11-22 05:07:19 +0000
commitbda2bb31b13d540ff0730fbc3e9ef5f21fdb9181 (patch)
treee52279f3d978a4eee796870cbfca2dd51aa8ae52 /src/panfrost/midgard/midgard_compile.c
parent68c2c7962a98673a2c589cc88ad19791a8d47cfd (diff)
pan/midgard: Enable LOD lowering only on buggy chips
T720 and earlier need this workaround, so check the quirk before lowering. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
Diffstat (limited to 'src/panfrost/midgard/midgard_compile.c')
-rw-r--r--src/panfrost/midgard/midgard_compile.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index cf7d15a0f9f..91cba1c1d54 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -485,7 +485,7 @@ midgard_nir_lower_fdot2(nir_shader *shader)
/* Flushes undefined values to zero */
static void
-optimise_nir(nir_shader *nir)
+optimise_nir(nir_shader *nir, unsigned quirks)
{
bool progress;
unsigned lower_flrp =
@@ -504,6 +504,11 @@ optimise_nir(nir_shader *nir)
NIR_PASS(progress, nir, nir_lower_tex, &lower_tex_options);
+ /* T720 is broken. */
+
+ if (quirks & MIDGARD_BROKEN_LOD)
+ NIR_PASS_V(nir, midgard_nir_lod_errata);
+
do {
progress = false;
@@ -2481,7 +2486,7 @@ midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_bl
/* Optimisation passes */
- optimise_nir(nir);
+ optimise_nir(nir, ctx->quirks);
if (midgard_debug & MIDGARD_DBG_SHADERS) {
nir_print_shader(nir, stdout);