summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_inlines.h
diff options
context:
space:
mode:
authorMichal Krol <michal@vmware.com>2010-02-19 19:00:26 +0100
committerMichal Krol <michal@vmware.com>2010-02-19 19:00:26 +0100
commitf6106566081978f663cf08e54bb8908cb58a5316 (patch)
tree7bc2482548f55471d7024f04c75ac7f58402afa9 /src/gallium/auxiliary/util/u_inlines.h
parent3d0bfc6a4be73d43928493641bf819f77075bbc1 (diff)
gallium: WIP: Introduce sampler views.
Diffstat (limited to 'src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index e95d58ea86..f8dfea4e51 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -117,6 +117,16 @@ pipe_texture_reference(struct pipe_texture **ptr, struct pipe_texture *tex)
*ptr = tex;
}
+static INLINE void
+pipe_sampler_view_reference(struct pipe_sampler_view **ptr, struct pipe_sampler_view *view)
+{
+ struct pipe_sampler_view *old_view = *ptr;
+
+ if (pipe_reference(&(*ptr)->reference, &view->reference))
+ old_view->context->sampler_view_destroy(old_view->context, old_view);
+ *ptr = view;
+}
+
/*
* Convenience wrappers for screen buffer functions.