FastUIDraw
Classes | Macros | Functions | Variables
GLSL Vertex Fragment Code

This group documents the GLSL functions fastuidraw makes available to GLSL code fragments for both vertex and fragment shading for custom shading as embodied by the classes fastuidraw::glsl::PainterItemShaderGLSL, fastuidraw::glsl::PainterBlendShaderGLSL and fastuidraw::glsl::PainterBrushShaderGLSL. More...

Classes

struct  fastuidraw_compute_image_atlas_coord_type
 Structure to give information about what tile and where within a tile an image texel is located. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined. More...
 
struct  fastuidraw_dashed_stroking_params_header
 
struct  fastuidraw_image_extended_info_type
 Structure that fully describes a fastuidraw::Image or a sub-image of one. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined. More...
 
struct  fastuidraw_image_info_type
 Structure that describes the relationship between the master index tile and the color tiles of an image. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined. More...
 
struct  fastuidraw_image_texture_gather_output_type
 Structure that holds the 2x2 texel block. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined. More...
 
struct  fastuidraw_stroking_params
 

Macros

#define FASTUIDRAW_BINDLESS_HANDLE_128U
 
#define FASTUIDRAW_BINDLESS_HANDLE_UVEC2
 
#define fastuidraw_colorStopFetch(x, L)
 
#define FASTUIDRAW_EXTRACT_BITS(bit0, num_bits, src)   fastuidraw_extract_bits(uint(bit0), uint(num_bits), uint(src))
 
#define fastuidraw_fetch_data(X)
 
#define fastuidraw_fetch_glyph_data(X)
 
#define fastuidraw_fetch_glyph_data_fp16x2(X)
 
#define FASTUIDRAW_IMAGE_ATLAS_COLOR_TILE_LOG2_SIZE
 
#define FASTUIDRAW_IMAGE_ATLAS_COLOR_TILE_RECIP_SIZE
 
#define FASTUIDRAW_IMAGE_ATLAS_COLOR_TILE_SIZE
 
#define FASTUIDRAW_IMAGE_ATLAS_DISABLED
 
#define FASTUIDRAW_IMAGE_ATLAS_INDEX_TILE_LOG2_SIZE
 
#define FASTUIDRAW_IMAGE_ATLAS_INDEX_TILE_RECIP_SIZE
 
#define FASTUIDRAW_IMAGE_ATLAS_INDEX_TILE_SIZE
 
#define FASTUIDRAW_PAINTER_NUMBER_CONTEXT_TEXTURES
 
#define FASTUIDRAW_SUPPORT_BINDLESS_TEXTURE
 

Functions

float fastuidraw_anisotropic_coverage (float d, float dx, float dy)
 computes anisotropic coverage from a coverage value and its screen-space derivatives More...
 
vec2 fastuidraw_circular_interpolate (in vec2 v0, in vec2 v1, in float d, in float interpolate)
 compute interpolation along a circle. More...
 
float fastuidraw_compute_clamp_spread (float t)
 compute clamp spread pattern on [0, 1]
 
float fastuidraw_compute_clamp_spread (float t, float range)
 compute clamp spread pattern on [0, range]
 
float fastuidraw_compute_clamp_spread (float t, float begin_range, float end_range)
 compute clamp spread pattern on [begin_range, end_range]
 
void fastuidraw_compute_image_atlas_coord (in vec2 master_tile_texel_coord, in uint index_layer, in uint num_levels, out fastuidraw_compute_image_atlas_coord_type return_value)
 
void fastuidraw_compute_image_atlas_coord (in vec2 image_texel_coordinate, in fastuidraw_image_extended_info_type image_info, out fastuidraw_compute_image_atlas_coord_type return_value)
 
vec2 fastuidraw_compute_image_coordinate (in vec2 master_tile_tex_coord, in fastuidraw_image_extended_info_type image_info)
 
void fastuidraw_compute_image_info (in uint num_levels, out fastuidraw_image_info_type d)
 
vec2 fastuidraw_compute_master_index_tile_coordinate (in vec2 image_coordinate, in fastuidraw_image_extended_info_type image_info)
 
float fastuidraw_compute_mirror_repeat_spread (float t)
 compute mirror-repeat spread pattern on [0, 1]
 
float fastuidraw_compute_mirror_repeat_spread (float t, float range)
 compute mirror-repeat spread pattern on [0, range]
 
float fastuidraw_compute_mirror_repeat_spread (float t, float begin_range, float end_range)
 compute mirror-repeat spread pattern on [begin_range, end_range]
 
float fastuidraw_compute_mirror_spread (float t)
 compute mirror spread pattern on [0, 1]
 
float fastuidraw_compute_mirror_spread (float t, float range)
 compute mirror spread pattern on [0, range]
 
float fastuidraw_compute_mirror_spread (float t, float begin_range, float end_range)
 compute mirror spread pattern on [begin_range, end_range]
 
float fastuidraw_compute_repeat_spread (float t)
 compute repeat spread pattern on [0, 1]
 
float fastuidraw_compute_repeat_spread (float t, float range)
 compute repeat spread pattern on [0, range]
 
float fastuidraw_compute_repeat_spread (float t, float begin_range, float end_range)
 compute repeat spread pattern on [begin_range, end_range]
 
vec2 fastuidraw_compute_root_image_coordinate (in vec2 master_tile_tex_coord, in fastuidraw_image_info_type image_info)
 
vec4 fastuidraw_cubic_filter_atlas_image (in vec2 image_coordinate, in fastuidraw_image_extended_info_type image_info)
 
vec4 fastuidraw_cubic_filter_texture (in sampler2D surface, in vec2 texel_coord)
 Peform cubic filtering on a sampler2D. More...
 
void fastuidraw_do_nothing (void)
 
uint fastuidraw_extract_bits (uint bit0, uint num_bits, uint src)
 
void fastuidraw_image_atlas_compute_tile_range (in float root_image_coordinate, out float tile_min_dist, out float tile_max_dist)
 
void fastuidraw_image_atlas_compute_tile_range (in vec2 root_image_coord, out vec2 tile_min_dist, out vec2 tile_max_dist)
 
vec2 fastuidraw_image_coordinate_clamp_for_cubic_filtering (in vec2 image_coordinate, in fastuidraw_image_extended_info_type image_info)
 
vec2 fastuidraw_image_coordinate_clamp_for_linear_filtering (in vec2 image_coordinate, in fastuidraw_image_extended_info_type image_info, float pow2_lod)
 
vec2 fastuidraw_image_coordinate_clamp_for_nearest_filtering (in vec2 image_coordinate, in fastuidraw_image_extended_info_type image_info)
 
vec4 fastuidraw_linear_filter_atlas_image (in vec2 master_tile_texel_coord, in uint index_layer, in fastuidraw_image_info_type image_info, in int lod_i, in float lod_factor)
 
vec4 fastuidraw_linear_filter_atlas_image (in vec2 image_coordinate, in fastuidraw_image_extended_info_type image_info, in int lod_i)
 
vec4 fastuidraw_linear_filter_texture (in sampler2D surface, in vec2 texel_coord, in float lod)
 Peform linear filtering on a sampler2D. More...
 
vec4 fastuidraw_nearest_filter_atlas_image (in vec2 image_texel_coordinate, in fastuidraw_image_extended_info_type image_info, in float lod)
 
vec4 fastuidraw_nearest_filter_texture (in sampler2D surface, in vec2 texel_coord, in float lod)
 Peform nearest filtering on a sampler2D. More...
 
void fastuidraw_read_dashed_stroking_params_header (in uint location, out fastuidraw_dashed_stroking_params_header p)
 
void fastuidraw_read_stroking_params (in uint location, out fastuidraw_stroking_params p)
 
uint fastuidraw_read_texel_from_data (in ivec2 coord, in uvec2 dims, in uint location)
 Read 8-bit texel data from 32-bit linear data as packed into a fastuidraw::GlyphAtlas by fastuidraw::GlyphRenderDataTexels. More...
 
vec2 fastuidraw_unpack_unit_vector (float x, uint b)
 unpack a unit vector More...
 

Variables

uniform sampler2D fastuidraw_context_texture [FASTUIDRAW_PAINTER_NUMBER_CONTEXT_TEXTURES]
 
uniform sampler2DArray fastuidraw_imageAtlasLinear
 
uniform sampler2DArray fastuidraw_imageAtlasNearest
 
uniform usampler2DArray fastuidraw_imageIndexAtlas
 

Detailed Description

This group documents the GLSL functions fastuidraw makes available to GLSL code fragments for both vertex and fragment shading for custom shading as embodied by the classes fastuidraw::glsl::PainterItemShaderGLSL, fastuidraw::glsl::PainterBlendShaderGLSL and fastuidraw::glsl::PainterBrushShaderGLSL.

Macro Definition Documentation

◆ FASTUIDRAW_BINDLESS_HANDLE_128U

#define FASTUIDRAW_BINDLESS_HANDLE_128U

If this macro is defined, then bindless texturing is supported (see FASTUIDRAW_SUPPORT_BINDLESS_TEXTURE) and the 64-bit handle from which to construct sampler handles is realized as a uint64_t.

Definition at line 69 of file fastuidraw_painter_uniforms.glsl.hpp.

◆ FASTUIDRAW_BINDLESS_HANDLE_UVEC2

#define FASTUIDRAW_BINDLESS_HANDLE_UVEC2

If this macro is defined, then bindless texturing is supported (see FASTUIDRAW_SUPPORT_BINDLESS_TEXTURE) and the 64-bit handle from which to construct sampler handles is realized as a uvec2 where the low 32-bits are in the .x component and the high 32-bits are in the .y component.

Definition at line 60 of file fastuidraw_painter_uniforms.glsl.hpp.

◆ fastuidraw_colorStopFetch

#define fastuidraw_colorStopFetch (   x,
 
)

Use this macro to read a color value from the colorstop atlas (see fastuidraw::ColorStopAtlas). Recall that colorstops are stored as part of a GL_TEXTURE_1D_ARRAY or GL_TEXTURE_2D_ARRAY and that the interpolation of the color is to be handled by the the sampler.

Parameters
xtexture coordinate (i.e. normalized to [0, 1]) to read from the atlas
Lwhich layer to read from the atlas

Definition at line 34 of file fastuidraw_atlases.glsl.hpp.

◆ FASTUIDRAW_EXTRACT_BITS

#define FASTUIDRAW_EXTRACT_BITS (   bit0,
  num_bits,
  src 
)    fastuidraw_extract_bits(uint(bit0), uint(num_bits), uint(src))

Macro that wraps fastuidraw_extract_bits() so that each argument is casted into a uint.

Parameters
bit0starting bit from which to unpack
num_bitsnumber bits to unpack
srcvalue from which to unpack

Definition at line 43 of file fastuidraw_bit_utils.glsl.hpp.

◆ fastuidraw_fetch_data

#define fastuidraw_fetch_data (   X)

Use this macro to fetch a single 128-bit value from the data store bufferrealized as a uvec4. To get floating point data, use the GLSL built-in function uintBitsToFloat().

Parameters
Xoffset into data store buffer

Definition at line 78 of file fastuidraw_painter_uniforms.glsl.hpp.

◆ fastuidraw_fetch_glyph_data

#define fastuidraw_fetch_glyph_data (   X)

Use this macro to read a single 32-bit value from the glyph atlas (fastuidraw::GlyphAtlas).

Parameters
Xoffset into the glyph atlas to read

Definition at line 63 of file fastuidraw_atlases.glsl.hpp.

◆ fastuidraw_fetch_glyph_data_fp16x2

#define fastuidraw_fetch_glyph_data_fp16x2 (   X)

Use this macro to read a single 32-bit value from the glyph atlas (fastuidraw::GlyphAtlas) interpreted as a vec2 of 16-bit floats.

Parameters
Xoffset into the glyph atlas to read

Definition at line 71 of file fastuidraw_atlases.glsl.hpp.

◆ FASTUIDRAW_IMAGE_ATLAS_COLOR_TILE_LOG2_SIZE

#define FASTUIDRAW_IMAGE_ATLAS_COLOR_TILE_LOG2_SIZE

The log2 of size of the color tiles (as an uint).

Definition at line 53 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ FASTUIDRAW_IMAGE_ATLAS_COLOR_TILE_RECIP_SIZE

#define FASTUIDRAW_IMAGE_ATLAS_COLOR_TILE_RECIP_SIZE

The reciprocal of size of the color tiles (as a float). Value is always a power of 2.

Definition at line 47 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ FASTUIDRAW_IMAGE_ATLAS_COLOR_TILE_SIZE

#define FASTUIDRAW_IMAGE_ATLAS_COLOR_TILE_SIZE

The size of the color tiles (as an uint), i.e. fastuidraw::ImageAtlas::color_tile_size(). Value is always a power of 2.

Definition at line 40 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ FASTUIDRAW_IMAGE_ATLAS_DISABLED

#define FASTUIDRAW_IMAGE_ATLAS_DISABLED

If FASTUIDRAW_IMAGE_ATLAS_DISABLED is defined by the GLSL preamble generated by fastuidraw, then images backed by an atlas (i.e. fastuidraw::Image::type() is fastuidraw::Image::on_atlas) do not occur and are not supported.

Definition at line 33 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ FASTUIDRAW_IMAGE_ATLAS_INDEX_TILE_LOG2_SIZE

#define FASTUIDRAW_IMAGE_ATLAS_INDEX_TILE_LOG2_SIZE

The log2 of size of the index tiles (as an uint).

Definition at line 72 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ FASTUIDRAW_IMAGE_ATLAS_INDEX_TILE_RECIP_SIZE

#define FASTUIDRAW_IMAGE_ATLAS_INDEX_TILE_RECIP_SIZE

The reciprocal of size of the index tiles (as a float)

Definition at line 66 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ FASTUIDRAW_IMAGE_ATLAS_INDEX_TILE_SIZE

#define FASTUIDRAW_IMAGE_ATLAS_INDEX_TILE_SIZE

The size of the index tiles, i.e. fastuidraw::ImageAtlas::index_tile_size(). Value is always a power of 2.

Definition at line 60 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ FASTUIDRAW_PAINTER_NUMBER_CONTEXT_TEXTURES

#define FASTUIDRAW_PAINTER_NUMBER_CONTEXT_TEXTURES

The maximum number of simutaneous bound textures that the shader supports, i.e. the value of fastuidraw::PainterEngine::ConfigurationBase::number_context_textures().

Definition at line 30 of file fastuidraw_painter_uniforms.glsl.hpp.

◆ FASTUIDRAW_SUPPORT_BINDLESS_TEXTURE

#define FASTUIDRAW_SUPPORT_BINDLESS_TEXTURE

If this macro is defined, then bindless texturing is supported. Bindless texturing allows one to create sampler object handles from 64-bit uint data. See FASTUIDRAW_BINDLESS_HANDLE_UVEC2 and FASTUIDRAW_BINDLESS_HANDLE_128U for how the GLSL implementation realizes the 64-bit handle values.

Definition at line 50 of file fastuidraw_painter_uniforms.glsl.hpp.

Function Documentation

◆ fastuidraw_anisotropic_coverage()

float fastuidraw_anisotropic_coverage ( float  d,
float  dx,
float  dy 
)

computes anisotropic coverage from a coverage value and its screen-space derivatives

Parameters
dcoverage value
dxderivative in x-direction of coverage value
dyderivative in y-direction of coverage value

Definition at line 32 of file fastuidraw_anisotropic.frag.glsl.hpp.

◆ fastuidraw_circular_interpolate()

vec2 fastuidraw_circular_interpolate ( in vec2  v0,
in vec2  v1,
in float  d,
in float  interpolate 
)

compute interpolation along a circle.

Parameters
v0starting point on circle, must have unit length
v1end point on circle, must have unit length
dthe cosine of the angle (in radians) between v0 and v1, i.e. the value of dot(v0, v1).
interpolatevalue in range [0, 1] providing the interpolate of the interpolation

Definition at line 31 of file fastuidraw_circular_interpolate.glsl.hpp.

◆ fastuidraw_compute_image_atlas_coord() [1/2]

void fastuidraw_compute_image_atlas_coord ( in vec2  master_tile_texel_coord,
in uint  index_layer,
in uint  num_levels,
out fastuidraw_compute_image_atlas_coord_type  return_value 
)

Computes the image-atlas coordinate. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined.

Parameters
master_tile_texel_coordunnormalized texel coordinate of within the master-index tile
index_layerwhat layer from the index-atlas the master tile is located at
num_levelsnumber of index levels needed to reach the color-tile
return_valuelocation to which to write values

