From 923ca6e77c03d602f9a5a71713cf5d973451687b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 25 Mar 2014 06:41:21 +0100 Subject: ShaderCode: Allow 'srcRoot' to be optional ; RegionRendererImpl01: Allos custom shader --- .../com/jogamp/opengl/util/glsl/ShaderCode.java | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl/util') 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 6a64edeb5..264b9e2a6 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java @@ -327,7 +327,7 @@ public class ShaderCode { * @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER} * @param count number of shaders * @param context class used to help resolving the source and binary location - * @param srcRoot relative root path for srcBasenames + * @param srcRoot relative root path for srcBasenames optional * @param srcBasenames basenames w/o path or suffix relative to srcRoot for the shader's source code * @param binRoot relative root path for binBasenames * @param binBasename basename w/o path or suffix relative to binRoot for the shader's binary code @@ -355,11 +355,17 @@ public class ShaderCode { String srcPathString = null; String binFileName = null; - if(null!=srcRoot && null!=srcBasenames && ShaderUtil.isShaderCompilerAvailable(gl)) { + if( null!=srcBasenames && ShaderUtil.isShaderCompilerAvailable(gl) ) { srcPath = new String[srcBasenames.length]; final String srcSuffix = getFileSuffix(false, type); - for(int i=0; i 0 ) { + for(int i=0; i binFmts = ShaderUtil.getShaderBinaryFormats(gl); final String binSuffix = getFileSuffix(true, type); for(Iterator iter=binFmts.iterator(); iter.hasNext(); ) { int bFmt = iter.next().intValue(); - String bFmtPath = getBinarySubPath(bFmt); + final String bFmtPath = getBinarySubPath(bFmt); if(null==bFmtPath) continue; binFileName = binRoot + '/' + bFmtPath + '/' + binBasename + "." + binSuffix; res = create(type, count, context, bFmt, binFileName); @@ -426,7 +432,7 @@ public class ShaderCode { * or to determine the shader binary format (if binary is used). * @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER} * @param context class used to help resolving the source and binary location - * @param srcRoot relative root path for basename + * @param srcRoot relative root path for basename optional * @param binRoot relative root path for basename * @param mutableStringBuilder TODO * @param basenames basename w/o path or suffix relative to srcRoot and binRoot -- cgit v1.2.3