com.io7m.r2.core

## Class R2DepthVarianceBufferPool

- java.lang.Object
- - com.io7m.r2.core.R2DepthVarianceBufferPool

- All Implemented Interfaces:
    R2RenderTargetPoolType<R2DepthVarianceBufferDescriptionType,R2DepthVarianceBufferUsableType>, R2RenderTargetPoolUsableType<R2DepthVarianceBufferDescriptionType,R2DepthVarianceBufferUsableType>

      public final class R2DepthVarianceBufferPool
      extends Object
      implements R2RenderTargetPoolType<R2DepthVarianceBufferDescriptionType,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.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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, R2DepthVarianceBufferDescriptionType desc)` Get a render target from the pool, allocating a new one if necessary.
    `boolean` | `isDeleted()`
    `static R2RenderTargetPoolType<R2DepthVarianceBufferDescriptionType,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)`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### newPool

          public static R2RenderTargetPoolType<R2DepthVarianceBufferDescriptionType,R2DepthVarianceBufferUsableType> newPool(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g,
                                                                                                                             long soft,
                                                                                                                             long hard)

      Construct a new pool with the given size limits.
      Parameters:
        `g` - An OpenGL interface
        `soft` - The soft limit for the pool in bytes
        `hard` - The hard limit for the pool in bytes
      Returns:
        A new pool

    - #### get

          public R2DepthVarianceBufferUsableType get(com.io7m.jcanephora.texture_unit_allocator.JCGLTextureUnitContextParentType tc,
                                                     R2DepthVarianceBufferDescriptionType desc)

      Description copied from interface: `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)` .

      Specified by:
        `get` in interface `R2RenderTargetPoolUsableType<R2DepthVarianceBufferDescriptionType,R2DepthVarianceBufferUsableType>`
      Parameters:
        `tc` - A texture unit context
        `desc` - A render target description
      Returns:
        A (possibly new) render target that must be returned after use
      See Also:
        `R2RenderTargetPoolUsableType.returnValue(JCGLTextureUnitContextParentType, R2RenderTargetUsableType)`

    - #### returnValue

          public void returnValue(com.io7m.jcanephora.texture_unit_allocator.JCGLTextureUnitContextParentType tc,
                                  R2DepthVarianceBufferUsableType target)

      Description copied from interface: `R2RenderTargetPoolUsableType`
      Return a render target that has previously been fetched via `R2RenderTargetPoolUsableType.get(JCGLTextureUnitContextParentType, R2RenderTargetDescriptionType)`.
      Specified by:
        `returnValue` in interface `R2RenderTargetPoolUsableType<R2DepthVarianceBufferDescriptionType,R2DepthVarianceBufferUsableType>`
      Parameters:
        `tc` - A texture unit context
        `target` - A render target

    - #### delete

          public void delete(com.io7m.jcanephora.texture_unit_allocator.JCGLTextureUnitContextParentType c)

      Description copied from interface: `R2RenderTargetPoolType`
      Delete the pool.
      Specified by:
        `delete` in interface `R2RenderTargetPoolType<R2DepthVarianceBufferDescriptionType,R2DepthVarianceBufferUsableType>`
      Parameters:
        `c` - A texture unit context

    - #### isDeleted

          public boolean isDeleted()

      Specified by:
        `isDeleted` in interface `R2RenderTargetPoolType<R2DepthVarianceBufferDescriptionType,R2DepthVarianceBufferUsableType>`
      Returns:
        `true` iff the pool is deleted

Copyright © 2017 <code@io7m.com> http://io7m.com