summaryrefslogtreecommitdiffstats
path: root/modules/basis_universal
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2024-07-12 01:52:55 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-07-19 16:04:30 +0200
commit0445ccf428da3486e0ce9a2a45edc7cc52340034 (patch)
treed92f2a4c5f95f758230e07174ea2bf5e59d25a40 /modules/basis_universal
parent293c0f76463a4e1c2c2e86d8fbfc3e04f491b347 (diff)
downloadredot-engine-0445ccf428da3486e0ce9a2a45edc7cc52340034.tar.gz
Fix Image CowData crash when baking large lightmaps
This switches to 64-bit integers in select locations of the Image class, so that image resolutions of 16384×16384 (used by lightmap texture arrays) can be used properly. Values that are larger should also work. VRAM compression is also supported, although most VRAM-compressed formats are limited to individual slices of 16384×16384. WebP is limited to 16383×16383 due to format limitations.
Diffstat (limited to 'modules/basis_universal')
-rw-r--r--modules/basis_universal/image_compress_basisu.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/basis_universal/image_compress_basisu.cpp b/modules/basis_universal/image_compress_basisu.cpp
index 216fa6c9a2..fc1f01ae50 100644
--- a/modules/basis_universal/image_compress_basisu.cpp
+++ b/modules/basis_universal/image_compress_basisu.cpp
@@ -120,7 +120,8 @@ Vector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Image::UsedCha
Vector<uint32_t> mip_data_padded;
for (int32_t i = 0; i <= image->get_mipmap_count(); i++) {
- int ofs, size, width, height;
+ int64_t ofs, size;
+ int width, height;
image->get_mipmap_offset_size_and_dimensions(i, ofs, size, width, height);
const uint8_t *image_mip_data = image_data.ptr() + ofs;