diff options
author | Sven Göthel <[email protected]> | 2024-01-22 06:44:41 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-01-22 06:44:41 +0100 |
commit | 6cf158cc59e901b49ab54681e363d23492421a9d (patch) | |
tree | d60d3d7e7e9c98c36ae116bad827bc149c299d38 /src/jogl/classes/com/jogamp/graph/curve/opengl | |
parent | daf9ae20ebc45c851bc3b8384f4cee3cded8d9dc (diff) |
Bug 1488 - Graph RegionRenderer: Ensure shaderPrograms1 path is disabled using 'static final boolean useShaderPrograms0 = true'
For now, let's leave the dead shaderPrograms1 code path inside the class for further consideration.
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve/opengl')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java index df8be39d2..8dd72d231 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java @@ -282,11 +282,13 @@ public final class RegionRenderer { } shaderPrograms0.clear(); - for(final Iterator<ShaderProgram> i = shaderPrograms1.values().iterator(); i.hasNext(); ) { - final ShaderProgram sp = i.next(); - sp.destroy(gl); + if( !useShaderPrograms0 ) { + for(final Iterator<ShaderProgram> i = shaderPrograms1.values().iterator(); i.hasNext(); ) { + final ShaderProgram sp = i.next(); + sp.destroy(gl); + } + shaderPrograms1.clear(); } - shaderPrograms1.clear(); rs.detachFrom(gl); rs.destroy(); initialized = false; @@ -582,8 +584,8 @@ public final class RegionRenderer { } } private final IntObjectHashMap shaderPrograms0 = new IntObjectHashMap(); - private final HashMap<ShaderKey, ShaderProgram> shaderPrograms1 = new HashMap<ShaderKey, ShaderProgram>(); - private final boolean useShaderPrograms0 = true; + private final HashMap<ShaderKey, ShaderProgram> shaderPrograms1 = null; // new HashMap<ShaderKey, ShaderProgram>(); + private static final boolean useShaderPrograms0 = true; private static String shaderKeyToString(final int hashCode, final boolean isTwoPass, final boolean pass1, final boolean hasFrustumClipping, final boolean hasColorChannel, final boolean hasColorTexture, |