Class ImmediateContext

All Implemented Interfaces:
RefCounted

public final class ImmediateContext extends Context
Immediate context is used for command list execution and queue submission. That thread is also known as command execution thread and submission thread.
  • Constructor Details

    • ImmediateContext

      @Internal public ImmediateContext(Device device, QueueManager queueManager)
      Use backend utility class to create context.
  • Method Details

    • makeRecordingContext

      @Nullable @SharedPtr public @SharedPtr RecordingContext makeRecordingContext()
    • makeRecordingContext

      @Nullable @SharedPtr public @SharedPtr RecordingContext makeRecordingContext(RecordingContextOptions options)
    • resetContext

      public void resetContext(int state)
      The context normally assumes that no outsider is setting state within the underlying 3D API's context/device. This call informs the context that the state was modified and it should resend.

      The flag bits, state, is dependent on which backend is used by the context, only GL.

      See Also:
    • isDiscarded

      public boolean isDiscarded()
    • getQueueManager

      @Internal public QueueManager getQueueManager()
    • addTask

      public boolean addTask(@RawPtr @RawPtr Task task)
    • submit

      public boolean submit()
    • checkForFinishedWork

      public void checkForFinishedWork()
    • currentCommandBuffer

      @VisibleForTesting @Internal public CommandBuffer currentCommandBuffer()
    • isDeviceLost

      public boolean isDeviceLost()
      Overrides:
      isDeviceLost in class Context
    • freeGpuResources

      public void freeGpuResources()
      Description copied from class: Context
      Frees GPU resources created and held by the Context. Can be called to reduce GPU memory pressure. Any resources that are still in use (e.g. being used by work submitted to the GPU) will not be deleted by this call. If the caller wants to make sure all resources are freed, then they should first make sure to submit and wait on any outstanding work.
      Specified by:
      freeGpuResources in class Context
    • performDeferredCleanup

      public void performDeferredCleanup(long msNotUsed)
      Description copied from class: Context
      Purge GPU resources on the Context that haven't been used in the past 'msNotUsed' milliseconds or are otherwise marked for deletion, regardless of whether the context is under budget.
      Specified by:
      performDeferredCleanup in class Context
    • init

      public boolean init()
    • deallocate

      protected void deallocate()
      Description copied from class: RefCnt
      Override this method to invoke de-allocation of the underlying resource.
      Overrides:
      deallocate in class Context