Refactor render graph error handling and resource APIs

- RenderGraph.Compile/Execute now return Error for better failure detection; error handling is propagated throughout compiler and executor.
- Renamed ScheduleReleaseResource to ReleaseResource for clarity; updated all usages.
- ResourceManager now calls ReleaseResource directly on Mesh, Material, and Shader types.
- Camera exposes Actual/Virtual size properties and Render returns Error.
- RenderingContext now uses IResourceManager for mesh/resource ops.
- Replaced custom BinaryWriter with BufferWriter in RenderGraphHasher.
- Improved variable naming, interface signatures, and code formatting.
- Added Error extension for IsSuccess/IsFailure.
- Minor FMOD/native interop and test code cleanups.
- No breaking API changes except for new Error return values on some methods.
This commit is contained in:
2026-02-25 19:08:54 +09:00
parent 30090f84ab
commit 162b71f309
93 changed files with 537 additions and 593 deletions

View File

@@ -114,7 +114,7 @@ public struct Color128 : IEquatable<Color128>
return obj is Color128 color && Equals(color);
}
public readonly override int GetHashCode()
public override readonly int GetHashCode()
{
return HashCode.Combine(r, g, b, a);
}
@@ -587,7 +587,7 @@ public struct ResourceDesc
}
internal resource_union _desc;
public ResourceType Type
{
get; init;

View File

@@ -8,7 +8,7 @@ public interface ICommandQueue : IDisposable
/// <summary>
/// Type of commands this queue can execute
/// </summary>
public CommandQueueType Type
CommandQueueType Type
{
get;
}
@@ -17,35 +17,35 @@ public interface ICommandQueue : IDisposable
/// Submits a single command buffer for execution
/// </summary>
/// <param name="commandBuffer">Command buffer to submit</param>
public void Submit(ICommandBuffer commandBuffer);
void Submit(ICommandBuffer commandBuffer);
/// <summary>
/// Submits multiple command buffers for execution
/// </summary>
/// <param name="commandBuffers">Command buffers to submit</param>
public void Submit(params ReadOnlySpan<ICommandBuffer> commandBuffers);
void Submit(params ReadOnlySpan<ICommandBuffer> commandBuffers);
/// <summary>
/// Signals a fence with the specified Value
/// </summary>
/// <param name="value">Value to signal</param>
/// <returns>The fence Value that was signaled</returns>
public ulong Signal(ulong value);
ulong Signal(ulong value);
/// <summary>
/// Waits for the fence to reach the specified Value
/// </summary>
/// <param name="value">Value to wait for</param>
public void WaitForValue(ulong value);
void WaitForValue(ulong value);
/// <summary>
/// Gets the last completed fence Value
/// </summary>
/// <returns>Last completed fence Value</returns>
public ulong GetCompletedValue();
ulong GetCompletedValue();
/// <summary>
/// Waits until all submitted commands have finished executing
/// </summary>
public void WaitIdle();
void WaitIdle();
}

View File

@@ -21,7 +21,7 @@ public interface IRenderDevice : IDisposable
/// <summary>
/// Graphics command queue for rendering operations
/// </summary>
public ICommandQueue GraphicsQueue
ICommandQueue GraphicsQueue
{
get;
}
@@ -29,7 +29,7 @@ public interface IRenderDevice : IDisposable
/// <summary>
/// Compute command queue for compute shader operations
/// </summary>
public ICommandQueue ComputeQueue
ICommandQueue ComputeQueue
{
get;
}
@@ -37,12 +37,12 @@ public interface IRenderDevice : IDisposable
/// <summary>
/// Copy command queue for data transfer operations
/// </summary>
public ICommandQueue CopyQueue
ICommandQueue CopyQueue
{
get;
}
public FeatureSupport FeatureSupport
FeatureSupport FeatureSupport
{
get;
}

View File

@@ -1,6 +1,4 @@
using Ghost.Core;
using Ghost.Core.Graphics;
using Misaki.HighPerformance.LowLevel.Collections;
namespace Ghost.Graphics.RHI;

View File

@@ -98,7 +98,7 @@ public interface IResourceDatabase : IDisposable
/// Releases the GPU resource associated with the specified handle, freeing any resources allocated to it.
/// </summary>
/// <param name="handle">The handle of the resource to be removed.</param>
void ScheduleReleaseResource(Handle<GPUResource> handle);
void ReleaseResource(Handle<GPUResource> handle);
/// <summary>
/// Releases the GPU resource associated with the specified handle immediately, freeing any resources allocated to it.