@@ -37295,10 +37295,7 @@ function cloneUniforms( src ) {
3729537295
3729637296 const property = src[ u ][ p ];
3729737297
37298- if ( property && ( property.isColor ||
37299- property.isMatrix3 || property.isMatrix4 ||
37300- property.isVector2 || property.isVector3 || property.isVector4 ||
37301- property.isTexture || property.isQuaternion ) ) {
37298+ if ( isThreeObject( property ) ) {
3730237299
3730337300 if ( property.isRenderTargetTexture ) {
3730437301
@@ -37313,7 +37310,23 @@ function cloneUniforms( src ) {
3731337310
3731437311 } else if ( Array.isArray( property ) ) {
3731537312
37316- dst[ u ][ p ] = property.slice();
37313+ if ( isThreeObject( property[ 0 ] ) ) {
37314+
37315+ const clonedProperty = [];
37316+
37317+ for ( let i = 0, l = property.length; i < l; i ++ ) {
37318+
37319+ clonedProperty[ i ] = property[ i ].clone();
37320+
37321+ }
37322+
37323+ dst[ u ][ p ] = clonedProperty;
37324+
37325+ } else {
37326+
37327+ dst[ u ][ p ] = property.slice();
37328+
37329+ }
3731737330
3731837331 } else {
3731937332
@@ -37357,6 +37370,15 @@ function mergeUniforms( uniforms ) {
3735737370
3735837371}
3735937372
37373+ function isThreeObject( property ) {
37374+
37375+ return ( property && ( property.isColor ||
37376+ property.isMatrix3 || property.isMatrix4 ||
37377+ property.isVector2 || property.isVector3 || property.isVector4 ||
37378+ property.isTexture || property.isQuaternion ) );
37379+
37380+ }
37381+
3736037382function cloneUniformsGroups( src ) {
3736137383
3736237384 const dst = [];
@@ -44051,7 +44073,6 @@ class FileLoader extends Loader {
4405144073 * @param {function(any)} onLoad - Executed when the loading process has been finished.
4405244074 * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
4405344075 * @param {onErrorCallback} [onError] - Executed when errors occur.
44054- * @return {any|undefined} The cached resource if available.
4405544076 */
4405644077 load( url, onLoad, onProgress, onError ) {
4405744078
@@ -44075,7 +44096,7 @@ class FileLoader extends Loader {
4407544096
4407644097 }, 0 );
4407744098
44078- return cached ;
44099+ return;
4407944100
4408044101 }
4408144102
@@ -49525,6 +49546,9 @@ class ImageBitmapLoader extends Loader {
4952549546 * Sets the given loader options. The structure of the object must match the `options` parameter of
4952649547 * [createImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap).
4952749548 *
49549+ * Note: When caching is enabled, the cache key is based on the URL only. Loading the same URL with
49550+ * different options will return the cached result of the first request.
49551+ *
4952849552 * @param {Object} options - The loader options to set.
4952949553 * @return {ImageBitmapLoader} A reference to this image bitmap loader.
4953049554 */
@@ -49543,7 +49567,6 @@ class ImageBitmapLoader extends Loader {
4954349567 * @param {function(ImageBitmap)} onLoad - Executed when the loading process has been finished.
4954449568 * @param {onProgressCallback} onProgress - Unsupported in this loader.
4954549569 * @param {onErrorCallback} onError - Executed when errors occur.
49546- * @return {ImageBitmap|undefined} The image bitmap.
4954749570 */
4954849571 load( url, onLoad, onProgress, onError ) {
4954949572
@@ -49581,8 +49604,6 @@ class ImageBitmapLoader extends Loader {
4958149604
4958249605 scope.manager.itemEnd( url );
4958349606
49584- return imageBitmap;
49585-
4958649607 }
4958749608
4958849609 } );
@@ -49600,7 +49621,7 @@ class ImageBitmapLoader extends Loader {
4960049621
4960149622 }, 0 );
4960249623
49603- return cached ;
49624+ return;
4960449625
4960549626 }
4960649627
@@ -49625,8 +49646,6 @@ class ImageBitmapLoader extends Loader {
4962549646
4962649647 scope.manager.itemEnd( url );
4962749648
49628- return imageBitmap;
49629-
4963049649 } ).catch( function ( e ) {
4963149650
4963249651 if ( onError ) onError( e );
@@ -49757,11 +49776,21 @@ class AudioLoader extends Loader {
4975749776 const bufferCopy = buffer.slice( 0 );
4975849777
4975949778 const context = AudioContext.getContext();
49779+
49780+ const decodeUrl = url + '#decode';
49781+ scope.manager.itemStart( decodeUrl ); // prevent loading manager from completing too early, see #33378
49782+
4976049783 context.decodeAudioData( bufferCopy, function ( audioBuffer ) {
4976149784
4976249785 onLoad( audioBuffer );
49786+ scope.manager.itemEnd( decodeUrl );
4976349787
49764- } ).catch( handleError );
49788+ } ).catch( function ( e ) {
49789+
49790+ handleError( e );
49791+ scope.manager.itemEnd( decodeUrl );
49792+
49793+ } );
4976549794
4976649795 } catch ( e ) {
4976749796
0 commit comments