Package icyllis.arc3d.engine

# Class GpuRenderTarget

java.lang.Object
icyllis.arc3d.engine.Resource
icyllis.arc3d.engine.GpuSurface
icyllis.arc3d.engine.GpuRenderTarget

All Implemented Interfaces:
  `RefCounted`

Direct Known Subclasses:
  `GLRenderTarget`, `VulkanRenderTarget`

@Deprecated public abstract class GpuRenderTarget extends GpuSurface
Deprecated.
The `GpuRenderTarget` manages all objects used by a rendering pipeline, which are framebuffers, render passes and a set of attachments. This is the target of `OpsRenderPass`, and may be associated with `Surface`.

A `GpuRenderTarget` may be associated with one or more renderable `Image`s or a wrapped presentable object. This class is used by the pipeline internally. Use `RenderTargetProxy` for high-level operations.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `GpuRenderTarget.ResourceKey`
  Deprecated.
  Scratch key of `GpuRenderTarget`.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected int`
  `mSurfaceFlags`
  Deprecated.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `GpuRenderTarget(Context context, int width, int height, int sampleCount, int numColorTargets)`
  Deprecated.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Image`
  `asImage()`
  Deprecated.
  If this object is image, returns this.
  `final GpuRenderTarget`
  `asRenderTarget()`
  Deprecated.
  If this object is RT, returns this.
  `protected abstract boolean`
  `canAttachStencil()`
  Deprecated.
  `abstract BackendFormat`
  `getBackendFormat()`
  Deprecated.
  Describes the backend format of color buffers.
  `abstract BackendRenderTarget`
  `getBackendRenderTarget()`
  Deprecated.
  Describes the backend render target of this render target.
  `abstract @RawPtr Image`
  `getColorAttachment()`
  Deprecated.
  `abstract @RawPtr Image`
  `getColorAttachment(int index)`
  Deprecated.
  `protected abstract @RawPtr Image[]`
  `getColorAttachments()`
  Deprecated.
  `abstract int`
  `getDepthBits()`
  Deprecated.
  Get the number of implicit depth bits, or 0 if no depth.
  `abstract @RawPtr Image`
  `getDepthStencilAttachment()`
  Deprecated.
  Get the dynamic or implicit stencil buffer, or null if no stencil.
  `final int`
  `getHeight()`
  Deprecated.
  Returns the effective height (intersection) of color buffers.
  `abstract @RawPtr Image`
  `getResolveAttachment()`
  Deprecated.
  `abstract @RawPtr Image`
  `getResolveAttachment(int index)`
  Deprecated.
  `protected abstract @RawPtr Image[]`
  `getResolveAttachments()`
  Deprecated.
  `final int`
  `getSampleCount()`
  Deprecated.
  Returns the number of samples per pixel in color buffers (One if non-MSAA).
  `abstract int`
  `getStencilBits()`
  Deprecated.
  Get the number of implicit stencil bits, or 0 if no stencil.
  `int`
  `getSurfaceFlags()`
  Deprecated.
  Surface flags.
  `final int`
  `getWidth()`
  Deprecated.
  Returns the effective width (intersection) of color buffers.
  `final int`
  `numColorTargets()`
  Deprecated.

  ### Methods inherited from class icyllis.arc3d.engine.GpuSurface

  `isProtected`

  ### Methods inherited from class icyllis.arc3d.engine.Resource

  `getContext, getDevice, getKey, getLabel, getMemorySize, getUniqueID, hasAnyRefs, hasCacheRef, hasCommandBufferRef, hasUsageRef, isBudgeted, isDestroyed, isPurgeable, isWrapped, onRelease, onSetLabel, ref, refCommandBuffer, setKey, setLabel, setNonCacheable, unref, unrefCommandBuffer`

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

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

- ## Field Details

  - ### mSurfaceFlags

    protected int mSurfaceFlags
    Deprecated.

- ## Constructor Details

  - ### GpuRenderTarget

    protected GpuRenderTarget(Context context, int width, int height, int sampleCount, int numColorTargets)
    Deprecated.

