mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
nouveau: only try to get new storage if there are any levels
This would try to allocate 0-sized bo's when the max level was below the base level. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
parent
ddcbea91f1
commit
d72d67832b
1 changed files with 11 additions and 8 deletions
|
|
@ -345,16 +345,19 @@ relayout_texture(struct gl_context *ctx, struct gl_texture_object *t)
|
|||
height = minify(height, 1);
|
||||
}
|
||||
|
||||
/* Get new storage. */
|
||||
size = align(offset, 64);
|
||||
if (t->BaseLevel <= last) {
|
||||
/* Get new storage. */
|
||||
size = align(offset, 64);
|
||||
assert(size);
|
||||
|
||||
ret = nouveau_bo_new(context_dev(ctx), NOUVEAU_BO_MAP |
|
||||
NOUVEAU_BO_GART | NOUVEAU_BO_VRAM,
|
||||
0, size, NULL, &ss[last].bo);
|
||||
assert(!ret);
|
||||
ret = nouveau_bo_new(context_dev(ctx), NOUVEAU_BO_MAP |
|
||||
NOUVEAU_BO_GART | NOUVEAU_BO_VRAM,
|
||||
0, size, NULL, &ss[last].bo);
|
||||
assert(!ret);
|
||||
|
||||
for (i = t->BaseLevel; i < last; i++)
|
||||
nouveau_bo_ref(ss[last].bo, &ss[i].bo);
|
||||
for (i = t->BaseLevel; i < last; i++)
|
||||
nouveau_bo_ref(ss[last].bo, &ss[i].bo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue