Package icyllis.arc3d.opengl

# Class GLGraphicsPipeline

java.lang.Object
icyllis.arc3d.core.RefCnt
icyllis.arc3d.engine.ManagedResource
icyllis.arc3d.engine.GraphicsPipeline
icyllis.arc3d.opengl.GLGraphicsPipeline

All Implemented Interfaces:
  `RefCounted`

public final class GLGraphicsPipeline extends GraphicsPipeline
This class manages a GPU program and records per-program information. It also records the vertex and instance attribute layouts that are to be used with the program.

This class holds onto a `GLProgram` object that we use for draws. Besides storing the actual `GLProgram` object, this class is also responsible handling all uniforms, buffers, samplers, and other similar objects that are used along with the GLProgram and GLVertexArray in the draw. This includes both allocating and freeing these objects, as well as updating their values.

Supports OpenGL 3.3 and OpenGL 4.5.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `bindIndexBuffer(@RawPtr GLBuffer buffer)`
  Set element buffer (index buffer).
  `boolean`
  `bindTextures(GLCommandBuffer commandBuffer, GraphicsPipelineDesc_Old graphicsPipelineDesc, ImageViewProxy[] geomTextures)`
  Deprecated.
  `boolean`
  `bindUniforms(GLCommandBuffer commandBuffer, GraphicsPipelineDesc_Old graphicsPipelineDesc, int width, int height)`
  Deprecated.
  `void`
  `bindVertexBuffer(int binding, @RawPtr GLBuffer buffer, long offset)`
  Set the buffer that stores the attribute data.
  `protected void`
  `deallocate()`
  Override this method to invoke de-allocation of the underlying resource.
  `void`
  `discard()`
  `BlendInfo`
  `getBlendInfo()`
  `DepthStencilSettings`
  `getDepthStencilSettings()`
  `protected GLDevice`
  `getDevice()`
  `byte`
  `getPrimitiveType()`
  `GLProgram`
  `getProgram()`
  `GLVertexArray`
  `getVertexArray()`
  `int`
  `getVertexBindingCount()`
  `int`
  `getVertexInputRate(int binding)`
  `int`
  `getVertexStride(int binding)`

  ### Methods inherited from class icyllis.arc3d.core.RefCnt

  `create, create, getRefCnt, getRefCntAcquire, getRefCntVolatile, move, move, ref, unique, unref`

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

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

- ## Method Details

  - ### discard

    public void discard()

  - ### deallocate

    protected void deallocate()
    Description copied from class: `RefCnt`
    Override this method to invoke de-allocation of the underlying resource.
    Specified by:
      `deallocate` in class `RefCnt`

  - ### getProgram

    @Nullable public GLProgram getProgram()

  - ### getVertexArray

    @Nullable public GLVertexArray getVertexArray()

  - ### bindUniforms

    @Deprecated public boolean bindUniforms(GLCommandBuffer commandBuffer, GraphicsPipelineDesc_Old graphicsPipelineDesc, int width, int height)
    Deprecated.

  - ### bindTextures

    @Deprecated public boolean bindTextures(GLCommandBuffer commandBuffer, GraphicsPipelineDesc_Old graphicsPipelineDesc, ImageViewProxy[] geomTextures)
    Deprecated.
    Binds all geometry processor and fragment processor textures.

  - ### getPrimitiveType

    public byte getPrimitiveType()

  - ### getBlendInfo

    public BlendInfo getBlendInfo()

  - ### getDepthStencilSettings

    public DepthStencilSettings getDepthStencilSettings()

  - ### getVertexBindingCount

    public int getVertexBindingCount()

  - ### getVertexStride

    public int getVertexStride(int binding)

  - ### getVertexInputRate

    public int getVertexInputRate(int binding)

  - ### bindIndexBuffer

    public void bindIndexBuffer(@Nonnull @RawPtr @RawPtr GLBuffer buffer)
    Set element buffer (index buffer).

    Bind pipeline first.

    Parameters:
      `buffer` - the element buffer object, raw ptr

  - ### bindVertexBuffer

    public void bindVertexBuffer(int binding, @Nonnull @RawPtr @RawPtr GLBuffer buffer, long offset)
    Set the buffer that stores the attribute data.

    The stride, the distance to the next vertex data, in bytes, is determined in constructor.

    Bind pipeline first.

    Parameters:
      `binding` - the binding index
      `buffer` - the vertex buffer object, raw ptr
      `offset` - first vertex data to the head of the buffer, in bytes

  - ### getDevice

    protected GLDevice getDevice()
    Overrides:
      `getDevice` in class `ManagedResource`