Skip to content

Commit

Permalink
handle mipmap generation
Browse files Browse the repository at this point in the history
  • Loading branch information
aardgoose committed Jul 17, 2023
1 parent 4cbe2d2 commit 9e4bcbd
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion examples/jsm/renderers/webgpu/WebGPUBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,31 @@ class WebGPUBackend extends Backend {

if ( renderContext.texture !== null && renderContext.texture.generateMipmaps === true ) {

this.textureUtils.generateMipmaps( renderContext.texture );
if ( Array.isArray( renderContext.texture ) ) {

const textures = renderContext.texture;

for ( let i = 0; i < textures.length; i ++ ) {

const texture = textures[ i ];

if ( texture.generateMipmaps === true ) {

this.textureUtils.generateMipmaps( texture );

}

}

} else {

if ( renderContext.texture.generateMipmaps === true ) {

this.textureUtils.generateMipmaps( renderContext.texture );

}

}

}

Expand Down

0 comments on commit 9e4bcbd

Please sign in to comment.