Shader object asset. Can either be loaded from a precompiled binary, or loaded as source and compiled at run-time.
#include <asset/YiAssetShaderObject.h>

Public Types | |
| enum | SHADER_TYPE { VERTEX_SHADER, FRAGMENT_SHADER, COMPUTE_SHADER } |
| enum | CODE_TYPE { PRECOMPILED_BINARY, UNCOMPILED_SOURCE } |
Public Types inherited from CYIAsset | |
| enum | PATH_TYPE { PATH_ABSOLUTE = 0, PATH_RELATIVE } |
Public Member Functions | |
| CYIAssetShaderObject () | |
| CYIAssetShaderObject (const CYIString &path, PATH_TYPE ePathType=PATH_RELATIVE) | |
| virtual | ~CYIAssetShaderObject () |
| void | GetCode (uint8_t **ppCode, uint32_t *pCodeSize) const |
| CODE_TYPE | GetCodeType () const |
| SHADER_TYPE | GetType () const |
| bool | IsFromDisk () const |
| void | SetFromDisk (bool bFromDisk) |
| void | SetCode (const uint8_t *pCode, uint32_t uCodeSize, CODE_TYPE eType) |
| void | SetType (SHADER_TYPE eType) |
Public Member Functions inherited from CYIAsset | |
| virtual | ~CYIAsset () |
| const CYIString & | GetPath () const |
| CYIAssetLoadParams * | GetLoadParameters () const |
| virtual std::pair< uint32_t, uint32_t > | GetApproximateSize () const |
| bool | SetName (const CYIString &name) |
| const CYIString & | GetName () const |
| bool | Load () |
| void | Unload () |
| bool | IsLoaded () const |
| bool | Equals (const std::shared_ptr< CYIAsset > &pAsset) |
| virtual bool | Prepare () |
Public Member Functions inherited from CYIScriptableRTTIObject | |
| CYIScriptableRTTIObject () | |
| virtual | ~CYIScriptableRTTIObject () |
| virtual const CYIRuntimeTypeInfo * | GetRuntimeTypeInfoForScriptObject () const override |
Public Member Functions inherited from CYIScriptableObject | |
| CYIScriptableObject () | |
| CYIScriptableObject (const CYIScriptableObject &other) | |
| CYIScriptableObject & | operator= (const CYIScriptableObject &other) |
| virtual | ~CYIScriptableObject () |
| CYIBindingImplementation * | GetBindingImplementation () const |
| void | SetBindingImplementation (CYIBindingImplementation *pBindingImplementation) |
Protected Member Functions | |
| virtual void | OnUnload () override |
Protected Member Functions inherited from CYIAsset | |
| CYIAsset () | |
| ssize_t | GetID () const |
| void | SetPath (const CYIString &path, PATH_TYPE ePathType) |
| void | SetApproximateSize (uint32_t nSize) |
| void | SetLoaded (bool bAssetLoaded) |
| void | SetLoadParameters (std::unique_ptr< CYIAssetLoadParams > pParams) |
| virtual void | OnLoad () |
Protected Member Functions inherited from CYIScriptableRTTIObject | |
| virtual std::pair< const CYIRuntimeTypeInfo *, const void * > | GetRuntimeTypeInfoWithObject () const =0 |
Additional Inherited Members | |
Static Protected Attributes inherited from CYIAsset | |
| static ssize_t | INVALID_ID |
Describes the supported shader types. Together these form a shader program that describes how to render geometry.
| CYIAssetShaderObject::CYIAssetShaderObject | ( | ) |
| CYIAssetShaderObject::CYIAssetShaderObject | ( | const CYIString & | path, |
| PATH_TYPE | ePathType = PATH_RELATIVE |
||
| ) |
|
virtual |
| void CYIAssetShaderObject::GetCode | ( | uint8_t ** | ppCode, |
| uint32_t * | pCodeSize | ||
| ) | const |
Returns a pointer to the data defining this asset. The data will be of size pCodeSize in bytes.
If the data type of the shader, specified by GetDataType(), is CYIAssetShaderObject::PRECOMPILED_BINARY, the data will be a binary blob representing a compiled shader object. If the data type is CYIAssetShaderObject::UNCOMPILED_SOURCE, the data will be a string containing the shader source code. This source code will be compiled at run-time prior to usage, but will not be accessible as binary data.
| CODE_TYPE CYIAssetShaderObject::GetCodeType | ( | ) | const |
Returns the format of the data contained in this asset.
| SHADER_TYPE CYIAssetShaderObject::GetType | ( | ) | const |
Returns the type of shader object.
| bool CYIAssetShaderObject::IsFromDisk | ( | ) | const |
Returns true if this asset is loaded from disk and false if it is defined in-memory.
|
overrideprotectedvirtual |
Reimplemented from CYIAsset.
| void CYIAssetShaderObject::SetCode | ( | const uint8_t * | pCode, |
| uint32_t | uCodeSize, | ||
| CODE_TYPE | eType | ||
| ) |
Sets the data defining this asset to be pCode with size uCodeSize in bytes. If the code is a null-terminated string, it is up to the user to specify the size (not including the terminating character).
| void CYIAssetShaderObject::SetFromDisk | ( | bool | bFromDisk | ) |
| void CYIAssetShaderObject::SetType | ( | SHADER_TYPE | eType | ) |
Sets the type of shader object.