Skip to content

Commit

Permalink
Bring shaders' tails before main, fixes Strilanc#378
Browse files Browse the repository at this point in the history
  • Loading branch information
ebraminio committed Sep 13, 2017
1 parent 95d154b commit 5daa93b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/webgl/ShaderCoders.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function combinedShaderPartsWithCode(shaderPartsOrDescs, tailCode) {
}
}
let libCode = [...libs, ...shaderPartDescs.map(e => e.toConcretePart().code)].join('');
return libCode + '\n//////// tail ////////\n' + tailCode;
return libCode.replace('void main()', '\n//////// tail ////////\n' + tailCode + '\n//////// main ////////\nvoid main()');
};

return new WglShader(sourceMaker);
Expand Down

0 comments on commit 5daa93b

Please sign in to comment.