HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HgiShaderProgram Class Referenceabstract

#include <shaderProgram.h>

+ Inheritance diagram for HgiShaderProgram:

Public Member Functions

virtual HGI_API ~HgiShaderProgram ()
 
HGI_API HgiShaderProgramDesc
const & 
GetDescriptor () const
 The descriptor describes the object. More...
 
virtual HGI_API bool IsValid () const =0
 Returns false if any shader compile errors occured. More...
 
virtual HGI_API std::string const & GetCompileErrors ()=0
 Returns shader compile errors. More...
 
virtual HGI_API
HgiShaderFunctionHandleVector
const & 
GetShaderFunctions () const =0
 Returns the shader functions that are part of this program. More...
 
virtual HGI_API size_t GetByteSizeOfResource () const =0
 
virtual HGI_API uint64_t GetRawResource () const =0
 

Protected Member Functions

HGI_API HgiShaderProgram (HgiShaderProgramDesc const &desc)
 

Protected Attributes

HgiShaderProgramDesc _descriptor
 

Detailed Description

Represents a collection of shader functions. This object does not take ownership of the shader functions and does not destroy them automatically. The client must destroy the shader functions when the program is detroyed, because only the client knows if the shader functions are used by other shader programs.

Definition at line 80 of file shaderProgram.h.

Constructor & Destructor Documentation

virtual HGI_API HgiShaderProgram::~HgiShaderProgram ( )
virtual
HGI_API HgiShaderProgram::HgiShaderProgram ( HgiShaderProgramDesc const &  desc)
protected

Member Function Documentation

virtual HGI_API size_t HgiShaderProgram::GetByteSizeOfResource ( ) const
pure virtual

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.

Implemented in HgiGLShaderProgram.

virtual HGI_API std::string const& HgiShaderProgram::GetCompileErrors ( )
pure virtual

Returns shader compile errors.

Implemented in HgiGLShaderProgram.

HGI_API HgiShaderProgramDesc const& HgiShaderProgram::GetDescriptor ( ) const

The descriptor describes the object.

virtual HGI_API uint64_t HgiShaderProgram::GetRawResource ( ) const
pure virtual

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.

Implemented in HgiGLShaderProgram.

virtual HGI_API HgiShaderFunctionHandleVector const& HgiShaderProgram::GetShaderFunctions ( ) const
pure virtual

Returns the shader functions that are part of this program.

Implemented in HgiGLShaderProgram.

virtual HGI_API bool HgiShaderProgram::IsValid ( ) const
pure virtual

Returns false if any shader compile errors occured.

Implemented in HgiGLShaderProgram.

Member Data Documentation

HgiShaderProgramDesc HgiShaderProgram::_descriptor
protected

Definition at line 125 of file shaderProgram.h.


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