yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f65d756bf
master
1// pipeline-simple.slang.h 2 3 4// TODO(tfoley): strip this down to a minimal pipeline 5 6pipeline StandardPipeline 7{ 8 [Pinned ]input world MeshVertex ; 9 10world CoarseVertex ;// : "glsl(vertex:projCoord)" using projCoord export standardExport; 11world Fragment ;// : "glsl" export fragmentExport; 12 13require @CoarseVertex vec4 projCoord ; 14 15[VertexInput] extern @ CoarseVertex MeshVertex vertAttribIn; 16import (MeshVertex -> CoarseVertex ) vertexImport () 17{ 18return project (vertAttribIn); 19} 20 21extern @ Fragment CoarseVertex CoarseVertexIn; 22import (CoarseVertex -> Fragment ) standardImport () 23// TODO(tfoley): this trait doesn't seem to be implemented on `vec3` 24// require trait IsTriviallyPassable(CoarseVertex) 25{ 26return project (CoarseVertexIn); 27} 28 29stage vs : VertexShader 30{ 31World : 32CoarseVertex; 33Position : 34projCoord; 35} 36 37stage fs : FragmentShader 38{ 39World : 40Fragment ; 41 } 42}