https://github.com/shader-slang/slang
Raw File
Tip revision: 0c479a6161b14712e189699f473b3c4c46851c64 authored by Yong He on 10 July 2023, 19:01:44 UTC
Add a test case.
Tip revision: 0c479a6
pipeline-simple.slang.h
// pipeline-simple.slang.h


// TODO(tfoley): strip this down to a minimal pipeline

pipeline StandardPipeline
{
    [Pinned]
    input world MeshVertex;
    
    world CoarseVertex;// : "glsl(vertex:projCoord)" using projCoord export standardExport;
    world Fragment;// : "glsl" export fragmentExport;
    
    require @CoarseVertex vec4 projCoord; 
    
    [VertexInput]
    extern @CoarseVertex MeshVertex vertAttribIn;
    import(MeshVertex->CoarseVertex) vertexImport()
    {
        return project(vertAttribIn);
    }
    
    extern @Fragment CoarseVertex CoarseVertexIn;
    import(CoarseVertex->Fragment) standardImport()
// TODO(tfoley): this trait doesn't seem to be implemented on `vec3`
//        require trait IsTriviallyPassable(CoarseVertex)
    {
        return project(CoarseVertexIn);
    }
    
    stage vs : VertexShader
    {
        World: CoarseVertex;
        Position: projCoord;
    }
    
    stage fs : FragmentShader
    {
        World: Fragment;
    }
}
back to top