|
@@ -928,9 +928,18 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height );
|
|
|
|
|
|
- } else {
|
|
|
+ } else if ( allocateMemory ) {
|
|
|
|
|
|
- state.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null );
|
|
|
+ let width = image.width, height = image.height;
|
|
|
+
|
|
|
+ for ( let i = 0; i < levels; i ++ ) {
|
|
|
+
|
|
|
+ state.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, width, height, 0, glFormat, glType, null );
|
|
|
+
|
|
|
+ width >>= 1;
|
|
|
+ height >>= 1;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|