diff options
author | marha <marha@users.sourceforge.net> | 2012-05-15 15:07:22 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-05-15 15:07:22 +0200 |
commit | 9818207986d5db9831e43eb2a640be68f54bb2ef (patch) | |
tree | e1ac6d17b2da887a2110c1337f01fc6fbdfa68fd /mesalib/src/gallium/auxiliary/util/u_inlines.h | |
parent | e6ff1fe09702cb307729b3208175c84f623f2968 (diff) | |
parent | 062c45ff0df6a52080dcd74433710d47127cbe29 (diff) | |
download | vcxsrv-9818207986d5db9831e43eb2a640be68f54bb2ef.tar.gz vcxsrv-9818207986d5db9831e43eb2a640be68f54bb2ef.tar.bz2 vcxsrv-9818207986d5db9831e43eb2a640be68f54bb2ef.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_inlines.h | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_inlines.h b/mesalib/src/gallium/auxiliary/util/u_inlines.h index 49b4531db..2ec153c58 100644 --- a/mesalib/src/gallium/auxiliary/util/u_inlines.h +++ b/mesalib/src/gallium/auxiliary/util/u_inlines.h @@ -233,14 +233,6 @@ pipe_buffer_create( struct pipe_screen *screen, return screen->resource_create(screen, &buffer); } - -static INLINE struct pipe_resource * -pipe_user_buffer_create( struct pipe_screen *screen, void *ptr, unsigned size, - unsigned usage ) -{ - return screen->user_buffer_create(screen, ptr, size, usage); -} - static INLINE void * pipe_buffer_map_range(struct pipe_context *pipe, struct pipe_resource *buffer, @@ -376,6 +368,19 @@ pipe_buffer_write_nooverlap(struct pipe_context *pipe, 0, 0); } +static INLINE struct pipe_resource * +pipe_buffer_create_with_data(struct pipe_context *pipe, + unsigned bind, + unsigned usage, + unsigned size, + void *ptr) +{ + struct pipe_resource *res = pipe_buffer_create(pipe->screen, + bind, usage, size); + pipe_buffer_write_nooverlap(pipe, res, 0, size, ptr); + return res; +} + static INLINE void pipe_buffer_read(struct pipe_context *pipe, struct pipe_resource *buf, @@ -437,6 +442,22 @@ pipe_transfer_destroy( struct pipe_context *context, context->transfer_destroy(context, transfer); } +static INLINE void +pipe_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index, + struct pipe_resource *buf) +{ + if (buf) { + struct pipe_constant_buffer cb; + cb.buffer = buf; + cb.buffer_offset = 0; + cb.buffer_size = buf->width0; + cb.user_buffer = NULL; + pipe->set_constant_buffer(pipe, shader, index, &cb); + } else { + pipe->set_constant_buffer(pipe, shader, index, NULL); + } +} + static INLINE boolean util_get_offset( const struct pipe_rasterizer_state *templ, |