summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r--src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c2
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_state.c5
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_state.c5
3 files changed, 5 insertions, 7 deletions
diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
index 86e3599325e..2bcb62b97d8 100644
--- a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
@@ -73,7 +73,7 @@ nvfx_fp_imm(struct nvfx_fpc *fpc, float a, float b, float c, float d)
float v[4] = {a, b, c, d};
int idx = fpc->imm_data.size >> 4;
- memcpy(util_dynarray_grow(&fpc->imm_data, sizeof(float) * 4), v, 4 * sizeof(float));
+ memcpy(util_dynarray_grow(&fpc->imm_data, float, 4), v, 4 * sizeof(float));
return nvfx_reg(NVFXSR_IMM, idx);
}
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c
index 55167a27c09..228feced5d1 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_state.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c
@@ -1263,10 +1263,9 @@ nv50_set_global_bindings(struct pipe_context *pipe,
if (nv50->global_residents.size <= (end * sizeof(struct pipe_resource *))) {
const unsigned old_size = nv50->global_residents.size;
- const unsigned req_size = end * sizeof(struct pipe_resource *);
- util_dynarray_resize(&nv50->global_residents, req_size);
+ util_dynarray_resize(&nv50->global_residents, struct pipe_resource *, end);
memset((uint8_t *)nv50->global_residents.data + old_size, 0,
- req_size - old_size);
+ nv50->global_residents.size - old_size);
}
if (resources) {
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
index 12e21862ee0..2ab51c8529e 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
@@ -1370,10 +1370,9 @@ nvc0_set_global_bindings(struct pipe_context *pipe,
if (nvc0->global_residents.size <= (end * sizeof(struct pipe_resource *))) {
const unsigned old_size = nvc0->global_residents.size;
- const unsigned req_size = end * sizeof(struct pipe_resource *);
- util_dynarray_resize(&nvc0->global_residents, req_size);
+ util_dynarray_resize(&nvc0->global_residents, struct pipe_resource *, end);
memset((uint8_t *)nvc0->global_residents.data + old_size, 0,
- req_size - old_size);
+ nvc0->global_residents.size - old_size);
}
if (resources) {