Frame | |
public class FrameResources : IDisposable
The FrameResources type exposes the following members.
| Name | Description | |
|---|---|---|
| FrameResources | Initializes a new instance of the FrameResources class |
| Name | Description | |
|---|---|---|
| FrameNumber | Current frame number. | |
| ImageAvailableSemaphore | ImageAvailableSemaphore is used to signal the Submitted queue to wait until either: the SwapChainImage returned by the AcquireNextImage is available for rendering, or Avalonia's UpdateWithSemaphoresAsync has signaled that the image can be used for another frame. | |
| InFlightFrameIndex | Index of this FrameResources in the SceneView's FrameResources array (in-flight frame index). | |
| IsDisposed | ||
| IsHandedToConsumer | True when this frame was already handed over to the consumer (Avalonia compositor). This is independent of IsRenderFinishedSemaphorePending, because when WaitForSharpEngineToFinishRendering is true, no RenderFinishedSemaphore is signaled at all. | |
| IsImageAvailableSemaphoreSignalScheduled | True when a signal operation for the ImageAvailableSemaphore has already been submitted (by AcquireNextImage or by Avalonia's UpdateWithSemaphoresAsync). Only when this is true, the semaphore may (and must) be used as a wait semaphore in the next QueueSubmit. | |
| IsRenderFinishedSemaphorePending | When true, then SharpEngine submitted a queue with RenderFinishedSemaphore set as signal semaphore. NOTE that this semaphore must not be used again in a SubmitQueue call without being waited - this is done when the task returned by UpdateWithSemaphoresAsync (UpdateTask) is completed or by the Present call. | |
| IsSubmitted | True when SharpEngine submitted a queue for the specified FrameNumber. | |
| IsWaitingForConsumer | True when this frame is rendered but was not yet handed over to the consumer (Avalonia compositor). | |
| RenderFinishedFence | RenderFinishedFence is used to check when the submitted queue has finished rendering the image. | |
| RenderFinishedSemaphore | RenderFinishedSemaphore is used to signal: the Present queue to wait until the Submitted queue has finished rendering the image or signal the Avalonia's UpdateWithSemaphoresAsync method when the rendered scene is ready for presentation. | |
| SemaphoreGlobalIndex | Gets a static integer value that is increase each time semaphores are created. This can be used to when checking if imported semaphores are still valid (because the newly created semaphore handle value can be the same as the old one). | |
| SkippedFramesCount | Number of consecutive frames that were skipped because the consumer did not consume the previously rendered frame. Used to log a warning when the rendering appears to be stuck. | |
| SwapChainIndex | Gets the index of the swap chain image that is currently being rendered. This may be different from the index of this FrameResources in case AcquireNextImage returns the same index as in the previous frame. | |
| UpdateTask | This can be set to Avalonia's UpdateTask that must be finished before the ImageAvailableSemaphore can be used in QueueSubmit. Also, if IsRenderFinishedSemaphorePending is true, and UpdateTask is null, this means that Avalonia's Render method was not yet called and we must skip rendering SharpEngine's frame to prevent using RenderFinishedSemaphore two times in QueueSubmit. This is set to null when the task is completed. | |
| UpdateTaskFrameNumber | FrameNumber for which the UpdateTask was created (used for logging and to detect stale tasks). |
| Name | Description | |
|---|---|---|
| CreateSemaphores | ||
| Dispose | ||
| DisposeSemaphores | ||
| WaitUpdateTask | ||
| WaitUpdateTaskAsync |