(String[] src0,
Pattern[] search,
String[] replace,
int offset)
| 2032 | |
| 2033 | |
| 2034 | protected static String[] preprocessShaderSource(String[] src0, |
| 2035 | Pattern[] search, |
| 2036 | String[] replace, |
| 2037 | int offset) { |
| 2038 | String[] src = new String[src0.length+offset]; |
| 2039 | for (int i = 0; i < src0.length; i++) { |
| 2040 | String line = src0[i]; |
| 2041 | int versionIndex = line.indexOf("#version"); |
| 2042 | if (versionIndex >= 0) { |
| 2043 | line = line.substring(0, versionIndex); |
| 2044 | } |
| 2045 | for (int j = 0; j < search.length; j++) { |
| 2046 | line = search[j].matcher(line).replaceAll(replace[j]); |
| 2047 | } |
| 2048 | src[i+offset] = line; |
| 2049 | } |
| 2050 | return src; |
| 2051 | } |
| 2052 | |
| 2053 | protected static boolean containsVersionDirective(String[] shSrc) { |
| 2054 | for (String line : shSrc) { |
no test coverage detected