UBO consolidation (#3089)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Alex Cristici
2025-01-08 17:41:29 +02:00
committed by GitHub
parent cf9f41cf61
commit f582327191
262 changed files with 6968 additions and 6928 deletions

View File

@@ -1,7 +1,9 @@
layout (std140) uniform BackgroundLayerUBO {
layout (std140) uniform BackgroundPropsUBO {
highp vec4 u_color;
highp float u_opacity;
highp float layer_pad1, layer_pad2, layer_pad3;
lowp float props_pad1;
lowp float props_pad2;
lowp float props_pad3;
};
void main() {

View File

@@ -6,10 +6,11 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform BackgroundPatternLayerUBO {
layout (std140) uniform BackgroundPatternPropsUBO {
highp vec2 u_pattern_tl_a;
highp vec2 u_pattern_br_a;
highp vec2 u_pattern_tl_b;

View File

@@ -3,9 +3,12 @@ layout (std140) uniform BackgroundPatternDrawableUBO {
highp vec2 u_pixel_coord_upper;
highp vec2 u_pixel_coord_lower;
highp float u_tile_units_to_pixels;
highp float drawable_pad1, drawable_pad2, drawable_pad3;
lowp float drawable_pad1;
lowp float drawable_pad2;
lowp float drawable_pad3;
};
layout (std140) uniform BackgroundPatternLayerUBO {
layout (std140) uniform BackgroundPatternPropsUBO {
highp vec2 u_pattern_tl_a;
highp vec2 u_pattern_br_a;
highp vec2 u_pattern_tl_b;

View File

@@ -9,13 +9,24 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform CircleDrawableUBO {
highp mat4 u_matrix;
highp vec2 u_extrude_scale;
lowp vec2 drawable_pad1;
// Interpolations
lowp float u_color_t;
lowp float u_radius_t;
lowp float u_blur_t;
lowp float u_opacity_t;
lowp float u_stroke_color_t;
lowp float u_stroke_width_t;
lowp float u_stroke_opacity_t;
lowp float drawable_pad1;
lowp float drawable_pad2;
lowp float drawable_pad3;
};
layout (std140) uniform CircleEvaluatedPropsUBO {
@@ -31,17 +42,6 @@ layout (std140) uniform CircleEvaluatedPropsUBO {
lowp float props_pad1;
};
layout (std140) uniform CircleInterpolateUBO {
lowp float u_color_t;
lowp float u_radius_t;
lowp float u_blur_t;
lowp float u_opacity_t;
lowp float u_stroke_color_t;
lowp float u_stroke_width_t;
lowp float u_stroke_opacity_t;
lowp float interp_pad1;
};
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur

View File

@@ -1,10 +1,3 @@
layout (std140) uniform CollisionUBO {
highp mat4 u_matrix;
highp vec2 u_extrude_scale;
highp float u_overscale_factor;
highp float pad1;
};
in float v_placed;
in float v_notUsed;

View File

@@ -12,14 +12,18 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform CollisionUBO {
layout (std140) uniform CollisionDrawableUBO {
highp mat4 u_matrix;
};
layout (std140) uniform CollisionTilePropsUBO {
highp vec2 u_extrude_scale;
highp float u_overscale_factor;
highp float pad1;
lowp float drawable_pad1;
};
out float v_placed;

View File

@@ -6,14 +6,14 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform CollisionUBO {
highp mat4 u_matrix;
layout (std140) uniform CollisionTilePropsUBO {
highp vec2 u_extrude_scale;
highp float u_overscale_factor;
highp float pad1;
lowp float drawable_pad1;
};
in float v_placed;

View File

@@ -11,14 +11,18 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform CollisionUBO {
layout (std140) uniform CollisionDrawableUBO {
highp mat4 u_matrix;
};
layout (std140) uniform CollisionTilePropsUBO {
highp vec2 u_extrude_scale;
highp float u_overscale_factor;
highp float pad1;
lowp float drawable_pad1;
};
out float v_placed;

View File

@@ -3,9 +3,6 @@ layout(location = 1) in vec2 a_tex;
layout(std140) uniform CustomSymbolIconDrawableUBO {
highp mat4 u_matrix;
};
layout(std140) uniform CustomSymbolIconParametersUBO {
highp vec2 u_extrude_scale;
highp vec2 u_anchor;
highp float u_angle_degrees;
@@ -13,7 +10,9 @@ layout(std140) uniform CustomSymbolIconParametersUBO {
bool u_pitch_with_map;
highp float u_camera_to_center_distance;
highp float u_aspect_ratio;
highp float params_pad1, params_pad2, params_pad3;
lowp float drawable_pad1;
lowp float drawable_pad2;
lowp float drawable_pad3;
};
out vec2 v_tex;

View File

@@ -2,9 +2,9 @@ layout (std140) uniform DebugUBO {
highp mat4 u_matrix;
highp vec4 u_color;
highp float u_overlay_scale;
highp float pad1;
highp float pad2;
highp float pad3;
lowp float pad1;
lowp float pad2;
lowp float pad3;
};
uniform sampler2D u_overlay;

View File

@@ -5,9 +5,9 @@ layout (std140) uniform DebugUBO {
highp mat4 u_matrix;
highp vec4 u_color;
highp float u_overlay_scale;
highp float pad1;
highp float pad2;
highp float pad3;
lowp float pad1;
lowp float pad2;
lowp float pad3;
};
void main() {

View File

@@ -1,8 +1,3 @@
layout (std140) uniform FillInterpolateUBO {
highp float u_color_t;
highp float u_opacity_t;
highp float interp_pad1, interp_pad2;
};
layout (std140) uniform FillEvaluatedPropsUBO {
highp vec4 u_color;
highp vec4 u_outline_color;

View File

@@ -1,11 +1,12 @@
layout (std140) uniform FillDrawableUBO {
highp mat4 u_matrix;
};
layout (std140) uniform FillInterpolateUBO {
// Interpolations
highp float u_color_t;
highp float u_opacity_t;
highp float interp_pad1, interp_pad2;
lowp float drawable_pad1;
lowp float drawable_pad2;
};
layout (std140) uniform FillEvaluatedPropsUBO {
highp vec4 u_color;
highp vec4 u_outline_color;

View File

@@ -4,16 +4,31 @@ out vec4 v_color;
layout (std140) uniform FillExtrusionDrawableUBO {
highp mat4 u_matrix;
highp vec2 u_texsize;
highp vec2 u_pixel_coord_upper;
highp vec2 u_pixel_coord_lower;
highp float u_height_factor;
highp float u_tile_ratio;
// Interpolations
highp float u_base_t;
highp float u_height_t;
highp float u_color_t;
highp float u_pattern_from_t;
highp float u_pattern_to_t;
lowp float drawable_pad1;
};
layout (std140) uniform FillExtrusionTilePropsUBO {
highp vec4 u_pattern_from;
highp vec4 u_pattern_to;
highp vec2 u_texsize;
lowp float tileprops_pad1;
lowp float tileprops_pad2;
};
layout (std140) uniform FillExtrusionPropsUBO {
highp vec4 u_color;
highp vec3 u_lightcolor;
highp float props_pad1;
lowp float props_pad1;
highp vec3 u_lightpos;
highp float u_base;
highp float u_height;
@@ -23,20 +38,9 @@ layout (std140) uniform FillExtrusionPropsUBO {
highp float u_fade;
highp float u_from_scale;
highp float u_to_scale;
highp float props_pad2;
};
layout (std140) uniform FillExtrusionTilePropsUBO {
highp vec4 u_pattern_from;
highp vec4 u_pattern_to;
};
layout (std140) uniform FillExtrusionInterpolateUBO {
highp float u_base_t;
highp float u_height_t;
highp float u_color_t;
highp float u_pattern_from_t;
highp float u_pattern_to_t;
highp float interp_pad1, interp_pad2, interp_pad3;
lowp float props_pad2;
};
#pragma mapbox: define highp float base
#pragma mapbox: define highp float height
#pragma mapbox: define highp vec4 color

View File

@@ -2,18 +2,18 @@ in vec2 v_pos_a;
in vec2 v_pos_b;
in vec4 v_lighting;
layout (std140) uniform FillExtrusionDrawableUBO {
highp mat4 u_matrix;
layout (std140) uniform FillExtrusionTilePropsUBO {
highp vec4 u_pattern_from;
highp vec4 u_pattern_to;
highp vec2 u_texsize;
highp vec2 u_pixel_coord_upper;
highp vec2 u_pixel_coord_lower;
highp float u_height_factor;
highp float u_tile_ratio;
lowp float tileprops_pad1;
lowp float tileprops_pad2;
};
layout (std140) uniform FillExtrusionPropsUBO {
highp vec4 u_color;
highp vec3 u_lightcolor;
highp float props_pad1;
lowp float props_pad1;
highp vec3 u_lightpos;
highp float u_base;
highp float u_height;
@@ -23,19 +23,7 @@ layout (std140) uniform FillExtrusionPropsUBO {
highp float u_fade;
highp float u_from_scale;
highp float u_to_scale;
highp float props_pad2;
};
layout (std140) uniform FillExtrusionTilePropsUBO {
highp vec4 u_pattern_from;
highp vec4 u_pattern_to;
};
layout (std140) uniform FillExtrusionInterpolateUBO {
highp float u_base_t;
highp float u_height_t;
highp float u_color_t;
highp float u_pattern_from_t;
highp float u_pattern_to_t;
highp float interp_pad1, interp_pad2, interp_pad3;
lowp float props_pad2;
};
uniform sampler2D u_image;

View File

@@ -13,21 +13,37 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform FillExtrusionDrawableUBO {
highp mat4 u_matrix;
highp vec2 u_texsize;
highp vec2 u_pixel_coord_upper;
highp vec2 u_pixel_coord_lower;
highp float u_height_factor;
highp float u_tile_ratio;
// Interpolations
highp float u_base_t;
highp float u_height_t;
highp float u_color_t;
highp float u_pattern_from_t;
highp float u_pattern_to_t;
lowp float drawable_pad1;
};
layout (std140) uniform FillExtrusionTilePropsUBO {
highp vec4 u_pattern_from;
highp vec4 u_pattern_to;
highp vec2 u_texsize;
lowp float tileprops_pad1;
lowp float tileprops_pad2;
};
layout (std140) uniform FillExtrusionPropsUBO {
highp vec4 u_color;
highp vec3 u_lightcolor;
highp float props_pad1;
lowp float props_pad1;
highp vec3 u_lightpos;
highp float u_base;
highp float u_height;
@@ -37,19 +53,7 @@ layout (std140) uniform FillExtrusionPropsUBO {
highp float u_fade;
highp float u_from_scale;
highp float u_to_scale;
highp float props_pad2;
};
layout (std140) uniform FillExtrusionTilePropsUBO {
highp vec4 u_pattern_from;
highp vec4 u_pattern_to;
};
layout (std140) uniform FillExtrusionInterpolateUBO {
highp float u_base_t;
highp float u_height_t;
highp float u_color_t;
highp float u_pattern_from_t;
highp float u_pattern_to_t;
highp float interp_pad1, interp_pad2, interp_pad3;
lowp float props_pad2;
};
#pragma mapbox: define lowp float base

View File

@@ -1,9 +1,3 @@
layout (std140) uniform FillOutlineInterpolateUBO {
highp float u_outline_color_t;
highp float u_opacity_t;
highp float interp_pad1;
highp float interp_pad2;
};
layout (std140) uniform FillEvaluatedPropsUBO {
highp vec4 u_color;
highp vec4 u_outline_color;

View File

@@ -6,17 +6,19 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform FillOutlineDrawableUBO {
highp mat4 u_matrix;
};
layout (std140) uniform FillOutlineInterpolateUBO {
// Interpolations
highp float u_outline_color_t;
highp float u_opacity_t;
highp float interp_pad1;
highp float interp_pad2;
lowp float drawable_pad1;
lowp float drawable_pad2;
};
layout (std140) uniform FillEvaluatedPropsUBO {
highp vec4 u_color;
highp vec4 u_outline_color;

View File

@@ -1,21 +1,11 @@
layout (std140) uniform FillOutlinePatternDrawableUBO {
highp mat4 u_matrix;
highp vec2 u_pixel_coord_upper;
highp vec2 u_pixel_coord_lower;
highp vec2 u_texsize;
highp float u_tile_ratio;
highp float drawable_pad1;
};
layout (std140) uniform FillOutlinePatternTilePropsUBO {
highp vec4 u_pattern_from;
highp vec4 u_pattern_to;
highp vec2 u_texsize;
lowp float tileprops_pad1;
lowp float tileprops_pad2;
};
layout (std140) uniform FillOutlinePatternInterpolateUBO {
highp float u_pattern_from_t;
highp float u_pattern_to_t;
highp float u_opacity_t;
highp float interp_pad1;
};
layout (std140) uniform FillEvaluatedPropsUBO {
highp vec4 u_color;
highp vec4 u_outline_color;

View File

@@ -6,26 +6,29 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform FillOutlinePatternDrawableUBO {
highp mat4 u_matrix;
highp vec2 u_pixel_coord_upper;
highp vec2 u_pixel_coord_lower;
highp vec2 u_texsize;
highp float u_tile_ratio;
highp float drawable_pad1;
};
layout (std140) uniform FillOutlinePatternTilePropsUBO {
highp vec4 u_pattern_from;
highp vec4 u_pattern_to;
};
layout (std140) uniform FillOutlinePatternInterpolateUBO {
// Interpolations
highp float u_pattern_from_t;
highp float u_pattern_to_t;
highp float u_opacity_t;
highp float interp_pad1;
};
layout (std140) uniform FillOutlinePatternTilePropsUBO {
highp vec4 u_pattern_from;
highp vec4 u_pattern_to;
highp vec2 u_texsize;
lowp float tileprops_pad1;
lowp float tileprops_pad2;
};
layout (std140) uniform FillEvaluatedPropsUBO {
highp vec4 u_color;
highp vec4 u_outline_color;

View File

@@ -17,13 +17,18 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform FillOutlineTriangulatedDrawableUBO {
highp mat4 u_matrix;
mediump float u_ratio;
lowp float drawable_pad1, drawable_pad2, drawable_pad3;
lowp float drawable_pad1;
lowp float drawable_pad2;
lowp float drawable_pad3;
};
layout (std140) uniform FillEvaluatedPropsUBO {
highp vec4 u_color;
highp vec4 u_outline_color;

View File

@@ -1,21 +1,11 @@
layout (std140) uniform FillPatternDrawableUBO {
highp mat4 u_matrix;
highp vec2 u_pixel_coord_upper;
highp vec2 u_pixel_coord_lower;
highp vec2 u_texsize;
highp float u_tile_ratio;
highp float drawable_pad1;
};
layout (std140) uniform FillPatternTilePropsUBO {
highp vec4 u_pattern_from;
highp vec4 u_pattern_to;
highp vec2 u_texsize;
lowp float tileprops_pad1;
lowp float tileprops_pad2;
};
layout (std140) uniform FillPatternInterpolateUBO {
highp float u_pattern_from_t;
highp float u_pattern_to_t;
highp float u_opacity_t;
highp float interp_pad1;
};
layout (std140) uniform FillEvaluatedPropsUBO {
highp vec4 u_color;
highp vec4 u_outline_color;

View File

@@ -6,26 +6,29 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform FillPatternDrawableUBO {
highp mat4 u_matrix;
highp vec2 u_pixel_coord_upper;
highp vec2 u_pixel_coord_lower;
highp vec2 u_texsize;
highp float u_tile_ratio;
highp float drawable_pad1;
};
layout (std140) uniform FillPatternTilePropsUBO {
highp vec4 u_pattern_from;
highp vec4 u_pattern_to;
};
layout (std140) uniform FillPatternInterpolateUBO {
// Interpolations
highp float u_pattern_from_t;
highp float u_pattern_to_t;
highp float u_opacity_t;
highp float interp_pad1;
};
layout (std140) uniform FillPatternTilePropsUBO {
highp vec4 u_pattern_from;
highp vec4 u_pattern_to;
highp vec2 u_texsize;
lowp float tileprops_pad1;
lowp float tileprops_pad2;
};
layout (std140) uniform FillEvaluatedPropsUBO {
highp vec4 u_color;
highp vec4 u_outline_color;

View File

@@ -4,8 +4,10 @@ out vec2 v_extrude;
layout (std140) uniform HeatmapDrawableUBO {
highp mat4 u_matrix;
highp float u_extrude_scale;
// Interpolations
lowp float u_weight_t;
lowp float u_radius_t;
lowp float drawable_pad1;
lowp vec2 drawable_pad2;
};
layout (std140) uniform HeatmapEvaluatedPropsUBO {
@@ -15,12 +17,6 @@ layout (std140) uniform HeatmapEvaluatedPropsUBO {
lowp float props_pad1;
};
layout (std140) uniform HeatmapInterpolateUBO {
lowp float u_weight_t;
lowp float u_radius_t;
lowp vec2 interp_pad1;
};
#pragma mapbox: define highp float weight
#pragma mapbox: define mediump float radius

View File

@@ -5,7 +5,9 @@ uniform sampler2D u_color_ramp;
layout (std140) uniform HeatmapTexturePropsUBO {
highp mat4 u_matrix;
highp float u_opacity;
lowp float props_pad1, props_pad2, props_pad3;
lowp float props_pad1;
lowp float props_pad2;
lowp float props_pad3;
};
void main() {

View File

@@ -9,12 +9,16 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform HeatmapTexturePropsUBO {
highp mat4 u_matrix;
highp float u_opacity;
lowp float props_pad1, props_pad2, props_pad3;
lowp float props_pad1;
lowp float props_pad2;
lowp float props_pad3;
};
void main() {

View File

@@ -1,8 +1,7 @@
in vec2 v_pos;
uniform sampler2D u_image;
layout (std140) uniform HillshadeDrawableUBO {
highp mat4 u_matrix;
layout (std140) uniform HillshadeTilePropsUBO {
highp vec2 u_latrange;
highp vec2 u_light;
};

View File

@@ -3,8 +3,6 @@ layout (location = 1) in vec2 a_texture_pos;
layout (std140) uniform HillshadeDrawableUBO {
highp mat4 u_matrix;
highp vec2 u_latrange;
highp vec2 u_light;
};
out vec2 v_pos;

View File

@@ -5,8 +5,7 @@ precision highp float;
in vec2 v_pos;
uniform sampler2D u_image;
layout (std140) uniform HillshadePrepareDrawableUBO {
highp mat4 u_matrix;
layout (std140) uniform HillshadePrepareTilePropsUBO {
highp vec4 u_unpack;
highp vec2 u_dimension;
highp float u_zoom;

View File

@@ -3,6 +3,9 @@ layout (location = 1) in vec2 a_texture_pos;
layout (std140) uniform HillshadePrepareDrawableUBO {
highp mat4 u_matrix;
};
layout (std140) uniform HillshadePrepareTilePropsUBO {
highp vec4 u_unpack;
highp vec2 u_dimension;
highp float u_zoom;

View File

@@ -1,19 +1,3 @@
layout (std140) uniform LineDrawableUBO {
highp mat4 u_matrix;
mediump float u_ratio;
lowp float drawable_pad1, drawable_pad2, drawable_pad3;
};
layout (std140) uniform LineInterpolationUBO {
lowp float u_color_t;
lowp float u_blur_t;
lowp float u_opacity_t;
lowp float u_gapwidth_t;
lowp float u_offset_t;
lowp float u_width_t;
highp vec2 interp_pad1;
};
layout (std140) uniform LineEvaluatedPropsUBO {
highp vec4 u_color;
lowp float u_blur;
@@ -22,8 +6,8 @@ layout (std140) uniform LineEvaluatedPropsUBO {
lowp float u_offset;
mediump float u_width;
lowp float u_floorwidth;
highp float props_pad1;
highp float props_pad2;
lowp float props_pad1;
lowp float props_pad2;
};
in vec2 v_width2;

View File

@@ -17,23 +17,21 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform LineDrawableUBO {
highp mat4 u_matrix;
mediump float u_ratio;
lowp float drawable_pad1, drawable_pad2, drawable_pad3;
};
layout (std140) uniform LineInterpolationUBO {
// Interpolations
lowp float u_color_t;
lowp float u_blur_t;
lowp float u_opacity_t;
lowp float u_gapwidth_t;
lowp float u_offset_t;
lowp float u_width_t;
highp vec2 interp_pad1;
lowp float drawable_pad1;
};
layout (std140) uniform LineEvaluatedPropsUBO {
@@ -44,8 +42,8 @@ layout (std140) uniform LineEvaluatedPropsUBO {
lowp float u_offset;
mediump float u_width;
lowp float u_floorwidth;
highp float props_pad1;
highp float props_pad2;
lowp float props_pad1;
lowp float props_pad2;
};
out vec2 v_normal;

View File

@@ -1,19 +1,3 @@
layout (std140) uniform LineGradientDrawableUBO {
highp mat4 u_matrix;
mediump float u_ratio;
lowp float drawable_pad1, drawable_pad2, drawable_pad3;
};
layout (std140) uniform LineGradientInterpolationUBO {
lowp float u_blur_t;
lowp float u_opacity_t;
lowp float u_gapwidth_t;
lowp float u_offset_t;
lowp float u_width_t;
highp float interp_pad1;
highp vec2 interp_pad2;
};
layout (std140) uniform LineEvaluatedPropsUBO {
highp vec4 u_color;
lowp float u_blur;
@@ -22,8 +6,8 @@ layout (std140) uniform LineEvaluatedPropsUBO {
lowp float u_offset;
mediump float u_width;
lowp float u_floorwidth;
highp float props_pad1;
highp float props_pad2;
lowp float props_pad1;
lowp float props_pad2;
};
uniform sampler2D u_image;

View File

@@ -21,23 +21,21 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform LineGradientDrawableUBO {
highp mat4 u_matrix;
mediump float u_ratio;
lowp float drawable_pad1, drawable_pad2, drawable_pad3;
};
layout (std140) uniform LineGradientInterpolationUBO {
// Interpolations
lowp float u_blur_t;
lowp float u_opacity_t;
lowp float u_gapwidth_t;
lowp float u_offset_t;
lowp float u_width_t;
highp float interp_pad1;
highp vec2 interp_pad2;
lowp float drawable_pad1;
lowp float drawable_pad2;
};
layout (std140) uniform LineEvaluatedPropsUBO {
@@ -48,8 +46,8 @@ layout (std140) uniform LineEvaluatedPropsUBO {
lowp float u_offset;
mediump float u_width;
lowp float u_floorwidth;
highp float props_pad1;
highp float props_pad2;
lowp float props_pad1;
lowp float props_pad2;
};
out vec2 v_normal;

View File

@@ -1,25 +1,10 @@
layout (std140) uniform LinePatternDrawableUBO {
highp mat4 u_matrix;
mediump vec4 u_scale;
highp vec2 u_texsize;
mediump float u_ratio;
highp float u_fade;
};
layout (std140) uniform LinePatternInterpolationUBO {
lowp float u_blur_t;
lowp float u_opacity_t;
lowp float u_offset_t;
lowp float u_gapwidth_t;
lowp float u_width_t;
lowp float u_pattern_from_t;
lowp float u_pattern_to_t;
highp float interp_pad1;
};
layout (std140) uniform LinePatternTilePropertiesUBO {
layout (std140) uniform LinePatternTilePropsUBO {
lowp vec4 u_pattern_from;
lowp vec4 u_pattern_to;
mediump vec4 u_scale;
highp vec2 u_texsize;
highp float u_fade;
lowp float tileprops_pad1;
};
layout (std140) uniform LineEvaluatedPropsUBO {
@@ -30,8 +15,8 @@ layout (std140) uniform LineEvaluatedPropsUBO {
lowp float u_offset;
mediump float u_width;
lowp float u_floorwidth;
highp float props_pad1;
highp float props_pad2;
lowp float props_pad1;
lowp float props_pad2;
};
uniform sampler2D u_image;

View File

@@ -21,18 +21,13 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform LinePatternDrawableUBO {
highp mat4 u_matrix;
mediump vec4 u_scale;
highp vec2 u_texsize;
mediump float u_ratio;
highp float u_fade;
};
layout (std140) uniform LinePatternInterpolationUBO {
// Interpolations
lowp float u_blur_t;
lowp float u_opacity_t;
lowp float u_offset_t;
@@ -40,12 +35,15 @@ layout (std140) uniform LinePatternInterpolationUBO {
lowp float u_width_t;
lowp float u_pattern_from_t;
lowp float u_pattern_to_t;
highp float interp_pad1;
};
layout (std140) uniform LinePatternTilePropertiesUBO {
layout (std140) uniform LinePatternTilePropsUBO {
lowp vec4 u_pattern_from;
lowp vec4 u_pattern_to;
mediump vec4 u_scale;
highp vec2 u_texsize;
highp float u_fade;
lowp float tileprops_pad1;
};
layout (std140) uniform LineEvaluatedPropsUBO {
@@ -56,8 +54,8 @@ layout (std140) uniform LineEvaluatedPropsUBO {
lowp float u_offset;
mediump float u_width;
lowp float u_floorwidth;
highp float props_pad1;
highp float props_pad2;
lowp float props_pad1;
lowp float props_pad2;
};
out vec2 v_normal;

View File

@@ -1,25 +1,8 @@
layout (std140) uniform LineSDFDrawableUBO {
highp mat4 u_matrix;
highp vec2 u_patternscale_a;
highp vec2 u_patternscale_b;
mediump float u_ratio;
highp float u_tex_y_a;
highp float u_tex_y_b;
layout (std140) uniform LineSDFTilePropsUBO {
highp float u_sdfgamma;
highp float u_mix;
lowp float drawable_pad1, drawable_pad2, drawable_pad3;
};
layout (std140) uniform LineSDFInterpolationUBO {
lowp float u_color_t;
lowp float u_blur_t;
lowp float u_opacity_t;
lowp float u_gapwidth_t;
lowp float u_offset_t;
lowp float u_width_t;
lowp float u_floorwidth_t;
highp float interp_pad1;
lowp float tileprops_pad1;
lowp float tileprops_pad2;
};
layout (std140) uniform LineEvaluatedPropsUBO {
@@ -30,8 +13,8 @@ layout (std140) uniform LineEvaluatedPropsUBO {
lowp float u_offset;
mediump float u_width;
lowp float u_floorwidth;
highp float props_pad1;
highp float props_pad2;
lowp float props_pad1;
lowp float props_pad2;
};
uniform sampler2D u_image;

View File

@@ -21,22 +21,18 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform LineSDFDrawableUBO {
highp mat4 u_matrix;
highp vec2 u_patternscale_a;
highp vec2 u_patternscale_b;
mediump float u_ratio;
highp float u_tex_y_a;
highp float u_tex_y_b;
highp float u_sdfgamma;
highp float u_mix;
lowp float drawable_pad1, drawable_pad2, drawable_pad3;
};
layout (std140) uniform LineSDFInterpolationUBO {
mediump float u_ratio;
// Interpolations
lowp float u_color_t;
lowp float u_blur_t;
lowp float u_opacity_t;
@@ -44,7 +40,8 @@ layout (std140) uniform LineSDFInterpolationUBO {
lowp float u_offset_t;
lowp float u_width_t;
lowp float u_floorwidth_t;
highp float interp_pad1;
lowp float drawable_pad1;
lowp float drawable_pad2;
};
layout (std140) uniform LineEvaluatedPropsUBO {
@@ -55,8 +52,8 @@ layout (std140) uniform LineEvaluatedPropsUBO {
lowp float u_offset;
mediump float u_width;
lowp float u_floorwidth;
highp float props_pad1;
highp float props_pad2;
lowp float props_pad1;
lowp float props_pad2;
};
out vec2 v_normal;

View File

@@ -9,8 +9,8 @@ layout (std140) uniform RasterEvaluatedPropsUBO {
highp float u_brightness_high;
highp float u_saturation_factor;
highp float u_contrast_factor;
highp float props_pad1;
highp float props_pad2;
lowp float props_pad1;
lowp float props_pad2;
};
uniform sampler2D u_image0;
uniform sampler2D u_image1;

View File

@@ -12,8 +12,8 @@ layout (std140) uniform RasterEvaluatedPropsUBO {
highp float u_brightness_high;
highp float u_saturation_factor;
highp float u_contrast_factor;
highp float props_pad1;
highp float props_pad2;
lowp float props_pad1;
lowp float props_pad2;
};
layout (location = 0) in vec2 a_pos;

View File

@@ -3,12 +3,8 @@ uniform sampler2D u_texture;
layout (std140) uniform SymbolTilePropsUBO {
bool u_is_text;
bool u_is_halo;
bool u_pitch_with_map;
bool u_is_size_zoom_constant;
bool u_is_size_feature_constant;
highp float u_size_t; // used to interpolate between zoom stops when size is a composite function
highp float u_size; // used when size is both zoom and feature constant
bool tileprops_pad1;
highp float u_gamma_scale;
lowp float tileprops_pad1;
};
layout (std140) uniform SymbolEvaluatedPropsUBO {
@@ -17,13 +13,13 @@ layout (std140) uniform SymbolEvaluatedPropsUBO {
highp float u_text_opacity;
highp float u_text_halo_width;
highp float u_text_halo_blur;
highp float props_pad1;
lowp float props_pad1;
highp vec4 u_icon_fill_color;
highp vec4 u_icon_halo_color;
highp float u_icon_opacity;
highp float u_icon_halo_width;
highp float u_icon_halo_blur;
highp float props_pad2;
lowp float props_pad2;
};
in vec2 v_tex;

View File

@@ -12,7 +12,8 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform SymbolDrawableUBO {
@@ -23,29 +24,21 @@ layout (std140) uniform SymbolDrawableUBO {
highp vec2 u_texsize;
highp vec2 u_texsize_icon;
highp float u_gamma_scale;
bool u_is_text_prop;
bool u_rotate_symbol;
highp vec2 drawable_pad1;
};
layout (std140) uniform SymbolTilePropsUBO {
bool u_is_text;
bool u_is_halo;
bool u_pitch_with_map;
bool u_is_size_zoom_constant;
bool u_is_size_feature_constant;
highp float u_size_t; // used to interpolate between zoom stops when size is a composite function
highp float u_size; // used when size is both zoom and feature constant
bool tileprops_pad1;
};
layout (std140) uniform SymbolInterpolateUBO {
// Interpolations
highp float u_fill_color_t;
highp float u_halo_color_t;
highp float u_opacity_t;
highp float u_halo_width_t;
highp float u_halo_blur_t;
highp float interp_pad1, interp_pad2, interp_pad3;
};
layout (std140) uniform SymbolEvaluatedPropsUBO {
@@ -54,13 +47,13 @@ layout (std140) uniform SymbolEvaluatedPropsUBO {
highp float u_text_opacity;
highp float u_text_halo_width;
highp float u_text_halo_blur;
highp float props_pad1;
lowp float props_pad1;
highp vec4 u_icon_fill_color;
highp vec4 u_icon_halo_color;
highp float u_icon_opacity;
highp float u_icon_halo_width;
highp float u_icon_halo_blur;
highp float props_pad2;
lowp float props_pad2;
};
out vec2 v_tex;
@@ -69,7 +62,7 @@ out float v_fade_opacity;
#pragma mapbox: define lowp float opacity
void main() {
highp float u_opacity = u_is_text ? u_text_opacity : u_icon_opacity;
highp float u_opacity = u_is_text_prop ? u_text_opacity : u_icon_opacity;
#pragma mapbox: initialize lowp float opacity
@@ -107,7 +100,7 @@ void main() {
size *= perspective_ratio;
float fontScale = u_is_text ? size / 24.0 : size;
float fontScale = u_is_text_prop ? size / 24.0 : size;
highp float symbol_rotation = 0.0;
if (u_rotate_symbol) {

View File

@@ -1,27 +1,10 @@
#define SDF_PX 8.0
layout (std140) uniform SymbolDrawableUBO {
highp mat4 u_matrix;
highp mat4 u_label_plane_matrix;
highp mat4 u_coord_matrix;
highp vec2 u_texsize;
highp vec2 u_texsize_icon;
highp float u_gamma_scale;
bool u_rotate_symbol;
highp vec2 drawable_pad1;
};
layout (std140) uniform SymbolTilePropsUBO {
bool u_is_text;
bool u_is_halo;
bool u_pitch_with_map;
bool u_is_size_zoom_constant;
bool u_is_size_feature_constant;
highp float u_size_t; // used to interpolate between zoom stops when size is a composite function
highp float u_size; // used when size is both zoom and feature constant
bool tileprops_pad1;
highp float u_gamma_scale;
lowp float tileprops_pad1;
};
layout (std140) uniform SymbolEvaluatedPropsUBO {
@@ -30,13 +13,13 @@ layout (std140) uniform SymbolEvaluatedPropsUBO {
highp float u_text_opacity;
highp float u_text_halo_width;
highp float u_text_halo_blur;
highp float props_pad1;
lowp float props_pad1;
highp vec4 u_icon_fill_color;
highp vec4 u_icon_halo_color;
highp float u_icon_opacity;
highp float u_icon_halo_width;
highp float u_icon_halo_blur;
highp float props_pad2;
lowp float props_pad2;
};
uniform sampler2D u_texture;

View File

@@ -20,7 +20,8 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform SymbolDrawableUBO {
@@ -31,29 +32,21 @@ layout (std140) uniform SymbolDrawableUBO {
highp vec2 u_texsize;
highp vec2 u_texsize_icon;
highp float u_gamma_scale;
bool u_is_text_prop;
bool u_rotate_symbol;
highp vec2 drawable_pad1;
};
layout (std140) uniform SymbolTilePropsUBO {
bool u_is_text;
bool u_is_halo;
bool u_pitch_with_map;
bool u_is_size_zoom_constant;
bool u_is_size_feature_constant;
highp float u_size_t; // used to interpolate between zoom stops when size is a composite function
highp float u_size; // used when size is both zoom and feature constant
bool tileprops_pad1;
};
layout (std140) uniform SymbolInterpolateUBO {
// Interpolations
highp float u_fill_color_t;
highp float u_halo_color_t;
highp float u_opacity_t;
highp float u_halo_width_t;
highp float u_halo_blur_t;
highp float interp_pad1, interp_pad2, interp_pad3;
};
layout (std140) uniform SymbolEvaluatedPropsUBO {
@@ -62,13 +55,13 @@ layout (std140) uniform SymbolEvaluatedPropsUBO {
highp float u_text_opacity;
highp float u_text_halo_width;
highp float u_text_halo_blur;
highp float props_pad1;
lowp float props_pad1;
highp vec4 u_icon_fill_color;
highp vec4 u_icon_halo_color;
highp float u_icon_opacity;
highp float u_icon_halo_width;
highp float u_icon_halo_blur;
highp float props_pad2;
lowp float props_pad2;
};
out vec2 v_data0;
@@ -81,11 +74,11 @@ out vec3 v_data1;
#pragma mapbox: define lowp float halo_blur
void main() {
highp vec4 u_fill_color = u_is_text ? u_text_fill_color : u_icon_fill_color;
highp vec4 u_halo_color = u_is_text ? u_text_halo_color : u_icon_halo_color;
highp float u_opacity = u_is_text ? u_text_opacity : u_icon_opacity;
highp float u_halo_width = u_is_text ? u_text_halo_width : u_icon_halo_width;
highp float u_halo_blur = u_is_text ? u_text_halo_blur : u_icon_halo_blur;
highp vec4 u_fill_color = u_is_text_prop ? u_text_fill_color : u_icon_fill_color;
highp vec4 u_halo_color = u_is_text_prop ? u_text_halo_color : u_icon_halo_color;
highp float u_opacity = u_is_text_prop ? u_text_opacity : u_icon_opacity;
highp float u_halo_width = u_is_text_prop ? u_text_halo_width : u_icon_halo_width;
highp float u_halo_blur = u_is_text_prop ? u_text_halo_blur : u_icon_halo_blur;
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
@@ -131,7 +124,7 @@ void main() {
size *= perspective_ratio;
float fontScale = u_is_text ? size / 24.0 : size;
float fontScale = u_is_text_prop ? size / 24.0 : size;
highp float symbol_rotation = 0.0;
if (u_rotate_symbol) {

View File

@@ -3,28 +3,11 @@
#define SDF 1.0
#define ICON 0.0
layout (std140) uniform SymbolDrawableUBO {
highp mat4 u_matrix;
highp mat4 u_label_plane_matrix;
highp mat4 u_coord_matrix;
highp vec2 u_texsize;
highp vec2 u_texsize_icon;
highp float u_gamma_scale;
bool u_rotate_symbol;
highp vec2 drawable_pad1;
};
layout (std140) uniform SymbolTilePropsUBO {
bool u_is_text;
bool u_is_halo;
bool u_pitch_with_map;
bool u_is_size_zoom_constant;
bool u_is_size_feature_constant;
highp float u_size_t; // used to interpolate between zoom stops when size is a composite function
highp float u_size; // used when size is both zoom and feature constant
bool tileprops_pad1;
highp float u_gamma_scale;
lowp float tileprops_pad1;
};
layout (std140) uniform SymbolEvaluatedPropsUBO {
@@ -33,13 +16,13 @@ layout (std140) uniform SymbolEvaluatedPropsUBO {
highp float u_text_opacity;
highp float u_text_halo_width;
highp float u_text_halo_blur;
highp float props_pad1;
lowp float props_pad1;
highp vec4 u_icon_fill_color;
highp vec4 u_icon_halo_color;
highp float u_icon_opacity;
highp float u_icon_halo_width;
highp float u_icon_halo_blur;
highp float props_pad2;
lowp float props_pad2;
};
uniform sampler2D u_texture;

View File

@@ -19,7 +19,8 @@ layout (std140) uniform GlobalPaintParamsUBO {
highp float u_symbol_fade_change;
highp float u_aspect_ratio;
highp float u_pixel_ratio;
highp float global_pad1, global_pad2;
highp float u_map_zoom;
lowp float global_pad1;
};
layout (std140) uniform SymbolDrawableUBO {
@@ -30,29 +31,21 @@ layout (std140) uniform SymbolDrawableUBO {
highp vec2 u_texsize;
highp vec2 u_texsize_icon;
highp float u_gamma_scale;
bool u_is_text_prop;
bool u_rotate_symbol;
highp vec2 drawable_pad1;
};
layout (std140) uniform SymbolTilePropsUBO {
bool u_is_text;
bool u_is_halo;
bool u_pitch_with_map;
bool u_is_size_zoom_constant;
bool u_is_size_feature_constant;
highp float u_size_t; // used to interpolate between zoom stops when size is a composite function
highp float u_size; // used when size is both zoom and feature constant
bool tileprops_pad1;
};
layout (std140) uniform SymbolInterpolateUBO {
// Interpolations
highp float u_fill_color_t;
highp float u_halo_color_t;
highp float u_opacity_t;
highp float u_halo_width_t;
highp float u_halo_blur_t;
highp float interp_pad1, interp_pad2, interp_pad3;
};
layout (std140) uniform SymbolEvaluatedPropsUBO {
@@ -61,13 +54,13 @@ layout (std140) uniform SymbolEvaluatedPropsUBO {
highp float u_text_opacity;
highp float u_text_halo_width;
highp float u_text_halo_blur;
highp float props_pad1;
lowp float props_pad1;
highp vec4 u_icon_fill_color;
highp vec4 u_icon_halo_color;
highp float u_icon_opacity;
highp float u_icon_halo_width;
highp float u_icon_halo_blur;
highp float props_pad2;
lowp float props_pad2;
};
out vec4 v_data0;
@@ -80,11 +73,11 @@ out vec4 v_data1;
#pragma mapbox: define lowp float halo_blur
void main() {
highp vec4 u_fill_color = u_is_text ? u_text_fill_color : u_icon_fill_color;
highp vec4 u_halo_color = u_is_text ? u_text_halo_color : u_icon_halo_color;
highp float u_opacity = u_is_text ? u_text_opacity : u_icon_opacity;
highp float u_halo_width = u_is_text ? u_text_halo_width : u_icon_halo_width;
highp float u_halo_blur = u_is_text ? u_text_halo_blur : u_icon_halo_blur;
highp vec4 u_fill_color = u_is_text_prop ? u_text_fill_color : u_icon_fill_color;
highp vec4 u_halo_color = u_is_text_prop ? u_text_halo_color : u_icon_halo_color;
highp float u_opacity = u_is_text_prop ? u_text_opacity : u_icon_opacity;
highp float u_halo_width = u_is_text_prop ? u_text_halo_width : u_icon_halo_width;
highp float u_halo_blur = u_is_text_prop ? u_text_halo_blur : u_icon_halo_blur;
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color

View File

@@ -34,6 +34,13 @@
"glsl_frag": "drawable.collision_circle.fragment.glsl",
"uses_ubos": true
},
{
"name": "CustomSymbolIconShader",
"header": "drawable_custom_symbol_icon",
"glsl_vert": "drawable.custom.symbol_icon.vertex.glsl",
"glsl_frag": "drawable.custom.symbol_icon.fragment.glsl",
"uses_ubos": true
},
{
"name": "DebugShader",
"header": "drawable_debug",
@@ -139,6 +146,20 @@
"glsl_frag": "drawable.line_pattern.fragment.glsl",
"uses_ubos": true
},
{
"name": "LocationIndicatorShader",
"header": "drawable_location_indicator",
"glsl_vert": "_empty.glsl",
"glsl_frag": "_empty.glsl",
"uses_ubos": true
},
{
"name": "LocationIndicatorTexturedShader",
"header": "drawable_location_indicator_textured",
"glsl_vert": "_empty.glsl",
"glsl_frag": "_empty.glsl",
"uses_ubos": true
},
{
"name": "LineSDFShader",
"header": "drawable_line_sdf",
@@ -174,19 +195,12 @@
"glsl_frag": "drawable.symbol_text_and_icon.fragment.glsl",
"uses_ubos": true
},
{
"name": "CustomSymbolIconShader",
"header": "drawable_custom_symbol_icon",
"glsl_vert": "drawable.custom.symbol_icon.vertex.glsl",
"glsl_frag": "drawable.custom.symbol_icon.fragment.glsl",
"uses_ubos": true
},
{
"name": "WideVectorShader",
"header": "drawable_wide_vector",
"glsl_vert": "_empty.glsl",
"glsl_frag": "_empty.glsl",
"uses_ubos": false
"uses_ubos": true
},
{