Kaynağa Gözat

WebGPURenderer: Fix stale texture references in bindings. (#33680)

Michael Herzog 3 hafta önce
ebeveyn
işleme
cfca67bbd1

+ 4 - 0
src/renderers/common/Bindings.js

@@ -265,6 +265,10 @@ class Bindings extends DataMap {
 
 						binding.release();
 
+					} else if ( binding.isSampler ) {
+
+						binding.release();
+
 					}
 
 				}

+ 9 - 0
src/renderers/common/Sampler.js

@@ -119,6 +119,15 @@ class Sampler extends Binding {
 
 	}
 
+	/**
+	 * Releases the texture reference.
+	 */
+	release() {
+
+		this._texture = null;
+
+	}
+
 }
 
 export default Sampler;

+ 1 - 0
src/renderers/common/Textures.js

@@ -626,6 +626,7 @@ class Textures extends DataMap {
 						if ( binding.isSampler && binding.texture === texture ) {
 
 							binding.reset();
+							binding.release();
 
 						}
 

粤ICP备19079148号