⚠️ This documentation corresponds to the latest development branch of axmol. It might diverge from the official releases.

Axmol Engine 3.0.0-dff292a
Loading...
Searching...
No Matches
ShaderModuleImpl Class Reference

To Create a vertex or fragment shader. More...

#include <ShaderModuleMTL.h>

Inherits ShaderModule.

Public Member Functions

 ShaderModuleImpl (id< MTLDevice > mtlDevice, ShaderStage stage, std::string_view source)
id< MTLFunction > getMTLFunction () const
 Get MTLFunction object.
const UniformInfo & getUniformInfo (Uniform name) const
 Get uniform info by engine built-in uniform enum name.
const UniformInfo & getUniformInfo (std::string_view name) const
 Get uniform info by name.
const VertexInputDesc * getVertexInputDesc (VertexInputKind name) const
 Get attribute location by engine built-in attribute enum name.
const VertexInputDesc * getVertexInputDesc (std::string_view name) const
 Get attribute location by attribute name.
const tlx::string_map< VertexInputDesc > & getActiveVertexInputs () const
 Get active attribute informations.
const tlx::string_map< UniformInfo > & getActiveUniformInfos () const
 Get all uniformInfos.
const int getMaxLocation () const
 Get maximum uniform location.
std::size_t getUniformBufferSize () const
 Get uniform buffer size in bytes that holds all the uniforms.
Public Member Functions inherited from ShaderModule
ShaderStage getShaderStage () const
 Get shader stage.
Public Member Functions inherited from Object
void retain ()
 Retains the ownership.
void release ()
 Releases the ownership immediately.
Objectautorelease ()
 Releases the ownership sometime soon automatically.
unsigned int getReferenceCount () const
 Returns the Object's current reference count.
virtual ~Object ()
 Destructor.

Additional Inherited Members

Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID
int _luaID
 Lua reference id.

Detailed Description

To Create a vertex or fragment shader.

Constructor & Destructor Documentation

◆ ShaderModuleImpl()

ShaderModuleImpl ( id< MTLDevice > mtlDevice,
ShaderStage stage,
std::string_view source )
Parameters
mtlDeviceThe device for which MTLFunction object was created.
stageSpecify what kinds of shader to be created.
sourceSpecify the shader source.

Member Function Documentation

◆ getMTLFunction()

id< MTLFunction > getMTLFunction ( ) const
inline

Get MTLFunction object.

Returns
A MTLFunction object.

◆ getUniformInfo() [1/2]

const UniformInfo & getUniformInfo ( Uniform name) const

Get uniform info by engine built-in uniform enum name.

Parameters
nameSpecifies the engine built-in uniform enum name.
Returns
The uniform location.

◆ getUniformInfo() [2/2]

const UniformInfo & getUniformInfo ( std::string_view name) const

Get uniform info by name.

Parameters
uniformSpecifies the uniform name.
Returns
The uniform location.

◆ getVertexInputDesc() [1/2]

const VertexInputDesc * getVertexInputDesc ( VertexInputKind name) const

Get attribute location by engine built-in attribute enum name.

Parameters
nameSpecifies the engine built-in attribute enum name.
Returns
The attribute location.

◆ getVertexInputDesc() [2/2]

const VertexInputDesc * getVertexInputDesc ( std::string_view name) const

Get attribute location by attribute name.

Parameters
nameSpecifies the attribute name.
Returns
The attribute location.

◆ getActiveVertexInputs()

const tlx::string_map< VertexInputDesc > & getActiveVertexInputs ( ) const
inline

Get active attribute informations.

Returns
Active attribute informations. key is attribute name and Value is corresponding attribute info.

◆ getActiveUniformInfos()

const tlx::string_map< UniformInfo > & getActiveUniformInfos ( ) const
inline

Get all uniformInfos.

Returns
The uniformInfos.

◆ getMaxLocation()

const int getMaxLocation ( ) const
inline

Get maximum uniform location.

Returns
Maximum uniform location.

◆ getUniformBufferSize()

std::size_t getUniformBufferSize ( ) const
inline

Get uniform buffer size in bytes that holds all the uniforms.

Returns
The uniform buffer size.

The documentation for this class was generated from the following file:
  • ShaderModuleMTL.h