diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2024-07-12 01:52:55 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-19 16:04:30 +0200 |
commit | 0445ccf428da3486e0ce9a2a45edc7cc52340034 (patch) | |
tree | d92f2a4c5f95f758230e07174ea2bf5e59d25a40 /tests/core/io/test_image.h | |
parent | 293c0f76463a4e1c2c2e86d8fbfc3e04f491b347 (diff) | |
download | redot-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 'tests/core/io/test_image.h')
-rw-r--r-- | tests/core/io/test_image.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/core/io/test_image.h b/tests/core/io/test_image.h index 09b2e8cf29..0698c60f2a 100644 --- a/tests/core/io/test_image.h +++ b/tests/core/io/test_image.h @@ -355,8 +355,8 @@ TEST_CASE("[Image] Custom mipmaps") { uint8_t *data_ptr = data.ptrw(); for (int mip = 0; mip < mipmaps; mip++) { - int mip_offset = 0; - int mip_size = 0; + int64_t mip_offset = 0; + int64_t mip_size = 0; image->get_mipmap_offset_and_size(mip, mip_offset, mip_size); for (int i = 0; i < mip_size; i++) { @@ -378,8 +378,8 @@ TEST_CASE("[Image] Custom mipmaps") { const uint8_t *data_ptr = data.ptr(); for (int mip = 0; mip < mipmaps; mip++) { - int mip_offset = 0; - int mip_size = 0; + int64_t mip_offset = 0; + int64_t mip_size = 0; image_bytes->get_mipmap_offset_and_size(mip, mip_offset, mip_size); for (int i = 0; i < mip_size; i++) { @@ -402,8 +402,8 @@ TEST_CASE("[Image] Custom mipmaps") { const uint8_t *data_ptr = data.ptr(); for (int mip = 0; mip < mipmaps; mip++) { - int mip_offset = 0; - int mip_size = 0; + int64_t mip_offset = 0; + int64_t mip_size = 0; image_rgbaf->get_mipmap_offset_and_size(mip, mip_offset, mip_size); for (int i = 0; i < mip_size; i += 4) { |