FastUIDraw
Public Member Functions | Friends | List of all members
fastuidraw::glsl::PainterBrushShaderGLSL::DependencyList Class Reference

If one wishes to make use of other PainterBrushShaderGLSL fastuidraw_gl_vert_brush_main()/fastuidraw_gl_frag_brush_main() of other shaders (for example to have a simple shader that adds on to a previous shader), a DependencyList provides the means to do so. More...

#include <painter_brush_shader_glsl.hpp>

Public Member Functions

 DependencyList (void)
 
 DependencyList (const DependencyList &obj)
 
DependencyListadd_shader (c_string name, const reference_counted_ptr< const PainterBrushShaderGLSL > &shader)
 
DependencyListoperator= (const DependencyList &rhs)
 
void swap (DependencyList &obj)
 

Friends

class PainterBrushShaderGLSL
 

Detailed Description

If one wishes to make use of other PainterBrushShaderGLSL fastuidraw_gl_vert_brush_main()/fastuidraw_gl_frag_brush_main() of other shaders (for example to have a simple shader that adds on to a previous shader), a DependencyList provides the means to do so.

Each such used shader is given a name by which the caller will use it. In addition, the caller has access to the varyings and shared symbols of the callee as well. A varying or shareable V of an element in the DependencyList is accessed from the parent shader with dep::V where dep is the argument value of name to add_shader(). Note that it is accessed with the scope-resolution operator; the uber-shader assember will convert the scope-resolution operator into acceptable GLSL code.

By using the values of the shareables (embodied in fields symbol_list::m_vert_shareable_values and symbol_list::m_frag_shareable_values), reading and potentially modifying the values of the varyings, one can create effects building off of the built-in shaders of the GLSL module.

Lastly, the uber-shader assembler gives a means to avoid collision in using context textures. To avoid re-using the same context textures, the macros fastuidraw_brush_start_context_texture, and fastuidraw_brush_context_texture(X) are provided where

The Uber-shader assembler fills the textures depth-first. Thus the first dependency uses slots [0, 1, .., N - 1] where N is number_context_textures() of the first dependency, then the second dependency uses [N, N + 1, ..., N + M - 1] where M is number_context_textures() of the second dependency and so on.

Definition at line 129 of file painter_brush_shader_glsl.hpp.

Constructor & Destructor Documentation

◆ DependencyList() [1/2]

fastuidraw::glsl::PainterBrushShaderGLSL::DependencyList::DependencyList ( void  )

Ctor.

◆ DependencyList() [2/2]

fastuidraw::glsl::PainterBrushShaderGLSL::DependencyList::DependencyList ( const DependencyList obj)

Copy ctor.

Parameters
objvalue from which to copy

Member Function Documentation

◆ add_shader()

DependencyList& fastuidraw::glsl::PainterBrushShaderGLSL::DependencyList::add_shader ( c_string  name,
const reference_counted_ptr< const PainterBrushShaderGLSL > &  shader 
)

Add a shader to the DependencyList's list.

Parameters
namename by which to call the shader
shadershader to add to this DependencyList

◆ operator=()

DependencyList& fastuidraw::glsl::PainterBrushShaderGLSL::DependencyList::operator= ( const DependencyList rhs)

Assignment operator

Parameters
rhsvalue from which to copy

◆ swap()

void fastuidraw::glsl::PainterBrushShaderGLSL::DependencyList::swap ( DependencyList obj)

Swap operation

Parameters
objobject with which to swap

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