summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/pipebuffer/pb_buffer.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-09-11 17:24:24 +0200
committerMarek Olšák <[email protected]>2011-09-11 18:29:27 +0200
commit4682e706012fe26627a2f827db01b5068cc62814 (patch)
tree640717b8898a4bf2e7dde1fa474a88159efee07e /src/gallium/auxiliary/pipebuffer/pb_buffer.h
parent2154c672b3f2a0f3de7aaacd9260954b9310262a (diff)
pb_buffer: inline 'base' sub-struct
Diffstat (limited to 'src/gallium/auxiliary/pipebuffer/pb_buffer.h')
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer.h24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
index 5a13f39849f..a5ec93c255e 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
@@ -97,14 +97,10 @@ typedef unsigned pb_size;
*/
struct pb_buffer
{
- /* This used to be a pipe_buffer struct:
- */
- struct {
- struct pipe_reference reference;
- unsigned size;
- unsigned alignment;
- unsigned usage;
- } base;
+ struct pipe_reference reference;
+ unsigned size;
+ unsigned alignment;
+ unsigned usage;
/**
* Pointer to the virtual function table.
@@ -169,7 +165,7 @@ pb_map(struct pb_buffer *buf,
assert(buf);
if(!buf)
return NULL;
- assert(pipe_is_referenced(&buf->base.reference));
+ assert(pipe_is_referenced(&buf->reference));
return buf->vtbl->map(buf, flags, flush_ctx);
}
@@ -180,7 +176,7 @@ pb_unmap(struct pb_buffer *buf)
assert(buf);
if(!buf)
return;
- assert(pipe_is_referenced(&buf->base.reference));
+ assert(pipe_is_referenced(&buf->reference));
buf->vtbl->unmap(buf);
}
@@ -196,11 +192,11 @@ pb_get_base_buffer( struct pb_buffer *buf,
offset = 0;
return;
}
- assert(pipe_is_referenced(&buf->base.reference));
+ assert(pipe_is_referenced(&buf->reference));
assert(buf->vtbl->get_base_buffer);
buf->vtbl->get_base_buffer(buf, base_buf, offset);
assert(*base_buf);
- assert(*offset < (*base_buf)->base.size);
+ assert(*offset < (*base_buf)->size);
}
@@ -232,7 +228,7 @@ pb_destroy(struct pb_buffer *buf)
assert(buf);
if(!buf)
return;
- assert(!pipe_is_referenced(&buf->base.reference));
+ assert(!pipe_is_referenced(&buf->reference));
buf->vtbl->destroy(buf);
}
@@ -242,7 +238,7 @@ pb_reference(struct pb_buffer **dst,
{
struct pb_buffer *old = *dst;
- if (pipe_reference(&(*dst)->base.reference, &src->base.reference))
+ if (pipe_reference(&(*dst)->reference, &src->reference))
pb_destroy( old );
*dst = src;
}