コード例 #1
0
        private void InternalReset()
        {
            GraphicsDevice device = NVIDIA.GraphicsDevice.device;

            if (device != null && m_DebugView != null)
            {
                device.DeleteDebugView(m_DebugView);
            }

            m_DebugView = null;
        }
コード例 #2
0
        private void InternalUpdate()
        {
            GraphicsDevice device      = NVIDIA.GraphicsDevice.device;
            bool           panelIsOpen = DebugManager.instance.displayRuntimeUI || DebugManager.instance.displayEditorUI;

            if (device != null)
            {
                if (panelIsOpen && m_DebugView == null)
                {
                    m_DebugView = device.CreateDebugView();
                }
                else if (!panelIsOpen && m_DebugView != null)
                {
                    device.DeleteDebugView(m_DebugView);
                    m_DebugView = null;
                }
            }

            if (device != null)
            {
                if (m_DebugView != null)
                {
                    m_Data.deviceState   = DeviceState.Active;
                    m_Data.dlssSupported = device.IsFeatureAvailable(UnityEngine.NVIDIA.GraphicsDeviceFeature.DLSS);
                    device.UpdateDebugView(m_DebugView);
                    m_Data.dlssFeatureInfos = TranslateDlssFeatureArray(m_Data.dlssFeatureInfos, m_DebugView);
                }
                else
                {
                    m_Data.deviceState = DeviceState.Unknown;
                }
            }
            else if (device == null)
            {
                bool isPluginLoaded = NVUnityPlugin.IsLoaded();
                m_Data.deviceState      = isPluginLoaded ?  DeviceState.DeviceCreationFailed : DeviceState.MissingPluginDLL;
                m_Data.dlssSupported    = false;
                m_Data.dlssFeatureInfos = null;
            }

            UpdateDebugUITable();
        }