Example #1
0
        /// <summary>
        /// Constructs a new <see cref="GraphicsPipelineDescription"/>.
        /// </summary>
        /// <param name="blendState">A description of the blend state, which controls how color values are blended into each
        /// color target.</param>
        /// <param name="depthStencilStateDescription">A description of the depth stencil state, which controls depth tests,
        /// writing, and comparisons.</param>
        /// <param name="rasterizerState">A description of the rasterizer state, which controls culling, clipping, scissor, and
        /// polygon-fill behavior.</param>
        /// <param name="shaders">An array of <see cref="Shader"/> objects, one for each shader stage which is to be active
        /// in the <see cref="Pipeline"/>. At a minimum, every graphics Pipeline must include a Vertex and Fragment shader. All
        /// other stages are optional, but if either Tessellation stage is present, then the other must also be.</param>
        /// <param name="specializations">An array of <see cref="SpecializationConstant"/> used to override specialization
        /// constants in the created <see cref="Pipeline"/>. Each element in this array describes a single ID-value pair, which
        /// will be matched with the constants specified in each <see cref="Shader"/>.</param>
        /// <param name="resourceLayouts">An array of <see cref="ResourceLayout"/>, which controls the layout of shader resoruces
        /// in the <see cref="Pipeline"/>.</param>
        /// <param name="outputs">A description of the output attachments used by the <see cref="Pipeline"/>.</param>
        public GraphicsPipelineDescription CreateGraphicsPipelineDescription(
            ref VeldridPrimitive primitive,
            BlendStateDescription blendState,
            DepthStencilStateDescription depthStencilStateDescription,
            RasterizerStateDescription rasterizerState,
            Shader[] shaders,
            SpecializationConstant[] specializations,
            ResourceLayout[] resourceLayouts,
            OutputDescription outputs)
        {
            var shaderSetDescription = new ShaderSetDescription(new VertexLayoutDescription[] { primitive.VertexLayout }, shaders, specializations);

            return(new GraphicsPipelineDescription(blendState, depthStencilStateDescription, rasterizerState, primitive.PrimitiveTopology, shaderSetDescription, resourceLayouts, outputs));
        }
Example #2
0
 public PipelineDescription(
     BlendStateDescription blendState,
     DepthStencilStateDescription depthStencilStateDescription,
     RasterizerStateDescription rasterizerState,
     PrimitiveTopology primitiveTopology,
     ShaderSetDescription shaderSet,
     ResourceLayout[] resourceLayouts,
     OutputDescription outputs)
 {
     BlendState        = blendState;
     DepthStencilState = depthStencilStateDescription;
     RasterizerState   = rasterizerState;
     PrimitiveTopology = primitiveTopology;
     ShaderSet         = shaderSet;
     ResourceLayouts   = resourceLayouts;
     Outputs           = outputs;
 }
 /// <summary>
 /// Constructs a new <see cref="GraphicsPipelineDescription"/>.
 /// </summary>
 /// <param name="blendState">A description of the blend state, which controls how color values are blended into each
 /// color target.</param>
 /// <param name="depthStencilStateDescription">A description of the depth stencil state, which controls depth tests,
 /// writing, and comparisons.</param>
 /// <param name="rasterizerState">A description of the rasterizer state, which controls culling, clipping, scissor, and
 /// polygon-fill behavior.</param>
 /// <param name="primitiveTopology">The <see cref="PrimitiveTopology"/> to use, which controls how a series of input
 /// vertices is interpreted by the <see cref="Pipeline"/>.</param>
 /// <param name="shaderSet">A description of the shader set to be used.</param>
 /// <param name="resourceLayout">A <see cref="ResourceLayout"/>, which controls the layout of shader resoruces in the
 /// <see cref="Pipeline"/>.</param>
 /// <param name="outputs">A description of the output attachments used by the <see cref="Pipeline"/>.</param>
 public GraphicsPipelineDescription(
     BlendStateDescription blendState,
     DepthStencilStateDescription depthStencilStateDescription,
     RasterizerStateDescription rasterizerState,
     PrimitiveTopology primitiveTopology,
     ShaderSetDescription shaderSet,
     ResourceLayout resourceLayout,
     OutputDescription outputs)
 {
     BlendState           = blendState;
     DepthStencilState    = depthStencilStateDescription;
     RasterizerState      = rasterizerState;
     PrimitiveTopology    = primitiveTopology;
     ShaderSet            = shaderSet;
     ResourceLayouts      = new[] { resourceLayout };
     Outputs              = outputs;
     ResourceBindingModel = null;
 }