A metal Program.
More...
#include <ProgramMTL.h>
Inherits Program.
|
| ProgramMTL (std::string_view vertexShader, std::string_view fragmentShader) |
|
virtual UniformLocation | getUniformLocation (std::string_view uniform) const override |
| Get uniform location by name.
|
|
virtual UniformLocation | getUniformLocation (backend::Uniform name) const override |
| Get uniform location by engine built-in uniform enum name.
|
|
virtual int | getAttributeLocation (std::string_view name) const override |
| Get attribute location by attribute name.
|
|
virtual int | getAttributeLocation (Attribute name) const override |
| Get attribute location by engine built-in attribute enum name.
|
|
virtual ShaderModuleMTL * | getVertexShader () const |
| Get vertex shader module.
|
|
virtual ShaderModuleMTL * | getFragmentShader () const |
| Get fragment shader module.
|
|
const hlookup::string_map< AttributeBindInfo > & | getActiveAttributes () const override |
| Get active vertex attributes.
|
|
virtual int | getMaxVertexLocation () const override |
| Get maximum vertex location.
|
|
virtual int | getMaxFragmentLocation () const override |
| Get maximum fragment location.
|
|
virtual std::size_t | getUniformBufferSize (ShaderStage stage) const override |
| Get uniform buffer size in bytes that can hold all the uniforms.
|
|
virtual const hlookup::string_map< UniformInfo > & | getAllActiveUniformInfo (ShaderStage stage) const override |
| Get all uniformInfos.
|
|
|
std::string_view | getVertexShader () const |
| Get vertex shader.
|
|
std::string_view | getFragmentShader () const |
| Get fragment shader.
|
|
void | setupVertexLayout (VertexLayoutType vlt) |
| Sets the program shared vertex layout type, see: VertexLayoutType.
|
|
uint32_t | getProgramType () const |
| Get engine built-in program type.
|
|
uint64_t | getProgramId () const |
| Get program id.
|
|
void | retain () |
| Retains the ownership.
|
|
void | release () |
| Releases the ownership immediately.
|
|
Object * | autorelease () |
| Releases the ownership sometime soon automatically.
|
|
unsigned int | getReferenceCount () const |
| Returns the Object's current reference count.
|
|
virtual | ~Object () |
| Destructor.
|
|
static Program * | getBuiltinProgram (uint32_t type) |
| Get engine built-in program.
|
|
unsigned int | _ID |
| object id, ScriptSupport need public _ID
|
|
int | _luaID |
| Lua reference id.
|
|
◆ ProgramMTL()
ProgramMTL |
( |
std::string_view | vertexShader, |
|
|
std::string_view | fragmentShader ) |
- Parameters
-
vertexShader | Specifes the vertex shader source. |
fragmentShader | Specifes the fragment shader source. |
◆ getUniformLocation() [1/2]
virtual UniformLocation getUniformLocation |
( |
std::string_view | uniform | ) |
const |
|
overridevirtual |
Get uniform location by name.
- Parameters
-
uniform | Specifies the uniform name. |
- Returns
- The uniform location.
Implements Program.
◆ getUniformLocation() [2/2]
virtual UniformLocation getUniformLocation |
( |
backend::Uniform | name | ) |
const |
|
overridevirtual |
Get uniform location by engine built-in uniform enum name.
- Parameters
-
name | Specifies the engine built-in uniform enum name. |
- Returns
- The uniform location.
Implements Program.
◆ getAttributeLocation() [1/2]
virtual int getAttributeLocation |
( |
std::string_view | name | ) |
const |
|
overridevirtual |
Get attribute location by attribute name.
- Parameters
-
name | Specifies the attribute name. |
- Returns
- The attribute location.
Implements Program.
◆ getAttributeLocation() [2/2]
virtual int getAttributeLocation |
( |
Attribute | name | ) |
const |
|
overridevirtual |
Get attribute location by engine built-in attribute enum name.
- Parameters
-
name | Specifies the engine built-in attribute enum name. |
- Returns
- The attribute location.
Implements Program.
◆ getVertexShader()
Get vertex shader module.
- Returns
- Vertex shader module.
◆ getFragmentShader()
Get fragment shader module.
@ Fragment shader module.
◆ getActiveAttributes()
const hlookup::string_map< AttributeBindInfo > & getActiveAttributes |
( |
| ) |
const |
|
overridevirtual |
Get active vertex attributes.
- Returns
- Active vertex attributes. key is active attribute name, Value is corresponding attribute info.
Implements Program.
◆ getMaxVertexLocation()
virtual int getMaxVertexLocation |
( |
| ) |
const |
|
overridevirtual |
Get maximum vertex location.
- Returns
- Maximum vertex locaiton.
Implements Program.
◆ getMaxFragmentLocation()
virtual int getMaxFragmentLocation |
( |
| ) |
const |
|
overridevirtual |
Get maximum fragment location.
- Returns
- Maximum fragment location.
Implements Program.
◆ getUniformBufferSize()
virtual std::size_t getUniformBufferSize |
( |
ShaderStage | stage | ) |
const |
|
overridevirtual |
Get uniform buffer size in bytes that can hold all the uniforms.
- Parameters
-
stage | Specifies the shader stage. The symbolic constant can be either VERTEX or FRAGMENT. |
- Returns
- The uniform buffer size in bytes.
Implements Program.
◆ getAllActiveUniformInfo()
virtual const hlookup::string_map< UniformInfo > & getAllActiveUniformInfo |
( |
ShaderStage | stage | ) |
const |
|
overridevirtual |
Get all uniformInfos.
- Returns
- The uniformInfos.
Implements Program.
The documentation for this class was generated from the following file: