#include <ShTransformer.hpp>
Collaboration diagram for SH::ShTransformer:

Tuple splitting when backend canot support arbitrary | |
| length tuples.
If any tuples are split, this adds entries to the splits map to map from original long tuple ShVariableNode to a vector of ShVariableNodes all <= max tuple size of the backend. All long tuples in the intermediate representation are split up into shorter tuples. | |
| typedef std::vector< ShVariableNodePtr > | VarNodeVec |
|
typedef std::map< ShVariableNodePtr, VarNodeVec > | VarSplitMap |
| void | splitTuples (int maxTuple, VarSplitMap &splits) |
| struct | VariableSplitter |
| struct | StatementSplitter |
Input and Output variable to temp convertor | |
| In most GPU shading languages/assembly, outputs cannot be used as src variable in computation and inputs cannot be used as a dest, and inout variables are not supported directly. Optionally one can provide a ShVarTransformMap that the function will update with any new variable transformations that it makes.
| |
| void | convertInputOutput (ShVarTransformMap *varTransMap=0) |
| struct | InputOutputConvertor |
Arithmetic type conversions | |
| Converts ops on other basic non-float Sh types to float storage types based on the floatMapping. For each key k (a type index to convert), in floatMapping, the converter changes it to use floating point type index floatMapping[k].
(Note, the converter does not handle cases where floatMapping[j] exists, but j is also floatMapping[k]) | |
| void | convertToFloat (ValueTypeMap &typeMap) |
| void | stripDummyOps () |
| Strips out dummy statements (SECTION in particular). | |
| void | expand_atan2 () |
| Replace atan2 by a division followed by an arctan. | |
| void | expand_inverse_hyperbolic () |
| Replace atanh, asinh and acosh with a log. | |
| void | texd_to_texlod () |
| Replace TEXD with TEXLOD ops. | |
Public Types | |
|
typedef std::map< ShValueType, ShValueType > | ValueTypeMap |
Public Member Functions | |
| ShTransformer (const ShProgramNodePtr &program) | |
| ~ShTransformer () | |
| bool | changed () |
Texture lookup conversion | |
Most GPUs only do indexed lookup for rectangular textures, so convert other kinds of lookup with appropriate scales. | |
| void | convertTextureLookups () |
Platform-specific transformations on ShProgram objects.
These may change the variable lists (inputs, outputs, etc.) and control graph of the ShProgram, so they should be done on a copy of the ShProgram just before code generation instead of the original. (Otherwise, future algebra operations on the original may not give the expected results since the variables will no longer be the same)
Global requirements for running ShTransformer: ShContext::current()->parsing() == program
Definition at line 45 of file ShTransformer.hpp.
1.4.6