UniShader  1.0.0a
Interface for GPGPU and working with shader programs
 All Classes Functions Typedefs Enumerations Enumerator
Public Types | Public Member Functions
Varying Class Reference

Varying class. More...

#include <Varying.h>

Inheritance diagram for Varying:
SignalReceiver ObjectBase

List of all members.

Public Types

typedef SafePtr< VaryingPtr
 Safe pointer.
typedef SafePtr< const VaryingPtrConst
 Safe pointer.

Public Member Functions

 Varying (ShaderProgram &program, ShaderOutput &output, std::string name)
virtual const std::string & getClassName () const
 Get name of this class.
template<typename T >
Buffer< T >::PtrConst getBuffer ()
 Get buffer.
const GLSLTypegetGLSLType () const
 Get GLSL type.
std::string getName () const
 Get shader variable name.
bool prepare (unsigned int index, unsigned int primitiveCount, size_t *unitSize=0)
 Prepare varying.
virtual bool handleSignal (unsigned int signalID, const ObjectBase *callerPtr)
 Handle incoming signal.

Detailed Description

Varying class.

Varyings are output variables for GLSL vertex and geometry shader programs. In newer GLSL versions varying keyword was replaced by output keyword, but functionality is the same. Varyings are used to pass data between subsequent shader stages.

It is possible to record values in varying before they enter fragment shader stage with transform feedback. This class, therefore, seves as interface to access recorded values in application. Recorded values are originaly stored in buffer in graphics card memory.

If a geometry shader stage is present, only output variables of geometry shader can be recorded. If only vertex shader stage is present, recording of output variable is considered as valid usage of that variable and shader program can be run.


Member Function Documentation

template<typename T >
UNISHADER_BEGIN Buffer< T >::PtrConst Varying::getBuffer ( )

Get buffer.

Returns:
Buffer.
const GLSLType& Varying::getGLSLType ( ) const

Get GLSL type.

Returns:
GLSL type.
std::string Varying::getName ( ) const

Get shader variable name.

Returns:
Shader variable name.
virtual bool Varying::handleSignal ( unsigned int  signalID,
const ObjectBase callerPtr 
) [virtual]

Handle incoming signal.

Parameters:
signalIDSignal identifier.
callerPtrPointer to object sending signal.
Returns:
True if handled.

Implements SignalReceiver.

bool Varying::prepare ( unsigned int  index,
unsigned int  primitiveCount,
size_t *  unitSize = 0 
)

Prepare varying.

Retrieve info about varying from shader program and prepare varying for use.

Returns:
True if prepared successfully.

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