diff options
author | Sven Gothel <[email protected]> | 2023-03-15 03:26:30 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-15 03:26:30 +0100 |
commit | c01a4ad712cfa2d1f8746daf161d9052c8acfccd (patch) | |
tree | 4f8a033905d0ffc63329f44726a9ea88c0b2977f /src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java | |
parent | 00dbacc5af3531af50e77a02d534dc11e08de10f (diff) |
Fix ShaderProgram ownership bug, introduced in commit 67a723477ecd818fbc5859fe20ee536a3b4efae5 (reverting and clarifying)
All Graph ShaderPrograms used are owned by RegionRenderer, not RenderState nor [GL]Region*,
hence [GL]Region* shall only nullify the resources but not destroy the shader currently in use.
One RegionRenderer maybe used for multuple Regions.
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java index a86060fab..c8e9a0113 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java @@ -179,7 +179,6 @@ public abstract class GLRegion extends Region { */
protected abstract void updateImpl(final GL2ES2 gl);
- protected abstract void clearShaderImpl(final GL2ES2 gl);
protected abstract void destroyImpl(final GL2ES2 gl);
protected abstract void clearImpl(final GL2ES2 gl);
@@ -212,16 +211,14 @@ public abstract class GLRegion extends Region { return this;
}
- /** Deletes all {@link ShaderProgram}s and nullifies its references. */
- public final void clearShader(final GL2ES2 gl) {
- clearShaderImpl(gl);
- }
-
/**
* Delete and clear the associated OGL objects.
+ * <p>
+ * The {@link ShaderProgram}s references are nullified but not {@link ShaderProgram#destroy(GL2ES2) destroyed}
+ * as they are owned by {@link RegionRenderer}.
+ * </p>
*/
public final void destroy(final GL2ES2 gl) {
- clearShaderImpl(gl);
clear(gl);
destroyImpl(gl);
}
|