RslContext Class Reference

RslContext contains the grid data required to execute a shadeop. More...

#include <RslPlugin.h>

List of all members.

Public Member Functions

virtual ~RslContext ()
 Virtual destructor.
virtual const RslRunFlagGetRunFlags (unsigned int *length) const =0
 Returns an array of runflags.
virtual RixInterface * GetRixInterface (RixInterfaceId id) const =0
 Shader plugins have access to RixInterfaces that provide various kinds of storage management (per-frame, per-thread, and per-grid), statistics reporting, error messages, etc.
RixStorage * GetGlobalStorage () const
 Get thread-safe global variable storage, which is used as follows:.
RixStorage * GetThreadStorage () const
 Get per-thread storage, which is used as follows:.
RixStorage * GetLocalStorage () const
 Get local data storage, which is cleared when the current shader set finishes running on the current set of points.
void SetThreadData (void *data, RixCleanupFunc cleanup=0L)
 Set per-thread user data and optional cleanup function.
void * GetThreadData () const
 Get per-thread user data.
void SetLocalData (void *data, RixCleanupFunc cleanup=0L)
 Set local user data and optional cleanup function.
void * GetLocalData () const
 Get local user data.
virtual const char * GetPluginName () const =0
 Get the name of this plugin.

Friends

class RslIter
class RslArrayIter


Detailed Description

RslContext contains the grid data required to execute a shadeop.


Constructor & Destructor Documentation

virtual RslContext::~RslContext  )  [inline, virtual]
 

Virtual destructor.


Member Function Documentation

RixStorage* RslContext::GetGlobalStorage  )  const [inline]
 

Get thread-safe global variable storage, which is used as follows:.

       RixStorage* storage = rslContext->GetGlobalStorage();
       storage->Lock();
       void* myglobal = storage->Get("myglobal");
       if (myglobal == NULL) {
           myglobal = MakeData();
           storage->Set("myglobal", myglobal, CleanupData);
       }
       storage->Unlock();
This code operates as follows:
  • Get the globals from the RslContext.
  • Lock the globals for thread safety.
  • Look up the key to see if the data already exists.
  • If not, allocate the data and store it in the globals. (The optional cleanup function is called at end of frame.)
  • Unlock the globals.

void* RslContext::GetLocalData  )  const [inline]
 

Get local user data.

RixStorage* RslContext::GetLocalStorage  )  const [inline]
 

Get local data storage, which is cleared when the current shader set finishes running on the current set of points.

virtual const char* RslContext::GetPluginName  )  const [pure virtual]
 

Get the name of this plugin.

virtual RixInterface* RslContext::GetRixInterface RixInterfaceId  id  )  const [pure virtual]
 

Shader plugins have access to RixInterfaces that provide various kinds of storage management (per-frame, per-thread, and per-grid), statistics reporting, error messages, etc.

virtual const RslRunFlag* RslContext::GetRunFlags unsigned int *  length  )  const [pure virtual]
 

Returns an array of runflags.

A value of 1 indicates the grid point is active, a value of 0 means the grid point is not active.

void* RslContext::GetThreadData  )  const [inline]
 

Get per-thread user data.

RixStorage* RslContext::GetThreadStorage  )  const [inline]
 

Get per-thread storage, which is used as follows:.

       RixStorage* storage = rslContext->GetThreadStorage();
       void* mydata = storage->Get("mydata");
       if (mydata == NULL) {
           mydata = MakeData();
           storage->Set("mydata", mydata, CleanupData);
       }
This code operates as follows:
  • Get the per-thread storage from the RslContext.
  • Look up the key to see if the data already exists.
  • If not, allocate the data and store it in the globals. (The optional cleanup function is called at end of frame.)

void RslContext::SetLocalData void *  data,
RixCleanupFunc  cleanup = 0L
[inline]
 

Set local user data and optional cleanup function.

The cleanup function is called on the user data when the current shader set finishes running on the current set of points. For greater flexibility, use GetLocals.

void RslContext::SetThreadData void *  data,
RixCleanupFunc  cleanup = 0L
[inline]
 

Set per-thread user data and optional cleanup function.

The cleanup function is called on the user data when the thread is terminated. For greater flexibility, use GetThreadLocals.


The documentation for this class was generated from the following file:
Generated on Wed May 10 15:56:09 2006 for PRManHeaders by  doxygen 1.4.6