diff options
author | Luca Barbieri <[email protected]> | 2010-04-18 14:50:14 +0200 |
---|---|---|
committer | Luca Barbieri <[email protected]> | 2010-04-18 15:29:23 +0200 |
commit | 64aa67a360ab09db1691b37b86178e008c4e3711 (patch) | |
tree | c254f6314390ec929f53c61daaff46243339d615 /src/gallium/auxiliary/util/u_blitter.h | |
parent | 5df6c430619d7652a5d0c0fb6c87332407b5330e (diff) |
u_blitter: add support for saving vertex buffers
Currently r300g does not save vertex buffer on blitter calls.
It gets away with it because the current Mesa state tracker usually
resets vertex buffers on every draw calls.
However, this is wrong.
nvfx won't be lucky because it needs to use the blitter inside draw
calls.
Diffstat (limited to 'src/gallium/auxiliary/util/u_blitter.h')
-rw-r--r-- | src/gallium/auxiliary/util/u_blitter.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_blitter.h b/src/gallium/auxiliary/util/u_blitter.h index 2ad7201a29d..f6e3ce4874e 100644 --- a/src/gallium/auxiliary/util/u_blitter.h +++ b/src/gallium/auxiliary/util/u_blitter.h @@ -57,6 +57,9 @@ struct blitter_context int saved_num_sampler_views; struct pipe_sampler_view *saved_sampler_views[PIPE_MAX_SAMPLERS]; + + int saved_num_vertex_buffers; + struct pipe_vertex_buffer saved_vertex_buffers[PIPE_MAX_ATTRIBS]; }; /** @@ -255,6 +258,19 @@ util_blitter_save_fragment_sampler_views(struct blitter_context *blitter, num_views * sizeof(struct pipe_sampler_view *)); } +static INLINE void +util_blitter_save_vertex_buffers(struct blitter_context *blitter, + int num_vertex_buffers, + struct pipe_vertex_buffer *vertex_buffers) +{ + assert(num_vertex_buffers <= Elements(blitter->saved_vertex_buffers)); + + blitter->saved_num_vertex_buffers = num_vertex_buffers; + memcpy(blitter->saved_vertex_buffers, + vertex_buffers, + num_vertex_buffers * sizeof(struct pipe_vertex_buffer)); +} + #ifdef __cplusplus } #endif |