yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Ellie Hermaszewskaformatf65d756bf

master
983 B42 linesraw
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
10    world CoarseVertex; // : "glsl(vertex:projCoord)" using projCoord export standardExport;
11    world Fragment;     // : "glsl" export fragmentExport;
12
13    require @CoarseVertex vec4 projCoord;
14
15    [VertexInput] extern @CoarseVertex MeshVertex vertAttribIn;
16    import(MeshVertex->CoarseVertex) vertexImport()
17    {
18        return project(vertAttribIn);
19    }
20
21    extern @Fragment CoarseVertex CoarseVertexIn;
22    import(CoarseVertex->Fragment) standardImport()
23    // TODO(tfoley): this trait doesn't seem to be implemented on `vec3`
24    //        require trait IsTriviallyPassable(CoarseVertex)
25    {
26        return project(CoarseVertexIn);
27    }
28
29    stage vs : VertexShader
30    {
31    World:
32        CoarseVertex;
33    Position:
34        projCoord;
35    }
36
37    stage fs : FragmentShader
38    {
39    World:
40        Fragment;
41    }
42}