From 8c066e7a57dee7b30a2aafb8f1c075bac0867be7 Mon Sep 17 00:00:00 2001 From: Pierre Moreau Date: Thu, 21 May 2020 20:35:35 +0200 Subject: [PATCH] nv50,nvc0: Do not resize global residents if unnecessary Reviewed-by: Karol Herbst Reviewed-by: Ilia Mirkin Signed-off-by: Pierre Moreau Part-of: --- src/gallium/drivers/nouveau/nv50/nv50_state.c | 2 +- src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c index 3ad9e41fdbb..42a8f45c5bc 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_state.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c @@ -1426,7 +1426,7 @@ nv50_set_global_bindings(struct pipe_context *pipe, unsigned i; const unsigned end = start + nr; - if (nv50->global_residents.size <= (end * sizeof(struct pipe_resource *))) { + if (nv50->global_residents.size < (end * sizeof(struct pipe_resource *))) { const unsigned old_size = nv50->global_residents.size; if (util_dynarray_resize(&nv50->global_residents, struct pipe_resource *, end)) { memset((uint8_t *)nv50->global_residents.data + old_size, 0, diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c index 13c4fc6a27b..08d2336589f 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c @@ -1419,7 +1419,7 @@ nvc0_set_global_bindings(struct pipe_context *pipe, if (!nr) return; - if (nvc0->global_residents.size <= (end * sizeof(struct pipe_resource *))) { + if (nvc0->global_residents.size < (end * sizeof(struct pipe_resource *))) { const unsigned old_size = nvc0->global_residents.size; if (util_dynarray_resize(&nvc0->global_residents, struct pipe_resource *, end)) { memset((uint8_t *)nvc0->global_residents.data + old_size, 0,