Crystal Space: csShaderProgram Class Reference (Crystal Space Public API Reference)

| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# csShaderProgram Class Reference
[Common Plugin Classes]

Base class for iShaderProgram plugins. More...

`#include <csplugincommon/shader/shaderprogram.h>`

Inheritance diagram for csShaderProgram:

[legend]
List of all members.

## Public Member Functions
virtual csVertexAttrib | ResolveBufferDestination (const char *)
virtual int | ResolveTU (const char *)
| When the destination of a texture binding wasn't recognized, the FP is asked whether it can provide a TU number for it.
## Protected Types
enum | ProgramParamType
| Expected/accepted types for a program parameter. More...
## Protected Member Functions
void | DumpProgramInfo (csString &output)
| Dump all program info to output.
void | DumpVariableMappings (csString &output)
| Dump variable mapping.
csPtr< iDataBuffer > | GetProgramData ()
| Get the raw program data.
iDocumentNode * | GetProgramNode ()
| Get the program node.
bool | ParseCommon (iDocumentNode *child)
| Parse common properties and variablemapping.
bool | ParseProgramParam (iDocumentNode *node, ProgramParam &param, uint types=~0)
| Parse program parameter node.
float | GetParamFloatVal (const iShaderVarStack *stacks, const ProgramParam &param, float defVal)
csReversibleTransform | GetParamTransformVal (const iShaderVarStack *stacks, const ProgramParam &param, const csReversibleTransform &defVal)
csVector4 | GetParamVectorVal (const iShaderVarStack *stacks, const ProgramParam &param, const csVector4 &defVal)
| Query the value of a ProgramParam variable by reading the constant or resolving the shader variable.
## Protected Attributes
csStringHash | commonTokens
csString | description
| Program description.
bool | doVerbose
| Whether the shader program should report additional information during runtime.
iObjectRegistry * | objectReg
csRef< iFile > | programFile
| File the program is loaded from (if any).
csString | programFileName
| Filename of program.
csRef< iDocumentNode > | programNode
| iDocumentNode the program is loaded from
csRef< iStringSet > | strings
csRef< iSyntaxService > | synsrv
csArray< VariableMapEntry > | variablemap
| Variable mappings.
## Classes
struct | ProgramParam
| Program parameter, either a SV reference or a const value. More...
struct | VariableMapEntry
| Holder of variable mapping. More...

## Detailed Description

Base class for iShaderProgram plugins.

Provides basic services such as holding and of parameter mapping information, basic program data and data dumping.

Definition at line 58 of file shaderprogram.h.

## Member Enumeration Documentation

enum csShaderProgram::ProgramParamType`[protected]`

Expected/accepted types for a program parameter.

Definition at line 80 of file shaderprogram.h.

## Member Function Documentation

void csShaderProgram::DumpProgramInfo | ( | csString & | output | ) | `[protected]`

Dump all program info to output.

void csShaderProgram::DumpVariableMappings | ( | csString & | output | ) | `[protected]`

Dump variable mapping.

csVector4 csShaderProgram::GetParamVectorVal | ( | const iShaderVarStack * | stacks,
|  | const ProgramParam & | param,
|  | const csVector4 & | defVal |
| ) |  |  | `[inline, protected]`

Query the value of a ProgramParam variable by reading the constant or resolving the shader variable.

Definition at line 174 of file shaderprogram.h.

References csGetShaderVariableFromStack(), csRef< T >::IsValid(), csShaderProgram::ProgramParam::name, and csShaderProgram::ProgramParam::var.

csPtr<iDataBuffer> csShaderProgram::GetProgramData | ( |  | ) | `[protected]`

Get the raw program data.

iDocumentNode* csShaderProgram::GetProgramNode | ( |  | ) | `[protected]`

Get the program node.

bool csShaderProgram::ParseCommon | ( | iDocumentNode * | child | ) | `[protected]`

Parse common properties and variablemapping.

bool csShaderProgram::ParseProgramParam | ( | iDocumentNode * | node,
|  | ProgramParam & | param,
|  | uint | types = `~0` |
| ) |  |  | `[protected]`

Parse program parameter node.

virtual int csShaderProgram::ResolveTU | ( | const char * |  | ) | `[inline, virtual]`

When the destination of a texture binding wasn't recognized, the FP is asked whether it can provide a TU number for it.

Implements iShaderDestinationResolver.

Definition at line 232 of file shaderprogram.h.

## Member Data Documentation

csString csShaderProgram::description`[protected]`

Program description.

Definition at line 141 of file shaderprogram.h.

bool csShaderProgram::doVerbose`[protected]`

Whether the shader program should report additional information during runtime.

Definition at line 155 of file shaderprogram.h.

csRef<iFile> csShaderProgram::programFile`[protected]`

File the program is loaded from (if any).

Definition at line 146 of file shaderprogram.h.

csString csShaderProgram::programFileName`[protected]`

Filename of program.

Definition at line 149 of file shaderprogram.h.

csRef<iDocumentNode> csShaderProgram::programNode`[protected]`

iDocumentNode the program is loaded from

Definition at line 144 of file shaderprogram.h.

csArray<VariableMapEntry> csShaderProgram::variablemap`[protected]`

Variable mappings.

Definition at line 138 of file shaderprogram.h.

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

- csplugincommon/shader/shaderprogram.h