HDK
|
#include <shaderFunction.h>
Public Member Functions | |
virtual HGI_API | ~HgiShaderFunction () |
HGI_API HgiShaderFunctionDesc 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 size_t | GetByteSizeOfResource () const =0 |
virtual HGI_API uint64_t | GetRawResource () const =0 |
Protected Member Functions | |
HGI_API | HgiShaderFunction (HgiShaderFunctionDesc const &desc) |
Protected Attributes | |
HgiShaderFunctionDesc | _descriptor |
Represents one shader stage function (code snippet).
ShaderFunctions are usually passed to a ShaderProgram, however be careful not to destroy the ShaderFunction after giving it to the program. While this may be safe for OpenGL after the program is created, it does not apply to other graphics backends, such as Vulkan, where the shader functions are used during rendering.
Definition at line 47 of file shaderFunction.h.
|
virtual |
|
protected |
|
pure virtual |
Returns the byte size of the GPU shader function. This can be helpful if the application wishes to tally up memory usage.
Implemented in HgiGLShaderFunction.
|
pure virtual |
Returns shader compile errors.
Implemented in HgiGLShaderFunction.
HGI_API HgiShaderFunctionDesc const& HgiShaderFunction::GetDescriptor | ( | ) | const |
The descriptor describes the object.
|
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 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.
Implemented in HgiGLShaderFunction.
|
pure virtual |
Returns false if any shader compile errors occured.
Implemented in HgiGLShaderFunction.
|
protected |
Definition at line 88 of file shaderFunction.h.