diff --git a/src/panfrost/compiler/bifrost/bifrost_compile.c b/src/panfrost/compiler/bifrost/bifrost_compile.c index 24c4485d88b..3812e558486 100644 --- a/src/panfrost/compiler/bifrost/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost/bifrost_compile.c @@ -7059,7 +7059,7 @@ bifrost_compile_shader_nir(nir_shader *nir, info->tls_size = nir->scratch_size; info->stage = nir->info.stage; - pan_nir_collect_varyings(nir, info, PAN_MEDIUMP_VARY_32BIT); + pan_nir_collect_varyings(nir, info); if (nir->info.stage == MESA_SHADER_VERTEX && info->vs.idvs) { /* On 5th Gen, IDVS is only in one binary */ diff --git a/src/panfrost/compiler/midgard/midgard_compile.c b/src/panfrost/compiler/midgard/midgard_compile.c index 9e2d89066b3..d2d31a1eac6 100644 --- a/src/panfrost/compiler/midgard/midgard_compile.c +++ b/src/panfrost/compiler/midgard/midgard_compile.c @@ -2982,7 +2982,7 @@ midgard_compile_shader_nir(nir_shader *nir, /* Collect varyings after lowering I/O */ info->quirk_no_auto32 = (ctx->quirks & MIDGARD_NO_AUTO32); - pan_nir_collect_varyings(nir, info, PAN_MEDIUMP_VARY_SMOOTH_16BIT); + pan_nir_collect_varyings(nir, info); /* Optimisation passes */ optimise_nir(nir, ctx->quirks, inputs->is_blend); diff --git a/src/panfrost/compiler/pan_nir.h b/src/panfrost/compiler/pan_nir.h index 32b7ebbb4c9..3f08686492b 100644 --- a/src/panfrost/compiler/pan_nir.h +++ b/src/panfrost/compiler/pan_nir.h @@ -82,16 +82,6 @@ bool pan_nir_lower_fs_outputs(nir_shader *shader, bool skip_atest); uint32_t pan_nir_collect_noperspective_varyings_fs(nir_shader *s); -/* Specify the mediump lowering behavior for pan_nir_collect_varyings */ -enum pan_mediump_vary { - /* Always assign a 32-bit format to mediump varyings */ - PAN_MEDIUMP_VARY_32BIT, - /* Assign a 16-bit format to varyings with smooth interpolation, and a - * 32-bit format to varyings with flat interpolation */ - PAN_MEDIUMP_VARY_SMOOTH_16BIT, -}; - -void pan_nir_collect_varyings(nir_shader *s, struct pan_shader_info *info, - enum pan_mediump_vary mediump); +void pan_nir_collect_varyings(nir_shader *s, struct pan_shader_info *info); #endif /* __PAN_NIR_H__ */ diff --git a/src/panfrost/compiler/pan_nir_collect_varyings.c b/src/panfrost/compiler/pan_nir_collect_varyings.c index adef29b55e5..8862c1147ae 100644 --- a/src/panfrost/compiler/pan_nir_collect_varyings.c +++ b/src/panfrost/compiler/pan_nir_collect_varyings.c @@ -51,7 +51,6 @@ struct slot_info { }; struct walk_varyings_data { - enum pan_mediump_vary mediump; struct pan_shader_info *info; struct slot_info *slots; }; @@ -112,19 +111,6 @@ walk_varyings(UNUSED nir_builder *b, nir_instr *instr, void *data) bool auto32 = !info->quirk_no_auto32 && size == 32; nir_alu_type type = (flat && auto32) ? nir_type_uint : nir_type_float; - if (sem.medium_precision) { - /* Demote interpolated float varyings to fp16 where possible. We do not - * demote flat varyings, including integer varyings, due to various - * issues with the Midgard hardware behaviour and TGSI shaders, as well - * as having no demonstrable benefit in practice. - */ - if (wv_data->mediump == PAN_MEDIUMP_VARY_SMOOTH_16BIT) - size = type == nir_type_float ? 16 : 32; - - if (wv_data->mediump == PAN_MEDIUMP_VARY_32BIT) - size = 32; - } - assert(size == 32 || size == 16); type |= size; @@ -191,15 +177,14 @@ pan_nir_collect_noperspective_varyings_fs(nir_shader *s) } void -pan_nir_collect_varyings(nir_shader *s, struct pan_shader_info *info, - enum pan_mediump_vary mediump) +pan_nir_collect_varyings(nir_shader *s, struct pan_shader_info *info) { if (s->info.stage != MESA_SHADER_VERTEX && s->info.stage != MESA_SHADER_FRAGMENT) return; struct slot_info slots[64] = {0}; - struct walk_varyings_data wv_data = {mediump, info, slots}; + struct walk_varyings_data wv_data = {info, slots}; nir_shader_instructions_pass(s, walk_varyings, nir_metadata_all, &wv_data); struct pan_shader_varying *varyings = (s->info.stage == MESA_SHADER_VERTEX)