Improve exceptions in ID3D12DescriptorHandleAllocator

このコミットが含まれているのは:
Sergio Pedri committed 2022-01-29 18:37:33 +01:00
1 親 e6aad7e0ed
コミット d0e1df9d04
1ファイル変更
+8 -2
+8 -2
ファイルの表示
@@ -94,7 +94,10 @@ internal unsafe struct ID3D12DescriptorHandleAllocator : IDisposable
{
lock (this.d3D12DescriptorHandlePairs)
{
Guard.IsGreaterThan(this.size, 0, nameof(size));
if (this.size <= 0)
{
ThrowHelper.ThrowInvalidOperationException("There are no descriptor handles left in the pool.");
}
d3D12ResourceDescriptorHandles = this.d3D12DescriptorHandlePairs[this.head++];
@@ -115,7 +118,10 @@ internal unsafe struct ID3D12DescriptorHandleAllocator : IDisposable
{
lock (this.d3D12DescriptorHandlePairs)
{
Guard.IsLessThan(this.size, DescriptorsPerHeap, nameof(size));
if (this.size >= DescriptorsPerHeap)
{
ThrowHelper.ThrowInvalidOperationException("The pool of descriptor heaps is already full.");
}
this.d3D12DescriptorHandlePairs[this.tail++] = d3D12ResourceDescriptorHandles;