private void DeviceSelectionChanged(object sender, EventArgs e) { UnRegisterControlEvents(); if (sender is GridDevicePage senderpage) { foreach (var page in m_tc.Pages) { if (page is GridDevicePage p && p != sender) { p.ClearSelection(); } } var vud = Settings; m_newDevice = ccl.Device.DeviceFromString(senderpage.DeviceSelectionString()); if (vud != null) { vud.IntermediateSelectedDeviceStr = m_newDevice.DeviceString; } if (m_for_app) { vud.SelectedDeviceStr = vud.IntermediateSelectedDeviceStr; } } RegisterControlEvents(); It_InitialisationCompleted(this, EventArgs.Empty); }
public void ViewportSettingsChangedHandler(object sender, ViewportSettingsChangedArgs e) { if (e.Settings.AllowSelectedDeviceOverride) { RenderDevice = ccl.Device.DeviceFromString(ccl.Device.ValidDeviceString(e.Settings.SelectedDeviceStr)); } else { RenderDevice = RcCore.It.EngineSettings.RenderDevice; } if (Session != null && Session.Scene != null) { var hash = e.Settings.IntegratorHash; if (hash != _oldIntegratorHash) { var integrator = Session.Scene.Integrator; integrator.Seed = e.Settings.Seed; integrator.DiffuseSamples = e.Settings.DiffuseSamples; integrator.GlossySamples = e.Settings.GlossySamples; integrator.MaxBounce = e.Settings.MaxBounce; integrator.MaxDiffuseBounce = e.Settings.MaxDiffuseBounce; integrator.MaxGlossyBounce = e.Settings.MaxGlossyBounce; integrator.MaxTransmissionBounce = e.Settings.MaxTransmissionBounce; integrator.MaxVolumeBounce = e.Settings.MaxVolumeBounce; integrator.TagForUpdate(); _needReset = true; _oldIntegratorHash = hash; } Session.SetSamples(e.Settings.Samples); _throttle = e.Settings.ThrottleMs; _samples = e.Settings.Samples; } }
private void DeviceSection_ViewportSettingsReceived(object sender, ViewportSettingsReceivedEventArgs e) { if (e.ViewportSettings != null) { m_currentDevice = RcCore.It.EngineSettings.RenderDevice; m_newDevice = ccl.Device.DeviceFromString(ccl.Device.ValidDeviceString(e.ViewportSettings.SelectedDeviceStr)); SuspendLayout(); UnRegisterControlEvents(); ShowDeviceData(); SetupDeviceData(e.ViewportSettings, m_tabpage_cpu.Collection, ccl.DeviceType.CPU); SetupDeviceData(e.ViewportSettings, m_tabpage_cuda.Collection, ccl.DeviceType.CUDA); SetupDeviceData(e.ViewportSettings, m_tabpage_opencl.Collection, ccl.DeviceType.OpenCL); ActivateDevicePage(e.ViewportSettings); RegisterControlEvents(); ResumeLayout(); } }
private void It_InitialisationCompleted(object sender, EventArgs e) { Application.Instance.AsyncInvoke(() => { IViewportSettings vud = Settings; if (vud == null) { return; } m_currentDevice = Settings.RenderDevice; m_newDevice = vud != null ? ccl.Device.DeviceFromString(ccl.Device.ValidDeviceString(vud.IntermediateSelectedDeviceStr)): m_currentDevice; SuspendLayout(); UnRegisterControlEvents(); ShowDeviceData(); SetupDeviceData(vud, m_tabpage_cpu.Collection, ccl.DeviceType.CPU); SetupDeviceData(vud, m_tabpage_cuda.Collection, ccl.DeviceType.CUDA); SetupDeviceData(vud, m_tabpage_opencl.Collection, ccl.DeviceType.OpenCL); ActivateDevicePage(vud); RegisterControlEvents(); ResumeLayout(); } ); }