Added GraphicsDeviceInfo type
このコミットが含まれているのは:
1 親
00bce20a34
コミット
c0db9ca81b
3ファイル変更
+39
-3
検索条件に一致するファイルはありません
@@ -67,8 +67,8 @@ namespace ComputeSharp.Graphics
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="GraphicsDevice"/> instance for the input <see cref="ID3D12Device"/>.
|
||||
/// </summary>
|
||||
/// <param name="device">The <see cref="ID3D12Device"/> to use for the new <see cref="GraphicsDevice"/> instance.</param>
|
||||
/// <param name="description">The available info for the new <see cref="GraphicsDevice"/> instance.</param>
|
||||
/// <param name="d3d12device">The <see cref="ID3D12Device"/> to use for the new <see cref="GraphicsDevice"/> instance.</param>
|
||||
/// <param name="dxgiDescription1">The available info for the new <see cref="GraphicsDevice"/> instance.</param>
|
||||
internal GraphicsDevice(ComPtr<ID3D12Device> d3d12device, DXGI_ADAPTER_DESC1* dxgiDescription1)
|
||||
{
|
||||
this.d3D12Device = d3d12device;
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
using TerraFX.Interop;
|
||||
|
||||
namespace ComputeSharp.Graphics
|
||||
{
|
||||
/// <summary>
|
||||
/// A type containing info on a given DX12.0 device that can be used.
|
||||
/// </summary>
|
||||
public readonly struct GraphicsDeviceInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="GraphicsDeviceInfo"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
/// <param name="description">The available info for the associate device.</param>
|
||||
internal unsafe GraphicsDeviceInfo(DXGI_ADAPTER_DESC1* dxgiDescription1)
|
||||
{
|
||||
Luid = *(Luid*)&dxgiDescription1->AdapterLuid;
|
||||
Name = new string((char*)dxgiDescription1->Description);
|
||||
MemorySize = dxgiDescription1->DedicatedVideoMemory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the locally unique identifier for the current device.
|
||||
/// </summary>
|
||||
public Luid Luid { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the associated device.
|
||||
/// </summary>
|
||||
public string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the dedicated video memory for the associated device.
|
||||
/// </summary>
|
||||
public nuint MemorySize { get; }
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace ComputeSharp
|
||||
namespace ComputeSharp.Graphics
|
||||
{
|
||||
/// <summary>
|
||||
/// A locally unique identifier for a graphics device.
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする