Minor code refactoring
このコミットが含まれているのは:
1 親
8665f6ee19
コミット
0c3f8f92c3
3ファイル変更
+11
-12
検索条件に一致するファイルはありません
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using ComputeSharp.Graphics.Buffers.Abstract;
|
||||
using ComputeSharp.Graphics.Extensions;
|
||||
using TerraFX.Interop;
|
||||
using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE;
|
||||
|
||||
+7
-7
@@ -8,7 +8,7 @@ namespace ComputeSharp.Graphics
|
||||
/// <summary>
|
||||
/// A type that provides logic to create resource descriptors for a <see cref="GraphicsDevice"/> instance.
|
||||
/// </summary>
|
||||
internal unsafe struct DescriptorAllocator : IDisposable
|
||||
internal unsafe struct ID3D12DescriptorHandleAllocator : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The default number of available descriptors per heap.
|
||||
@@ -16,7 +16,7 @@ namespace ComputeSharp.Graphics
|
||||
private const uint DescriptorsPerHeap = 4096;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="ID3D12DescriptorHeap"/> in use for the current <see cref="DescriptorAllocator"/> instance.
|
||||
/// The <see cref="ID3D12DescriptorHeap"/> in use for the current <see cref="ID3D12DescriptorHandleAllocator"/> instance.
|
||||
/// </summary>
|
||||
private ComPtr<ID3D12DescriptorHeap> d3D12DescriptorHeap;
|
||||
|
||||
@@ -31,12 +31,12 @@ namespace ComputeSharp.Graphics
|
||||
private readonly uint descriptorSize;
|
||||
|
||||
/// <summary>
|
||||
/// The current <see cref="D3D12_CPU_DESCRIPTOR_HANDLE"/> for the <see cref="DescriptorAllocator"/> instance in use.
|
||||
/// The current <see cref="D3D12_CPU_DESCRIPTOR_HANDLE"/> for the <see cref="ID3D12DescriptorHandleAllocator"/> instance in use.
|
||||
/// </summary>
|
||||
private D3D12_CPU_DESCRIPTOR_HANDLE d3d12CpuDescriptorHandle;
|
||||
|
||||
/// <summary>
|
||||
/// The current <see cref="D3D12_GPU_DESCRIPTOR_HANDLE"/> for the <see cref="DescriptorAllocator"/> instance in use.
|
||||
/// The current <see cref="D3D12_GPU_DESCRIPTOR_HANDLE"/> for the <see cref="ID3D12DescriptorHandleAllocator"/> instance in use.
|
||||
/// </summary>
|
||||
private D3D12_GPU_DESCRIPTOR_HANDLE d3d12GpuDescriptorHandle;
|
||||
|
||||
@@ -46,10 +46,10 @@ namespace ComputeSharp.Graphics
|
||||
private uint remainingHandles;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="DescriptorAllocator"/> instance with the specified parameters.
|
||||
/// Creates a new <see cref="ID3D12DescriptorHandleAllocator"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
/// <param name="device">The <see cref="ID3D12Device"/> instance to use</param>
|
||||
public DescriptorAllocator(ID3D12Device* device)
|
||||
public ID3D12DescriptorHandleAllocator(ID3D12Device* device)
|
||||
{
|
||||
this.d3D12DescriptorHeap = device->CreateDescriptorHeap(DescriptorsPerHeap);
|
||||
this.allocationLock = new object();
|
||||
@@ -60,7 +60,7 @@ namespace ComputeSharp.Graphics
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="ID3D12DescriptorHeap"/> in use for the current <see cref="DescriptorAllocator"/> instance.
|
||||
/// Gets the <see cref="ID3D12DescriptorHeap"/> in use for the current <see cref="ID3D12DescriptorHandleAllocator"/> instance.
|
||||
/// </summary>
|
||||
public ID3D12DescriptorHeap* D3D12DescriptorHeap => this.d3D12DescriptorHeap;
|
||||
|
||||
@@ -50,9 +50,9 @@ namespace ComputeSharp.Graphics
|
||||
private readonly ID3D12CommandAllocatorPool copyCommandAllocatorPool;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="DescriptorAllocator"/> instance to use when allocating new buffers.
|
||||
/// The <see cref="ID3D12DescriptorHandleAllocator"/> instance to use when allocating new buffers.
|
||||
/// </summary>
|
||||
private DescriptorAllocator shaderResourceViewDescriptorAllocator;
|
||||
private ID3D12DescriptorHandleAllocator shaderResourceViewDescriptorAllocator;
|
||||
|
||||
/// <summary>
|
||||
/// The next fence value for compute operations using <see cref="d3D12ComputeCommandQueue"/>.
|
||||
@@ -79,7 +79,7 @@ namespace ComputeSharp.Graphics
|
||||
|
||||
this.computeCommandAllocatorPool = new ID3D12CommandAllocatorPool(D3D12_COMMAND_LIST_TYPE_COMPUTE);
|
||||
this.copyCommandAllocatorPool = new ID3D12CommandAllocatorPool(D3D12_COMMAND_LIST_TYPE_COPY);
|
||||
this.shaderResourceViewDescriptorAllocator = new DescriptorAllocator(d3d12device);
|
||||
this.shaderResourceViewDescriptorAllocator = new ID3D12DescriptorHandleAllocator(d3d12device);
|
||||
|
||||
Luid = *(Luid*)&dxgiDescription1->AdapterLuid;
|
||||
Name = new string((char*)dxgiDescription1->Description);
|
||||
@@ -121,7 +121,7 @@ namespace ComputeSharp.Graphics
|
||||
/// </summary>
|
||||
internal ID3D12Device* D3D12Device => this.d3D12Device;
|
||||
|
||||
/// <inheritdoc cref="DescriptorAllocator.Allocate"/>
|
||||
/// <inheritdoc cref="ID3D12DescriptorHandleAllocator.Allocate"/>
|
||||
internal void AllocateShaderResourceViewDescriptorHandles(
|
||||
out D3D12_CPU_DESCRIPTOR_HANDLE d3d12CpuDescriptorHandle,
|
||||
out D3D12_GPU_DESCRIPTOR_HANDLE d3d12GpuDescriptorHandle)
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする