summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_inlines.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-04-02 14:30:16 +0200
committerMarek Olšák <[email protected]>2017-05-10 19:00:16 +0200
commitc24c3b94ed29ecd99b1101c74c6c4606f9b5580e (patch)
tree81f6966bc59a68d9867693c65d35fae9bb1d9819 /src/gallium/auxiliary/util/u_inlines.h
parentfe437882ea2d60e91c244cc95beb4b79c615af49 (diff)
gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytes
Diffstat (limited to 'src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index 6bc5e6660f9..6a3d5043cf2 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -188,6 +188,25 @@ pipe_so_target_reference(struct pipe_stream_output_target **ptr,
}
static inline void
+pipe_vertex_buffer_unreference(struct pipe_vertex_buffer *dst)
+{
+ if (dst->is_user_buffer)
+ dst->buffer.user = NULL;
+ else
+ pipe_resource_reference(&dst->buffer.resource, NULL);
+}
+
+static inline void
+pipe_vertex_buffer_reference(struct pipe_vertex_buffer *dst,
+ const struct pipe_vertex_buffer *src)
+{
+ pipe_vertex_buffer_unreference(dst);
+ if (!src->is_user_buffer)
+ pipe_resource_reference(&dst->buffer.resource, src->buffer.resource);
+ memcpy(dst, src, sizeof(*src));
+}
+
+static inline void
pipe_surface_reset(struct pipe_context *ctx, struct pipe_surface* ps,
struct pipe_resource *pt, unsigned level, unsigned layer)
{