Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
PipelineStage.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 
5 namespace SiliconStudio.Shaders.Convertor
6 {
7  /// <summary>
8  /// Enum to specify pipeline stage.
9  /// </summary>
10  [Serializable]
11  public enum PipelineStage
12  {
13  Vertex = 0,
14  Hull = 1,
15  Domain = 2,
16  Geometry = 3,
17  Pixel = 4,
18  Compute = 5,
19  None = 6,
20  }
21 
22  /// <summary>
23  /// Helper functions for <see cref="PipelineStage"/>.
24  /// </summary>
25  public static class PipelineStageHelper
26  {
27  /// <summary>
28  /// Parse a pipeline stage from string.
29  /// </summary>
30  /// <param name="stage">The stage in string form.</param>
31  /// <exception cref="ArgumentException">If stage string is an invalid string.</exception>
32  /// <returns>A PipelineStage value.</returns>
33  public static PipelineStage FromString(string stage)
34  {
35  switch (stage.ToLowerInvariant())
36  {
37  case "vs":
38  case "vertex":
39  return PipelineStage.Vertex;
40  case "ps":
41  case "pixel":
42  return PipelineStage.Pixel;
43  case "gs":
44  case "geometry":
45  return PipelineStage.Geometry;
46  }
47 
48  throw new ArgumentException("stage is invalid. Must be vs/vertex, ps/pixel, gs/geometry.", "stage");
49  }
50  }
51 }
static PipelineStage FromString(string stage)
Parse a pipeline stage from string.
Helper functions for PipelineStage.
PipelineStage
Enum to specify pipeline stage.