Updated TerraFX and D3D12MA packages
このコミットが含まれているのは:
1 親
05407c06e6
コミット
c6df0fc6ae
5ファイル変更
+25
-11
検索条件に一致するファイルはありません
@@ -6,5 +6,8 @@
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Company>Sergio Pedri</Company>
|
||||
<Copyright>Copyright (c) 2021 Sergio Pedri</Copyright>
|
||||
<RestoreAdditionalProjectSources>
|
||||
https://pkgs.terrafx.dev/index.json;
|
||||
</RestoreAdditionalProjectSources>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -51,7 +51,7 @@ internal unsafe static class Win32ApplicationRunner
|
||||
{
|
||||
Win32ApplicationRunner.application = application;
|
||||
|
||||
IntPtr hInstance = Windows.GetModuleHandleW(null);
|
||||
HMODULE hInstance = Windows.GetModuleHandleW(null);
|
||||
|
||||
fixed (char* name = Assembly.GetExecutingAssembly().FullName)
|
||||
fixed (char* windowTitle = application.GetType().ToString())
|
||||
@@ -61,9 +61,9 @@ internal unsafe static class Win32ApplicationRunner
|
||||
{
|
||||
cbSize = (uint)sizeof(WNDCLASSEXW),
|
||||
style = Windows.CS_HREDRAW | Windows.CS_VREDRAW,
|
||||
lpfnWndProc = &WindowProc,
|
||||
lpfnWndProc = (delegate* unmanaged<HWND, uint, WPARAM, LPARAM, LRESULT>)(delegate* unmanaged<IntPtr, uint, nuint, nint, nint>)&WindowProc,
|
||||
hInstance = hInstance,
|
||||
hCursor = Windows.LoadCursorW(IntPtr.Zero, Windows.IDC_ARROW),
|
||||
hCursor = Windows.LoadCursorW(HINSTANCE.NULL, Windows.IDC_ARROW),
|
||||
lpszClassName = (ushort*)name
|
||||
};
|
||||
|
||||
@@ -150,7 +150,7 @@ internal unsafe static class Win32ApplicationRunner
|
||||
}
|
||||
|
||||
// Also listen to Escape and 'Q' to quit
|
||||
if (msg.message == Windows.WM_KEYUP && (msg.wParam == Windows.VK_ESCAPE || msg.wParam == 'Q'))
|
||||
if (msg.message == Windows.WM_KEYUP && (msg.wParam == (WPARAM)Windows.VK_ESCAPE || msg.wParam == 'Q'))
|
||||
{
|
||||
_ = Windows.DestroyWindow(hwnd);
|
||||
}
|
||||
@@ -199,7 +199,7 @@ internal unsafe static class Win32ApplicationRunner
|
||||
|
||||
if (isPaused)
|
||||
{
|
||||
Windows.SetCapture(hwnd);
|
||||
Windows.SetCapture((HWND)hwnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -253,7 +253,7 @@ internal unsafe static class Win32ApplicationRunner
|
||||
RECT rect;
|
||||
|
||||
_ = Windows.GetCursorPos(&point);
|
||||
_ = Windows.GetWindowRect(hwnd, &rect);
|
||||
_ = Windows.GetWindowRect((HWND)hwnd, &rect);
|
||||
|
||||
bool isAtTop = Math.Abs(point.y - rect.top) < 12;
|
||||
bool isAtRight = Math.Abs(point.x - rect.right) < 12;
|
||||
@@ -300,7 +300,7 @@ internal unsafe static class Win32ApplicationRunner
|
||||
margins.cyTopHeight = -1;
|
||||
margins.cyBottomHeight = -1;
|
||||
|
||||
_ = Windows.DwmExtendFrameIntoClientArea(hwnd, &margins);
|
||||
_ = Windows.DwmExtendFrameIntoClientArea((HWND)hwnd, &margins);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -313,6 +313,6 @@ internal unsafe static class Win32ApplicationRunner
|
||||
}
|
||||
}
|
||||
|
||||
return Windows.DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||
return Windows.DefWindowProcW((HWND)hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Toolkit.Diagnostics" Version="7.1.1" />
|
||||
<PackageReference Include="TerraFX.Interop.D3D12MemoryAllocator" Version="2.0.0-beta2" />
|
||||
<PackageReference Include="TerraFX.Interop.D3D12MemoryAllocator" Version="2.0.0-beta3.1423935916" />
|
||||
</ItemGroup>
|
||||
|
||||
<Choose>
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
|
||||
using ComputeSharp.Graphics.Helpers;
|
||||
#endif
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using HRESULT = System.Int32;
|
||||
using TerraFX.Interop;
|
||||
|
||||
namespace ComputeSharp.Core.Extensions;
|
||||
|
||||
@@ -22,6 +22,17 @@ internal static class HResultExtensions
|
||||
/// <exception cref="Win32Exception">Thrown if <paramref name="result"/> represents an error.</exception>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void Assert(this HRESULT result)
|
||||
{
|
||||
Assert((int)result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Throws a <see cref="Win32Exception"/> if <paramref name="result"/> represents an error.
|
||||
/// </summary>
|
||||
/// <param name="result">The input <see cref="int"/> to check.</param>
|
||||
/// <exception cref="Win32Exception">Thrown if <paramref name="result"/> represents an error.</exception>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void Assert(this int result)
|
||||
{
|
||||
#if DEBUG
|
||||
bool hasErrorsOrWarnings = DeviceHelper.FlushAllID3D12InfoQueueMessagesAndCheckForErrorsOrWarnings();
|
||||
|
||||
@@ -116,7 +116,7 @@ internal sealed unsafe partial class ShaderCompiler
|
||||
dxcOperationResult.GetAddressOf()).Assert();
|
||||
}
|
||||
|
||||
int status;
|
||||
HRESULT status;
|
||||
|
||||
dxcOperationResult.Get()->GetStatus(&status).Assert();
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする