Add option to enable v-sync in shader panels
このコミットが含まれているのは:
1 親
b1fb409f73
コミット
9bc9c97eaa
6ファイル変更
+76
-2
検索条件に一致するファイルはありません
@@ -97,6 +97,17 @@ partial class SwapChainManager<TOwner>
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Queues a change in the vertical sync mode.
|
||||
/// </summary>
|
||||
/// <param name="isVerticalSyncEnabled">Whether or not to use vertical sync.</param>
|
||||
public void QueueVerticalSyncModeChange(bool isVerticalSyncEnabled)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
|
||||
this.syncInterval = isVerticalSyncEnabled ? 1u : 0u;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Queues a resize operation.
|
||||
/// </summary>
|
||||
|
||||
@@ -175,6 +175,11 @@ internal sealed unsafe partial class SwapChainManager<TOwner> : NativeObject
|
||||
/// </summary>
|
||||
private volatile bool isDynamicResolutionEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// The flags to enable or disable vertical sync.
|
||||
/// </summary>
|
||||
private volatile uint syncInterval;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Stopwatch"/> instance tracking time since the first rendered frame.
|
||||
/// </summary>
|
||||
@@ -388,7 +393,7 @@ internal sealed unsafe partial class SwapChainManager<TOwner> : NativeObject
|
||||
private unsafe partial void OnPresent()
|
||||
{
|
||||
// Wait for the swap chain to be ready for presenting
|
||||
_ = Win32.WaitForSingleObjectEx(frameLatencyWaitableObject, 1000, true);
|
||||
_ = Win32.WaitForSingleObjectEx(frameLatencyWaitableObject, Win32.INFINITE, true);
|
||||
|
||||
using ComPtr<ID3D12Resource> d3D12Resource = default;
|
||||
|
||||
@@ -455,7 +460,7 @@ internal sealed unsafe partial class SwapChainManager<TOwner> : NativeObject
|
||||
this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), updatedFenceValue).Assert();
|
||||
|
||||
// Present the new frame
|
||||
this.dxgiSwapChain3.Get()->Present(0, 0).Assert();
|
||||
this.dxgiSwapChain3.Get()->Present(SyncInterval: this.syncInterval, 0).Assert();
|
||||
|
||||
if (updatedFenceValue > this.d3D12Fence.Get()->GetCompletedValue())
|
||||
{
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする