@@ -89,6 +89,11 @@
Adds the given pass to the pass chain.
</p>
+ <h3>[method:undefined dispose]()</h3>
+ <p>
+ Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
+ </p>
+
<h3>[method:undefined insertPass]( [param:Pass pass], [param:Integer index] )</h3>
<p>
@@ -88,6 +88,11 @@
将传入的过程添加到过程链。
@@ -232,6 +232,15 @@ class EffectComposer {
}
+ dispose() {
+ this.renderTarget1.dispose();
+ this.renderTarget2.dispose();
+ this.copyPass.dispose();
+ }
@@ -31,6 +31,8 @@ class Pass {
+ dispose() {}
// Helper for passes that need to fill the viewport with a single quad.
@@ -63,6 +63,13 @@ class ShaderPass extends Pass {
+ this.fsQuad.dispose();
+ this.material.dispose();
export { ShaderPass };