Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

SH::ShTransformer Class Reference

Program transformer. More...

#include <ShTransformer.hpp>

Collaboration diagram for SH::ShTransformer:

Collaboration graph
[legend]
List of all members.

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< ShVariableNodePtrVarNodeVec
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.

Todo:
currently all or none approach to conversion. could parameterize this with flags to choose INPUT, OUTPUT, INOUT


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 ()

Detailed Description

Program transformer.

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.


The documentation for this class was generated from the following files:
Generated on Mon Oct 18 14:17:59 2004 for Sh by doxygen 1.3.7