From 39661fb1d16149df7eabe818a25f44dac537c8a3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 18 Aug 2015 11:10:12 +0200 Subject: Bug 1193: ShaderCode: Add SUFFIX_COMPUTE_SOURCE/SUFFIX_COMPUTE_BINARY; Add @since 2.3.2 tag --- .../com/jogamp/opengl/util/glsl/ShaderCode.java | 25 +++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl') diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java index c916a6671..e5ef3b268 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java @@ -87,6 +87,18 @@ public class ShaderCode { /** Unique resource suffix for {@link GL3#GL_GEOMETRY_SHADER} in binary: {@value} */ public static final String SUFFIX_GEOMETRY_BINARY = "bgp" ; + /** + * Unique resource suffix for {@link GL3ES3#GL_COMPUTE_SHADER} in source code: {@value} + * @since 2.3.2 + */ + public static final String SUFFIX_COMPUTE_SOURCE = "cp" ; + + /** + * Unique resource suffix for {@link GL3ES3#GL_COMPUTE_SHADER} in binary: {@value} + * @since 2.3.2 + */ + public static final String SUFFIX_COMPUTE_BINARY = "bcp" ; + /** * Unique resource suffix for {@link GL4#GL_TESS_CONTROL_SHADER} in source code: {@value} * @since 2.2.1 @@ -349,6 +361,7 @@ public class ShaderCode { *
  • {@link GL3#GL_GEOMETRY_SHADER geometry}: {@link #SUFFIX_GEOMETRY_SOURCE}
  • *
  • {@link GL4#GL_TESS_CONTROL_SHADER tess-ctrl}: {@link #SUFFIX_TESS_CONTROL_SOURCE}
  • *
  • {@link GL4#GL_TESS_EVALUATION_SHADER tess-eval}: {@link #SUFFIX_TESS_EVALUATION_SOURCE}
  • + *
  • {@link GL3ES3#GL_COMPUTE_SHADER}: {@link #SUFFIX_COMPUTE_SOURCE}
  • * *
  • Binary
  • * * @param binary true for a binary resource, false for a source resource @@ -378,8 +392,8 @@ public class ShaderCode { return binary?SUFFIX_TESS_CONTROL_BINARY:SUFFIX_TESS_CONTROL_SOURCE; case GL3.GL_TESS_EVALUATION_SHADER: return binary?SUFFIX_TESS_EVALUATION_BINARY:SUFFIX_TESS_EVALUATION_SOURCE; - //case GL3ES3.GL_COMPUTE_SHADER: - //FIXME + case GL3ES3.GL_COMPUTE_SHADER: + return binary?SUFFIX_COMPUTE_BINARY:SUFFIX_COMPUTE_SOURCE; default: throw new GLException("illegal shader type: "+type); } @@ -735,7 +749,12 @@ public class ShaderCode { * @param context class used to help resolving the source and binary location * @param srcRoot relative root path for basename optional * @param binRoot relative root path for basename - * @param mutableStringBuilder TODO + * @param mutableStringBuilder if true method returns a mutable StringBuilder instance + * which can be edited later on at the costs of a String conversion when passing to + * {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}. + * If false method returns an immutable String instance, + * which can be passed to {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)} + * at no additional costs. * @param basenames basename w/o path or suffix relative to srcRoot and binRoot * for the shader's source and binary code. * @param mutableStringBuilder if true method returns a mutable StringBuilder instance -- cgit v1.2.3