summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp19
-rw-r--r--drivers/png/SCsub1
-rw-r--r--drivers/png/image_loader_png.cpp6
3 files changed, 19 insertions, 7 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index e38f9f922c..959bfaffc9 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -702,14 +702,18 @@ void RasterizerStorageGLES3::texture_allocate(RID p_texture, int p_width, int p_
int mipmaps = 0;
- while (width != 1 && height != 1) {
- glTexImage3D(texture->target, 0, internal_format, width, height, depth, 0, format, type, NULL);
+ while (width > 0 || height > 0 || (p_type == VS::TEXTURE_TYPE_3D && depth > 0)) {
+ width = MAX(1, width);
+ height = MAX(1, height);
+ depth = MAX(1, depth);
- width = MAX(1, width / 2);
- height = MAX(1, height / 2);
+ glTexImage3D(texture->target, mipmaps, internal_format, width, height, depth, 0, format, type, NULL);
+
+ width /= 2;
+ height /= 2;
if (p_type == VS::TEXTURE_TYPE_3D) {
- depth = MAX(1, depth / 2);
+ depth /= 2;
}
mipmaps++;
@@ -926,6 +930,9 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p
h = MAX(1, h >> 1);
}
+ // Handle array and 3D textures, as those set their data per layer.
+ tsize *= MAX(texture->alloc_depth, 1);
+
info.texture_mem -= texture->total_data_size;
texture->total_data_size = tsize;
info.texture_mem += texture->total_data_size;
@@ -1496,7 +1503,7 @@ void RasterizerStorageGLES3::texture_debug_usage(List<VS::TextureInfo> *r_info)
tinfo.format = t->format;
tinfo.width = t->alloc_width;
tinfo.height = t->alloc_height;
- tinfo.depth = 0;
+ tinfo.depth = t->alloc_depth;
tinfo.bytes = t->total_data_size;
r_info->push_back(tinfo);
}
diff --git a/drivers/png/SCsub b/drivers/png/SCsub
index 22fb1817d1..97ba1de3db 100644
--- a/drivers/png/SCsub
+++ b/drivers/png/SCsub
@@ -50,6 +50,7 @@ if env['builtin_libpng']:
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/arm_init.c"))
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon_intrinsics.c"))
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon.S"))
+ neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/palette_neon_intrinsics.c"))
env.drivers_sources += neon_sources
# Godot source files
diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp
index 6d8185cdd8..0bf432c78a 100644
--- a/drivers/png/image_loader_png.cpp
+++ b/drivers/png/image_loader_png.cpp
@@ -63,7 +63,11 @@ static void _png_error_function(png_structp, png_const_charp text) {
}
static void _png_warn_function(png_structp, png_const_charp text) {
-
+#ifdef TOOLS_ENABLED
+ if (Engine::get_singleton()->is_editor_hint()) {
+ if (String(text).begins_with("iCCP")) return; // silences annoying spam emitted to output every time the user opened assetlib
+ }
+#endif
WARN_PRINT(text);
}