Fixed rendering pause feature, added sample option
このコミットが含まれているのは:
1 親
2d89489e7f
コミット
255db239ea
4ファイル変更
+70
-4
検索条件に一致するファイルはありません
@@ -113,6 +113,11 @@ namespace ComputeSharp.WinUI
|
||||
/// </summary>
|
||||
private bool isCancellationRequested;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Stopwatch"/> instance tracking time since the first rendered frame.
|
||||
/// </summary>
|
||||
private Stopwatch? renderTimer;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the current application.
|
||||
/// </summary>
|
||||
@@ -375,12 +380,14 @@ namespace ComputeSharp.WinUI
|
||||
static void ExecuteRenderLoop(ComputeShaderPanel @this)
|
||||
{
|
||||
Stopwatch
|
||||
startStopwatch = Stopwatch.StartNew(),
|
||||
startStopwatch = @this.renderTimer ??= new(),
|
||||
frameStopwatch = Stopwatch.StartNew();
|
||||
|
||||
const long targetFrameTimeInTicksFor60fps = 166666;
|
||||
@this.OnUpdate(startStopwatch.Elapsed);
|
||||
|
||||
@this.OnUpdate(TimeSpan.Zero);
|
||||
startStopwatch.Start();
|
||||
|
||||
const long targetFrameTimeInTicksFor60fps = 166666;
|
||||
|
||||
while (!@this.isCancellationRequested)
|
||||
{
|
||||
@@ -391,6 +398,8 @@ namespace ComputeSharp.WinUI
|
||||
@this.OnUpdate(startStopwatch.Elapsed);
|
||||
}
|
||||
}
|
||||
|
||||
startStopwatch.Stop();
|
||||
}
|
||||
|
||||
this.isCancellationRequested = false;
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする