FastUIDraw
Public Member Functions | List of all members
fastuidraw::gl::PainterEngineGL::ConfigurationGL Class Reference

A ConfigurationGL gives parameters how to contruct a PainterEngineGL. More...

#include <painter_engine_gl.hpp>

Public Member Functions

 ConfigurationGL (void)
 
 ConfigurationGL (const ConfigurationGL &obj)
 
ConfigurationGLadjust_for_context (const ContextProperties &ctx=ContextProperties())
 
bool allow_bindless_texture_from_surface (void) const
 
ConfigurationGLallow_bindless_texture_from_surface (bool)
 
bool assign_binding_points (void) const
 
ConfigurationGLassign_binding_points (bool v)
 
bool assign_layout_to_varyings (void) const
 
ConfigurationGLassign_layout_to_varyings (bool v)
 
bool assign_layout_to_vertex_shader_inputs (void) const
 
ConfigurationGLassign_layout_to_vertex_shader_inputs (bool v)
 
bool assume_single_gl_context (void) const
 
ConfigurationGLassume_single_gl_context (bool)
 
unsigned int attributes_per_buffer (void) const
 
ConfigurationGLattributes_per_buffer (unsigned int v)
 
bool blend_shader_use_switch (void) const
 
ConfigurationGLblend_shader_use_switch (bool v)
 
bool break_on_shader_change (void) const
 
ConfigurationGLbreak_on_shader_change (bool v)
 
enum buffer_streaming_type_t buffer_streaming_type (void) const
 
ConfigurationGLbuffer_streaming_type (enum buffer_streaming_type_t)
 
enum clipping_type_t clipping_type (void) const
 
ConfigurationGLclipping_type (enum clipping_type_t)
 
const reference_counted_ptr< ColorStopAtlas > & colorstop_atlas (void) const
 
const ColorStopAtlasParamscolorstop_atlas_params (void) const
 
ConfigurationGLcolorstop_atlas_params (const ColorStopAtlasParams &)
 
ConfigurationGLconfigure_from_context (bool optimal_rendering_quality=false, const ContextProperties &ctx=ContextProperties())
 
unsigned int data_blocks_per_store_buffer (void) const
 
ConfigurationGLdata_blocks_per_store_buffer (unsigned int v)
 
enum data_store_backing_t data_store_backing (void) const
 
ConfigurationGLdata_store_backing (enum data_store_backing_t v)
 
enum fbf_blending_type_t fbf_blending_type (void) const
 
ConfigurationGLfbf_blending_type (enum fbf_blending_type_t tp)
 
bool frag_shader_use_switch (void) const
 
ConfigurationGLfrag_shader_use_switch (bool v)
 
c_string glsl_version_override (void) const
 
ConfigurationGLglsl_version_override (c_string)
 
const reference_counted_ptr< GlyphAtlas > & glyph_atlas (void) const
 
const GlyphAtlasParamsglyph_atlas_params (void) const
 
ConfigurationGLglyph_atlas_params (const GlyphAtlasParams &)
 
const reference_counted_ptr< ImageAtlas > & image_atlas (void) const
 
const ImageAtlasParamsimage_atlas_params (void) const
 
ConfigurationGLimage_atlas_params (const ImageAtlasParams &)
 
unsigned int indices_per_buffer (void) const
 
ConfigurationGLindices_per_buffer (unsigned int v)
 
unsigned int number_context_textures (void) const
 
ConfigurationGLnumber_context_textures (unsigned int)
 
unsigned int number_pools (void) const
 
ConfigurationGLnumber_pools (unsigned int v)
 
ConfigurationGLoperator= (const ConfigurationGL &rhs)
 
enum PainterBlendShader::shader_type preferred_blend_type (void) const
 
ConfigurationGLpreferred_blend_type (enum PainterBlendShader::shader_type tp)
 
bool separate_program_for_discard (void) const
 
ConfigurationGLseparate_program_for_discard (bool v)
 
bool support_dual_src_blend_shaders (void) const
 
ConfigurationGLsupport_dual_src_blend_shaders (bool v)
 
void swap (ConfigurationGL &obj)
 
bool use_glsl_unpack_fp16 (void) const
 
ConfigurationGLuse_glsl_unpack_fp16 (bool)
 
bool use_uber_item_shader (void) const
 
ConfigurationGLuse_uber_item_shader (bool)
 
bool vert_shader_use_switch (void) const
 
ConfigurationGLvert_shader_use_switch (bool v)
 

Detailed Description

A ConfigurationGL gives parameters how to contruct a PainterEngineGL.

Definition at line 464 of file painter_engine_gl.hpp.

Constructor & Destructor Documentation

◆ ConfigurationGL() [1/2]

fastuidraw::gl::PainterEngineGL::ConfigurationGL::ConfigurationGL ( void  )

Ctor.

◆ ConfigurationGL() [2/2]

fastuidraw::gl::PainterEngineGL::ConfigurationGL::ConfigurationGL ( const ConfigurationGL obj)

Copy ctor.

Parameters
objvalue from which to copy

Member Function Documentation

◆ adjust_for_context()

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::adjust_for_context ( const ContextProperties ctx = ContextProperties())

Adjust values for current GL context.

Parameters
ctxOptional argument to pass to avoid re-querying the current GL context for extension and version

◆ allow_bindless_texture_from_surface() [1/2]

bool fastuidraw::gl::PainterEngineGL::ConfigurationGL::allow_bindless_texture_from_surface ( void  ) const

If true, PainterSurfaceGL objects whose PainterSurface::image() routine will return a TextureImage whose Image::type() is Image::bindless_texture2d if the GL/GLES implementation support bindless texturing; otherwise PainterSurfaceSurface::image() will always return TextureImage objects of Image::type() Image::context_texture2d. A number of buggy hardware drivers do not correctly sample from bindless textures if the texture was renderered to.

◆ allow_bindless_texture_from_surface() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::allow_bindless_texture_from_surface ( bool  )

Specify the return value to allow_bindless_texture_from_surface() const. Default value is true.

◆ assign_binding_points() [1/2]

bool fastuidraw::gl::PainterEngineGL::ConfigurationGL::assign_binding_points ( void  ) const

If true, the textures and buffers used in the uber-shader should be qualified with a layout(binding=) specifier. Default value is true.

◆ assign_binding_points() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::assign_binding_points ( bool  v)

◆ assign_layout_to_varyings() [1/2]

bool fastuidraw::gl::PainterEngineGL::ConfigurationGL::assign_layout_to_varyings ( void  ) const

If true, the varyings between vertex and fragment shading should be qualified with a layout(location=) specifier. Default value is false.

◆ assign_layout_to_varyings() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::assign_layout_to_varyings ( bool  v)

◆ assign_layout_to_vertex_shader_inputs() [1/2]

bool fastuidraw::gl::PainterEngineGL::ConfigurationGL::assign_layout_to_vertex_shader_inputs ( void  ) const

If true, the vertex shader inputs should be qualified with a layout(location=) specifier. Default value is true.

◆ assign_layout_to_vertex_shader_inputs() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::assign_layout_to_vertex_shader_inputs ( bool  v)

◆ assume_single_gl_context() [1/2]

bool fastuidraw::gl::PainterEngineGL::ConfigurationGL::assume_single_gl_context ( void  ) const

If true, for each PainterBackend made from the PainterEngineGL, the same GL context will access it. Default value is true.

◆ assume_single_gl_context() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::assume_single_gl_context ( bool  )

Set the value returned by assume_single_gl_context(void) const

◆ attributes_per_buffer() [1/2]

unsigned int fastuidraw::gl::PainterEngineGL::ConfigurationGL::attributes_per_buffer ( void  ) const

Specifies the maximum number of attributes a PainterDraw returned by map_draw() may store, i.e. the size of PainterDraw::m_attributes. Initial value is 512 * 512.

◆ attributes_per_buffer() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::attributes_per_buffer ( unsigned int  v)

◆ blend_shader_use_switch() [1/2]

bool fastuidraw::gl::PainterEngineGL::ConfigurationGL::blend_shader_use_switch ( void  ) const

If true, use switch() statements in uber blend shader, if false use a chain of if-else. Default value is false.

◆ blend_shader_use_switch() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::blend_shader_use_switch ( bool  v)

◆ break_on_shader_change() [1/2]

bool fastuidraw::gl::PainterEngineGL::ConfigurationGL::break_on_shader_change ( void  ) const

If true, place different item shaders in seperate entries of a glMultiDrawElements call. The motivation is that by placing in a seperate element of a glMultiDrawElements call, each element is a seperate HW draw call and by being seperate, the shader invocation does not divergently branch. Default value is false.

◆ break_on_shader_change() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::break_on_shader_change ( bool  v)

◆ buffer_streaming_type() [1/2]

enum buffer_streaming_type_t fastuidraw::gl::PainterEngineGL::ConfigurationGL::buffer_streaming_type ( void  ) const

Specifies how attribute, index and data-store is streamed to the GL buffer objects used in drawing. Default value is buffer_streaming_use_mapping

◆ buffer_streaming_type() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::buffer_streaming_type ( enum  buffer_streaming_type_t)

Set the value returned by buffer_streaming_type(void) const

◆ clipping_type() [1/2]

enum clipping_type_t fastuidraw::gl::PainterEngineGL::ConfigurationGL::clipping_type ( void  ) const

Specifies how the uber-shader will perform clipping.

