/// <summary>
 /// Call after other middleware to specify when they should run in the integrated pipeline.
 /// </summary>
 /// <param name="app">The IAppBuilder.</param>
 /// <param name="stage">The stage of the integrated pipeline in which to run.</param>
 /// <returns>The original IAppBuilder for chaining.</returns>
 public static IAppBuilder UseStageMarker(this IAppBuilder app, PipelineStage stage)
 {
     return UseStageMarker(app, stage.ToString());
 }
예제 #2
0
 /// <summary>
 /// Call after other middleware to specify when they should run in the integrated pipeline.
 /// </summary>
 /// <param name="app">The IAppBuilder.</param>
 /// <param name="stage">The stage of the integrated pipeline in which to run.</param>
 /// <returns>The original IAppBuilder for chaining.</returns>
 public static IAppBuilder UseStageMarker(this IAppBuilder app, PipelineStage stage)
 {
     return(UseStageMarker(app, stage.ToString()));
 }
예제 #3
0
        /// <summary>
        /// Gets the input or output structure.
        /// </summary>
        /// <param name="type">The pipeline stage.</param>
        /// <param name="input">If set to <c>true</c> input, if set to <c>false</c> output.</param>
        /// <returns></returns>
        public static StructType GetStream(this Shader shader, PipelineStage type, bool input)
        {
            if (type == PipelineStage.Hull || type == PipelineStage.Domain)
            {
                throw new NotImplementedException();
            }

            foreach (var typeDecl in shader.Declarations.OfType <StructType>())
            {
                var stream = typeDecl.Attributes.OfType <AttributeDeclaration>().FirstOrDefault(x => x.Name == "Stream");
                if (stream != null)
                {
                    if ((string)stream.Parameters[0].Value == (input ? "Input" : "Output") && (string)stream.Parameters[1].Value == type.ToString())
                    {
                        return(typeDecl);
                    }
                }
            }

            return(null);
        }