Mesa (main): v3dv: use the global RCL EZ disable if we don't have any EZ draws in the job

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 1 06:46:51 UTC 2022


Module: Mesa
Branch: main
Commit: 18985e803087bdac8ac6448839554af0fabffe03
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=18985e803087bdac8ac6448839554af0fabffe03

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Tue May 31 11:16:35 2022 +0200

v3dv: use the global RCL EZ disable if we don't have any EZ draws in the job

Until now we would only disable EZ globally if we had a depth or stencil
load operation or if we had no draw calls at all, but even if we have draw
calls if all of them disable EZ we should also us the global disable.

Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16794>

---

 src/broadcom/vulkan/v3dv_private.h     |  3 +++
 src/broadcom/vulkan/v3dvx_cmd_buffer.c | 10 +++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/broadcom/vulkan/v3dv_private.h b/src/broadcom/vulkan/v3dv_private.h
index 3656db97ac5..ee5b4b84853 100644
--- a/src/broadcom/vulkan/v3dv_private.h
+++ b/src/broadcom/vulkan/v3dv_private.h
@@ -1082,6 +1082,9 @@ struct v3dv_job {
     */
    bool decided_global_ez_enable;
 
+   /* If the job emitted any draw calls with Early Z/S enabled */
+   bool has_ez_draws;
+
    /* If this job has been configured to use early Z/S clear */
    bool early_zs_clear;
 
diff --git a/src/broadcom/vulkan/v3dvx_cmd_buffer.c b/src/broadcom/vulkan/v3dvx_cmd_buffer.c
index ad3e9ba35a9..58405714b28 100644
--- a/src/broadcom/vulkan/v3dvx_cmd_buffer.c
+++ b/src/broadcom/vulkan/v3dvx_cmd_buffer.c
@@ -754,11 +754,8 @@ set_rcl_early_z_config(struct v3dv_job *job,
                        bool *early_z_disable,
                        uint32_t *early_z_test_and_update_direction)
 {
-   /* If this is true then we have not emitted any draw calls in this job
-    * and we don't get any benefits form early Z.
-    */
-   if (!job->decided_global_ez_enable) {
-      assert(job->draw_count == 0);
+   /* Disable if none of the draw calls in this job enabled EZ */
+   if (!job->has_ez_draws) {
       *early_z_disable = true;
       return;
    }
@@ -1533,6 +1530,9 @@ job_update_ez_state(struct v3dv_job *job,
       job->ez_state = V3D_EZ_DISABLED;
    }
 
+   if (!disable_ez)
+      job->has_ez_draws = true;
+
    return !disable_ez;
 }
 



More information about the mesa-commit mailing list