Module: Mesa
Branch: master
Commit: 821d68652dde4c3c385b2cf53588572595c6b50e
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=821d68652dde4c3c385b2cf53588572595c6b50e

Author: Icecream95 <i...@disroot.org>
Date:   Thu Jan 21 16:23:49 2021 +1300

panfrost: Add fast path for graphics work group computation

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzw...@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10158>

---

 src/gallium/drivers/panfrost/pan_context.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c 
b/src/gallium/drivers/panfrost/pan_context.c
index b3c05805ac7..519dcb162bf 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -550,9 +550,21 @@ panfrost_direct_draw(struct panfrost_context *ctx,
         panfrost_statistics_record(ctx, info, draw);
 
         struct mali_invocation_packed invocation;
-        panfrost_pack_work_groups_compute(&invocation,
-                                          1, vertex_count, 
info->instance_count,
-                                          1, 1, 1, true);
+        if (info->instance_count > 1) {
+                panfrost_pack_work_groups_compute(&invocation,
+                                                  1, vertex_count, 
info->instance_count,
+                                                  1, 1, 1, true);
+        } else {
+                pan_pack(&invocation, INVOCATION, cfg) {
+                        cfg.invocations = MALI_POSITIVE(vertex_count);
+                        cfg.size_y_shift = 0;
+                        cfg.size_z_shift = 0;
+                        cfg.workgroups_x_shift = 0;
+                        cfg.workgroups_y_shift = 0;
+                        cfg.workgroups_z_shift = 32;
+                        cfg.unknown_shift = 2;
+                }
+        }
 
         /* Emit all sort of descriptors. */
         mali_ptr varyings = 0, vs_vary = 0, fs_vary = 0, pos = 0, psiz = 0;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to