Skip to content

Commit

Permalink
Re-added ordering change to shaderCodeNode.ts, now that I know why it…
Browse files Browse the repository at this point in the history
…'s necessary.
  • Loading branch information
syntheticmagus committed Aug 22, 2019
1 parent 849098d commit e7b765a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Engines/Processors/shaderCodeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand All @@ -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";
Expand Down

0 comments on commit e7b765a

Please sign in to comment.