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()
468468
469469 var callSequence = new StringBuilder ( ) ;
470470 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());
473476 }
474477 }
475478
@@ -544,9 +547,9 @@ private void WriteShaderSkeleton()
544547 }
545548 }
546549 }
547- MatchCollection mkr = Regex . Matches ( ShaderFile . ToString ( ) , @"#KI#.*$ " , RegexOptions . Multiline ) ;
550+ MatchCollection mkr = Regex . Matches ( ShaderFile . ToString ( ) , @"#KI#\S* " , RegexOptions . Multiline ) ;
548551 for ( int i = mkr . Count - 1 ; i >= 0 ; i -- )
549- ShaderFile . Replace ( mkr [ i ] . Value , "" ) ;
552+ ShaderFile . Remove ( mkr [ i ] . Index , mkr [ i ] . Length ) ;
550553 //}
551554
552555 ShaderFile . AppendLine ( "}" ) ;
You can’t perform that action at this time.
0 commit comments