File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -468,8 +468,11 @@ private void WriteFunctionCallsToKeywords()
468
468
469
469
var callSequence = new StringBuilder ( ) ;
470
470
WriteFunctionCallSequence ( callSequence , startKeyword ) ;
471
- callSequence . AppendLine ( startKeyword ) ;
472
- ShaderFile . Replace ( startKeyword , callSequence . ToString ( ) ) ;
471
+ //callSequence.AppendLine(startKeyword);
472
+ var m = Regex . Matches ( ShaderFile . ToString ( ) , $@ "{ startKeyword } (\s|$)", RegexOptions . Multiline ) ;
473
+ for ( int i = m . Count - 1 ; i >= 0 ; i -- )
474
+ ShaderFile . Insert ( m [ i ] . Index , callSequence . ToString ( ) ) ;
475
+ //ShaderFile.Replace(startKeyword, callSequence.ToString());
473
476
}
474
477
}
475
478
@@ -544,9 +547,9 @@ private void WriteShaderSkeleton()
544
547
}
545
548
}
546
549
}
547
- MatchCollection mkr = Regex . Matches ( ShaderFile . ToString ( ) , @"#KI#.*$ " , RegexOptions . Multiline ) ;
550
+ MatchCollection mkr = Regex . Matches ( ShaderFile . ToString ( ) , @"#KI#\S* " , RegexOptions . Multiline ) ;
548
551
for ( int i = mkr . Count - 1 ; i >= 0 ; i -- )
549
- ShaderFile . Replace ( mkr [ i ] . Value , "" ) ;
552
+ ShaderFile . Remove ( mkr [ i ] . Index , mkr [ i ] . Length ) ;
550
553
//}
551
554
552
555
ShaderFile . AppendLine ( "}" ) ;
You can’t perform that action at this time.
0 commit comments