aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java
index 4622d6975..a2d202d11 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java
@@ -52,6 +52,7 @@ public class ImageSequence implements TextureSequence {
private final int[] texWrapST = { GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE };
private volatile int frameIdx = 0;
private volatile boolean manualStepping = false;
+ private int textureFragmentShaderHashCode = 0;
public ImageSequence(final int textureUnit, final boolean useBuildInTexLookup) {
this.textureUnit = textureUnit;
@@ -173,4 +174,17 @@ public class ImageSequence implements TextureSequence {
" return texture2D(image, texCoord);\n"+
"}\n\n";
}
+
+ @Override
+ public int getTextureFragmentShaderHashCode() {
+ if( !isTextureAvailable() ) {
+ textureFragmentShaderHashCode = 0;
+ return 0;
+ } else if( 0 == textureFragmentShaderHashCode ) {
+ int hash = 31 + getTextureLookupFragmentShaderImpl().hashCode();
+ hash = ((hash << 5) - hash) + getTextureSampler2DType().hashCode();
+ textureFragmentShaderHashCode = hash;
+ }
+ return textureFragmentShaderHashCode;
+ }
}