Definition at line 464 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_compute_image_atlas_coord() [2/2]

void fastuidraw_compute_image_atlas_coord ( in vec2  image_texel_coordinate,
in fastuidraw_image_extended_info_type  image_info,
out fastuidraw_compute_image_atlas_coord_type  return_value 
)

Computes the image-atlas coordinate. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined.

Parameters
image_texel_coordinateimage texel coordinate relative to the sub-image described by image_info
image_infoinformation of the image
return_valuelocation to which to write values

Definition at line 487 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_compute_image_coordinate()

vec2 fastuidraw_compute_image_coordinate ( in vec2  master_tile_tex_coord,
in fastuidraw_image_extended_info_type  image_info 
)

Computes the sub-image-texel coordinate from a master-tile texel coordinate. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined.

Parameters
master_tile_tex_coordinterpolated value of fastuidraw::Image::master_index_tile().xy
image_infoinformation of the image

Definition at line 314 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_compute_image_info()

void fastuidraw_compute_image_info ( in uint  num_levels,
out fastuidraw_image_info_type  d 
)

Given the number of levels of an fastuidraw::Image with fastuidraw::Image::type() being fastuidraw::Image::on_atlas, compute the fastuidraw_image_info_type. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined.

Parameters
num_levelsvalue of fastuidraw::Image::number_index_lookups()
dlocation to which to write the results

Definition at line 197 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_compute_master_index_tile_coordinate()

vec2 fastuidraw_compute_master_index_tile_coordinate ( in vec2  image_coordinate,
in fastuidraw_image_extended_info_type  image_info 
)

Computes the the master-tile texel coordinate from a sub-image-texel coordinate. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined.

Parameters
image_coordinatetexel coordinate relative to the sub-image described by image_info
image_infoinformation of the image

Definition at line 332 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_compute_root_image_coordinate()

vec2 fastuidraw_compute_root_image_coordinate ( in vec2  master_tile_tex_coord,
in fastuidraw_image_info_type  image_info 
)

Given a master_tile_tex_coord value, compute the image coordinate relate to the actual fastuidraw::Image (not a sub-image as tracked by fastuidraw_image_extended_info_type additional fields). Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined.

Parameters
master_tile_tex_coordinterpolated value of fastuidraw::Image::master_index_tile().xy
image_infoinfomration of the image

Definition at line 242 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_cubic_filter_atlas_image()

vec4 fastuidraw_cubic_filter_atlas_image ( in vec2  image_coordinate,
in fastuidraw_image_extended_info_type  image_info 
)

Perform cubic filtering sampling on a sub-image. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined.

Parameters
image_coordinatetexel coordinate relative to the sub-image specified by image_info
image_infodescribes the fastuidraw::Image and the sub-image within it to sample

Definition at line 743 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_cubic_filter_texture()

vec4 fastuidraw_cubic_filter_texture ( in sampler2D  surface,
in vec2  texel_coord 
)

Peform cubic filtering on a sampler2D.

Parameters
surfacethe surface from which to sample
texel_coordthe texel coordinate (not texture coordinate), i.e. the coordinate in pixels from which to sample

Definition at line 83 of file fastuidraw_texture_fetch.glsl.hpp.

◆ fastuidraw_do_nothing()

void fastuidraw_do_nothing ( void  )

Function that does nothing (i.e. utterly empty implementation contents).

Definition at line 51 of file fastuidraw_bit_utils.glsl.hpp.

◆ fastuidraw_extract_bits()

uint fastuidraw_extract_bits ( uint  bit0,
uint  num_bits,
uint  src 
)

Utility function to extract bits from an uint value

Parameters
bit0starting bit from which to unpack
num_bitsnumber bits to unpack
srcvalue from which to unpack

Definition at line 30 of file fastuidraw_bit_utils.glsl.hpp.

◆ fastuidraw_image_atlas_compute_tile_range() [1/2]

void fastuidraw_image_atlas_compute_tile_range ( in float  root_image_coordinate,
out float  tile_min_dist,
out float  tile_max_dist 
)

Gives the signed distance from an image coordinate value to the tile boundary. NOTE! the input value is the image coordinate within a fastuidraw::Image, not a sub-image.

