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

Author: Mike Blumenkrantz <[email protected]>
Date:   Tue Jan 12 17:05:24 2021 -0500

zink: bypass separate stencil path in resource_reference_rw when not a zs image

no point in trying to get a stencil resource if none exists

Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9961>

---

 src/gallium/drivers/zink/zink_batch.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_batch.c 
b/src/gallium/drivers/zink/zink_batch.c
index 842cc9ed9a0..825d394dc9f 100644
--- a/src/gallium/drivers/zink/zink_batch.c
+++ b/src/gallium/drivers/zink/zink_batch.c
@@ -426,9 +426,10 @@ zink_batch_reference_resource_rw(struct zink_batch *batch, 
struct zink_resource
    /* u_transfer_helper unrefs the stencil buffer when the depth buffer is 
unrefed,
     * so we add an extra ref here to the stencil buffer to compensate
     */
-   struct zink_resource *stencil;
+   struct zink_resource *stencil = NULL;
 
-   zink_get_depth_stencil_resources((struct pipe_resource*)res, NULL, 
&stencil);
+   if (!res->obj->is_buffer && res->aspect == (VK_IMAGE_ASPECT_DEPTH_BIT | 
VK_IMAGE_ASPECT_STENCIL_BIT))
+      zink_get_depth_stencil_resources((struct pipe_resource*)res, NULL, 
&stencil);
 
    /* if the resource already has usage of any sort set for this batch, we can 
skip hashing */
    if (res->obj->reads.usage != batch->state->fence.batch_id &&

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to