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, VertexLayoutType vlt=VertexLayoutType::Unspec, 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, VertexLayoutType vlt=VertexLayoutType::Unspec) |
| 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.
|
|
| AX_DEPRECATED (2.1) void removeProgram(Program *prog) |
| Remove a program object from cache.
|
|
| AX_DEPRECATED (2.1) void removeUnusedProgram() |
| Remove all unused program objects from cache.
|
|
| AX_DEPRECATED (2.1) void removeAllPrograms() |
| Remove all program objects from cache.
|
|
Cache and reuse program object.
◆ destroyInstance()
static void destroyInstance |
( |
| ) |
|
|
static |
purges the cache.
It releases the retained instance.
◆ registerCustomProgram()
uint64_t registerCustomProgram |
( |
std::string_view | vsName, |
|
|
std::string_view | fsName, |
|
|
VertexLayoutType | vlt = VertexLayoutType::Unspec, |
|
|
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, |
|
|
VertexLayoutType | vlt = VertexLayoutType::Unspec ) |
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 |
vlt | 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. |
◆ AX_DEPRECATED()
Remove a program object from cache.
- Parameters
-
program | Specifies the program object to move. |
The documentation for this class was generated from the following file: