Mesa (main): zink: zero out sampler/image descriptor surface info for null descriptor updates

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 12 21:26:30 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Mon Jul 12 12:57:29 2021 -0400

zink: zero out sampler/image descriptor surface info for null descriptor updates

this is the surface struct used by the caching manager to generate a ref update template,
which means it must be kept in sync with the current state of descriptors

when the struct is zeroed, it implies that no refs need to be taken for the cached set

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11829>

---

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

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index bd95fd6edf6..9b8acbea4bd 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -507,6 +507,7 @@ update_descriptor_state_sampler(struct zink_context *ctx, enum pipe_shader_type
          ctx->di.textures[shader][slot].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
          ctx->di.tbos[shader][slot] = null_bufferview->buffer_view;
       }
+      memset(&ctx->di.sampler_surfaces[shader][slot], 0, sizeof(ctx->di.sampler_surfaces[shader][slot]));
    }
 }
 
@@ -542,6 +543,7 @@ update_descriptor_state_image(struct zink_context *ctx, enum pipe_shader_type sh
          ctx->di.images[shader][slot].imageLayout = VK_IMAGE_LAYOUT_GENERAL;
          ctx->di.texel_images[shader][slot] = null_bufferview->buffer_view;
       }
+      memset(&ctx->di.image_surfaces[shader][slot], 0, sizeof(ctx->di.image_surfaces[shader][slot]));
    }
 }
 



More information about the mesa-commit mailing list