diff options
author | Zack Rusin <zackr@vmware.com> | 2009-01-26 15:22:53 -0500 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2009-01-27 12:20:26 -0500 |
commit | 4f5308bdcb9e62f678975a77783a48096f6dfdc6 (patch) | |
tree | 3895687d86bdff430155b850b663d252f867dfdc /src/gallium/drivers/softpipe | |
parent | d6888e811d24eaa7e8d9093be606394f00435c05 (diff) |
gallium: remove redundant size from the constant buffer
reuse the size of the actual buffer
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_draw_arrays.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_state_fs.c | 1 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c index 424bd56846..ed3e8f95ae 100644 --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@ -49,14 +49,14 @@ softpipe_map_constant_buffers(struct softpipe_context *sp) struct pipe_winsys *ws = sp->pipe.winsys; uint i; for (i = 0; i < PIPE_SHADER_TYPES; i++) { - if (sp->constants[i].size) + if (sp->constants[i].buffer && sp->constants[i].buffer->size) sp->mapped_constants[i] = ws->buffer_map(ws, sp->constants[i].buffer, PIPE_BUFFER_USAGE_CPU_READ); } draw_set_mapped_constant_buffer(sp->draw, sp->mapped_constants[PIPE_SHADER_VERTEX], - sp->constants[PIPE_SHADER_VERTEX].size); + sp->constants[PIPE_SHADER_VERTEX].buffer->size); } static void @@ -73,7 +73,7 @@ softpipe_unmap_constant_buffers(struct softpipe_context *sp) draw_set_mapped_constant_buffer(sp->draw, NULL, 0); for (i = 0; i < 2; i++) { - if (sp->constants[i].size) + if (sp->constants[i].buffer && sp->constants[i].buffer->size) ws->buffer_unmap(ws, sp->constants[i].buffer); sp->mapped_constants[i] = NULL; } diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c index e5b609cf6c..15815160ed 100644 --- a/src/gallium/drivers/softpipe/sp_state_fs.c +++ b/src/gallium/drivers/softpipe/sp_state_fs.c @@ -155,7 +155,6 @@ softpipe_set_constant_buffer(struct pipe_context *pipe, winsys_buffer_reference(ws, &softpipe->constants[shader].buffer, buf ? buf->buffer : NULL); - softpipe->constants[shader].size = buf ? buf->size : 0; softpipe->dirty |= SP_NEW_CONSTANTS; } |