diff options
author | Zack Rusin <[email protected]> | 2009-01-26 15:22:53 -0500 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2009-01-27 12:20:26 -0500 |
commit | 4f5308bdcb9e62f678975a77783a48096f6dfdc6 (patch) | |
tree | 3895687d86bdff430155b850b663d252f867dfdc /src/gallium/drivers/nv10 | |
parent | d6888e811d24eaa7e8d9093be606394f00435c05 (diff) |
gallium: remove redundant size from the constant buffer
reuse the size of the actual buffer
Diffstat (limited to 'src/gallium/drivers/nv10')
-rw-r--r-- | src/gallium/drivers/nv10/nv10_state.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/nv10/nv10_state.c b/src/gallium/drivers/nv10/nv10_state.c index 622bcdf22e7..119af66dfd0 100644 --- a/src/gallium/drivers/nv10/nv10_state.c +++ b/src/gallium/drivers/nv10/nv10_state.c @@ -467,11 +467,12 @@ nv10_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index, if (buf) { void *mapped; - if (buf->size && (mapped = ws->buffer_map(ws, buf->buffer, PIPE_BUFFER_USAGE_CPU_READ))) + if (buf->buffer && buf->buffer->size && + (mapped = ws->buffer_map(ws, buf->buffer, PIPE_BUFFER_USAGE_CPU_READ))) { - memcpy(nv10->constbuf[shader], mapped, buf->size); + memcpy(nv10->constbuf[shader], mapped, buf->buffer->size); nv10->constbuf_nr[shader] = - buf->size / (4 * sizeof(float)); + buf->buffer->size / (4 * sizeof(float)); ws->buffer_unmap(ws, buf->buffer); } } |