gallium/u_inlines: allow NULL src in util_copy_image_view

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Nicolai Hähnle
2016-04-29 16:06:13 -05:00
parent 57f576f1fb
commit fc0352ff9c
+11 -4
View File
@@ -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