diff --git a/src/panfrost/bifrost/bi_opt_push_ubo.c b/src/panfrost/bifrost/bi_opt_push_ubo.c index 80eec2f7088..e8ebc971f5d 100644 --- a/src/panfrost/bifrost/bi_opt_push_ubo.c +++ b/src/panfrost/bifrost/bi_opt_push_ubo.c @@ -128,12 +128,6 @@ bi_pick_ubo(struct panfrost_ubo_push *push, struct bi_ubo_analysis *analysis) void bi_opt_push_ubo(bi_context *ctx) { - if (ctx->inputs->no_ubo_to_push) { - /* If nothing is pushed, all UBOs need to be uploaded */ - ctx->ubo_mask = ~0; - return; - } - /* This pass only runs once */ assert(ctx->info->push.count == 0); diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 651eaf7d690..5234cc22f75 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -3576,6 +3576,10 @@ bifrost_compile_shader_nir(nir_shader *nir, ctx->stage = nir->info.stage; ctx->quirks = bifrost_get_quirks(inputs->gpu_id); ctx->arch = inputs->gpu_id >> 12; + + /* If nothing is pushed, all UBOs need to be uploaded */ + ctx->ubo_mask = ~0; + list_inithead(&ctx->blocks); /* Lower gl_Position pre-optimisation, but after lowering vars to ssa @@ -3677,7 +3681,10 @@ bifrost_compile_shader_nir(nir_shader *nir, bi_validate(ctx, "Early lowering"); /* Runs before copy prop */ - bi_opt_push_ubo(ctx); + if (!ctx->inputs->no_ubo_to_push) { + bi_opt_push_ubo(ctx); + } + bi_opt_constant_fold(ctx); bi_opt_copy_prop(ctx);