panfrost: Set FAU count based on program->push
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 10 Feb 2021 00:08:54 +0000 (19:08 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 11 Feb 2021 17:24:37 +0000 (17:24 +0000)
There's no "cutoff" to worry about on Bifrost, just do the simple thing.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8973>

src/gallium/drivers/panfrost/pan_assemble.c

index 32254ebe93e06de03f112d9fb85d6be60bc922c3..ba39b7527c24a8541a2db4e42e1c634642f3ffad 100644 (file)
@@ -64,6 +64,8 @@ pan_prepare_bifrost_props(struct panfrost_shader_state *state,
                           panfrost_program *program,
                           gl_shader_stage stage)
 {
+        unsigned fau_count = DIV_ROUND_UP(program->push.count, 2);
+
         switch (stage) {
         case MESA_SHADER_VERTEX:
                 pan_prepare(&state->properties, RENDERER_PROPERTIES);
@@ -71,7 +73,7 @@ pan_prepare_bifrost_props(struct panfrost_shader_state *state,
                 state->properties.uniform_buffer_count = state->ubo_count;
 
                 pan_prepare(&state->preload, PRELOAD);
-                state->preload.uniform_count = state->uniform_count;
+                state->preload.uniform_count = fau_count;
                 state->preload.vertex.vertex_id = true;
                 state->preload.vertex.instance_id = true;
                 break;
@@ -94,7 +96,7 @@ pan_prepare_bifrost_props(struct panfrost_shader_state *state,
                 state->properties.bifrost.shader_wait_dependency_7 = program->wait_7;
 
                 pan_prepare(&state->preload, PRELOAD);
-                state->preload.uniform_count = state->uniform_count;
+                state->preload.uniform_count = fau_count;
                 state->preload.fragment.fragment_position = state->reads_frag_coord;
                 state->preload.fragment.coverage = true;
                 state->preload.fragment.primitive_flags = state->reads_face;
@@ -104,7 +106,7 @@ pan_prepare_bifrost_props(struct panfrost_shader_state *state,
                 state->properties.uniform_buffer_count = state->ubo_count;
 
                 pan_prepare(&state->preload, PRELOAD);
-                state->preload.uniform_count = state->uniform_count;
+                state->preload.uniform_count = fau_count;
 
                 state->preload.compute.local_invocation_xy = true;
                 state->preload.compute.local_invocation_z = true;