All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HgiGLShaderProgram Class Referencefinal

#include <shaderProgram.h>

+ Inheritance diagram for HgiGLShaderProgram:

Public Member Functions

HGIGL_API ~HgiGLShaderProgram () override
HGIGL_API bool IsValid () const override
 Returns false if any shader compile errors occured. More...
HGIGL_API std::string constGetCompileErrors () override
 Returns shader compile errors. More...
GetShaderFunctions () const override
 Returns the shader functions that are part of this program. More...
HGIGL_API size_t GetByteSizeOfResource () const override
HGIGL_API uint64_t GetRawResource () const override
HGIGL_API uint32_t GetProgramId () const
 Returns the gl resource id of the program. More...
HGIGL_API uint32_t GetUniformBuffer (size_t sizeHint)
- Public Member Functions inherited from HgiShaderProgram
virtual HGI_API ~HgiShaderProgram ()
HGI_API HgiShaderProgramDesc
GetDescriptor () const
 The descriptor describes the object. More...

Protected Member Functions

HGIGL_API HgiGLShaderProgram (HgiShaderProgramDesc const &desc)
- Protected Member Functions inherited from HgiShaderProgram
HGI_API HgiShaderProgram (HgiShaderProgramDesc const &desc)


class HgiGL

Additional Inherited Members

- Protected Attributes inherited from HgiShaderProgram
HgiShaderProgramDesc _descriptor

Detailed Description

OpenGL implementation of HgiShaderProgram

Definition at line 42 of file shaderProgram.h.

Constructor & Destructor Documentation

HGIGL_API HgiGLShaderProgram::~HgiGLShaderProgram ( )
HGIGL_API HgiGLShaderProgram::HgiGLShaderProgram ( HgiShaderProgramDesc const desc)

Member Function Documentation

HGIGL_API size_t HgiGLShaderProgram::GetByteSizeOfResource ( ) const

Returns the byte size of the GPU shader program. APIs that do not have programs can return the combined byte size of the shader functions used by the program. This can be helpful if the application wishes to tally up memory usage.

Implements HgiShaderProgram.

HGIGL_API std::string const& HgiGLShaderProgram::GetCompileErrors ( )

Returns shader compile errors.

Implements HgiShaderProgram.

HGIGL_API uint32_t HgiGLShaderProgram::GetProgramId ( ) const

Returns the gl resource id of the program.

HGIGL_API uint64_t HgiGLShaderProgram::GetRawResource ( ) const

This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t. Clients should avoid using this function and instead use Hgi base classes so that client code works with any Hgi platform. For transitioning code to Hgi, it can however we useful to directly access a platform's internal resource handles. There is no safety provided in using this. If you by accident pass a HgiMetal resource into an OpenGL call, bad things may happen. In OpenGL this returns the GLuint resource name. In Metal, Vulkan this returns 0.

Implements HgiShaderProgram.

HGIGL_API HgiShaderFunctionHandleVector const& HgiGLShaderProgram::GetShaderFunctions ( ) const

Returns the shader functions that are part of this program.

Implements HgiShaderProgram.

HGIGL_API uint32_t HgiGLShaderProgram::GetUniformBuffer ( size_t  sizeHint)

Returns the gl resource for the uniform block of this shader program. This uniform block is used to store some per-shader values, such as indices or offsets into other buffers. See also Hgi::SetConstantValues. 'sizeHint' is used to store the byte size of the uniform buffer, but this fn does not actually allocate the data storage for the buffer.

HGIGL_API bool HgiGLShaderProgram::IsValid ( ) const

Returns false if any shader compile errors occured.

Implements HgiShaderProgram.

Friends And Related Function Documentation

friend class HgiGL

Definition at line 77 of file shaderProgram.h.

The documentation for this class was generated from the following file: