From add14d6cfb6b2aa666c7dbe2bbe43a8926d62d34 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Mon, 5 Jun 2023 15:32:13 +0200 Subject: [PATCH] etnaviv: nir: do not call nir_lower_idiv(..) unconditionally 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 Reviewed-by: Emma Anholt Part-of: --- src/etnaviv/ci/etnaviv-gc2000-fails.txt | 144 ------------------ .../drivers/etnaviv/etnaviv_compiler_nir.c | 10 +- 2 files changed, 6 insertions(+), 148 deletions(-) diff --git a/src/etnaviv/ci/etnaviv-gc2000-fails.txt b/src/etnaviv/ci/etnaviv-gc2000-fails.txt index 6e52ce50a55..7ca6c9a320d 100644 --- a/src/etnaviv/ci/etnaviv-gc2000-fails.txt +++ b/src/etnaviv/ci/etnaviv-gc2000-fails.txt @@ -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 diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c index 93204103838..1bf098ee572 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c @@ -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);