(String[] src0,
Pattern[] search,
String[] replace,
int offset)
| 1990 | |
| 1991 | |
| 1992 | protected static String[] preprocessShaderSource(String[] src0, |
| 1993 | Pattern[] search, |
| 1994 | String[] replace, |
| 1995 | int offset) { |
| 1996 | String[] src = new String[src0.length+offset]; |
| 1997 | for (int i = 0; i < src0.length; i++) { |
| 1998 | String line = src0[i]; |
| 1999 | int versionIndex = line.indexOf("#version"); |
| 2000 | if (versionIndex >= 0) { |
| 2001 | line = line.substring(0, versionIndex); |
| 2002 | } |
| 2003 | for (int j = 0; j < search.length; j++) { |
| 2004 | line = search[j].matcher(line).replaceAll(replace[j]); |
| 2005 | } |
| 2006 | src[i+offset] = line; |
| 2007 | } |
| 2008 | return src; |
| 2009 | } |
| 2010 | |
| 2011 | protected static boolean containsVersionDirective(String[] shSrc) { |
| 2012 | for (int i = 0; i < shSrc.length; i++) { |
no test coverage detected