示例#1
0
 public static bool IsFormatSupported(GraphicsFormat format, FormatUsage usage)
 {
     return(ShimManager.systemInfoShim.IsFormatSupported(format, usage));
 }
示例#2
0
 public static GraphicsFormat GetCompatibleFormat(GraphicsFormat format, FormatUsage usage)
 {
     return(ShimManager.systemInfoShim.GetCompatibleFormat(format, usage));
 }
示例#3
0
 extern public static bool IsFormatSupported(GraphicsFormat format, FormatUsage usage);
示例#4
0
 extern public static GraphicsFormat GetCompatibleFormat(GraphicsFormat format, FormatUsage usage);
示例#5
0
            internal void Validate()
            {
                bool flag = this.width <= 0 || this.height <= 0 || this.tilesize <= 0;

                if (flag)
                {
                    throw new ArgumentException(string.Format("Zero sized dimensions are invalid (width: {0}, height: {1}, tilesize {2}", this.width, this.height, this.tilesize));
                }
                bool flag2 = this.layers == null || this.layers.Length > 4;

                if (flag2)
                {
                    throw new ArgumentException(string.Format("layers is either invalid or has too many layers (maxNumLayers: {0})", 4));
                }
                bool flag3 = this.gpuGeneration == 1 && this.filterMode != FilterMode.Bilinear;

                if (flag3)
                {
                    throw new ArgumentException("Filter mode invalid for GPU PVT; only FilterMode.Bilinear is currently supported");
                }
                bool flag4 = this.gpuGeneration == 0 && this.filterMode != FilterMode.Bilinear && this.filterMode != FilterMode.Trilinear;

                if (flag4)
                {
                    throw new ArgumentException("Filter mode invalid for CPU PVT; only FilterMode.Bilinear and FilterMode.Trilinear are currently supported");
                }
                GraphicsFormat[] array = new GraphicsFormat[]
                {
                    GraphicsFormat.R8G8B8A8_SRGB,
                    GraphicsFormat.R8G8B8A8_UNorm,
                    GraphicsFormat.R32G32B32A32_SFloat,
                    GraphicsFormat.R8G8_SRGB,
                    GraphicsFormat.R8G8_UNorm,
                    GraphicsFormat.R32_SFloat,
                    GraphicsFormat.RGB_DXT1_SRGB,
                    GraphicsFormat.RGB_DXT1_UNorm,
                    GraphicsFormat.RGBA_DXT5_SRGB,
                    GraphicsFormat.RGBA_DXT5_UNorm,
                    GraphicsFormat.RGBA_BC7_SRGB,
                    GraphicsFormat.RGBA_BC7_UNorm,
                    GraphicsFormat.RG_BC5_SNorm,
                    GraphicsFormat.RG_BC5_UNorm,
                    GraphicsFormat.RGB_BC6H_SFloat,
                    GraphicsFormat.RGB_BC6H_UFloat,
                    GraphicsFormat.R16_SFloat,
                    GraphicsFormat.R16_UNorm,
                    GraphicsFormat.R16G16_SFloat,
                    GraphicsFormat.R16G16_UNorm,
                    GraphicsFormat.R16G16B16A16_SFloat,
                    GraphicsFormat.R16G16B16A16_UNorm
                };
                GraphicsFormat[] array2 = new GraphicsFormat[]
                {
                    GraphicsFormat.R8G8B8A8_SRGB,
                    GraphicsFormat.R8G8B8A8_UNorm,
                    GraphicsFormat.R32G32B32A32_SFloat,
                    GraphicsFormat.R8G8_SRGB,
                    GraphicsFormat.R8G8_UNorm,
                    GraphicsFormat.R32_SFloat,
                    GraphicsFormat.A2B10G10R10_UNormPack32
                };
                FormatUsage usage = (this.gpuGeneration == 1) ? FormatUsage.Render : FormatUsage.Sample;

                for (int i = 0; i < this.layers.Length; i++)
                {
                    bool flag5 = SystemInfo.GetCompatibleFormat(this.layers[i], usage) != this.layers[i];
                    if (flag5)
                    {
                        throw new ArgumentException(string.Format("Requested format {0} on layer {1} is not supported on this platform", this.layers[i], i));
                    }
                    bool             flag6  = false;
                    GraphicsFormat[] array3 = (this.gpuGeneration == 1) ? array2 : array;
                    for (int j = 0; j < array3.Length; j++)
                    {
                        bool flag7 = this.layers[i] == array3[j];
                        if (flag7)
                        {
                            flag6 = true;
                            break;
                        }
                    }
                    bool flag8 = !flag6;
                    if (flag8)
                    {
                        throw new ArgumentException(string.Format("Invalid textureformat on layer: {0}. Supported formats are: {1}", i, array3));
                    }
                }
                bool flag9 = this.maxActiveRequests > 4095 || this.maxActiveRequests <= 0;

                if (flag9)
                {
                    throw new ArgumentException(string.Format("Invalid requests per frame (maxActiveRequests: ]0, {0}])", this.maxActiveRequests));
                }
            }
 public virtual GraphicsFormat GetCompatibleFormat(GraphicsFormat format, FormatUsage usage)
 {
     return(EditorSystemInfo.GetCompatibleFormat(format, usage));
 }
 public virtual bool IsFormatSupported(GraphicsFormat format, FormatUsage usage)
 {
     return(EditorSystemInfo.IsFormatSupported(format, usage));
 }
示例#8
0
 public override GraphicsFormat GetCompatibleFormat(GraphicsFormat format, FormatUsage usage)
 {
     return(base.GetCompatibleFormat(format, usage));
 }
示例#9
0
 public override bool IsFormatSupported(GraphicsFormat format, FormatUsage usage)
 {
     return(base.IsFormatSupported(format, usage));
 }