diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index ed046307755..59a1e3fa77c 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -6343,10 +6343,12 @@ bifrost_compile_shader_nir(nir_shader *nir, */ NIR_PASS(_, nir, pan_nir_lower_zs_store); - info->vs.idvs = bi_should_idvs(nir, inputs); + if (nir->info.stage == MESA_SHADER_VERTEX) { + info->vs.idvs = bi_should_idvs(nir, inputs); - if (info->vs.idvs) - NIR_PASS(_, nir, bifrost_nir_lower_shader_output); + if (info->vs.idvs) + NIR_PASS(_, nir, bifrost_nir_lower_shader_output); + } bi_optimize_nir(nir, inputs->gpu_id, inputs->is_blend); @@ -6354,12 +6356,14 @@ bifrost_compile_shader_nir(nir_shader *nir, pan_nir_collect_varyings(nir, info, PAN_MEDIUMP_VARY_32BIT); - /* On Avalon, IDVS is only in one binary */ - if (info->vs.idvs && pan_arch(inputs->gpu_id) >= 12) { - bi_compile_variant(nir, inputs, binary, info, BI_IDVS_ALL); - } else if (info->vs.idvs) { - bi_compile_variant(nir, inputs, binary, info, BI_IDVS_POSITION); - bi_compile_variant(nir, inputs, binary, info, BI_IDVS_VARYING); + if (nir->info.stage == MESA_SHADER_VERTEX && info->vs.idvs) { + /* On Avalon, IDVS is only in one binary */ + if (pan_arch(inputs->gpu_id) >= 12) + bi_compile_variant(nir, inputs, binary, info, BI_IDVS_ALL); + else { + bi_compile_variant(nir, inputs, binary, info, BI_IDVS_POSITION); + bi_compile_variant(nir, inputs, binary, info, BI_IDVS_VARYING); + } } else { bi_compile_variant(nir, inputs, binary, info, BI_IDVS_NONE); }