summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/pipebuffer/pb_validate.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-10-13 13:47:51 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-10-13 13:47:51 +0100
commita1276bfdd8ea2c2840f3ea8edd3cea8720804498 (patch)
treef9a6435a7607f15e0a44fe479905d0a0a9db3dec /src/gallium/auxiliary/pipebuffer/pb_validate.c
parent056aff7a7cf11f17e879b6ae93ccd771e1c59e9f (diff)
pipebuffer: is_texture/buffer_referenced helper.gallium-0.1
A hash table would be more efficient, but this likely isn't used often enough to make a difference.
Diffstat (limited to 'src/gallium/auxiliary/pipebuffer/pb_validate.c')
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_validate.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_validate.c b/src/gallium/auxiliary/pipebuffer/pb_validate.c
index 1e54fc39d4..1c7b91957b 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_validate.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_validate.c
@@ -99,6 +99,20 @@ pb_validate_add_buffer(struct pb_validate *vl,
}
+unsigned
+pb_validate_is_buffer_referenced(struct pb_validate *vl,
+ struct pb_buffer *buf)
+{
+ unsigned i;
+
+ for(i = 0; i < vl->used; ++i)
+ if(vl->buffers[i] == buf)
+ return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE;
+
+ return 0;
+}
+
+
enum pipe_error
pb_validate_validate(struct pb_validate *vl)
{