Refresh API updates
parent
6d95203816
commit
baa4df5e18
|
@ -1 +1 @@
|
|||
Subproject commit a0cdff3054c646a532e5850c0ab89d4611069237
|
||||
Subproject commit 5d09b036cbd0a1402857776d8f39be87234b450a
|
|
@ -358,84 +358,15 @@ namespace MoonWorks.Graphics
|
|||
/// <summary>
|
||||
/// Waits for the given fence to become signaled.
|
||||
/// </summary>
|
||||
public unsafe void WaitForFences(Fence fence)
|
||||
public unsafe void WaitForFence(Fence fence)
|
||||
{
|
||||
var fenceHandle = fence.Handle;
|
||||
|
||||
Refresh.Refresh_WaitForFences(
|
||||
Handle,
|
||||
1,
|
||||
1,
|
||||
&fenceHandle
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wait for one or more fences to become signaled.
|
||||
/// </summary>
|
||||
/// <param name="waitAll">If true, will wait for all given fences to be signaled.</param>
|
||||
public unsafe void WaitForFences(
|
||||
Fence fenceOne,
|
||||
Fence fenceTwo,
|
||||
bool waitAll
|
||||
) {
|
||||
var handlePtr = stackalloc nint[2];
|
||||
handlePtr[0] = fenceOne.Handle;
|
||||
handlePtr[1] = fenceTwo.Handle;
|
||||
|
||||
Refresh.Refresh_WaitForFences(
|
||||
Handle,
|
||||
Conversions.BoolToInt(waitAll),
|
||||
2,
|
||||
handlePtr
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wait for one or more fences to become signaled.
|
||||
/// </summary>
|
||||
/// <param name="waitAll">If true, will wait for all given fences to be signaled.</param>
|
||||
public unsafe void WaitForFences(
|
||||
Fence fenceOne,
|
||||
Fence fenceTwo,
|
||||
Fence fenceThree,
|
||||
bool waitAll
|
||||
) {
|
||||
var handlePtr = stackalloc nint[3];
|
||||
handlePtr[0] = fenceOne.Handle;
|
||||
handlePtr[1] = fenceTwo.Handle;
|
||||
handlePtr[2] = fenceThree.Handle;
|
||||
|
||||
Refresh.Refresh_WaitForFences(
|
||||
Handle,
|
||||
Conversions.BoolToInt(waitAll),
|
||||
3,
|
||||
handlePtr
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wait for one or more fences to become signaled.
|
||||
/// </summary>
|
||||
/// <param name="waitAll">If true, will wait for all given fences to be signaled.</param>
|
||||
public unsafe void WaitForFences(
|
||||
Fence fenceOne,
|
||||
Fence fenceTwo,
|
||||
Fence fenceThree,
|
||||
Fence fenceFour,
|
||||
bool waitAll
|
||||
) {
|
||||
var handlePtr = stackalloc nint[4];
|
||||
handlePtr[0] = fenceOne.Handle;
|
||||
handlePtr[1] = fenceTwo.Handle;
|
||||
handlePtr[2] = fenceThree.Handle;
|
||||
handlePtr[3] = fenceFour.Handle;
|
||||
|
||||
Refresh.Refresh_WaitForFences(
|
||||
Handle,
|
||||
Conversions.BoolToInt(waitAll),
|
||||
4,
|
||||
handlePtr
|
||||
&fenceHandle,
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -455,8 +386,8 @@ namespace MoonWorks.Graphics
|
|||
Refresh.Refresh_WaitForFences(
|
||||
Handle,
|
||||
Conversions.BoolToInt(waitAll),
|
||||
4,
|
||||
handlePtr
|
||||
handlePtr,
|
||||
(uint) fences.Length
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -250,7 +250,7 @@ namespace MoonWorks.Graphics
|
|||
var commandBuffer = Device.AcquireCommandBuffer();
|
||||
RecordUploadCommands(commandBuffer);
|
||||
var fence = Device.SubmitAndAcquireFence(commandBuffer);
|
||||
Device.WaitForFences(fence);
|
||||
Device.WaitForFence(fence);
|
||||
Device.ReleaseFence(fence);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue