diff options
author | Michal Krol <michal@vmware.com> | 2010-01-25 12:36:50 +0100 |
---|---|---|
committer | Michal Krol <michal@vmware.com> | 2010-01-28 14:07:53 +0100 |
commit | 9851644435f991a1a1bbb145333a97601627b37d (patch) | |
tree | 20351d0e1cdf5e0bb80d928cad27b77fbb7015af /src/gallium/drivers/softpipe | |
parent | 44ac4c4e2c7890236ee7e9cd0cf82b58710d57ef (diff) |
gallium: Enable multiple constant buffers for vertex and geometry shaders.
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_draw_arrays.c | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c index cbb9631fa5..06b97ab7c9 100644 --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@ -49,7 +49,7 @@ static void softpipe_map_constant_buffers(struct softpipe_context *sp) { struct pipe_winsys *ws = sp->pipe.winsys; - uint i, vssize, gssize; + uint i; for (i = 0; i < PIPE_SHADER_TYPES; i++) { uint j; @@ -63,22 +63,22 @@ softpipe_map_constant_buffers(struct softpipe_context *sp) } } - if (sp->constants[PIPE_SHADER_VERTEX][0]) - vssize = sp->constants[PIPE_SHADER_VERTEX][0]->size; - else - vssize = 0; - - if (sp->constants[PIPE_SHADER_GEOMETRY][0]) - gssize = sp->constants[PIPE_SHADER_GEOMETRY][0]->size; - else - gssize = 0; - - draw_set_mapped_constant_buffer(sp->draw, PIPE_SHADER_VERTEX, - sp->mapped_constants[PIPE_SHADER_VERTEX][0], - vssize); - draw_set_mapped_constant_buffer(sp->draw, PIPE_SHADER_GEOMETRY, - sp->mapped_constants[PIPE_SHADER_GEOMETRY][0], - gssize); + for (i = 0; i < PIPE_MAX_CONSTANT; i++) { + if (sp->constants[PIPE_SHADER_VERTEX][i]) { + draw_set_mapped_constant_buffer(sp->draw, + PIPE_SHADER_VERTEX, + i, + sp->mapped_constants[PIPE_SHADER_VERTEX][i], + sp->constants[PIPE_SHADER_VERTEX][i]->size); + } + if (sp->constants[PIPE_SHADER_GEOMETRY][i]) { + draw_set_mapped_constant_buffer(sp->draw, + PIPE_SHADER_GEOMETRY, + i, + sp->mapped_constants[PIPE_SHADER_GEOMETRY][i], + sp->constants[PIPE_SHADER_GEOMETRY][i]->size); + } + } } @@ -93,8 +93,18 @@ softpipe_unmap_constant_buffers(struct softpipe_context *sp) */ draw_flush(sp->draw); - draw_set_mapped_constant_buffer(sp->draw, PIPE_SHADER_VERTEX, NULL, 0); - draw_set_mapped_constant_buffer(sp->draw, PIPE_SHADER_GEOMETRY, NULL, 0); + for (i = 0; i < PIPE_MAX_CONSTANT; i++) { + draw_set_mapped_constant_buffer(sp->draw, + PIPE_SHADER_VERTEX, + i, + NULL, + 0); + draw_set_mapped_constant_buffer(sp->draw, + PIPE_SHADER_GEOMETRY, + i, + NULL, + 0); + } for (i = 0; i < PIPE_SHADER_TYPES; i++) { uint j; |