public final class R2DepthVarianceBufferPool extends Object implements R2RenderTargetPoolType<R2DepthVarianceBufferDescription,R2DepthVarianceBufferUsableType>
A pool of depth variance buffers, with a configurable soft and hard size.
Objects within the pool will occasionally be discarded so that the storage size of the pool stays below the soft limit. The size of the pool will never be allowed to grow beyond the hard limit, and attempting to do this will result in exceptions being raised.
Modifier and Type | Method and Description |
---|---|
void |
delete(com.io7m.jcanephora.texture.unit_allocator.JCGLTextureUnitContextParentType c)
Delete the pool.
|
R2DepthVarianceBufferUsableType |
get(com.io7m.jcanephora.texture.unit_allocator.JCGLTextureUnitContextParentType tc,
R2DepthVarianceBufferDescription desc)
Get a render target from the pool, allocating a new one if necessary.
|
boolean |
isDeleted() |
static R2RenderTargetPoolType<R2DepthVarianceBufferDescription,R2DepthVarianceBufferUsableType> |
newPool(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g,
long soft,
long hard)
Construct a new pool with the given size limits.
|
void |
returnValue(com.io7m.jcanephora.texture.unit_allocator.JCGLTextureUnitContextParentType tc,
R2DepthVarianceBufferUsableType target)
Return a render target that has previously been fetched via
R2RenderTargetPoolUsableType.get(JCGLTextureUnitContextParentType, R2RenderTargetDescriptionType) . |
public static R2RenderTargetPoolType<R2DepthVarianceBufferDescription,R2DepthVarianceBufferUsableType> newPool(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g, long soft, long hard)
g
- An OpenGL interfacesoft
- The soft limit for the pool in byteshard
- The hard limit for the pool in bytespublic R2DepthVarianceBufferUsableType get(com.io7m.jcanephora.texture.unit_allocator.JCGLTextureUnitContextParentType tc, R2DepthVarianceBufferDescription desc)
R2RenderTargetPoolUsableType
Get a render target from the pool, allocating a new one if necessary.
The returned render target is guaranteed to be different from any other
that has been returned from this call and not yet returned with R2RenderTargetPoolUsableType.returnValue(JCGLTextureUnitContextParentType, R2RenderTargetUsableType)
.
get
in interface R2RenderTargetPoolUsableType<R2DepthVarianceBufferDescription,R2DepthVarianceBufferUsableType>
tc
- A texture unit contextdesc
- A render target descriptionR2RenderTargetPoolUsableType.returnValue(JCGLTextureUnitContextParentType, R2RenderTargetUsableType)
public void returnValue(com.io7m.jcanephora.texture.unit_allocator.JCGLTextureUnitContextParentType tc, R2DepthVarianceBufferUsableType target)
R2RenderTargetPoolUsableType
R2RenderTargetPoolUsableType.get(JCGLTextureUnitContextParentType, R2RenderTargetDescriptionType)
.returnValue
in interface R2RenderTargetPoolUsableType<R2DepthVarianceBufferDescription,R2DepthVarianceBufferUsableType>
tc
- A texture unit contexttarget
- A render targetpublic void delete(com.io7m.jcanephora.texture.unit_allocator.JCGLTextureUnitContextParentType c)
R2RenderTargetPoolType
delete
in interface R2RenderTargetPoolType<R2DepthVarianceBufferDescription,R2DepthVarianceBufferUsableType>
c
- A texture unit contextpublic boolean isDeleted()
isDeleted
in interface R2RenderTargetPoolType<R2DepthVarianceBufferDescription,R2DepthVarianceBufferUsableType>
true
iff the pool is deletedCopyright © 2017 <code@io7m.com> http://io7m.com