Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

SH Namespace Reference

The main Sh namespace. More...


Compounds

struct  DebugDumper
class  ShAttrib
 A generic attribute (or parameter) holding N values. More...

class  ShBackend
class  ShBackendCode
class  ShBasicBlock
 A basic block. More...

class  ShBlock
 A generic block or token. More...

class  ShBlockList
class  ShCheckDims
 Utility template to check whether dimensions are equal or scalar. More...

class  ShCheckDims< 1, false, 1, false >
class  ShCheckDims< 1, false, 1, true >
class  ShCheckDims< 1, true, 1, false >
class  ShCheckDims< 1, true, 1, true >
class  ShCheckDims< 1, true, N, ScalarRHS >
class  ShCheckDims< N, false, N, false >
class  ShCheckDims< N, false, N, true >
class  ShCheckDims< N, ScalarLHS, 1, true >
class  ShCheckDims< N, true, N, false >
class  ShCheckDims< N, true, N, true >
class  ShConstant
 A shader-compile-time constant. More...

class  ShCtrlGraph
 A control-flow graph. More...

struct  ShCtrlGraphBranch
class  ShCtrlGraphNode
class  ShCubeTextureNode
class  ShDataTextureNode
class  ShDomTree
 A dominator tree in a flowgraph. More...

struct  ShEnvironment
 Global settings for the current program. More...

class  ShException
 A generic exception. More...

class  ShImage
class  ShImageException
 An exception relating to an ShImage operation. More...

class  ShIntEqual
 Enforce that A == B (will not instantiate otherwise). More...

class  ShIntEqual< A, A >
struct  ShLifeTime
class  ShLinearAllocator
 A simple, basic-block based linear register allocator. More...

class  ShMatrix
 A matrix of Rows by Cols elements. More...

class  ShMatrixRows
 A few rows from a matrix. More...

struct  ShOperationInfo
 Information related to a specific operation. More...

class  ShOptimizer
class  ShParseException
 An exception representing a parse error. More...

class  ShParser
class  ShProgramNode
 A particular Sh program. More...

class  ShRefCount
 A reference-counting smart pointer. More...

class  ShRefCountable
 A class which can be reference-counted. More...

class  ShStatement
 A single statement. More...

class  ShSwizzle
 Represents swizzling of a variable. More...

class  ShSwizzleException
 Thrown when an invalid swizzle is specified (e.g. More...

class  ShTexture
class  ShTexture1D
class  ShTexture2D
class  ShTextureCube
class  ShTextureNode
class  ShToken
 A token in the (unparsed) parse tree. More...

struct  ShTokenArgument
 A token argument, e.g. to SH_IF or SH_FOR. More...

class  ShTokenizer
 A tokenizer. More...

class  ShTokenizerException
 An exception indicating a tokenizer error. More...

class  ShVariable
 A reference and interface to a generic n-tuple variable. More...

class  ShVariableN
 A variable of length N. More...

class  ShVariableNode
 A generic n-tuple variable. More...


Enumerations

enum  ShOperation {
  SH_OP_ASN, SH_OP_NEG, SH_OP_ADD, SH_OP_MUL,
  SH_OP_DIV, SH_OP_SLT, SH_OP_SLE, SH_OP_SGT,
  SH_OP_SGE, SH_OP_SEQ, SH_OP_SNE, SH_OP_ABS,
  SH_OP_ACOS, SH_OP_ASIN, SH_OP_ATAN, SH_OP_ATAN2,
  SH_OP_CEIL, SH_OP_COS, SH_OP_DOT, SH_OP_FRAC,
  SH_OP_MAX, SH_OP_MIN, SH_OP_POW, SH_OP_SIN,
  SH_OP_SQRT, SH_OP_NORM, SH_OP_TEX, SH_OP_COND,
  SH_OP_KIL
}
 Kinds of operations. More...

enum  ShTokenType
 Possible types a token can have. More...


Functions

 SH_SPECIAL_TYPE (ShColor, color)
 An N-color.

template<int N, typename T> ShVariableN< N, T > operator+ (const ShVariableN< N, T > &left, const ShVariableN< N, T > &right)
 Addition.

template<int N, typename T> ShVariableN< N, T > operator- (const ShVariableN< N, T > &left, const ShVariableN< N, T > &right)
 Subtraction.

template<int N, int M, typename T> ShVariableN< N, T > operator * (const ShVariableN< N, T > &left, const ShVariableN< M, T > &right)
 Componentwise/scalar multiplication.

template<int N, int M, typename T> ShVariableN< N, T > operator/ (const ShVariableN< N, T > &left, const ShVariableN< M, T > &right)
 Componentwise/scalar division.

template<int N, typename T> ShVariableN< N, T > operator^ (const ShVariableN< N, T > &left, const ShVariableN< N, T > &right)
 Conventional power operation.

template<int N, typename T> ShVariableN< N, T > cond (const ShVariableN< N, T > &condition, const ShVariableN< N, T > &left, const ShVariableN< N, T > &right)
 Conditional assignment (COND/CMP) dest[i] = (src1[i] > 0.0 ? src2[i] : src3[i]) Note: CMP in the ARB_{vertex,fragment}_program spec has src1[i] < 0.0, not greater than.

template<int N, typename T> ShVariableN< N, T > abs (const ShVariableN< N, T > &var)
 Absolute value.

template<int N, typename T> ShVariableN< N, T > acos (const ShVariableN< N, T > &var)
 Arccosine of x. x in [-1, 1], result in [-pi/2, pi/2].

template<int N, typename T> ShVariableN< N, T > asin (const ShVariableN< N, T > &var)
 Arcsine of x. x in [-1, 1]. Result in [0, pi].

template<int N, typename T> ShVariableN< N, T > cos (const ShVariableN< N, T > &var)
 Cosine of x.

template<int N, typename T> ShVariableN< N, T > frac (const ShVariableN< N, T > &var)
 Fractional part.

template<int N, typename T> ShVariableN< N, T > max (const ShVariableN< N, T > &left, const ShVariableN< N, T > &right)
 Componentwise maximum.

template<int N, typename T> ShVariableN< N, T > min (const ShVariableN< N, T > &left, const ShVariableN< N, T > &right)
 Componentwise minimum.

template<int N, typename T> ShVariableN< N, T > sin (const ShVariableN< N, T > &var)
 Sine of x.

template<int Rows, int Cols, int Kind, typename T> ShMatrix< Cols, Rows, SH_VAR_TEMP,
T > 
transpose (const ShMatrix< Rows, Cols, Kind, T > &m)
 Transpose of a matrix.

template<int M, int N, int P, int Kind, int Kind2, typename T> ShMatrix< M, P, SH_VAR_TEMP,
T > 
operator| (const ShMatrix< M, N, Kind, T > &a, const ShMatrix< N, P, Kind2, T > &b)
 Matrix multiplication.

template<int M, int N, int Kind, typename T> ShVariableN< M, T > operator| (const ShMatrix< M, N, Kind, T > &a, const ShVariableN< N, T > &b)
 Treat a variable as a column vector and multiply it with a matrix.

 SH_SPECIAL_TYPE (ShNormal, surface normal)
 A surface normal with N dimensions.

 SH_SPECIAL_TYPE (ShPoint, point)
 An N-Point.

 SH_SPECIAL_TYPE_PARENT (ShPosition, position, ShPoint)
 A vertex position.

 SH_SPECIAL_TYPE (ShTexCoord, texture coordinate)
 A texture coordinate with N dimensions.

std::ostream & shPrintIndent (std::ostream &out, int indent)
 Print "indent" spaces to out.

 SH_SPECIAL_TYPE (ShVector, vector)
 An N-Vector.


Variables

const int shShaderKinds
 How many kinds of shaders there are in the pipeline at most.

const ShOperationInfo opInfo []
 Update this if you add or change operations in ShOperation.

char * tokenNames []
 Names of token types.


Detailed Description

The main Sh namespace.

All Sh classes, functions and objects reside within this namespace.


Enumeration Type Documentation

enum SH::ShOperation
 

Kinds of operations.

If you change this, be sure to change the opInfo array in ShStatement.cpp

See also:
opInfo
Enumeration values:
SH_OP_ASN  Assignment.
SH_OP_NEG  Unary negation.
SH_OP_ADD  Binary addition.
SH_OP_MUL  Binary multiplication.
SH_OP_DIV  Binary division.
SH_OP_SLT  Set less than.
SH_OP_SLE  Set less than or equal.
SH_OP_SGT  Set greater than.
SH_OP_SGE  Set greater than or equal.
SH_OP_SEQ  Set equal.
SH_OP_SNE  Set not equal.
SH_OP_ABS  Unary absolute value.
SH_OP_ACOS  Unary arccosine (result between -pi/2 and pi/2).
SH_OP_ASIN  Unary arcsine (result between 0 and pi).
SH_OP_ATAN  Unary arctan (result between -pi/2 and pi/2).
SH_OP_ATAN2  Binary arctan of src2/src1 (result between -pi and pi).
SH_OP_CEIL  Unary smallest integer not less than src1.
SH_OP_COS  Unary cosine function.
SH_OP_DOT  Binary dot product.
SH_OP_FRAC  Unary fractional part.
SH_OP_MAX  Binary componentwise maximum.
SH_OP_MIN  Binary componentwise minimum.
SH_OP_POW  Binary power.
SH_OP_SIN  Unary sine function.
SH_OP_SQRT  Unary square root.
SH_OP_NORM  Normalize vector.
SH_OP_TEX  Texture lookup.
SH_OP_COND  Conditional assignment: dst[i] = (src1[i] > 0.0 ? src2[i] : src3[i]).
SH_OP_KIL  Conditionally kill fragment (if for any i, dst[i] > 0).

Definition at line 40 of file ShStatement.hpp.

enum SH::ShTokenType
 

Possible types a token can have.

If you add to this list or change it, be sure to change tokenNames in ShToken.cpp.

Definition at line 42 of file ShToken.hpp.

Referenced by SH::ShToken::type().


Variable Documentation

const ShOperationInfo SH::opInfo
 

Update this if you add or change operations in ShOperation.

See also:
ShOperation

Definition at line 35 of file ShStatement.cpp.

char* SH::tokenNames[]
 

Names of token types.

Change this if you change the ShTokenType enumeration.

See also:
ShTokenType

Definition at line 38 of file ShToken.cpp.

Referenced by SH::ShToken::print().


Generated on Thu Aug 7 15:29:42 2003 for Sh by doxygen1.2.18