I've made changes that allow (not force) the merging of shader stages into one invokation of glassful. Each stage's main is marked by an attribute of the stage. Everything besides a stage's main is copied into every stage, not including other stages' mains.
Function parameters not mut become in values in glsl, and parameters marked mut become out values, and if there's a return value, then that becomes the very last out value.
A couple uppercase types are converted into glsl types as well, including Pnt*, Vec*, Mat* into their (lowercase) glsl counterparts. The lowercase versions could still be used for function syntax if that is clearer.
My changes to the README.md say more.
Be warned: shaders.rs has alot of things commented out, I've been playing with syntax there. But, what I've outlined should work.
I've made changes that allow (not force) the merging of shader stages into one invokation of glassful. Each stage's
main
is marked by an attribute of the stage. Everything besides a stage's main is copied into every stage, not including other stages'main
s. Function parameters notmut
becomein
values in glsl, and parameters markedmut
becomeout
values, and if there's a return value, then that becomes the very lastout
value. A couple uppercase types are converted into glsl types as well, includingPnt*
,Vec*
,Mat*
into their (lowercase) glsl counterparts. The lowercase versions could still be used for function syntax if that is clearer. My changes to theREADME.md
say more.Be warned: shaders.rs has alot of things commented out, I've been playing with syntax there. But, what I've outlined should work.