feat(rendergraph): async queue, pool refactor, barrier cleanup

Refactor resource pool to use UnsafeQueue/UnsafeList for transient resources, improving memory management and performance.
Add async GPU wait support to ICommandQueue and D3D12.
Refactor render graph barrier system, streamline CompiledBarrier, and remove ResourceBarrier.
RenderGraphCompiler now returns Result<float2, Error> for dynamic resolution scaling.
Replace custom memory pools with Allocator.FreeList for temp allocations.
Add ResourceUploadBatch for async/sync resource uploads.
Fix D3D12 disposal and fence tracking bugs.
Update NuGet dependencies.
Numerous minor cleanups and code improvements.
This commit is contained in:
2026-04-05 17:54:23 +09:00
parent 92970f85ef
commit effd33b285
35 changed files with 472 additions and 494 deletions

View File

@@ -8,21 +8,20 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<IsAotCompatible>True</IsAotCompatible>
<DefineConstants>$(DefineConstants);MHP_ENABLE_SAFETY_CHECKS</DefineConstants>
<IsAotCompatible>True</IsAotCompatible>
<IsTrimmable>True</IsTrimmable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<IsAotCompatible>True</IsAotCompatible>
<!--<DefineConstants>$(DefineConstants);MHP_ENABLE_SAFETY_CHECKS</DefineConstants>-->
<IsTrimmable>True</IsTrimmable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Misaki.HighPerformance" Version="1.0.6" />
<PackageReference Include="Misaki.HighPerformance" Version="1.0.7" />
<PackageReference Include="Misaki.HighPerformance.Jobs" Version="1.5.8" />
<PackageReference Include="Misaki.HighPerformance.LowLevel" Version="1.6.9">
<PackageReference Include="Misaki.HighPerformance.LowLevel" Version="1.6.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -18,31 +18,37 @@ public readonly struct Result
_message = message;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Result Success()
{
return new Result(true);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Result Failure(string? message = null)
{
return new Result(false, message);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Result Failure(Error status)
{
return new Result(false, status.ToString());
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Result<T> Success<T>(T value)
{
return Result<T>.Success(value);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Result<T> Failure<T>(string? message = null)
{
return Result<T>.Failure(message);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Result<T> Failure<T>(Error status)
{
return Result<T>.Failure(status.ToString());
@@ -69,6 +75,7 @@ public readonly struct Result<T>
/// </summary>
public T Value
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
#if DEBUG || GHOST_EDITOR
@@ -92,11 +99,13 @@ public readonly struct Result<T>
_message = message;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Result<T> Success(T value)
{
return new Result<T>(true, value);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Result<T> Failure(string? message = null)
{
return new Result<T>(false, default!, message);
@@ -144,6 +153,7 @@ public readonly struct Result<T, E>
/// </summary>
public T Value
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
#if DEBUG || GHOST_EDITOR
@@ -166,11 +176,13 @@ public readonly struct Result<T, E>
_error = status;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Result<T, E> Success(T value)
{
return new Result<T, E>(value, default);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Result<T, E> Failure(E status)
{
return new Result<T, E>(default!, status);
@@ -200,6 +212,7 @@ public readonly ref struct RefResult<T, E>
/// </summary>
public ref T Value
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
#if DEBUG || GHOST_EDITOR
@@ -222,11 +235,13 @@ public readonly ref struct RefResult<T, E>
_error = error;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static RefResult<T, E> Success(ref T value)
{
return new RefResult<T, E>(ref value, default);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static RefResult<T, E> Failure(E error)
{
return new RefResult<T, E>(ref Unsafe.NullRef<T>(), error);