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
ConstructorsConstructorDescriptionImmediateContext(Device device, QueueManager queueManager) Use backend utility class to create context. -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidprotected voidOverride this method to invoke de-allocation of the underlying resource.voidFrees GPU resources created and held by the Context.booleaninit()booleanbooleanvoidperformDeferredCleanup(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.voidresetContext(int state) The context normally assumes that no outsider is setting state within the underlying 3D API's context/device.booleansubmit()Methods inherited from class icyllis.arc3d.engine.Context
checkOwnerThread, getBackend, getCaps, getCompressedBackendFormat, getContextID, getCurrentBudgetedBytes, getCurrentPurgeableBytes, getDefaultBackendFormat, getDevice, getGlobalResourceCache, getLogger, getMaxBudgetedBytes, getMaxRenderTargetSize, getMaxSurfaceSampleCount, getMaxTextureSize, getOptions, getOwnerThread, getRendererProvider, getResourceProvider, isImmediate, isOwnerThread, matches
-
Constructor Details
-
ImmediateContext
Use backend utility class to create context.
-
-
Method Details
-
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:
isDeviceLostin classContext
-
freeGpuResources
public void freeGpuResources()Description copied from class:ContextFrees 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:
freeGpuResourcesin classContext
-
performDeferredCleanup
public void performDeferredCleanup(long msNotUsed) Description copied from class:ContextPurge 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:
performDeferredCleanupin classContext
-
init
public boolean init() -
deallocate
protected void deallocate()Description copied from class:RefCntOverride this method to invoke de-allocation of the underlying resource.- Overrides:
deallocatein classContext
-