panfrost: Add a knob to disable the UBO -> push constants optimization
authorBoris Brezillon <boris.brezillon@collabora.com>
Fri, 5 Mar 2021 12:18:03 +0000 (13:18 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 11 Mar 2021 15:10:57 +0000 (15:10 +0000)
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 <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9517>

src/panfrost/bifrost/bi_opt_push_ubo.c
src/panfrost/midgard/mir_promote_uniforms.c
src/panfrost/util/pan_ir.h

index 9442315..8debdd4 100644 (file)
@@ -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);
 
index aead024..6a02eaa 100644 (file)
@@ -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);
index 5705d3b..37bf877 100644 (file)
@@ -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];
 };