- ## Method Details

  - ### getWidth

    public final int getWidth()
    Deprecated.
    Returns the effective width (intersection) of color buffers.
    Specified by:
      `getWidth` in class `GpuSurface`
    Returns:
      the width of the surface in pixels, greater than zero

  - ### getHeight

    public final int getHeight()
    Deprecated.
    Returns the effective height (intersection) of color buffers.
    Specified by:
      `getHeight` in class `GpuSurface`
    Returns:
      the height of the surface in pixels, greater than zero

  - ### getSampleCount

    public final int getSampleCount()
    Deprecated.
    Returns the number of samples per pixel in color buffers (One if non-MSAA).
    Specified by:
      `getSampleCount` in class `GpuSurface`
    Returns:
      the number of samples, greater than (multisample) or equal to one

  - ### getBackendFormat

    @Nonnull public abstract BackendFormat getBackendFormat()
    Deprecated.
    Describes the backend format of color buffers.
    Overrides:
      `getBackendFormat` in class `GpuSurface`

  - ### getBackendRenderTarget

    @Nonnull public abstract BackendRenderTarget getBackendRenderTarget()
    Deprecated.
    Describes the backend render target of this render target.

  - ### asImage

    public Image asImage()
    Deprecated.
    Description copied from class: `GpuSurface`
    If this object is image, returns this.

    If this object is RT, returns the resolve attachment 0 if available, or returns the color attachment 0 if available, or null.

    Overrides:
      `asImage` in class `GpuSurface`
    Returns:
      raw ptr to the image

  - ### asRenderTarget

    public final GpuRenderTarget asRenderTarget()
    Deprecated.
    Description copied from class: `GpuSurface`
    If this object is RT, returns this.

    If this object is image, returns null.

    Overrides:
      `asRenderTarget` in class `GpuSurface`
    Returns:
      raw ptr to this

  - ### getSurfaceFlags

    public int getSurfaceFlags()
    Deprecated.
    Description copied from class: `GpuSurface`
    Surface flags.
    - `ISurface.FLAG_BUDGETED` - Indicates whether an allocation should count against a cache budget. Budgeted when set, otherwise not budgeted.
    - `ISurface.FLAG_MIPMAPPED` - Used to say whether an image has mip levels allocated or not. Mipmaps are allocated when set, otherwise mipmaps are not allocated. `Image` only.
    - `ISurface.FLAG_RENDERABLE` - Used to say whether a surface can be rendered to, whether an image can be used as color attachments. Renderable when set, otherwise not renderable.
    - `ISurface.FLAG_PROTECTED` - Used to say whether image is backed by protected memory. Protected when set, otherwise not protected.
    - `ISurface.FLAG_READ_ONLY` - Means the pixels in the image are read-only. Non-renderable `Image` only.
    Specified by:
      `getSurfaceFlags` in class `GpuSurface`
    Returns:
      combination of the above flags

  - ### numColorTargets

    public final int numColorTargets()
    Deprecated.

  - ### getColorAttachment

    @RawPtr @Nullable public abstract @RawPtr Image getColorAttachment()
    Deprecated.

  - ### getColorAttachment

    @RawPtr @Nullable public abstract @RawPtr Image getColorAttachment(int index)
    Deprecated.

  - ### getColorAttachments

    @RawPtr @Nullable protected abstract @RawPtr Image[] getColorAttachments()
    Deprecated.

  - ### getResolveAttachment

    @RawPtr @Nullable public abstract @RawPtr Image getResolveAttachment()
    Deprecated.

  - ### getResolveAttachment

    @RawPtr @Nullable public abstract @RawPtr Image getResolveAttachment(int index)
    Deprecated.

  - ### getResolveAttachments

    @RawPtr @Nullable protected abstract @RawPtr Image[] getResolveAttachments()
    Deprecated.

  - ### getDepthStencilAttachment

    @RawPtr @Nullable public abstract @RawPtr Image getDepthStencilAttachment()
    Deprecated.
    Get the dynamic or implicit stencil buffer, or null if no stencil.

  - ### getDepthBits

    public abstract int getDepthBits()
    Deprecated.
    Get the number of implicit depth bits, or 0 if no depth.
    Specified by:
      `getDepthBits` in class `GpuSurface`

  - ### getStencilBits

    public abstract int getStencilBits()
    Deprecated.
    Get the number of implicit stencil bits, or 0 if no stencil.
    Specified by:
      `getStencilBits` in class `GpuSurface`

  - ### canAttachStencil

    protected abstract boolean canAttachStencil()
    Deprecated.
    Returns:
      whether a stencil buffer can be attached to this render target.