◆ clipping_type() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::clipping_type ( enum  clipping_type_t)

Set the value returned by clipping_type(void) const. Default value is clipping_via_gl_clip_distance.

◆ colorstop_atlas()

const reference_counted_ptr<ColorStopAtlas>& fastuidraw::gl::PainterEngineGL::ConfigurationGL::colorstop_atlas ( void  ) const

The ColorStopAtlasGL to be used by the painter

◆ colorstop_atlas_params() [1/2]

const ColorStopAtlasParams& fastuidraw::gl::PainterEngineGL::ConfigurationGL::colorstop_atlas_params ( void  ) const

Return the parameters for creating the value returned by _atlas();

◆ colorstop_atlas_params() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::colorstop_atlas_params ( const ColorStopAtlasParams )

Set the value for _atlas_params(void) const

◆ configure_from_context()

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::configure_from_context ( bool  optimal_rendering_quality = false,
const ContextProperties ctx = ContextProperties() 
)

Set the values for optimal performance or rendering quality by quering the GL context.

Parameters
optimal_rendering_qualityif true, select parameters that give optimal rendering quality (at potential sacrifice of performance). If false, choose for optimal performance even at the cost of rendering quality.
ctxOptional argument to pass to avoid re-querying the current GL context for extension and version

◆ data_blocks_per_store_buffer() [1/2]

unsigned int fastuidraw::gl::PainterEngineGL::ConfigurationGL::data_blocks_per_store_buffer ( void  ) const

Specifies the maximum number of blocks of data a PainterDraw returned by map_draw() may store. The size of PainterDraw::m_store is given by data_blocks_per_store_buffer() * 4. Initial value is 1024 * 64.

◆ data_blocks_per_store_buffer() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::data_blocks_per_store_buffer ( unsigned int  v)

◆ data_store_backing() [1/2]

enum data_store_backing_t fastuidraw::gl::PainterEngineGL::ConfigurationGL::data_store_backing ( void  ) const

Returns how the data store is realized. The GL implementation may impose size limits that will force that the size of the data store might be smaller than that specified by data_blocks_per_store_buffer(). The initial value is data_store_tbo.

◆ data_store_backing() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::data_store_backing ( enum data_store_backing_t  v)

Set the value for data_store_backing(void) const

◆ fbf_blending_type() [1/2]

enum fbf_blending_type_t fastuidraw::gl::PainterEngineGL::ConfigurationGL::fbf_blending_type ( void  ) const

Returns how the painter will perform blending. If the value is not fbf_blending_not_supported, then will support blend shaders with PainterBlendShader::type() with value PainterBlendShader::framebuffer_fetch.

◆ fbf_blending_type() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::fbf_blending_type ( enum fbf_blending_type_t  tp)

Specify the return value to fbf_blending_type() const. Default value is fbf_blending_not_supported

Parameters
tpblend shader type

◆ frag_shader_use_switch() [1/2]

bool fastuidraw::gl::PainterEngineGL::ConfigurationGL::frag_shader_use_switch ( void  ) const

If true, use switch() statements in uber frag shader, if false use a chain of if-else. Default value is false.

◆ frag_shader_use_switch() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::frag_shader_use_switch ( bool  v)

◆ glsl_version_override() [1/2]

c_string fastuidraw::gl::PainterEngineGL::ConfigurationGL::glsl_version_override ( void  ) const

If a non-empty string, gives the GLSL version to be used by the uber-shaders. This value is (string) maxed with the computed GLSL version that is needed from the values of ConfigurationGL. Return value is valid until the next call to glsl_version_override(). Default value is an empty string.

◆ glsl_version_override() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::glsl_version_override ( c_string  )

Set the value returned by glsl_version_override(void) const. NOTE: the string is -copied-, thus it is legal for the passed string to be deallocated after the call.

◆ glyph_atlas()

const reference_counted_ptr<GlyphAtlas>& fastuidraw::gl::PainterEngineGL::ConfigurationGL::glyph_atlas ( void  ) const

The GlyphAtlasGL to be used by the painter

◆ glyph_atlas_params() [1/2]

const GlyphAtlasParams& fastuidraw::gl::PainterEngineGL::ConfigurationGL::glyph_atlas_params ( void  ) const

Return the parameters for creating the value returned by glyph_atlas();

◆ glyph_atlas_params() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::glyph_atlas_params ( const GlyphAtlasParams )

Set the value for glyph_atlas_params(void) const

◆ image_atlas()

const reference_counted_ptr<ImageAtlas>& fastuidraw::gl::PainterEngineGL::ConfigurationGL::image_atlas ( void  ) const

The ImageAtlasGL to be used by the painter

◆ image_atlas_params() [1/2]

const ImageAtlasParams& fastuidraw::gl::PainterEngineGL::ConfigurationGL::image_atlas_params ( void  ) const

Return the parameters for creating the value returned by image_atlas();

◆ image_atlas_params() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::image_atlas_params ( const ImageAtlasParams )

Set the value for image_atlas_params(void) const

◆ indices_per_buffer() [1/2]

unsigned int fastuidraw::gl::PainterEngineGL::ConfigurationGL::indices_per_buffer ( void  ) const

Specifies the maximum number of indices a PainterDraw returned by map_draw() may store, i.e. the size of PainterDraw::m_indices. Initial value is 1.5 times the initial value for attributes_per_buffer(void) const.

◆ indices_per_buffer() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::indices_per_buffer ( unsigned int  v)

Set the value for indices_per_buffer(void) const

◆ number_context_textures() [1/2]

unsigned int fastuidraw::gl::PainterEngineGL::ConfigurationGL::number_context_textures ( void  ) const

Returns the number of external textures (realized as sampler2D uniforms) the uber-shader is to have.

◆ number_context_textures() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::number_context_textures ( unsigned  int)

Set the value returned by number_context_textures(void) const. Default value is 8.

◆ number_pools() [1/2]

unsigned int fastuidraw::gl::PainterEngineGL::ConfigurationGL::number_pools ( void  ) const

A PainterBackend for the GL/GLES backend has a set of pools for the buffer objects to which to data to send to GL. Whenever on_end() is called, the next pool is used (wrapping around to the first pool when the last pool is finished). Ideally, one should set this value to N * L where N is the number of times Painter::begin() - Painter::end() pairs are within a frame and L is the latency in frames from ending a frame to the GPU finishes rendering the results of the frame. Initial value is 3.

◆ number_pools() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::number_pools ( unsigned int  v)

Set the value for number_pools(void) const

◆ operator=()

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::operator= ( const ConfigurationGL rhs)

Assignment operator

Parameters
rhsvalue from which to copy

◆ preferred_blend_type() [1/2]

enum PainterBlendShader::shader_type fastuidraw::gl::PainterEngineGL::ConfigurationGL::preferred_blend_type ( void  ) const

Returns the preferred way to implement blend shaders, i.e. if a shader can be implemented with this blending type it will be.

◆ preferred_blend_type() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::preferred_blend_type ( enum PainterBlendShader::shader_type  tp)

Specify the return value to preferred_blend_type() const. Default value is PainterBlendShader::dual_src

Parameters
tpblend shader type

◆ separate_program_for_discard() [1/2]

bool fastuidraw::gl::PainterEngineGL::ConfigurationGL::separate_program_for_discard ( void  ) const

If true, item and blend shaders are broken into two classes: those that use discard and those that do not. Each class is then realized as a seperate GLSL program.

◆ separate_program_for_discard() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::separate_program_for_discard ( bool  v)

◆ support_dual_src_blend_shaders() [1/2]

bool fastuidraw::gl::PainterEngineGL::ConfigurationGL::support_dual_src_blend_shaders ( void  ) const

If true, will support blend shaders with PainterBlendShader::type() with value PainterBlendShader::dual_src.

◆ support_dual_src_blend_shaders() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::support_dual_src_blend_shaders ( bool  v)

Specify the return value to support_dual_src_blend_shaders() const. Default value is true

◆ swap()

void fastuidraw::gl::PainterEngineGL::ConfigurationGL::swap ( ConfigurationGL obj)

Swap operation

Parameters
objobject with which to swap

◆ use_glsl_unpack_fp16() [1/2]

bool fastuidraw::gl::PainterEngineGL::ConfigurationGL::use_glsl_unpack_fp16 ( void  ) const

If true, use the GLSL built-in unpackHalf2x16(), otherwise use an implementation based off of bit-twiddling.

◆ use_glsl_unpack_fp16() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::use_glsl_unpack_fp16 ( bool  )

Set the value returned by use_glsl_unpack_fp16(void) const. Default value is true.

◆ use_uber_item_shader() [1/2]

bool fastuidraw::gl::PainterEngineGL::ConfigurationGL::use_uber_item_shader ( void  ) const

If false, each differen item shader (including sub-shaders) is realized as a separate GLSL program. This means that a GLSL shader change is invoked when item shader changes, potentially massively harming performance. Default value is true.

◆ use_uber_item_shader() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::use_uber_item_shader ( bool  )

◆ vert_shader_use_switch() [1/2]

bool fastuidraw::gl::PainterEngineGL::ConfigurationGL::vert_shader_use_switch ( void  ) const

If true, use switch() statements in uber vertex shader, if false use a chain of if-else. Default value is false.

◆ vert_shader_use_switch() [2/2]

ConfigurationGL& fastuidraw::gl::PainterEngineGL::ConfigurationGL::vert_shader_use_switch ( bool  v)

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