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: f532202f2d ("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>
(cherry picked from commit add14d6cfb)
This commit is contained in:
Christian Gmeiner 2023-06-05 15:32:13 +02:00 committed by Eric Engestrom
parent 2bc5c7a89a
commit 6d4a65c68f
3 changed files with 7 additions and 149 deletions

View file

@ -733,7 +733,7 @@
"description": "etnaviv: nir: do not call nir_lower_idiv(..) unconditionally",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "f532202f2d55b9ac475b7e3f8c96a4dd23489299"
},

View 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

View file

@ -1135,10 +1135,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);