mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Software rendering - Fixed memory leak
Rendering - Swap back and forth between software and GPU without crash
This commit is contained in:
1 parent
97668ee932
commit
c444ff4e59
8 files changed
+105
-79
No files matched your search
@@ -32,11 +32,9 @@
|
||||
<TextBlock Grid.Column="1" HorizontalAlignment="Right" Margin="0,0,5,0">
|
||||
<Run Text="FPS: " />
|
||||
<Run FontWeight="Bold" Text="{Binding CurrentFps}" />
|
||||
<Run Text=" at " />
|
||||
<Run Text="{Binding RenderWidth}" /><Run Text="x" />
|
||||
<Run Text="{Binding RenderHeight}" />
|
||||
|
||||
<Run Text=" - Renderer: "></Run>
|
||||
<Run Text="at" />
|
||||
<Run Text="{Binding RenderWidth}" /><Run Text="x" /><Run Text="{Binding RenderHeight}" />
|
||||
<Run Text="- Renderer:"></Run>
|
||||
<Run Text="{Binding Renderer}"></Run>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
|
||||
private int _renderHeight;
|
||||
private string _frameTargetPath;
|
||||
private string _renderer;
|
||||
private int _frames;
|
||||
private DateTime _frameCountStart;
|
||||
|
||||
public RenderDebugViewModel(ICoreService coreService)
|
||||
{
|
||||
@@ -76,8 +78,6 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
|
||||
{
|
||||
_coreService.FrameRendered += CoreServiceOnFrameRendered;
|
||||
_coreService.FrameRendering += CoreServiceOnFrameRendering;
|
||||
|
||||
Renderer = Constants.ManagedGraphicsContext != null ? Constants.ManagedGraphicsContext.GetType().Name : "Software";
|
||||
base.OnActivate();
|
||||
}
|
||||
|
||||
@@ -132,7 +132,15 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
|
||||
|
||||
private void CoreServiceOnFrameRendering(object sender, FrameRenderingEventArgs e)
|
||||
{
|
||||
CurrentFps = Math.Round(1.0 / e.DeltaTime, 2);
|
||||
if (DateTime.Now - _frameCountStart >= TimeSpan.FromSeconds(1))
|
||||
{
|
||||
CurrentFps = _frames;
|
||||
Renderer = Constants.ManagedGraphicsContext != null ? Constants.ManagedGraphicsContext.GetType().Name : "Software";
|
||||
|
||||
_frames = 0;
|
||||
_frameCountStart = DateTime.Now;
|
||||
}
|
||||
_frames++;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user