Added more info properties to devices
このコミットが含まれているのは:
1 親
1cc0b88d66
コミット
78ce4fb4e2
3ファイル変更
+35
-7
検索条件に一致するファイルはありません
@@ -12,6 +12,7 @@ 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;
|
||||
|
||||
namespace ComputeSharp.Graphics
|
||||
{
|
||||
@@ -90,7 +91,9 @@ namespace ComputeSharp.Graphics
|
||||
|
||||
Luid = Luid.FromLUID(dxgiDescription1->AdapterLuid);
|
||||
Name = new string((char*)dxgiDescription1->Description);
|
||||
MemorySize = dxgiDescription1->DedicatedVideoMemory;
|
||||
DedicatedMemorySize = dxgiDescription1->DedicatedVideoMemory;
|
||||
SharedMemorySize = dxgiDescription1->SharedSystemMemory;
|
||||
IsHardwareAccelerated = (dxgiDescription1->Flags & (uint)DXGI_ADAPTER_FLAG_SOFTWARE) == 0;
|
||||
|
||||
var d3D12Options1Data = d3D12Device.Get()->CheckFeatureSupport<D3D12_FEATURE_DATA_D3D12_OPTIONS1>(D3D12_FEATURE_D3D12_OPTIONS1);
|
||||
|
||||
@@ -109,9 +112,20 @@ namespace ComputeSharp.Graphics
|
||||
public string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the dedicated video memory for the current <see cref="GraphicsDevice"/> instance.
|
||||
/// Gets the size of the dedicated memory for the current device.
|
||||
/// </summary>
|
||||
public nuint MemorySize { get; }
|
||||
public nuint DedicatedMemorySize { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the shared system memory for the current device.
|
||||
/// </summary>
|
||||
public nuint SharedMemorySize { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether or not the current device is hardware accelerated.
|
||||
/// This value is <see langword="false"/> for software fallback devices.
|
||||
/// </summary>
|
||||
public bool IsHardwareAccelerated { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of total lanes on the current device (eg. CUDA cores on an nVidia GPU).
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using TerraFX.Interop;
|
||||
using static TerraFX.Interop.DXGI_ADAPTER_FLAG;
|
||||
|
||||
namespace ComputeSharp.Graphics
|
||||
{
|
||||
@@ -15,7 +16,9 @@ namespace ComputeSharp.Graphics
|
||||
{
|
||||
Luid = Luid.FromLUID(dxgiDescription1->AdapterLuid);
|
||||
Name = new string((char*)dxgiDescription1->Description);
|
||||
MemorySize = dxgiDescription1->DedicatedVideoMemory;
|
||||
DedicatedMemorySize = dxgiDescription1->DedicatedVideoMemory;
|
||||
SharedMemorySize = dxgiDescription1->SharedSystemMemory;
|
||||
IsHardwareAccelerated = (dxgiDescription1->Flags & (uint)DXGI_ADAPTER_FLAG_SOFTWARE) == 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -29,8 +32,19 @@ namespace ComputeSharp.Graphics
|
||||
public string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the dedicated video memory for the associated device.
|
||||
/// Gets the size of the dedicated memory for the associated device.
|
||||
/// </summary>
|
||||
public nuint MemorySize { get; }
|
||||
public nuint DedicatedMemorySize { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the shared system memory for the associated device.
|
||||
/// </summary>
|
||||
public nuint SharedMemorySize { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether or not the associated device is hardware accelerated.
|
||||
/// This value is <see langword="false"/> for software fallback devices.
|
||||
/// </summary>
|
||||
public bool IsHardwareAccelerated { get; }
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,7 @@ namespace ComputeSharp.Tests
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
foreach (GraphicsDevice device in Gpu.QueryDevices(info => info.MemorySize >= 1024))
|
||||
foreach (GraphicsDevice device in Gpu.QueryDevices(info => info.DedicatedMemorySize >= 1024))
|
||||
{
|
||||
if (i++ == 0) Assert.AreSame(Gpu.Default, device);
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする