mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
capture test
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using Snap.Hutao.Win32.UI.Shell;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using static Snap.Hutao.Win32.Macros;
|
||||
using static Snap.Hutao.Win32.Ole32;
|
||||
using static Snap.Hutao.Win32.Shell32;
|
||||
@@ -62,13 +63,13 @@ internal static class FileOperation
|
||||
result = true;
|
||||
}
|
||||
|
||||
pDestShellItem->Release();
|
||||
IUnknownMarshal.Release(pDestShellItem);
|
||||
}
|
||||
|
||||
pSourceShellItem->Release();
|
||||
IUnknownMarshal.Release(pSourceShellItem);
|
||||
}
|
||||
|
||||
pFileOperation->Release();
|
||||
IUnknownMarshal.Release(pFileOperation);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -89,10 +90,10 @@ internal static class FileOperation
|
||||
result = true;
|
||||
}
|
||||
|
||||
pShellItem->Release();
|
||||
IUnknownMarshal.Release(pShellItem);
|
||||
}
|
||||
|
||||
pFileOperation->Release();
|
||||
IUnknownMarshal.Release(pFileOperation);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -54,7 +54,7 @@ internal sealed partial class ShellLinkInterop : IShellLinkInterop
|
||||
pShellLink->SetShowCmd(SHOW_WINDOW_CMD.SW_NORMAL);
|
||||
pShellLink->SetIconLocation(targetLogoPath, 0);
|
||||
|
||||
if (SUCCEEDED(pShellLink->QueryInterface(in IPersistFile.IID, out IPersistFile* pPersistFile)))
|
||||
if (SUCCEEDED(IUnknownMarshal.QueryInterface(pShellLink, in IPersistFile.IID, out IPersistFile* pPersistFile)))
|
||||
{
|
||||
string desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
|
||||
string target = Path.Combine(desktop, $"{SH.FormatAppNameAndVersion(runtimeOptions.Version)}.lnk");
|
||||
@@ -64,10 +64,10 @@ internal sealed partial class ShellLinkInterop : IShellLinkInterop
|
||||
result = true;
|
||||
}
|
||||
|
||||
pPersistFile->Release();
|
||||
IUnknownMarshal.Release(pPersistFile);
|
||||
}
|
||||
|
||||
pShellLink->Release();
|
||||
IUnknownMarshal.Release(pShellLink);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -98,6 +98,13 @@
|
||||
Style="{ThemeResource SettingButtonStyle}"/>
|
||||
</cwc:SettingsCard>
|
||||
|
||||
<cwc:SettingsCard Header="Test Windows.Graphics.Capture">
|
||||
<Button
|
||||
Command="{Binding TestWindowsGraphicsCaptureCommand}"
|
||||
Content="Test"
|
||||
Style="{ThemeResource SettingButtonStyle}"/>
|
||||
</cwc:SettingsCard>
|
||||
|
||||
<cwc:SettingsCard Header="Suppress Metadata Initialization">
|
||||
<ToggleSwitch IsOn="{Binding SuppressMetadataInitialization, Mode=TwoWay}"/>
|
||||
</cwc:SettingsCard>
|
||||
|
||||
@@ -2,11 +2,27 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Snap.Hutao.Core;
|
||||
using Snap.Hutao.Core.Caching;
|
||||
using Snap.Hutao.Core.LifeCycle;
|
||||
using Snap.Hutao.Core.Setting;
|
||||
using Snap.Hutao.Service.Notification;
|
||||
using Snap.Hutao.ViewModel.Guide;
|
||||
using Snap.Hutao.Web.Hutao.HutaoAsAService;
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.Graphics.Direct3D;
|
||||
using Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using Snap.Hutao.Win32.System.WinRT;
|
||||
using Snap.Hutao.Win32.System.WinRT.Graphics.Capture;
|
||||
using Windows.Graphics;
|
||||
using Windows.Graphics.Capture;
|
||||
using Windows.Graphics.DirectX;
|
||||
using Windows.Graphics.DirectX.Direct3D11;
|
||||
using static Snap.Hutao.Win32.ConstValues;
|
||||
using static Snap.Hutao.Win32.D3D11;
|
||||
using static Snap.Hutao.Win32.Macros;
|
||||
|
||||
namespace Snap.Hutao.ViewModel;
|
||||
|
||||
@@ -19,6 +35,7 @@ namespace Snap.Hutao.ViewModel;
|
||||
internal sealed partial class TestViewModel : Abstraction.ViewModel
|
||||
{
|
||||
private readonly HutaoAsAServiceClient homaAsAServiceClient;
|
||||
private readonly IServiceProvider serviceProvider;
|
||||
private readonly IInfoBarService infoBarService;
|
||||
private readonly ILogger<TestViewModel> logger;
|
||||
private readonly IMemoryCache memoryCache;
|
||||
@@ -136,4 +153,78 @@ internal sealed partial class TestViewModel : Abstraction.ViewModel
|
||||
logger.LogInformation("Failed ImageCache download tasks: [{Tasks}]", set?.ToString(','));
|
||||
}
|
||||
}
|
||||
|
||||
[Command("TestWindowsGraphicsCaptureCommand")]
|
||||
private unsafe void TestWindowsGraphicsCapture()
|
||||
{
|
||||
// https://github.com/obsproject/obs-studio/blob/master/libobs-winrt/winrt-capture.cpp
|
||||
if (!UniversalApiContract.IsPresent(WindowsVersion.Windows10Version1903))
|
||||
{
|
||||
logger.LogWarning("Windows 10 Version 1903 or later is required for Windows.Graphics.Capture API.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GraphicsCaptureSession.IsSupported())
|
||||
{
|
||||
logger.LogWarning("GraphicsCaptureSession is not supported.");
|
||||
return;
|
||||
}
|
||||
|
||||
D3D11_CREATE_DEVICE_FLAG flag = D3D11_CREATE_DEVICE_FLAG.D3D11_CREATE_DEVICE_BGRA_SUPPORT | D3D11_CREATE_DEVICE_FLAG.D3D11_CREATE_DEVICE_DEBUG;
|
||||
|
||||
ID3D11Device* pD3D11Device = default;
|
||||
if (SUCCEEDED(D3D11CreateDevice(default, D3D_DRIVER_TYPE.D3D_DRIVER_TYPE_HARDWARE, default, flag, default, 0, D3D11_SDK_VERSION, &pD3D11Device, default, default)))
|
||||
{
|
||||
if (SUCCEEDED(IUnknownMarshal.QueryInterface(pD3D11Device, in IDXGIDevice.IID, out IDXGIDevice* pDXGIDevice)))
|
||||
{
|
||||
if (SUCCEEDED(CreateDirect3D11DeviceFromDXGIDevice(pDXGIDevice, out IInspectable* inspectable)))
|
||||
{
|
||||
IDirect3DDevice direct3DDevice = WinRT.CastExtensions.As<IDirect3DDevice>(WinRT.IInspectable.FromAbi((nint)inspectable));
|
||||
|
||||
SizeInt32 size = new(1920, 1080);
|
||||
Direct3D11CaptureFramePool framePool = Direct3D11CaptureFramePool.CreateFreeThreaded(direct3DDevice, DirectXPixelFormat.B8G8R8A8UIntNormalized, 2, size);
|
||||
GC.KeepAlive(framePool);
|
||||
framePool.FrameArrived += (pool, obj) =>
|
||||
{
|
||||
using (Direct3D11CaptureFrame frame = framePool.TryGetNextFrame())
|
||||
{
|
||||
if (frame is not null)
|
||||
{
|
||||
logger.LogInformation("Content Size: {Width} x {Height}", frame.ContentSize.Width, frame.ContentSize.Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.LogInformation("Null Frame");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
HWND hwnd = serviceProvider.GetRequiredService<ICurrentWindowReference>().GetWindowHandle();
|
||||
|
||||
GraphicsCaptureItem.As<IGraphicsCaptureItemInterop>().CreateForWindow(hwnd, out GraphicsCaptureItem item);
|
||||
|
||||
GraphicsCaptureSession captureSession = framePool.CreateCaptureSession(item);
|
||||
captureSession.StartCapture();
|
||||
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.LogWarning("CreateDirect3D11DeviceFromDXGIDevice failed");
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(pDXGIDevice);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.LogWarning("ID3D11Device As IDXGIDevice failed");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.LogWarning("D3D11CreateDevice failed");
|
||||
}
|
||||
|
||||
_ = 1;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ namespace Snap.Hutao.Win32;
|
||||
[SuppressMessage("", "SA1310")]
|
||||
internal static class ConstValues
|
||||
{
|
||||
public const uint D3D11_SDK_VERSION = 0x00000007U;
|
||||
public const uint WM_NULL = 0x00000000U;
|
||||
public const uint WM_ERASEBKGND = 0x00000014U;
|
||||
public const uint WM_GETMINMAXINFO = 0x00000024U;
|
||||
|
||||
32
src/Snap.Hutao/Snap.Hutao/Win32/D3D11.cs
Normal file
32
src/Snap.Hutao/Snap.Hutao/Win32/D3D11.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.Graphics.Direct3D;
|
||||
using Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
using Snap.Hutao.Win32.System.WinRT;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32;
|
||||
|
||||
[SuppressMessage("", "SA1313")]
|
||||
[SuppressMessage("", "SYSLIB1054")]
|
||||
internal static class D3D11
|
||||
{
|
||||
[DllImport("d3d11.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
public static unsafe extern HRESULT CreateDirect3D11DeviceFromDXGIDevice(IDXGIDevice* dxgiDevice, IInspectable** graphicsDevice);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe HRESULT CreateDirect3D11DeviceFromDXGIDevice(IDXGIDevice* dxgiDevice, out IInspectable* graphicsDevice)
|
||||
{
|
||||
fixed (IInspectable** pGraphicsDevice = &graphicsDevice)
|
||||
{
|
||||
return CreateDirect3D11DeviceFromDXGIDevice(dxgiDevice, pGraphicsDevice);
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("d3d11.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
public static unsafe extern HRESULT D3D11CreateDevice([AllowNull] IDXGIAdapter* pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, D3D11_CREATE_DEVICE_FLAG Flags, [AllowNull] D3D_FEATURE_LEVEL* pFeatureLevels, uint FeatureLevels, uint SDKVersion, [MaybeNull] ID3D11Device** ppDevice, [MaybeNull] D3D_FEATURE_LEVEL* pFeatureLevel, [MaybeNull] ID3D11DeviceContext** ppImmediateContext);
|
||||
}
|
||||
29
src/Snap.Hutao/Snap.Hutao/Win32/D3D12.cs
Normal file
29
src/Snap.Hutao/Snap.Hutao/Win32/D3D12.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.Graphics.Direct3D;
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32;
|
||||
|
||||
[SuppressMessage("", "SA1313")]
|
||||
[SuppressMessage("", "SYSLIB1054")]
|
||||
internal static class D3D12
|
||||
{
|
||||
[DllImport("d3d12.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
public static unsafe extern HRESULT D3D12CreateDevice([AllowNull] IUnknown* pAdapter, D3D_FEATURE_LEVEL MinimumFeatureLevel, Guid* riid, void** ppDevice);
|
||||
|
||||
public static unsafe HRESULT D3D12CreateDevice<T>([AllowNull] IUnknown* pAdapter, D3D_FEATURE_LEVEL MinimumFeatureLevel, ref readonly Guid riid, [MaybeNull] out T* pDevice)
|
||||
where T : unmanaged
|
||||
{
|
||||
fixed (Guid* riid2 = &riid)
|
||||
{
|
||||
fixed (T** pDevice2 = &pDevice)
|
||||
{
|
||||
return D3D12CreateDevice(pAdapter, MinimumFeatureLevel, riid2, (void**)pDevice2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,4 +12,6 @@ internal readonly struct HWND
|
||||
public bool IsNull => Value is 0;
|
||||
|
||||
public static unsafe implicit operator HWND(nint value) => *(HWND*)&value;
|
||||
|
||||
public static unsafe implicit operator nint(HWND value) => *(nint*)&value;
|
||||
}
|
||||
10
src/Snap.Hutao/Snap.Hutao/Win32/Foundation/LUID.cs
Normal file
10
src/Snap.Hutao/Snap.Hutao/Win32/Foundation/LUID.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Foundation;
|
||||
|
||||
internal readonly struct LUID
|
||||
{
|
||||
public readonly uint LowPart;
|
||||
public readonly int HighPart;
|
||||
}
|
||||
9
src/Snap.Hutao/Snap.Hutao/Win32/Foundation/PCSTR.cs
Normal file
9
src/Snap.Hutao/Snap.Hutao/Win32/Foundation/PCSTR.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Foundation;
|
||||
|
||||
internal readonly struct PCSTR
|
||||
{
|
||||
public readonly unsafe byte* Value;
|
||||
}
|
||||
9
src/Snap.Hutao/Snap.Hutao/Win32/Foundation/PSTR.cs
Normal file
9
src/Snap.Hutao/Snap.Hutao/Win32/Foundation/PSTR.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Foundation;
|
||||
|
||||
internal readonly struct PSTR
|
||||
{
|
||||
public readonly unsafe byte* Value;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D;
|
||||
|
||||
internal enum D3D_DRIVER_TYPE
|
||||
{
|
||||
D3D_DRIVER_TYPE_UNKNOWN = 0,
|
||||
D3D_DRIVER_TYPE_HARDWARE = 1,
|
||||
D3D_DRIVER_TYPE_REFERENCE = 2,
|
||||
D3D_DRIVER_TYPE_NULL = 3,
|
||||
D3D_DRIVER_TYPE_SOFTWARE = 4,
|
||||
D3D_DRIVER_TYPE_WARP = 5,
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D;
|
||||
|
||||
internal enum D3D_FEATURE_LEVEL
|
||||
{
|
||||
D3D_FEATURE_LEVEL_1_0_GENERIC = 0x100,
|
||||
D3D_FEATURE_LEVEL_1_0_CORE = 0x1000,
|
||||
D3D_FEATURE_LEVEL_9_1 = 0x9100,
|
||||
D3D_FEATURE_LEVEL_9_2 = 0x9200,
|
||||
D3D_FEATURE_LEVEL_9_3 = 0x9300,
|
||||
D3D_FEATURE_LEVEL_10_0 = 0xA000,
|
||||
D3D_FEATURE_LEVEL_10_1 = 0xA100,
|
||||
D3D_FEATURE_LEVEL_11_0 = 0xB000,
|
||||
D3D_FEATURE_LEVEL_11_1 = 0xB100,
|
||||
D3D_FEATURE_LEVEL_12_0 = 0xC000,
|
||||
D3D_FEATURE_LEVEL_12_1 = 0xC100,
|
||||
D3D_FEATURE_LEVEL_12_2 = 0xC200,
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D;
|
||||
|
||||
internal enum D3D_PRIMITIVE_TOPOLOGY
|
||||
{
|
||||
D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0,
|
||||
D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINELIST = 2,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLEFAN = 6,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13,
|
||||
D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33,
|
||||
D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = 34,
|
||||
D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = 35,
|
||||
D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = 36,
|
||||
D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = 37,
|
||||
D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = 38,
|
||||
D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = 39,
|
||||
D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = 40,
|
||||
D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = 41,
|
||||
D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = 42,
|
||||
D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = 43,
|
||||
D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = 44,
|
||||
D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = 45,
|
||||
D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = 46,
|
||||
D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = 47,
|
||||
D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = 48,
|
||||
D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = 49,
|
||||
D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = 50,
|
||||
D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = 51,
|
||||
D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = 52,
|
||||
D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = 53,
|
||||
D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = 54,
|
||||
D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = 55,
|
||||
D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = 56,
|
||||
D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = 57,
|
||||
D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = 58,
|
||||
D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = 59,
|
||||
D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = 60,
|
||||
D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = 61,
|
||||
D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = 62,
|
||||
D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = 63,
|
||||
D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = 64,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED = 0,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_POINTLIST = 1,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_LINELIST = 2,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP = 3,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED = 0,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_POINTLIST = 1,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_LINELIST = 2,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP = 3,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = 34,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = 35,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = 36,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = 37,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = 38,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = 39,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = 40,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = 41,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = 42,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = 43,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = 44,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = 45,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = 46,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = 47,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = 48,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = 49,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = 50,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = 51,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = 52,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = 53,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = 54,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = 55,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = 56,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = 57,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = 58,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = 59,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = 60,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = 61,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = 62,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = 63,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = 64,
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D;
|
||||
|
||||
internal enum D3D_SRV_DIMENSION
|
||||
{
|
||||
D3D_SRV_DIMENSION_UNKNOWN = 0,
|
||||
D3D_SRV_DIMENSION_BUFFER = 1,
|
||||
D3D_SRV_DIMENSION_TEXTURE1D = 2,
|
||||
D3D_SRV_DIMENSION_TEXTURE1DARRAY = 3,
|
||||
D3D_SRV_DIMENSION_TEXTURE2D = 4,
|
||||
D3D_SRV_DIMENSION_TEXTURE2DARRAY = 5,
|
||||
D3D_SRV_DIMENSION_TEXTURE2DMS = 6,
|
||||
D3D_SRV_DIMENSION_TEXTURE2DMSARRAY = 7,
|
||||
D3D_SRV_DIMENSION_TEXTURE3D = 8,
|
||||
D3D_SRV_DIMENSION_TEXTURECUBE = 9,
|
||||
D3D_SRV_DIMENSION_TEXTURECUBEARRAY = 10,
|
||||
D3D_SRV_DIMENSION_BUFFEREX = 11,
|
||||
D3D10_SRV_DIMENSION_UNKNOWN = 0,
|
||||
D3D10_SRV_DIMENSION_BUFFER = 1,
|
||||
D3D10_SRV_DIMENSION_TEXTURE1D = 2,
|
||||
D3D10_SRV_DIMENSION_TEXTURE1DARRAY = 3,
|
||||
D3D10_SRV_DIMENSION_TEXTURE2D = 4,
|
||||
D3D10_SRV_DIMENSION_TEXTURE2DARRAY = 5,
|
||||
D3D10_SRV_DIMENSION_TEXTURE2DMS = 6,
|
||||
D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY = 7,
|
||||
D3D10_SRV_DIMENSION_TEXTURE3D = 8,
|
||||
D3D10_SRV_DIMENSION_TEXTURECUBE = 9,
|
||||
D3D10_1_SRV_DIMENSION_UNKNOWN = 0,
|
||||
D3D10_1_SRV_DIMENSION_BUFFER = 1,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE1D = 2,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY = 3,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE2D = 4,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY = 5,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE2DMS = 6,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY = 7,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE3D = 8,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURECUBE = 9,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY = 10,
|
||||
D3D11_SRV_DIMENSION_UNKNOWN = 0,
|
||||
D3D11_SRV_DIMENSION_BUFFER = 1,
|
||||
D3D11_SRV_DIMENSION_TEXTURE1D = 2,
|
||||
D3D11_SRV_DIMENSION_TEXTURE1DARRAY = 3,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2D = 4,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2DARRAY = 5,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2DMS = 6,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY = 7,
|
||||
D3D11_SRV_DIMENSION_TEXTURE3D = 8,
|
||||
D3D11_SRV_DIMENSION_TEXTURECUBE = 9,
|
||||
D3D11_SRV_DIMENSION_TEXTURECUBEARRAY = 10,
|
||||
D3D11_SRV_DIMENSION_BUFFEREX = 11,
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[Flags]
|
||||
internal enum D3D11_BIND_FLAG : uint
|
||||
{
|
||||
D3D11_BIND_VERTEX_BUFFER = 0x1,
|
||||
D3D11_BIND_INDEX_BUFFER = 0x2,
|
||||
D3D11_BIND_CONSTANT_BUFFER = 0x4,
|
||||
D3D11_BIND_SHADER_RESOURCE = 0x8,
|
||||
D3D11_BIND_STREAM_OUTPUT = 0x10,
|
||||
D3D11_BIND_RENDER_TARGET = 0x20,
|
||||
D3D11_BIND_DEPTH_STENCIL = 0x40,
|
||||
D3D11_BIND_UNORDERED_ACCESS = 0x80,
|
||||
D3D11_BIND_DECODER = 0x200,
|
||||
D3D11_BIND_VIDEO_ENCODER = 0x400,
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_BLEND
|
||||
{
|
||||
D3D11_BLEND_ZERO = 1,
|
||||
D3D11_BLEND_ONE = 2,
|
||||
D3D11_BLEND_SRC_COLOR = 3,
|
||||
D3D11_BLEND_INV_SRC_COLOR = 4,
|
||||
D3D11_BLEND_SRC_ALPHA = 5,
|
||||
D3D11_BLEND_INV_SRC_ALPHA = 6,
|
||||
D3D11_BLEND_DEST_ALPHA = 7,
|
||||
D3D11_BLEND_INV_DEST_ALPHA = 8,
|
||||
D3D11_BLEND_DEST_COLOR = 9,
|
||||
D3D11_BLEND_INV_DEST_COLOR = 10,
|
||||
D3D11_BLEND_SRC_ALPHA_SAT = 11,
|
||||
D3D11_BLEND_BLEND_FACTOR = 14,
|
||||
D3D11_BLEND_INV_BLEND_FACTOR = 15,
|
||||
D3D11_BLEND_SRC1_COLOR = 16,
|
||||
D3D11_BLEND_INV_SRC1_COLOR = 17,
|
||||
D3D11_BLEND_SRC1_ALPHA = 18,
|
||||
D3D11_BLEND_INV_SRC1_ALPHA = 19,
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_BLEND_DESC
|
||||
{
|
||||
public BOOL AlphaToCoverageEnable;
|
||||
public BOOL IndependentBlendEnable;
|
||||
public D3D11_RENDER_TARGET_BLEND_DESC_8 RenderTarget;
|
||||
|
||||
[InlineArray(8)]
|
||||
internal struct D3D11_RENDER_TARGET_BLEND_DESC_8
|
||||
{
|
||||
public D3D11_RENDER_TARGET_BLEND_DESC Value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_BLEND_OP
|
||||
{
|
||||
D3D11_BLEND_OP_ADD = 1,
|
||||
D3D11_BLEND_OP_SUBTRACT = 2,
|
||||
D3D11_BLEND_OP_REV_SUBTRACT = 3,
|
||||
D3D11_BLEND_OP_MIN = 4,
|
||||
D3D11_BLEND_OP_MAX = 5,
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
public struct D3D11_BOX
|
||||
{
|
||||
public uint left;
|
||||
public uint top;
|
||||
public uint front;
|
||||
public uint right;
|
||||
public uint bottom;
|
||||
public uint back;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_BUFFEREX_SRV
|
||||
{
|
||||
public uint FirstElement;
|
||||
public uint NumElements;
|
||||
public uint Flags;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_BUFFER_DESC
|
||||
{
|
||||
public uint ByteWidth;
|
||||
public D3D11_USAGE Usage;
|
||||
public D3D11_BIND_FLAG BindFlags;
|
||||
public D3D11_CPU_ACCESS_FLAG CPUAccessFlags;
|
||||
public D3D11_RESOURCE_MISC_FLAG MiscFlags;
|
||||
public uint StructureByteStride;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_BUFFER_RTV
|
||||
{
|
||||
public Union1 Anonymous1;
|
||||
public Union2 Anonymous2;
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
internal struct Union1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public uint FirstElement;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public uint ElementOffset;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
internal struct Union2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public uint NumElements;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public uint ElementWidth;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_BUFFER_SRV
|
||||
{
|
||||
public Union1 Anonymous1;
|
||||
public Union2 Anonymous2;
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
internal struct Union1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public uint FirstElement;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public uint ElementOffset;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
internal struct Union2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public uint NumElements;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public uint ElementWidth;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_BUFFER_UAV
|
||||
{
|
||||
public uint FirstElement;
|
||||
public uint NumElements;
|
||||
public uint Flags;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_CLASS_INSTANCE_DESC
|
||||
{
|
||||
public uint InstanceId;
|
||||
public uint InstanceIndex;
|
||||
public uint TypeId;
|
||||
public uint ConstantBuffer;
|
||||
public uint BaseConstantBufferOffset;
|
||||
public uint BaseTexture;
|
||||
public uint BaseSampler;
|
||||
public BOOL Created;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_COMPARISON_FUNC
|
||||
{
|
||||
D3D11_COMPARISON_NEVER = 1,
|
||||
D3D11_COMPARISON_LESS = 2,
|
||||
D3D11_COMPARISON_EQUAL = 3,
|
||||
D3D11_COMPARISON_LESS_EQUAL = 4,
|
||||
D3D11_COMPARISON_GREATER = 5,
|
||||
D3D11_COMPARISON_NOT_EQUAL = 6,
|
||||
D3D11_COMPARISON_GREATER_EQUAL = 7,
|
||||
D3D11_COMPARISON_ALWAYS = 8,
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_COUNTER
|
||||
{
|
||||
D3D11_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_COUNTER_DESC
|
||||
{
|
||||
public D3D11_COUNTER Counter;
|
||||
public uint MiscFlags;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_COUNTER_INFO
|
||||
{
|
||||
public D3D11_COUNTER LastDeviceDependentCounter;
|
||||
public uint NumSimultaneousCounters;
|
||||
public byte NumDetectableParallelUnits;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_COUNTER_TYPE
|
||||
{
|
||||
D3D11_COUNTER_TYPE_FLOAT32 = 0,
|
||||
D3D11_COUNTER_TYPE_UINT16 = 1,
|
||||
D3D11_COUNTER_TYPE_UINT32 = 2,
|
||||
D3D11_COUNTER_TYPE_UINT64 = 3,
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[Flags]
|
||||
internal enum D3D11_CPU_ACCESS_FLAG : uint
|
||||
{
|
||||
D3D11_CPU_ACCESS_WRITE = 0x10000,
|
||||
D3D11_CPU_ACCESS_READ = 0x20000,
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[Flags]
|
||||
public enum D3D11_CREATE_DEVICE_FLAG : uint
|
||||
{
|
||||
D3D11_CREATE_DEVICE_SINGLETHREADED = 0x1U,
|
||||
D3D11_CREATE_DEVICE_DEBUG = 0x2U,
|
||||
D3D11_CREATE_DEVICE_SWITCH_TO_REF = 0x4U,
|
||||
D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8U,
|
||||
D3D11_CREATE_DEVICE_BGRA_SUPPORT = 0x20U,
|
||||
D3D11_CREATE_DEVICE_DEBUGGABLE = 0x40U,
|
||||
D3D11_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY = 0x80U,
|
||||
D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT = 0x100U,
|
||||
D3D11_CREATE_DEVICE_VIDEO_SUPPORT = 0x800U,
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_CULL_MODE
|
||||
{
|
||||
D3D11_CULL_NONE = 1,
|
||||
D3D11_CULL_FRONT = 2,
|
||||
D3D11_CULL_BACK = 3
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_DEPTH_STENCILOP_DESC
|
||||
{
|
||||
public D3D11_STENCIL_OP StencilFailOp;
|
||||
public D3D11_STENCIL_OP StencilDepthFailOp;
|
||||
public D3D11_STENCIL_OP StencilPassOp;
|
||||
public D3D11_COMPARISON_FUNC StencilFunc;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_DEPTH_STENCIL_DESC
|
||||
{
|
||||
public BOOL DepthEnable;
|
||||
public D3D11_DEPTH_WRITE_MASK DepthWriteMask;
|
||||
public D3D11_COMPARISON_FUNC DepthFunc;
|
||||
public BOOL StencilEnable;
|
||||
public byte StencilReadMask;
|
||||
public byte StencilWriteMask;
|
||||
public D3D11_DEPTH_STENCILOP_DESC FrontFace;
|
||||
public D3D11_DEPTH_STENCILOP_DESC BackFace;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi.Common;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_DEPTH_STENCIL_VIEW_DESC
|
||||
{
|
||||
public DXGI_FORMAT Format;
|
||||
public D3D11_DSV_DIMENSION ViewDimension;
|
||||
public uint Flags;
|
||||
public Union Anonymous;
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public struct Union
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX1D_DSV Texture1D;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX1D_ARRAY_DSV Texture1DArray;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2D_DSV Texture2D;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2D_ARRAY_DSV Texture2DArray;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2DMS_DSV Texture2DMS;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2DMS_ARRAY_DSV Texture2DMSArray;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_DEPTH_WRITE_MASK
|
||||
{
|
||||
D3D11_DEPTH_WRITE_MASK_ZERO = 0,
|
||||
D3D11_DEPTH_WRITE_MASK_ALL = 1,
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_DEVICE_CONTEXT_TYPE
|
||||
{
|
||||
D3D11_DEVICE_CONTEXT_IMMEDIATE = 0,
|
||||
D3D11_DEVICE_CONTEXT_DEFERRED = 1,
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_DSV_DIMENSION
|
||||
{
|
||||
D3D11_DSV_DIMENSION_UNKNOWN = 0,
|
||||
D3D11_DSV_DIMENSION_TEXTURE1D = 1,
|
||||
D3D11_DSV_DIMENSION_TEXTURE1DARRAY = 2,
|
||||
D3D11_DSV_DIMENSION_TEXTURE2D = 3,
|
||||
D3D11_DSV_DIMENSION_TEXTURE2DARRAY = 4,
|
||||
D3D11_DSV_DIMENSION_TEXTURE2DMS = 5,
|
||||
D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY = 6,
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_FEATURE
|
||||
{
|
||||
D3D11_FEATURE_THREADING = 0,
|
||||
D3D11_FEATURE_DOUBLES = 1,
|
||||
D3D11_FEATURE_FORMAT_SUPPORT = 2,
|
||||
D3D11_FEATURE_FORMAT_SUPPORT2 = 3,
|
||||
D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS = 4,
|
||||
D3D11_FEATURE_D3D11_OPTIONS = 5,
|
||||
D3D11_FEATURE_ARCHITECTURE_INFO = 6,
|
||||
D3D11_FEATURE_D3D9_OPTIONS = 7,
|
||||
D3D11_FEATURE_SHADER_MIN_PRECISION_SUPPORT = 8,
|
||||
D3D11_FEATURE_D3D9_SHADOW_SUPPORT = 9,
|
||||
D3D11_FEATURE_D3D11_OPTIONS1 = 10,
|
||||
D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT = 11,
|
||||
D3D11_FEATURE_MARKER_SUPPORT = 12,
|
||||
D3D11_FEATURE_D3D9_OPTIONS1 = 13,
|
||||
D3D11_FEATURE_D3D11_OPTIONS2 = 14,
|
||||
D3D11_FEATURE_D3D11_OPTIONS3 = 15,
|
||||
D3D11_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = 16,
|
||||
D3D11_FEATURE_D3D11_OPTIONS4 = 17,
|
||||
D3D11_FEATURE_SHADER_CACHE = 18,
|
||||
D3D11_FEATURE_D3D11_OPTIONS5 = 19,
|
||||
D3D11_FEATURE_DISPLAYABLE = 20,
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_FILL_MODE
|
||||
{
|
||||
D3D11_FILL_WIREFRAME = 2,
|
||||
D3D11_FILL_SOLID = 3,
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_FILTER
|
||||
{
|
||||
D3D11_FILTER_MIN_MAG_MIP_POINT = 0,
|
||||
D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR = 1,
|
||||
D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 4,
|
||||
D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR = 5,
|
||||
D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT = 16,
|
||||
D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 17,
|
||||
D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT = 20,
|
||||
D3D11_FILTER_MIN_MAG_MIP_LINEAR = 21,
|
||||
D3D11_FILTER_ANISOTROPIC = 85,
|
||||
D3D11_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 128,
|
||||
D3D11_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 129,
|
||||
D3D11_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 132,
|
||||
D3D11_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 133,
|
||||
D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 144,
|
||||
D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 145,
|
||||
D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 148,
|
||||
D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 149,
|
||||
D3D11_FILTER_COMPARISON_ANISOTROPIC = 213,
|
||||
D3D11_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 256,
|
||||
D3D11_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 257,
|
||||
D3D11_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 260,
|
||||
D3D11_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR = 261,
|
||||
D3D11_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT = 272,
|
||||
D3D11_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 273,
|
||||
D3D11_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 276,
|
||||
D3D11_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 277,
|
||||
D3D11_FILTER_MINIMUM_ANISOTROPIC = 341,
|
||||
D3D11_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 384,
|
||||
D3D11_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 385,
|
||||
D3D11_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 388,
|
||||
D3D11_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR = 389,
|
||||
D3D11_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT = 400,
|
||||
D3D11_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 401,
|
||||
D3D11_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 404,
|
||||
D3D11_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 405,
|
||||
D3D11_FILTER_MAXIMUM_ANISOTROPIC = 469,
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_INPUT_CLASSIFICATION
|
||||
{
|
||||
D3D11_INPUT_PER_VERTEX_DATA = 0,
|
||||
D3D11_INPUT_PER_INSTANCE_DATA = 1,
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi.Common;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_INPUT_ELEMENT_DESC
|
||||
{
|
||||
public PCSTR SemanticName;
|
||||
public uint SemanticIndex;
|
||||
public DXGI_FORMAT Format;
|
||||
public uint InputSlot;
|
||||
public uint AlignedByteOffset;
|
||||
public D3D11_INPUT_CLASSIFICATION InputSlotClass;
|
||||
public uint InstanceDataStepRate;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_MAP
|
||||
{
|
||||
D3D11_MAP_READ = 1,
|
||||
D3D11_MAP_WRITE = 2,
|
||||
D3D11_MAP_READ_WRITE = 3,
|
||||
D3D11_MAP_WRITE_DISCARD = 4,
|
||||
D3D11_MAP_WRITE_NO_OVERWRITE = 5,
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_MAPPED_SUBRESOURCE
|
||||
{
|
||||
public unsafe void* pData;
|
||||
public uint RowPitch;
|
||||
public uint DepthPitch;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_QUERY
|
||||
{
|
||||
D3D11_QUERY_EVENT = 0,
|
||||
D3D11_QUERY_OCCLUSION = 1,
|
||||
D3D11_QUERY_TIMESTAMP = 2,
|
||||
D3D11_QUERY_TIMESTAMP_DISJOINT = 3,
|
||||
D3D11_QUERY_PIPELINE_STATISTICS = 4,
|
||||
D3D11_QUERY_OCCLUSION_PREDICATE = 5,
|
||||
D3D11_QUERY_SO_STATISTICS = 6,
|
||||
D3D11_QUERY_SO_OVERFLOW_PREDICATE = 7,
|
||||
D3D11_QUERY_SO_STATISTICS_STREAM0 = 8,
|
||||
D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 = 9,
|
||||
D3D11_QUERY_SO_STATISTICS_STREAM1 = 10,
|
||||
D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 = 11,
|
||||
D3D11_QUERY_SO_STATISTICS_STREAM2 = 12,
|
||||
D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 = 13,
|
||||
D3D11_QUERY_SO_STATISTICS_STREAM3 = 14,
|
||||
D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM3 = 15,
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_QUERY_DESC
|
||||
{
|
||||
public D3D11_QUERY Query;
|
||||
public uint MiscFlags;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_RASTERIZER_DESC
|
||||
{
|
||||
public D3D11_FILL_MODE FillMode;
|
||||
public D3D11_CULL_MODE CullMode;
|
||||
public BOOL FrontCounterClockwise;
|
||||
public int DepthBias;
|
||||
public float DepthBiasClamp;
|
||||
public float SlopeScaledDepthBias;
|
||||
public BOOL DepthClipEnable;
|
||||
public BOOL ScissorEnable;
|
||||
public BOOL MultisampleEnable;
|
||||
public BOOL AntialiasedLineEnable;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_RENDER_TARGET_BLEND_DESC
|
||||
{
|
||||
public BOOL BlendEnable;
|
||||
public D3D11_BLEND SrcBlend;
|
||||
public D3D11_BLEND DestBlend;
|
||||
public D3D11_BLEND_OP BlendOp;
|
||||
public D3D11_BLEND SrcBlendAlpha;
|
||||
public D3D11_BLEND DestBlendAlpha;
|
||||
public D3D11_BLEND_OP BlendOpAlpha;
|
||||
public byte RenderTargetWriteMask;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi.Common;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_RENDER_TARGET_VIEW_DESC
|
||||
{
|
||||
public DXGI_FORMAT Format;
|
||||
public D3D11_RTV_DIMENSION ViewDimension;
|
||||
public Union Anonymous;
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
internal struct Union
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public D3D11_BUFFER_RTV Buffer;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX1D_RTV Texture1D;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX1D_ARRAY_RTV Texture1DArray;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2D_RTV Texture2D;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2D_ARRAY_RTV Texture2DArray;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2DMS_RTV Texture2DMS;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX3D_RTV Texture3D;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_RESOURCE_DIMENSION
|
||||
{
|
||||
D3D11_RESOURCE_DIMENSION_UNKNOWN = 0,
|
||||
D3D11_RESOURCE_DIMENSION_BUFFER = 1,
|
||||
D3D11_RESOURCE_DIMENSION_TEXTURE1D = 2,
|
||||
D3D11_RESOURCE_DIMENSION_TEXTURE2D = 3,
|
||||
D3D11_RESOURCE_DIMENSION_TEXTURE3D = 4,
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[Flags]
|
||||
internal enum D3D11_RESOURCE_MISC_FLAG : uint
|
||||
{
|
||||
D3D11_RESOURCE_MISC_GENERATE_MIPS = 0x1,
|
||||
D3D11_RESOURCE_MISC_SHARED = 0x2,
|
||||
D3D11_RESOURCE_MISC_TEXTURECUBE = 0x4,
|
||||
D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS = 0x10,
|
||||
D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS = 0x20,
|
||||
D3D11_RESOURCE_MISC_BUFFER_STRUCTURED = 0x40,
|
||||
D3D11_RESOURCE_MISC_RESOURCE_CLAMP = 0x80,
|
||||
D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x100,
|
||||
D3D11_RESOURCE_MISC_GDI_COMPATIBLE = 0x200,
|
||||
D3D11_RESOURCE_MISC_SHARED_NTHANDLE = 0x800,
|
||||
D3D11_RESOURCE_MISC_RESTRICTED_CONTENT = 0x1000,
|
||||
D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE = 0x2000,
|
||||
D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE_DRIVER = 0x4000,
|
||||
D3D11_RESOURCE_MISC_GUARDED = 0x8000,
|
||||
D3D11_RESOURCE_MISC_TILE_POOL = 0x20000,
|
||||
D3D11_RESOURCE_MISC_TILED = 0x40000,
|
||||
D3D11_RESOURCE_MISC_HW_PROTECTED = 0x80000,
|
||||
D3D11_RESOURCE_MISC_SHARED_DISPLAYABLE = 0x100000,
|
||||
D3D11_RESOURCE_MISC_SHARED_EXCLUSIVE_WRITER = 0x200000
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_RTV_DIMENSION
|
||||
{
|
||||
D3D11_RTV_DIMENSION_UNKNOWN = 0,
|
||||
D3D11_RTV_DIMENSION_BUFFER = 1,
|
||||
D3D11_RTV_DIMENSION_TEXTURE1D = 2,
|
||||
D3D11_RTV_DIMENSION_TEXTURE1DARRAY = 3,
|
||||
D3D11_RTV_DIMENSION_TEXTURE2D = 4,
|
||||
D3D11_RTV_DIMENSION_TEXTURE2DARRAY = 5,
|
||||
D3D11_RTV_DIMENSION_TEXTURE2DMS = 6,
|
||||
D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY = 7,
|
||||
D3D11_RTV_DIMENSION_TEXTURE3D = 8,
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_SAMPLER_DESC
|
||||
{
|
||||
public D3D11_FILTER Filter;
|
||||
public D3D11_TEXTURE_ADDRESS_MODE AddressU;
|
||||
public D3D11_TEXTURE_ADDRESS_MODE AddressV;
|
||||
public D3D11_TEXTURE_ADDRESS_MODE AddressW;
|
||||
public float MipLODBias;
|
||||
public uint MaxAnisotropy;
|
||||
public D3D11_COMPARISON_FUNC ComparisonFunc;
|
||||
public unsafe fixed float BorderColor[4];
|
||||
public float MinLOD;
|
||||
public float MaxLOD;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Graphics.Direct3D;
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi.Common;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_SHADER_RESOURCE_VIEW_DESC
|
||||
{
|
||||
public DXGI_FORMAT Format;
|
||||
public D3D_SRV_DIMENSION ViewDimension;
|
||||
public Union Anonymous;
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
internal struct Union
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public D3D11_BUFFER_SRV Buffer;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX1D_SRV Texture1D;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX1D_ARRAY_SRV Texture1DArray;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2D_SRV Texture2D;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2D_ARRAY_SRV Texture2DArray;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2DMS_SRV Texture2DMS;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2DMS_ARRAY_SRV Texture2DMSArray;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX3D_SRV Texture3D;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEXCUBE_SRV TextureCube;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEXCUBE_ARRAY_SRV TextureCubeArray;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_BUFFEREX_SRV BufferEx;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_SO_DECLARATION_ENTRY
|
||||
{
|
||||
public uint Stream;
|
||||
public PCSTR SemanticName;
|
||||
public uint SemanticIndex;
|
||||
public byte StartComponent;
|
||||
public byte ComponentCount;
|
||||
public byte OutputSlot;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_STENCIL_OP
|
||||
{
|
||||
D3D11_STENCIL_OP_KEEP = 1,
|
||||
D3D11_STENCIL_OP_ZERO = 2,
|
||||
D3D11_STENCIL_OP_REPLACE = 3,
|
||||
D3D11_STENCIL_OP_INCR_SAT = 4,
|
||||
D3D11_STENCIL_OP_DECR_SAT = 5,
|
||||
D3D11_STENCIL_OP_INVERT = 6,
|
||||
D3D11_STENCIL_OP_INCR = 7,
|
||||
D3D11_STENCIL_OP_DECR = 8,
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SuppressMessage("", "SA1307")]
|
||||
internal struct D3D11_SUBRESOURCE_DATA
|
||||
{
|
||||
// [Const]
|
||||
public unsafe void* pSysMem;
|
||||
public uint SysMemPitch;
|
||||
public uint SysMemSlicePitch;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX1D_ARRAY_DSV
|
||||
{
|
||||
public uint MipSlice;
|
||||
public uint FirstArraySlice;
|
||||
public uint ArraySize;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX1D_ARRAY_RTV
|
||||
{
|
||||
public uint MipSlice;
|
||||
public uint FirstArraySlice;
|
||||
public uint ArraySize;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX1D_ARRAY_SRV
|
||||
{
|
||||
public uint MostDetailedMip;
|
||||
public uint MipLevels;
|
||||
public uint FirstArraySlice;
|
||||
public uint ArraySize;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX1D_ARRAY_UAV
|
||||
{
|
||||
public uint MipSlice;
|
||||
public uint FirstArraySlice;
|
||||
public uint ArraySize;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX1D_DSV
|
||||
{
|
||||
public uint MipSlice;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX1D_RTV
|
||||
{
|
||||
public uint MipSlice;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX1D_SRV
|
||||
{
|
||||
public uint MostDetailedMip;
|
||||
public uint MipLevels;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX1D_UAV
|
||||
{
|
||||
public uint MipSlice;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX2DMS_ARRAY_DSV
|
||||
{
|
||||
public uint FirstArraySlice;
|
||||
public uint ArraySize;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX2DMS_ARRAY_RTV
|
||||
{
|
||||
public uint FirstArraySlice;
|
||||
public uint ArraySize;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX2DMS_ARRAY_SRV
|
||||
{
|
||||
public uint FirstArraySlice;
|
||||
public uint ArraySize;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SuppressMessage("", "SA1310")]
|
||||
internal struct D3D11_TEX2DMS_DSV
|
||||
{
|
||||
public uint UnusedField_NothingToDefine;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SuppressMessage("", "SA1310")]
|
||||
internal struct D3D11_TEX2DMS_RTV
|
||||
{
|
||||
public uint UnusedField_NothingToDefine;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SuppressMessage("", "SA1310")]
|
||||
internal struct D3D11_TEX2DMS_SRV
|
||||
{
|
||||
public uint UnusedField_NothingToDefine;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX2D_ARRAY_DSV
|
||||
{
|
||||
public uint MipSlice;
|
||||
public uint FirstArraySlice;
|
||||
public uint ArraySize;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX2D_ARRAY_RTV
|
||||
{
|
||||
public uint MipSlice;
|
||||
public uint FirstArraySlice;
|
||||
public uint ArraySize;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX2D_ARRAY_SRV
|
||||
{
|
||||
public uint MostDetailedMip;
|
||||
public uint MipLevels;
|
||||
public uint FirstArraySlice;
|
||||
public uint ArraySize;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX2D_ARRAY_UAV
|
||||
{
|
||||
public uint MipSlice;
|
||||
public uint FirstArraySlice;
|
||||
public uint ArraySize;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX2D_DSV
|
||||
{
|
||||
public uint MipSlice;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX2D_RTV
|
||||
{
|
||||
public uint MipSlice;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX2D_SRV
|
||||
{
|
||||
public uint MostDetailedMip;
|
||||
public uint MipLevels;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX2D_UAV
|
||||
{
|
||||
public uint MipSlice;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX3D_RTV
|
||||
{
|
||||
public uint MipSlice;
|
||||
public uint FirstWSlice;
|
||||
public uint WSize;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEX3D_SRV
|
||||
{
|
||||
public uint MostDetailedMip;
|
||||
public uint MipLevels;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
public struct D3D11_TEX3D_UAV
|
||||
{
|
||||
public uint MipSlice;
|
||||
public uint FirstWSlice;
|
||||
public uint WSize;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEXCUBE_ARRAY_SRV
|
||||
{
|
||||
public uint MostDetailedMip;
|
||||
public uint MipLevels;
|
||||
public uint First2DArrayFace;
|
||||
public uint NumCubes;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEXCUBE_SRV
|
||||
{
|
||||
public uint MostDetailedMip;
|
||||
public uint MipLevels;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi.Common;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEXTURE1D_DESC
|
||||
{
|
||||
public uint Width;
|
||||
public uint MipLevels;
|
||||
public uint ArraySize;
|
||||
public DXGI_FORMAT Format;
|
||||
public D3D11_USAGE Usage;
|
||||
public D3D11_BIND_FLAG BindFlags;
|
||||
public D3D11_CPU_ACCESS_FLAG CPUAccessFlags;
|
||||
public D3D11_RESOURCE_MISC_FLAG MiscFlags;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi.Common;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEXTURE2D_DESC
|
||||
{
|
||||
public uint Width;
|
||||
public uint Height;
|
||||
public uint MipLevels;
|
||||
public uint ArraySize;
|
||||
public DXGI_FORMAT Format;
|
||||
public DXGI_SAMPLE_DESC SampleDesc;
|
||||
public D3D11_USAGE Usage;
|
||||
public D3D11_BIND_FLAG BindFlags;
|
||||
public D3D11_CPU_ACCESS_FLAG CPUAccessFlags;
|
||||
public D3D11_RESOURCE_MISC_FLAG MiscFlags;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi.Common;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_TEXTURE3D_DESC
|
||||
{
|
||||
public uint Width;
|
||||
public uint Height;
|
||||
public uint Depth;
|
||||
public uint MipLevels;
|
||||
public DXGI_FORMAT Format;
|
||||
public D3D11_USAGE Usage;
|
||||
public D3D11_BIND_FLAG BindFlags;
|
||||
public D3D11_CPU_ACCESS_FLAG CPUAccessFlags;
|
||||
public D3D11_RESOURCE_MISC_FLAG MiscFlags;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_TEXTURE_ADDRESS_MODE
|
||||
{
|
||||
D3D11_TEXTURE_ADDRESS_WRAP = 1,
|
||||
D3D11_TEXTURE_ADDRESS_MIRROR = 2,
|
||||
D3D11_TEXTURE_ADDRESS_CLAMP = 3,
|
||||
D3D11_TEXTURE_ADDRESS_BORDER = 4,
|
||||
D3D11_TEXTURE_ADDRESS_MIRROR_ONCE = 5,
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_UAV_DIMENSION
|
||||
{
|
||||
D3D11_UAV_DIMENSION_UNKNOWN = 0,
|
||||
D3D11_UAV_DIMENSION_BUFFER = 1,
|
||||
D3D11_UAV_DIMENSION_TEXTURE1D = 2,
|
||||
D3D11_UAV_DIMENSION_TEXTURE1DARRAY = 3,
|
||||
D3D11_UAV_DIMENSION_TEXTURE2D = 4,
|
||||
D3D11_UAV_DIMENSION_TEXTURE2DARRAY = 5,
|
||||
D3D11_UAV_DIMENSION_TEXTURE3D = 8,
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi.Common;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_UNORDERED_ACCESS_VIEW_DESC
|
||||
{
|
||||
public DXGI_FORMAT Format;
|
||||
public D3D11_UAV_DIMENSION ViewDimension;
|
||||
public Union Anonymous;
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
internal struct Union
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public D3D11_BUFFER_UAV Buffer;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX1D_UAV Texture1D;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX1D_ARRAY_UAV Texture1DArray;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2D_UAV Texture2D;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX2D_ARRAY_UAV Texture2DArray;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public D3D11_TEX3D_UAV Texture3D;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal enum D3D11_USAGE
|
||||
{
|
||||
D3D11_USAGE_DEFAULT = 0,
|
||||
D3D11_USAGE_IMMUTABLE = 1,
|
||||
D3D11_USAGE_DYNAMIC = 2,
|
||||
D3D11_USAGE_STAGING = 3
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal struct D3D11_VIEWPORT
|
||||
{
|
||||
public float TopLeftX;
|
||||
public float TopLeftY;
|
||||
public float Width;
|
||||
public float Height;
|
||||
public float MinDepth;
|
||||
public float MaxDepth;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal unsafe readonly struct ID3D11Asynchronous
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
internal static ref readonly Guid IID
|
||||
{
|
||||
get
|
||||
{
|
||||
ReadOnlySpan<byte> data = [0xCD, 0xD0, 0x35, 0x4B, 0x15, 0x1E, 0x58, 0x42, 0x9C, 0x98, 0x1B, 0x13, 0x33, 0xF6, 0xDD, 0x3B];
|
||||
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
|
||||
}
|
||||
}
|
||||
|
||||
internal readonly struct Vftbl
|
||||
{
|
||||
internal readonly ID3D11DeviceChild.Vftbl ID3D11DeviceChildVftbl;
|
||||
internal readonly delegate* unmanaged[Stdcall]<ID3D11Asynchronous*, uint> GetDataSize;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal unsafe readonly struct ID3D11BlendState
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
internal static ref readonly Guid IID
|
||||
{
|
||||
get
|
||||
{
|
||||
ReadOnlySpan<byte> data = [0xAA, 0x8F, 0xB6, 0x75, 0x7D, 0x34, 0x59, 0x41, 0x8F, 0x45, 0xA0, 0x64, 0x0F, 0x01, 0xCD, 0x9A];
|
||||
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
|
||||
}
|
||||
}
|
||||
|
||||
internal readonly struct Vftbl
|
||||
{
|
||||
internal readonly ID3D11DeviceChild.Vftbl ID3D11DeviceChildVftbl;
|
||||
internal readonly delegate* unmanaged[Stdcall]<ID3D11BlendState*, D3D11_BLEND_DESC*, void> GetDesc;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal unsafe readonly struct ID3D11Buffer
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
internal static ref readonly Guid IID
|
||||
{
|
||||
get
|
||||
{
|
||||
ReadOnlySpan<byte> data = [0x85, 0x0B, 0x57, 0x48, 0xEE, 0xD1, 0xCD, 0x4F, 0xA2, 0x50, 0xEB, 0x35, 0x07, 0x22, 0xB0, 0x37];
|
||||
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
|
||||
}
|
||||
}
|
||||
|
||||
internal readonly struct Vftbl
|
||||
{
|
||||
internal readonly ID3D11Resource.Vftbl ID3D11ResourceVftbl;
|
||||
internal readonly delegate* unmanaged[Stdcall]<ID3D11Buffer*, D3D11_BUFFER_DESC*, void> GetDesc;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal unsafe readonly struct ID3D11ClassInstance
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
internal static ref readonly Guid IID
|
||||
{
|
||||
get
|
||||
{
|
||||
ReadOnlySpan<byte> data = [0xAA, 0x7F, 0xCD, 0xA6, 0xB7, 0xB0, 0x2F, 0x4A, 0x94, 0x36, 0x86, 0x62, 0xA6, 0x57, 0x97, 0xCB];
|
||||
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
|
||||
}
|
||||
}
|
||||
|
||||
internal readonly struct Vftbl
|
||||
{
|
||||
internal readonly ID3D11DeviceChild.Vftbl ID3D11DeviceChildVftbl;
|
||||
internal readonly delegate* unmanaged[Stdcall]<ID3D11ClassInstance*, ID3D11ClassLinkage**, void> GetClassLinkage;
|
||||
internal readonly delegate* unmanaged[Stdcall]<ID3D11ClassInstance*, D3D11_CLASS_INSTANCE_DESC*, void> GetDesc;
|
||||
internal readonly delegate* unmanaged[Stdcall]<ID3D11ClassInstance*, PSTR, nuint*, void> GetInstanceName;
|
||||
internal readonly delegate* unmanaged[Stdcall]<ID3D11ClassInstance*, PSTR, nuint*, void> GetTypeName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
internal unsafe readonly struct ID3D11ClassLinkage
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
internal static ref readonly Guid IID
|
||||
{
|
||||
get
|
||||
{
|
||||
ReadOnlySpan<byte> data = [0xBA, 0x7C, 0xF5, 0xDD, 0x43, 0x95, 0xE4, 0x46, 0xA1, 0x2B, 0xF2, 0x07, 0xA0, 0xFE, 0x7F, 0xED];
|
||||
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
|
||||
}
|
||||
}
|
||||
|
||||
internal readonly struct Vftbl
|
||||
{
|
||||
internal readonly ID3D11DeviceChild.Vftbl ID3D11DeviceChildVftbl;
|
||||
internal readonly delegate* unmanaged[Stdcall]<ID3D11ClassLinkage*, PCSTR, uint, ID3D11ClassInstance**, HRESULT> GetClassInstance;
|
||||
internal readonly delegate* unmanaged[Stdcall]<ID3D11ClassLinkage*, PCSTR, uint, uint, uint, uint, ID3D11ClassInstance**, HRESULT> CreateClassInstance;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user