Minor rebase fixes
このコミットが含まれているのは:
1 親
194dae1f50
コミット
cb0268286e
4ファイル変更
+9
-179
検索条件に一致するファイルはありません
@@ -7,10 +7,14 @@
|
||||
<Description>ComputeSharp</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Toolkit.Diagnostics" Version="7.0.0-build.776" />
|
||||
<PackageReference Include="TerraFX.Interop.Windows" Version="10.0.19041-beta2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Toolkit.Diagnostics" Version="7.0.0-build.776" />
|
||||
<PackageReference Include="TerraFX.Interop.Windows" Version="10.0.19041-beta2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\terrafx.interop.d3d12memoryallocator\sources\Interop\D3D12MemoryAllocator\TerraFX.Interop.D3D12MemoryAllocator.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="Libraries\dxcompiler.dll"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using ComputeSharp.Core.Extensions;
|
||||
using ComputeSharp.Graphics.Resources.Enums;
|
||||
using ComputeSharp.Interop;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using TerraFX.Interop;
|
||||
@@ -7,6 +6,7 @@ using static TerraFX.Interop.D3D12_HEAP_TYPE;
|
||||
using static TerraFX.Interop.D3D12_RESOURCE_FLAGS;
|
||||
using static TerraFX.Interop.D3D12_RESOURCE_STATES;
|
||||
using static TerraFX.Interop.ALLOCATION_FLAGS;
|
||||
using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType;
|
||||
|
||||
namespace ComputeSharp.Graphics.Extensions
|
||||
{
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using TerraFX.Interop;
|
||||
|
||||
namespace ComputeSharp.Graphics
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="ComPtr{T}"/>-equivalent type to safely work with <see cref="Allocation"/> pointers.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// While this type is not marked as <see langword="ref"/> so that it can also be used in fields, make sure to
|
||||
/// keep the reference counts properly tracked if you do store <see cref="ComPtr{T}"/> instances on the heap.
|
||||
/// </remarks>
|
||||
internal unsafe struct AllocationPtr : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The raw pointer to an <see cref="Allocation"/> object, if existing.
|
||||
/// </summary>
|
||||
private Allocation* pointer;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="ComPtr{T}"/> instance from a raw pointer.
|
||||
/// </summary>
|
||||
/// <param name="other">The raw pointer to wrap.</param>
|
||||
public AllocationPtr(Allocation* other)
|
||||
{
|
||||
pointer = other;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unwraps a <see cref="AllocationPtr"/> instance and returns the internal raw pointer.
|
||||
/// </summary>
|
||||
/// <param name="other">The <see cref="AllocationPtr"/> instance to unwrap.</param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static implicit operator Allocation*(AllocationPtr other)
|
||||
{
|
||||
return other.Get();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Dispose()
|
||||
{
|
||||
Allocation* pointer = this.pointer;
|
||||
|
||||
if (pointer != null)
|
||||
{
|
||||
this.pointer = null;
|
||||
|
||||
pointer->Release();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the currently wrapped raw pointer to an <see cref="Allocation"/> object.
|
||||
/// </summary>
|
||||
/// <returns>The raw pointer wrapped by the current <see cref="Allocation"/> instance.</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly Allocation* Get()
|
||||
{
|
||||
return this.pointer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the address of the current <see cref="AllocationPtr"/> instance as a raw <see cref="Allocation"/> double pointer.
|
||||
/// This method is only valid when the current <see cref="AllocationPtr"/> instance is on the stack or pinned.
|
||||
/// </summary>
|
||||
/// <returns>The raw pointer to the current <see cref="AllocationPtr"/> instance.</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly Allocation** GetAddressOf()
|
||||
{
|
||||
return (Allocation**)Unsafe.AsPointer(ref Unsafe.AsRef(in this));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the address of the current <see cref="AllocationPtr"/> instance as a raw <see langword="void"/> double pointer.
|
||||
/// </summary>
|
||||
/// <returns>The raw pointer to the input <see cref="AllocationPtr"/> instance.</returns>
|
||||
/// <remarks>This method is only valid when the current <see cref="AllocationPtr"/> instance is on the stack or pinned.</remarks>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public AllocationPtr Move()
|
||||
{
|
||||
AllocationPtr copy = this;
|
||||
|
||||
this = default;
|
||||
|
||||
return copy;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using TerraFX.Interop;
|
||||
|
||||
namespace ComputeSharp.Graphics
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="ComPtr{T}"/>-equivalent type to safely work with <see cref="Allocator"/> pointers.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// While this type is not marked as <see langword="ref"/> so that it can also be used in fields, make sure to
|
||||
/// keep the reference counts properly tracked if you do store <see cref="ComPtr{T}"/> instances on the heap.
|
||||
/// </remarks>
|
||||
internal unsafe struct AllocatorPtr : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The raw pointer to an <see cref="Allocator"/> object, if existing.
|
||||
/// </summary>
|
||||
private Allocator* pointer;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="ComPtr{T}"/> instance from a raw pointer.
|
||||
/// </summary>
|
||||
/// <param name="other">The raw pointer to wrap.</param>
|
||||
public AllocatorPtr(Allocator* other)
|
||||
{
|
||||
pointer = other;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unwraps a <see cref="AllocatorPtr"/> instance and returns the internal raw pointer.
|
||||
/// </summary>
|
||||
/// <param name="other">The <see cref="AllocatorPtr"/> instance to unwrap.</param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static implicit operator Allocator*(AllocatorPtr other)
|
||||
{
|
||||
return other.Get();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Dispose()
|
||||
{
|
||||
Allocator* pointer = this.pointer;
|
||||
|
||||
if (pointer != null)
|
||||
{
|
||||
this.pointer = null;
|
||||
|
||||
pointer->Release();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the currently wrapped raw pointer to an <see cref="Allocator"/> object.
|
||||
/// </summary>
|
||||
/// <returns>The raw pointer wrapped by the current <see cref="Allocator"/> instance.</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly Allocator* Get()
|
||||
{
|
||||
return this.pointer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the address of the current <see cref="AllocatorPtr"/> instance as a managed <see cref="Allocator"/> reference to pointer.
|
||||
/// </summary>
|
||||
/// <returns>The reference to the current <see cref="AllocatorPtr"/> instance.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public readonly ref Allocator* GetPinnableReference()
|
||||
{
|
||||
fixed (Allocator** ptr = &this.pointer)
|
||||
{
|
||||
return ref *ptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする