2023-09-19 06:18:21 +00:00
|
|
|
using System;
|
|
|
|
using RefreshCS;
|
|
|
|
|
|
|
|
namespace MoonWorks.Graphics
|
|
|
|
{
|
|
|
|
/// <summary>
|
2023-09-19 20:19:41 +00:00
|
|
|
/// Fences allow you to track the status of a submitted command buffer. <br/>
|
|
|
|
/// You should only acquire a Fence if you will need to track the command buffer. <br/>
|
|
|
|
/// You should make sure to call GraphicsDevice.ReleaseFence when done with a Fence to avoid memory growth. <br/>
|
|
|
|
/// The Fence object itself is basically just a wrapper for the Refresh_Fence. <br/>
|
2023-09-19 06:18:21 +00:00
|
|
|
/// The internal handle is replaced so that we can pool Fence objects to manage garbage.
|
|
|
|
/// </summary>
|
2023-12-15 18:46:43 +00:00
|
|
|
public class Fence : RefreshResource
|
2023-09-19 06:18:21 +00:00
|
|
|
{
|
2023-10-04 21:45:17 +00:00
|
|
|
protected override Action<nint, nint> QueueDestroyFunction => Refresh.Refresh_ReleaseFence;
|
2023-09-19 06:18:21 +00:00
|
|
|
|
2023-10-04 21:45:17 +00:00
|
|
|
internal Fence(GraphicsDevice device) : base(device)
|
2023-09-19 06:18:21 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
internal void SetHandle(nint handle)
|
|
|
|
{
|
|
|
|
Handle = handle;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|