molecular
Classes | Public Types | Public Member Functions | Friends | List of all members
molecular::gfx::GlCommandSink::Program Class Reference

Compiled shader program. More...

#include <GlCommandSinkProgram.h>

Inheritance diagram for molecular::gfx::GlCommandSink::Program:
molecular::util::NonCopyable

Classes

struct  ShaderSourceItem
 

Public Types

enum  ShaderType { kFragmentShader = gl.FRAGMENT_SHADER, kVertexShader = gl.VERTEX_SHADER, kGeometryShader = gl.GEOMETRY_SHADER }
 

Public Member Functions

void Store (const std::string &vertexShaderSource, const std::string &pixelShaderSource)
 Compile source code. More...
 
void Store (const ShaderSourceItem items[], size_t count, const char **transformFeedbackOutputs=nullptr, unsigned int tfOutputsCount=0)
 Compile source code. More...
 
const std::unordered_set< Hash > & GetInputs () const
 Get set of uniforms and attributes. More...
 
void SetUniform (Hash key, const float *values, int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const int *values, int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const unsigned int values[], int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const Vector2 *values, int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const Vector3 *values, int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const Vector4 *values, int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const IntVector2 *values, int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const IntVector3 *values, int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const IntVector4 *values, int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const UIntVector2 values[], int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const UIntVector3 values[], int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const UIntVector4 values[], int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const Matrix< 3, 3 > *values, int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const Matrix< 4, 4 > *values, int count=1)
 Set uniform values. More...
 
void SetUniform (Hash key, const Texture *const *textures, int count=1)
 Set texture sampler uniform. More...
 
void SetAttribute (Hash key, VertexBuffer *buffer, int components, VertexAttributeInfo::Type type, int stride=0, int offset=0, bool normalized=true)
 Set vertex attribute. More...
 
void SetAttribute (Hash key, VertexBuffer *buffer, const VertexAttributeInfo &info)
 

Friends

class GlCommandSink
 

Detailed Description

Compiled shader program.

See also
Renderer::CreateProgram
Renderer::DestroyProgram

Member Enumeration Documentation

Enumerator
kFragmentShader 
kVertexShader 
kGeometryShader 

Member Function Documentation

const std::unordered_set<Hash>& molecular::gfx::GlCommandSink::Program::GetInputs ( ) const
inline

Get set of uniforms and attributes.

See also
SetUniform
SetAttribute
void molecular::gfx::GlCommandSink::Program::SetAttribute ( Hash  key,
VertexBuffer buffer,
int  components,
VertexAttributeInfo::Type  type,
int  stride = 0,
int  offset = 0,
bool  normalized = true 
)

Set vertex attribute.

void molecular::gfx::GlCommandSink::Program::SetAttribute ( Hash  key,
VertexBuffer buffer,
const VertexAttributeInfo info 
)
inline
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const float *  values,
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const int *  values,
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const unsigned int  values[],
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const Vector2 values,
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const Vector3 values,
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const Vector4 values,
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const IntVector2 values,
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const IntVector3 values,
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const IntVector4 values,
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const UIntVector2  values[],
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const UIntVector3  values[],
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const UIntVector4  values[],
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const Matrix< 3, 3 > *  values,
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const Matrix< 4, 4 > *  values,
int  count = 1 
)
inline

Set uniform values.

Parameters
keyHash of the uniform name,
valuesPointer to the first (or single) value of the array.
countElements in the array (or 1 for non-array uniforms).
void molecular::gfx::GlCommandSink::Program::SetUniform ( Hash  key,
const Texture *const *  textures,
int  count = 1 
)

Set texture sampler uniform.

void molecular::gfx::GlCommandSink::Program::Store ( const std::string &  vertexShaderSource,
const std::string &  pixelShaderSource 
)

Compile source code.

Legacy interface.

void molecular::gfx::GlCommandSink::Program::Store ( const ShaderSourceItem  items[],
size_t  count,
const char **  transformFeedbackOutputs = nullptr,
unsigned int  tfOutputsCount = 0 
)

Compile source code.

Friends And Related Function Documentation

friend class GlCommandSink
friend

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