Skip to content

Commit

Permalink
WebGLTextures: Avoid redundant calls of texStorage2D(). (#24095)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored May 21, 2022
1 parent bc7a37c commit 3300a62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderers/webgl/WebGLTextures.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
const mipmaps = texture.mipmaps;

const useTexStorage = ( isWebGL2 && texture.isVideoTexture !== true );
const allocateMemory = ( textureProperties.__version === undefined ) || ( forceUpload === true );
const allocateMemory = ( source.__currentVersion === undefined ) || ( forceUpload === true );
const levels = getMipLevels( texture, image, supportsMips );

if ( texture.isDepthTexture ) {
Expand Down Expand Up @@ -1068,7 +1068,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding );

const useTexStorage = ( isWebGL2 && texture.isVideoTexture !== true );
const allocateMemory = ( textureProperties.__version === undefined );
const allocateMemory = ( source.__currentVersion === undefined ) || ( forceUpload === true );
let levels = getMipLevels( texture, image, supportsMips );

setTextureParameters( _gl.TEXTURE_CUBE_MAP, texture, supportsMips );
Expand Down

0 comments on commit 3300a62

Please sign in to comment.