Package icyllis.arc3d.opengl
Class GLRenderTarget
java.lang.Object
icyllis.arc3d.engine.Resource
icyllis.arc3d.engine.GpuSurface
icyllis.arc3d.engine.GpuRenderTarget
icyllis.arc3d.opengl.GLRenderTarget
- All Implemented Interfaces:
RefCounted
Represents OpenGL framebuffers.
-
Nested Class Summary
Nested classes/interfaces inherited from class icyllis.arc3d.engine.GpuRenderTarget
GpuRenderTarget.ResourceKey -
Field Summary
Fields inherited from class icyllis.arc3d.engine.GpuRenderTarget
mSurfaceFlags -
Method Summary
Modifier and TypeMethodDescriptionvoidMake sure the stencil attachment is valid.protected boolean@NonNull BackendFormatDescribes the backend format of color buffers.@NonNull BackendRenderTargetDescribes the backend render target of this render target.getColorAttachment(int index) intGet the number of implicit depth bits, or 0 if no depth.Get the dynamic or implicit stencil buffer, or null if no stencil.protected GLDeviceintgetResolveAttachment(int index) intintGet the number of implicit stencil bits, or 0 if no stencil.booleanstatic @NonNull @SharedPtr GLRenderTargetmakeWrapped(Context context, int width, int height, BackendFormat format, int sampleCount, int framebuffer, int depthBits, int stencilBits, boolean ownership) Make aGLRenderTargetthat wraps existing framebuffers without accessing their backing buffers (texture and stencil).protected voidSubclass should override this method to free GPU resources in the backend API.toString()Methods inherited from class icyllis.arc3d.engine.GpuRenderTarget
asImage, asRenderTarget, getHeight, getSampleCount, getSurfaceFlags, getWidth, numColorTargetsMethods inherited from class icyllis.arc3d.engine.Resource
getContext, getKey, getLabel, getMemorySize, getUniqueID, hasAnyRefs, hasCacheRef, hasCommandBufferRef, hasUsageRef, isBudgeted, isDestroyed, isPurgeable, isShareable, isWrapped, onSetLabel, ref, refCommandBuffer, setLabel, setNonCacheable, unref, unrefCommandBuffer
-
Method Details
-
makeWrapped
@SharedPtr public static @NonNull @SharedPtr GLRenderTarget makeWrapped(Context context, int width, int height, BackendFormat format, int sampleCount, int framebuffer, int depthBits, int stencilBits, boolean ownership) Make aGLRenderTargetthat wraps existing framebuffers without accessing their backing buffers (texture and stencil).- Parameters:
width- the effective width of framebufferheight- the effective height of framebuffer
-
getRenderFramebuffer
public int getRenderFramebuffer() -
getResolveFramebuffer
public int getResolveFramebuffer() -
bindStencil
public void bindStencil()Make sure the stencil attachment is valid. Even though a color buffer op doesn't use stencil, our FBO still needs to be "framebuffer complete". If this render target is already bound, this method ensures the stencil attachment is valid (attached or detached), if stencil buffers reset right before. -
getBackendFormat
Description copied from class:GpuRenderTargetDescribes the backend format of color buffers.- Specified by:
getBackendFormatin classGpuRenderTarget
-
isProtected
public boolean isProtected()- Specified by:
isProtectedin classGpuSurface- Returns:
- true if we are working with protected content
-
getColorAttachment
- Specified by:
getColorAttachmentin classGpuRenderTarget
-
getColorAttachment
- Specified by:
getColorAttachmentin classGpuRenderTarget
-
getColorAttachments
- Specified by:
getColorAttachmentsin classGpuRenderTarget
-
getResolveAttachment
- Specified by:
getResolveAttachmentin classGpuRenderTarget
-
getResolveAttachment
- Specified by:
getResolveAttachmentin classGpuRenderTarget
-
getResolveAttachments
- Specified by:
getResolveAttachmentsin classGpuRenderTarget
-
getDepthStencilAttachment
Description copied from class:GpuRenderTargetGet the dynamic or implicit stencil buffer, or null if no stencil.- Specified by:
getDepthStencilAttachmentin classGpuRenderTarget
-
getDepthBits
public int getDepthBits()Description copied from class:GpuRenderTargetGet the number of implicit depth bits, or 0 if no depth.- Specified by:
getDepthBitsin classGpuRenderTarget
-
getStencilBits
public int getStencilBits()Description copied from class:GpuRenderTargetGet the number of implicit stencil bits, or 0 if no stencil.- Specified by:
getStencilBitsin classGpuRenderTarget
-
getBackendRenderTarget
Description copied from class:GpuRenderTargetDescribes the backend render target of this render target.- Specified by:
getBackendRenderTargetin classGpuRenderTarget
-
canAttachStencil
protected boolean canAttachStencil()- Specified by:
canAttachStencilin classGpuRenderTarget- Returns:
- whether a stencil buffer can be attached to this render target.
-
onRelease
protected void onRelease()Description copied from class:ResourceSubclass should override this method to free GPU resources in the backend API. -
getDevice
-
toString
-