Cache and reuse program object.
More...
#include <ProgramManager.h>
|
|
Program * | getBuiltinProgram (uint32_t type) |
| | get built-in program
|
| uint64_t | registerCustomProgram (std::string_view vsName, std::string_view fsName, VertexLayoutKind vlk=VertexLayoutKind::Invalid, bool force=false) |
| | register a custom program
|
| Program * | loadProgram (uint64_t progId) |
| | load a builtin/or custom program:
|
| Program * | loadProgram (std::string_view vsName, std::string_view fsName, VertexLayoutKind vlk=VertexLayoutKind::Invalid) |
| | Load a program with vsName, fsName as CUSTOM immediately without register.
|
| void | unloadProgram (Program *program) |
| | Unload a program object from cache.
|
|
void | unloadUnusedPrograms () |
| | Unload all unused program objects from cache.
|
|
void | unloadAllPrograms () |
| | Unload all program objects from cache.
|
Cache and reuse program object.
◆ destroyInstance()
purges the cache.
It releases the retained instance.
◆ registerCustomProgram()
| uint64_t registerCustomProgram |
( |
std::string_view | vsName, |
|
|
std::string_view | fsName, |
|
|
VertexLayoutKind | vlk = VertexLayoutKind::Invalid, |
|
|
bool | force = false ) |
register a custom program
- Returns
- the id of custom program, 0: fail, the id can use by loadProgram
◆ loadProgram() [1/2]
| Program * loadProgram |
( |
uint64_t | progId | ) |
|
load a builtin/or custom program:
- Parameters
-
| id | the id of program to load, the id value returned by registerCustomProgram or builtin programType, whe the id < ProgramType:BUILTIN_COUNT, this function is identical to 'getBuiltinProgram' |
◆ loadProgram() [2/2]
| Program * loadProgram |
( |
std::string_view | vsName, |
|
|
std::string_view | fsName, |
|
|
VertexLayoutKind | vlk = VertexLayoutKind::Invalid ) |
Load a program with vsName, fsName as CUSTOM immediately without register.
- Parameters
-
| vsName | the vertex shader name: custom/xxx_vs |
| fsName | the fragment shader name: custom/xxx_vs |
| vlk | the builtin vertex layout type used for loading program |
- Returns
- Program* (nullable)
◆ unloadProgram()
| void unloadProgram |
( |
Program * | program | ) |
|
Unload a program object from cache.
- Parameters
-
| program | Specifies the program object to move. |
The documentation for this class was generated from the following file: