private static SupportState _instance; //only declared once

    private SupportState()                 //set instance to itself
    {
        if (_instance != null)
        {
            return;
        }

        _instance = this;
    }
Exemplo n.º 2
0
        public static Color SupportStateToColor(SupportState value)
        {
            switch (value)
            {
            case SupportState.None: return(Color.black);

            case SupportState.Supported: return(Color.green);

            case SupportState.Unsupported: return(Color.red);

            case SupportState.Obsolete: return(Color.magenta);

            default: return(Color.white);
            }
        }
Exemplo n.º 3
0
        public static void Get()
        {
            deviceType            = SystemInfo.deviceType.ToString();
            operatingSystem       = SystemInfo.operatingSystem;
            unityVersion          = Application.unityVersion;
            graphicsDeviceName    = SystemInfo.graphicsDeviceName;
            graphicsDeviceVersion = SystemInfo.graphicsDeviceVersion;
            graphicsDeviceID      = SystemInfo.graphicsDeviceID.ToString();
            graphicsMemorySize    = SystemInfo.graphicsMemorySize.ToString();
            graphicsShaderLevel   = SystemInfo.graphicsShaderLevel.ToString();

            processorType      = SystemInfo.processorType;
            processorCount     = SystemInfo.processorCount.ToString();
            processorFrequency = SystemInfo.processorFrequency.ToString();

            systemMemorySize = SystemInfo.systemMemorySize.ToString();

            maxTextureSize = SystemInfo.maxTextureSize.ToString();
            npotSupport    = SystemInfo.npotSupport.ToString();

            supportsComputeShaders         = GetSupportState(SystemInfo.supportsComputeShaders);
            supports3DTextures             = GetSupportState(SystemInfo.supports3DTextures);
            supports2DArrayTextures        = GetSupportState(SystemInfo.supports2DArrayTextures);
            supports3DRenderTextures       = GetSupportState(SystemInfo.supports3DRenderTextures);
            supportsCubemapArrayTextures   = GetSupportState(SystemInfo.supportsCubemapArrayTextures);
            supportsRawShadowDepthSampling = GetSupportState(SystemInfo.supportsRawShadowDepthSampling);
            supportsMotionVectors          = GetSupportState(SystemInfo.supportsMotionVectors);
            supportsRenderToCubemap        = GetSupportState(SystemInfo.supportsRenderToCubemap);
            supportsImageEffects           = GetSupportState(SystemInfo.supportsImageEffects);
            supportsHardwareQuadTopology   = GetSupportState(SystemInfo.supportsHardwareQuadTopology);
            supports32bitsIndexBuffer      = GetSupportState(SystemInfo.supports32bitsIndexBuffer);
            supportsSparseTextures         = GetSupportState(SystemInfo.supportsSparseTextures);
            supportsAsyncCompute           = GetSupportState(SystemInfo.supportsAsyncCompute);
            supportsGPUFence         = GetSupportState(SystemInfo.supportsGPUFence);
            supportsAsyncGPUReadback = GetSupportState(SystemInfo.supportsAsyncGPUReadback);

            graphicsMultiThreaded = SystemInfo.graphicsMultiThreaded;
            usesReversedZBuffer   = SystemInfo.usesReversedZBuffer;

            graphicsMultiThreaded = SystemInfo.graphicsMultiThreaded;

            RenderTextureFormats = new Dictionary <RenderTextureFormat, SupportState>();
            TextureFormats       = new Dictionary <TextureFormat, SupportState>();

            var renderTextureFormats = Enum.GetValues(typeof(RenderTextureFormat)).OfType <RenderTextureFormat>().ToList();
            var texuteFormats        = Enum.GetValues(typeof(TextureFormat)).OfType <TextureFormat>().ToList();

            foreach (var format in renderTextureFormats)
            {
                var supports = SystemInfo.SupportsRenderTextureFormat(format);

                RenderTextureFormats.Add(format, GetSupportState(supports));
            }

            foreach (var format in texuteFormats)
            {
                // NOTE : Some elements of TextureFormat enum marked with ObsoleteAttribute, but Enum.GetValues returns it all...
                if (GetAttributeOfType <ObsoleteAttribute>(format) == null)
                {
                    var supports = SystemInfo.SupportsTextureFormat(format);

                    TextureFormats.Add(format, GetSupportState(supports));
                }
                else
                {
                    // NOTE : Double check it for a PVRTC_2BPP_RGB...
                    if (!TextureFormats.ContainsKey(format))
                    {
                        TextureFormats.Add(format, GetSupportState(null));
                    }
                }
            }
        }
Exemplo n.º 4
0
 public static SupportState ReduceSetSupportSearchTypeAction(SupportState state, SetSupportSearchTypeAction action) =>