aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv20
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2009-01-26 15:22:53 -0500
committerZack Rusin <[email protected]>2009-01-27 12:20:26 -0500
commit4f5308bdcb9e62f678975a77783a48096f6dfdc6 (patch)
tree3895687d86bdff430155b850b663d252f867dfdc /src/gallium/drivers/nv20
parentd6888e811d24eaa7e8d9093be606394f00435c05 (diff)
gallium: remove redundant size from the constant buffer
reuse the size of the actual buffer
Diffstat (limited to 'src/gallium/drivers/nv20')
-rw-r--r--src/gallium/drivers/nv20/nv20_state.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/nv20/nv20_state.c b/src/gallium/drivers/nv20/nv20_state.c
index e8dc9665e82..ecec4f49a0c 100644
--- a/src/gallium/drivers/nv20/nv20_state.c
+++ b/src/gallium/drivers/nv20/nv20_state.c
@@ -460,11 +460,12 @@ nv20_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(nv20->constbuf[shader], mapped, buf->size);
+ memcpy(nv20->constbuf[shader], mapped, buf->buffer->size);
nv20->constbuf_nr[shader] =
- buf->size / (4 * sizeof(float));
+ buf->buffer->size / (4 * sizeof(float));
ws->buffer_unmap(ws, buf->buffer);
}
}