diff options
author | Sven Gothel <[email protected]> | 2023-03-13 21:38:29 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-13 21:38:29 +0100 |
commit | 67a723477ecd818fbc5859fe20ee536a3b4efae5 (patch) | |
tree | ca9ad9fa7b45c1fb99ce153667af64d13f73bc0c /src/jogl/classes/jogamp | |
parent | 6feb3738231210b03edefa7a60cf11e644fb7a5d (diff) |
GLRegion + RegionRenderer: Add clearShader(..) to delete all ShaderPrograms and is references.
Diffstat (limited to 'src/jogl/classes/jogamp')
3 files changed, 32 insertions, 5 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java index 89693bb66..c09e75b53 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java @@ -629,6 +629,18 @@ public final class VBORegion2PMSAAES2 extends GLRegion { } @Override + protected void clearShaderImpl(final GL2ES2 gl) { + if( null != spPass1 ) { + spPass1.destroy(gl); + spPass1 = null; + } + if( null != spPass2 ) { + spPass2.destroy(gl); + spPass2 = null; + } + } + + @Override protected void destroyImpl(final GL2ES2 gl) { if(DEBUG_INSTANCE) { System.err.println("VBORegion2PES2 Destroy: " + this); @@ -665,7 +677,5 @@ public final class VBORegion2PMSAAES2 extends GLRegion { indicesFbo.destroy(gl); indicesFbo = null; } - spPass1 = null; - spPass2 = null; } } diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java index 9567bab10..96247c61a 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java @@ -762,6 +762,18 @@ public final class VBORegion2PVBAAES2 extends GLRegion { } @Override + protected void clearShaderImpl(final GL2ES2 gl) { + if( null != spPass1 ) { + spPass1.destroy(gl); + spPass1 = null; + } + if( null != spPass2 ) { + spPass2.destroy(gl); + spPass2 = null; + } + } + + @Override protected void destroyImpl(final GL2ES2 gl) { if(DEBUG_INSTANCE) { System.err.println("VBORegion2PES2 Destroy: " + this); @@ -801,7 +813,5 @@ public final class VBORegion2PVBAAES2 extends GLRegion { indicesFbo.destroy(gl); indicesFbo = null; } - spPass1 = null; - spPass2 = null; } } diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java index adf3e4bc2..b8bdfbe37 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java @@ -345,6 +345,14 @@ public final class VBORegionSPES2 extends GLRegion { } @Override + protected void clearShaderImpl(final GL2ES2 gl) { + if( null != spPass1 ) { + spPass1.destroy(gl); + spPass1 = null; + } + } + + @Override protected void destroyImpl(final GL2ES2 gl) { if(DEBUG_INSTANCE) { System.err.println("VBORegionSPES2 Destroy: " + this); @@ -365,6 +373,5 @@ public final class VBORegionSPES2 extends GLRegion { indicesBuffer.destroy(gl); indicesBuffer = null; } - spPass1 = null; } } |