#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) |
Public Member Functions | |
ShTransformer (const ShProgramNodePtr &program) | |
bool | changed () |
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.
| |
void | convertInputOutput () |
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 50 of file ShTransformer.hpp.