Minor code tweaks to the WinUI project
このコミットが含まれているのは:
1 親
7f4704fd82
コミット
e0bddcea01
2ファイル変更
+14
-15
検索条件に一致するファイルはありません
@@ -1,11 +1,10 @@
|
||||
using System;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace ComputeSharp.WinUI
|
||||
{
|
||||
/// <inheritdoc cref="ComputeShaderPanel"/>
|
||||
public sealed unsafe partial class ComputeShaderPanel : SwapChainPanel
|
||||
public sealed unsafe partial class ComputeShaderPanel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="IShaderRunner"/> instance to use to render content.
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using ComputeSharp.Core.Extensions;
|
||||
using ComputeSharp.Interop;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using TerraFX.Interop;
|
||||
using WinRT;
|
||||
using FX = TerraFX.Interop.Windows;
|
||||
@@ -11,7 +10,7 @@ using FX = TerraFX.Interop.Windows;
|
||||
namespace ComputeSharp.WinUI
|
||||
{
|
||||
/// <inheritdoc cref="ComputeShaderPanel"/>
|
||||
public sealed partial class ComputeShaderPanel : SwapChainPanel
|
||||
public sealed partial class ComputeShaderPanel
|
||||
{
|
||||
/// <summary>
|
||||
/// The render thread in use, if any.
|
||||
@@ -232,21 +231,22 @@ namespace ComputeSharp.WinUI
|
||||
|
||||
// Extract the ISwapChainPanelNative reference from the current panel, then query the
|
||||
// IDXGISwapChain reference just created and set that as the swap chain panel to use.
|
||||
using (ComPtr<ISwapChainPanelNative> swapChainPanelNative = default)
|
||||
{
|
||||
IUnknown* swapChainPanel = (IUnknown*)((IWinRTObject)this).NativeObject.ThisPtr;
|
||||
Guid iSwapChainPanelNativeUuid = Guid.Parse("63AAD0B8-7C24-40FF-85A8-640D944CC325");
|
||||
using ComPtr<ISwapChainPanelNative> swapChainPanelNative = default;
|
||||
|
||||
swapChainPanel->QueryInterface(
|
||||
&iSwapChainPanelNativeUuid,
|
||||
(void**)&swapChainPanelNative).Assert();
|
||||
IUnknown* swapChainPanel = (IUnknown*)((IWinRTObject)this).NativeObject.ThisPtr;
|
||||
Guid iSwapChainPanelNativeUuid = new(0x63AAD0B8, 0x7C24, 0x40FF, 0x85, 0xA8, 0x64, 0x0D, 0x94, 0x4C, 0xC3, 0x25);
|
||||
|
||||
using ComPtr<IDXGISwapChain> idxgiSwapChain = default;
|
||||
swapChainPanel->QueryInterface(
|
||||
&iSwapChainPanelNativeUuid,
|
||||
(void**)&swapChainPanelNative).Assert();
|
||||
|
||||
this.dxgiSwapChain2.CopyTo(&idxgiSwapChain).Assert();
|
||||
using ComPtr<IDXGISwapChain> idxgiSwapChain = default;
|
||||
|
||||
swapChainPanelNative.Get()->SetSwapChain(idxgiSwapChain.Get()).Assert();
|
||||
}
|
||||
this.dxgiSwapChain2.CopyTo(&idxgiSwapChain).Assert();
|
||||
|
||||
swapChainPanelNative.Get()->SetSwapChain(idxgiSwapChain.Get()).Assert();
|
||||
|
||||
GC.KeepAlive(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする