OGRE 14.3
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::RTShader::Operand Class Reference

A class that represents a function operand (its the combination of a parameter the in/out semantic and the used fields) More...

#include <OgreShaderFunctionAtom.h>

+ Inheritance diagram for Ogre::RTShader::Operand:

Public Types

enum  OpMask : uchar {
  OPM_NONE = 0 , OPM_X = 0x0001 , OPM_Y = 0x0002 , OPM_Z = 0x0004 ,
  OPM_W = 0x0008 , OPM_XY = OPM_X | OPM_Y , OPM_XZ = OPM_X | OPM_Z , OPM_XW = OPM_X | OPM_W ,
  OPM_YZ = OPM_Y | OPM_Z , OPM_YW = OPM_Y | OPM_W , OPM_ZW = OPM_Z | OPM_W , OPM_XYZ = OPM_X | OPM_Y | OPM_Z ,
  OPM_XYW = OPM_X | OPM_Y | OPM_W , OPM_XZW = OPM_X | OPM_Z | OPM_W , OPM_YZW = OPM_Y | OPM_Z | OPM_W , OPM_XYZW = OPM_X | OPM_Y | OPM_Z | OPM_W ,
  OPM_ALL = OPM_XYZW
}
 
enum  OpSemantic { OPS_IN , OPS_OUT , OPS_INOUT }
 

Public Member Functions

 Operand (const Operand &rhs)
 Copy constructor.
 
 Operand (ParameterPtr parameter, OpSemantic opSemantic, OpMask opMask=OPM_ALL, ushort indirectionLevel=0)
 Class constructor.
 
 ~Operand ()
 Class destructor.
 
ushort getIndirectionLevel () const
 Returns the level of indirection.
 
OpMask getMask () const
 Returns the mask bitfield.
 
const ParameterPtrgetParameter () const
 Returns the parameter object as weak reference.
 
OpSemantic getSemantic () const
 Returns the operand semantic (do we read/write or both with the parameter).
 
bool hasFreeFields () const
 Returns true if not all fields used.
 
Operandmask (OpMask opMask)
 
Operandoperator= (const Operand &rhs)
 Copy the given Operand to this Operand.
 
void setMaskToParamType ()
 automatically set swizzle to match parameter arity
 
Operandw ()
 
void write (std::ostream &os) const
 write the parameter name and the usage mask like this 'color.xyz'
 
Operandx ()
 
Operandxy ()
 
Operandxyz ()
 
Operandy ()
 
Operandz ()
 

Static Public Member Functions

static int getFloatCount (int mask)
 Return the float count of the given mask.
 

Detailed Description

A class that represents a function operand (its the combination of a parameter the in/out semantic and the used fields)

Member Enumeration Documentation

◆ OpSemantic

Enumerator
OPS_IN 

The parameter is a input parameter.

OPS_OUT 

The parameter is a output parameter.

OPS_INOUT 

The parameter is a input/output parameter.

◆ OpMask

Enumerator
OPM_NONE 
OPM_X 
OPM_Y 
OPM_Z 
OPM_W 
OPM_XY 
OPM_XZ 
OPM_XW 
OPM_YZ 
OPM_YW 
OPM_ZW 
OPM_XYZ 
OPM_XYW 
OPM_XZW 
OPM_YZW 
OPM_XYZW 
OPM_ALL 

Constructor & Destructor Documentation

◆ Operand() [1/2]

Ogre::RTShader::Operand::Operand ( ParameterPtr  parameter,
OpSemantic  opSemantic,
OpMask  opMask = OPM_ALL,
ushort  indirectionLevel = 0 
)

Class constructor.

Parameters
parameterA function parameter.
opSemanticThe in/out semantic of the parameter.
opMaskThe field mask of the parameter.
indirectionLevel

◆ Operand() [2/2]

Ogre::RTShader::Operand::Operand ( const Operand rhs)

Copy constructor.

◆ ~Operand()

Ogre::RTShader::Operand::~Operand ( )

Class destructor.

Member Function Documentation

◆ operator=()

Operand & Ogre::RTShader::Operand::operator= ( const Operand rhs)

Copy the given Operand to this Operand.

Parameters
rhsThe other Operand to copy to this state.

◆ getParameter()

const ParameterPtr & Ogre::RTShader::Operand::getParameter ( ) const
inline

Returns the parameter object as weak reference.

◆ hasFreeFields()

bool Ogre::RTShader::Operand::hasFreeFields ( ) const
inline

Returns true if not all fields used.

(usage is described through semantic)

◆ getMask()

OpMask Ogre::RTShader::Operand::getMask ( ) const
inline

Returns the mask bitfield.

◆ x()

Operand & Ogre::RTShader::Operand::x ( )
inline

◆ y()

Operand & Ogre::RTShader::Operand::y ( )
inline

◆ z()

Operand & Ogre::RTShader::Operand::z ( )
inline

◆ w()

Operand & Ogre::RTShader::Operand::w ( )
inline

◆ xy()

Operand & Ogre::RTShader::Operand::xy ( )
inline

◆ xyz()

Operand & Ogre::RTShader::Operand::xyz ( )
inline

◆ mask()

Operand & Ogre::RTShader::Operand::mask ( OpMask  opMask)
inline

◆ setMaskToParamType()

void Ogre::RTShader::Operand::setMaskToParamType ( )

automatically set swizzle to match parameter arity

◆ getSemantic()

OpSemantic Ogre::RTShader::Operand::getSemantic ( ) const
inline

Returns the operand semantic (do we read/write or both with the parameter).

◆ getIndirectionLevel()

ushort Ogre::RTShader::Operand::getIndirectionLevel ( ) const
inline

Returns the level of indirection.

The greater the indirection level the more the parameter needs to be nested in brackets. For example given 4 parameters x1...x4 with the indirections levels 0,1,1,2 respectively. The parameters should form the following string: x1[x2][x3[x4]].

◆ write()

void Ogre::RTShader::Operand::write ( std::ostream &  os) const

write the parameter name and the usage mask like this 'color.xyz'

◆ getFloatCount()

static int Ogre::RTShader::Operand::getFloatCount ( int  mask)
static

Return the float count of the given mask.


The documentation for this class was generated from the following file: