Class 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 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