diff options
author | Dave Airlie <[email protected]> | 2010-09-17 14:01:50 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2010-09-17 15:29:31 +1000 |
commit | 0d76bb5d4c5c867155f7fb381c46018e1560b790 (patch) | |
tree | 41449f2f5ba46b87ab76a864931ce36ba738223c /src/gallium/drivers/r600/r600_resource.h | |
parent | a927d0477a47e29d72e518880979e11e8c0f98e7 (diff) |
r600g: add upload manager support.
this add support for the upload manager for uploading user vbo/index buffers.
this provides a considerable speedup in q3 type games.
Diffstat (limited to 'src/gallium/drivers/r600/r600_resource.h')
-rw-r--r-- | src/gallium/drivers/r600/r600_resource.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_resource.h b/src/gallium/drivers/r600/r600_resource.h index ff05afbc302..9608a5a6234 100644 --- a/src/gallium/drivers/r600/r600_resource.h +++ b/src/gallium/drivers/r600/r600_resource.h @@ -75,4 +75,35 @@ struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen, const struct pipe_resource *base, struct winsys_handle *whandle); +#define R600_BUFFER_MAGIC 0xabcd1600 +#define R600_BUFFER_MAX_RANGES 32 + +struct r600_buffer_range { + uint32_t start; + uint32_t end; +}; + +struct r600_resource_buffer { + struct r600_resource r; + uint32_t magic; + void *user_buffer; + struct r600_buffer_range ranges[R600_BUFFER_MAX_RANGES]; + unsigned num_ranges; +}; + +/* r600_buffer */ +static INLINE struct r600_resource_buffer *r600_buffer(struct pipe_resource *buffer) +{ + if (buffer) { + assert(((struct r600_resource_buffer *)buffer)->magic == R600_BUFFER_MAGIC); + return (struct r600_resource_buffer *)buffer; + } + return NULL; +} + +static INLINE boolean r600_buffer_is_user_buffer(struct pipe_resource *buffer) +{ + return r600_buffer(buffer)->user_buffer ? true : false; +} + #endif |