internal static void HandleDeviceReset() { ResetAdaptersList(); DisposeDevice(); CreateDevice(m_windowHandle, m_settings); MyRenderContext.OnDeviceReset(); MyRenderContextPool.OnDeviceReset(); OnDeviceReset(); }
internal static void OnDeviceReset() { MyRenderContext.OnDeviceReset(); MyRenderContextPool.OnDeviceReset(); MyHwBuffers.OnDeviceReset(); MyShaders.OnDeviceReset(); MyMaterialShaders.OnDeviceReset(); MyPipelineStates.OnDeviceReset(); MyTextures.OnDeviceReset(); MyRwTextures.OnDeviceReset(); SamplerStates.OnDeviceReset(); MyTransparentRendering.OnDeviceReset(); ResetShadows(Settings.ShadowCascadeCount, RenderSettings.ShadowQuality.ShadowCascadeResolution()); MyBillboardRenderer.OnDeviceRestart(); MyScreenDecals.OnDeviceReset(); MyMeshMaterials1.OnDeviceReset(); MyVoxelMaterials1.OnDeviceReset(); MyRenderableComponent.MarkAllDirty(); foreach (var f in MyComponentFactory <MyFoliageComponent> .GetAll()) { f.Dispose(); } foreach (var c in MyComponentFactory <MyGroupRootComponent> .GetAll()) { c.OnDeviceReset(); } MyBigMeshTable.Table.OnDeviceReset(); MySceneMaterials.OnDeviceReset(); MyMeshes.OnDeviceReset(); MyInstancing.OnDeviceReset(); MyScreenDecals.OnDeviceReset(); }