pan/bi: Make bi_opt_push_ubo optional

It's an optimization pass -- omitting it should not cause MMU faults
(!). Make sure the UBO push mask is set regardless of whether the pass
is called, and just call the pass when required.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12328>
This commit is contained in:
Alyssa Rosenzweig
2021-08-11 10:03:13 -04:00
committed by Marge Bot
parent 01b0935d31
commit ff03f096bf
2 changed files with 8 additions and 7 deletions
-6
View File
@@ -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);
+8 -1
View File
@@ -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);