From 0182294b3779e03d9201d596a8395cf2a094b078 Mon Sep 17 00:00:00 2001 From: BlueCube3310 <53150244+BlueCube3310@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:51:15 +0200 Subject: [PATCH] Compatibility: Fix alignment of compressed textures when retrieving --- drivers/gles3/storage/texture_storage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index 36393dde869..54012c20e93 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -1039,7 +1039,7 @@ Ref TextureStorage::texture_2d_get(RID p_texture) const { data.resize(data_size); ERR_FAIL_COND_V(data.is_empty(), Ref()); - image = Image::create_from_data(texture->width, texture->height, texture->mipmaps > 1, texture->real_format, data); + image = Image::create_from_data(texture->alloc_width, texture->alloc_height, texture->mipmaps > 1, texture->real_format, data); ERR_FAIL_COND_V(image->is_empty(), Ref()); if (texture->format != texture->real_format) { image->convert(texture->format); @@ -1095,7 +1095,7 @@ Ref TextureStorage::texture_2d_get(RID p_texture) const { data.resize(data_size); ERR_FAIL_COND_V(data.is_empty(), Ref()); - image = Image::create_from_data(texture->width, texture->height, false, Image::FORMAT_RGBA8, data); + image = Image::create_from_data(texture->alloc_width, texture->alloc_height, false, Image::FORMAT_RGBA8, data); ERR_FAIL_COND_V(image->is_empty(), Ref()); if (texture->format != Image::FORMAT_RGBA8) {