From: Rob Clark <[email protected]>

Signed-off-by: Rob Clark <[email protected]>
---
 src/gallium/auxiliary/util/u_inlines.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/gallium/auxiliary/util/u_inlines.h 
b/src/gallium/auxiliary/util/u_inlines.h
index ebaf368..93171d9 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -671,6 +671,23 @@ util_copy_image_view(struct pipe_image_view *dst,
    }
 }
 
+static inline void
+util_copy_vertex_buffer(struct pipe_vertex_buffer *dst,
+                        const struct pipe_vertex_buffer *src)
+{
+   if (src) {
+      dst->stride = src->stride;
+      dst->buffer_offset = src->buffer_offset;
+      pipe_resource_reference(&dst->buffer, src->buffer);
+      dst->user_buffer = src->user_buffer;
+   } else {
+      dst->stride = 0;
+      dst->buffer_offset = 0;
+      pipe_resource_reference(&dst->buffer, NULL);
+      dst->user_buffer = NULL;
+   }
+}
+
 static inline unsigned
 util_max_layer(const struct pipe_resource *r, unsigned level)
 {
-- 
2.5.5

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

Reply via email to