Parameters
root_image_coordinatetexel coordinate within a fastuidraw::Image; an image coordinate within a partial image is not useful.
[out]tile_min_distsigned distance, in image texels, to min-side of tile
[out]tile_max_distsigned distance, in image texels, to max-side of tile

Definition at line 274 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_image_atlas_compute_tile_range() [2/2]

void fastuidraw_image_atlas_compute_tile_range ( in vec2  root_image_coord,
out vec2  tile_min_dist,
out vec2  tile_max_dist 
)

Gives the signed distance from an image coordinate value to the tile boundary. NOTE! the input value is the image coordinate within a fastuidraw::Image, not a sub-image. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined.

Parameters
root_image_coordtexel coordinate within a fastuidraw::Image; an image coordinate within a partial image is not useful.
[out]tile_min_distsigned distance, in image texels, to min-side of tile
[out]tile_max_distsigned distance, in image texels, to max-side of tile

Definition at line 299 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_image_coordinate_clamp_for_cubic_filtering()

vec2 fastuidraw_image_coordinate_clamp_for_cubic_filtering ( in vec2  image_coordinate,
in fastuidraw_image_extended_info_type  image_info 
)

Clamps a image texel coordinate for cubic filtering. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined.

Parameters
image_coordinatetexel coordinate relative to the sub-image described by image_info
image_infoinformation of the image

Definition at line 380 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_image_coordinate_clamp_for_linear_filtering()

vec2 fastuidraw_image_coordinate_clamp_for_linear_filtering ( in vec2  image_coordinate,
in fastuidraw_image_extended_info_type  image_info,
float  pow2_lod 
)

Clamps a image texel coordinate for linear filtering. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined.

Parameters
image_coordinatetexel coordinate relative to the sub-image described by image_info
image_infoinformation of the image
pow2_lodpow2 of lod parameter

Definition at line 364 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_image_coordinate_clamp_for_nearest_filtering()

vec2 fastuidraw_image_coordinate_clamp_for_nearest_filtering ( in vec2  image_coordinate,
in fastuidraw_image_extended_info_type  image_info 
)

Clamps a image texel coordinate for nearest filtering. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined.

Parameters
image_coordinatetexel coordinate relative to the sub-image described by image_info
image_infoinformation of the image

Definition at line 350 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_linear_filter_atlas_image() [1/2]

vec4 fastuidraw_linear_filter_atlas_image ( in vec2  master_tile_texel_coord,
in uint  index_layer,
in fastuidraw_image_info_type  image_info,
in int  lod_i,
in float  lod_factor 
)

Perform linear filtering sampling on a sub-image. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined.

Parameters
master_tile_texel_coordunnormalized texel coordinate of within the master-index tile
index_layerwhat layer from the index-atlas the master tile is located at
image_infoinformation of image
lod_iwhich mipmap level to take (level = 0 is the base image)
lod_factorthe value of pow2(lod_i)

Definition at line 634 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_linear_filter_atlas_image() [2/2]

vec4 fastuidraw_linear_filter_atlas_image ( in vec2  image_coordinate,
in fastuidraw_image_extended_info_type  image_info,
in int  lod_i 
)

Perform linear filtering sampling on a sub-image. Only available if FASTUIDRAW_IMAGE_ATLAS_DISABLED is not defined.

Parameters
image_coordinatetexel coordinate relative to the sub-image specified by image_info
image_infodescribes the fastuidraw::Image and the sub-image within it to sample
lod_iwhich mipmap level to take (level = 0 is the base image)

Definition at line 710 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_linear_filter_texture()

vec4 fastuidraw_linear_filter_texture ( in sampler2D  surface,
in vec2  texel_coord,
in float  lod 
)

Peform linear filtering on a sampler2D.

Parameters
surfacethe surface from which to sample
texel_coordthe texel coordinate (not texture coordinate), i.e. the coordinate in pixels from which to sample
lodthe level of detail (ala textureLod() of glsl)

Definition at line 70 of file fastuidraw_texture_fetch.glsl.hpp.

◆ fastuidraw_nearest_filter_atlas_image()

vec4 fastuidraw_nearest_filter_atlas_image ( in vec2  image_texel_coordinate,
in fastuidraw_image_extended_info_type  image_info,
in float  lod 
)

