Skip to content

Commit eb51e09

Browse files
authored
Revert "RenderTarget: Fix copy of images. (#30570)" (#30572)
This reverts commit 2ab9aea.
1 parent 2ab9aea commit eb51e09

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/core/RenderTarget.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ class RenderTarget extends EventDispatcher {
148148
this.textures[ i ].isRenderTargetTexture = true;
149149
this.textures[ i ].renderTarget = this;
150150

151-
// ensure image object is not shared, see #20328
151+
}
152152

153-
const image = Object.assign( {}, source.textures[ i ].image );
154-
this.textures[ i ].source = new Source( image );
153+
// ensure image object is not shared, see #20328
155154

156-
}
155+
const image = Object.assign( {}, source.texture.image );
156+
this.texture.source = new Source( image );
157157

158158
this.depthBuffer = source.depthBuffer;
159159
this.stencilBuffer = source.stencilBuffer;

src/textures/DepthTexture.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Texture } from './Texture.js';
22
import { NearestFilter, UnsignedIntType, UnsignedInt248Type, DepthFormat, DepthStencilFormat } from '../constants.js';
3-
import { Source } from './Source.js';
43

54
class DepthTexture extends Texture {
65

@@ -31,11 +30,11 @@ class DepthTexture extends Texture {
3130

3231
}
3332

33+
3434
copy( source ) {
3535

3636
super.copy( source );
3737

38-
this.source = new Source( Object.assign( {}, source.image ) ); // see #30540
3938
this.compareFunction = source.compareFunction;
4039

4140
return this;

0 commit comments

Comments
 (0)