A PainterShaderRegistrarGLSL is an implementation of PainterRegistrar that assembles the shader source code of PainterItemShaderGLSL and PainterBlendShaderGLSL into an uber-shader.
More...
#include <painter_shader_registrar_glsl.hpp>
|
| PainterShaderRegistrarGLSL (void) |
|
void | add_fragment_shader_util (const ShaderSource &src) |
|
void | add_vertex_shader_util (const ShaderSource &src) |
|
void | construct_item_coverage_shader (const BackendConstants &backend_constants, ShaderSource &out_vertex, ShaderSource &out_fragment, const UberShaderParams &construct_params, unsigned int shader_id) |
|
void | construct_item_shader (enum PainterBlendShader::shader_type tp, const BackendConstants &backend_constants, ShaderSource &out_vertex, ShaderSource &out_fragment, const UberShaderParams &construct_params, unsigned int shader_id, c_string discard_macro_value="discard") |
|
void | construct_item_uber_coverage_shader (const BackendConstants &backend_constants, ShaderSource &out_vertex, ShaderSource &out_fragment, const UberShaderParams &construct_params, const ShaderFilter< PainterItemCoverageShaderGLSL > *item_shader_filter=nullptr) |
|
void | construct_item_uber_shader (enum PainterBlendShader::shader_type tp, const BackendConstants &backend_constants, ShaderSource &out_vertex, ShaderSource &out_fragment, const UberShaderParams &construct_params, const ShaderFilter< PainterItemShaderGLSL > *item_shader_filter=nullptr, c_string discard_macro_value="discard") |
|
void | fill_uniform_buffer (const PainterSurface::Viewport &vwp, c_array< uint32_t > p) |
|
unsigned int | registered_blend_shader_count (enum PainterBlendShader::shader_type tp) |
|
unsigned int | registered_shader_count (void) |
|
| PainterShaderRegistrar (void) |
|
void | register_shader (PainterItemShader *shader) |
|
void | register_shader (PainterItemCoverageShader *shader) |
|
void | register_shader (PainterBlendShader *shader) |
|
void | register_shader (PainterBrushShader *shader) |
|
void | register_shader (const PainterImageBrushShader *shader) |
|
void | register_shader (const PainterGradientBrushShader *shader) |
|
template<typename T > |
void | register_shader (const reference_counted_ptr< T > &shader) |
|
void | register_shader (const PainterStrokeShader &p) |
|
void | register_shader (const PainterFillShader &p) |
|
void | register_shader (const PainterDashedStrokeShaderSet &p) |
|
void | register_shader (const PainterGlyphShader &p) |
|
void | register_shader (const PainterBlendShaderSet &p) |
|
void | register_shader (const PainterBrushShaderSet &p) |
|
void | register_shader (const PainterShaderSet &p) |
|
unsigned int | unique_id (void) const |
|
| reference_counted_base (void) |
|
|
enum | clipping_type_t { clipping_via_gl_clip_distance,
clipping_via_discard,
clipping_via_skip_color_write
} |
|
enum | colorstop_backing_t { colorstop_texture_1d_array,
colorstop_texture_2d_array
} |
| Enumeration to specify how to access the backing store of a color stop atlas store in ColorStopAtlas::backing_store(). More...
|
|
enum | data_store_backing_t { data_store_tbo,
data_store_ubo,
data_store_ssbo
} |
| Enumeration to specify how the data store filled by PainterDraw::m_store is realized. More...
|
|
enum | fbf_blending_type_t { fbf_blending_not_supported,
fbf_blending_framebuffer_fetch,
fbf_blending_interlock
} |
| Enumeration to specify how to perform framebuffer-fetch blending. More...
|
|
enum | glyph_data_backing_t { glyph_data_tbo,
glyph_data_texture_array,
glyph_data_ssbo
} |
| Enumeration to specify how to access the backing store of the glyph data stored in GlyphAtlas::store() More...
|
|
enum | vertex_shader_in_layout { attribute0_slot = 0,
attribute1_slot,
attribute2_slot,
header_attrib_slot
} |
| Enumeration to describe vertex shader input slot layout. More...
|
|
enum | z_coordinate_convention_t { z_minus_1_to_1,
z_0_to_1
} |
| Enumeration to specify the convention for a 3D API for its normalized device coordinate in z. More...
|
|
A PainterShaderRegistrarGLSL is an implementation of PainterRegistrar that assembles the shader source code of PainterItemShaderGLSL and PainterBlendShaderGLSL into an uber-shader.
Definition at line 876 of file painter_shader_registrar_glsl.hpp.
◆ PainterShaderRegistrarGLSL()
fastuidraw::glsl::PainterShaderRegistrarGLSL::PainterShaderRegistrarGLSL |
( |
void |
| ) |
|
|
explicit |
◆ absorb_blend_shader()
|
finaloverrideprotectedvirtual |
To be implemented by a derived class to take into use a blend shader. Typically this means inserting the the blend shader into a large uber shader. Returns the PainterShader::Tag to be used by the backend to identify the shader. An implementation will never be passed an object for which PainterShader::parent() is non-nullptr. In addition, mutex() will be locked on entry.
- Parameters
-
shader | shader whose Tag is to be computed |
Implements fastuidraw::PainterShaderRegistrar.
◆ absorb_custom_brush_shader()
|
finaloverrideprotectedvirtual |
To be implemented by a derived class to take into use a blend shader. Typically this means inserting the the blend shader into a large uber shader. Returns the PainterShader::Tag to be used by the backend to identify the shader. An implementation will never be passed an object for which PainterShader::parent() is non-nullptr. In addition, mutex() will be locked on entry.
- Parameters
-
shader | shader whose Tag is to be computed |
Implements fastuidraw::PainterShaderRegistrar.
◆ absorb_item_coverage_shader()
|
finaloverrideprotectedvirtual |
To be implemented by a derived class to take into use an item shader. Typically this means inserting the the shader into a large uber shader. Returns the PainterShader::Tag to be used by the backend to identify the shader. An implementation will never be passed an object for which PainterShader::parent() is non-nullptr. In addition, mutex() will be locked on entry.
- Parameters
-
shader | shader whose Tag is to be computed |
Implements fastuidraw::PainterShaderRegistrar.
◆ absorb_item_shader()
|
finaloverrideprotectedvirtual |
To be implemented by a derived class to take into use an item shader. Typically this means inserting the the shader into a large uber shader. Returns the PainterShader::Tag to be used by the backend to identify the shader. An implementation will never be passed an object for which PainterShader::parent() is non-nullptr. In addition, mutex() will be locked on entry.
- Parameters
-
shader | shader whose Tag is to be computed |
Implements fastuidraw::PainterShaderRegistrar.
◆ add_fragment_shader_util()
void fastuidraw::glsl::PainterShaderRegistrarGLSL::add_fragment_shader_util |
( |
const ShaderSource & |
src | ) |
|
Add GLSL code that is to be visible to all vertex shaders. The code can define functions or macros.
- Parameters
-
◆ add_vertex_shader_util()
void fastuidraw::glsl::PainterShaderRegistrarGLSL::add_vertex_shader_util |
( |
const ShaderSource & |
src | ) |
|
Add GLSL code that is to be visible to all vertex shaders. The code can define functions or macros.
- Parameters
-
◆ compute_blend_shader_group()
To be optionally implemented by a derived class to compute the shader group of a PainterBlendShader. The passed shader may or may not be a sub-shader. The mutex() is locked for the duration of the function. Default implementation is to return 0.
- Parameters
-
◆ compute_blend_sub_shader_group()
|
finaloverrideprotectedvirtual |
◆ compute_custom_brush_shader_group()
To be optionally implemented by a derived class to compute the shader group of a PainterBrushShader. The passed shader may or may not be a sub-shader. The mutex() is locked for the duration of the function. Default implementation is to return 0.
- Parameters
-
◆ compute_custom_brush_sub_shader_group()
|
finaloverrideprotectedvirtual |
◆ compute_item_coverage_shader_group()
To be optionally implemented by a derived class to compute the shader group of a PainterItemCoverageShader. The passed shader may or may not be a sub-shader. The mutex() is locked for the duration of the function. Default implementation is to return 0.
- Parameters
-
◆ compute_item_coverage_sub_shader_group()
|
finaloverrideprotectedvirtual |
◆ compute_item_shader_group()
To be optionally implemented by a derived class to compute the shader group of a PainterItemShader. The passed shader may or may not be a sub-shader. The mutex() is locked for the duration of the function. Default implementation is to return 0.
- Parameters
-
◆ compute_item_sub_shader_group()
|
finaloverrideprotectedvirtual |
◆ construct_item_coverage_shader()
Add the vertex and fragment shaders of a specific item shader to given ShaderSource values. The Mutex mutex() is NOT locked during this call, a caller should lock the mutex before calling it. This way a derived class can use the same lock as used by the PainterShaderRegistrarGLSL.
- Parameters
-
backend_constants | constant values that affect the created uber-shader. |
out_vertex | ShaderSource to which to add uber-vertex shader |
out_fragment | ShaderSource to which to add uber-fragment shader |
construct_params | specifies how to construct the uber-shaders. |
shader_id | item shader ID, i.e. PainterItemShader::ID(). |
◆ construct_item_shader()
Add the vertex and fragment shaders of a specific item shader to given ShaderSource values. The Mutex mutex() is NOT locked during this call, a caller should lock the mutex before calling it. This way a derived class can use the same lock as used by the PainterShaderRegistrarGLSL.
- Parameters
-
tp | blend type of PainterBlendShader objects to include in the uber-shader |
backend_constants | constant values that affect the created uber-shader. |
out_vertex | ShaderSource to which to add uber-vertex shader |
out_fragment | ShaderSource to which to add uber-fragment shader |
construct_params | specifies how to construct the uber-shaders. |
shader_id | item shader ID, i.e. PainterItemShader::ID(). |
discard_macro_value | macro-value definintion for the macro FASTUIDRAW_DISCARD. PainterItemShaderGLSL fragment sources use FASTUIDRAW_DISCARD instead of discard. |
◆ construct_item_uber_coverage_shader()
Add the uber-vertex and fragment shaders to given ShaderSource values. The Mutex mutex() is NOT locked during this call, a caller should lock the mutex before calling it. This way a derived class can use the same lock as used by the PainterShaderRegistrarGLSL.
- Parameters
-
backend_constants | constant values that affect the created uber-shader. |
out_vertex | ShaderSource to which to add uber-vertex shader |
out_fragment | ShaderSource to which to add uber-fragment shader |
construct_params | specifies how to construct the uber-shaders. |
item_shader_filter | pointer to PainterShaderRegistrarGLSLTypes::ShaderFilter to use to filter which shaders to place into the uber-shader. A value of nullptr indicates to add all item coverage shaders to the uber-shader. |
◆ construct_item_uber_shader()
Add the uber-vertex and fragment shaders to given ShaderSource values. The Mutex mutex() is NOT locked during this call, a caller should lock the mutex before calling it. This way a derived class can use the same lock as used by the PainterShaderRegistrarGLSL. A backend will need to define the the functions (or macros) in their GLSL preamble:
- fastuidraw_begin_interlock() which is called before access
- fastuidraw_end_interlock() which is called after access if UberShaderParams::ffb_blending_type() is fbf_blending_interlock.
- Parameters
-
tp | blend type of PainterBlendShader objects to include in the uber-shader |
backend_constants | constant values that affect the created uber-shader. |
out_vertex | ShaderSource to which to add uber-vertex shader |
out_fragment | ShaderSource to which to add uber-fragment shader |
construct_params | specifies how to construct the uber-shaders. |
item_shader_filter | pointer to PainterShaderRegistrarGLSLTypes::ShaderFilter to use to filter which shaders to place into the uber-shader. A value of nullptr indicates to add all item shaders to the uber-shader. |
discard_macro_value | macro-value definintion for the macro FASTUIDRAW_DISCARD. PainterItemShaderGLSL fragment sources use FASTUIDRAW_DISCARD instead of discard. |
◆ fill_uniform_buffer()
Fill a buffer to hold the values used by the uber-shader. The buffer must be that p.size() is atleast ubo_size().
- Parameters
-
◆ registered_blend_shader_count()
Returns the number of blend shaders registered to this PainterShaderRegistrarGLSL; a derived class should track this count value and use it to determine when it needs to reconstruct its shaders. The mutex() is NOT locked for the duration of the function.
◆ registered_shader_count()
unsigned int fastuidraw::glsl::PainterShaderRegistrarGLSL::registered_shader_count |
( |
void |
| ) |
|
Returns the total number of shaders (item and blend) registered to this PainterShaderRegistrarGLSL; a derived class should track this count value and use it to determine when it needs to reconstruct its uber-shader. The mutex() is NOT locked for the duration of the function.
◆ ubo_size()
static uint32_t fastuidraw::glsl::PainterShaderRegistrarGLSL::ubo_size |
( |
void |
| ) |
|
|
static |
Total size of UBO for uniforms in units of uint32_t, see also fill_uniform_ubo().
The documentation for this class was generated from the following file: