Skip to content

Commit b21fa06

Browse files
committed
Update shader preprocessing to strip version correctly
Previously the whole line was removed, now only the end of the line is removed to handle the case when version is in a comment
1 parent 44b0b35 commit b21fa06

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

core/src/processing/opengl/PGL.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,8 +1989,9 @@ protected static String[] preprocessShaderSource(String[] src0,
19891989
String[] src = new String[src0.length+offset];
19901990
for (int i = 0; i < src0.length; i++) {
19911991
String line = src0[i];
1992-
if (line.contains("#version")) {
1993-
line = "";
1992+
int versionIndex = line.indexOf("#version");
1993+
if (versionIndex >= 0) {
1994+
line = line.substring(0, versionIndex);
19941995
}
19951996
for (int j = 0; j < search.length; j++) {
19961997
line = search[j].matcher(line).replaceAll(replace[j]);

0 commit comments

Comments
 (0)