Browse Source

Sampler: Don't set `_texture` to `null`. (#31874)

Michael Herzog 8 months ago
parent
commit
4ff594b870
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/renderers/common/Sampler.js

+ 6 - 3
src/renderers/common/Sampler.js

@@ -34,7 +34,8 @@ class Sampler extends Binding {
 		 */
 		 */
 		this._onTextureDispose = () => {
 		this._onTextureDispose = () => {
 
 
-			this.texture = null;
+			this.generation = null;
+			this.version = 0;
 
 
 		};
 		};
 
 
@@ -70,7 +71,8 @@ class Sampler extends Binding {
 
 
 	/**
 	/**
 	 * Sets the texture of this sampler.
 	 * Sets the texture of this sampler.
-	 * @param {?Texture} value - The texture to set.
+	 *
+	 * @param {Texture} value - The texture to set.
 	 */
 	 */
 	set texture( value ) {
 	set texture( value ) {
 
 
@@ -139,7 +141,8 @@ class Sampler extends Binding {
 
 
 		clonedSampler._onTextureDispose = () => {
 		clonedSampler._onTextureDispose = () => {
 
 
-			clonedSampler.texture = null;
+			clonedSampler.generation = null;
+			clonedSampler.version = 0;
 
 
 		};
 		};
 
 

粤ICP备19079148号