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

Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Oct 20 10:20:19 2023 -0400

zink: check for sampler view existence during zink_rebind_all_images()

views with mutable formats do not get created immediately, which means
access of them must be checked first

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25829>

---

 src/gallium/drivers/zink/zink_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_context.c 
b/src/gallium/drivers/zink/zink_context.c
index ca228da24cf..f8e742fc9cf 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -4841,7 +4841,7 @@ zink_rebind_all_images(struct zink_context *ctx)
     for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
       for (unsigned j = 0; j < ctx->di.num_sampler_views[i]; j++) {
          struct zink_sampler_view *sv = 
zink_sampler_view(ctx->sampler_views[i][j]);
-         if (!sv || sv->image_view->base.texture->target == PIPE_BUFFER)
+         if (!sv || sv->image_view->base.texture->target == PIPE_BUFFER || 
!sv->image_view)
             continue;
          struct zink_resource *res = 
zink_resource(sv->image_view->base.texture);
          if (res->obj != sv->image_view->obj) {

Reply via email to