summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/pipebuffer/pb_buffer.h
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2008-11-25 09:28:30 +0000
committerAlan Hourihane <alanh@tungstengraphics.com>2008-11-25 09:28:30 +0000
commit4af0d940a35536f096a9289470af0268a79402b3 (patch)
tree811a00ed03b1bcd5a99713108f831b41484153ff /src/gallium/auxiliary/pipebuffer/pb_buffer.h
parentc5b52b5e0e6f6e47c3953076fa788921b1c5a5e2 (diff)
parent55839ae064d64b7fcc180fcddb364bf31ab760dc (diff)
Merge commit 'origin/gallium-0.1' into gallium-0.2
Conflicts: scons/gallium.py src/gallium/auxiliary/pipebuffer/pb_buffer.h
Diffstat (limited to 'src/gallium/auxiliary/pipebuffer/pb_buffer.h')
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer.h39
1 files changed, 35 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
index 19db8a6a91..dd22ef34ec 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
@@ -37,7 +37,7 @@
* There is no obligation of a winsys driver to use this library. And a pipe
* driver should be completly agnostic about it.
*
- * \author Jos� Fonseca <jrfonseca@tungstengraphics.com>
+ * \author Jose Fonseca <jrfonseca@tungstengraphics.com>
*/
#ifndef PB_BUFFER_H_
@@ -46,6 +46,7 @@
#include "pipe/p_compiler.h"
#include "pipe/p_debug.h"
+#include "pipe/p_error.h"
#include "pipe/p_state.h"
#include "pipe/p_inlines.h"
@@ -56,6 +57,8 @@ extern "C" {
struct pb_vtbl;
+struct pb_validate;
+
/**
* Buffer description.
@@ -104,6 +107,13 @@ struct pb_vtbl
void (*unmap)( struct pb_buffer *buf );
+ enum pipe_error (*validate)( struct pb_buffer *buf,
+ struct pb_validate *vl,
+ unsigned flags );
+
+ void (*fence)( struct pb_buffer *buf,
+ struct pipe_fence_handle *fence );
+
/**
* Get the base buffer and the offset.
*
@@ -118,6 +128,7 @@ struct pb_vtbl
void (*get_base_buffer)( struct pb_buffer *buf,
struct pb_buffer **base_buf,
unsigned *offset );
+
};
@@ -173,13 +184,33 @@ pb_get_base_buffer( struct pb_buffer *buf,
offset = 0;
return;
}
+ assert(buf->vtbl->get_base_buffer);
buf->vtbl->get_base_buffer(buf, base_buf, offset);
}
-/**
- * Don't call this directly. Use pb_reference instead.
- */
+static INLINE enum pipe_error
+pb_validate(struct pb_buffer *buf, struct pb_validate *vl, unsigned flags)
+{
+ assert(buf);
+ if(!buf)
+ return PIPE_ERROR;
+ assert(buf->vtbl->validate);
+ return buf->vtbl->validate(buf, vl, flags);
+}
+
+
+static INLINE void
+pb_fence(struct pb_buffer *buf, struct pipe_fence_handle *fence)
+{
+ assert(buf);
+ if(!buf)
+ return;
+ assert(buf->vtbl->fence);
+ buf->vtbl->fence(buf, fence);
+}
+
+
static INLINE void
pb_destroy(struct pb_buffer *buf)
{