summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_inlines.h
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-04-18 22:37:32 +0200
committerLuca Barbieri <[email protected]>2010-04-18 22:58:09 +0200
commiteeabe9d1797765056dcf0ca70ad5fc11b3aa758d (patch)
tree7079fb7c30e0d82a4cdb4a016542139e78c948fa /src/gallium/auxiliary/util/u_inlines.h
parent0490116f96e61c6d8d26c2383736990cceef799b (diff)
u_inlines: split pipe_surface_init in pipe_surface_reset and *_init
Diffstat (limited to 'src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index b2a0408a60e..089adcf3827 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -122,9 +122,8 @@ pipe_sampler_view_reference(struct pipe_sampler_view **ptr, struct pipe_sampler_
*ptr = view;
}
-/* you have to call pipe_reference_init(&ps->reference, 1) yourself if it is just allocated */
static INLINE void
-pipe_surface_init(struct pipe_surface* ps, struct pipe_resource *pt,
+pipe_surface_reset(struct pipe_surface* ps, struct pipe_resource *pt,
unsigned face, unsigned level, unsigned zslice, unsigned flags)
{
pipe_resource_reference(&ps->texture, pt);
@@ -137,6 +136,15 @@ pipe_surface_init(struct pipe_surface* ps, struct pipe_resource *pt,
ps->zslice = zslice;
}
+static INLINE void
+pipe_surface_init(struct pipe_surface* ps, struct pipe_resource *pt,
+ unsigned face, unsigned level, unsigned zslice, unsigned flags)
+{
+ ps->texture = 0;
+ pipe_reference_init(&ps->reference, 1);
+ pipe_surface_reset(ps, pt, face, level, zslice, flags);
+}
+
/*
* Convenience wrappers for screen buffer functions.
*/