etnaviv: nir: do not call nir_lower_idiv(..) unconditionally
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Mon, 5 Jun 2023 13:32:13 +0000 (15:32 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 7 Jun 2023 19:02:36 +0000 (19:02 +0000)
GPUs without native integers lower idiv in lower_int_to_float and
there is no need to call nir_lower_idiv(..) for such GPUs.

Fixes nir crashes I am seeing with gc2000_gles2 CI job.

Fixes: f532202f2d5 ("etnaviv: use nir_lower_idiv(..) before opt loop")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23450>

src/etnaviv/ci/etnaviv-gc2000-fails.txt
src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c

index 6e52ce5..7ca6c9a 100644 (file)
@@ -139,150 +139,6 @@ dEQP-GLES2.functional.fragment_ops.random.97,Fail
 dEQP-GLES2.functional.fragment_ops.random.98,Fail
 dEQP-GLES2.functional.fragment_ops.random.9,Fail
 dEQP-GLES2.functional.rasterization.limits.points,Fail
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_int_ivec2_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_int_ivec2_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_int_ivec3_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_int_ivec3_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_int_ivec4_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_int_ivec4_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_ivec2_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_ivec2_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_ivec2_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_ivec2_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_ivec3_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_ivec3_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_ivec3_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_ivec3_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_ivec4_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_ivec4_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_ivec4_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.highp_ivec4_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_int_ivec2_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_int_ivec2_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_int_ivec3_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_int_ivec3_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_int_ivec4_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_int_ivec4_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_ivec2_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_ivec2_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_ivec2_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_ivec2_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_ivec3_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_ivec3_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_ivec3_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_ivec3_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_ivec4_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_ivec4_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_ivec4_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_ivec4_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_int_ivec2_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_int_ivec2_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_int_ivec3_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_int_ivec3_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_int_ivec4_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_int_ivec4_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_ivec2_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_ivec2_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_ivec2_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_ivec2_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_ivec3_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_ivec3_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_ivec3_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_ivec3_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_ivec4_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_ivec4_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_ivec4_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div.mediump_ivec4_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_ivec2_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_ivec2_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_ivec2_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_ivec2_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_ivec3_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_ivec3_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_ivec3_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_ivec3_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_ivec4_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_ivec4_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_ivec4_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.highp_ivec4_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_ivec2_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_ivec2_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_ivec2_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_ivec2_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_ivec3_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_ivec3_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_ivec3_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_ivec3_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_ivec4_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_ivec4_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_ivec4_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.lowp_ivec4_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_ivec2_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_ivec2_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_ivec2_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_ivec2_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_ivec3_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_ivec3_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_ivec3_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_ivec3_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_ivec4_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_ivec4_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_ivec4_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_effect.mediump_ivec4_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_ivec2_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_ivec2_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_ivec2_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_ivec2_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_ivec3_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_ivec3_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_ivec3_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_ivec3_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_ivec4_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_ivec4_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_ivec4_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.highp_ivec4_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_ivec2_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_ivec2_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_ivec2_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_ivec2_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_ivec3_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_ivec3_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_ivec3_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_ivec3_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_ivec4_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_ivec4_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_ivec4_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.lowp_ivec4_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_ivec2_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_ivec2_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_ivec2_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_ivec2_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_ivec3_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_ivec3_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_ivec3_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_ivec3_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_ivec4_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_ivec4_int_fragment,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_ivec4_int_vertex,Crash
-dEQP-GLES2.functional.shaders.operator.binary_operator.div_assign_result.mediump_ivec4_vertex,Crash
 dEQP-GLES2.functional.shaders.random.basic_expression.combined.12,Fail
 dEQP-GLES2.functional.shaders.random.basic_expression.combined.30,Fail
 dEQP-GLES2.functional.shaders.random.basic_expression.combined.63,Fail
index 9320410..1bf098e 100644 (file)
@@ -1139,10 +1139,12 @@ etna_compile_shader(struct etna_shader_variant *v)
                                           v->key.tex_swizzle);
 
    NIR_PASS_V(s, nir_lower_alu_to_scalar, etna_alu_to_scalar_filter_cb, specs);
-   nir_lower_idiv_options idiv_options = {
-      .allow_fp16 = true,
-   };
-   NIR_PASS_V(s, nir_lower_idiv, &idiv_options);
+   if (c->specs->halti >= 2) {
+      nir_lower_idiv_options idiv_options = {
+         .allow_fp16 = true,
+      };
+      NIR_PASS_V(s, nir_lower_idiv, &idiv_options);
+   }
    NIR_PASS_V(s, nir_lower_alu);
 
    etna_optimize_loop(s);