Perform nearest filtering sampling on a sub-image

Parameters
image_texel_coordinateimage texel coordinate relative to the sub-image described by image_info
image_infoinformation of the image
lodmipmap-lod (i.e. same value as one would feed textureLod)

Definition at line 609 of file fastuidraw_atlas_image_fetch.glsl.hpp.

◆ fastuidraw_nearest_filter_texture()

vec4 fastuidraw_nearest_filter_texture ( in sampler2D  surface,
in vec2  texel_coord,
in float  lod 
)

Peform nearest filtering on a sampler2D.

Parameters
surfacethe surface from which to sample
texel_coordthe texel coordinate (not texture coordinate), i.e. the coordinate in pixels from which to sample
lodthe level of detail (ala textureLod() of glsl)

Definition at line 52 of file fastuidraw_texture_fetch.glsl.hpp.

◆ fastuidraw_read_dashed_stroking_params_header()

void fastuidraw_read_dashed_stroking_params_header ( in uint  location,
out fastuidraw_dashed_stroking_params_header  p 
)

Unpack the values of fastuidraw_dashed_stroking_params_header from the data store buffer.

Parameters
locationoffset (in units of uvec4's) into data store buffer
[out]punpack value destination

◆ fastuidraw_read_stroking_params()

void fastuidraw_read_stroking_params ( in uint  location,
out fastuidraw_stroking_params  p 
)

Unpack the values of fastuidraw_stroking_params from the data store buffer.

Parameters
locationoffset (in units of uvec4's) into data store buffer
[out]punpack value destination

◆ fastuidraw_read_texel_from_data()

uint fastuidraw_read_texel_from_data ( in ivec2  coord,
in uvec2  dims,
in uint  location 
)

Read 8-bit texel data from 32-bit linear data as packed into a fastuidraw::GlyphAtlas by fastuidraw::GlyphRenderDataTexels.

Parameters
coordtexel coordinate to read
dimsdimension of texel data (i.e. fastuidraw::GlyphRenderDataTexels::resolution())
locationlocation into fastuidraw::GlyphAtlas of the data

Definition at line 32 of file fastuidraw_read_texels_from_data.glsl.hpp.

◆ fastuidraw_unpack_unit_vector()

vec2 fastuidraw_unpack_unit_vector ( float  x,
uint  b 
)

unpack a unit vector

Parameters
xx-coordinate value of unit vector
bif b is non-zero, indicates that y-coordinate is negative

Definition at line 29 of file fastuidraw_unpack_unit_vector.glsl.hpp.

Variable Documentation

◆ fastuidraw_context_texture

uniform sampler2D fastuidraw_context_texture[FASTUIDRAW_PAINTER_NUMBER_CONTEXT_TEXTURES]

The array of fastuidraw::Image objects whose fastuidraw::Image::type() has value fastuidraw::Image::context_texture2d that are currently bound. For fastuidraw::PainterBrush if it has such an image, it is always bound to fastuidraw_context_texture[0] and for fastuidraw::PainterBrushShaderData, the i'th index into fastuidraw::PainterBrushShaderData is bound to fastuidraw_context_texture[i]

Definition at line 40 of file fastuidraw_painter_uniforms.glsl.hpp.

◆ fastuidraw_imageAtlasLinear

uniform sampler2DArray fastuidraw_imageAtlasLinear

The sampler2Darray that backs the color tiles of the image atlas (fastuidraw::ImageAtlas) whose magnification filtering is set to GL_LINEAR and whose minification filtering is set to GL_LINEAR_MIPMAP_NEAREST.

Definition at line 42 of file fastuidraw_atlases.glsl.hpp.

◆ fastuidraw_imageAtlasNearest

uniform sampler2DArray fastuidraw_imageAtlasNearest

The sampler2Darray that backs the color tiles of the image atlas (fastuidraw::ImageAtlas) whose magnification and minification filtering are set to GL_NEAREST.

Definition at line 49 of file fastuidraw_atlases.glsl.hpp.

◆ fastuidraw_imageIndexAtlas

uniform usampler2DArray fastuidraw_imageIndexAtlas

The usampler2DArray that backes index tiles of the image atlas (fastuidraw::ImageAtlas).

Definition at line 55 of file fastuidraw_atlases.glsl.hpp.