From: Nicolai Hähnle <nicolai.haeh...@amd.com> --- src/gallium/auxiliary/util/u_inlines.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index 07c058a..789f6d6 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -626,10 +626,17 @@ static inline void util_copy_image_view(struct pipe_image_view *dst, const struct pipe_image_view *src) { - pipe_resource_reference(&dst->resource, src->resource); - dst->format = src->format; - dst->access = src->access; - dst->u = src->u; + if (src) { + pipe_resource_reference(&dst->resource, src->resource); + dst->format = src->format; + dst->access = src->access; + dst->u = src->u; + } else { + pipe_resource_reference(&dst->resource, NULL); + dst->format = PIPE_FORMAT_NONE; + dst->access = 0; + memset(&dst->u, 0, sizeof(dst->u)); + } } static inline unsigned -- 2.7.4 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev