FastUIDraw
|
A PainterBlendShaderGLSL is a PainterBlendShader whose shader code fragment is via GLSL. More...
#include <painter_blend_shader_glsl.hpp>
Classes | |
class | DependencyList |
If one wishes to make use of other PainterBlendShaderGLSL fastuidraw_gl_compute_blend_value(), fastuidraw_gl_compute_blend_factors() or fastuidraw_gl_compute_post_blended_value() routines 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... | |
Additional Inherited Members | |
Public Types inherited from fastuidraw::PainterBlendShader | |
enum | shader_type { single_src, dual_src, framebuffer_fetch, number_types } |
Enumeration to specify how blend shader operates. More... | |
Static Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter > | |
static void | add_reference (const reference_counted_base< T, Counter > *p) |
static void | remove_reference (const reference_counted_base< T, Counter > *p) |
A PainterBlendShaderGLSL is a PainterBlendShader whose shader code fragment is via GLSL.
The code to implement is dependent on the PainterBlendShader::type() of the created PainterBlendShaderGLSL.
The GLSL elements in the modules GLSL Vertex Fragment Code and GLSL Fragment Code are available for use.
For both stages, the value of the argument of shader_data_block is which 128-bit block into the data store (PainterDraw::m_store) of the shader data to be read with the GLSL macro fastuidraw_fetch_data. On exit, this value must be updated to the location just past the shader data of the shader.
For both stages, the value of the argument of sub_shader() is the value of PainterShader::sub_shader() of the active shader.
The value of the argument of shader_data_block is which 128-bit block into the data store (PainterDraw::m_store) of the custom shader data to be read with the GLSL macro fastuidraw_fetch_data.
Also, if one defines macros in any of the passed ShaderSource objects, those macros MUST be undefined at the end. In addition, if one has local helper functions, to avoid global name collision, those function names should be wrapped in the macro FASTUIDRAW_LOCAL() to make sure that the function is given a unique global name within the uber-shader.
Lastly, one can use the class UnpackSourceGenerator to generate shader code to unpack values from the data in the data store buffer. That machine generated code uses the macro fastuidraw_fetch_data().
Definition at line 104 of file painter_blend_shader_glsl.hpp.
fastuidraw::glsl::PainterBlendShaderGLSL::PainterBlendShaderGLSL | ( | enum shader_type | tp, |
const ShaderSource & | src, | ||
unsigned int | num_sub_shaders = 1 , |
||
const DependencyList & | dependencies = DependencyList() |
||
) |
Ctor.
tp | blend shader type |
src | GLSL code fragment for blend shading |
num_sub_shaders | the number of sub-shaders it supports |
dependencies | list of other PainterBlendShaderGLSL that are used directly. |
const glsl::ShaderSource& fastuidraw::glsl::PainterBlendShaderGLSL::blend_src | ( | void | ) | const |
Return the GLSL source of the blend shader
c_array<const c_string> fastuidraw::glsl::PainterBlendShaderGLSL::dependency_list_names | ( | void | ) | const |
Returns the names that each shader listed in dependency_list_shaders() is referenced by, i.e. the i'th element of dependency_list_shaders() is referenced as the i'th element of dependency_list_names().
c_array<const reference_counted_ptr<const PainterBlendShaderGLSL> > fastuidraw::glsl::PainterBlendShaderGLSL::dependency_list_shaders | ( | void | ) | const |
Return the list of shaders on which this shader is dependent.