|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
CVPParser Class ReferenceA vertex program parser.
More...
#include <vertex_program_parse.h>
List of all members.
Public Types |
typedef std::vector< CVPInstruction > | TProgram |
Public Methods |
bool | parse (const char *src, TProgram &result, std::string &errorOutput) |
| Parse a vertex program, and convert to proprietary format. More...
|
Static Public Methods |
void | dump (const TProgram &prg, std::string &dest) |
| Debugging purpose : This output a parsed vertex program in a string, with the standard format. More...
|
Private Methods |
bool | parseOperand (CVPOperand &operand, bool outputOperand, std::string &errorOutput) |
bool | parseInputRegister (CVPOperand &operand, std::string &errorOutput) |
bool | parseOutputRegister (CVPOperand &operand, std::string &errorOutput) |
bool | parseConstantRegister (CVPOperand &operand, std::string &errorOutput) |
bool | parseVariableRegister (CVPOperand &operand, std::string &errorOutput) |
bool | parseAddressRegister (CVPOperand &operand, std::string &errorOutput) |
bool | parseSwizzle (CVPSwizzle &swizzle, std::string &errorOutput) |
bool | parseWriteMask (uint &mask, std::string &errorOutput) |
bool | parseInstruction (CVPInstruction &instr, std::string &errorOutput, bool &endEncountered) |
bool | parseOp2 (CVPInstruction &instr, std::string &errorOutput) |
bool | parseOp3 (CVPInstruction &instr, std::string &errorOutput) |
bool | parseOp4 (CVPInstruction &instr, std::string &errorOutput) |
void | skipSpacesAndComments () |
| Skip tabulation and space in a source code. More...
|
Private Attributes |
const char * | _CurrChar |
const char * | _LineStart |
uint | _LineIndex |
uint | _RegisterMask [96] |
Detailed Description
A vertex program parser.
-
Author:
-
Nicolas Vizerie , Nevrax France
-
Date:
-
2002
Definition at line 191 of file vertex_program_parse.h.
Member Typedef Documentation
Member Function Documentation
void CVPParser::dump |
( |
const TProgram & |
prg, |
|
|
std::string & |
dest |
|
) |
[static] |
|
|
Debugging purpose : This output a parsed vertex program in a string, with the standard format.
This can serve as a base for other format code generation
Definition at line 1095 of file vertex_program_parse.cpp.
References dumpInstr. |
bool CVPParser::parse |
( |
const char * |
src, |
|
|
TProgram & |
result, |
|
|
std::string & |
errorOutput |
|
) |
|
|
|
Parse a vertex program, and convert to proprietary format.
It is intended to be use by a driver implementation. \warning: Only syntax is checked. It doesn't check that a register has been initialised before use. -
Parameters:
-
src |
The input text of a vertex program, in OpenGL format. |
result |
The result program. |
errorOuput |
If parsing failed, contains the reason |
-
Returns:
-
true if the parsing succeeded
Definition at line 906 of file vertex_program_parse.cpp.
References _CurrChar, _LineIndex, _LineStart, _RegisterMask, getStringUntilCR, parseInstruction, skipSpacesAndComments, src, NLMISC::toString, and TProgram.
Referenced by NL3D::CDriverGL::activeEXTVertexShader, NL3D::CDriverGL::activeNVVertexProgram, and NL3D::CMeshVPPerPixelLight::initInstance. |
bool CVPParser::parseAddressRegister |
( |
CVPOperand & |
operand, |
|
|
std::string & |
errorOutput |
|
) |
[private] |
|
bool CVPParser::parseConstantRegister |
( |
CVPOperand & |
operand, |
|
|
std::string & |
errorOutput |
|
) |
[private] |
|
bool CVPParser::parseInputRegister |
( |
CVPOperand & |
operand, |
|
|
std::string & |
errorOutput |
|
) |
[private] |
|
|
Definition at line 224 of file vertex_program_parse.cpp.
References _CurrChar, CVPOperand::IFogCoord, index, CVPOperand::INormal, CVPOperand::InputRegister, CVPOperand::IPosition, CVPOperand::IPrimaryColor, CVPOperand::ISecondaryColor, CVPOperand::ITex0, CVPOperand::IWeight, skipSpacesAndComments, CVPOperand::Type, and CVPOperand::Value.
Referenced by parseOperand. |
bool CVPParser::parseInstruction |
( |
CVPInstruction & |
instr, |
|
|
std::string & |
errorOutput, |
|
|
bool & |
endEncountered |
|
) |
[private] |
|
|
Definition at line 714 of file vertex_program_parse.cpp.
References _CurrChar, _RegisterMask, CVPInstruction::ADD, CVPOperand::AddressRegister, CVPInstruction::ARL, CVPInstruction::Dest, CVPInstruction::DP3, CVPInstruction::DP4, CVPInstruction::DST, CVPInstruction::EXPP, CVPSwizzle::isScalar, CVPInstruction::LIT, CVPInstruction::LOG, CVPInstruction::MAD, CVPInstruction::MAX, CVPInstruction::MIN, CVPInstruction::MOV, CVPInstruction::MUL, CVPInstruction::Opcode, parseOp2, parseOp3, parseOp4, CVPInstruction::RCP, CVPInstruction::RSQ, CVPInstruction::SGE, skipSpacesAndComments, CVPInstruction::SLT, CVPInstruction::Src1, CVPOperand::Swizzle, CVPOperand::Type, CVPOperand::Value, CVPOperand::Variable, and CVPOperand::WriteMask.
Referenced by parse. |
bool CVPParser::parseOp2 |
( |
CVPInstruction & |
instr, |
|
|
std::string & |
errorOutput |
|
) |
[private] |
|
|
Definition at line 547 of file vertex_program_parse.cpp.
References _CurrChar, CVPOperand::AddressRegister, CVPOperand::Constant, CVPInstruction::Dest, CVPOperand::InputRegister, CVPOperand::OutputRegister, parseOperand, skipSpacesAndComments, CVPInstruction::Src1, and CVPOperand::Type.
Referenced by parseInstruction, and parseOp3. |
bool CVPParser::parseOp3 |
( |
CVPInstruction & |
instr, |
|
|
std::string & |
errorOutput |
|
) |
[private] |
|
|
Definition at line 579 of file vertex_program_parse.cpp.
References _CurrChar, CVPOperand::AddressRegister, CVPOperand::Constant, CVPOperand::Indexed, CVPOperand::InputRegister, CVPOperand::OutputRegister, parseOp2, parseOperand, skipSpacesAndComments, CVPInstruction::Src1, CVPInstruction::Src2, CVPOperand::Type, and CVPOperand::Value.
Referenced by parseInstruction, and parseOp4. |
bool CVPParser::parseOp4 |
( |
CVPInstruction & |
instr, |
|
|
std::string & |
errorOutput |
|
) |
[private] |
|
|
Definition at line 632 of file vertex_program_parse.cpp.
References _CurrChar, CVPOperand::AddressRegister, CVPOperand::Constant, CVPOperand::Indexed, CVPOperand::InputRegister, CVPOperand::OutputRegister, parseOp3, parseOperand, skipSpacesAndComments, CVPInstruction::Src1, CVPInstruction::Src2, CVPInstruction::Src3, CVPOperand::Type, and CVPOperand::Value.
Referenced by parseInstruction. |
bool CVPParser::parseOperand |
( |
CVPOperand & |
operand, |
|
|
bool |
outputOperand, |
|
|
std::string & |
errorOutput |
|
) |
[private] |
|
|
Definition at line 142 of file vertex_program_parse.cpp.
References _CurrChar, _RegisterMask, CVPOperand::AddressRegister, CVPSwizzle::Comp, CVPOperand::Negate, parseAddressRegister, parseConstantRegister, parseInputRegister, parseOutputRegister, parseSwizzle, parseVariableRegister, parseWriteMask, skipSpacesAndComments, CVPOperand::Swizzle, CVPOperand::Type, CVPOperand::Value, CVPOperand::Variable, and CVPOperand::WriteMask.
Referenced by parseOp2, parseOp3, and parseOp4. |
bool CVPParser::parseOutputRegister |
( |
CVPOperand & |
operand, |
|
|
std::string & |
errorOutput |
|
) |
[private] |
|
|
Definition at line 370 of file vertex_program_parse.cpp.
References _CurrChar, CVPOperand::OBackFacePrimaryColor, CVPOperand::OBackFaceSecondaryColor, CVPOperand::OFogCoord, CVPOperand::OHPosition, CVPOperand::OPointSize, CVPOperand::OPrimaryColor, CVPOperand::OSecondaryColor, CVPOperand::OTex0, CVPOperand::OTex1, CVPOperand::OTex2, CVPOperand::OTex3, CVPOperand::OTex4, CVPOperand::OTex5, CVPOperand::OTex6, CVPOperand::OTex7, CVPOperand::OutputRegister, skipSpacesAndComments, CVPOperand::Type, and CVPOperand::Value.
Referenced by parseOperand. |
bool CVPParser::parseSwizzle |
( |
CVPSwizzle & |
swizzle, |
|
|
std::string & |
errorOutput |
|
) |
[private] |
|
bool CVPParser::parseVariableRegister |
( |
CVPOperand & |
operand, |
|
|
std::string & |
errorOutput |
|
) |
[private] |
|
bool CVPParser::parseWriteMask |
( |
uint & |
mask, |
|
|
std::string & |
errorOutput |
|
) |
[private] |
|
void CVPParser::skipSpacesAndComments |
( |
|
) |
[private] |
|
|
Skip tabulation and space in a source code.
Definition at line 77 of file vertex_program_parse.cpp.
References _CurrChar, _LineIndex, and _LineStart.
Referenced by parse, parseConstantRegister, parseInputRegister, parseInstruction, parseOp2, parseOp3, parseOp4, parseOperand, and parseOutputRegister. |
Member Data Documentation
const char* CVPParser::_CurrChar [private]
|
|
|
Definition at line 213 of file vertex_program_parse.h.
Referenced by parse, parseAddressRegister, parseConstantRegister, parseInputRegister, parseInstruction, parseOp2, parseOp3, parseOp4, parseOperand, parseOutputRegister, parseSwizzle, parseVariableRegister, parseWriteMask, and skipSpacesAndComments. |
uint CVPParser::_LineIndex [private]
|
|
const char* CVPParser::_LineStart [private]
|
|
uint CVPParser::_RegisterMask[96] [private]
|
|
The documentation for this class was generated from the following files:
|
|