#include <ShProgramNode.hpp>
Inheritance diagram for SH::ShProgramNode:


Public Types | |
| typedef std::set< ShVariableNodePtr > | VarSet |
| typedef std::list< ShVariableNodePtr > | VarList |
| typedef std::list< ShTextureNodePtr > | TexList |
| typedef std::list< ShChannelNodePtr > | ChannelList |
| typedef std::list< ShPaletteNodePtr > | PaletteList |
Public Member Functions | |
| ShProgramNode (const std::string &target) | |
| ~ShProgramNode () | |
| void | compile (const ShPointer< ShBackend > &backend) |
| Forcefully compile this program for a particular backend, even if it has been compiled previously. | |
| void | compile (const std::string &target, const ShPointer< ShBackend > &backend) |
| Forcefully compile this program for a particular backend, even if it has been compiled previously. | |
| bool | is_compiled () const |
| Check whether the program has been compiled for the default backend. | |
| bool | is_compiled (const std::string &target) const |
| Check whether the program has been compiled for the default backend and the given target. | |
| bool | is_compiled (const std::string &target, const ShPointer< ShBackend > &backend) const |
| Check whether the program has been compiled for the given backend and the given target. | |
| std::string | describe_interface () const |
| Describe the inputs and outputs of this program. | |
| std::string | describe_vars () const |
| Describes all the variables in this program. | |
| std::string | describe_decls () const |
| Describes all the temps declared in this program. | |
| void | dump (std::string filename) const |
| Describes all of the above to the file filename.vars and dumps a DOT version of the cfg to filename.ps. | |
| ShPointer< ShBackendCode > | code () |
| Obtain the code for currently active backend. | |
| ShPointer< ShBackendCode > | code (const ShPointer< ShBackend > &backend) |
| Obtain the code for a particular backend. | |
| ShPointer< ShBackendCode > | code (const std::string &target, const ShPointer< ShBackend > &backend) |
| Obtain the code for a particular backend. | |
| void | updateUniform (const ShVariableNodePtr &uniform) |
| Notify this program that a uniform variable has changed. | |
| void | collectDecls () |
| Called right before optimization to collect temporary declarations. | |
| void | collectVariables () |
| Called right after optimization to make lists of all the variables used in the program. | |
| VarList::const_iterator | inputs_begin () const |
| VarList::const_iterator | inputs_end () const |
| VarList::const_iterator | outputs_begin () const |
| VarList::const_iterator | outputs_end () const |
| VarList::const_iterator | temps_begin () const |
| VarList::const_iterator | temps_end () const |
| VarList::const_iterator | constants_begin () const |
| VarList::const_iterator | constants_end () const |
| VarList::const_iterator | uniforms_begin () const |
| VarList::const_iterator | uniforms_end () const |
| TexList::const_iterator | textures_begin () const |
| TexList::const_iterator | textures_end () const |
| ChannelList::const_iterator | channels_begin () const |
| ChannelList::const_iterator | channels_end () const |
| PaletteList::const_iterator | palettes_begin () const |
| PaletteList::const_iterator | palettes_end () const |
| std::string | target () const |
| Can be empty, if there is no target associated with this program. | |
| std::string & | target () |
| It may be useful to change a program's target sometimes. | |
| ShPointer< ShProgramNode > | clone () const |
| Make a copy of this program. | |
| bool | finished () const |
| True if this program has been completed with SH_END. | |
| void | finish () |
| void | assign (const ShVariableNodePtr &var) const |
| bool | hasDecl (ShVariableNodePtr node) const |
| Returns whether a temporary variable is declared in this program. | |
| void | addDecl (ShVariableNodePtr node, ShCtrlGraphNodePtr) |
| Add a declaration. | |
| void | addDecl (ShVariableNodePtr node) |
Static Public Member Functions | |
| static std::ostream & | print (std::ostream &out, const VarList &list) |
| Print a description of a list of variables. | |
Public Attributes | |
| ShTokenizer | tokenizer |
| The tokenizer for this program's body. | |
| ShPointer< ShCtrlGraph > | ctrlGraph |
| The control graph (the parsed form of the token list). | |
| VarList | inputs |
| Input variables used in this program. | |
| VarList | outputs |
| Output variables used in this program. | |
| VarList | temps |
| Temporary variables used in this program. | |
| VarSet | tempDecls |
| Temporary variables declared in this program. | |
| VarList | constants |
| Constants used in this program. | |
| VarList | uniforms |
| Uniform variables used in this program. | |
| TexList | textures |
| Textures used in this program. | |
| ChannelList | channels |
| Channels used in FETCH instructions in this program. | |
| PaletteList | palettes |
| Palettes used in PAL instructions in this program. | |
Definition at line 44 of file ShProgramNode.hpp.
|
||||||||||||
|
Add a declaration. This is for use when a program is transformed and new temporaries are added. The first version adds to a specified cfg node in addition to this. The second adds to this and the entry node.
Definition at line 223 of file ShProgramNode.cpp. References ctrlGraph, and tempDecls. Referenced by addDecl(). |
|
||||||||||||
|
Obtain the code for a particular backend. Generates it if necessary. Definition at line 112 of file ShProgramNode.cpp. References compile(). |
|
|
Obtain the code for a particular backend. Generates it if necessary. This operation will fail if this program does not have a particular target. Definition at line 105 of file ShProgramNode.cpp. References code(), and SH::shError(). |
|
|
Obtain the code for currently active backend. This operation will fail if this program does not have a particular target. Definition at line 100 of file ShProgramNode.cpp. References SH::ShBackend::get_backend(). |
|
||||||||||||
|
Forcefully compile this program for a particular backend, even if it has been compiled previously. Use code() to obtain the actual code. Definition at line 53 of file ShProgramNode.cpp. References code(), collectDecls(), collectVariables(), SH::ShContext::current(), SH::ShContext::enter(), and SH::ShContext::exit(). |
|
|
Forcefully compile this program for a particular backend, even if it has been compiled previously. Use code() to obtain the actual code. This operation will fail if this program does not have a particular target. Definition at line 47 of file ShProgramNode.cpp. References SH::shError(). Referenced by code(). |
|
|
Check whether the program has been compiled for the default backend. This operation will fail if this program does not have particular target. Definition at line 71 of file ShProgramNode.cpp. References SH::ShBackend::get_backend(), and SH::shError(). Referenced by is_compiled(). |
|
|
The control graph (the parsed form of the token list). Constructed during the parsing step, when shEndProgram() is called. Definition at line 104 of file ShProgramNode.hpp. Referenced by addDecl(), clone(), collectDecls(), collectVariables(), dump(), shgl::GlslCode::generate(), shgl::ArbCode::generate(), and shgl::PBufferStreamCache::PBufferStreamCache(). |
|
|
The tokenizer for this program's body. Used only during construction of the program (before parsing) Definition at line 99 of file ShProgramNode.hpp. |
1.4.3-20050530