iris: Prepare depth resource if clear_depth enable
authorSagar Ghuge <sagar.ghuge@intel.com>
Wed, 28 Aug 2019 07:21:20 +0000 (00:21 -0700)
committerSagar Ghuge <sagar.ghuge@intel.com>
Tue, 29 Oct 2019 21:46:15 +0000 (14:46 -0700)
Avoid preparing depth resource, if we did fast depth clear before.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
src/gallium/drivers/iris/iris_clear.c

index cdc96471ce75db528f53e64557143d456878a047..58c219e9af33dee99f8c7ed1be31d458791bd5af 100644 (file)
@@ -581,7 +581,7 @@ clear_depth_stencil(struct iris_context *ice,
       return;
    }
 
-   if (z_res) {
+   if (clear_depth && z_res) {
       iris_resource_prepare_depth(ice, batch, z_res, level, box->z, box->depth);
       iris_blorp_surf_for_resource(&ice->vtbl, &z_surf, &z_res->base,
                                    z_res->aux.usage, level, true);
@@ -611,7 +611,7 @@ clear_depth_stencil(struct iris_context *ice,
    iris_flush_and_dirty_for_history(ice, batch, res, 0,
                                     "cache history: post slow ZS clear");
 
-   if (z_res) {
+   if (clear_depth && z_res) {
       iris_resource_finish_depth(ice, z_res, level,
                                  box->z, box->depth, true);
    }