|
@@ -181,9 +181,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
function getMipLevels( texture, image, supportsMips ) {
|
|
|
|
|
|
- if ( textureNeedsGenerateMipmaps( texture, supportsMips ) === true ) {
|
|
|
-
|
|
|
- // generated mipmaps via gl.generateMipmap()
|
|
|
+ if ( textureNeedsGenerateMipmaps( texture, supportsMips ) === true || ( texture.isFramebufferTexture && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) ) {
|
|
|
|
|
|
return Math.log2( Math.max( image.width, image.height ) ) + 1;
|
|
|
|
|
@@ -793,7 +791,15 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
} else if ( texture.isFramebufferTexture ) {
|
|
|
|
|
|
- // texture data extracted from framebuffers require mutuable textures defined via gl.copyTexImage2D()
|
|
|
+ if ( useTexStorage && allocateMemory ) {
|
|
|
+
|
|
|
+ state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ state.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
} else {
|
|
|
|