Przeglądaj źródła

Re-added ordering change to shaderCodeNode.ts, now that I know why it's necessary.

Justin Murray 6 lat temu
rodzic
commit
e7b765a975
1 zmienionych plików z 5 dodań i 4 usunięć
  1. 5 4
      src/Engines/Processors/shaderCodeNode.ts

+ 5 - 4
src/Engines/Processors/shaderCodeNode.ts

@@ -18,6 +18,11 @@ export class ShaderCodeNode {
             let value: string = this.line;
             let processor = options.processor;
             if (processor) {
+                // This must be done before other replacements to avoid mistakenly changing something that was already changed.
+                if (processor.lineProcessor) {
+                    value = processor.lineProcessor(value, options.isFragment);
+                }
+
                 if (processor.attributeProcessor && StringTools.StartsWith(this.line, "attribute")) {
                     value = processor.attributeProcessor(this.line);
                 } else if (processor.varyingProcessor && StringTools.StartsWith(this.line, "varying")) {
@@ -43,10 +48,6 @@ export class ShaderCodeNode {
                         value = processor.endOfUniformBufferProcessor(this.line, options.isFragment);
                     }
                 }
-
-                if (processor.lineProcessor) {
-                    value = processor.lineProcessor(value, options.isFragment);
-                }
             }
 
             result += value + "\r\n";