public static SourceLanguage Parse(WordReader reader, uint wordCount) { var id = (Enumerant)reader.ReadWord(); switch (id) { case Enumerant.Unknown: return(UnknownImpl.Parse(reader, wordCount - 1)); case Enumerant.ESSL: return(ESSLImpl.Parse(reader, wordCount - 1)); case Enumerant.GLSL: return(GLSLImpl.Parse(reader, wordCount - 1)); case Enumerant.OpenCL_C: return(OpenCL_CImpl.Parse(reader, wordCount - 1)); case Enumerant.OpenCL_CPP: return(OpenCL_CPPImpl.Parse(reader, wordCount - 1)); case Enumerant.HLSL: return(HLSLImpl.Parse(reader, wordCount - 1)); default: throw new IndexOutOfRangeException("Unknown SourceLanguage " + id); } }
public static ImageFormat Parse(WordReader reader, uint wordCount) { var id = (Enumerant)reader.ReadWord(); switch (id) { case Enumerant.Unknown: return(UnknownImpl.Parse(reader, wordCount - 1)); case Enumerant.Rgba32f: return(Rgba32fImpl.Parse(reader, wordCount - 1)); case Enumerant.Rgba16f: return(Rgba16fImpl.Parse(reader, wordCount - 1)); case Enumerant.R32f: return(R32fImpl.Parse(reader, wordCount - 1)); case Enumerant.Rgba8: return(Rgba8Impl.Parse(reader, wordCount - 1)); case Enumerant.Rgba8Snorm: return(Rgba8SnormImpl.Parse(reader, wordCount - 1)); case Enumerant.Rg32f: return(Rg32fImpl.Parse(reader, wordCount - 1)); case Enumerant.Rg16f: return(Rg16fImpl.Parse(reader, wordCount - 1)); case Enumerant.R11fG11fB10f: return(R11fG11fB10fImpl.Parse(reader, wordCount - 1)); case Enumerant.R16f: return(R16fImpl.Parse(reader, wordCount - 1)); case Enumerant.Rgba16: return(Rgba16Impl.Parse(reader, wordCount - 1)); case Enumerant.Rgb10A2: return(Rgb10A2Impl.Parse(reader, wordCount - 1)); case Enumerant.Rg16: return(Rg16Impl.Parse(reader, wordCount - 1)); case Enumerant.Rg8: return(Rg8Impl.Parse(reader, wordCount - 1)); case Enumerant.R16: return(R16Impl.Parse(reader, wordCount - 1)); case Enumerant.R8: return(R8Impl.Parse(reader, wordCount - 1)); case Enumerant.Rgba16Snorm: return(Rgba16SnormImpl.Parse(reader, wordCount - 1)); case Enumerant.Rg16Snorm: return(Rg16SnormImpl.Parse(reader, wordCount - 1)); case Enumerant.Rg8Snorm: return(Rg8SnormImpl.Parse(reader, wordCount - 1)); case Enumerant.R16Snorm: return(R16SnormImpl.Parse(reader, wordCount - 1)); case Enumerant.R8Snorm: return(R8SnormImpl.Parse(reader, wordCount - 1)); case Enumerant.Rgba32i: return(Rgba32iImpl.Parse(reader, wordCount - 1)); case Enumerant.Rgba16i: return(Rgba16iImpl.Parse(reader, wordCount - 1)); case Enumerant.Rgba8i: return(Rgba8iImpl.Parse(reader, wordCount - 1)); case Enumerant.R32i: return(R32iImpl.Parse(reader, wordCount - 1)); case Enumerant.Rg32i: return(Rg32iImpl.Parse(reader, wordCount - 1)); case Enumerant.Rg16i: return(Rg16iImpl.Parse(reader, wordCount - 1)); case Enumerant.Rg8i: return(Rg8iImpl.Parse(reader, wordCount - 1)); case Enumerant.R16i: return(R16iImpl.Parse(reader, wordCount - 1)); case Enumerant.R8i: return(R8iImpl.Parse(reader, wordCount - 1)); case Enumerant.Rgba32ui: return(Rgba32uiImpl.Parse(reader, wordCount - 1)); case Enumerant.Rgba16ui: return(Rgba16uiImpl.Parse(reader, wordCount - 1)); case Enumerant.Rgba8ui: return(Rgba8uiImpl.Parse(reader, wordCount - 1)); case Enumerant.R32ui: return(R32uiImpl.Parse(reader, wordCount - 1)); case Enumerant.Rgb10a2ui: return(Rgb10a2uiImpl.Parse(reader, wordCount - 1)); case Enumerant.Rg32ui: return(Rg32uiImpl.Parse(reader, wordCount - 1)); case Enumerant.Rg16ui: return(Rg16uiImpl.Parse(reader, wordCount - 1)); case Enumerant.Rg8ui: return(Rg8uiImpl.Parse(reader, wordCount - 1)); case Enumerant.R16ui: return(R16uiImpl.Parse(reader, wordCount - 1)); case Enumerant.R8ui: return(R8uiImpl.Parse(reader, wordCount - 1)); default: throw new IndexOutOfRangeException("Unknown ImageFormat " + id); } }