diff options
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java index c7e845953..3a5a24116 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java @@ -182,9 +182,7 @@ public class ShaderUtil { public Set getShaderBinaryFormats(GL _gl) { GL2ES2 gl = _gl.getGL2ES2(); if(null==shaderBinaryFormats) { - if(gl.getContext()!=GLContext.getCurrent()) { - return new HashSet(0); // bail out - } + gl.getContext().validateCurrent(); int[] param = new int[1]; shaderBinaryFormats = new HashSet(); @@ -208,9 +206,7 @@ public class ShaderUtil { public boolean isShaderCompilerAvailable(GL _gl) { GL2ES2 gl = _gl.getGL2ES2(); if(null==shaderCompilerAvailable) { - if(gl.getContext()!=GLContext.getCurrent()) { - return false; // bail out - } + gl.getContext().validateCurrent(); Set bfs = getShaderBinaryFormats(gl); if(gl.isGLES2()) { byte[] param = new byte[1]; @@ -469,7 +465,7 @@ public class ShaderUtil { Impl impl = (Impl) context.getAttachedObject(ShaderUtil.class.getName()); if (impl == null) { impl = new GL2ES2Impl(); - context.putAttachedObject(ShaderUtil.class.getName(), impl); + context.attachObject(ShaderUtil.class.getName(), impl); } return impl; } |