Package icyllis.arc3d.engine
Class ImmediateContext
java.lang.Object
icyllis.arc3d.core.RefCnt
icyllis.arc3d.engine.Context
icyllis.arc3d.engine.ImmediateContext
- All Implemented Interfaces:
RefCounted
Immediate context is used for command list execution and queue submission.
That thread is also known as command execution thread and submission thread.
-
Field Summary
Fields inherited from class icyllis.arc3d.engine.Context
mDevice, mOwnerThread, mResourceProvider
-
Constructor Summary
ConstructorDescriptionImmediateContext
(Device device, QueueManager queueManager) Use backend utility class to create context. -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
protected void
Override this method to invoke de-allocation of the underlying resource.void
Frees GPU resources created and held by the Context.boolean
init()
boolean
boolean
void
performDeferredCleanup
(long msNotUsed) 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.void
resetContext
(int state) The context normally assumes that no outsider is setting state within the underlying 3D API's context/device.boolean
submit()
Methods inherited from class icyllis.arc3d.engine.Context
checkOwnerThread, getBackend, getCaps, getCompressedBackendFormat, getContextID, getCurrentBudgetedBytes, getCurrentPurgeableBytes, getDefaultBackendFormat, getDevice, getLogger, getMaxBudgetedBytes, getMaxRenderTargetSize, getMaxSurfaceSampleCount, getMaxTextureSize, getOptions, getOwnerThread, getRendererProvider, getResourceProvider, getSharedResourceCache, init, isImmediate, isOwnerThread, matches
-
Constructor Details
-
ImmediateContext
Use backend utility class to create context.
-
-
Method Details
-
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
-
addTask
-
submit
public boolean submit() -
checkForFinishedWork
public void checkForFinishedWork() -
currentCommandBuffer
-
isDeviceLost
public boolean isDeviceLost()- Overrides:
isDeviceLost
in classContext
-
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 classContext
-
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 classContext
-
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 classContext
-