Shader program asset. Contains a vector of CYIAssetShaderObject types.
#include <asset/YiAssetShaderProgram.h>

Protected Member Functions | |
| virtual std::shared_ptr< IYIGPUObject > | CreateGPUObject () const override |
| void | UpdateApproximateSize () |
Protected Member Functions inherited from CYIAssetHardware | |
| virtual void | ApplyRetainmentPolicy () |
| virtual void | OnLoad () 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 | OnUnload () |
Protected Member Functions inherited from CYIScriptableRTTIObject | |
| virtual std::pair< const CYIRuntimeTypeInfo *, const void * > | GetRuntimeTypeInfoWithObject () const =0 |
Additional Inherited Members | |
Public Types inherited from CYIAssetHardware | |
| enum | RETENTION_POLICY { RETAIN = 0, UNLOAD } |
| The YI_HW_ASSET_RETENTION_POLICY enum specifies the retention policy of static hardware assets from the CPU memory once they are loaded onto the GPU. It is globally configurable, where new CYIAssetHardware will be making use of it and the can also change directly per assets. Be aware that on some platform, it is best to leave the assets retained on the CPU side when the platform lifecycle has the ability to destroy the graphic context while the app still runs, giving You.i Engine the ability to re-load every assets back onto GPU memory really fast. A good example of such platform would be Android. More... | |
Public Types inherited from CYIAsset | |
| enum | PATH_TYPE { PATH_ABSOLUTE = 0, PATH_RELATIVE } |
Protected Attributes inherited from CYIAssetHardware | |
| bool | m_bHardwareLoadRequested |
| std::shared_ptr< IYIGPUObject > | m_pGPUObject |
| RETENTION_POLICY | m_eRetentionPolicy |
Static Protected Attributes inherited from CYIAsset | |
| static ssize_t | INVALID_ID |
| CYIAssetShaderProgram::CYIAssetShaderProgram | ( | ) |
| CYIAssetShaderProgram::CYIAssetShaderProgram | ( | const CYIString & | path, |
| PATH_TYPE | ePathType = PATH_RELATIVE |
||
| ) |
|
virtual |
| void CYIAssetShaderProgram::AddShaderObject | ( | const std::shared_ptr< CYIAssetShaderObject > & | pShaderObjectAsset | ) |
Adds a pShaderObjectAsset to the list of managed shader objects.
|
overrideprotectedvirtual |
Subclasses must implement this function to instance a new IYIGPUObject concrete type corresponding to the asset container. This function will be called by the CreateGPUObject implementation of CYIAssetHardware
Implements CYIAssetHardware.
| const std::vector<std::pair<uint32_t, CYIString> >& CYIAssetShaderProgram::GetAttributeLocations | ( | ) |
Get attribute locations as a vector of pairs. The shader will be reloaded, if necessary.
| const std::vector<std::shared_ptr<CYIAssetShaderObject> >& CYIAssetShaderProgram::GetShaderObjects | ( | ) |
Returns a vector of shader objects. The shaders will be reloaded, if necessary.
| bool CYIAssetShaderProgram::Load | ( | ) |
| void CYIAssetShaderProgram::RemoveShaderObject | ( | const std::shared_ptr< CYIAssetShaderObject > & | pShaderObjectAsset | ) |
Removes a pShaderObjectAsset from the list of managed shader objects.
| void CYIAssetShaderProgram::SetAttributeLocation | ( | CYIString | name, |
| uint32_t | location | ||
| ) |
Declare a vertex attribute to be at a particular location. See CYIMesh for more information about You.i Engine default attribute locations.
This should ALWAYS be used to declare your attribute locations, for performance we do not provide a means for reading automatically generated attribute locations back from shaders.
| void CYIAssetShaderProgram::UnsetAttributeLocation | ( | CYIString | name | ) |
Unset an attribute location setting
|
protected |