https://github.com/shader-slang/slang
Raw File
Tip revision: 13ff0bd345990c0fdfb7b52ebd5339cddb04889e authored by Tim Foley on 03 March 2021, 19:45:39 UTC
Add GLSL/SPIR-V support got GetAttributeAtVertex (#1733)
Tip revision: 13ff0bd
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