Loading...
Searching...
No Matches
HgiGLShaderFunction Class Referencefinal

OpenGL implementation of HgiShaderFunction. More...

#include <shaderFunction.h>

+ Inheritance diagram for HgiGLShaderFunction:

Public Member Functions

HGIGL_API bool IsValid () const override
 Returns false if any shader compile errors occured.
 
HGIGL_API std::string const & GetCompileErrors () override
 Returns shader compile errors.
 
HGIGL_API size_t GetByteSizeOfResource () const override
 Returns the byte size of the GPU shader function.
 
HGIGL_API uint64_t GetRawResource () const override
 This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t.
 
HGIGL_API uint32_t GetShaderId () const
 Returns the gl resource id of the shader.
 
- Public Member Functions inherited from HgiShaderFunction
HGI_API HgiShaderFunctionDesc const & GetDescriptor () const
 The descriptor describes the object.
 
virtual HGI_API bool IsValid () const =0
 Returns false if any shader compile errors occured.
 
virtual HGI_API std::string const & GetCompileErrors ()=0
 Returns shader compile errors.
 
virtual HGI_API size_t GetByteSizeOfResource () const =0
 Returns the byte size of the GPU shader function.
 
virtual HGI_API uint64_t GetRawResource () const =0
 This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t.
 

Protected Member Functions

HGIGL_API HgiGLShaderFunction (Hgi const *hgi, HgiShaderFunctionDesc const &desc)
 
- Protected Member Functions inherited from HgiShaderFunction
HGI_API HgiShaderFunction (HgiShaderFunctionDesc const &desc)
 

Friends

class HgiGL
 

Additional Inherited Members

- Protected Attributes inherited from HgiShaderFunction
HgiShaderFunctionDesc _descriptor
 

Detailed Description

OpenGL implementation of HgiShaderFunction.

Definition at line 39 of file shaderFunction.h.

Member Function Documentation

◆ GetByteSizeOfResource()

HGIGL_API size_t GetByteSizeOfResource ( ) const
overridevirtual

Returns the byte size of the GPU shader function.

This can be helpful if the application wishes to tally up memory usage.

Implements HgiShaderFunction.

◆ GetCompileErrors()

HGIGL_API std::string const & GetCompileErrors ( )
overridevirtual

Returns shader compile errors.

Implements HgiShaderFunction.

◆ GetRawResource()

HGIGL_API uint64_t GetRawResource ( ) const
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 this returns the id<MTLFunction> as uint64_t. In Vulkan this returns the VkShaderModule as uint64_t. In DX12 this returns the ID3D12Resource pointer as uint64_t.

Implements HgiShaderFunction.

◆ GetShaderId()

HGIGL_API uint32_t GetShaderId ( ) const

Returns the gl resource id of the shader.

◆ IsValid()

HGIGL_API bool IsValid ( ) const
overridevirtual

Returns false if any shader compile errors occured.

Implements HgiShaderFunction.

Friends And Related Function Documentation

◆ HgiGL

friend class HgiGL
friend

Definition at line 62 of file shaderFunction.h.


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