Skip to content

Commit 6b9ff3b

Browse files
committed
Sampler: Don't set _texture to null.
1 parent 77cc698 commit 6b9ff3b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/renderers/common/Sampler.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ class Sampler extends Binding {
3434
*/
3535
this._onTextureDispose = () => {
3636

37-
this.texture = null;
37+
this.generation = null;
38+
this.version = 0;
3839

3940
};
4041

@@ -70,7 +71,8 @@ class Sampler extends Binding {
7071

7172
/**
7273
* Sets the texture of this sampler.
73-
* @param {?Texture} value - The texture to set.
74+
*
75+
* @param {Texture} value - The texture to set.
7476
*/
7577
set texture( value ) {
7678

@@ -84,9 +86,6 @@ class Sampler extends Binding {
8486

8587
this._texture = value;
8688

87-
this.generation = null;
88-
this.version = 0;
89-
9089
if ( this._texture ) {
9190

9291
this._texture.addEventListener( 'dispose', this._onTextureDispose );
@@ -139,7 +138,8 @@ class Sampler extends Binding {
139138

140139
clonedSampler._onTextureDispose = () => {
141140

142-
clonedSampler.texture = null;
141+
clonedSampler.generation = null;
142+
clonedSampler.version = 0;
143143

144144
};
145145

0 commit comments

Comments
 (0)