ShaderInstance Class Reference

#include <oslexec_pvt.h>

Public Types

typedef ShaderInstanceRef ref

Public Member Functions

 ShaderInstance (ShaderMaster::ref master, const char *layername="")
 ~ShaderInstance ()
ustring layername () const
const std::string & shadername () const
ShaderMastermaster () const
ShadingSystemImplshadingsys () const
void parameters (const ParamValueList &params)
int findsymbol (ustring name) const
int findparam (ustring name) const
Symbol * symbol (int index)
const Symbol * symbol (int index) const
size_t heapround ()
void add_connection (int srclayer, const ConnectedParam &srccon, const ConnectedParam &dstcon)
int nconnections () const
const Connectionconnection (int i) const
ConnectionVecconnections ()
const ConnectionVecconnections () const
int id () const
bool writes_globals () const
bool run_lazily () const
void run_lazily (bool lazy)
bool outgoing_connections () const
void outgoing_connections (bool out)
int maincodebegin () const
int maincodeend () const
int firstparam () const
int lastparam () const
int Psym () const
int Nsym () const
const std::vector< int > & args () const
std::vector< int > & args ()
int arg (int argnum)
Symbol * argsymbol (int argnum)
const OpcodeVec & ops () const
OpcodeVec & ops ()
std::string print ()
SymbolVec & symbols ()
const SymbolVec & symbols () const
void make_symbol_room (size_t moresyms=1)
bool unused () const
void copy_code_from_master ()


class ShadingSystemImpl
class RuntimeOptimizer
std::pair< Symbol *, Symbol * > param_range (ShaderInstance *i)
std::pair< const Symbol *, const Symbol * > param_range (const ShaderInstance *i)

Detailed Description

ShaderInstance is a particular instance of a shader, with its own set of parameter values, coordinate transform, and connections to other instances within the same shader group.

Definition at line 303 of file oslexec_pvt.h.

Member Typedef Documentation

Definition at line 305 of file oslexec_pvt.h.

Constructor & Destructor Documentation

ShaderInstance ( ShaderMaster::ref  master,
const char *  layername = "" 

Member Function Documentation

ustring layername ( ) const

Return the layer name of this instance

Definition at line 311 of file oslexec_pvt.h.

const std::string& shadername ( ) const

Return the name of the shader used by this instance.

Definition at line 315 of file oslexec_pvt.h.

ShaderMaster* master ( ) const

Return a pointer to the master for this instance.

Definition at line 319 of file oslexec_pvt.h.

ShadingSystemImpl& shadingsys ( ) const

Return a reference to the shading system for this instance.

Definition at line 323 of file oslexec_pvt.h.

void parameters ( const ParamValueList &  params)

Apply pending parameters

int findsymbol ( ustring  name) const

Find the named symbol, return its index in the symbol array, or -1 if not found.

int findparam ( ustring  name) const

Find the named parameter, return its index in the symbol array, or -1 if not found.

Symbol* symbol ( int  index)

Return a pointer to the symbol (specified by integer index), or NULL (if index was -1, as returned by 'findsymbol').

Definition at line 339 of file oslexec_pvt.h.

const Symbol* symbol ( int  index) const

Definition at line 340 of file oslexec_pvt.h.

size_t heapround ( )

Estimate how much to round the required heap size up if npoints is odd, to account for getting the desired alignment for each symbol.

void add_connection ( int  srclayer,
const ConnectedParam srccon,
const ConnectedParam dstcon 

Add a connection

int nconnections ( ) const

How many connections to earlier layers do we have?

Definition at line 354 of file oslexec_pvt.h.

const Connection& connection ( int  i) const

Return a reference to the i-th connection to an earlier layer.

Definition at line 358 of file oslexec_pvt.h.

ConnectionVec& connections ( )

Reference to the connection list.

Definition at line 362 of file oslexec_pvt.h.

const ConnectionVec& connections ( ) const

Definition at line 363 of file oslexec_pvt.h.

int id ( ) const

Return the unique ID of this instance.

Definition at line 367 of file oslexec_pvt.h.

bool writes_globals ( ) const

Does this instance potentially write to any global vars?

Definition at line 371 of file oslexec_pvt.h.

bool run_lazily ( ) const

Should this instance only be run lazily (i.e., not unconditionally)?

Definition at line 375 of file oslexec_pvt.h.

void run_lazily ( bool  lazy)

Definition at line 376 of file oslexec_pvt.h.

bool outgoing_connections ( ) const

Does this instance have any outgoing connections?

Definition at line 380 of file oslexec_pvt.h.

void outgoing_connections ( bool  out)

Set whether this instance has outgoing connections.

Definition at line 383 of file oslexec_pvt.h.

References out.

int maincodebegin ( ) const

Definition at line 385 of file oslexec_pvt.h.

int maincodeend ( ) const

Definition at line 386 of file oslexec_pvt.h.

int firstparam ( ) const

Definition at line 388 of file oslexec_pvt.h.

int lastparam ( ) const

Definition at line 389 of file oslexec_pvt.h.

int Psym ( ) const

Definition at line 403 of file oslexec_pvt.h.

int Nsym ( ) const

Definition at line 404 of file oslexec_pvt.h.

const std::vector<int>& args ( ) const

Definition at line 407 of file oslexec_pvt.h.

std::vector<int>& args ( )

Definition at line 408 of file oslexec_pvt.h.

int arg ( int  argnum)

Definition at line 409 of file oslexec_pvt.h.

Symbol* argsymbol ( int  argnum)

Definition at line 410 of file oslexec_pvt.h.

const OpcodeVec& ops ( ) const

Definition at line 411 of file oslexec_pvt.h.

OpcodeVec& ops ( )

Definition at line 412 of file oslexec_pvt.h.

std::string print ( )
SymbolVec& symbols ( )

Definition at line 416 of file oslexec_pvt.h.

const SymbolVec& symbols ( ) const

Definition at line 417 of file oslexec_pvt.h.

void make_symbol_room ( size_t  moresyms = 1)

Make sure there's room for more symbols.

bool unused ( ) const

Does it appear that the layer is completely unused?

Definition at line 425 of file oslexec_pvt.h.

void copy_code_from_master ( )

Make our own version of the code and args from the master.

Friends And Related Function Documentation

friend class ShadingSystemImpl

Definition at line 449 of file oslexec_pvt.h.

friend class RuntimeOptimizer

Definition at line 450 of file oslexec_pvt.h.

std::pair<Symbol *,Symbol *> param_range ( ShaderInstance i)

Return a begin/end Symbol* pair for the set of param symbols that is suitable to pass as a range for BOOST_FOREACH.

Definition at line 393 of file oslexec_pvt.h.

std::pair<const Symbol *,const Symbol *> param_range ( const ShaderInstance i)

Definition at line 398 of file oslexec_pvt.h.

The documentation for this class was generated from the following file: