Improved DEBUG info on D3D12 objects
このコミットが含まれているのは:
1 親
e4cc915ee0
コミット
b141f0d8c1
9ファイル変更
+36
-39
検索条件に一致するファイルはありません
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using ComputeSharp.Core.Extensions;
|
||||
using ComputeSharp.Graphics.Resources.Interop;
|
||||
@@ -38,5 +39,22 @@ namespace ComputeSharp.Graphics.Extensions
|
||||
{
|
||||
d3D12Resource.Unmap(0, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Assigns a name to a given <see cref="ID3D12Resource"/>.
|
||||
/// </summary>
|
||||
/// <param name="d3D12Resource">The target <see cref="ID3D12Resource"/> to map.</param>
|
||||
/// <param name="wrapper">The wrapper object to get the name from.</param>
|
||||
/// <exception cref="Exception">Thrown when the mapping operation fails.</exception>
|
||||
[Conditional("DEBUG")]
|
||||
public static void SetName(this ref ID3D12Resource d3D12Resource, object wrapper)
|
||||
{
|
||||
string name = wrapper.ToString()!;
|
||||
|
||||
fixed (char* p = name)
|
||||
{
|
||||
d3D12Resource.SetName((ushort*)p).Assert();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,6 +80,8 @@ namespace ComputeSharp.Resources
|
||||
device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource.Get(), (uint)length, elementSizeInBytes, D3D12CpuDescriptorHandle);
|
||||
break;
|
||||
}
|
||||
|
||||
this.d3D12Resource.Get()->SetName(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -111,6 +111,8 @@ namespace ComputeSharp.Resources
|
||||
device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType<T>(), D3D12_UAV_DIMENSION_TEXTURE2D, D3D12CpuDescriptorHandle);
|
||||
break;
|
||||
}
|
||||
|
||||
this.d3D12Resource.Get()->SetName(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -115,6 +115,8 @@ namespace ComputeSharp.Resources
|
||||
device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType<T>(), D3D12_UAV_DIMENSION_TEXTURE3D, D3D12CpuDescriptorHandle);
|
||||
break;
|
||||
}
|
||||
|
||||
this.d3D12Resource.Get()->SetName(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -48,6 +48,8 @@ namespace ComputeSharp.Resources
|
||||
|
||||
this.d3D12Resource = device.D3D12Device->CreateCommittedResource(resourceType, allocationMode, sizeInBytes, device.IsCacheCoherentUMA);
|
||||
this.mappedData = (T*)this.d3D12Resource.Get()->Map().Pointer;
|
||||
|
||||
this.d3D12Resource.Get()->SetName(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -65,6 +65,8 @@ namespace ComputeSharp.Resources
|
||||
|
||||
this.d3D12Resource = GraphicsDevice.D3D12Device->CreateCommittedResource(resourceType, allocationMode, totalSizeInBytes, GraphicsDevice.IsCacheCoherentUMA);
|
||||
this.mappedData = (T*)this.d3D12Resource.Get()->Map().Pointer;
|
||||
|
||||
this.d3D12Resource.Get()->SetName(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -68,6 +68,8 @@ namespace ComputeSharp.Resources
|
||||
|
||||
this.d3D12Resource = GraphicsDevice.D3D12Device->CreateCommittedResource(resourceType, allocationMode, totalSizeInBytes, GraphicsDevice.IsCacheCoherentUMA);
|
||||
this.mappedData = (T*)this.d3D12Resource.Get()->Map().Pointer;
|
||||
|
||||
this.d3D12Resource.Get()->SetName(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする