mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 15:00:10 +01:00
mesa: don't assert when finding a renderbuffer miplevel fails
this can also be caused by winsys and api being out of sync, e.g., if the window resize is lagging behind the framebuffer resize in this case, just use level 0 and assume things will be okay cc: mesa-stable Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37467>
This commit is contained in:
parent
62912e6719
commit
f9dd9bc30d
1 changed files with 7 additions and 7 deletions
|
|
@ -573,17 +573,17 @@ _mesa_update_renderbuffer_surface(struct gl_context *ctx,
|
|||
rtt_height = 1;
|
||||
}
|
||||
|
||||
/* find matching mipmap level size */
|
||||
unsigned level;
|
||||
for (level = 0; level <= resource->last_level; level++) {
|
||||
if (u_minify(resource->width0, level) == rtt_width &&
|
||||
u_minify(resource->height0, level) == rtt_height &&
|
||||
/* try to find matching mipmap level size, or just use level 0 and assume partial render */
|
||||
unsigned level = 0;
|
||||
for (int test_level = 0; test_level <= resource->last_level; test_level++) {
|
||||
if (u_minify(resource->width0, test_level) == rtt_width &&
|
||||
u_minify(resource->height0, test_level) == rtt_height &&
|
||||
(resource->target != PIPE_TEXTURE_3D ||
|
||||
u_minify(resource->depth0, level) == rtt_depth)) {
|
||||
u_minify(resource->depth0, test_level) == rtt_depth)) {
|
||||
level = test_level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert(level <= resource->last_level);
|
||||
|
||||
/* determine the layer bounds */
|
||||
unsigned first_layer, last_layer;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue