From 92d9f090d9faa83a6f3215682f6b7a5a6844b160 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 5 Mar 2021 13:18:03 +0100 Subject: [PATCH] panfrost: Add a knob to disable the UBO -> push constants optimization I'm just too lazy to implement the logic to prepare push constant buffers in the Vulkan driver. Besides, Vulkan has explicit push constants, which AFAIK is not handled in the compiler backends yet, and that will probably conflict with the UBO -> push constant promotion. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_opt_push_ubo.c | 3 +++ src/panfrost/midgard/mir_promote_uniforms.c | 3 +++ src/panfrost/util/pan_ir.h | 1 + 3 files changed, 7 insertions(+) diff --git a/src/panfrost/bifrost/bi_opt_push_ubo.c b/src/panfrost/bifrost/bi_opt_push_ubo.c index 9442315b213..8debdd486fd 100644 --- a/src/panfrost/bifrost/bi_opt_push_ubo.c +++ b/src/panfrost/bifrost/bi_opt_push_ubo.c @@ -118,6 +118,9 @@ 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) + return; + /* This pass only runs once */ assert(ctx->info->push.count == 0); diff --git a/src/panfrost/midgard/mir_promote_uniforms.c b/src/panfrost/midgard/mir_promote_uniforms.c index aead024130d..6a02eaadd15 100644 --- a/src/panfrost/midgard/mir_promote_uniforms.c +++ b/src/panfrost/midgard/mir_promote_uniforms.c @@ -258,6 +258,9 @@ mir_special_indices(compiler_context *ctx) void midgard_promote_uniforms(compiler_context *ctx) { + if (ctx->inputs->no_ubo_to_push) + return; + struct mir_ubo_analysis analysis = mir_analyze_ranges(ctx); unsigned work_count = mir_work_heuristic(ctx, &analysis); diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h index 5705d3b4121..37bf877cb21 100644 --- a/src/panfrost/util/pan_ir.h +++ b/src/panfrost/util/pan_ir.h @@ -126,6 +126,7 @@ struct panfrost_compile_inputs { uint64_t bifrost_blend_desc; } blend; bool shaderdb; + bool no_ubo_to_push; enum pipe_format rt_formats[8]; };