Package icyllis.arc3d.granite
Class RecordingContext
java.lang.Object
icyllis.arc3d.core.RefCnt
icyllis.arc3d.engine.Context
icyllis.arc3d.granite.RecordingContext
- All Implemented Interfaces:
RefCounted
A command recording context for Granite Renderer.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class icyllis.arc3d.engine.Context
mDevice, mOwnerThread, mResourceProvider -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTask(@SharedPtr Task task) voidprotected voidOverride this method to invoke de-allocation of the underlying resource.voidvoidFrees GPU resources created and held by the Context.final DrawBufferManagerbooleaninit(RecordingContext.Options options) booleanReports whether theImmediateContextassociated with thisRecordingContextis discarded.final booleanisImageCompatible(int colorType) Can aImagebe created with the given color type.final booleanisSurfaceCompatible(int colorType) Can aSurfacebe created with the given color type.static @Nullable @SharedPtr RecordingContextmakeRecordingContext(ImmediateContext context, RecordingContext.Options options) voidperformDeferredCleanup(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.@Nullable Recordingsnap()voidtrackDevice(@SharedPtr GraniteDevice device) voiduntrackDevice(@RawPtr GraniteDevice device) 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, isDeviceLost, isImmediate, isOwnerThread, matches
-
Method Details
-
makeRecordingContext
@SharedPtr public static @Nullable @SharedPtr RecordingContext makeRecordingContext(ImmediateContext context, RecordingContext.Options options) -
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
-
clearStrikeCache
public void clearStrikeCache() -
isDiscarded
public boolean isDiscarded()Reports whether theImmediateContextassociated with thisRecordingContextis discarded. When called on aImmediateContextit may actively check whether the underlying 3D API device/context has been disconnected before reporting the status. If so, calling this method will transition theImmediateContextto the discarded state. -
isImageCompatible
public final boolean isImageCompatible(int colorType) Can aImagebe created with the given color type.- Parameters:
colorType- seeColorInfo
-
isSurfaceCompatible
public final boolean isSurfaceCompatible(int colorType) Can aSurfacebe created with the given color type. To check whether MSAA is supported useContext.getMaxSurfaceSampleCount(int).- Parameters:
colorType- seeColorInfo
-
getDynamicBufferManager
-
getUploadBufferManager
-
getAtlasProvider
-
getAtlasTokenTracker
-
getGlyphStrikeCache
-
getTextBlobCache
-
trackDevice
-
untrackDevice
-
addTask
-
snap
-
flushTrackedDevices
@Internal public void flushTrackedDevices() -
init
-
deallocate
protected void deallocate()Description copied from class:RefCntOverride this method to invoke de-allocation of the underlying resource.- Overrides:
deallocatein classContext
-