diff options
author | Sven Gothel <[email protected]> | 2014-04-02 19:25:16 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-04-02 19:25:16 +0200 |
commit | abc833631e0ab30a06c7aff47a39a551544fd735 (patch) | |
tree | 1d6e5a94d2149d7b2635de5b5eccb330bc41cd2c /src/jogl/classes/jogamp/opengl/util/glsl | |
parent | e8a5a1cbb988670ca206ab1ac633e19a91bfa478 (diff) |
Bug 801: Reduce temp. object creation, i.e. GC load
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/glsl')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java index 1f402f48b..e9fb91086 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java @@ -69,6 +69,8 @@ public class GLSLArrayHandler extends GLVBOArrayHandler { } } + private final int[] tempI = new int[1]; + private final void enableShaderState(GL2ES2 glsl, boolean enable, ShaderState st) { if(enable) { /* @@ -99,9 +101,8 @@ public class GLSLArrayHandler extends GLVBOArrayHandler { } else if(st.getAttribLocation(glsl, ad) >= 0) { // didn't experience a performance hit on this query .. // (using ShaderState's location query above to validate the location) - final int[] qi = new int[1]; - glsl.glGetVertexAttribiv(ad.getLocation(), GL2ES2.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, qi, 0); - if(ad.getVBOName() != qi[0]) { + glsl.glGetVertexAttribiv(ad.getLocation(), GL2ES2.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, tempI, 0); + if(ad.getVBOName() != tempI[0]) { glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName()); st.vertexAttribPointer(glsl, ad); glsl.glBindBuffer(ad.getVBOTarget(), 0); @@ -151,9 +152,8 @@ public class GLSLArrayHandler extends GLVBOArrayHandler { } else { // didn't experience a performance hit on this query .. // (using ShaderState's location query above to validate the location) - final int[] qi = new int[1]; - glsl.glGetVertexAttribiv(location, GL2ES2.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, qi, 0); - if(ad.getVBOName() != qi[0]) { + glsl.glGetVertexAttribiv(location, GL2ES2.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, tempI, 0); + if(ad.getVBOName() != tempI[0]) { glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName()); glsl.glVertexAttribPointer(ad); glsl.glBindBuffer(ad.getVBOTarget(), 0); |