Bump D3D12MA to version 2.0.0-beta3.1459250354

このコミットが含まれているのは:
Sergio Pedri committed 2021-11-14 17:48:44 +01:00
1 親 702b880b89
コミット e17f622032
57ファイル変更
+218 -179

検索条件に一致するファイルはありません

+5 -2
ファイルの表示
@@ -1,6 +1,9 @@
using System;
using ComputeSharp.Interop;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
#pragma warning disable CA1416
namespace ComputeSharp.SwapChain.Backend;
@@ -120,7 +123,7 @@ internal sealed class SwapChainApplication<T> : Win32Application
{
using ComPtr<IDXGIFactory2> dxgiFactory2 = default;
_ = Windows.CreateDXGIFactory2(Windows.DXGI_CREATE_FACTORY_DEBUG, Windows.__uuidof<IDXGIFactory2>(), (void**)dxgiFactory2.GetAddressOf());
_ = DirectX.CreateDXGIFactory2(DirectX.DXGI_CREATE_FACTORY_DEBUG, Windows.__uuidof<IDXGIFactory2>(), (void**)dxgiFactory2.GetAddressOf());
DXGI_SWAP_CHAIN_DESC1 dxgiSwapChainDesc1 = default;
dxgiSwapChainDesc1.AlphaMode = DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_IGNORE;
+1 -1
ファイルの表示
@@ -1,5 +1,5 @@
using System;
using TerraFX.Interop;
using TerraFX.Interop.Windows;
namespace ComputeSharp.SwapChain.Backend;
+14 -14
ファイルの表示
@@ -4,7 +4,7 @@ using System.Drawing;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using TerraFX.Interop;
using TerraFX.Interop.Windows;
namespace ComputeSharp.SwapChain.Backend;
@@ -73,7 +73,7 @@ internal unsafe static class Win32ApplicationRunner
Rectangle windowRect = new(0, 0, 1280, 720);
// Set the target window size
_ = Windows.AdjustWindowRect((RECT*)&windowRect, Windows.WS_OVERLAPPEDWINDOW, Windows.FALSE);
_ = Windows.AdjustWindowRect((RECT*)&windowRect, WS.WS_OVERLAPPEDWINDOW, Windows.FALSE);
uint height = (uint)(windowRect.Bottom - windowRect.Top);
uint width = (uint)(windowRect.Right - windowRect.Left);
@@ -83,7 +83,7 @@ internal unsafe static class Win32ApplicationRunner
0,
windowClassEx.lpszClassName,
(ushort*)windowTitle,
Windows.WS_OVERLAPPEDWINDOW,
WS.WS_OVERLAPPEDWINDOW,
Windows.CW_USEDEFAULT,
Windows.CW_USEDEFAULT,
(int)width,
@@ -137,7 +137,7 @@ internal unsafe static class Win32ApplicationRunner
renderThread.Start((application, tokenSource.Token));
// Process any messages in the queue
while (msg.message != Windows.WM_QUIT)
while (msg.message != WM.WM_QUIT)
{
if (Windows.PeekMessageW(&msg, HWND.NULL, 0, 0, Windows.PM_REMOVE) != 0)
{
@@ -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 == (WPARAM)Windows.VK_ESCAPE || msg.wParam == 'Q'))
if (msg.message == WM.WM_KEYUP && (msg.wParam == (WPARAM)VK.VK_ESCAPE || msg.wParam == 'Q'))
{
_ = Windows.DestroyWindow(hwnd);
}
@@ -178,7 +178,7 @@ internal unsafe static class Win32ApplicationRunner
switch (uMsg)
{
// Change the paused state on window activation
case Windows.WM_ACTIVATE:
case WM.WM_ACTIVATE:
{
if (Windows.LOWORD(wParam) == Windows.WA_INACTIVE)
{
@@ -192,7 +192,7 @@ internal unsafe static class Win32ApplicationRunner
}
// Change the paused state when ESC is pressed
case Windows.WM_KEYDOWN:
case WM.WM_KEYDOWN:
{
if ((ConsoleKey)wParam == ConsoleKey.Escape)
{
@@ -213,7 +213,7 @@ internal unsafe static class Win32ApplicationRunner
}
// Window resize started
case Windows.WM_ENTERSIZEMOVE:
case WM.WM_ENTERSIZEMOVE:
{
isResizing = true;
@@ -221,7 +221,7 @@ internal unsafe static class Win32ApplicationRunner
}
// Window resize completed
case Windows.WM_EXITSIZEMOVE:
case WM.WM_EXITSIZEMOVE:
{
isResizing = false;
application.OnResize();
@@ -230,7 +230,7 @@ internal unsafe static class Win32ApplicationRunner
}
// Size update
case Windows.WM_SIZE:
case WM.WM_SIZE:
{
if (!isResizing && wParam != Windows.SIZE_MINIMIZED)
{
@@ -241,13 +241,13 @@ internal unsafe static class Win32ApplicationRunner
}
// Size and position of the window (needed to enable the borderless mode)
case Windows.WM_NCCALCSIZE:
case WM.WM_NCCALCSIZE:
{
return 0;
}
// Enable dragging the window
case Windows.WM_NCHITTEST:
case WM.WM_NCHITTEST:
{
POINT point;
RECT rect;
@@ -292,7 +292,7 @@ internal unsafe static class Win32ApplicationRunner
}
// Restore the drop shadow
case Windows.WM_DWMCOMPOSITIONCHANGED:
case WM.WM_DWMCOMPOSITIONCHANGED:
{
MARGINS margins = default;
margins.cxLeftWidth = -1;
@@ -306,7 +306,7 @@ internal unsafe static class Win32ApplicationRunner
}
// Shutdown
case Windows.WM_DESTROY:
case WM.WM_DESTROY:
{
Windows.PostQuitMessage(0);
return 0;
+1 -1
ファイルの表示
@@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Toolkit.Diagnostics" Version="7.1.1" />
<PackageReference Include="TerraFX.Interop.D3D12MemoryAllocator" Version="2.0.0-beta3.1423935916" />
<PackageReference Include="TerraFX.Interop.D3D12MemoryAllocator" Version="2.0.0-beta3.1459250354" />
</ItemGroup>
<Choose>
+3 -2
ファイルの表示
@@ -1,8 +1,9 @@
using System;
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_COMMAND_LIST_TYPE;
namespace ComputeSharp.Graphics.Commands;
+2 -1
ファイルの表示
@@ -3,7 +3,8 @@ using System.Collections.Generic;
using System.Runtime.CompilerServices;
using ComputeSharp.Core.Extensions;
using ComputeSharp.Graphics.Extensions;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
namespace ComputeSharp.Graphics.Commands.Interop;
+3 -2
ファイルの表示
@@ -1,8 +1,9 @@
using System;
using ComputeSharp.Graphics.Extensions;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_DESCRIPTOR_HEAP_TYPE;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_DESCRIPTOR_HEAP_TYPE;
namespace ComputeSharp.Graphics.Commands.Interop;
+2 -1
ファイルの表示
@@ -1,5 +1,6 @@
using ComputeSharp.Interop;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
namespace ComputeSharp.Graphics.Commands;
+8 -7
ファイルの表示
@@ -1,12 +1,13 @@
using ComputeSharp.Core.Extensions;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_CPU_PAGE_PROPERTY;
using static TerraFX.Interop.D3D12_HEAP_TYPE;
using static TerraFX.Interop.D3D12_MEMORY_POOL;
using static TerraFX.Interop.D3D12_RESOURCE_FLAGS;
using static TerraFX.Interop.D3D12_RESOURCE_STATES;
using static TerraFX.Interop.D3D12MA_ALLOCATION_FLAGS;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_CPU_PAGE_PROPERTY;
using static TerraFX.Interop.DirectX.D3D12_HEAP_TYPE;
using static TerraFX.Interop.DirectX.D3D12_MEMORY_POOL;
using static TerraFX.Interop.DirectX.D3D12_RESOURCE_FLAGS;
using static TerraFX.Interop.DirectX.D3D12_RESOURCE_STATES;
using static TerraFX.Interop.DirectX.D3D12MA_ALLOCATION_FLAGS;
using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType;
namespace ComputeSharp.Graphics.Extensions;
+8 -8
ファイルの表示
@@ -1,6 +1,6 @@
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using TerraFX.Interop;
using TerraFX.Interop.Windows;
namespace ComputeSharp.Core.Extensions;
@@ -17,11 +17,11 @@ internal static class ComPtrExtensions
/// <returns>A <see cref="ComPtr{T}"/> instance of type <see cref="IUnknown"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe uint AddRef<T>(this ComPtr<T> ptr)
where T : unmanaged
where T : unmanaged, IUnknown.Interface
{
if (ptr.Get() is not null)
{
return ((IUnknown*)ptr.Get())->AddRef();
return ptr.Get()->AddRef();
}
return 0;
@@ -36,11 +36,11 @@ internal static class ComPtrExtensions
/// <returns>A <see cref="ComPtr{T}"/> instance of type <see cref="IUnknown"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe uint Release<T>(this ref ComPtr<T> ptr)
where T : unmanaged
where T : unmanaged, IUnknown.Interface
{
if (ptr.Get() is not null)
{
uint count = ((IUnknown*)ptr.Get())->Release();
uint count = ptr.Get()->Release();
if (count == 0)
{
@@ -66,7 +66,7 @@ internal static class ComPtrExtensions
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe ref readonly ComPtr<IUnknown> AsIUnknown<T>(this in ComPtr<T> ptr)
where T : unmanaged
where T : unmanaged, IUnknown.Interface
{
return ref Unsafe.As<ComPtr<T>, ComPtr<IUnknown>>(ref Unsafe.AsRef(in ptr));
}
@@ -81,7 +81,7 @@ internal static class ComPtrExtensions
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe void** GetVoidAddressOf<T>(this in ComPtr<T> ptr)
where T : unmanaged
where T : unmanaged, IUnknown.Interface
{
return (void**)Unsafe.AsPointer(ref Unsafe.AsRef(in ptr));
}
@@ -94,7 +94,7 @@ internal static class ComPtrExtensions
/// <returns>The moved <see cref="ComPtr{T}"/> instance.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe ComPtr<T> Move<T>(this in ComPtr<T> ptr)
where T : unmanaged
where T : unmanaged, IUnknown.Interface
{
ComPtr<T> copy = default;
+1 -1
ファイルの表示
@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
using ComputeSharp.Graphics.Helpers;
#endif
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using TerraFX.Interop.Windows;
namespace ComputeSharp.Core.Extensions;
+13 -13
ファイルの表示
@@ -2,17 +2,17 @@
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using ComputeSharp.Core.Extensions;
using ComputeSharp.Interop;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_COMMAND_QUEUE_FLAGS;
using static TerraFX.Interop.D3D12_COMMAND_QUEUE_PRIORITY;
using static TerraFX.Interop.D3D12_DESCRIPTOR_HEAP_FLAGS;
using static TerraFX.Interop.D3D12_DESCRIPTOR_HEAP_TYPE;
using static TerraFX.Interop.D3D12_FEATURE;
using static TerraFX.Interop.D3D12_FENCE_FLAGS;
using static TerraFX.Interop.D3D12_MESSAGE_ID;
using static TerraFX.Interop.D3D12_SRV_DIMENSION;
using static TerraFX.Interop.D3D12_UAV_DIMENSION;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_COMMAND_QUEUE_FLAGS;
using static TerraFX.Interop.DirectX.D3D12_COMMAND_QUEUE_PRIORITY;
using static TerraFX.Interop.DirectX.D3D12_DESCRIPTOR_HEAP_FLAGS;
using static TerraFX.Interop.DirectX.D3D12_DESCRIPTOR_HEAP_TYPE;
using static TerraFX.Interop.DirectX.D3D12_FEATURE;
using static TerraFX.Interop.DirectX.D3D12_FENCE_FLAGS;
using static TerraFX.Interop.DirectX.D3D12_MESSAGE_ID;
using static TerraFX.Interop.DirectX.D3D12_SRV_DIMENSION;
using static TerraFX.Interop.DirectX.D3D12_UAV_DIMENSION;
namespace ComputeSharp.Graphics.Extensions;
@@ -176,7 +176,7 @@ internal static unsafe class ID3D12DeviceExtensions
{
D3D12_SHADER_RESOURCE_VIEW_DESC d3D12ShaderResourceViewDescription = default;
d3D12ShaderResourceViewDescription.ViewDimension = D3D12_SRV_DIMENSION_BUFFER;
d3D12ShaderResourceViewDescription.Shader4ComponentMapping = Windows.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
d3D12ShaderResourceViewDescription.Shader4ComponentMapping = DirectX.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
d3D12ShaderResourceViewDescription.Buffer.NumElements = bufferSize;
d3D12ShaderResourceViewDescription.Buffer.StructureByteStride = elementSize;
@@ -201,7 +201,7 @@ internal static unsafe class ID3D12DeviceExtensions
D3D12_SHADER_RESOURCE_VIEW_DESC d3D12ShaderResourceViewDescription = default;
d3D12ShaderResourceViewDescription.ViewDimension = d3D12SrvDimension;
d3D12ShaderResourceViewDescription.Format = dxgiFormat;
d3D12ShaderResourceViewDescription.Shader4ComponentMapping = Windows.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
d3D12ShaderResourceViewDescription.Shader4ComponentMapping = DirectX.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
d3D12ShaderResourceViewDescription.Texture2D.MipLevels = uint.MaxValue;
d3D12Device.CreateShaderResourceView(d3D12Resource, &d3D12ShaderResourceViewDescription, d3D12CpuDescriptorHandle);
+1 -1
ファイルの表示
@@ -1,5 +1,5 @@
using System;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
namespace ComputeSharp.Graphics.Extensions;
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@ using System.Diagnostics;
using System.Runtime.CompilerServices;
using ComputeSharp.Core.Extensions;
using ComputeSharp.Graphics.Resources.Interop;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
namespace ComputeSharp.Graphics.Extensions;
+6 -5
ファイルの表示
@@ -9,11 +9,12 @@ using ComputeSharp.Graphics.Extensions;
using ComputeSharp.Graphics.Helpers;
using ComputeSharp.Interop;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE;
using static TerraFX.Interop.D3D12_FEATURE;
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
using static TerraFX.Interop.DXGI_ADAPTER_FLAG;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_COMMAND_LIST_TYPE;
using static TerraFX.Interop.DirectX.D3D12_FEATURE;
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
using static TerraFX.Interop.DirectX.DXGI_ADAPTER_FLAG;
namespace ComputeSharp;
+2 -2
ファイルの表示
@@ -1,5 +1,5 @@
using TerraFX.Interop;
using static TerraFX.Interop.DXGI_ADAPTER_FLAG;
using TerraFX.Interop.DirectX;
using static TerraFX.Interop.DirectX.DXGI_ADAPTER_FLAG;
namespace ComputeSharp;
+3 -2
ファイルの表示
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_FEATURE;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_FEATURE;
namespace ComputeSharp.Graphics.Helpers;
+2 -2
ファイルの表示
@@ -2,8 +2,8 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using static TerraFX.Interop.DXGI_FORMAT;
using TerraFX.Interop.DirectX;
using static TerraFX.Interop.DirectX.DXGI_FORMAT;
namespace ComputeSharp.Graphics.Helpers;
+11 -9
ファイルの表示
@@ -4,11 +4,13 @@ using System.Collections.Generic;
using ComputeSharp.Core.Extensions;
using ComputeSharp.Graphics.Extensions;
using ComputeSharp.Interop;
using TerraFX.Interop;
using HRESULT = System.Int32;
using static TerraFX.Interop.D3D_FEATURE_LEVEL;
using static TerraFX.Interop.D3D_SHADER_MODEL;
using static TerraFX.Interop.DXGI_GPU_PREFERENCE;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D_FEATURE_LEVEL;
using static TerraFX.Interop.DirectX.D3D_SHADER_MODEL;
using static TerraFX.Interop.DirectX.DXGI_GPU_PREFERENCE;
#pragma warning disable CA1416
namespace ComputeSharp.Graphics.Helpers;
@@ -129,7 +131,7 @@ internal static partial class DeviceHelper
dxgiAdapter1.Get()->GetDesc1(&dxgiDescription1).Assert();
HRESULT createDeviceResult = Windows.D3D12CreateDevice(
HRESULT createDeviceResult = DirectX.D3D12CreateDevice(
dxgiAdapter1.AsIUnknown().Get(),
D3D_FEATURE_LEVEL_11_0,
Windows.__uuidof<ID3D12Device>(),
@@ -140,7 +142,7 @@ internal static partial class DeviceHelper
{
using ComPtr<ID3D12Device> d3D12Device = default;
Windows.D3D12CreateDevice(
DirectX.D3D12CreateDevice(
dxgiAdapter1.AsIUnknown().Get(),
D3D_FEATURE_LEVEL_11_0,
Windows.__uuidof<ID3D12Device>(),
@@ -170,7 +172,7 @@ internal static partial class DeviceHelper
continue;
}
HRESULT createDeviceResult = Windows.D3D12CreateDevice(
HRESULT createDeviceResult = DirectX.D3D12CreateDevice(
dxgiAdapter1.AsIUnknown().Get(),
D3D_FEATURE_LEVEL_11_0,
Windows.__uuidof<ID3D12Device>(),
@@ -181,7 +183,7 @@ internal static partial class DeviceHelper
{
using ComPtr<ID3D12Device> d3D12Device = default;
Windows.D3D12CreateDevice(
DirectX.D3D12CreateDevice(
dxgiAdapter1.AsIUnknown().Get(),
D3D_FEATURE_LEVEL_11_0,
Windows.__uuidof<ID3D12Device>(),
+2 -1
ファイルの表示
@@ -2,7 +2,8 @@
#if DEBUG
using ComputeSharp.Graphics.Extensions;
#endif
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
namespace ComputeSharp.Graphics.Helpers;
+2 -2
ファイルの表示
@@ -4,8 +4,8 @@ using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_MESSAGE_SEVERITY;
using TerraFX.Interop.DirectX;
using static TerraFX.Interop.DirectX.D3D12_MESSAGE_SEVERITY;
namespace ComputeSharp.Graphics.Helpers;
+8 -6
ファイルの表示
@@ -3,8 +3,10 @@ using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using ComputeSharp.Core.Extensions;
using TerraFX.Interop;
using HRESULT = System.Int32;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
#pragma warning disable CA1416
namespace ComputeSharp.Graphics.Helpers;
@@ -16,7 +18,7 @@ internal static partial class DeviceHelper
/// </summary>
private const uint IDXGIFactoryCreationFlags =
#if DEBUG
Windows.DXGI_CREATE_FACTORY_DEBUG;
DirectX.DXGI_CREATE_FACTORY_DEBUG;
#else
0;
#endif
@@ -31,7 +33,7 @@ internal static partial class DeviceHelper
EnableDebugMode();
Windows.CreateDXGIFactory2(IDXGIFactoryCreationFlags, Windows.__uuidof<IDXGIFactory4>(), dxgiFactory4.GetVoidAddressOf()).Assert();
DirectX.CreateDXGIFactory2(IDXGIFactoryCreationFlags, Windows.__uuidof<IDXGIFactory4>(), dxgiFactory4.GetVoidAddressOf()).Assert();
HRESULT result = dxgiFactory4.CopyTo(dxgiFactory6);
@@ -40,7 +42,7 @@ internal static partial class DeviceHelper
return;
}
if (result == Windows.E_NOINTERFACE)
if (result == E.E_NOINTERFACE)
{
IDXGIFactory4As6Backcompat.Create(dxgiFactory4.Get(), dxgiFactory6);
@@ -61,7 +63,7 @@ internal static partial class DeviceHelper
using ComPtr<ID3D12Debug> d3D12Debug = default;
using ComPtr<ID3D12Debug1> d3D12Debug1 = default;
Windows.D3D12GetDebugInterface(Windows.__uuidof<ID3D12Debug>(), d3D12Debug.GetVoidAddressOf()).Assert();
DirectX.D3D12GetDebugInterface(Windows.__uuidof<ID3D12Debug>(), d3D12Debug.GetVoidAddressOf()).Assert();
d3D12Debug.Get()->EnableDebugLayer();
+11 -9
ファイルの表示
@@ -3,11 +3,13 @@ using System.Diagnostics.Contracts;
using ComputeSharp.Core.Extensions;
using ComputeSharp.Graphics.Extensions;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using HRESULT = System.Int32;
using static TerraFX.Interop.D3D_FEATURE_LEVEL;
using static TerraFX.Interop.D3D_SHADER_MODEL;
using static TerraFX.Interop.DXGI_GPU_PREFERENCE;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D_FEATURE_LEVEL;
using static TerraFX.Interop.DirectX.D3D_SHADER_MODEL;
using static TerraFX.Interop.DirectX.DXGI_GPU_PREFERENCE;
#pragma warning disable CA1416
namespace ComputeSharp.Graphics.Helpers;
@@ -119,7 +121,7 @@ internal static partial class DeviceHelper
// a device for adapters that would've failed at the FL11 check already.
if (d3D12Device == null)
{
HRESULT createDeviceResult = Windows.D3D12CreateDevice(
HRESULT createDeviceResult = DirectX.D3D12CreateDevice(
dxgiAdapter1.AsIUnknown().Get(),
D3D_FEATURE_LEVEL_11_0,
Windows.__uuidof<ID3D12Device>(),
@@ -129,7 +131,7 @@ internal static partial class DeviceHelper
{
using ComPtr<ID3D12Device> d3D12DeviceCandidate = default;
createDeviceResult = Windows.D3D12CreateDevice(
createDeviceResult = DirectX.D3D12CreateDevice(
dxgiAdapter1.AsIUnknown().Get(),
D3D_FEATURE_LEVEL_11_0,
Windows.__uuidof<ID3D12Device>(),
@@ -146,7 +148,7 @@ internal static partial class DeviceHelper
{
using ComPtr<ID3D12Device> d3D12DeviceCandidate = default;
HRESULT createDeviceResult = Windows.D3D12CreateDevice(
HRESULT createDeviceResult = DirectX.D3D12CreateDevice(
dxgiAdapter1.AsIUnknown().Get(),
D3D_FEATURE_LEVEL_11_0,
Windows.__uuidof<ID3D12Device>(),
@@ -183,7 +185,7 @@ internal static partial class DeviceHelper
dxgiAdapter1.Get()->GetDesc1(dxgiDescription1).Assert();
HRESULT createDeviceResult = Windows.D3D12CreateDevice(
HRESULT createDeviceResult = DirectX.D3D12CreateDevice(
dxgiAdapter1.AsIUnknown().Get(),
D3D_FEATURE_LEVEL_11_0,
Windows.__uuidof<ID3D12Device>(),
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@ using System.Diagnostics.Contracts;
using System.IO;
using System.Runtime.CompilerServices;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using TerraFX.Interop.Windows;
namespace ComputeSharp.Graphics.Helpers;
+5 -3
ファイルの表示
@@ -1,7 +1,10 @@
using System;
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using ComputeSharp.Core.Extensions;
using TerraFX.Interop;
using TerraFX.Interop.Windows;
#pragma warning disable CA1416
namespace ComputeSharp.Graphics.Helpers;
@@ -21,10 +24,9 @@ internal sealed unsafe class WICHelper
private WICHelper()
{
using ComPtr<IWICImagingFactory2> wicImagingFactory2 = default;
Guid wicImagingFactor2Clsid = Windows.CLSID_WICImagingFactory2;
Windows.CoCreateInstance(
&wicImagingFactor2Clsid,
(Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in CLSID.CLSID_WICImagingFactory2)),
null,
(uint)CLSCTX.CLSCTX_INPROC_SERVER,
Windows.__uuidof<IWICImagingFactory2>(),
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@ using System.ComponentModel;
using System.Runtime.CompilerServices;
using ComputeSharp.Resources;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
namespace ComputeSharp.__Internals;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
using System;
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using TerraFX.Interop;
using TerraFX.Interop.Windows;
namespace ComputeSharp;
+5 -4
ファイルの表示
@@ -7,8 +7,9 @@ using ComputeSharp.Graphics.Extensions;
using ComputeSharp.Graphics.Helpers;
using ComputeSharp.Interop;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_FEATURE;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_FEATURE;
using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType;
namespace ComputeSharp.Resources;
@@ -59,7 +60,7 @@ public unsafe abstract class Buffer<T> : NativeObject
if (resourceType == ResourceType.Constant)
{
Guard.IsBetweenOrEqualTo(length, 1, Windows.D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT, nameof(length));
Guard.IsBetweenOrEqualTo(length, 1, DirectX.D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT, nameof(length));
}
else
{
@@ -74,7 +75,7 @@ public unsafe abstract class Buffer<T> : NativeObject
}
nint usableSizeInBytes = checked((nint)(length * elementSizeInBytes));
nint effectiveSizeInBytes = resourceType == ResourceType.Constant ? AlignmentHelper.Pad(usableSizeInBytes, Windows.D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT) : usableSizeInBytes;
nint effectiveSizeInBytes = resourceType == ResourceType.Constant ? AlignmentHelper.Pad(usableSizeInBytes, DirectX.D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT) : usableSizeInBytes;
SizeInBytes = usableSizeInBytes;
GraphicsDevice = device;
+3 -2
ファイルの表示
@@ -3,8 +3,9 @@ using ComputeSharp.Graphics.Extensions;
using ComputeSharp.Graphics.Helpers;
using ComputeSharp.Graphics.Resources.Interop;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_COMMAND_LIST_TYPE;
using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType;
namespace ComputeSharp.Resources;
+8 -7
ファイルの表示
@@ -7,11 +7,12 @@ using ComputeSharp.Graphics.Helpers;
using ComputeSharp.Graphics.Resources.Interop;
using ComputeSharp.Interop;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE;
using static TerraFX.Interop.D3D12_RESOURCE_STATES;
using static TerraFX.Interop.D3D12_SRV_DIMENSION;
using static TerraFX.Interop.D3D12_UAV_DIMENSION;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_COMMAND_LIST_TYPE;
using static TerraFX.Interop.DirectX.D3D12_RESOURCE_STATES;
using static TerraFX.Interop.DirectX.D3D12_SRV_DIMENSION;
using static TerraFX.Interop.DirectX.D3D12_UAV_DIMENSION;
using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType;
#pragma warning disable CS0618
@@ -73,8 +74,8 @@ public unsafe abstract class Texture2D<T> : NativeObject, GraphicsResourceHelper
{
device.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(width, 1, Windows.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Windows.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(width, 1, DirectX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, DirectX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height));
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), d3D12FormatSupport))
{
+9 -8
ファイルの表示
@@ -7,11 +7,12 @@ using ComputeSharp.Graphics.Helpers;
using ComputeSharp.Graphics.Resources.Interop;
using ComputeSharp.Interop;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE;
using static TerraFX.Interop.D3D12_RESOURCE_STATES;
using static TerraFX.Interop.D3D12_SRV_DIMENSION;
using static TerraFX.Interop.D3D12_UAV_DIMENSION;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_COMMAND_LIST_TYPE;
using static TerraFX.Interop.DirectX.D3D12_RESOURCE_STATES;
using static TerraFX.Interop.DirectX.D3D12_SRV_DIMENSION;
using static TerraFX.Interop.DirectX.D3D12_UAV_DIMENSION;
using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType;
#pragma warning disable CS0618
@@ -74,9 +75,9 @@ public unsafe abstract class Texture3D<T> : NativeObject, GraphicsResourceHelper
{
device.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(width, 1, Windows.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Windows.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, Windows.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth));
Guard.IsBetweenOrEqualTo(width, 1, DirectX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, DirectX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, DirectX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth));
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), d3D12FormatSupport))
{
+2 -1
ファイルの表示
@@ -5,7 +5,8 @@ using ComputeSharp.Exceptions;
using ComputeSharp.Graphics.Extensions;
using ComputeSharp.Interop;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType;
namespace ComputeSharp.Resources;
+5 -4
ファイルの表示
@@ -4,8 +4,9 @@ using ComputeSharp.Graphics.Extensions;
using ComputeSharp.Graphics.Helpers;
using ComputeSharp.Interop;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType;
namespace ComputeSharp.Resources;
@@ -49,8 +50,8 @@ public unsafe abstract class TransferTexture2D<T> : NativeObject
{
device.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(width, 1, Windows.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Windows.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(width, 1, DirectX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, DirectX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height));
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), D3D12_FORMAT_SUPPORT1_TEXTURE2D))
{
+6 -5
ファイルの表示
@@ -4,8 +4,9 @@ using ComputeSharp.Graphics.Extensions;
using ComputeSharp.Graphics.Helpers;
using ComputeSharp.Interop;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType;
namespace ComputeSharp.Resources;
@@ -50,9 +51,9 @@ public unsafe abstract class TransferTexture3D<T> : NativeObject
{
device.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(width, 1, Windows.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, Windows.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, Windows.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth));
Guard.IsBetweenOrEqualTo(width, 1, DirectX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, DirectX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, DirectX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth));
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), D3D12_FORMAT_SUPPORT1_TEXTURE3D))
{
+2 -2
ファイルの表示
@@ -9,7 +9,7 @@ using ComputeSharp.Graphics.Resources.Interop;
using ComputeSharp.Resources;
using ComputeSharp.Resources.Debug;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType;
namespace ComputeSharp;
@@ -26,7 +26,7 @@ public sealed class ConstantBuffer<T> : Buffer<T>
/// <summary>
/// The alignment boundary for elements in a constant buffer.
/// </summary>
private const int ElementAlignment = Windows.D3D12_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT;
private const int ElementAlignment = DirectX.D3D12_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT;
/// <summary>
/// Creates a new <see cref="ConstantBuffer{T}"/> instance with the specified parameters.
+5 -5
ファイルの表示
@@ -8,35 +8,35 @@ internal enum ResourceType
/// <summary>
/// A constant resource, with items aligned to 16 bytes, used for individual values or very small arrays.
/// This is only supported for buffers and is mapped to a <see langword="cbuffer"/>.
/// Resources of this type are located in <see cref="TerraFX.Interop.D3D12_HEAP_TYPE.D3D12_HEAP_TYPE_UPLOAD"/>.
/// Resources of this type are located in <see cref="TerraFX.Interop.DirectX.D3D12_HEAP_TYPE.D3D12_HEAP_TYPE_UPLOAD"/>.
/// </summary>
Constant,
/// <summary>
/// A readonly resource, that can store arbitrary arrays of values and can only be read from by the GPU.
/// This is mapped to either <see langword="StructuredBuffer&lt;T&gt;"/> or <see langword="TextureND&lt;T&gt;"/>.
/// Resources of this type are located in <see cref="TerraFX.Interop.D3D12_HEAP_TYPE.D3D12_HEAP_TYPE_DEFAULT"/>.
/// Resources of this type are located in <see cref="TerraFX.Interop.DirectX.D3D12_HEAP_TYPE.D3D12_HEAP_TYPE_DEFAULT"/>.
/// </summary>
ReadOnly,
/// <summary>
/// A read write resource, that can store arbitrary arrays with both read and write access for the GPU.
/// This is mapped to either <see langword="RWStructuredBuffer&lt;T&gt;"/> or <see langword="RWTextureND&lt;T&gt;"/>.
/// Resources of this type are located in <see cref="TerraFX.Interop.D3D12_HEAP_TYPE.D3D12_HEAP_TYPE_DEFAULT"/>.
/// Resources of this type are located in <see cref="TerraFX.Interop.DirectX.D3D12_HEAP_TYPE.D3D12_HEAP_TYPE_DEFAULT"/>.
/// </summary>
ReadWrite,
/// <summary>
/// A readback resource, used temporarily to read data back from <see cref="ReadOnly"/> and <see cref="ReadWrite"/> resources.
/// This has no direct mapping to a type in HLSL, as it's only used for copy operations.
/// Resources of this type are located in <see cref="TerraFX.Interop.D3D12_HEAP_TYPE.D3D12_HEAP_TYPE_READBACK"/>.
/// Resources of this type are located in <see cref="TerraFX.Interop.DirectX.D3D12_HEAP_TYPE.D3D12_HEAP_TYPE_READBACK"/>.
/// </summary>
ReadBack,
/// <summary>
/// A transfer resource, used temporarily to set data to <see cref="ReadOnly"/> and <see cref="ReadWrite"/> resources.
/// This has no direct mapping to a type in HLSL, as it's only used for copy operations (like <see cref="ReadBack"/>).
/// Resources of this type are located in <see cref="TerraFX.Interop.D3D12_HEAP_TYPE.D3D12_HEAP_TYPE_UPLOAD"/>.
/// Resources of this type are located in <see cref="TerraFX.Interop.DirectX.D3D12_HEAP_TYPE.D3D12_HEAP_TYPE_UPLOAD"/>.
/// </summary>
Upload
}
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
using System;
using System.Runtime.CompilerServices;
using ComputeSharp.Graphics.Extensions;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
namespace ComputeSharp.Graphics.Resources.Interop;
+3 -3
ファイルの表示
@@ -1,7 +1,7 @@
using System;
using System.ComponentModel;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_DESCRIPTOR_RANGE_FLAGS;
using TerraFX.Interop.DirectX;
using static TerraFX.Interop.DirectX.D3D12_DESCRIPTOR_RANGE_FLAGS;
#pragma warning disable IDE0052, CS0414
@@ -45,6 +45,6 @@ public struct ResourceDescriptor
descriptor.BaseShaderRegister = offset;
descriptor.RegisterSpace = 0;
descriptor.Flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE;
descriptor.OffsetInDescriptorsFromTableStart = Windows.D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;
descriptor.OffsetInDescriptorsFromTableStart = DirectX.D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;
}
}
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
using ComputeSharp.Graphics.Resources.Enums;
using ComputeSharp.Resources;
using ComputeSharp.Resources.Debug;
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
#pragma warning disable CS0618
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@ using ComputeSharp.Exceptions;
using ComputeSharp.Graphics.Resources.Enums;
using ComputeSharp.Resources;
using ComputeSharp.Resources.Debug;
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
namespace ComputeSharp;
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
using ComputeSharp.Graphics.Resources.Enums;
using ComputeSharp.Resources;
using ComputeSharp.Resources.Debug;
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
#pragma warning disable CS0618
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@ using ComputeSharp.Exceptions;
using ComputeSharp.Graphics.Resources.Enums;
using ComputeSharp.Resources;
using ComputeSharp.Resources.Debug;
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
namespace ComputeSharp;
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
using ComputeSharp.Graphics.Resources.Enums;
using ComputeSharp.Resources;
using ComputeSharp.Resources.Debug;
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
#pragma warning disable CS0618
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@ using ComputeSharp.Exceptions;
using ComputeSharp.Graphics.Resources.Enums;
using ComputeSharp.Resources;
using ComputeSharp.Resources.Debug;
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
namespace ComputeSharp;
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
using ComputeSharp.Graphics.Resources.Enums;
using ComputeSharp.Resources;
using ComputeSharp.Resources.Debug;
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
#pragma warning disable CS0618
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@ using ComputeSharp.Exceptions;
using ComputeSharp.Graphics.Resources.Enums;
using ComputeSharp.Resources;
using ComputeSharp.Resources.Debug;
using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1;
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
namespace ComputeSharp;
+1 -1
ファイルの表示
@@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using ComputeSharp.Graphics.Extensions;
using ComputeSharp.__Internals;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
using System.Runtime.InteropServices;
#pragma warning disable CS0618
+2 -2
ファイルの表示
@@ -1,9 +1,9 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using ComputeSharp.Graphics.Extensions;
using ComputeSharp.__Internals;
using TerraFX.Interop;
using System.Runtime.InteropServices;
using TerraFX.Interop.DirectX;
#pragma warning disable CS0618
+2 -1
ファイルの表示
@@ -4,7 +4,8 @@ using System.Runtime.InteropServices;
using ComputeSharp.Shaders.Extensions;
using ComputeSharp.__Internals;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
#pragma warning disable CS0618
+7 -6
ファイルの表示
@@ -1,10 +1,11 @@
using System;
using ComputeSharp.Core.Extensions;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_COMPARISON_FUNC;
using static TerraFX.Interop.D3D12_FILTER;
using static TerraFX.Interop.D3D12_PIPELINE_STATE_FLAGS;
using static TerraFX.Interop.D3D12_TEXTURE_ADDRESS_MODE;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_COMPARISON_FUNC;
using static TerraFX.Interop.DirectX.D3D12_FILTER;
using static TerraFX.Interop.DirectX.D3D12_PIPELINE_STATE_FLAGS;
using static TerraFX.Interop.DirectX.D3D12_TEXTURE_ADDRESS_MODE;
namespace ComputeSharp.Shaders.Extensions;
@@ -71,7 +72,7 @@ internal static unsafe class ID3D12DeviceExtensions
// Serialize the root signature from the data just computed. When this is done
// we just work with the resulting blobs, so the input data can be unpinned.
Windows.D3D12SerializeVersionedRootSignature(
DirectX.D3D12SerializeVersionedRootSignature(
&d3D12VersionedRootSignatureDescription,
d3D3Blob.GetAddressOf(),
d3D3BlobError.GetAddressOf()).Assert();
+6 -4
ファイルの表示
@@ -3,7 +3,8 @@ using System.Runtime.CompilerServices;
using ComputeSharp.__Internals;
using ComputeSharp.Core.Extensions;
using ComputeSharp.Shaders.Translation;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
#pragma warning disable CS0618
@@ -109,9 +110,10 @@ public static class ReflectionServices
using ComPtr<IDxcUtils> dxcUtils = default;
Guid dxcLibraryClsid = Windows.CLSID_DxcLibrary;
Windows.DxcCreateInstance(&dxcLibraryClsid, Windows.__uuidof<IDxcUtils>(), dxcUtils.GetVoidAddressOf()).Assert();
DirectX.DxcCreateInstance(
(Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in CLSID.CLSID_DxcLibrary)),
Windows.__uuidof<IDxcUtils>(),
dxcUtils.GetVoidAddressOf()).Assert();
using ComPtr<ID3D12ShaderReflection> d3D12ShaderReflection = default;
+7 -6
ファイルの表示
@@ -8,7 +8,8 @@ using ComputeSharp.Shaders.Translation;
using ComputeSharp.Shaders.Translation.Models;
using ComputeSharp.__Internals;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
#pragma warning disable CS0618
@@ -118,9 +119,9 @@ internal static class ShaderRunner<T>
int groupsY = Math.DivRem(y, threadsY, out int modY) + (modY == 0 ? 0 : 1);
int groupsZ = Math.DivRem(z, threadsZ, out int modZ) + (modZ == 0 ? 0 : 1);
Guard.IsBetweenOrEqualTo(groupsX, 1, Windows.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsY, 1, Windows.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsZ, 1, Windows.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsX, 1, DirectX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsY, 1, DirectX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsZ, 1, DirectX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
ShaderKey key = new(shader.GetDispatchId(), threadsX, threadsY, threadsZ);
PipelineData? pipelineData;
@@ -173,8 +174,8 @@ internal static class ShaderRunner<T>
int groupsX = Math.DivRem(x, threadsX, out int modX) + (modX == 0 ? 0 : 1);
int groupsY = Math.DivRem(y, threadsY, out int modY) + (modY == 0 ? 0 : 1);
Guard.IsBetweenOrEqualTo(groupsX, 1, Windows.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsY, 1, Windows.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsX, 1, DirectX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsY, 1, DirectX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
ShaderKey key = new(shader.GetDispatchId(), threadsX, threadsY, 1);
PipelineData? pipelineData;
+2 -1
ファイルの表示
@@ -1,7 +1,8 @@
using System.Runtime.CompilerServices;
using ComputeSharp.Graphics.Commands;
using ComputeSharp.Interop;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
namespace ComputeSharp.Shaders.Translation.Models;
+1 -1
ファイルの表示
@@ -2,7 +2,7 @@
using System.IO;
using System.Runtime.InteropServices;
using Microsoft.Toolkit.Diagnostics;
using TerraFX.Interop;
using TerraFX.Interop.Windows;
namespace ComputeSharp.Shaders.Translation;
+10 -5
ファイルの表示
@@ -3,7 +3,8 @@ using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using ComputeSharp.Core.Extensions;
using ComputeSharp.Exceptions;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
namespace ComputeSharp.Shaders.Translation;
@@ -43,11 +44,15 @@ internal sealed unsafe partial class ShaderCompiler
using ComPtr<IDxcLibrary> dxcLibrary = default;
using ComPtr<IDxcIncludeHandler> dxcIncludeHandler = default;
Guid dxcCompilerCLGuid = Windows.CLSID_DxcCompiler;
Guid dxcLibraryCLGuid = Windows.CLSID_DxcLibrary;
DirectX.DxcCreateInstance(
(Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in CLSID.CLSID_DxcCompiler)),
Windows.__uuidof<IDxcCompiler>(),
dxcCompiler.GetVoidAddressOf()).Assert();
Windows.DxcCreateInstance(&dxcCompilerCLGuid, Windows.__uuidof<IDxcCompiler>(), dxcCompiler.GetVoidAddressOf()).Assert();
Windows.DxcCreateInstance(&dxcLibraryCLGuid, Windows.__uuidof<IDxcLibrary>(), dxcLibrary.GetVoidAddressOf()).Assert();
DirectX.DxcCreateInstance(
(Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in CLSID.CLSID_DxcLibrary)),
Windows.__uuidof<IDxcLibrary>(),
dxcLibrary.GetVoidAddressOf()).Assert();
dxcLibrary.Get()->CreateIncludeHandler(dxcIncludeHandler.GetAddressOf()).Assert();
+2 -1
ファイルの表示
@@ -1,7 +1,8 @@
using ComputeSharp.Exceptions;
using ComputeSharp.Shaders.Translation;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TerraFX.Interop;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
namespace ComputeSharp.Tests.Internals;
+3 -2
ファイルの表示
@@ -4,8 +4,9 @@ using ComputeSharp.Resources;
using ComputeSharp.Tests.Attributes;
using ComputeSharp.Tests.Extensions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TerraFX.Interop;
using static TerraFX.Interop.D3D12_RESOURCE_DIMENSION;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.DirectX.D3D12_RESOURCE_DIMENSION;
namespace ComputeSharp.Tests;