Преглед изворни кода

RenderTarget: Fix resize of 3D textures. (#31854)

Michael Herzog пре 5 месеци
родитељ
комит
8683d9657d
1 измењених фајлова са 10 додато и 1 уклоњено
  1. 10 1
      src/core/RenderTarget.js

+ 10 - 1
src/core/RenderTarget.js

@@ -294,7 +294,16 @@ class RenderTarget extends EventDispatcher {
 				this.textures[ i ].image.width = width;
 				this.textures[ i ].image.height = height;
 				this.textures[ i ].image.depth = depth;
-				this.textures[ i ].isArrayTexture = this.textures[ i ].image.depth > 1;
+
+				if ( this.textures[ i ].isData3DTexture !== true ) { // Fix for #31693
+
+					// TODO: Reconsider setting isArrayTexture flag here and in the ctor of Texture.
+					// Maybe a method `isArrayTexture()` or just a getter could replace a flag since
+					// both are evaluated on each call?
+
+					this.textures[ i ].isArrayTexture = this.textures[ i ].image.depth > 1;
+
+				}
 
 			}
 

粤ICP备19079148号