From bc50b09bf4edc7feb78cf293c933543d5d123000 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Sat, 9 Sep 2017 13:43:46 -0400 Subject: [PATCH] Don't upload NULL texture slices --- .../src/main/java/com/jme3/renderer/opengl/TextureUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/TextureUtil.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/TextureUtil.java index 305da6d83..7adc3ff19 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/opengl/TextureUtil.java +++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/TextureUtil.java @@ -199,10 +199,12 @@ final class TextureUtil { format.format, format.dataType, data); - } else { + } else if (data != null) { // For texture arrays, only upload 1 slice at a time. // zoffset specifies slice index, and depth is 1 to indicate // a single texture in the array. + // We don't need to do this for NULL data because the + // main texture storage was already allocated with slice == -1 gl2.glTexSubImage3D(target, level, // level 0, // xoffset