Skip to content

Commit 27552a2

Browse files
committed
Merge pull request godotengine#96758 from RandomShaper/fix_the_shift_must_go_on
RenderingDevice: Fix uncapped mipmap sizes causing div-by-zero
2 parents dcc15aa + 7f1989b commit 27552a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

servers/rendering/rendering_device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,8 +1641,8 @@ Vector<uint8_t> RenderingDevice::texture_get_data(RID p_texture, uint32_t p_laye
16411641
copy_region.texture_region_size.z = d;
16421642
command_buffer_texture_copy_regions_vector.push_back(copy_region);
16431643

1644-
w = (w >> 1);
1645-
h = (h >> 1);
1644+
w = MAX(1u, w >> 1);
1645+
h = MAX(1u, h >> 1);
16461646
d = MAX(1u, d >> 1);
16471647
}
16481648

0 commit comments

Comments
 (0)