mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
nv50,nvc0: Do not resize global residents if unnecessary
Reviewed-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Pierre Moreau <dev@pmoreau.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10711>
This commit is contained in:
parent
cc2cdf88fb
commit
8c066e7a57
2 changed files with 2 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue