diff options
51 files changed, 541 insertions, 541 deletions
diff --git a/scripts/generate-style-code.js b/scripts/generate-style-code.js index ae25a856a8..72f4857a96 100755 --- a/scripts/generate-style-code.js +++ b/scripts/generate-style-code.js @@ -99,7 +99,7 @@ function attributeUniformType(property, type) { [ property.name.replace(type + '-', '').replace(/-/g, '_') ]; return names.map(name => { - return `attributes::a_${name}, uniforms::u_${name}` + return `attributes::${name}, uniforms::${name}` }).join(', '); } diff --git a/src/mbgl/gfx/attribute.hpp b/src/mbgl/gfx/attribute.hpp index 4f44d68d7b..aff27d9c1d 100644 --- a/src/mbgl/gfx/attribute.hpp +++ b/src/mbgl/gfx/attribute.hpp @@ -14,8 +14,8 @@ #define MBGL_DEFINE_ATTRIBUTE(type_, n_, name_) \ struct name_ { \ using Type = ::mbgl::gfx::AttributeType<type_, n_>; \ - static auto name() { \ - return #name_; \ + static auto attributeName() { \ + return "a_" #name_; \ } \ } diff --git a/src/mbgl/gfx/texture.hpp b/src/mbgl/gfx/texture.hpp index a957c4ebdf..05f98686a1 100644 --- a/src/mbgl/gfx/texture.hpp +++ b/src/mbgl/gfx/texture.hpp @@ -10,8 +10,8 @@ #define MBGL_DEFINE_TEXTURE(name_) \ struct name_ { \ using Value = ::mbgl::gfx::TextureBinding; \ - static constexpr auto name() { \ - return #name_; \ + static constexpr auto uniformName() { \ + return "u_" #name_; \ } \ } diff --git a/src/mbgl/gfx/uniform.hpp b/src/mbgl/gfx/uniform.hpp index f6896b9138..44cfe35510 100644 --- a/src/mbgl/gfx/uniform.hpp +++ b/src/mbgl/gfx/uniform.hpp @@ -8,24 +8,24 @@ #define MBGL_DEFINE_UNIFORM_SCALAR(type_, name_) \ struct name_ { \ using Value = type_; \ - static constexpr auto name() { \ - return #name_; \ + static constexpr auto uniformName() { \ + return "u_" #name_; \ } \ } #define MBGL_DEFINE_UNIFORM_VECTOR(type_, n_, name_) \ struct name_ { \ using Value = std::array<type_, n_>; \ - static constexpr auto name() { \ - return #name_; \ + static constexpr auto uniformName() { \ + return "u_" #name_; \ } \ } #define MBGL_DEFINE_UNIFORM_MATRIX(type_, n_, name_) \ struct name_ { \ using Value = std::array<type_, n_ * n_>; \ - static constexpr auto name() { \ - return #name_; \ + static constexpr auto uniformName() { \ + return "u_" #name_; \ } \ } diff --git a/src/mbgl/gl/attribute.hpp b/src/mbgl/gl/attribute.hpp index c4fe8b993f..32493d207a 100644 --- a/src/mbgl/gl/attribute.hpp +++ b/src/mbgl/gl/attribute.hpp @@ -50,13 +50,13 @@ public: } }; - return Locations{ maybeBindLocation(As::name())... }; + return Locations{ maybeBindLocation(As::attributeName())... }; }()) { } template <class BinaryProgram> AttributeLocations(const BinaryProgram& program) - : locations{ program.attributeLocation(As::name())... } { + : locations{ program.attributeLocation(As::attributeName())... } { } NamedAttributeLocations getNamedLocations() const { @@ -68,7 +68,7 @@ public: } }; - util::ignore({ (maybeAddLocation(As::name(), locations.template get<As>()), 0)... }); + util::ignore({ (maybeAddLocation(As::attributeName(), locations.template get<As>()), 0)... }); return result; } diff --git a/src/mbgl/gl/texture.hpp b/src/mbgl/gl/texture.hpp index 0569adc3b0..2058ecd495 100644 --- a/src/mbgl/gl/texture.hpp +++ b/src/mbgl/gl/texture.hpp @@ -27,16 +27,16 @@ private: public: void queryLocations(const ProgramID& id) { - state = State{ gl::uniformLocation(id, Ts::name())... }; + state = State{ gl::uniformLocation(id, Ts::uniformName())... }; } template <class BinaryProgram> void loadNamedLocations(const BinaryProgram& program) { - state = State{ program.textureLocation(Ts::name())... }; + state = State{ program.textureLocation(Ts::uniformName())... }; } NamedUniformLocations getNamedLocations() const { - return NamedUniformLocations{ { Ts::name(), state.template get<Ts>().location }... }; + return NamedUniformLocations{ { Ts::uniformName(), state.template get<Ts>().location }... }; } void bind(gl::Context& context, const gfx::TextureBindings<TypeList<Ts...>>& bindings) { diff --git a/src/mbgl/gl/uniform.hpp b/src/mbgl/gl/uniform.hpp index 770f3e2294..64c83cab6b 100644 --- a/src/mbgl/gl/uniform.hpp +++ b/src/mbgl/gl/uniform.hpp @@ -73,21 +73,21 @@ public: util::ignore( { // Some shader programs have uniforms declared, but not used, so they're not active. // Therefore, we'll only verify them when they are indeed active. - (active.find(Us::name()) != active.end() - ? verifyUniform<typename Us::Value>(active.at(Us::name())) + (active.find(Us::uniformName()) != active.end() + ? verifyUniform<typename Us::Value>(active.at(Us::uniformName())) : false)... }); #endif - state = State{ gl::uniformLocation(id, Us::name())... }; + state = State{ gl::uniformLocation(id, Us::uniformName())... }; } template <class BinaryProgram> void loadNamedLocations(const BinaryProgram& program) { - state = State{ UniformState<typename Us::Value>(program.uniformLocation(Us::name()))... }; + state = State{ UniformState<typename Us::Value>(program.uniformLocation(Us::uniformName()))... }; } NamedUniformLocations getNamedLocations() const { - return NamedUniformLocations{ { Us::name(), state.template get<Us>().location }... }; + return NamedUniformLocations{ { Us::uniformName(), state.template get<Us>().location }... }; } void bind(const gfx::UniformValues<TypeList<Us...>>& values) { diff --git a/src/mbgl/programs/attributes.hpp b/src/mbgl/programs/attributes.hpp index 6106eedb53..2ee2218fcb 100644 --- a/src/mbgl/programs/attributes.hpp +++ b/src/mbgl/programs/attributes.hpp @@ -7,52 +7,52 @@ namespace attributes { // Layout attributes -MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_pos); -MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_extrude); -MBGL_DEFINE_ATTRIBUTE(int16_t, 4, a_pos_offset); -MBGL_DEFINE_ATTRIBUTE(int16_t, 4, a_pos_normal); -MBGL_DEFINE_ATTRIBUTE(float, 3, a_projected_pos); -MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_label_pos); -MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_anchor_pos); -MBGL_DEFINE_ATTRIBUTE(uint16_t, 2, a_texture_pos); -MBGL_DEFINE_ATTRIBUTE(int16_t, 4, a_normal_ed); -MBGL_DEFINE_ATTRIBUTE(uint8_t, 1, a_fade_opacity); -MBGL_DEFINE_ATTRIBUTE(uint8_t, 2, a_placed); -MBGL_DEFINE_ATTRIBUTE(uint16_t, 3, a_size); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_offset); -MBGL_DEFINE_ATTRIBUTE(float, 2, a_shift); +MBGL_DEFINE_ATTRIBUTE(int16_t, 2, pos); +MBGL_DEFINE_ATTRIBUTE(int16_t, 2, extrude); +MBGL_DEFINE_ATTRIBUTE(int16_t, 4, pos_offset); +MBGL_DEFINE_ATTRIBUTE(int16_t, 4, pos_normal); +MBGL_DEFINE_ATTRIBUTE(float, 3, projected_pos); +MBGL_DEFINE_ATTRIBUTE(int16_t, 2, label_pos); +MBGL_DEFINE_ATTRIBUTE(int16_t, 2, anchor_pos); +MBGL_DEFINE_ATTRIBUTE(uint16_t, 2, texture_pos); +MBGL_DEFINE_ATTRIBUTE(int16_t, 4, normal_ed); +MBGL_DEFINE_ATTRIBUTE(uint8_t, 1, fade_opacity); +MBGL_DEFINE_ATTRIBUTE(uint8_t, 2, placed); +MBGL_DEFINE_ATTRIBUTE(uint16_t, 3, size); +MBGL_DEFINE_ATTRIBUTE(float, 1, offset); +MBGL_DEFINE_ATTRIBUTE(float, 2, shift); template <typename T, std::size_t N> -struct a_data { +struct data { using Type = gfx::AttributeType<T, N>; - static auto name() { return "a_data"; } + static auto attributeName() { return "a_data"; } }; // Paint attributes -MBGL_DEFINE_ATTRIBUTE(float, 2, a_color); -MBGL_DEFINE_ATTRIBUTE(float, 2, a_fill_color); -MBGL_DEFINE_ATTRIBUTE(float, 2, a_halo_color); -MBGL_DEFINE_ATTRIBUTE(float, 2, a_stroke_color); -MBGL_DEFINE_ATTRIBUTE(float, 2, a_outline_color); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_opacity); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_stroke_opacity); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_blur); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_radius); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_width); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_floorwidth); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_height); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_base); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_gapwidth); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_stroke_width); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_halo_width); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_halo_blur); -MBGL_DEFINE_ATTRIBUTE(float, 1, a_weight); -MBGL_DEFINE_ATTRIBUTE(uint16_t, 4, a_pattern_to); -MBGL_DEFINE_ATTRIBUTE(uint16_t, 4, a_pattern_from); +MBGL_DEFINE_ATTRIBUTE(float, 2, color); +MBGL_DEFINE_ATTRIBUTE(float, 2, fill_color); +MBGL_DEFINE_ATTRIBUTE(float, 2, halo_color); +MBGL_DEFINE_ATTRIBUTE(float, 2, stroke_color); +MBGL_DEFINE_ATTRIBUTE(float, 2, outline_color); +MBGL_DEFINE_ATTRIBUTE(float, 1, opacity); +MBGL_DEFINE_ATTRIBUTE(float, 1, stroke_opacity); +MBGL_DEFINE_ATTRIBUTE(float, 1, blur); +MBGL_DEFINE_ATTRIBUTE(float, 1, radius); +MBGL_DEFINE_ATTRIBUTE(float, 1, width); +MBGL_DEFINE_ATTRIBUTE(float, 1, floorwidth); +MBGL_DEFINE_ATTRIBUTE(float, 1, height); +MBGL_DEFINE_ATTRIBUTE(float, 1, base); +MBGL_DEFINE_ATTRIBUTE(float, 1, gapwidth); +MBGL_DEFINE_ATTRIBUTE(float, 1, stroke_width); +MBGL_DEFINE_ATTRIBUTE(float, 1, halo_width); +MBGL_DEFINE_ATTRIBUTE(float, 1, halo_blur); +MBGL_DEFINE_ATTRIBUTE(float, 1, weight); +MBGL_DEFINE_ATTRIBUTE(uint16_t, 4, pattern_to); +MBGL_DEFINE_ATTRIBUTE(uint16_t, 4, pattern_from); } // namespace attributes -using PositionOnlyLayoutAttributes = TypeList<attributes::a_pos>; +using PositionOnlyLayoutAttributes = TypeList<attributes::pos>; } // namespace mbgl diff --git a/src/mbgl/programs/background_program.cpp b/src/mbgl/programs/background_program.cpp index 7d68f62fb1..772d481578 100644 --- a/src/mbgl/programs/background_program.cpp +++ b/src/mbgl/programs/background_program.cpp @@ -28,21 +28,21 @@ BackgroundPatternProgram::layoutUniformValues(mat4 matrix, int32_t pixelY = tileSizeAtNearestZoom * tileID.canonical.y; return { - uniforms::u_matrix::Value( matrix ), - uniforms::u_opacity::Value( opacity ), - uniforms::u_texsize::Value( atlasSize ), - uniforms::u_pattern_tl_a::Value( a.tl() ), - uniforms::u_pattern_br_a::Value( a.br() ), - uniforms::u_pattern_tl_b::Value( b.tl() ), - uniforms::u_pattern_br_b::Value( b.br() ), - uniforms::u_pattern_size_a::Value( a.displaySize() ), - uniforms::u_pattern_size_b::Value( b.displaySize() ), - uniforms::u_scale_a::Value( fading.fromScale ), - uniforms::u_scale_b::Value( fading.toScale ), - uniforms::u_mix::Value( fading.t ), - uniforms::u_pixel_coord_upper::Value( std::array<float, 2> {{ float(pixelX >> 16), float(pixelY >> 16) }}), - uniforms::u_pixel_coord_lower::Value( std::array<float, 2> {{ float(pixelX & 0xFFFF), float(pixelY & 0xFFFF)}}), - uniforms::u_tile_units_to_pixels::Value( 1.0f / tileID.pixelsToTileUnits(1.0f, state.getIntegerZoom()) ), + uniforms::matrix::Value( matrix ), + uniforms::opacity::Value( opacity ), + uniforms::texsize::Value( atlasSize ), + uniforms::pattern_tl_a::Value( a.tl() ), + uniforms::pattern_br_a::Value( a.br() ), + uniforms::pattern_tl_b::Value( b.tl() ), + uniforms::pattern_br_b::Value( b.br() ), + uniforms::pattern_size_a::Value( a.displaySize() ), + uniforms::pattern_size_b::Value( b.displaySize() ), + uniforms::scale_a::Value( fading.fromScale ), + uniforms::scale_b::Value( fading.toScale ), + uniforms::mix::Value( fading.t ), + uniforms::pixel_coord_upper::Value( std::array<float, 2> {{ float(pixelX >> 16), float(pixelY >> 16) }}), + uniforms::pixel_coord_lower::Value( std::array<float, 2> {{ float(pixelX & 0xFFFF), float(pixelY & 0xFFFF)}}), + uniforms::tile_units_to_pixels::Value( 1.0f / tileID.pixelsToTileUnits(1.0f, state.getIntegerZoom()) ), }; } diff --git a/src/mbgl/programs/background_program.hpp b/src/mbgl/programs/background_program.hpp index b1ade6dc84..dd0683776c 100644 --- a/src/mbgl/programs/background_program.hpp +++ b/src/mbgl/programs/background_program.hpp @@ -18,26 +18,26 @@ template <class> class Faded; using BackgroundLayoutAttributes = PositionOnlyLayoutAttributes; using BackgroundUniforms = TypeList< - uniforms::u_matrix, - uniforms::u_color, - uniforms::u_opacity>; + uniforms::matrix, + uniforms::color, + uniforms::opacity>; using BackgroundPatternUniforms = TypeList< - uniforms::u_matrix, - uniforms::u_opacity, - uniforms::u_texsize, - uniforms::u_pattern_tl_a, - uniforms::u_pattern_br_a, - uniforms::u_pattern_tl_b, - uniforms::u_pattern_br_b, - uniforms::u_pattern_size_a, - uniforms::u_pattern_size_b, - uniforms::u_scale_a, - uniforms::u_scale_b, - uniforms::u_mix, - uniforms::u_pixel_coord_upper, - uniforms::u_pixel_coord_lower, - uniforms::u_tile_units_to_pixels>; + uniforms::matrix, + uniforms::opacity, + uniforms::texsize, + uniforms::pattern_tl_a, + uniforms::pattern_br_a, + uniforms::pattern_tl_b, + uniforms::pattern_br_b, + uniforms::pattern_size_a, + uniforms::pattern_size_b, + uniforms::scale_a, + uniforms::scale_b, + uniforms::mix, + uniforms::pixel_coord_upper, + uniforms::pixel_coord_lower, + uniforms::tile_units_to_pixels>; class BackgroundProgram : public Program< BackgroundProgram, @@ -57,7 +57,7 @@ class BackgroundPatternProgram : public Program< BackgroundLayoutAttributes, BackgroundPatternUniforms, TypeList< - textures::u_image>, + textures::image>, style::Properties<>> { public: diff --git a/src/mbgl/programs/circle_program.hpp b/src/mbgl/programs/circle_program.hpp index 0caa1b2a15..b108a43da3 100644 --- a/src/mbgl/programs/circle_program.hpp +++ b/src/mbgl/programs/circle_program.hpp @@ -9,20 +9,20 @@ namespace mbgl { namespace uniforms { -MBGL_DEFINE_UNIFORM_SCALAR(bool, u_scale_with_map); +MBGL_DEFINE_UNIFORM_SCALAR(bool, scale_with_map); } // namespace uniforms class CircleProgram : public Program< CircleProgram, gfx::PrimitiveType::Triangle, TypeList< - attributes::a_pos>, + attributes::pos>, TypeList< - uniforms::u_matrix, - uniforms::u_scale_with_map, - uniforms::u_extrude_scale, - uniforms::u_camera_to_center_distance, - uniforms::u_pitch_with_map>, + uniforms::matrix, + uniforms::scale_with_map, + uniforms::extrude_scale, + uniforms::camera_to_center_distance, + uniforms::pitch_with_map>, TypeList<>, style::CirclePaintProperties> { diff --git a/src/mbgl/programs/clipping_mask_program.hpp b/src/mbgl/programs/clipping_mask_program.hpp index 874708a52f..14d66a8703 100644 --- a/src/mbgl/programs/clipping_mask_program.hpp +++ b/src/mbgl/programs/clipping_mask_program.hpp @@ -12,7 +12,7 @@ class ClippingMaskProgram : public Program< gfx::PrimitiveType::Triangle, PositionOnlyLayoutAttributes, TypeList< - uniforms::u_matrix>, + uniforms::matrix>, TypeList<>, style::Properties<>> { diff --git a/src/mbgl/programs/collision_box_program.hpp b/src/mbgl/programs/collision_box_program.hpp index 7b81752a94..0fa7ea4b4f 100644 --- a/src/mbgl/programs/collision_box_program.hpp +++ b/src/mbgl/programs/collision_box_program.hpp @@ -11,21 +11,21 @@ namespace mbgl { using CollisionBoxLayoutAttributes = TypeList< - attributes::a_pos, - attributes::a_anchor_pos, - attributes::a_extrude, - attributes::a_shift>; + attributes::pos, + attributes::anchor_pos, + attributes::extrude, + attributes::shift>; -using CollisionBoxDynamicAttributes = TypeList<attributes::a_placed>; +using CollisionBoxDynamicAttributes = TypeList<attributes::placed>; class CollisionBoxProgram : public Program< CollisionBoxProgram, gfx::PrimitiveType::Line, TypeListConcat<CollisionBoxLayoutAttributes, CollisionBoxDynamicAttributes>, TypeList< - uniforms::u_matrix, - uniforms::u_extrude_scale, - uniforms::u_camera_to_center_distance>, + uniforms::matrix, + uniforms::extrude_scale, + uniforms::camera_to_center_distance>, TypeList<>, style::Properties<>> { @@ -116,10 +116,10 @@ class CollisionCircleProgram : public Program< gfx::PrimitiveType::Triangle, TypeListConcat<CollisionBoxLayoutAttributes, CollisionBoxDynamicAttributes>, TypeList< - uniforms::u_matrix, - uniforms::u_extrude_scale, - uniforms::u_overscale_factor, - uniforms::u_camera_to_center_distance>, + uniforms::matrix, + uniforms::extrude_scale, + uniforms::overscale_factor, + uniforms::camera_to_center_distance>, TypeList<>, style::Properties<>> { diff --git a/src/mbgl/programs/debug_program.hpp b/src/mbgl/programs/debug_program.hpp index 61125b55bf..f1782e19e3 100644 --- a/src/mbgl/programs/debug_program.hpp +++ b/src/mbgl/programs/debug_program.hpp @@ -11,10 +11,10 @@ class DebugProgram : public Program< DebugProgram, gfx::PrimitiveType::Line, TypeList< - attributes::a_pos>, + attributes::pos>, TypeList< - uniforms::u_matrix, - uniforms::u_color>, + uniforms::matrix, + uniforms::color>, TypeList<>, style::Properties<>> { diff --git a/src/mbgl/programs/extrusion_texture_program.hpp b/src/mbgl/programs/extrusion_texture_program.hpp index bdeeabb8cd..10dfdc8a16 100644 --- a/src/mbgl/programs/extrusion_texture_program.hpp +++ b/src/mbgl/programs/extrusion_texture_program.hpp @@ -12,13 +12,13 @@ namespace mbgl { class ExtrusionTextureProgram : public Program< ExtrusionTextureProgram, gfx::PrimitiveType::Triangle, - TypeList<attributes::a_pos>, + TypeList<attributes::pos>, TypeList< - uniforms::u_matrix, - uniforms::u_world, - uniforms::u_opacity>, + uniforms::matrix, + uniforms::world, + uniforms::opacity>, TypeList< - textures::u_image>, + textures::image>, style::Properties<>> { public: using Program::Program; diff --git a/src/mbgl/programs/fill_extrusion_program.cpp b/src/mbgl/programs/fill_extrusion_program.cpp index 7688d09299..d301f32707 100644 --- a/src/mbgl/programs/fill_extrusion_program.cpp +++ b/src/mbgl/programs/fill_extrusion_program.cpp @@ -38,10 +38,10 @@ float lightIntensity(const EvaluatedLight& light) { FillExtrusionProgram::LayoutUniformValues FillExtrusionProgram::layoutUniformValues( mat4 matrix, const TransformState& state, const EvaluatedLight& light) { return { - uniforms::u_matrix::Value( matrix ), - uniforms::u_lightcolor::Value( lightColor(light) ), - uniforms::u_lightpos::Value( lightPosition(light, state) ), - uniforms::u_lightintensity::Value( lightIntensity(light) ) + uniforms::matrix::Value( matrix ), + uniforms::lightcolor::Value( lightColor(light) ), + uniforms::lightpos::Value( lightPosition(light, state) ), + uniforms::lightintensity::Value( lightIntensity(light) ) }; } @@ -60,16 +60,16 @@ FillExtrusionPatternProgram::layoutUniformValues(mat4 matrix, int32_t pixelY = tileSizeAtNearestZoom * tileID.canonical.y; return { - uniforms::u_matrix::Value( matrix ), - uniforms::u_scale::Value( {{pixelRatio, tileRatio, crossfade.fromScale, crossfade.toScale}} ), - uniforms::u_texsize::Value( atlasSize ), - uniforms::u_fade::Value( crossfade.t ), - uniforms::u_pixel_coord_upper::Value( std::array<float, 2>{{ float(pixelX >> 16), float(pixelY >> 16) }} ), - uniforms::u_pixel_coord_lower::Value( std::array<float, 2>{{ float(pixelX & 0xFFFF), float(pixelY & 0xFFFF) }} ), - uniforms::u_height_factor::Value( heightFactor ), - uniforms::u_lightcolor::Value( lightColor(light) ), - uniforms::u_lightpos::Value( lightPosition(light, state) ), - uniforms::u_lightintensity::Value( lightIntensity(light) ), + uniforms::matrix::Value( matrix ), + uniforms::scale::Value( {{pixelRatio, tileRatio, crossfade.fromScale, crossfade.toScale}} ), + uniforms::texsize::Value( atlasSize ), + uniforms::fade::Value( crossfade.t ), + uniforms::pixel_coord_upper::Value( std::array<float, 2>{{ float(pixelX >> 16), float(pixelY >> 16) }} ), + uniforms::pixel_coord_lower::Value( std::array<float, 2>{{ float(pixelX & 0xFFFF), float(pixelY & 0xFFFF) }} ), + uniforms::height_factor::Value( heightFactor ), + uniforms::lightcolor::Value( lightColor(light) ), + uniforms::lightpos::Value( lightPosition(light, state) ), + uniforms::lightintensity::Value( lightIntensity(light) ), }; } diff --git a/src/mbgl/programs/fill_extrusion_program.hpp b/src/mbgl/programs/fill_extrusion_program.hpp index e1c3ca7f17..ca696230b4 100644 --- a/src/mbgl/programs/fill_extrusion_program.hpp +++ b/src/mbgl/programs/fill_extrusion_program.hpp @@ -22,33 +22,33 @@ class TransformState; template <class> class Faded; namespace uniforms { -MBGL_DEFINE_UNIFORM_VECTOR(float, 3, u_lightpos); -MBGL_DEFINE_UNIFORM_VECTOR(float, 3, u_lightcolor); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_lightintensity); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_height_factor); +MBGL_DEFINE_UNIFORM_VECTOR(float, 3, lightpos); +MBGL_DEFINE_UNIFORM_VECTOR(float, 3, lightcolor); +MBGL_DEFINE_UNIFORM_SCALAR(float, lightintensity); +MBGL_DEFINE_UNIFORM_SCALAR(float, height_factor); } // namespace uniforms using FillExtrusionLayoutAttributes = TypeList< - attributes::a_pos, - attributes::a_normal_ed>; + attributes::pos, + attributes::normal_ed>; using FillExtrusionUniforms = TypeList< - uniforms::u_matrix, - uniforms::u_lightcolor, - uniforms::u_lightpos, - uniforms::u_lightintensity>; + uniforms::matrix, + uniforms::lightcolor, + uniforms::lightpos, + uniforms::lightintensity>; using FillExtrusionPatternUniforms = TypeList< - uniforms::u_matrix, - uniforms::u_scale, - uniforms::u_texsize, - uniforms::u_fade, - uniforms::u_pixel_coord_upper, - uniforms::u_pixel_coord_lower, - uniforms::u_height_factor, - uniforms::u_lightcolor, - uniforms::u_lightpos, - uniforms::u_lightintensity>; + uniforms::matrix, + uniforms::scale, + uniforms::texsize, + uniforms::fade, + uniforms::pixel_coord_upper, + uniforms::pixel_coord_lower, + uniforms::height_factor, + uniforms::lightcolor, + uniforms::lightpos, + uniforms::lightintensity>; class FillExtrusionProgram : public Program< FillExtrusionProgram, @@ -91,7 +91,7 @@ class FillExtrusionPatternProgram : public Program< FillExtrusionLayoutAttributes, FillExtrusionPatternUniforms, TypeList< - textures::u_image>, + textures::image>, style::FillExtrusionPaintProperties> { public: diff --git a/src/mbgl/programs/fill_program.cpp b/src/mbgl/programs/fill_program.cpp index e0dfc71f81..703d61399f 100644 --- a/src/mbgl/programs/fill_program.cpp +++ b/src/mbgl/programs/fill_program.cpp @@ -30,13 +30,13 @@ FillPatternProgram::layoutUniformValues(mat4 matrix, int32_t pixelY = tileSizeAtNearestZoom * tileID.canonical.y; return { - uniforms::u_matrix::Value( matrix ), - uniforms::u_world::Value( framebufferSize ), - uniforms::u_texsize::Value( atlasSize ), - uniforms::u_scale::Value({ {pixelRatio, tileRatio, crossfade.fromScale, crossfade.toScale} } ), - uniforms::u_fade::Value( crossfade.t ), - uniforms::u_pixel_coord_upper::Value( std::array<float, 2> {{ float(pixelX >> 16), float(pixelY >> 16) }}), - uniforms::u_pixel_coord_lower::Value( std::array<float, 2> {{ float(pixelX & 0xFFFF), float(pixelY & 0xFFFF) }} ) + uniforms::matrix::Value( matrix ), + uniforms::world::Value( framebufferSize ), + uniforms::texsize::Value( atlasSize ), + uniforms::scale::Value({ {pixelRatio, tileRatio, crossfade.fromScale, crossfade.toScale} } ), + uniforms::fade::Value( crossfade.t ), + uniforms::pixel_coord_upper::Value( std::array<float, 2> {{ float(pixelX >> 16), float(pixelY >> 16) }}), + uniforms::pixel_coord_lower::Value( std::array<float, 2> {{ float(pixelX & 0xFFFF), float(pixelY & 0xFFFF) }} ) }; } diff --git a/src/mbgl/programs/fill_program.hpp b/src/mbgl/programs/fill_program.hpp index 8519e482d6..4684a84f54 100644 --- a/src/mbgl/programs/fill_program.hpp +++ b/src/mbgl/programs/fill_program.hpp @@ -21,17 +21,17 @@ template <class> class Faded; using FillLayoutAttributes = PositionOnlyLayoutAttributes; using FillUniforms = TypeList< - uniforms::u_matrix, - uniforms::u_world>; + uniforms::matrix, + uniforms::world>; using FillPatternUniforms = TypeList< - uniforms::u_matrix, - uniforms::u_world, - uniforms::u_texsize, - uniforms::u_scale, - uniforms::u_fade, - uniforms::u_pixel_coord_upper, - uniforms::u_pixel_coord_lower>; + uniforms::matrix, + uniforms::world, + uniforms::texsize, + uniforms::scale, + uniforms::fade, + uniforms::pixel_coord_upper, + uniforms::pixel_coord_lower>; class FillProgram : public Program< FillProgram, @@ -60,7 +60,7 @@ class FillPatternProgram : public Program< FillLayoutAttributes, FillPatternUniforms, TypeList< - textures::u_image>, + textures::image>, style::FillPaintProperties> { public: @@ -93,7 +93,7 @@ class FillOutlinePatternProgram : public Program< FillLayoutAttributes, FillPatternUniforms, TypeList< - textures::u_image>, + textures::image>, style::FillPaintProperties> { public: diff --git a/src/mbgl/programs/heatmap_program.hpp b/src/mbgl/programs/heatmap_program.hpp index 9563dd8d1b..89ba655105 100644 --- a/src/mbgl/programs/heatmap_program.hpp +++ b/src/mbgl/programs/heatmap_program.hpp @@ -10,18 +10,18 @@ namespace mbgl { namespace uniforms { -MBGL_DEFINE_UNIFORM_SCALAR(float, u_intensity); +MBGL_DEFINE_UNIFORM_SCALAR(float, intensity); } // namespace uniforms class HeatmapProgram : public Program< HeatmapProgram, gfx::PrimitiveType::Triangle, TypeList< - attributes::a_pos>, + attributes::pos>, TypeList< - uniforms::u_intensity, - uniforms::u_matrix, - uniforms::heatmap::u_extrude_scale>, + uniforms::intensity, + uniforms::matrix, + uniforms::heatmap::extrude_scale>, TypeList<>, style::HeatmapPaintProperties> { diff --git a/src/mbgl/programs/heatmap_texture_program.hpp b/src/mbgl/programs/heatmap_texture_program.hpp index 954e03f9b6..6762f8c7f4 100644 --- a/src/mbgl/programs/heatmap_texture_program.hpp +++ b/src/mbgl/programs/heatmap_texture_program.hpp @@ -12,14 +12,14 @@ namespace mbgl { class HeatmapTextureProgram : public Program< HeatmapTextureProgram, gfx::PrimitiveType::Triangle, - TypeList<attributes::a_pos>, + TypeList<attributes::pos>, TypeList< - uniforms::u_matrix, - uniforms::u_world, - uniforms::u_opacity>, + uniforms::matrix, + uniforms::world, + uniforms::opacity>, TypeList< - textures::u_image, - textures::u_color_ramp>, + textures::image, + textures::color_ramp>, style::Properties<>> { public: using Program::Program; diff --git a/src/mbgl/programs/hillshade_prepare_program.hpp b/src/mbgl/programs/hillshade_prepare_program.hpp index 0243cc1879..2d76145bc3 100644 --- a/src/mbgl/programs/hillshade_prepare_program.hpp +++ b/src/mbgl/programs/hillshade_prepare_program.hpp @@ -9,23 +9,23 @@ namespace mbgl { namespace uniforms { -MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 2, u_dimension); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_maxzoom); +MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 2, dimension); +MBGL_DEFINE_UNIFORM_SCALAR(float, maxzoom); } // namespace uniforms class HillshadePrepareProgram : public Program< HillshadePrepareProgram, gfx::PrimitiveType::Triangle, TypeList< - attributes::a_pos, - attributes::a_texture_pos>, + attributes::pos, + attributes::texture_pos>, TypeList< - uniforms::u_matrix, - uniforms::u_dimension, - uniforms::u_zoom, - uniforms::u_maxzoom>, + uniforms::matrix, + uniforms::dimension, + uniforms::zoom, + uniforms::maxzoom>, TypeList< - textures::u_image>, + textures::image>, style::Properties<>> { public: using Program::Program; diff --git a/src/mbgl/programs/hillshade_program.hpp b/src/mbgl/programs/hillshade_program.hpp index 68d67917df..33f91abef0 100644 --- a/src/mbgl/programs/hillshade_program.hpp +++ b/src/mbgl/programs/hillshade_program.hpp @@ -11,28 +11,28 @@ namespace mbgl { namespace uniforms { -MBGL_DEFINE_UNIFORM_SCALAR(Color, u_shadow); -MBGL_DEFINE_UNIFORM_SCALAR(Color, u_highlight); -MBGL_DEFINE_UNIFORM_SCALAR(Color, u_accent); -MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_light); -MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_latrange); +MBGL_DEFINE_UNIFORM_SCALAR(Color, shadow); +MBGL_DEFINE_UNIFORM_SCALAR(Color, highlight); +MBGL_DEFINE_UNIFORM_SCALAR(Color, accent); +MBGL_DEFINE_UNIFORM_VECTOR(float, 2, light); +MBGL_DEFINE_UNIFORM_VECTOR(float, 2, latrange); } // namespace uniforms class HillshadeProgram : public Program< HillshadeProgram, gfx::PrimitiveType::Triangle, TypeList< - attributes::a_pos, - attributes::a_texture_pos>, + attributes::pos, + attributes::texture_pos>, TypeList< - uniforms::u_matrix, - uniforms::u_highlight, - uniforms::u_shadow, - uniforms::u_accent, - uniforms::u_light, - uniforms::u_latrange>, + uniforms::matrix, + uniforms::highlight, + uniforms::shadow, + uniforms::accent, + uniforms::light, + uniforms::latrange>, TypeList< - textures::u_image>, + textures::image>, style::HillshadePaintProperties>{ public: using Program::Program; diff --git a/src/mbgl/programs/line_program.cpp b/src/mbgl/programs/line_program.cpp index 74a1ba3162..9e035ff245 100644 --- a/src/mbgl/programs/line_program.cpp +++ b/src/mbgl/programs/line_program.cpp @@ -26,13 +26,13 @@ Values makeValues(const RenderLinePaintProperties::PossiblyEvaluated& properties Args&&... args) { return Values { - uniforms::u_matrix::Value( + uniforms::matrix::Value( tile.translatedMatrix(properties.get<LineTranslate>(), properties.get<LineTranslateAnchor>(), state) ), - uniforms::u_ratio::Value( 1.0f / tile.id.pixelsToTileUnits(1.0, state.getZoom()) ), - uniforms::u_gl_units_to_pixels::Value({ {1.0f / pixelsToGLUnits[0], 1.0f / pixelsToGLUnits[1]} }), + uniforms::ratio::Value( 1.0f / tile.id.pixelsToTileUnits(1.0, state.getZoom()) ), + uniforms::gl_units_to_pixels::Value({ {1.0f / pixelsToGLUnits[0], 1.0f / pixelsToGLUnits[1]} }), std::forward<Args>(args)... }; } @@ -78,12 +78,12 @@ LineSDFProgram::layoutUniformValues(const RenderLinePaintProperties::PossiblyEva tile, state, pixelsToGLUnits, - uniforms::u_patternscale_a::Value( scaleA ), - uniforms::u_patternscale_b::Value( scaleB ), - uniforms::u_tex_y_a::Value( posA.y ), - uniforms::u_tex_y_b::Value( posB.y ), - uniforms::u_mix::Value( crossfade.t ), - uniforms::u_sdfgamma::Value( atlasWidth / (std::min(widthA, widthB) * 256.0f * pixelRatio) / 2.0f ) + uniforms::patternscale_a::Value( scaleA ), + uniforms::patternscale_b::Value( scaleB ), + uniforms::tex_y_a::Value( posA.y ), + uniforms::tex_y_b::Value( posB.y ), + uniforms::mix::Value( crossfade.t ), + uniforms::sdfgamma::Value( atlasWidth / (std::min(widthA, widthB) * 256.0f * pixelRatio) / 2.0f ) ); } @@ -103,9 +103,9 @@ LinePatternProgram::LayoutUniformValues LinePatternProgram::layoutUniformValues( tile, state, pixelsToGLUnits, - uniforms::u_scale::Value ({ {pixelRatio, tileRatio, crossfade.fromScale, crossfade.toScale} }), - uniforms::u_texsize::Value( atlasSize ), - uniforms::u_fade::Value( crossfade.t ) + uniforms::scale::Value ({ {pixelRatio, tileRatio, crossfade.fromScale, crossfade.toScale} }), + uniforms::texsize::Value( atlasSize ), + uniforms::fade::Value( crossfade.t ) ); } diff --git a/src/mbgl/programs/line_program.hpp b/src/mbgl/programs/line_program.hpp index 05546e3cbe..9ec01bd3ac 100644 --- a/src/mbgl/programs/line_program.hpp +++ b/src/mbgl/programs/line_program.hpp @@ -17,27 +17,27 @@ class LinePatternPos; class ImagePosition; namespace uniforms { -MBGL_DEFINE_UNIFORM_SCALAR(float, u_ratio); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_tex_y_a); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_tex_y_b); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_sdfgamma); -MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_patternscale_a); -MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_patternscale_b); -MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_gl_units_to_pixels); +MBGL_DEFINE_UNIFORM_SCALAR(float, ratio); +MBGL_DEFINE_UNIFORM_SCALAR(float, tex_y_a); +MBGL_DEFINE_UNIFORM_SCALAR(float, tex_y_b); +MBGL_DEFINE_UNIFORM_SCALAR(float, sdfgamma); +MBGL_DEFINE_UNIFORM_VECTOR(float, 2, patternscale_a); +MBGL_DEFINE_UNIFORM_VECTOR(float, 2, patternscale_b); +MBGL_DEFINE_UNIFORM_VECTOR(float, 2, gl_units_to_pixels); } // namespace uniforms using LineLayoutAttributes = TypeList< - attributes::a_pos_normal, - attributes::a_data<uint8_t, 4>>; + attributes::pos_normal, + attributes::data<uint8_t, 4>>; class LineProgram : public Program< LineProgram, gfx::PrimitiveType::Triangle, LineLayoutAttributes, TypeList< - uniforms::u_matrix, - uniforms::u_ratio, - uniforms::u_gl_units_to_pixels>, + uniforms::matrix, + uniforms::ratio, + uniforms::gl_units_to_pixels>, TypeList<>, RenderLinePaintProperties> { @@ -101,14 +101,14 @@ class LinePatternProgram : public Program< gfx::PrimitiveType::Triangle, LineLayoutAttributes, TypeList< - uniforms::u_matrix, - uniforms::u_ratio, - uniforms::u_gl_units_to_pixels, - uniforms::u_scale, - uniforms::u_texsize, - uniforms::u_fade>, + uniforms::matrix, + uniforms::ratio, + uniforms::gl_units_to_pixels, + uniforms::scale, + uniforms::texsize, + uniforms::fade>, TypeList< - textures::u_image>, + textures::image>, RenderLinePaintProperties> { public: @@ -129,17 +129,17 @@ class LineSDFProgram : public Program< gfx::PrimitiveType::Triangle, LineLayoutAttributes, TypeList< - uniforms::u_matrix, - uniforms::u_ratio, - uniforms::u_gl_units_to_pixels, - uniforms::u_patternscale_a, - uniforms::u_patternscale_b, - uniforms::u_tex_y_a, - uniforms::u_tex_y_b, - uniforms::u_mix, - uniforms::u_sdfgamma>, + uniforms::matrix, + uniforms::ratio, + uniforms::gl_units_to_pixels, + uniforms::patternscale_a, + uniforms::patternscale_b, + uniforms::tex_y_a, + uniforms::tex_y_b, + uniforms::mix, + uniforms::sdfgamma>, TypeList< - textures::u_image>, + textures::image>, RenderLinePaintProperties> { public: @@ -162,11 +162,11 @@ class LineGradientProgram : public Program< gfx::PrimitiveType::Triangle, LineLayoutAttributes, TypeList< - uniforms::u_matrix, - uniforms::u_ratio, - uniforms::u_gl_units_to_pixels>, + uniforms::matrix, + uniforms::ratio, + uniforms::gl_units_to_pixels>, TypeList< - textures::u_image>, + textures::image>, RenderLinePaintProperties> { public: diff --git a/src/mbgl/programs/raster_program.hpp b/src/mbgl/programs/raster_program.hpp index 55f1fb0a2e..e84ada0bdc 100644 --- a/src/mbgl/programs/raster_program.hpp +++ b/src/mbgl/programs/raster_program.hpp @@ -10,38 +10,38 @@ namespace mbgl { namespace uniforms { -MBGL_DEFINE_UNIFORM_SCALAR(float, u_fade_t); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_buffer_scale); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_brightness_low); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_brightness_high); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_saturation_factor); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_contrast_factor); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_scale_parent); -MBGL_DEFINE_UNIFORM_VECTOR(float, 3, u_spin_weights); -MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_tl_parent); +MBGL_DEFINE_UNIFORM_SCALAR(float, fade_t); +MBGL_DEFINE_UNIFORM_SCALAR(float, buffer_scale); +MBGL_DEFINE_UNIFORM_SCALAR(float, brightness_low); +MBGL_DEFINE_UNIFORM_SCALAR(float, brightness_high); +MBGL_DEFINE_UNIFORM_SCALAR(float, saturation_factor); +MBGL_DEFINE_UNIFORM_SCALAR(float, contrast_factor); +MBGL_DEFINE_UNIFORM_SCALAR(float, scale_parent); +MBGL_DEFINE_UNIFORM_VECTOR(float, 3, spin_weights); +MBGL_DEFINE_UNIFORM_VECTOR(float, 2, tl_parent); } // namespace uniforms class RasterProgram : public Program< RasterProgram, gfx::PrimitiveType::Triangle, TypeList< - attributes::a_pos, - attributes::a_texture_pos>, + attributes::pos, + attributes::texture_pos>, TypeList< - uniforms::u_matrix, - uniforms::u_opacity, - uniforms::u_fade_t, - uniforms::u_brightness_low, - uniforms::u_brightness_high, - uniforms::u_saturation_factor, - uniforms::u_contrast_factor, - uniforms::u_spin_weights, - uniforms::u_buffer_scale, - uniforms::u_scale_parent, - uniforms::u_tl_parent>, + uniforms::matrix, + uniforms::opacity, + uniforms::fade_t, + uniforms::brightness_low, + uniforms::brightness_high, + uniforms::saturation_factor, + uniforms::contrast_factor, + uniforms::spin_weights, + uniforms::buffer_scale, + uniforms::scale_parent, + uniforms::tl_parent>, TypeList< - textures::u_image0, - textures::u_image1>, + textures::image0, + textures::image1>, style::RasterPaintProperties> { public: diff --git a/src/mbgl/programs/symbol_program.cpp b/src/mbgl/programs/symbol_program.cpp index 2300dedff3..0195506129 100644 --- a/src/mbgl/programs/symbol_program.cpp +++ b/src/mbgl/programs/symbol_program.cpp @@ -82,24 +82,24 @@ Values makeValues(const bool isText, mat4 glCoordMatrix = getGlCoordMatrix(tile.matrix, pitchWithMap, rotateWithMap, state, pixelsToTileUnits); return Values { - uniforms::u_matrix::Value( tile.translatedMatrix(values.translate, + uniforms::matrix::Value( tile.translatedMatrix(values.translate, values.translateAnchor, state) ), - uniforms::u_label_plane_matrix::Value(labelPlaneMatrix), - uniforms::u_gl_coord_matrix::Value( tile.translateVtxMatrix(glCoordMatrix, + uniforms::label_plane_matrix::Value(labelPlaneMatrix), + uniforms::gl_coord_matrix::Value( tile.translateVtxMatrix(glCoordMatrix, values.translate, values.translateAnchor, state, true) ), - uniforms::u_extrude_scale::Value( extrudeScale ), - uniforms::u_texsize::Value( texsize ), - uniforms::u_fade_change::Value( symbolFadeChange ), - uniforms::u_is_text::Value( isText ), - uniforms::u_camera_to_center_distance::Value( state.getCameraToCenterDistance() ), - uniforms::u_pitch::Value( state.getPitch() ), - uniforms::u_pitch_with_map::Value( pitchWithMap ), - uniforms::u_rotate_symbol::Value( rotateInShader ), - uniforms::u_aspect_ratio::Value( state.getSize().aspectRatio() ), + uniforms::extrude_scale::Value( extrudeScale ), + uniforms::texsize::Value( texsize ), + uniforms::fade_change::Value( symbolFadeChange ), + uniforms::is_text::Value( isText ), + uniforms::camera_to_center_distance::Value( state.getCameraToCenterDistance() ), + uniforms::pitch::Value( state.getPitch() ), + uniforms::pitch_with_map::Value( pitchWithMap ), + uniforms::rotate_symbol::Value( rotateInShader ), + uniforms::aspect_ratio::Value( state.getSize().aspectRatio() ), std::forward<Args>(args)... }; } @@ -149,8 +149,8 @@ SymbolSDFProgram<Name, PaintProperties>::layoutUniformValues(const bool isText, tile, state, symbolFadeChange, - uniforms::u_gamma_scale::Value( gammaScale ), - uniforms::u_is_halo::Value( part == SymbolSDFPart::Halo ) + uniforms::gamma_scale::Value( gammaScale ), + uniforms::is_halo::Value( part == SymbolSDFPart::Halo ) ); } diff --git a/src/mbgl/programs/symbol_program.hpp b/src/mbgl/programs/symbol_program.hpp index d5fb153bbb..66e53647ef 100644 --- a/src/mbgl/programs/symbol_program.hpp +++ b/src/mbgl/programs/symbol_program.hpp @@ -28,27 +28,27 @@ class RenderTile; class TransformState; namespace uniforms { -MBGL_DEFINE_UNIFORM_MATRIX(double, 4, u_gl_coord_matrix); -MBGL_DEFINE_UNIFORM_MATRIX(double, 4, u_label_plane_matrix); -MBGL_DEFINE_UNIFORM_SCALAR(bool, u_is_halo); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_gamma_scale); - -MBGL_DEFINE_UNIFORM_SCALAR(bool, u_is_text); -MBGL_DEFINE_UNIFORM_SCALAR(bool, u_is_size_zoom_constant); -MBGL_DEFINE_UNIFORM_SCALAR(bool, u_is_size_feature_constant); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_size_t); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_size); -MBGL_DEFINE_UNIFORM_SCALAR(bool, u_rotate_symbol); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_aspect_ratio); +MBGL_DEFINE_UNIFORM_MATRIX(double, 4, gl_coord_matrix); +MBGL_DEFINE_UNIFORM_MATRIX(double, 4, label_plane_matrix); +MBGL_DEFINE_UNIFORM_SCALAR(bool, is_halo); +MBGL_DEFINE_UNIFORM_SCALAR(float, gamma_scale); + +MBGL_DEFINE_UNIFORM_SCALAR(bool, is_text); +MBGL_DEFINE_UNIFORM_SCALAR(bool, is_size_zoom_constant); +MBGL_DEFINE_UNIFORM_SCALAR(bool, is_size_feature_constant); +MBGL_DEFINE_UNIFORM_SCALAR(float, size_t); +MBGL_DEFINE_UNIFORM_SCALAR(float, size); +MBGL_DEFINE_UNIFORM_SCALAR(bool, rotate_symbol); +MBGL_DEFINE_UNIFORM_SCALAR(float, aspect_ratio); } // namespace uniforms using SymbolLayoutAttributes = TypeList< - attributes::a_pos_offset, - attributes::a_data<uint16_t, 4>>; + attributes::pos_offset, + attributes::data<uint16_t, 4>>; -using SymbolDynamicLayoutAttributes = TypeList<attributes::a_projected_pos>; +using SymbolDynamicLayoutAttributes = TypeList<attributes::projected_pos>; -using SymbolOpacityAttributes = TypeList<attributes::a_fade_opacity>; +using SymbolOpacityAttributes = TypeList<attributes::fade_opacity>; struct ZoomEvaluatedSize { bool isZoomConstant; @@ -66,10 +66,10 @@ public: virtual ~SymbolSizeBinder() = default; using UniformList = TypeList< - uniforms::u_is_size_zoom_constant, - uniforms::u_is_size_feature_constant, - uniforms::u_size_t, - uniforms::u_size>; + uniforms::is_size_zoom_constant, + uniforms::is_size_feature_constant, + uniforms::size_t, + uniforms::size>; using UniformValues = gfx::UniformValues<UniformList>; static std::unique_ptr<SymbolSizeBinder> create(const float tileZoom, @@ -82,10 +82,10 @@ public: UniformValues uniformValues(float currentZoom) const { const ZoomEvaluatedSize u = evaluateForZoom(currentZoom); return UniformValues { - uniforms::u_is_size_zoom_constant::Value( u.isZoomConstant ), - uniforms::u_is_size_feature_constant::Value( u.isFeatureConstant), - uniforms::u_size_t::Value( u.sizeT ), - uniforms::u_size::Value( u.size ) + uniforms::is_size_zoom_constant::Value( u.isZoomConstant ), + uniforms::is_size_feature_constant::Value( u.isFeatureConstant), + uniforms::size_t::Value( u.sizeT ), + uniforms::size::Value( u.size ) }; } }; @@ -347,20 +347,20 @@ class SymbolIconProgram : public SymbolProgram< gfx::PrimitiveType::Triangle, SymbolLayoutAttributes, TypeList< - uniforms::u_matrix, - uniforms::u_label_plane_matrix, - uniforms::u_gl_coord_matrix, - uniforms::u_extrude_scale, - uniforms::u_texsize, - uniforms::u_fade_change, - uniforms::u_is_text, - uniforms::u_camera_to_center_distance, - uniforms::u_pitch, - uniforms::u_pitch_with_map, - uniforms::u_rotate_symbol, - uniforms::u_aspect_ratio>, + uniforms::matrix, + uniforms::label_plane_matrix, + uniforms::gl_coord_matrix, + uniforms::extrude_scale, + uniforms::texsize, + uniforms::fade_change, + uniforms::is_text, + uniforms::camera_to_center_distance, + uniforms::pitch, + uniforms::pitch_with_map, + uniforms::rotate_symbol, + uniforms::aspect_ratio>, TypeList< - textures::u_texture>, + textures::texture>, style::IconPaintProperties> { public: @@ -387,22 +387,22 @@ class SymbolSDFProgram : public SymbolProgram< gfx::PrimitiveType::Triangle, SymbolLayoutAttributes, TypeList< - uniforms::u_matrix, - uniforms::u_label_plane_matrix, - uniforms::u_gl_coord_matrix, - uniforms::u_extrude_scale, - uniforms::u_texsize, - uniforms::u_fade_change, - uniforms::u_is_text, - uniforms::u_camera_to_center_distance, - uniforms::u_pitch, - uniforms::u_pitch_with_map, - uniforms::u_rotate_symbol, - uniforms::u_aspect_ratio, - uniforms::u_gamma_scale, - uniforms::u_is_halo>, + uniforms::matrix, + uniforms::label_plane_matrix, + uniforms::gl_coord_matrix, + uniforms::extrude_scale, + uniforms::texsize, + uniforms::fade_change, + uniforms::is_text, + uniforms::camera_to_center_distance, + uniforms::pitch, + uniforms::pitch_with_map, + uniforms::rotate_symbol, + uniforms::aspect_ratio, + uniforms::gamma_scale, + uniforms::is_halo>, TypeList< - textures::u_texture>, + textures::texture>, PaintProperties> { public: @@ -411,22 +411,22 @@ public: gfx::PrimitiveType::Triangle, SymbolLayoutAttributes, TypeList< - uniforms::u_matrix, - uniforms::u_label_plane_matrix, - uniforms::u_gl_coord_matrix, - uniforms::u_extrude_scale, - uniforms::u_texsize, - uniforms::u_fade_change, - uniforms::u_is_text, - uniforms::u_camera_to_center_distance, - uniforms::u_pitch, - uniforms::u_pitch_with_map, - uniforms::u_rotate_symbol, - uniforms::u_aspect_ratio, - uniforms::u_gamma_scale, - uniforms::u_is_halo>, + uniforms::matrix, + uniforms::label_plane_matrix, + uniforms::gl_coord_matrix, + uniforms::extrude_scale, + uniforms::texsize, + uniforms::fade_change, + uniforms::is_text, + uniforms::camera_to_center_distance, + uniforms::pitch, + uniforms::pitch_with_map, + uniforms::rotate_symbol, + uniforms::aspect_ratio, + uniforms::gamma_scale, + uniforms::is_halo>, TypeList< - textures::u_texture>, + textures::texture>, PaintProperties>; using LayoutUniformValues = typename BaseProgram::LayoutUniformValues; diff --git a/src/mbgl/programs/textures.hpp b/src/mbgl/programs/textures.hpp index 32bc4a4a35..4c9de53366 100644 --- a/src/mbgl/programs/textures.hpp +++ b/src/mbgl/programs/textures.hpp @@ -5,11 +5,11 @@ namespace mbgl { namespace textures { -MBGL_DEFINE_TEXTURE(u_image); -MBGL_DEFINE_TEXTURE(u_image0); -MBGL_DEFINE_TEXTURE(u_image1); -MBGL_DEFINE_TEXTURE(u_color_ramp); -MBGL_DEFINE_TEXTURE(u_texture); +MBGL_DEFINE_TEXTURE(image); +MBGL_DEFINE_TEXTURE(image0); +MBGL_DEFINE_TEXTURE(image1); +MBGL_DEFINE_TEXTURE(color_ramp); +MBGL_DEFINE_TEXTURE(texture); } // namespace textures } // namespace mbgl diff --git a/src/mbgl/programs/uniforms.hpp b/src/mbgl/programs/uniforms.hpp index 79febf7f73..702b21def9 100644 --- a/src/mbgl/programs/uniforms.hpp +++ b/src/mbgl/programs/uniforms.hpp @@ -9,61 +9,61 @@ namespace uniforms { // Uniforms common to several shaders. -MBGL_DEFINE_UNIFORM_MATRIX(double, 4, u_matrix); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_opacity); -MBGL_DEFINE_UNIFORM_SCALAR(Color, u_color); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_blur); +MBGL_DEFINE_UNIFORM_MATRIX(double, 4, matrix); +MBGL_DEFINE_UNIFORM_SCALAR(float, opacity); +MBGL_DEFINE_UNIFORM_SCALAR(Color, color); +MBGL_DEFINE_UNIFORM_SCALAR(float, blur); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_zoom); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_collision_y_stretch); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_pitch); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_bearing); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_radius); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_stroke_width); -MBGL_DEFINE_UNIFORM_SCALAR(Color, u_stroke_color); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_stroke_opacity); -MBGL_DEFINE_UNIFORM_SCALAR(Color, u_fill_color); -MBGL_DEFINE_UNIFORM_SCALAR(Color, u_halo_color); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_halo_width); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_halo_blur); -MBGL_DEFINE_UNIFORM_SCALAR(Color, u_outline_color); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_height); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_base); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_width); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_floorwidth); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_gapwidth); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_offset); -MBGL_DEFINE_UNIFORM_SCALAR(Size, u_world); -MBGL_DEFINE_UNIFORM_SCALAR(Size, u_texsize); -MBGL_DEFINE_UNIFORM_SCALAR(bool, u_pitch_with_map); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_camera_to_center_distance); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_fade); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_fade_change); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_weight); +MBGL_DEFINE_UNIFORM_SCALAR(float, zoom); +MBGL_DEFINE_UNIFORM_SCALAR(float, collision_y_stretch); +MBGL_DEFINE_UNIFORM_SCALAR(float, pitch); +MBGL_DEFINE_UNIFORM_SCALAR(float, bearing); +MBGL_DEFINE_UNIFORM_SCALAR(float, radius); +MBGL_DEFINE_UNIFORM_SCALAR(float, stroke_width); +MBGL_DEFINE_UNIFORM_SCALAR(Color, stroke_color); +MBGL_DEFINE_UNIFORM_SCALAR(float, stroke_opacity); +MBGL_DEFINE_UNIFORM_SCALAR(Color, fill_color); +MBGL_DEFINE_UNIFORM_SCALAR(Color, halo_color); +MBGL_DEFINE_UNIFORM_SCALAR(float, halo_width); +MBGL_DEFINE_UNIFORM_SCALAR(float, halo_blur); +MBGL_DEFINE_UNIFORM_SCALAR(Color, outline_color); +MBGL_DEFINE_UNIFORM_SCALAR(float, height); +MBGL_DEFINE_UNIFORM_SCALAR(float, base); +MBGL_DEFINE_UNIFORM_SCALAR(float, width); +MBGL_DEFINE_UNIFORM_SCALAR(float, floorwidth); +MBGL_DEFINE_UNIFORM_SCALAR(float, gapwidth); +MBGL_DEFINE_UNIFORM_SCALAR(float, offset); +MBGL_DEFINE_UNIFORM_SCALAR(Size, world); +MBGL_DEFINE_UNIFORM_SCALAR(Size, texsize); +MBGL_DEFINE_UNIFORM_SCALAR(bool, pitch_with_map); +MBGL_DEFINE_UNIFORM_SCALAR(float, camera_to_center_distance); +MBGL_DEFINE_UNIFORM_SCALAR(float, fade); +MBGL_DEFINE_UNIFORM_SCALAR(float, fade_change); +MBGL_DEFINE_UNIFORM_SCALAR(float, weight); -MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_extrude_scale); +MBGL_DEFINE_UNIFORM_VECTOR(float, 2, extrude_scale); namespace heatmap { -MBGL_DEFINE_UNIFORM_SCALAR(float, u_extrude_scale); +MBGL_DEFINE_UNIFORM_SCALAR(float, extrude_scale); } // namespace heatmap -MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 4, u_pattern_from); -MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 4, u_pattern_to); -MBGL_DEFINE_UNIFORM_VECTOR(float, 4, u_scale); -MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 2, u_pattern_tl_a); -MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 2, u_pattern_br_a); -MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 2, u_pattern_tl_b); -MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 2, u_pattern_br_b); -MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_pattern_size_a); -MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_pattern_size_b); -MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_pixel_coord_upper); -MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_pixel_coord_lower); +MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 4, pattern_from); +MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 4, pattern_to); +MBGL_DEFINE_UNIFORM_VECTOR(float, 4, scale); +MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 2, pattern_tl_a); +MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 2, pattern_br_a); +MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 2, pattern_tl_b); +MBGL_DEFINE_UNIFORM_VECTOR(uint16_t, 2, pattern_br_b); +MBGL_DEFINE_UNIFORM_VECTOR(float, 2, pattern_size_a); +MBGL_DEFINE_UNIFORM_VECTOR(float, 2, pattern_size_b); +MBGL_DEFINE_UNIFORM_VECTOR(float, 2, pixel_coord_upper); +MBGL_DEFINE_UNIFORM_VECTOR(float, 2, pixel_coord_lower); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_mix); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_scale_a); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_scale_b); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_tile_units_to_pixels); -MBGL_DEFINE_UNIFORM_SCALAR(float, u_overscale_factor); +MBGL_DEFINE_UNIFORM_SCALAR(float, mix); +MBGL_DEFINE_UNIFORM_SCALAR(float, scale_a); +MBGL_DEFINE_UNIFORM_SCALAR(float, scale_b); +MBGL_DEFINE_UNIFORM_SCALAR(float, tile_units_to_pixels); +MBGL_DEFINE_UNIFORM_SCALAR(float, overscale_factor); } // namespace uniforms } // namespace mbgl diff --git a/src/mbgl/renderer/layers/render_background_layer.cpp b/src/mbgl/renderer/layers/render_background_layer.cpp index 68c792517c..269b227a7d 100644 --- a/src/mbgl/renderer/layers/render_background_layer.cpp +++ b/src/mbgl/renderer/layers/render_background_layer.cpp @@ -102,7 +102,7 @@ void RenderBackgroundLayer::render(PaintParameters& parameters, RenderSource*) { parameters.state ), BackgroundPatternProgram::TextureBindings{ - textures::u_image::Value{ parameters.imageManager.textureBinding(parameters.context) }, + textures::image::Value{ parameters.imageManager.textureBinding(parameters.context) }, } ); } @@ -111,9 +111,9 @@ void RenderBackgroundLayer::render(PaintParameters& parameters, RenderSource*) { draw( parameters.programs.getBackgroundLayerPrograms().background, BackgroundProgram::LayoutUniformValues { - uniforms::u_matrix::Value( parameters.matrixForTile(tileID) ), - uniforms::u_color::Value( evaluated.get<BackgroundColor>() ), - uniforms::u_opacity::Value( evaluated.get<BackgroundOpacity>() ), + uniforms::matrix::Value( parameters.matrixForTile(tileID) ), + uniforms::color::Value( evaluated.get<BackgroundColor>() ), + uniforms::opacity::Value( evaluated.get<BackgroundOpacity>() ), }, BackgroundProgram::TextureBindings{} ); diff --git a/src/mbgl/renderer/layers/render_circle_layer.cpp b/src/mbgl/renderer/layers/render_circle_layer.cpp index 2cc0d2e329..9b463e6a6f 100644 --- a/src/mbgl/renderer/layers/render_circle_layer.cpp +++ b/src/mbgl/renderer/layers/render_circle_layer.cpp @@ -69,19 +69,19 @@ void RenderCircleLayer::render(PaintParameters& parameters, RenderSource*) { const auto allUniformValues = programInstance.computeAllUniformValues( CircleProgram::LayoutUniformValues { - uniforms::u_matrix::Value( + uniforms::matrix::Value( tile.translatedMatrix(evaluated.get<CircleTranslate>(), evaluated.get<CircleTranslateAnchor>(), parameters.state) ), - uniforms::u_scale_with_map::Value( scaleWithMap ), - uniforms::u_extrude_scale::Value( pitchWithMap + uniforms::scale_with_map::Value( scaleWithMap ), + uniforms::extrude_scale::Value( pitchWithMap ? std::array<float, 2> {{ tile.id.pixelsToTileUnits(1, parameters.state.getZoom()), tile.id.pixelsToTileUnits(1, parameters.state.getZoom()) }} : parameters.pixelsToGLUnits ), - uniforms::u_camera_to_center_distance::Value( parameters.state.getCameraToCenterDistance() ), - uniforms::u_pitch_with_map::Value( pitchWithMap ) + uniforms::camera_to_center_distance::Value( parameters.state.getCameraToCenterDistance() ), + uniforms::pitch_with_map::Value( pitchWithMap ) }, paintPropertyBinders, evaluated, diff --git a/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp b/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp index a8c9f7a1c4..0d0c9034e1 100644 --- a/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp +++ b/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp @@ -163,7 +163,7 @@ void RenderFillExtrusionLayer::render(PaintParameters& parameters, RenderSource* patternPosA, patternPosB, FillExtrusionPatternProgram::TextureBindings{ - textures::u_image::Value{ *geometryTile.iconAtlasTexture->resource, gfx::TextureFilterType::Linear }, + textures::image::Value{ *geometryTile.iconAtlasTexture->resource, gfx::TextureFilterType::Linear }, } ); } @@ -182,9 +182,9 @@ void RenderFillExtrusionLayer::render(PaintParameters& parameters, RenderSource* const auto allUniformValues = programInstance.computeAllUniformValues( ExtrusionTextureProgram::LayoutUniformValues{ - uniforms::u_matrix::Value( viewportMat ), - uniforms::u_world::Value( size ), - uniforms::u_opacity::Value( evaluated.get<FillExtrusionOpacity>() ) + uniforms::matrix::Value( viewportMat ), + uniforms::world::Value( size ), + uniforms::opacity::Value( evaluated.get<FillExtrusionOpacity>() ) }, paintAttributeData, properties, @@ -210,7 +210,7 @@ void RenderFillExtrusionLayer::render(PaintParameters& parameters, RenderSource* allUniformValues, allAttributeBindings, ExtrusionTextureProgram::TextureBindings{ - textures::u_image::Value{ *renderTexture->getTexture().resource }, + textures::image::Value{ *renderTexture->getTexture().resource }, }, getID()); } diff --git a/src/mbgl/renderer/layers/render_fill_layer.cpp b/src/mbgl/renderer/layers/render_fill_layer.cpp index b11c2d23b6..2c6f1127f2 100644 --- a/src/mbgl/renderer/layers/render_fill_layer.cpp +++ b/src/mbgl/renderer/layers/render_fill_layer.cpp @@ -86,12 +86,12 @@ void RenderFillLayer::render(PaintParameters& parameters, RenderSource*) { const auto allUniformValues = programInstance.computeAllUniformValues( FillProgram::LayoutUniformValues { - uniforms::u_matrix::Value( + uniforms::matrix::Value( tile.translatedMatrix(evaluated.get<FillTranslate>(), evaluated.get<FillTranslateAnchor>(), parameters.state) ), - uniforms::u_world::Value( glContext.viewport.getCurrentValue().size ), + uniforms::world::Value( glContext.viewport.getCurrentValue().size ), }, paintPropertyBinders, evaluated, @@ -219,7 +219,7 @@ void RenderFillLayer::render(PaintParameters& parameters, RenderSource*) { *bucket.triangleIndexBuffer, bucket.triangleSegments, FillPatternProgram::TextureBindings{ - textures::u_image::Value{ *geometryTile.iconAtlasTexture->resource, gfx::TextureFilterType::Linear }, + textures::image::Value{ *geometryTile.iconAtlasTexture->resource, gfx::TextureFilterType::Linear }, }); if (evaluated.get<FillAntialias>() && unevaluated.get<FillOutlineColor>().isUndefined()) { @@ -229,7 +229,7 @@ void RenderFillLayer::render(PaintParameters& parameters, RenderSource*) { *bucket.lineIndexBuffer, bucket.lineSegments, FillOutlinePatternProgram::TextureBindings{ - textures::u_image::Value{ *geometryTile.iconAtlasTexture->resource, gfx::TextureFilterType::Linear }, + textures::image::Value{ *geometryTile.iconAtlasTexture->resource, gfx::TextureFilterType::Linear }, }); } } diff --git a/src/mbgl/renderer/layers/render_heatmap_layer.cpp b/src/mbgl/renderer/layers/render_heatmap_layer.cpp index 8ec6f7707b..a8d25df818 100644 --- a/src/mbgl/renderer/layers/render_heatmap_layer.cpp +++ b/src/mbgl/renderer/layers/render_heatmap_layer.cpp @@ -106,9 +106,9 @@ void RenderHeatmapLayer::render(PaintParameters& parameters, RenderSource*) { const auto allUniformValues = programInstance.computeAllUniformValues( HeatmapProgram::LayoutUniformValues { - uniforms::u_intensity::Value( evaluated.get<style::HeatmapIntensity>() ), - uniforms::u_matrix::Value( tile.matrix ), - uniforms::heatmap::u_extrude_scale::Value( extrudeScale ) + uniforms::intensity::Value( evaluated.get<style::HeatmapIntensity>() ), + uniforms::matrix::Value( tile.matrix ), + uniforms::heatmap::extrude_scale::Value( extrudeScale ) }, paintPropertyBinders, evaluated, @@ -151,9 +151,9 @@ void RenderHeatmapLayer::render(PaintParameters& parameters, RenderSource*) { const auto allUniformValues = programInstance.computeAllUniformValues( HeatmapTextureProgram::LayoutUniformValues{ - uniforms::u_matrix::Value( viewportMat ), - uniforms::u_world::Value( size ), - uniforms::u_opacity::Value( evaluated.get<HeatmapOpacity>() ) + uniforms::matrix::Value( viewportMat ), + uniforms::world::Value( size ), + uniforms::opacity::Value( evaluated.get<HeatmapOpacity>() ) }, paintAttributeData, properties, @@ -179,8 +179,8 @@ void RenderHeatmapLayer::render(PaintParameters& parameters, RenderSource*) { allUniformValues, allAttributeBindings, HeatmapTextureProgram::TextureBindings{ - textures::u_image::Value{ *renderTexture->getTexture().resource, gfx::TextureFilterType::Linear }, - textures::u_color_ramp::Value{ *colorRampTexture->resource, gfx::TextureFilterType::Linear }, + textures::image::Value{ *renderTexture->getTexture().resource, gfx::TextureFilterType::Linear }, + textures::color_ramp::Value{ *colorRampTexture->resource, gfx::TextureFilterType::Linear }, }, getID() ); diff --git a/src/mbgl/renderer/layers/render_hillshade_layer.cpp b/src/mbgl/renderer/layers/render_hillshade_layer.cpp index ff1def3d9a..1d030f5946 100644 --- a/src/mbgl/renderer/layers/render_hillshade_layer.cpp +++ b/src/mbgl/renderer/layers/render_hillshade_layer.cpp @@ -76,12 +76,12 @@ void RenderHillshadeLayer::render(PaintParameters& parameters, RenderSource* src const auto allUniformValues = programInstance.computeAllUniformValues( HillshadeProgram::LayoutUniformValues { - uniforms::u_matrix::Value( matrix ), - uniforms::u_highlight::Value( evaluated.get<HillshadeHighlightColor>() ), - uniforms::u_shadow::Value( evaluated.get<HillshadeShadowColor>() ), - uniforms::u_accent::Value( evaluated.get<HillshadeAccentColor>() ), - uniforms::u_light::Value( getLight(parameters) ), - uniforms::u_latrange::Value( getLatRange(id) ), + uniforms::matrix::Value( matrix ), + uniforms::highlight::Value( evaluated.get<HillshadeHighlightColor>() ), + uniforms::shadow::Value( evaluated.get<HillshadeShadowColor>() ), + uniforms::accent::Value( evaluated.get<HillshadeAccentColor>() ), + uniforms::light::Value( getLight(parameters) ), + uniforms::latrange::Value( getLatRange(id) ), }, paintAttributeData, evaluated, @@ -140,10 +140,10 @@ void RenderHillshadeLayer::render(PaintParameters& parameters, RenderSource* src const auto allUniformValues = programInstance.computeAllUniformValues( HillshadePrepareProgram::LayoutUniformValues { - uniforms::u_matrix::Value( mat ), - uniforms::u_dimension::Value( {{stride, stride}} ), - uniforms::u_zoom::Value( float(tile.id.canonical.z) ), - uniforms::u_maxzoom::Value( float(maxzoom) ), + uniforms::matrix::Value( mat ), + uniforms::dimension::Value( {{stride, stride}} ), + uniforms::zoom::Value( float(tile.id.canonical.z) ), + uniforms::maxzoom::Value( float(maxzoom) ), }, paintAttributeData, properties, @@ -169,7 +169,7 @@ void RenderHillshadeLayer::render(PaintParameters& parameters, RenderSource* src allUniformValues, allAttributeBindings, HillshadePrepareProgram::TextureBindings{ - textures::u_image::Value{ *bucket.dem->resource }, + textures::image::Value{ *bucket.dem->resource }, }, getID() ); @@ -186,7 +186,7 @@ void RenderHillshadeLayer::render(PaintParameters& parameters, RenderSource* src bucket.segments, tile.id, HillshadeProgram::TextureBindings{ - textures::u_image::Value{ *bucket.texture->resource, gfx::TextureFilterType::Linear }, + textures::image::Value{ *bucket.texture->resource, gfx::TextureFilterType::Linear }, }); } else { // Draw the full tile. @@ -196,7 +196,7 @@ void RenderHillshadeLayer::render(PaintParameters& parameters, RenderSource* src parameters.staticData.rasterSegments, tile.id, HillshadeProgram::TextureBindings{ - textures::u_image::Value{ *bucket.texture->resource, gfx::TextureFilterType::Linear }, + textures::image::Value{ *bucket.texture->resource, gfx::TextureFilterType::Linear }, }); } } diff --git a/src/mbgl/renderer/layers/render_line_layer.cpp b/src/mbgl/renderer/layers/render_line_layer.cpp index b52c28e6c6..60c487c205 100644 --- a/src/mbgl/renderer/layers/render_line_layer.cpp +++ b/src/mbgl/renderer/layers/render_line_layer.cpp @@ -147,7 +147,7 @@ void RenderLineLayer::render(PaintParameters& parameters, RenderSource*) { *posA, *posB, LinePatternProgram::TextureBindings{ - textures::u_image::Value{ *geometryTile.iconAtlasTexture->resource, gfx::TextureFilterType::Linear }, + textures::image::Value{ *geometryTile.iconAtlasTexture->resource, gfx::TextureFilterType::Linear }, }); } else if (!unevaluated.get<LineGradient>().getValue().isUndefined()) { if (!colorRampTexture) { @@ -163,7 +163,7 @@ void RenderLineLayer::render(PaintParameters& parameters, RenderSource*) { {}, {}, LineGradientProgram::TextureBindings{ - textures::u_image::Value{ *colorRampTexture->resource, gfx::TextureFilterType::Linear }, + textures::image::Value{ *colorRampTexture->resource, gfx::TextureFilterType::Linear }, }); } else { draw(parameters.programs.getLineLayerPrograms().line, diff --git a/src/mbgl/renderer/layers/render_line_layer.hpp b/src/mbgl/renderer/layers/render_line_layer.hpp index 186b740234..2f76274691 100644 --- a/src/mbgl/renderer/layers/render_line_layer.hpp +++ b/src/mbgl/renderer/layers/render_line_layer.hpp @@ -10,7 +10,7 @@ namespace mbgl { -struct LineFloorwidth : style::DataDrivenPaintProperty<float, attributes::a_floorwidth, uniforms::u_floorwidth> { +struct LineFloorwidth : style::DataDrivenPaintProperty<float, attributes::floorwidth, uniforms::floorwidth> { using EvaluatorType = DataDrivenPropertyEvaluator<float, true>; static float defaultValue() { return 1.0; } }; diff --git a/src/mbgl/renderer/layers/render_raster_layer.cpp b/src/mbgl/renderer/layers/render_raster_layer.cpp index c237cfe317..94c4a8dc42 100644 --- a/src/mbgl/renderer/layers/render_raster_layer.cpp +++ b/src/mbgl/renderer/layers/render_raster_layer.cpp @@ -84,17 +84,17 @@ void RenderRasterLayer::render(PaintParameters& parameters, RenderSource* source const auto allUniformValues = programInstance.computeAllUniformValues( RasterProgram::LayoutUniformValues { - uniforms::u_matrix::Value( matrix ), - uniforms::u_opacity::Value( evaluated.get<RasterOpacity>() ), - uniforms::u_fade_t::Value( 1 ), - uniforms::u_brightness_low::Value( evaluated.get<RasterBrightnessMin>() ), - uniforms::u_brightness_high::Value( evaluated.get<RasterBrightnessMax>() ), - uniforms::u_saturation_factor::Value( saturationFactor(evaluated.get<RasterSaturation>()) ), - uniforms::u_contrast_factor::Value( contrastFactor(evaluated.get<RasterContrast>()) ), - uniforms::u_spin_weights::Value( spinWeights(evaluated.get<RasterHueRotate>()) ), - uniforms::u_buffer_scale::Value( 1.0f ), - uniforms::u_scale_parent::Value( 1.0f ), - uniforms::u_tl_parent::Value( std::array<float, 2> {{ 0.0f, 0.0f }} ), + uniforms::matrix::Value( matrix ), + uniforms::opacity::Value( evaluated.get<RasterOpacity>() ), + uniforms::fade_t::Value( 1 ), + uniforms::brightness_low::Value( evaluated.get<RasterBrightnessMin>() ), + uniforms::brightness_high::Value( evaluated.get<RasterBrightnessMax>() ), + uniforms::saturation_factor::Value( saturationFactor(evaluated.get<RasterSaturation>()) ), + uniforms::contrast_factor::Value( contrastFactor(evaluated.get<RasterContrast>()) ), + uniforms::spin_weights::Value( spinWeights(evaluated.get<RasterHueRotate>()) ), + uniforms::buffer_scale::Value( 1.0f ), + uniforms::scale_parent::Value( 1.0f ), + uniforms::tl_parent::Value( std::array<float, 2> {{ 0.0f, 0.0f }} ), }, paintAttributeData, evaluated, @@ -137,8 +137,8 @@ void RenderRasterLayer::render(PaintParameters& parameters, RenderSource* source *bucket.indexBuffer, bucket.segments, RasterProgram::TextureBindings{ - textures::u_image0::Value{ *bucket.texture->resource, filter }, - textures::u_image1::Value{ *bucket.texture->resource, filter }, + textures::image0::Value{ *bucket.texture->resource, filter }, + textures::image1::Value{ *bucket.texture->resource, filter }, }); } } @@ -161,8 +161,8 @@ void RenderRasterLayer::render(PaintParameters& parameters, RenderSource* source *bucket.indexBuffer, bucket.segments, RasterProgram::TextureBindings{ - textures::u_image0::Value{ *bucket.texture->resource, filter }, - textures::u_image1::Value{ *bucket.texture->resource, filter }, + textures::image0::Value{ *bucket.texture->resource, filter }, + textures::image1::Value{ *bucket.texture->resource, filter }, }); } else { // Draw the full tile. @@ -171,8 +171,8 @@ void RenderRasterLayer::render(PaintParameters& parameters, RenderSource* source parameters.staticData.quadTriangleIndexBuffer, parameters.staticData.rasterSegments, RasterProgram::TextureBindings{ - textures::u_image0::Value{ *bucket.texture->resource, filter }, - textures::u_image1::Value{ *bucket.texture->resource, filter }, + textures::image0::Value{ *bucket.texture->resource, filter }, + textures::image1::Value{ *bucket.texture->resource, filter }, }); } } diff --git a/src/mbgl/renderer/layers/render_symbol_layer.cpp b/src/mbgl/renderer/layers/render_symbol_layer.cpp index fc05439010..5fbc81663c 100644 --- a/src/mbgl/renderer/layers/render_symbol_layer.cpp +++ b/src/mbgl/renderer/layers/render_symbol_layer.cpp @@ -279,9 +279,9 @@ void RenderSymbolLayer::render(PaintParameters& parameters, RenderSource*) { parameters.colorModeForRenderPass(), gfx::CullFaceMode::disabled(), CollisionBoxProgram::LayoutUniformValues { - uniforms::u_matrix::Value( tile.matrix ), - uniforms::u_extrude_scale::Value( extrudeScale ), - uniforms::u_camera_to_center_distance::Value( parameters.state.getCameraToCenterDistance() ) + uniforms::matrix::Value( tile.matrix ), + uniforms::extrude_scale::Value( extrudeScale ), + uniforms::camera_to_center_distance::Value( parameters.state.getCameraToCenterDistance() ) }, *bucket.collisionBox.vertexBuffer, *bucket.collisionBox.dynamicVertexBuffer, @@ -315,10 +315,10 @@ void RenderSymbolLayer::render(PaintParameters& parameters, RenderSource*) { parameters.colorModeForRenderPass(), gfx::CullFaceMode::disabled(), CollisionCircleProgram::LayoutUniformValues { - uniforms::u_matrix::Value( tile.matrix ), - uniforms::u_extrude_scale::Value( extrudeScale ), - uniforms::u_overscale_factor::Value( float(tile.tile.id.overscaleFactor()) ), - uniforms::u_camera_to_center_distance::Value( parameters.state.getCameraToCenterDistance() ) + uniforms::matrix::Value( tile.matrix ), + uniforms::extrude_scale::Value( extrudeScale ), + uniforms::overscale_factor::Value( float(tile.tile.id.overscaleFactor()) ), + uniforms::camera_to_center_distance::Value( parameters.state.getCameraToCenterDistance() ) }, *bucket.collisionCircle.vertexBuffer, *bucket.collisionCircle.dynamicVertexBuffer, diff --git a/src/mbgl/renderer/paint_property_binder.hpp b/src/mbgl/renderer/paint_property_binder.hpp index a014b36ece..6c2c07950d 100644 --- a/src/mbgl/renderer/paint_property_binder.hpp +++ b/src/mbgl/renderer/paint_property_binder.hpp @@ -432,15 +432,15 @@ PaintPropertyBinder<T, UniformValueType, PossiblyEvaluatedType, As...>::create(c template <class Attr> struct ZoomInterpolatedAttribute { - static auto name() { return Attr::name(); } + static auto attributeName() { return Attr::attributeName(); } using Type = ZoomInterpolatedAttributeType<typename Attr::Type>; }; template <class Attr> struct InterpolationUniform { using Value = float; - static auto name() { - static const std::string name = Attr::name() + std::string("_t"); + static auto uniformName() { + static const std::string name = Attr::attributeName() + std::string("_t"); return name.c_str(); } }; @@ -553,7 +553,7 @@ public: struct UniformDefines<TypeList<Us...>> { static void appendDefines(std::vector<std::string>& defines) { util::ignore({ - (defines.push_back(std::string("#define HAS_UNIFORM_") + Us::name()), 0)... + (defines.push_back(std::string("#define HAS_UNIFORM_") + Us::uniformName()), 0)... }); } }; diff --git a/src/mbgl/renderer/render_tile.cpp b/src/mbgl/renderer/render_tile.cpp index 8490b41d37..745a577683 100644 --- a/src/mbgl/renderer/render_tile.cpp +++ b/src/mbgl/renderer/render_tile.cpp @@ -105,8 +105,8 @@ void RenderTile::finishRender(PaintParameters& parameters) { tile.debugBucket->segments, program.computeAllUniformValues( DebugProgram::LayoutUniformValues { - uniforms::u_matrix::Value( matrix ), - uniforms::u_color::Value( Color::white() ) + uniforms::matrix::Value( matrix ), + uniforms::color::Value( Color::white() ) }, paintAttributeData, properties, @@ -128,8 +128,8 @@ void RenderTile::finishRender(PaintParameters& parameters) { tile.debugBucket->segments, program.computeAllUniformValues( DebugProgram::LayoutUniformValues { - uniforms::u_matrix::Value( matrix ), - uniforms::u_color::Value( Color::black() ) + uniforms::matrix::Value( matrix ), + uniforms::color::Value( Color::black() ) }, paintAttributeData, properties, @@ -153,8 +153,8 @@ void RenderTile::finishRender(PaintParameters& parameters) { parameters.staticData.tileBorderSegments, program.computeAllUniformValues( DebugProgram::LayoutUniformValues { - uniforms::u_matrix::Value( matrix ), - uniforms::u_color::Value( Color::red() ) + uniforms::matrix::Value( matrix ), + uniforms::color::Value( Color::red() ) }, paintAttributeData, properties, diff --git a/src/mbgl/renderer/renderer_impl.cpp b/src/mbgl/renderer/renderer_impl.cpp index d12cb00de0..dee42a6128 100644 --- a/src/mbgl/renderer/renderer_impl.cpp +++ b/src/mbgl/renderer/renderer_impl.cpp @@ -466,7 +466,7 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) { parameters.staticData.tileTriangleSegments, program.computeAllUniformValues( ClippingMaskProgram::LayoutUniformValues { - uniforms::u_matrix::Value( parameters.matrixForTile(clipID.first) ), + uniforms::matrix::Value( parameters.matrixForTile(clipID.first) ), }, paintAttributeData, properties, diff --git a/src/mbgl/renderer/sources/render_image_source.cpp b/src/mbgl/renderer/sources/render_image_source.cpp index 5bb520be78..dee3eab750 100644 --- a/src/mbgl/renderer/sources/render_image_source.cpp +++ b/src/mbgl/renderer/sources/render_image_source.cpp @@ -73,8 +73,8 @@ void RenderImageSource::finishRender(PaintParameters& parameters) { parameters.staticData.tileBorderSegments, programInstance.computeAllUniformValues( DebugProgram::LayoutUniformValues { - uniforms::u_matrix::Value( matrix ), - uniforms::u_color::Value( Color::red() ) + uniforms::matrix::Value( matrix ), + uniforms::color::Value( Color::red() ) }, paintAttributeData, properties, diff --git a/src/mbgl/style/layers/circle_layer_properties.hpp b/src/mbgl/style/layers/circle_layer_properties.hpp index bc0c961e75..57caba9e3a 100644 --- a/src/mbgl/style/layers/circle_layer_properties.hpp +++ b/src/mbgl/style/layers/circle_layer_properties.hpp @@ -12,19 +12,19 @@ namespace mbgl { namespace style { -struct CircleRadius : DataDrivenPaintProperty<float, attributes::a_radius, uniforms::u_radius> { +struct CircleRadius : DataDrivenPaintProperty<float, attributes::radius, uniforms::radius> { static float defaultValue() { return 5; } }; -struct CircleColor : DataDrivenPaintProperty<Color, attributes::a_color, uniforms::u_color> { +struct CircleColor : DataDrivenPaintProperty<Color, attributes::color, uniforms::color> { static Color defaultValue() { return Color::black(); } }; -struct CircleBlur : DataDrivenPaintProperty<float, attributes::a_blur, uniforms::u_blur> { +struct CircleBlur : DataDrivenPaintProperty<float, attributes::blur, uniforms::blur> { static float defaultValue() { return 0; } }; -struct CircleOpacity : DataDrivenPaintProperty<float, attributes::a_opacity, uniforms::u_opacity> { +struct CircleOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniforms::opacity> { static float defaultValue() { return 1; } }; @@ -44,15 +44,15 @@ struct CirclePitchAlignment : PaintProperty<AlignmentType> { static AlignmentType defaultValue() { return AlignmentType::Viewport; } }; -struct CircleStrokeWidth : DataDrivenPaintProperty<float, attributes::a_stroke_width, uniforms::u_stroke_width> { +struct CircleStrokeWidth : DataDrivenPaintProperty<float, attributes::stroke_width, uniforms::stroke_width> { static float defaultValue() { return 0; } }; -struct CircleStrokeColor : DataDrivenPaintProperty<Color, attributes::a_stroke_color, uniforms::u_stroke_color> { +struct CircleStrokeColor : DataDrivenPaintProperty<Color, attributes::stroke_color, uniforms::stroke_color> { static Color defaultValue() { return Color::black(); } }; -struct CircleStrokeOpacity : DataDrivenPaintProperty<float, attributes::a_stroke_opacity, uniforms::u_stroke_opacity> { +struct CircleStrokeOpacity : DataDrivenPaintProperty<float, attributes::stroke_opacity, uniforms::stroke_opacity> { static float defaultValue() { return 1; } }; diff --git a/src/mbgl/style/layers/fill_extrusion_layer_properties.hpp b/src/mbgl/style/layers/fill_extrusion_layer_properties.hpp index 20cba699fe..a7799eee22 100644 --- a/src/mbgl/style/layers/fill_extrusion_layer_properties.hpp +++ b/src/mbgl/style/layers/fill_extrusion_layer_properties.hpp @@ -16,7 +16,7 @@ struct FillExtrusionOpacity : PaintProperty<float> { static float defaultValue() { return 1; } }; -struct FillExtrusionColor : DataDrivenPaintProperty<Color, attributes::a_color, uniforms::u_color> { +struct FillExtrusionColor : DataDrivenPaintProperty<Color, attributes::color, uniforms::color> { static Color defaultValue() { return Color::black(); } }; @@ -28,15 +28,15 @@ struct FillExtrusionTranslateAnchor : PaintProperty<TranslateAnchorType> { static TranslateAnchorType defaultValue() { return TranslateAnchorType::Map; } }; -struct FillExtrusionPattern : CrossFadedDataDrivenPaintProperty<std::string, attributes::a_pattern_to, uniforms::u_pattern_to, attributes::a_pattern_from, uniforms::u_pattern_from> { +struct FillExtrusionPattern : CrossFadedDataDrivenPaintProperty<std::string, attributes::pattern_to, uniforms::pattern_to, attributes::pattern_from, uniforms::pattern_from> { static std::string defaultValue() { return ""; } }; -struct FillExtrusionHeight : DataDrivenPaintProperty<float, attributes::a_height, uniforms::u_height> { +struct FillExtrusionHeight : DataDrivenPaintProperty<float, attributes::height, uniforms::height> { static float defaultValue() { return 0; } }; -struct FillExtrusionBase : DataDrivenPaintProperty<float, attributes::a_base, uniforms::u_base> { +struct FillExtrusionBase : DataDrivenPaintProperty<float, attributes::base, uniforms::base> { static float defaultValue() { return 0; } }; diff --git a/src/mbgl/style/layers/fill_layer_properties.hpp b/src/mbgl/style/layers/fill_layer_properties.hpp index a20089ff2e..942733f2e1 100644 --- a/src/mbgl/style/layers/fill_layer_properties.hpp +++ b/src/mbgl/style/layers/fill_layer_properties.hpp @@ -16,15 +16,15 @@ struct FillAntialias : PaintProperty<bool> { static bool defaultValue() { return true; } }; -struct FillOpacity : DataDrivenPaintProperty<float, attributes::a_opacity, uniforms::u_opacity> { +struct FillOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniforms::opacity> { static float defaultValue() { return 1; } }; -struct FillColor : DataDrivenPaintProperty<Color, attributes::a_color, uniforms::u_color> { +struct FillColor : DataDrivenPaintProperty<Color, attributes::color, uniforms::color> { static Color defaultValue() { return Color::black(); } }; -struct FillOutlineColor : DataDrivenPaintProperty<Color, attributes::a_outline_color, uniforms::u_outline_color> { +struct FillOutlineColor : DataDrivenPaintProperty<Color, attributes::outline_color, uniforms::outline_color> { static Color defaultValue() { return {}; } }; @@ -36,7 +36,7 @@ struct FillTranslateAnchor : PaintProperty<TranslateAnchorType> { static TranslateAnchorType defaultValue() { return TranslateAnchorType::Map; } }; -struct FillPattern : CrossFadedDataDrivenPaintProperty<std::string, attributes::a_pattern_to, uniforms::u_pattern_to, attributes::a_pattern_from, uniforms::u_pattern_from> { +struct FillPattern : CrossFadedDataDrivenPaintProperty<std::string, attributes::pattern_to, uniforms::pattern_to, attributes::pattern_from, uniforms::pattern_from> { static std::string defaultValue() { return ""; } }; diff --git a/src/mbgl/style/layers/heatmap_layer_properties.hpp b/src/mbgl/style/layers/heatmap_layer_properties.hpp index 4d49a52c72..ce00217b2e 100644 --- a/src/mbgl/style/layers/heatmap_layer_properties.hpp +++ b/src/mbgl/style/layers/heatmap_layer_properties.hpp @@ -12,11 +12,11 @@ namespace mbgl { namespace style { -struct HeatmapRadius : DataDrivenPaintProperty<float, attributes::a_radius, uniforms::u_radius> { +struct HeatmapRadius : DataDrivenPaintProperty<float, attributes::radius, uniforms::radius> { static float defaultValue() { return 30; } }; -struct HeatmapWeight : DataDrivenPaintProperty<float, attributes::a_weight, uniforms::u_weight> { +struct HeatmapWeight : DataDrivenPaintProperty<float, attributes::weight, uniforms::weight> { static float defaultValue() { return 1; } }; diff --git a/src/mbgl/style/layers/line_layer_properties.hpp b/src/mbgl/style/layers/line_layer_properties.hpp index bab6e77ce5..208c2d142f 100644 --- a/src/mbgl/style/layers/line_layer_properties.hpp +++ b/src/mbgl/style/layers/line_layer_properties.hpp @@ -32,11 +32,11 @@ struct LineRoundLimit : LayoutProperty<float> { static float defaultValue() { return 1; } }; -struct LineOpacity : DataDrivenPaintProperty<float, attributes::a_opacity, uniforms::u_opacity> { +struct LineOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniforms::opacity> { static float defaultValue() { return 1; } }; -struct LineColor : DataDrivenPaintProperty<Color, attributes::a_color, uniforms::u_color> { +struct LineColor : DataDrivenPaintProperty<Color, attributes::color, uniforms::color> { static Color defaultValue() { return Color::black(); } }; @@ -48,19 +48,19 @@ struct LineTranslateAnchor : PaintProperty<TranslateAnchorType> { static TranslateAnchorType defaultValue() { return TranslateAnchorType::Map; } }; -struct LineWidth : DataDrivenPaintProperty<float, attributes::a_width, uniforms::u_width> { +struct LineWidth : DataDrivenPaintProperty<float, attributes::width, uniforms::width> { static float defaultValue() { return 1; } }; -struct LineGapWidth : DataDrivenPaintProperty<float, attributes::a_gapwidth, uniforms::u_gapwidth> { +struct LineGapWidth : DataDrivenPaintProperty<float, attributes::gapwidth, uniforms::gapwidth> { static float defaultValue() { return 0; } }; -struct LineOffset : DataDrivenPaintProperty<float, attributes::a_offset, uniforms::u_offset> { +struct LineOffset : DataDrivenPaintProperty<float, attributes::offset, uniforms::offset> { static float defaultValue() { return 0; } }; -struct LineBlur : DataDrivenPaintProperty<float, attributes::a_blur, uniforms::u_blur> { +struct LineBlur : DataDrivenPaintProperty<float, attributes::blur, uniforms::blur> { static float defaultValue() { return 0; } }; @@ -68,7 +68,7 @@ struct LineDasharray : CrossFadedPaintProperty<std::vector<float>> { static std::vector<float> defaultValue() { return { }; } }; -struct LinePattern : CrossFadedDataDrivenPaintProperty<std::string, attributes::a_pattern_to, uniforms::u_pattern_to, attributes::a_pattern_from, uniforms::u_pattern_from> { +struct LinePattern : CrossFadedDataDrivenPaintProperty<std::string, attributes::pattern_to, uniforms::pattern_to, attributes::pattern_from, uniforms::pattern_from> { static std::string defaultValue() { return ""; } }; diff --git a/src/mbgl/style/layers/symbol_layer_properties.hpp b/src/mbgl/style/layers/symbol_layer_properties.hpp index c352ab8e77..8645823cac 100644 --- a/src/mbgl/style/layers/symbol_layer_properties.hpp +++ b/src/mbgl/style/layers/symbol_layer_properties.hpp @@ -197,23 +197,23 @@ struct TextOptional : LayoutProperty<bool> { static bool defaultValue() { return false; } }; -struct IconOpacity : DataDrivenPaintProperty<float, attributes::a_opacity, uniforms::u_opacity> { +struct IconOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniforms::opacity> { static float defaultValue() { return 1; } }; -struct IconColor : DataDrivenPaintProperty<Color, attributes::a_fill_color, uniforms::u_fill_color> { +struct IconColor : DataDrivenPaintProperty<Color, attributes::fill_color, uniforms::fill_color> { static Color defaultValue() { return Color::black(); } }; -struct IconHaloColor : DataDrivenPaintProperty<Color, attributes::a_halo_color, uniforms::u_halo_color> { +struct IconHaloColor : DataDrivenPaintProperty<Color, attributes::halo_color, uniforms::halo_color> { static Color defaultValue() { return {}; } }; -struct IconHaloWidth : DataDrivenPaintProperty<float, attributes::a_halo_width, uniforms::u_halo_width> { +struct IconHaloWidth : DataDrivenPaintProperty<float, attributes::halo_width, uniforms::halo_width> { static float defaultValue() { return 0; } }; -struct IconHaloBlur : DataDrivenPaintProperty<float, attributes::a_halo_blur, uniforms::u_halo_blur> { +struct IconHaloBlur : DataDrivenPaintProperty<float, attributes::halo_blur, uniforms::halo_blur> { static float defaultValue() { return 0; } }; @@ -225,26 +225,26 @@ struct IconTranslateAnchor : PaintProperty<TranslateAnchorType> { static TranslateAnchorType defaultValue() { return TranslateAnchorType::Map; } }; -struct TextOpacity : DataDrivenPaintProperty<float, attributes::a_opacity, uniforms::u_opacity> { +struct TextOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniforms::opacity> { static float defaultValue() { return 1; } }; -struct TextColor : DataDrivenPaintProperty<Color, attributes::a_fill_color, uniforms::u_fill_color, true> { +struct TextColor : DataDrivenPaintProperty<Color, attributes::fill_color, uniforms::fill_color, true> { static Color defaultValue() { return Color::black(); } static constexpr const char *name() { return "text-color"; } static constexpr auto expressionType() { return expression::type::ColorType{}; }; template<typename T> static bool hasOverride(const T& t) { return !!t.textColor; }; }; -struct TextHaloColor : DataDrivenPaintProperty<Color, attributes::a_halo_color, uniforms::u_halo_color> { +struct TextHaloColor : DataDrivenPaintProperty<Color, attributes::halo_color, uniforms::halo_color> { static Color defaultValue() { return {}; } }; -struct TextHaloWidth : DataDrivenPaintProperty<float, attributes::a_halo_width, uniforms::u_halo_width> { +struct TextHaloWidth : DataDrivenPaintProperty<float, attributes::halo_width, uniforms::halo_width> { static float defaultValue() { return 0; } }; -struct TextHaloBlur : DataDrivenPaintProperty<float, attributes::a_halo_blur, uniforms::u_halo_blur> { +struct TextHaloBlur : DataDrivenPaintProperty<float, attributes::halo_blur, uniforms::halo_blur> { static float defaultValue() { return 0; } }; diff --git a/test/programs/symbol_program.test.cpp b/test/programs/symbol_program.test.cpp index 4d30e5dc3d..28d734c21a 100644 --- a/test/programs/symbol_program.test.cpp +++ b/test/programs/symbol_program.test.cpp @@ -9,9 +9,9 @@ using namespace mbgl::style::expression::dsl; TEST(SymbolProgram, SymbolSizeBinder) { auto binder = SymbolSizeBinder::create(5.0f, 12.0f, 0.0f); auto uniformValues = binder->uniformValues(5.5f); - EXPECT_EQ(uniformValues.get<uniforms::u_is_size_zoom_constant>(), true); - EXPECT_EQ(uniformValues.get<uniforms::u_is_size_feature_constant>(), true); - EXPECT_EQ(uniformValues.get<uniforms::u_size>(), 12.0f); + EXPECT_EQ(uniformValues.get<uniforms::is_size_zoom_constant>(), true); + EXPECT_EQ(uniformValues.get<uniforms::is_size_feature_constant>(), true); + EXPECT_EQ(uniformValues.get<uniforms::size>(), 12.0f); binder = SymbolSizeBinder::create(1.0f, style::PropertyExpression<float>( interpolate( @@ -20,9 +20,9 @@ TEST(SymbolProgram, SymbolSizeBinder) { 0., literal(8.), 10., literal(18.))), 0.0f); uniformValues = binder->uniformValues(1.5f); - EXPECT_EQ(uniformValues.get<uniforms::u_is_size_zoom_constant>(), false); - EXPECT_EQ(uniformValues.get<uniforms::u_is_size_feature_constant>(), true); - EXPECT_EQ(uniformValues.get<uniforms::u_size>(), 9.5f); + EXPECT_EQ(uniformValues.get<uniforms::is_size_zoom_constant>(), false); + EXPECT_EQ(uniformValues.get<uniforms::is_size_feature_constant>(), true); + EXPECT_EQ(uniformValues.get<uniforms::size>(), 9.5f); binder = SymbolSizeBinder::create(0.0f, style::PropertyExpression<float>( interpolate( @@ -31,9 +31,9 @@ TEST(SymbolProgram, SymbolSizeBinder) { 1., literal(8.), 11., literal(18.))), 0.0f); uniformValues = binder->uniformValues(0.5f); - EXPECT_EQ(uniformValues.get<uniforms::u_is_size_zoom_constant>(), false); - EXPECT_EQ(uniformValues.get<uniforms::u_is_size_feature_constant>(), true); - EXPECT_EQ(uniformValues.get<uniforms::u_size>(), 8.0f); + EXPECT_EQ(uniformValues.get<uniforms::is_size_zoom_constant>(), false); + EXPECT_EQ(uniformValues.get<uniforms::is_size_feature_constant>(), true); + EXPECT_EQ(uniformValues.get<uniforms::size>(), 8.0f); binder = SymbolSizeBinder::create(12.0f, style::PropertyExpression<float>( interpolate( @@ -42,9 +42,9 @@ TEST(SymbolProgram, SymbolSizeBinder) { 1., literal(8.), 11., literal(18.))), 0.0f); uniformValues = binder->uniformValues(12.5f); - EXPECT_EQ(uniformValues.get<uniforms::u_is_size_zoom_constant>(), false); - EXPECT_EQ(uniformValues.get<uniforms::u_is_size_feature_constant>(), true); - EXPECT_EQ(uniformValues.get<uniforms::u_size>(), 18.0f); + EXPECT_EQ(uniformValues.get<uniforms::is_size_zoom_constant>(), false); + EXPECT_EQ(uniformValues.get<uniforms::is_size_feature_constant>(), true); + EXPECT_EQ(uniformValues.get<uniforms::size>(), 18.0f); binder = SymbolSizeBinder::create(0.0f, style::PropertyExpression<float>( interpolate( @@ -53,8 +53,8 @@ TEST(SymbolProgram, SymbolSizeBinder) { 1., literal(8.), 11., literal(18.))), 0.0f); uniformValues = binder->uniformValues(12.5f); - EXPECT_EQ(uniformValues.get<uniforms::u_is_size_zoom_constant>(), true); - EXPECT_EQ(uniformValues.get<uniforms::u_is_size_feature_constant>(), false); + EXPECT_EQ(uniformValues.get<uniforms::is_size_zoom_constant>(), true); + EXPECT_EQ(uniformValues.get<uniforms::is_size_feature_constant>(), false); binder = SymbolSizeBinder::create(5.0f, style::PropertyExpression<float>( interpolate( @@ -63,7 +63,7 @@ TEST(SymbolProgram, SymbolSizeBinder) { 1., interpolate(linear(), number(get("x")), 0., literal(8.), 100., literal(18.)), 11., interpolate(linear(), number(get("x")), 0., literal(12.), 100., literal(24.9)))), 0.0f); uniformValues = binder->uniformValues(5.5f); - EXPECT_EQ(uniformValues.get<uniforms::u_is_size_zoom_constant>(), false); - EXPECT_EQ(uniformValues.get<uniforms::u_is_size_feature_constant>(), false); - EXPECT_EQ(uniformValues.get<uniforms::u_size_t>(), 0.45f); + EXPECT_EQ(uniformValues.get<uniforms::is_size_zoom_constant>(), false); + EXPECT_EQ(uniformValues.get<uniforms::is_size_feature_constant>(), false); + EXPECT_EQ(uniformValues.get<uniforms::size_t>(), 0.45f); } |