OpenGL implementation of HgiShaderProgram. More...
Public Member Functions | |
HGIGL_API bool | IsValid () const override |
Returns false if any shader compile errors occured. More... | |
HGIGL_API std::string const & | GetCompileErrors () override |
Returns shader compile errors. More... | |
HGIGL_API HgiShaderFunctionHandleVector const & | GetShaderFunctions () const override |
Returns the shader functions that are part of this program. More... | |
HGIGL_API size_t | GetByteSizeOfResource () const override |
Returns the byte size of the GPU shader program. More... | |
HGIGL_API uint64_t | GetRawResource () const override |
This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t. More... | |
HGIGL_API uint32_t | GetProgramId () const |
Returns the gl resource id of the program. More... | |
HGIGL_API uint32_t | GetUniformBuffer (size_t sizeHint) |
Returns the gl resource for the uniform block of this shader program. More... | |
Public Member Functions inherited from HgiShaderProgram | |
HGI_API HgiShaderProgramDesc const & | 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) |
Friends | |
class | HgiGL |
Additional Inherited Members | |
Protected Attributes inherited from HgiShaderProgram | |
HgiShaderProgramDesc | _descriptor |
OpenGL implementation of HgiShaderProgram.
Definition at line 42 of file shaderProgram.h.
|
overridevirtual |
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.
|
overridevirtual |
Returns shader compile errors.
Implements HgiShaderProgram.
HGIGL_API uint32_t GetProgramId | ( | ) | const |
Returns the gl resource id of the program.
|
overridevirtual |
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.
|
overridevirtual |
Returns the shader functions that are part of this program.
Implements HgiShaderProgram.
HGIGL_API uint32_t 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.
|
overridevirtual |
Returns false if any shader compile errors occured.
Implements HgiShaderProgram.