Migrate shaders to the registry (#964)
Co-authored-by: Bart Louwers <bart.louwers@gmail.com>
This commit is contained in:
@@ -869,6 +869,35 @@ if(MBGL_WITH_OPENGL)
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/layermanager/location_indicator_layer_factory.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/platform/gl_functions.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/style/layers/location_indicator_layer.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/shader_source.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/shader_manifest.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/prelude.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/background.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/background_pattern.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/circle.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/clipping_mask.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/collision_box.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/collision_circle.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/debug.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/fill_extrusion_pattern.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/fill_extrusion.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/fill_outline_pattern.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/fill_outline.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/fill_pattern.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/fill.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/heatmap_texture.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/heatmap.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/hillshade_prepare.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/hillshade.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/line_gradient.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/line_pattern.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/line_sdf.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/line.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/raster.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/symbol_icon.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/symbol_sdf_text.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/symbol_sdf_icon.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/symbol_text_and_icon.hpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/gl/attribute.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/gl/attribute.hpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/gl/command_encoder.cpp
|
||||
@@ -919,37 +948,6 @@ if(MBGL_WITH_OPENGL)
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/gl/vertex_buffer_resource.hpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/layermanager/location_indicator_layer_factory.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/platform/gl_functions.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/background.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/background_pattern.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/circle.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/clipping_mask.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/collision_box.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/collision_circle.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/debug.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/fill.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/fill_extrusion.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/fill_extrusion_pattern.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/fill_outline.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/fill_outline_pattern.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/fill_pattern.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/heatmap.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/heatmap_texture.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/hillshade.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/hillshade_prepare.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/line.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/line_gradient.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/line_pattern.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/line_sdf.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/preludes.hpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/raster.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/shader_source.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/shader_source.hpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/shaders.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/shaders.hpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/symbol_icon.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/symbol_sdf_icon.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/symbol_sdf_text.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/programs/gl/symbol_text_and_icon.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_location_indicator_layer.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_location_indicator_layer.hpp
|
||||
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/location_indicator_layer.cpp
|
||||
|
||||
@@ -9,8 +9,11 @@ namespace gfx {
|
||||
|
||||
class Backend {
|
||||
public:
|
||||
/// @brief The active graphics API/backend type.
|
||||
enum class Type : uint8_t {
|
||||
OpenGL,
|
||||
OpenGL, ///< The OpenGL API backend
|
||||
TYPE_MAX, ///< Not a valid backend type, used to determine the number
|
||||
///< of available backends (ie for array allocation).
|
||||
};
|
||||
|
||||
static constexpr Type DefaultType = Type::OpenGL;
|
||||
|
||||
@@ -65,6 +65,26 @@ class ShaderRegistry {
|
||||
return std::static_pointer_cast<T>(shader);
|
||||
}
|
||||
|
||||
/// @brief Ensure the destination 'to' is populated with the requested
|
||||
/// shader. If already non-null, does nothing.
|
||||
/// @tparam T Derived type, inheriting `gfx::Shader`
|
||||
/// @param to Location to store the shader
|
||||
/// @return True if 'to' has a valid program object, false otherwise.
|
||||
template<typename T,
|
||||
typename std::enable_if_t<is_shader_v<T>, bool>* = nullptr>
|
||||
bool populate(std::shared_ptr<T>& to) noexcept {
|
||||
if (to) {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto shader = getShader(std::string(T::Name));
|
||||
if (!shader || (shader->name() != T::Name)) {
|
||||
return false;
|
||||
}
|
||||
to = std::static_pointer_cast<T>(shader);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
std::unordered_map<
|
||||
std::string,
|
||||
|
||||
33
include/mbgl/shaders/gl/background.hpp
Normal file
33
include/mbgl/shaders/gl/background.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace shaders {
|
||||
|
||||
template <> struct ShaderSource<BuiltIn::BackgroundProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(attribute vec2 a_pos;
|
||||
|
||||
uniform mat4 u_matrix;
|
||||
|
||||
void main() {
|
||||
gl_Position = u_matrix * vec4(a_pos, 0, 1);
|
||||
}
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform vec4 u_color;
|
||||
uniform float u_opacity;
|
||||
|
||||
void main() {
|
||||
gl_FragColor = u_color * u_opacity;
|
||||
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/background_pattern_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<BackgroundPatternProgram> {
|
||||
static constexpr const char* name = "background_pattern";
|
||||
static constexpr const uint8_t hash[8] = {0x70, 0x13, 0xc8, 0x7e, 0xba, 0x18, 0xf5, 0x19};
|
||||
static constexpr const auto vertexOffset = 1675;
|
||||
static constexpr const auto fragmentOffset = 2266;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<BackgroundPatternProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<BackgroundPatternProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<BackgroundPatternProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<BackgroundPatternProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of background_pattern.vertex.glsl:
|
||||
/*
|
||||
uniform mat4 u_matrix;
|
||||
template <> struct ShaderSource<BuiltIn::BackgroundPatternProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(uniform mat4 u_matrix;
|
||||
uniform vec2 u_pattern_size_a;
|
||||
uniform vec2 u_pattern_size_b;
|
||||
uniform vec2 u_pixel_coord_upper;
|
||||
@@ -59,12 +28,8 @@ void main() {
|
||||
v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);
|
||||
v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of background_pattern.fragment.glsl:
|
||||
/*
|
||||
uniform vec2 u_pattern_tl_a;
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform vec2 u_pattern_tl_a;
|
||||
uniform vec2 u_pattern_br_a;
|
||||
uniform vec2 u_pattern_tl_b;
|
||||
uniform vec2 u_pattern_br_b;
|
||||
@@ -92,6 +57,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/circle_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<CircleProgram> {
|
||||
static constexpr const char* name = "circle";
|
||||
static constexpr const uint8_t hash[8] = {0x1d, 0x47, 0x35, 0xbb, 0x94, 0x3d, 0x93, 0xca};
|
||||
static constexpr const auto vertexOffset = 2927;
|
||||
static constexpr const auto fragmentOffset = 6135;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<CircleProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<CircleProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<CircleProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<CircleProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of circle.vertex.glsl:
|
||||
/*
|
||||
uniform mat4 u_matrix;
|
||||
template <> struct ShaderSource<BuiltIn::CircleProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(uniform mat4 u_matrix;
|
||||
uniform bool u_scale_with_map;
|
||||
uniform bool u_pitch_with_map;
|
||||
uniform vec2 u_extrude_scale;
|
||||
@@ -50,7 +19,6 @@ attribute vec2 a_pos;
|
||||
|
||||
varying vec3 v_data;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
uniform lowp float u_color_t;
|
||||
attribute highp vec4 a_color;
|
||||
@@ -58,8 +26,6 @@ varying highp vec4 color;
|
||||
#else
|
||||
uniform highp vec4 u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_radius
|
||||
uniform lowp float u_radius_t;
|
||||
attribute mediump vec2 a_radius;
|
||||
@@ -67,8 +33,6 @@ varying mediump float radius;
|
||||
#else
|
||||
uniform mediump float u_radius;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
uniform lowp float u_blur_t;
|
||||
attribute lowp vec2 a_blur;
|
||||
@@ -76,8 +40,6 @@ varying lowp float blur;
|
||||
#else
|
||||
uniform lowp float u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
@@ -85,8 +47,6 @@ varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_stroke_color
|
||||
uniform lowp float u_stroke_color_t;
|
||||
attribute highp vec4 a_stroke_color;
|
||||
@@ -94,8 +54,6 @@ varying highp vec4 stroke_color;
|
||||
#else
|
||||
uniform highp vec4 u_stroke_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_stroke_width
|
||||
uniform lowp float u_stroke_width_t;
|
||||
attribute mediump vec2 a_stroke_width;
|
||||
@@ -103,8 +61,6 @@ varying mediump float stroke_width;
|
||||
#else
|
||||
uniform mediump float u_stroke_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_stroke_opacity
|
||||
uniform lowp float u_stroke_opacity_t;
|
||||
attribute lowp vec2 a_stroke_opacity;
|
||||
@@ -113,58 +69,43 @@ varying lowp float stroke_opacity;
|
||||
uniform lowp float u_stroke_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
void main(void) {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
color = unpack_mix_color(a_color, u_color_t);
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
color = unpack_mix_color(a_color, u_color_t);
|
||||
#else
|
||||
highp vec4 color = u_color;
|
||||
highp vec4 color = u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_radius
|
||||
radius = unpack_mix_vec2(a_radius, u_radius_t);
|
||||
#ifndef HAS_UNIFORM_u_radius
|
||||
radius = unpack_mix_vec2(a_radius, u_radius_t);
|
||||
#else
|
||||
mediump float radius = u_radius;
|
||||
mediump float radius = u_radius;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
blur = unpack_mix_vec2(a_blur, u_blur_t);
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
blur = unpack_mix_vec2(a_blur, u_blur_t);
|
||||
#else
|
||||
lowp float blur = u_blur;
|
||||
lowp float blur = u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_stroke_color
|
||||
stroke_color = unpack_mix_color(a_stroke_color, u_stroke_color_t);
|
||||
#ifndef HAS_UNIFORM_u_stroke_color
|
||||
stroke_color = unpack_mix_color(a_stroke_color, u_stroke_color_t);
|
||||
#else
|
||||
highp vec4 stroke_color = u_stroke_color;
|
||||
highp vec4 stroke_color = u_stroke_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_stroke_width
|
||||
stroke_width = unpack_mix_vec2(a_stroke_width, u_stroke_width_t);
|
||||
#ifndef HAS_UNIFORM_u_stroke_width
|
||||
stroke_width = unpack_mix_vec2(a_stroke_width, u_stroke_width_t);
|
||||
#else
|
||||
mediump float stroke_width = u_stroke_width;
|
||||
mediump float stroke_width = u_stroke_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_stroke_opacity
|
||||
stroke_opacity = unpack_mix_vec2(a_stroke_opacity, u_stroke_opacity_t);
|
||||
#ifndef HAS_UNIFORM_u_stroke_opacity
|
||||
stroke_opacity = unpack_mix_vec2(a_stroke_opacity, u_stroke_opacity_t);
|
||||
#else
|
||||
lowp float stroke_opacity = u_stroke_opacity;
|
||||
lowp float stroke_opacity = u_stroke_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
// unencode the extrusion vector that we snuck into the a_pos vector
|
||||
vec2 extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);
|
||||
|
||||
@@ -201,100 +142,68 @@ void main(void) {
|
||||
|
||||
v_data = vec3(extrude.x, extrude.y, antialiasblur);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of circle.fragment.glsl:
|
||||
/*
|
||||
varying vec3 v_data;
|
||||
|
||||
)";
|
||||
static constexpr const char* fragment = R"(varying vec3 v_data;
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
varying highp vec4 color;
|
||||
#else
|
||||
uniform highp vec4 u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_radius
|
||||
varying mediump float radius;
|
||||
#else
|
||||
uniform mediump float u_radius;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
varying lowp float blur;
|
||||
#else
|
||||
uniform lowp float u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_stroke_color
|
||||
varying highp vec4 stroke_color;
|
||||
#else
|
||||
uniform highp vec4 u_stroke_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_stroke_width
|
||||
varying mediump float stroke_width;
|
||||
#else
|
||||
uniform mediump float u_stroke_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_stroke_opacity
|
||||
varying lowp float stroke_opacity;
|
||||
#else
|
||||
uniform lowp float u_stroke_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_color
|
||||
highp vec4 color = u_color;
|
||||
#ifdef HAS_UNIFORM_u_color
|
||||
highp vec4 color = u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_radius
|
||||
mediump float radius = u_radius;
|
||||
#ifdef HAS_UNIFORM_u_radius
|
||||
mediump float radius = u_radius;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_blur
|
||||
lowp float blur = u_blur;
|
||||
#ifdef HAS_UNIFORM_u_blur
|
||||
lowp float blur = u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_stroke_color
|
||||
highp vec4 stroke_color = u_stroke_color;
|
||||
#ifdef HAS_UNIFORM_u_stroke_color
|
||||
highp vec4 stroke_color = u_stroke_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_stroke_width
|
||||
mediump float stroke_width = u_stroke_width;
|
||||
#ifdef HAS_UNIFORM_u_stroke_width
|
||||
mediump float stroke_width = u_stroke_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_stroke_opacity
|
||||
lowp float stroke_opacity = u_stroke_opacity;
|
||||
#ifdef HAS_UNIFORM_u_stroke_opacity
|
||||
lowp float stroke_opacity = u_stroke_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
vec2 extrude = v_data.xy;
|
||||
float extrude_length = length(extrude);
|
||||
|
||||
@@ -315,6 +224,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
26
include/mbgl/shaders/gl/clipping_mask.hpp
Normal file
26
include/mbgl/shaders/gl/clipping_mask.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace shaders {
|
||||
|
||||
template <> struct ShaderSource<BuiltIn::ClippingMaskProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(attribute vec2 a_pos;
|
||||
|
||||
uniform mat4 u_matrix;
|
||||
|
||||
void main() {
|
||||
gl_Position = u_matrix * vec4(a_pos, 0, 1);
|
||||
}
|
||||
)";
|
||||
static constexpr const char* fragment = R"(void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/collision_box_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<CollisionBoxProgram> {
|
||||
static constexpr const char* name = "collision_box";
|
||||
static constexpr const uint8_t hash[8] = {0xcb, 0x6a, 0x9b, 0xd1, 0x1f, 0x31, 0xf8, 0x5b};
|
||||
static constexpr const auto vertexOffset = 10000;
|
||||
static constexpr const auto fragmentOffset = 10679;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<CollisionBoxProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<CollisionBoxProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<CollisionBoxProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<CollisionBoxProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of collision_box.vertex.glsl:
|
||||
/*
|
||||
attribute vec2 a_pos;
|
||||
template <> struct ShaderSource<BuiltIn::CollisionBoxProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(attribute vec2 a_pos;
|
||||
attribute vec2 a_anchor_pos;
|
||||
attribute vec2 a_extrude;
|
||||
attribute vec2 a_placed;
|
||||
@@ -66,12 +35,8 @@ void main() {
|
||||
v_placed = a_placed.x;
|
||||
v_notUsed = a_placed.y;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of collision_box.fragment.glsl:
|
||||
/*
|
||||
|
||||
)";
|
||||
static constexpr const char* fragment = R"(
|
||||
varying float v_placed;
|
||||
varying float v_notUsed;
|
||||
|
||||
@@ -91,6 +56,8 @@ void main() {
|
||||
// This box not used, fade it out
|
||||
gl_FragColor *= .1;
|
||||
}
|
||||
}
|
||||
*/
|
||||
// clang-format on
|
||||
})";
|
||||
};
|
||||
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/collision_circle_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<CollisionCircleProgram> {
|
||||
static constexpr const char* name = "collision_circle";
|
||||
static constexpr const uint8_t hash[8] = {0x99, 0x2e, 0xad, 0x8c, 0xd3, 0x88, 0xae, 0x82};
|
||||
static constexpr const auto vertexOffset = 10902;
|
||||
static constexpr const auto fragmentOffset = 11818;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<CollisionCircleProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<CollisionCircleProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<CollisionCircleProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<CollisionCircleProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of collision_circle.vertex.glsl:
|
||||
/*
|
||||
attribute vec2 a_pos;
|
||||
template <> struct ShaderSource<BuiltIn::CollisionCircleProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(attribute vec2 a_pos;
|
||||
attribute vec2 a_anchor_pos;
|
||||
attribute vec2 a_extrude;
|
||||
attribute vec2 a_placed;
|
||||
@@ -75,12 +44,8 @@ void main() {
|
||||
v_extrude = a_extrude * padding_factor;
|
||||
v_extrude_scale = u_extrude_scale * u_camera_to_center_distance * collision_perspective_ratio;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of collision_circle.fragment.glsl:
|
||||
/*
|
||||
uniform float u_overscale_factor;
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform float u_overscale_factor;
|
||||
|
||||
varying float v_placed;
|
||||
varying float v_notUsed;
|
||||
@@ -114,6 +79,8 @@ void main() {
|
||||
|
||||
gl_FragColor = opacity_t * color;
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
37
include/mbgl/shaders/gl/debug.hpp
Normal file
37
include/mbgl/shaders/gl/debug.hpp
Normal file
@@ -0,0 +1,37 @@
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace shaders {
|
||||
|
||||
template <> struct ShaderSource<BuiltIn::DebugProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(attribute vec2 a_pos;
|
||||
varying vec2 v_uv;
|
||||
|
||||
uniform mat4 u_matrix;
|
||||
uniform float u_overlay_scale;
|
||||
|
||||
void main() {
|
||||
// This vertex shader expects a EXTENT x EXTENT quad,
|
||||
// The UV co-ordinates for the overlay texture can be calculated using that knowledge
|
||||
v_uv = a_pos / 8192.0;
|
||||
gl_Position = u_matrix * vec4(a_pos * u_overlay_scale, 0, 1);
|
||||
}
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform highp vec4 u_color;
|
||||
uniform sampler2D u_overlay;
|
||||
|
||||
varying vec2 v_uv;
|
||||
|
||||
void main() {
|
||||
vec4 overlay_color = texture2D(u_overlay, v_uv);
|
||||
gl_FragColor = mix(u_color, overlay_color, overlay_color.a);
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
74
include/mbgl/shaders/gl/fill.hpp
Normal file
74
include/mbgl/shaders/gl/fill.hpp
Normal file
@@ -0,0 +1,74 @@
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace shaders {
|
||||
|
||||
template <> struct ShaderSource<BuiltIn::FillProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(attribute vec2 a_pos;
|
||||
|
||||
uniform mat4 u_matrix;
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
uniform lowp float u_color_t;
|
||||
attribute highp vec4 a_color;
|
||||
varying highp vec4 color;
|
||||
#else
|
||||
uniform highp vec4 u_color;
|
||||
#endif
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
color = unpack_mix_color(a_color, u_color_t);
|
||||
#else
|
||||
highp vec4 color = u_color;
|
||||
#endif
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
gl_Position = u_matrix * vec4(a_pos, 0, 1);
|
||||
}
|
||||
)";
|
||||
static constexpr const char* fragment = R"(#ifndef HAS_UNIFORM_u_color
|
||||
varying highp vec4 color;
|
||||
#else
|
||||
uniform highp vec4 u_color;
|
||||
#endif
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
#ifdef HAS_UNIFORM_u_color
|
||||
highp vec4 color = u_color;
|
||||
#endif
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
gl_FragColor = color * opacity;
|
||||
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/fill_extrusion_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<FillExtrusionProgram> {
|
||||
static constexpr const char* name = "fill_extrusion";
|
||||
static constexpr const uint8_t hash[8] = {0x9d, 0x76, 0x7f, 0xaa, 0x86, 0x57, 0x56, 0x96};
|
||||
static constexpr const auto vertexOffset = 21491;
|
||||
static constexpr const auto fragmentOffset = 23422;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<FillExtrusionProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<FillExtrusionProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<FillExtrusionProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<FillExtrusionProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of fill_extrusion.vertex.glsl:
|
||||
/*
|
||||
uniform mat4 u_matrix;
|
||||
template <> struct ShaderSource<BuiltIn::FillExtrusionProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(uniform mat4 u_matrix;
|
||||
uniform vec3 u_lightcolor;
|
||||
uniform lowp vec3 u_lightpos;
|
||||
uniform lowp float u_lightintensity;
|
||||
@@ -51,15 +20,12 @@ attribute vec4 a_normal_ed;
|
||||
|
||||
varying vec4 v_color;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_base
|
||||
uniform lowp float u_base_t;
|
||||
attribute highp vec2 a_base;
|
||||
#else
|
||||
uniform highp float u_base;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_height
|
||||
uniform lowp float u_height_t;
|
||||
attribute highp vec2 a_height;
|
||||
@@ -67,8 +33,6 @@ attribute highp vec2 a_height;
|
||||
uniform highp float u_height;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
uniform lowp float u_color_t;
|
||||
attribute highp vec4 a_color;
|
||||
@@ -76,30 +40,23 @@ attribute highp vec4 a_color;
|
||||
uniform highp vec4 u_color;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_base
|
||||
highp float base = unpack_mix_vec2(a_base, u_base_t);
|
||||
#ifndef HAS_UNIFORM_u_base
|
||||
highp float base = unpack_mix_vec2(a_base, u_base_t);
|
||||
#else
|
||||
highp float base = u_base;
|
||||
highp float base = u_base;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_height
|
||||
highp float height = unpack_mix_vec2(a_height, u_height_t);
|
||||
#ifndef HAS_UNIFORM_u_height
|
||||
highp float height = unpack_mix_vec2(a_height, u_height_t);
|
||||
#else
|
||||
highp float height = u_height;
|
||||
highp float height = u_height;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
highp vec4 color = unpack_mix_color(a_color, u_color_t);
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
highp vec4 color = unpack_mix_color(a_color, u_color_t);
|
||||
#else
|
||||
highp vec4 color = u_color;
|
||||
highp vec4 color = u_color;
|
||||
#endif
|
||||
|
||||
|
||||
vec3 normal = a_normal_ed.xyz;
|
||||
|
||||
base = max(0.0, base);
|
||||
@@ -144,12 +101,8 @@ void main() {
|
||||
v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);
|
||||
v_color *= u_opacity;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of fill_extrusion.fragment.glsl:
|
||||
/*
|
||||
varying vec4 v_color;
|
||||
)";
|
||||
static constexpr const char* fragment = R"(varying vec4 v_color;
|
||||
|
||||
void main() {
|
||||
gl_FragColor = v_color;
|
||||
@@ -158,6 +111,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/fill_extrusion_pattern_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<FillExtrusionPatternProgram> {
|
||||
static constexpr const char* name = "fill_extrusion_pattern";
|
||||
static constexpr const uint8_t hash[8] = {0x5a, 0x8f, 0x1a, 0xbf, 0x43, 0x62, 0xf0, 0x86};
|
||||
static constexpr const auto vertexOffset = 23538;
|
||||
static constexpr const auto fragmentOffset = 26509;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<FillExtrusionPatternProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<FillExtrusionPatternProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<FillExtrusionPatternProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<FillExtrusionPatternProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of fill_extrusion_pattern.vertex.glsl:
|
||||
/*
|
||||
uniform mat4 u_matrix;
|
||||
template <> struct ShaderSource<BuiltIn::FillExtrusionPatternProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(uniform mat4 u_matrix;
|
||||
uniform vec2 u_pixel_coord_upper;
|
||||
uniform vec2 u_pixel_coord_lower;
|
||||
uniform float u_height_factor;
|
||||
@@ -58,7 +27,6 @@ varying vec2 v_pos_a;
|
||||
varying vec2 v_pos_b;
|
||||
varying vec4 v_lighting;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_base
|
||||
uniform lowp float u_base_t;
|
||||
attribute lowp vec2 a_base;
|
||||
@@ -66,8 +34,6 @@ varying lowp float base;
|
||||
#else
|
||||
uniform lowp float u_base;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_height
|
||||
uniform lowp float u_height_t;
|
||||
attribute lowp vec2 a_height;
|
||||
@@ -75,8 +41,6 @@ varying lowp float height;
|
||||
#else
|
||||
uniform lowp float u_height;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
uniform lowp float u_pattern_from_t;
|
||||
attribute lowp vec4 a_pattern_from;
|
||||
@@ -84,8 +48,6 @@ varying lowp vec4 pattern_from;
|
||||
#else
|
||||
uniform lowp vec4 u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
uniform lowp float u_pattern_to_t;
|
||||
attribute lowp vec4 a_pattern_to;
|
||||
@@ -94,37 +56,28 @@ varying lowp vec4 pattern_to;
|
||||
uniform lowp vec4 u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_base
|
||||
base = unpack_mix_vec2(a_base, u_base_t);
|
||||
#ifndef HAS_UNIFORM_u_base
|
||||
base = unpack_mix_vec2(a_base, u_base_t);
|
||||
#else
|
||||
lowp float base = u_base;
|
||||
lowp float base = u_base;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_height
|
||||
height = unpack_mix_vec2(a_height, u_height_t);
|
||||
#ifndef HAS_UNIFORM_u_height
|
||||
height = unpack_mix_vec2(a_height, u_height_t);
|
||||
#else
|
||||
lowp float height = u_height;
|
||||
lowp float height = u_height;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
pattern_from = a_pattern_from;
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
pattern_from = a_pattern_from;
|
||||
#else
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
pattern_to = a_pattern_to;
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
pattern_to = a_pattern_to;
|
||||
#else
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
vec2 pattern_tl_a = pattern_from.xy;
|
||||
vec2 pattern_br_a = pattern_from.zw;
|
||||
vec2 pattern_tl_b = pattern_to.xy;
|
||||
@@ -171,12 +124,8 @@ void main() {
|
||||
v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));
|
||||
v_lighting *= u_opacity;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of fill_extrusion_pattern.fragment.glsl:
|
||||
/*
|
||||
uniform vec2 u_texsize;
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform vec2 u_texsize;
|
||||
uniform float u_fade;
|
||||
|
||||
uniform sampler2D u_image;
|
||||
@@ -185,57 +134,41 @@ varying vec2 v_pos_a;
|
||||
varying vec2 v_pos_b;
|
||||
varying vec4 v_lighting;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_base
|
||||
varying lowp float base;
|
||||
#else
|
||||
uniform lowp float u_base;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_height
|
||||
varying lowp float height;
|
||||
#else
|
||||
uniform lowp float u_height;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
varying lowp vec4 pattern_from;
|
||||
#else
|
||||
uniform lowp vec4 u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
varying lowp vec4 pattern_to;
|
||||
#else
|
||||
uniform lowp vec4 u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_base
|
||||
lowp float base = u_base;
|
||||
#ifdef HAS_UNIFORM_u_base
|
||||
lowp float base = u_base;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_height
|
||||
lowp float height = u_height;
|
||||
#ifdef HAS_UNIFORM_u_height
|
||||
lowp float height = u_height;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_pattern_from
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
#ifdef HAS_UNIFORM_u_pattern_from
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_pattern_to
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
#ifdef HAS_UNIFORM_u_pattern_to
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
vec2 pattern_tl_a = pattern_from.xy;
|
||||
vec2 pattern_br_a = pattern_from.zw;
|
||||
vec2 pattern_tl_b = pattern_to.xy;
|
||||
@@ -257,6 +190,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
82
include/mbgl/shaders/gl/fill_outline.hpp
Normal file
82
include/mbgl/shaders/gl/fill_outline.hpp
Normal file
@@ -0,0 +1,82 @@
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace shaders {
|
||||
|
||||
template <> struct ShaderSource<BuiltIn::FillOutlineProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(attribute vec2 a_pos;
|
||||
|
||||
uniform mat4 u_matrix;
|
||||
uniform vec2 u_world;
|
||||
|
||||
varying vec2 v_pos;
|
||||
|
||||
#ifndef HAS_UNIFORM_u_outline_color
|
||||
uniform lowp float u_outline_color_t;
|
||||
attribute highp vec4 a_outline_color;
|
||||
varying highp vec4 outline_color;
|
||||
#else
|
||||
uniform highp vec4 u_outline_color;
|
||||
#endif
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
#ifndef HAS_UNIFORM_u_outline_color
|
||||
outline_color = unpack_mix_color(a_outline_color, u_outline_color_t);
|
||||
#else
|
||||
highp vec4 outline_color = u_outline_color;
|
||||
#endif
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
gl_Position = u_matrix * vec4(a_pos, 0, 1);
|
||||
v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;
|
||||
}
|
||||
)";
|
||||
static constexpr const char* fragment = R"(varying vec2 v_pos;
|
||||
|
||||
#ifndef HAS_UNIFORM_u_outline_color
|
||||
varying highp vec4 outline_color;
|
||||
#else
|
||||
uniform highp vec4 u_outline_color;
|
||||
#endif
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
#ifdef HAS_UNIFORM_u_outline_color
|
||||
highp vec4 outline_color = u_outline_color;
|
||||
#endif
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
float dist = length(v_pos - gl_FragCoord.xy);
|
||||
float alpha = 1.0 - smoothstep(0.0, 1.0, dist);
|
||||
gl_FragColor = outline_color * (alpha * opacity);
|
||||
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/fill_outline_pattern_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<FillOutlinePatternProgram> {
|
||||
static constexpr const char* name = "fill_outline_pattern";
|
||||
static constexpr const uint8_t hash[8] = {0x56, 0x9c, 0x2f, 0x58, 0x6b, 0x31, 0xff, 0x84};
|
||||
static constexpr const auto vertexOffset = 15345;
|
||||
static constexpr const auto fragmentOffset = 17205;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<FillOutlinePatternProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<FillOutlinePatternProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<FillOutlinePatternProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<FillOutlinePatternProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of fill_outline_pattern.vertex.glsl:
|
||||
/*
|
||||
uniform mat4 u_matrix;
|
||||
template <> struct ShaderSource<BuiltIn::FillOutlinePatternProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(uniform mat4 u_matrix;
|
||||
uniform vec2 u_world;
|
||||
uniform vec2 u_pixel_coord_upper;
|
||||
uniform vec2 u_pixel_coord_lower;
|
||||
@@ -51,7 +20,6 @@ varying vec2 v_pos_a;
|
||||
varying vec2 v_pos_b;
|
||||
varying vec2 v_pos;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
@@ -59,8 +27,6 @@ varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
uniform lowp float u_pattern_from_t;
|
||||
attribute lowp vec4 a_pattern_from;
|
||||
@@ -68,8 +34,6 @@ varying lowp vec4 pattern_from;
|
||||
#else
|
||||
uniform lowp vec4 u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
uniform lowp float u_pattern_to_t;
|
||||
attribute lowp vec4 a_pattern_to;
|
||||
@@ -78,30 +42,23 @@ varying lowp vec4 pattern_to;
|
||||
uniform lowp vec4 u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
pattern_from = a_pattern_from;
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
pattern_from = a_pattern_from;
|
||||
#else
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
pattern_to = a_pattern_to;
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
pattern_to = a_pattern_to;
|
||||
#else
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
vec2 pattern_tl_a = pattern_from.xy;
|
||||
vec2 pattern_br_a = pattern_from.zw;
|
||||
vec2 pattern_tl_b = pattern_to.xy;
|
||||
@@ -122,12 +79,8 @@ void main() {
|
||||
|
||||
v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of fill_outline_pattern.fragment.glsl:
|
||||
/*
|
||||
|
||||
)";
|
||||
static constexpr const char* fragment = R"(
|
||||
uniform vec2 u_texsize;
|
||||
uniform sampler2D u_image;
|
||||
uniform float u_fade;
|
||||
@@ -136,45 +89,33 @@ varying vec2 v_pos_a;
|
||||
varying vec2 v_pos_b;
|
||||
varying vec2 v_pos;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
varying lowp vec4 pattern_from;
|
||||
#else
|
||||
uniform lowp vec4 u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
varying lowp vec4 pattern_to;
|
||||
#else
|
||||
uniform lowp vec4 u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_pattern_from
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
#ifdef HAS_UNIFORM_u_pattern_from
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_pattern_to
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
#ifdef HAS_UNIFORM_u_pattern_to
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
vec2 pattern_tl_a = pattern_from.xy;
|
||||
vec2 pattern_br_a = pattern_from.zw;
|
||||
vec2 pattern_tl_b = pattern_to.xy;
|
||||
@@ -200,6 +141,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/fill_pattern_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<FillPatternProgram> {
|
||||
static constexpr const char* name = "fill_pattern";
|
||||
static constexpr const uint8_t hash[8] = {0x74, 0xa9, 0x97, 0x01, 0x96, 0xbd, 0x87, 0x36};
|
||||
static constexpr const auto vertexOffset = 18512;
|
||||
static constexpr const auto fragmentOffset = 20291;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<FillPatternProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<FillPatternProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<FillPatternProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<FillPatternProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of fill_pattern.vertex.glsl:
|
||||
/*
|
||||
uniform mat4 u_matrix;
|
||||
template <> struct ShaderSource<BuiltIn::FillPatternProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(uniform mat4 u_matrix;
|
||||
uniform vec2 u_pixel_coord_upper;
|
||||
uniform vec2 u_pixel_coord_lower;
|
||||
uniform vec4 u_scale;
|
||||
@@ -49,7 +18,6 @@ attribute vec2 a_pos;
|
||||
varying vec2 v_pos_a;
|
||||
varying vec2 v_pos_b;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
@@ -57,8 +25,6 @@ varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
uniform lowp float u_pattern_from_t;
|
||||
attribute lowp vec4 a_pattern_from;
|
||||
@@ -66,8 +32,6 @@ varying lowp vec4 pattern_from;
|
||||
#else
|
||||
uniform lowp vec4 u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
uniform lowp float u_pattern_to_t;
|
||||
attribute lowp vec4 a_pattern_to;
|
||||
@@ -76,30 +40,23 @@ varying lowp vec4 pattern_to;
|
||||
uniform lowp vec4 u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
pattern_from = a_pattern_from;
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
pattern_from = a_pattern_from;
|
||||
#else
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
pattern_to = a_pattern_to;
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
pattern_to = a_pattern_to;
|
||||
#else
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
vec2 pattern_tl_a = pattern_from.xy;
|
||||
vec2 pattern_br_a = pattern_from.zw;
|
||||
vec2 pattern_tl_b = pattern_to.xy;
|
||||
@@ -117,12 +74,8 @@ void main() {
|
||||
v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileZoomRatio, a_pos);
|
||||
v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileZoomRatio, a_pos);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of fill_pattern.fragment.glsl:
|
||||
/*
|
||||
uniform vec2 u_texsize;
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform vec2 u_texsize;
|
||||
uniform float u_fade;
|
||||
|
||||
uniform sampler2D u_image;
|
||||
@@ -130,45 +83,33 @@ uniform sampler2D u_image;
|
||||
varying vec2 v_pos_a;
|
||||
varying vec2 v_pos_b;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
varying lowp vec4 pattern_from;
|
||||
#else
|
||||
uniform lowp vec4 u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
varying lowp vec4 pattern_to;
|
||||
#else
|
||||
uniform lowp vec4 u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_pattern_from
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
#ifdef HAS_UNIFORM_u_pattern_from
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_pattern_to
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
#ifdef HAS_UNIFORM_u_pattern_to
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
vec2 pattern_tl_a = pattern_from.xy;
|
||||
vec2 pattern_br_a = pattern_from.zw;
|
||||
vec2 pattern_tl_b = pattern_to.xy;
|
||||
@@ -188,6 +129,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/heatmap_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<HeatmapProgram> {
|
||||
static constexpr const char* name = "heatmap";
|
||||
static constexpr const uint8_t hash[8] = {0xe5, 0xa4, 0x9c, 0x31, 0x01, 0xe5, 0x4a, 0xe0};
|
||||
static constexpr const auto vertexOffset = 8026;
|
||||
static constexpr const auto fragmentOffset = 9074;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<HeatmapProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<HeatmapProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<HeatmapProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<HeatmapProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of heatmap.vertex.glsl:
|
||||
/*
|
||||
namespace shaders {
|
||||
|
||||
template <> struct ShaderSource<BuiltIn::HeatmapProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(
|
||||
uniform mat4 u_matrix;
|
||||
uniform float u_extrude_scale;
|
||||
uniform float u_opacity;
|
||||
@@ -49,7 +18,6 @@ attribute vec2 a_pos;
|
||||
|
||||
varying vec2 v_extrude;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_weight
|
||||
uniform lowp float u_weight_t;
|
||||
attribute highp vec2 a_weight;
|
||||
@@ -57,8 +25,6 @@ varying highp float weight;
|
||||
#else
|
||||
uniform highp float u_weight;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_radius
|
||||
uniform lowp float u_radius_t;
|
||||
attribute mediump vec2 a_radius;
|
||||
@@ -66,7 +32,6 @@ attribute mediump vec2 a_radius;
|
||||
uniform mediump float u_radius;
|
||||
#endif
|
||||
|
||||
|
||||
// Effective "0" in the kernel density texture to adjust the kernel size to;
|
||||
// this empirically chosen number minimizes artifacts on overlapping kernels
|
||||
// for typical heatmap cases (assuming clustered source)
|
||||
@@ -76,21 +41,17 @@ const highp float ZERO = 1.0 / 255.0 / 16.0;
|
||||
#define GAUSS_COEF 0.3989422804014327
|
||||
|
||||
void main(void) {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_weight
|
||||
weight = unpack_mix_vec2(a_weight, u_weight_t);
|
||||
#ifndef HAS_UNIFORM_u_weight
|
||||
weight = unpack_mix_vec2(a_weight, u_weight_t);
|
||||
#else
|
||||
highp float weight = u_weight;
|
||||
highp float weight = u_weight;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_radius
|
||||
mediump float radius = unpack_mix_vec2(a_radius, u_radius_t);
|
||||
#ifndef HAS_UNIFORM_u_radius
|
||||
mediump float radius = unpack_mix_vec2(a_radius, u_radius_t);
|
||||
#else
|
||||
mediump float radius = u_radius;
|
||||
mediump float radius = u_radius;
|
||||
#endif
|
||||
|
||||
|
||||
// unencode the extrusion vector that we snuck into the a_pos vector
|
||||
vec2 unscaled_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);
|
||||
|
||||
@@ -120,33 +81,25 @@ void main(void) {
|
||||
|
||||
gl_Position = u_matrix * pos;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of heatmap.fragment.glsl:
|
||||
/*
|
||||
uniform highp float u_intensity;
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform highp float u_intensity;
|
||||
|
||||
varying vec2 v_extrude;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_weight
|
||||
varying highp float weight;
|
||||
#else
|
||||
uniform highp float u_weight;
|
||||
#endif
|
||||
|
||||
|
||||
// Gaussian kernel coefficient: 1 / sqrt(2 * PI)
|
||||
#define GAUSS_COEF 0.3989422804014327
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_weight
|
||||
highp float weight = u_weight;
|
||||
#ifdef HAS_UNIFORM_u_weight
|
||||
highp float weight = u_weight;
|
||||
#endif
|
||||
|
||||
|
||||
// Kernel density estimation with a Gaussian kernel of size 5x5
|
||||
float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);
|
||||
float val = weight * u_intensity * GAUSS_COEF * exp(d);
|
||||
@@ -157,6 +110,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
41
include/mbgl/shaders/gl/heatmap_texture.hpp
Normal file
41
include/mbgl/shaders/gl/heatmap_texture.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace shaders {
|
||||
|
||||
template <> struct ShaderSource<BuiltIn::HeatmapTextureProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(uniform mat4 u_matrix;
|
||||
uniform vec2 u_world;
|
||||
attribute vec2 a_pos;
|
||||
varying vec2 v_pos;
|
||||
|
||||
void main() {
|
||||
gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);
|
||||
|
||||
v_pos.x = a_pos.x;
|
||||
v_pos.y = 1.0 - a_pos.y;
|
||||
}
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform sampler2D u_image;
|
||||
uniform sampler2D u_color_ramp;
|
||||
uniform float u_opacity;
|
||||
varying vec2 v_pos;
|
||||
|
||||
void main() {
|
||||
float t = texture2D(u_image, v_pos).r;
|
||||
vec4 color = texture2D(u_color_ramp, vec2(t, 0.5));
|
||||
gl_FragColor = color * u_opacity;
|
||||
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
gl_FragColor = vec4(0.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/hillshade_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<HillshadeProgram> {
|
||||
static constexpr const char* name = "hillshade";
|
||||
static constexpr const uint8_t hash[8] = {0x8a, 0x11, 0x29, 0x18, 0x52, 0x7f, 0x3b, 0xbb};
|
||||
static constexpr const auto vertexOffset = 29333;
|
||||
static constexpr const auto fragmentOffset = 29504;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<HillshadeProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<HillshadeProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<HillshadeProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<HillshadeProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of hillshade.vertex.glsl:
|
||||
/*
|
||||
uniform mat4 u_matrix;
|
||||
template <> struct ShaderSource<BuiltIn::HillshadeProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(uniform mat4 u_matrix;
|
||||
|
||||
attribute vec2 a_pos;
|
||||
attribute vec2 a_texture_pos;
|
||||
@@ -50,12 +19,8 @@ void main() {
|
||||
gl_Position = u_matrix * vec4(a_pos, 0, 1);
|
||||
v_pos = a_texture_pos / 8192.0;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of hillshade.fragment.glsl:
|
||||
/*
|
||||
uniform sampler2D u_image;
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform sampler2D u_image;
|
||||
varying vec2 v_pos;
|
||||
|
||||
uniform vec2 u_latrange;
|
||||
@@ -107,6 +72,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/hillshade_prepare_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<HillshadePrepareProgram> {
|
||||
static constexpr const char* name = "hillshade_prepare";
|
||||
static constexpr const uint8_t hash[8] = {0xbd, 0xa0, 0x8a, 0x88, 0x91, 0xe3, 0x73, 0x66};
|
||||
static constexpr const auto vertexOffset = 27906;
|
||||
static constexpr const auto fragmentOffset = 28199;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<HillshadePrepareProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<HillshadePrepareProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<HillshadePrepareProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<HillshadePrepareProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of hillshade_prepare.vertex.glsl:
|
||||
/*
|
||||
uniform mat4 u_matrix;
|
||||
template <> struct ShaderSource<BuiltIn::HillshadePrepareProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(uniform mat4 u_matrix;
|
||||
uniform vec2 u_dimension;
|
||||
|
||||
attribute vec2 a_pos;
|
||||
@@ -54,12 +23,8 @@ void main() {
|
||||
float scale = (u_dimension.x - 2.0) / u_dimension.x;
|
||||
v_pos = (a_texture_pos / 8192.0) * scale + epsilon;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of hillshade_prepare.fragment.glsl:
|
||||
/*
|
||||
#ifdef GL_ES
|
||||
)";
|
||||
static constexpr const char* fragment = R"(#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
|
||||
@@ -133,6 +98,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/line_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<LineProgram> {
|
||||
static constexpr const char* name = "line";
|
||||
static constexpr const uint8_t hash[8] = {0x7f, 0x8e, 0xaa, 0x53, 0x75, 0x78, 0xac, 0x2c};
|
||||
static constexpr const auto vertexOffset = 30578;
|
||||
static constexpr const auto fragmentOffset = 33575;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<LineProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<LineProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<LineProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<LineProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of line.vertex.glsl:
|
||||
/*
|
||||
// floor(127 / 2) == 63.0
|
||||
template <> struct ShaderSource<BuiltIn::LineProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(// floor(127 / 2) == 63.0
|
||||
// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is
|
||||
// stored in a byte (-128..127). we scale regular normals up to length 63, but
|
||||
// there are also "special" normals that have a bigger length (of up to 126 in
|
||||
@@ -60,7 +29,6 @@ varying vec2 v_width2;
|
||||
varying float v_gamma_scale;
|
||||
varying highp float v_linesofar;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
uniform lowp float u_color_t;
|
||||
attribute highp vec4 a_color;
|
||||
@@ -68,8 +36,6 @@ varying highp vec4 color;
|
||||
#else
|
||||
uniform highp vec4 u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
uniform lowp float u_blur_t;
|
||||
attribute lowp vec2 a_blur;
|
||||
@@ -77,8 +43,6 @@ varying lowp float blur;
|
||||
#else
|
||||
uniform lowp float u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
@@ -86,24 +50,18 @@ varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_gapwidth
|
||||
uniform lowp float u_gapwidth_t;
|
||||
attribute mediump vec2 a_gapwidth;
|
||||
#else
|
||||
uniform mediump float u_gapwidth;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_offset
|
||||
uniform lowp float u_offset_t;
|
||||
attribute lowp vec2 a_offset;
|
||||
#else
|
||||
uniform lowp float u_offset;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_width
|
||||
uniform lowp float u_width_t;
|
||||
attribute mediump vec2 a_width;
|
||||
@@ -111,51 +69,38 @@ attribute mediump vec2 a_width;
|
||||
uniform mediump float u_width;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
color = unpack_mix_color(a_color, u_color_t);
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
color = unpack_mix_color(a_color, u_color_t);
|
||||
#else
|
||||
highp vec4 color = u_color;
|
||||
highp vec4 color = u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
blur = unpack_mix_vec2(a_blur, u_blur_t);
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
blur = unpack_mix_vec2(a_blur, u_blur_t);
|
||||
#else
|
||||
lowp float blur = u_blur;
|
||||
lowp float blur = u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_gapwidth
|
||||
mediump float gapwidth = unpack_mix_vec2(a_gapwidth, u_gapwidth_t);
|
||||
#ifndef HAS_UNIFORM_u_gapwidth
|
||||
mediump float gapwidth = unpack_mix_vec2(a_gapwidth, u_gapwidth_t);
|
||||
#else
|
||||
mediump float gapwidth = u_gapwidth;
|
||||
mediump float gapwidth = u_gapwidth;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_offset
|
||||
lowp float offset = unpack_mix_vec2(a_offset, u_offset_t);
|
||||
#ifndef HAS_UNIFORM_u_offset
|
||||
lowp float offset = unpack_mix_vec2(a_offset, u_offset_t);
|
||||
#else
|
||||
lowp float offset = u_offset;
|
||||
lowp float offset = u_offset;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_width
|
||||
mediump float width = unpack_mix_vec2(a_width, u_width_t);
|
||||
#ifndef HAS_UNIFORM_u_width
|
||||
mediump float width = unpack_mix_vec2(a_width, u_width_t);
|
||||
#else
|
||||
mediump float width = u_width;
|
||||
mediump float width = u_width;
|
||||
#endif
|
||||
|
||||
|
||||
// the distance over which the line edge fades out.
|
||||
// Retina devices need a smaller distance to avoid aliasing.
|
||||
float ANTIALIASING = 1.0 / u_device_pixel_ratio / 2.0;
|
||||
@@ -205,56 +150,40 @@ void main() {
|
||||
|
||||
v_width2 = vec2(outset, inset);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of line.fragment.glsl:
|
||||
/*
|
||||
uniform lowp float u_device_pixel_ratio;
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform lowp float u_device_pixel_ratio;
|
||||
|
||||
varying vec2 v_width2;
|
||||
varying vec2 v_normal;
|
||||
varying float v_gamma_scale;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
varying highp vec4 color;
|
||||
#else
|
||||
uniform highp vec4 u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
varying lowp float blur;
|
||||
#else
|
||||
uniform lowp float u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_color
|
||||
highp vec4 color = u_color;
|
||||
#ifdef HAS_UNIFORM_u_color
|
||||
highp vec4 color = u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_blur
|
||||
lowp float blur = u_blur;
|
||||
#ifdef HAS_UNIFORM_u_blur
|
||||
lowp float blur = u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
// Calculate the distance of the pixel from the line in pixels.
|
||||
float dist = length(v_normal) * v_width2.s;
|
||||
|
||||
@@ -270,6 +199,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/line_gradient_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<LineGradientProgram> {
|
||||
static constexpr const char* name = "line_gradient";
|
||||
static constexpr const uint8_t hash[8] = {0x3f, 0xba, 0xc6, 0x33, 0xcd, 0x86, 0xa2, 0xe8};
|
||||
static constexpr const auto vertexOffset = 34444;
|
||||
static constexpr const auto fragmentOffset = 37236;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<LineGradientProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<LineGradientProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<LineGradientProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<LineGradientProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of line_gradient.vertex.glsl:
|
||||
/*
|
||||
namespace shaders {
|
||||
|
||||
template <> struct ShaderSource<BuiltIn::LineGradientProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(
|
||||
// the attribute conveying progress along a line is scaled to [0, 2^15)
|
||||
#define MAX_LINE_DISTANCE 32767.0
|
||||
|
||||
@@ -64,7 +33,6 @@ varying vec2 v_width2;
|
||||
varying float v_gamma_scale;
|
||||
varying highp float v_lineprogress;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
uniform lowp float u_blur_t;
|
||||
attribute lowp vec2 a_blur;
|
||||
@@ -72,8 +40,6 @@ varying lowp float blur;
|
||||
#else
|
||||
uniform lowp float u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
@@ -81,24 +47,18 @@ varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_gapwidth
|
||||
uniform lowp float u_gapwidth_t;
|
||||
attribute mediump vec2 a_gapwidth;
|
||||
#else
|
||||
uniform mediump float u_gapwidth;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_offset
|
||||
uniform lowp float u_offset_t;
|
||||
attribute lowp vec2 a_offset;
|
||||
#else
|
||||
uniform lowp float u_offset;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_width
|
||||
uniform lowp float u_width_t;
|
||||
attribute mediump vec2 a_width;
|
||||
@@ -106,44 +66,33 @@ attribute mediump vec2 a_width;
|
||||
uniform mediump float u_width;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
blur = unpack_mix_vec2(a_blur, u_blur_t);
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
blur = unpack_mix_vec2(a_blur, u_blur_t);
|
||||
#else
|
||||
lowp float blur = u_blur;
|
||||
lowp float blur = u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_gapwidth
|
||||
mediump float gapwidth = unpack_mix_vec2(a_gapwidth, u_gapwidth_t);
|
||||
#ifndef HAS_UNIFORM_u_gapwidth
|
||||
mediump float gapwidth = unpack_mix_vec2(a_gapwidth, u_gapwidth_t);
|
||||
#else
|
||||
mediump float gapwidth = u_gapwidth;
|
||||
mediump float gapwidth = u_gapwidth;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_offset
|
||||
lowp float offset = unpack_mix_vec2(a_offset, u_offset_t);
|
||||
#ifndef HAS_UNIFORM_u_offset
|
||||
lowp float offset = unpack_mix_vec2(a_offset, u_offset_t);
|
||||
#else
|
||||
lowp float offset = u_offset;
|
||||
lowp float offset = u_offset;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_width
|
||||
mediump float width = unpack_mix_vec2(a_width, u_width_t);
|
||||
#ifndef HAS_UNIFORM_u_width
|
||||
mediump float width = unpack_mix_vec2(a_width, u_width_t);
|
||||
#else
|
||||
mediump float width = u_width;
|
||||
mediump float width = u_width;
|
||||
#endif
|
||||
|
||||
|
||||
// the distance over which the line edge fades out.
|
||||
// Retina devices need a smaller distance to avoid aliasing.
|
||||
float ANTIALIASING = 1.0 / u_device_pixel_ratio / 2.0;
|
||||
@@ -193,12 +142,8 @@ void main() {
|
||||
|
||||
v_width2 = vec2(outset, inset);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of line_gradient.fragment.glsl:
|
||||
/*
|
||||
uniform lowp float u_device_pixel_ratio;
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform lowp float u_device_pixel_ratio;
|
||||
uniform sampler2D u_image;
|
||||
|
||||
varying vec2 v_width2;
|
||||
@@ -206,33 +151,25 @@ varying vec2 v_normal;
|
||||
varying float v_gamma_scale;
|
||||
varying highp float v_lineprogress;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
varying lowp float blur;
|
||||
#else
|
||||
uniform lowp float u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_blur
|
||||
lowp float blur = u_blur;
|
||||
#ifdef HAS_UNIFORM_u_blur
|
||||
lowp float blur = u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
// Calculate the distance of the pixel from the line in pixels.
|
||||
float dist = length(v_normal) * v_width2.s;
|
||||
|
||||
@@ -252,6 +189,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/line_pattern_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<LinePatternProgram> {
|
||||
static constexpr const char* name = "line_pattern";
|
||||
static constexpr const uint8_t hash[8] = {0x38, 0x9c, 0x3d, 0xde, 0xb4, 0xe0, 0xd1, 0x61};
|
||||
static constexpr const auto vertexOffset = 38066;
|
||||
static constexpr const auto fragmentOffset = 41460;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<LinePatternProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<LinePatternProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<LinePatternProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<LinePatternProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of line_pattern.vertex.glsl:
|
||||
/*
|
||||
// floor(127 / 2) == 63.0
|
||||
template <> struct ShaderSource<BuiltIn::LinePatternProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(// floor(127 / 2) == 63.0
|
||||
// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is
|
||||
// stored in a byte (-128..127). we scale regular normals up to length 63, but
|
||||
// there are also "special" normals that have a bigger length (of up to 126 in
|
||||
@@ -64,7 +33,6 @@ varying vec2 v_width2;
|
||||
varying float v_linesofar;
|
||||
varying float v_gamma_scale;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
uniform lowp float u_blur_t;
|
||||
attribute lowp vec2 a_blur;
|
||||
@@ -72,8 +40,6 @@ varying lowp float blur;
|
||||
#else
|
||||
uniform lowp float u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
@@ -81,32 +47,24 @@ varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_offset
|
||||
uniform lowp float u_offset_t;
|
||||
attribute lowp vec2 a_offset;
|
||||
#else
|
||||
uniform lowp float u_offset;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_gapwidth
|
||||
uniform lowp float u_gapwidth_t;
|
||||
attribute mediump vec2 a_gapwidth;
|
||||
#else
|
||||
uniform mediump float u_gapwidth;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_width
|
||||
uniform lowp float u_width_t;
|
||||
attribute mediump vec2 a_width;
|
||||
#else
|
||||
uniform mediump float u_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
uniform lowp float u_pattern_from_t;
|
||||
attribute lowp vec4 a_pattern_from;
|
||||
@@ -114,8 +72,6 @@ varying lowp vec4 pattern_from;
|
||||
#else
|
||||
uniform lowp vec4 u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
uniform lowp float u_pattern_to_t;
|
||||
attribute lowp vec4 a_pattern_to;
|
||||
@@ -124,58 +80,43 @@ varying lowp vec4 pattern_to;
|
||||
uniform lowp vec4 u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
blur = unpack_mix_vec2(a_blur, u_blur_t);
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
blur = unpack_mix_vec2(a_blur, u_blur_t);
|
||||
#else
|
||||
lowp float blur = u_blur;
|
||||
lowp float blur = u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_offset
|
||||
lowp float offset = unpack_mix_vec2(a_offset, u_offset_t);
|
||||
#ifndef HAS_UNIFORM_u_offset
|
||||
lowp float offset = unpack_mix_vec2(a_offset, u_offset_t);
|
||||
#else
|
||||
lowp float offset = u_offset;
|
||||
lowp float offset = u_offset;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_gapwidth
|
||||
mediump float gapwidth = unpack_mix_vec2(a_gapwidth, u_gapwidth_t);
|
||||
#ifndef HAS_UNIFORM_u_gapwidth
|
||||
mediump float gapwidth = unpack_mix_vec2(a_gapwidth, u_gapwidth_t);
|
||||
#else
|
||||
mediump float gapwidth = u_gapwidth;
|
||||
mediump float gapwidth = u_gapwidth;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_width
|
||||
mediump float width = unpack_mix_vec2(a_width, u_width_t);
|
||||
#ifndef HAS_UNIFORM_u_width
|
||||
mediump float width = unpack_mix_vec2(a_width, u_width_t);
|
||||
#else
|
||||
mediump float width = u_width;
|
||||
mediump float width = u_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
pattern_from = a_pattern_from;
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
pattern_from = a_pattern_from;
|
||||
#else
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
pattern_to = a_pattern_to;
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
pattern_to = a_pattern_to;
|
||||
#else
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
// the distance over which the line edge fades out.
|
||||
// Retina devices need a smaller distance to avoid aliasing.
|
||||
float ANTIALIASING = 1.0 / u_device_pixel_ratio / 2.0;
|
||||
@@ -225,12 +166,8 @@ void main() {
|
||||
v_linesofar = a_linesofar;
|
||||
v_width2 = vec2(outset, inset);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of line_pattern.fragment.glsl:
|
||||
/*
|
||||
uniform lowp float u_device_pixel_ratio;
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform lowp float u_device_pixel_ratio;
|
||||
uniform vec2 u_texsize;
|
||||
uniform float u_fade;
|
||||
uniform mediump vec4 u_scale;
|
||||
@@ -242,58 +179,42 @@ varying vec2 v_width2;
|
||||
varying float v_linesofar;
|
||||
varying float v_gamma_scale;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_from
|
||||
varying lowp vec4 pattern_from;
|
||||
#else
|
||||
uniform lowp vec4 u_pattern_from;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_pattern_to
|
||||
varying lowp vec4 pattern_to;
|
||||
#else
|
||||
uniform lowp vec4 u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
varying lowp float blur;
|
||||
#else
|
||||
uniform lowp float u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_pattern_from
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
#ifdef HAS_UNIFORM_u_pattern_from
|
||||
mediump vec4 pattern_from = u_pattern_from;
|
||||
#endif
|
||||
#ifdef HAS_UNIFORM_u_pattern_to
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_pattern_to
|
||||
mediump vec4 pattern_to = u_pattern_to;
|
||||
#ifdef HAS_UNIFORM_u_blur
|
||||
lowp float blur = u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_blur
|
||||
lowp float blur = u_blur;
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
vec2 pattern_tl_a = pattern_from.xy;
|
||||
vec2 pattern_br_a = pattern_from.zw;
|
||||
vec2 pattern_tl_b = pattern_to.xy;
|
||||
@@ -340,6 +261,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/line_sdf_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<LineSDFProgram> {
|
||||
static constexpr const char* name = "line_sdf";
|
||||
static constexpr const uint8_t hash[8] = {0x25, 0x94, 0x7f, 0xad, 0x84, 0xfe, 0x96, 0xad};
|
||||
static constexpr const auto vertexOffset = 43815;
|
||||
static constexpr const auto fragmentOffset = 47502;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<LineSDFProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<LineSDFProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<LineSDFProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<LineSDFProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of line_sdf.vertex.glsl:
|
||||
/*
|
||||
// floor(127 / 2) == 63.0
|
||||
template <> struct ShaderSource<BuiltIn::LineSDFProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(// floor(127 / 2) == 63.0
|
||||
// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is
|
||||
// stored in a byte (-128..127). we scale regular normals up to length 63, but
|
||||
// there are also "special" normals that have a bigger length (of up to 126 in
|
||||
@@ -69,7 +38,6 @@ varying vec2 v_tex_a;
|
||||
varying vec2 v_tex_b;
|
||||
varying float v_gamma_scale;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
uniform lowp float u_color_t;
|
||||
attribute highp vec4 a_color;
|
||||
@@ -77,8 +45,6 @@ varying highp vec4 color;
|
||||
#else
|
||||
uniform highp vec4 u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
uniform lowp float u_blur_t;
|
||||
attribute lowp vec2 a_blur;
|
||||
@@ -86,8 +52,6 @@ varying lowp float blur;
|
||||
#else
|
||||
uniform lowp float u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
@@ -95,24 +59,18 @@ varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_gapwidth
|
||||
uniform lowp float u_gapwidth_t;
|
||||
attribute mediump vec2 a_gapwidth;
|
||||
#else
|
||||
uniform mediump float u_gapwidth;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_offset
|
||||
uniform lowp float u_offset_t;
|
||||
attribute lowp vec2 a_offset;
|
||||
#else
|
||||
uniform lowp float u_offset;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_width
|
||||
uniform lowp float u_width_t;
|
||||
attribute mediump vec2 a_width;
|
||||
@@ -120,8 +78,6 @@ varying mediump float width;
|
||||
#else
|
||||
uniform mediump float u_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_floorwidth
|
||||
uniform lowp float u_floorwidth_t;
|
||||
attribute lowp vec2 a_floorwidth;
|
||||
@@ -130,58 +86,43 @@ varying lowp float floorwidth;
|
||||
uniform lowp float u_floorwidth;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
color = unpack_mix_color(a_color, u_color_t);
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
color = unpack_mix_color(a_color, u_color_t);
|
||||
#else
|
||||
highp vec4 color = u_color;
|
||||
highp vec4 color = u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
blur = unpack_mix_vec2(a_blur, u_blur_t);
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
blur = unpack_mix_vec2(a_blur, u_blur_t);
|
||||
#else
|
||||
lowp float blur = u_blur;
|
||||
lowp float blur = u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_gapwidth
|
||||
mediump float gapwidth = unpack_mix_vec2(a_gapwidth, u_gapwidth_t);
|
||||
#ifndef HAS_UNIFORM_u_gapwidth
|
||||
mediump float gapwidth = unpack_mix_vec2(a_gapwidth, u_gapwidth_t);
|
||||
#else
|
||||
mediump float gapwidth = u_gapwidth;
|
||||
mediump float gapwidth = u_gapwidth;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_offset
|
||||
lowp float offset = unpack_mix_vec2(a_offset, u_offset_t);
|
||||
#ifndef HAS_UNIFORM_u_offset
|
||||
lowp float offset = unpack_mix_vec2(a_offset, u_offset_t);
|
||||
#else
|
||||
lowp float offset = u_offset;
|
||||
lowp float offset = u_offset;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_width
|
||||
width = unpack_mix_vec2(a_width, u_width_t);
|
||||
#ifndef HAS_UNIFORM_u_width
|
||||
width = unpack_mix_vec2(a_width, u_width_t);
|
||||
#else
|
||||
mediump float width = u_width;
|
||||
mediump float width = u_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_floorwidth
|
||||
floorwidth = unpack_mix_vec2(a_floorwidth, u_floorwidth_t);
|
||||
#ifndef HAS_UNIFORM_u_floorwidth
|
||||
floorwidth = unpack_mix_vec2(a_floorwidth, u_floorwidth_t);
|
||||
#else
|
||||
lowp float floorwidth = u_floorwidth;
|
||||
lowp float floorwidth = u_floorwidth;
|
||||
#endif
|
||||
|
||||
|
||||
// the distance over which the line edge fades out.
|
||||
// Retina devices need a smaller distance to avoid aliasing.
|
||||
float ANTIALIASING = 1.0 / u_device_pixel_ratio / 2.0;
|
||||
@@ -233,12 +174,8 @@ void main() {
|
||||
|
||||
v_width2 = vec2(outset, inset);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of line_sdf.fragment.glsl:
|
||||
/*
|
||||
|
||||
)";
|
||||
static constexpr const char* fragment = R"(
|
||||
uniform lowp float u_device_pixel_ratio;
|
||||
uniform sampler2D u_image;
|
||||
uniform float u_sdfgamma;
|
||||
@@ -250,69 +187,49 @@ varying vec2 v_tex_a;
|
||||
varying vec2 v_tex_b;
|
||||
varying float v_gamma_scale;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
varying highp vec4 color;
|
||||
#else
|
||||
uniform highp vec4 u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_blur
|
||||
varying lowp float blur;
|
||||
#else
|
||||
uniform lowp float u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_width
|
||||
varying mediump float width;
|
||||
#else
|
||||
uniform mediump float u_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_floorwidth
|
||||
varying lowp float floorwidth;
|
||||
#else
|
||||
uniform lowp float u_floorwidth;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_color
|
||||
highp vec4 color = u_color;
|
||||
#ifdef HAS_UNIFORM_u_color
|
||||
highp vec4 color = u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_blur
|
||||
lowp float blur = u_blur;
|
||||
#ifdef HAS_UNIFORM_u_blur
|
||||
lowp float blur = u_blur;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_width
|
||||
mediump float width = u_width;
|
||||
#ifdef HAS_UNIFORM_u_width
|
||||
mediump float width = u_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_floorwidth
|
||||
lowp float floorwidth = u_floorwidth;
|
||||
#ifdef HAS_UNIFORM_u_floorwidth
|
||||
lowp float floorwidth = u_floorwidth;
|
||||
#endif
|
||||
|
||||
|
||||
// Calculate the distance of the pixel from the line in pixels.
|
||||
float dist = length(v_normal) * v_width2.s;
|
||||
|
||||
@@ -333,6 +250,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
106
include/mbgl/shaders/gl/prelude.hpp
Normal file
106
include/mbgl/shaders/gl/prelude.hpp
Normal file
@@ -0,0 +1,106 @@
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace shaders {
|
||||
|
||||
template <> struct ShaderSource<BuiltIn::Prelude, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(#ifdef GL_ES
|
||||
precision highp float;
|
||||
#else
|
||||
|
||||
#if !defined(lowp)
|
||||
#define lowp
|
||||
#endif
|
||||
|
||||
#if !defined(mediump)
|
||||
#define mediump
|
||||
#endif
|
||||
|
||||
#if !defined(highp)
|
||||
#define highp
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// Unpack a pair of values that have been packed into a single float.
|
||||
// The packed values are assumed to be 8-bit unsigned integers, and are
|
||||
// packed like so:
|
||||
// packedValue = floor(input[0]) * 256 + input[1],
|
||||
vec2 unpack_float(const float packedValue) {
|
||||
int packedIntValue = int(packedValue);
|
||||
int v0 = packedIntValue / 256;
|
||||
return vec2(v0, packedIntValue - v0 * 256);
|
||||
}
|
||||
|
||||
vec2 unpack_opacity(const float packedOpacity) {
|
||||
int intOpacity = int(packedOpacity) / 2;
|
||||
return vec2(float(intOpacity) / 127.0, mod(packedOpacity, 2.0));
|
||||
}
|
||||
|
||||
// To minimize the number of attributes needed, we encode a 4-component
|
||||
// color into a pair of floats (i.e. a vec2) as follows:
|
||||
// [ floor(color.r * 255) * 256 + color.g * 255,
|
||||
// floor(color.b * 255) * 256 + color.g * 255 ]
|
||||
vec4 decode_color(const vec2 encodedColor) {
|
||||
return vec4(
|
||||
unpack_float(encodedColor[0]) / 255.0,
|
||||
unpack_float(encodedColor[1]) / 255.0
|
||||
);
|
||||
}
|
||||
|
||||
// Unpack a pair of paint values and interpolate between them.
|
||||
float unpack_mix_vec2(const vec2 packedValue, const float t) {
|
||||
return mix(packedValue[0], packedValue[1], t);
|
||||
}
|
||||
|
||||
// Unpack a pair of paint values and interpolate between them.
|
||||
vec4 unpack_mix_color(const vec4 packedColors, const float t) {
|
||||
vec4 minColor = decode_color(vec2(packedColors[0], packedColors[1]));
|
||||
vec4 maxColor = decode_color(vec2(packedColors[2], packedColors[3]));
|
||||
return mix(minColor, maxColor, t);
|
||||
}
|
||||
|
||||
// The offset depends on how many pixels are between the world origin and the edge of the tile:
|
||||
// vec2 offset = mod(pixel_coord, size)
|
||||
//
|
||||
// At high zoom levels there are a ton of pixels between the world origin and the edge of the tile.
|
||||
// The glsl spec only guarantees 16 bits of precision for highp floats. We need more than that.
|
||||
//
|
||||
// The pixel_coord is passed in as two 16 bit values:
|
||||
// pixel_coord_upper = floor(pixel_coord / 2^16)
|
||||
// pixel_coord_lower = mod(pixel_coord, 2^16)
|
||||
//
|
||||
// The offset is calculated in a series of steps that should preserve this precision:
|
||||
vec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,
|
||||
const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {
|
||||
|
||||
vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);
|
||||
return (tile_units_to_pixels * pos + offset) / pattern_size;
|
||||
}
|
||||
)";
|
||||
static constexpr const char* fragment = R"(#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#else
|
||||
|
||||
#if !defined(lowp)
|
||||
#define lowp
|
||||
#endif
|
||||
|
||||
#if !defined(mediump)
|
||||
#define mediump
|
||||
#endif
|
||||
|
||||
#if !defined(highp)
|
||||
#define highp
|
||||
#endif
|
||||
|
||||
#endif
|
||||
)";
|
||||
};
|
||||
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/raster_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<RasterProgram> {
|
||||
static constexpr const char* name = "raster";
|
||||
static constexpr const uint8_t hash[8] = {0x40, 0x3d, 0x6c, 0xf4, 0xd0, 0x41, 0x51, 0x0e};
|
||||
static constexpr const auto vertexOffset = 49047;
|
||||
static constexpr const auto fragmentOffset = 49396;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<RasterProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<RasterProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<RasterProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<RasterProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of raster.vertex.glsl:
|
||||
/*
|
||||
uniform mat4 u_matrix;
|
||||
template <> struct ShaderSource<BuiltIn::RasterProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(uniform mat4 u_matrix;
|
||||
uniform vec2 u_tl_parent;
|
||||
uniform float u_scale_parent;
|
||||
uniform float u_buffer_scale;
|
||||
@@ -60,12 +29,8 @@ void main() {
|
||||
v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;
|
||||
v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of raster.fragment.glsl:
|
||||
/*
|
||||
uniform float u_fade_t;
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform float u_fade_t;
|
||||
uniform float u_opacity;
|
||||
uniform sampler2D u_image0;
|
||||
uniform sampler2D u_image1;
|
||||
@@ -117,6 +82,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/symbol_icon_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<SymbolIconProgram> {
|
||||
static constexpr const char* name = "symbol_icon";
|
||||
static constexpr const uint8_t hash[8] = {0xa9, 0xd8, 0x73, 0xdf, 0xd9, 0xd8, 0x82, 0xf2};
|
||||
static constexpr const auto vertexOffset = 50455;
|
||||
static constexpr const auto fragmentOffset = 53204;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<SymbolIconProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<SymbolIconProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<SymbolIconProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<SymbolIconProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of symbol_icon.vertex.glsl:
|
||||
/*
|
||||
const float PI = 3.141592653589793;
|
||||
template <> struct ShaderSource<BuiltIn::SymbolIconProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(const float PI = 3.141592653589793;
|
||||
|
||||
attribute vec4 a_pos_offset;
|
||||
attribute vec4 a_data;
|
||||
@@ -69,7 +38,6 @@ uniform vec2 u_texsize;
|
||||
varying vec2 v_tex;
|
||||
varying float v_fade_opacity;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
@@ -78,16 +46,13 @@ varying lowp float opacity;
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
vec2 a_pos = a_pos_offset.xy;
|
||||
vec2 a_offset = a_pos_offset.zw;
|
||||
|
||||
@@ -147,31 +112,23 @@ void main() {
|
||||
float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;
|
||||
v_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of symbol_icon.fragment.glsl:
|
||||
/*
|
||||
uniform sampler2D u_texture;
|
||||
)";
|
||||
static constexpr const char* fragment = R"(uniform sampler2D u_texture;
|
||||
|
||||
varying vec2 v_tex;
|
||||
varying float v_fade_opacity;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
lowp float alpha = opacity * v_fade_opacity;
|
||||
gl_FragColor = texture2D(u_texture, v_tex) * alpha;
|
||||
|
||||
@@ -179,6 +136,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/symbol_sdf_text_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<SymbolSDFTextProgram> {
|
||||
static constexpr const char* name = "symbol_sdf_text";
|
||||
static constexpr const uint8_t hash[8] = {0x46, 0xe9, 0x60, 0xde, 0x1e, 0x85, 0x36, 0x54};
|
||||
static constexpr const auto vertexOffset = 53609;
|
||||
static constexpr const auto fragmentOffset = 57649;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<SymbolSDFTextProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<SymbolSDFTextProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<SymbolSDFTextProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<SymbolSDFTextProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of symbol_sdf_text.vertex.glsl:
|
||||
/*
|
||||
const float PI = 3.141592653589793;
|
||||
template <> struct ShaderSource<BuiltIn::SymbolSDFIconProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(const float PI = 3.141592653589793;
|
||||
|
||||
attribute vec4 a_pos_offset;
|
||||
attribute vec4 a_data;
|
||||
@@ -73,7 +42,6 @@ uniform vec2 u_texsize;
|
||||
varying vec2 v_data0;
|
||||
varying vec3 v_data1;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_fill_color
|
||||
uniform lowp float u_fill_color_t;
|
||||
attribute highp vec4 a_fill_color;
|
||||
@@ -81,8 +49,6 @@ varying highp vec4 fill_color;
|
||||
#else
|
||||
uniform highp vec4 u_fill_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_color
|
||||
uniform lowp float u_halo_color_t;
|
||||
attribute highp vec4 a_halo_color;
|
||||
@@ -90,8 +56,6 @@ varying highp vec4 halo_color;
|
||||
#else
|
||||
uniform highp vec4 u_halo_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
@@ -99,8 +63,6 @@ varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_width
|
||||
uniform lowp float u_halo_width_t;
|
||||
attribute lowp vec2 a_halo_width;
|
||||
@@ -108,8 +70,6 @@ varying lowp float halo_width;
|
||||
#else
|
||||
uniform lowp float u_halo_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_blur
|
||||
uniform lowp float u_halo_blur_t;
|
||||
attribute lowp vec2 a_halo_blur;
|
||||
@@ -118,44 +78,33 @@ varying lowp float halo_blur;
|
||||
uniform lowp float u_halo_blur;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_fill_color
|
||||
fill_color = unpack_mix_color(a_fill_color, u_fill_color_t);
|
||||
#ifndef HAS_UNIFORM_u_fill_color
|
||||
fill_color = unpack_mix_color(a_fill_color, u_fill_color_t);
|
||||
#else
|
||||
highp vec4 fill_color = u_fill_color;
|
||||
highp vec4 fill_color = u_fill_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_color
|
||||
halo_color = unpack_mix_color(a_halo_color, u_halo_color_t);
|
||||
#ifndef HAS_UNIFORM_u_halo_color
|
||||
halo_color = unpack_mix_color(a_halo_color, u_halo_color_t);
|
||||
#else
|
||||
highp vec4 halo_color = u_halo_color;
|
||||
highp vec4 halo_color = u_halo_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_width
|
||||
halo_width = unpack_mix_vec2(a_halo_width, u_halo_width_t);
|
||||
#ifndef HAS_UNIFORM_u_halo_width
|
||||
halo_width = unpack_mix_vec2(a_halo_width, u_halo_width_t);
|
||||
#else
|
||||
lowp float halo_width = u_halo_width;
|
||||
lowp float halo_width = u_halo_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_blur
|
||||
halo_blur = unpack_mix_vec2(a_halo_blur, u_halo_blur_t);
|
||||
#ifndef HAS_UNIFORM_u_halo_blur
|
||||
halo_blur = unpack_mix_vec2(a_halo_blur, u_halo_blur_t);
|
||||
#else
|
||||
lowp float halo_blur = u_halo_blur;
|
||||
lowp float halo_blur = u_halo_blur;
|
||||
#endif
|
||||
|
||||
|
||||
vec2 a_pos = a_pos_offset.xy;
|
||||
vec2 a_offset = a_pos_offset.zw;
|
||||
|
||||
@@ -224,12 +173,8 @@ void main() {
|
||||
v_data0 = a_tex / u_texsize;
|
||||
v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of symbol_sdf_text.fragment.glsl:
|
||||
/*
|
||||
#define SDF_PX 8.0
|
||||
)";
|
||||
static constexpr const char* fragment = R"(#define SDF_PX 8.0
|
||||
|
||||
uniform bool u_is_halo;
|
||||
uniform sampler2D u_texture;
|
||||
@@ -240,69 +185,49 @@ uniform bool u_is_text;
|
||||
varying vec2 v_data0;
|
||||
varying vec3 v_data1;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_fill_color
|
||||
varying highp vec4 fill_color;
|
||||
#else
|
||||
uniform highp vec4 u_fill_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_color
|
||||
varying highp vec4 halo_color;
|
||||
#else
|
||||
uniform highp vec4 u_halo_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_width
|
||||
varying lowp float halo_width;
|
||||
#else
|
||||
uniform lowp float u_halo_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_blur
|
||||
varying lowp float halo_blur;
|
||||
#else
|
||||
uniform lowp float u_halo_blur;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_fill_color
|
||||
highp vec4 fill_color = u_fill_color;
|
||||
#ifdef HAS_UNIFORM_u_fill_color
|
||||
highp vec4 fill_color = u_fill_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_halo_color
|
||||
highp vec4 halo_color = u_halo_color;
|
||||
#ifdef HAS_UNIFORM_u_halo_color
|
||||
highp vec4 halo_color = u_halo_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_halo_width
|
||||
lowp float halo_width = u_halo_width;
|
||||
#ifdef HAS_UNIFORM_u_halo_width
|
||||
lowp float halo_width = u_halo_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_halo_blur
|
||||
lowp float halo_blur = u_halo_blur;
|
||||
#ifdef HAS_UNIFORM_u_halo_blur
|
||||
lowp float halo_blur = u_halo_blur;
|
||||
#endif
|
||||
|
||||
|
||||
float EDGE_GAMMA = 0.105 / u_device_pixel_ratio;
|
||||
|
||||
vec2 tex = v_data0.xy;
|
||||
@@ -331,6 +256,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/symbol_sdf_icon_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<SymbolSDFIconProgram> {
|
||||
static constexpr const char* name = "symbol_sdf_icon";
|
||||
static constexpr const uint8_t hash[8] = {0x46, 0xe9, 0x60, 0xde, 0x1e, 0x85, 0x36, 0x54};
|
||||
static constexpr const auto vertexOffset = 53609;
|
||||
static constexpr const auto fragmentOffset = 57649;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<SymbolSDFIconProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<SymbolSDFIconProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<SymbolSDFIconProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<SymbolSDFIconProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of symbol_sdf_icon.vertex.glsl:
|
||||
/*
|
||||
const float PI = 3.141592653589793;
|
||||
template <> struct ShaderSource<BuiltIn::SymbolSDFTextProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(const float PI = 3.141592653589793;
|
||||
|
||||
attribute vec4 a_pos_offset;
|
||||
attribute vec4 a_data;
|
||||
@@ -73,7 +42,6 @@ uniform vec2 u_texsize;
|
||||
varying vec2 v_data0;
|
||||
varying vec3 v_data1;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_fill_color
|
||||
uniform lowp float u_fill_color_t;
|
||||
attribute highp vec4 a_fill_color;
|
||||
@@ -81,8 +49,6 @@ varying highp vec4 fill_color;
|
||||
#else
|
||||
uniform highp vec4 u_fill_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_color
|
||||
uniform lowp float u_halo_color_t;
|
||||
attribute highp vec4 a_halo_color;
|
||||
@@ -90,8 +56,6 @@ varying highp vec4 halo_color;
|
||||
#else
|
||||
uniform highp vec4 u_halo_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
@@ -99,8 +63,6 @@ varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_width
|
||||
uniform lowp float u_halo_width_t;
|
||||
attribute lowp vec2 a_halo_width;
|
||||
@@ -108,8 +70,6 @@ varying lowp float halo_width;
|
||||
#else
|
||||
uniform lowp float u_halo_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_blur
|
||||
uniform lowp float u_halo_blur_t;
|
||||
attribute lowp vec2 a_halo_blur;
|
||||
@@ -118,44 +78,33 @@ varying lowp float halo_blur;
|
||||
uniform lowp float u_halo_blur;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_fill_color
|
||||
fill_color = unpack_mix_color(a_fill_color, u_fill_color_t);
|
||||
#ifndef HAS_UNIFORM_u_fill_color
|
||||
fill_color = unpack_mix_color(a_fill_color, u_fill_color_t);
|
||||
#else
|
||||
highp vec4 fill_color = u_fill_color;
|
||||
highp vec4 fill_color = u_fill_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_color
|
||||
halo_color = unpack_mix_color(a_halo_color, u_halo_color_t);
|
||||
#ifndef HAS_UNIFORM_u_halo_color
|
||||
halo_color = unpack_mix_color(a_halo_color, u_halo_color_t);
|
||||
#else
|
||||
highp vec4 halo_color = u_halo_color;
|
||||
highp vec4 halo_color = u_halo_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_width
|
||||
halo_width = unpack_mix_vec2(a_halo_width, u_halo_width_t);
|
||||
#ifndef HAS_UNIFORM_u_halo_width
|
||||
halo_width = unpack_mix_vec2(a_halo_width, u_halo_width_t);
|
||||
#else
|
||||
lowp float halo_width = u_halo_width;
|
||||
lowp float halo_width = u_halo_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_blur
|
||||
halo_blur = unpack_mix_vec2(a_halo_blur, u_halo_blur_t);
|
||||
#ifndef HAS_UNIFORM_u_halo_blur
|
||||
halo_blur = unpack_mix_vec2(a_halo_blur, u_halo_blur_t);
|
||||
#else
|
||||
lowp float halo_blur = u_halo_blur;
|
||||
lowp float halo_blur = u_halo_blur;
|
||||
#endif
|
||||
|
||||
|
||||
vec2 a_pos = a_pos_offset.xy;
|
||||
vec2 a_offset = a_pos_offset.zw;
|
||||
|
||||
@@ -224,12 +173,8 @@ void main() {
|
||||
v_data0 = a_tex / u_texsize;
|
||||
v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of symbol_sdf_icon.fragment.glsl:
|
||||
/*
|
||||
#define SDF_PX 8.0
|
||||
)";
|
||||
static constexpr const char* fragment = R"(#define SDF_PX 8.0
|
||||
|
||||
uniform bool u_is_halo;
|
||||
uniform sampler2D u_texture;
|
||||
@@ -240,69 +185,49 @@ uniform bool u_is_text;
|
||||
varying vec2 v_data0;
|
||||
varying vec3 v_data1;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_fill_color
|
||||
varying highp vec4 fill_color;
|
||||
#else
|
||||
uniform highp vec4 u_fill_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_color
|
||||
varying highp vec4 halo_color;
|
||||
#else
|
||||
uniform highp vec4 u_halo_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_width
|
||||
varying lowp float halo_width;
|
||||
#else
|
||||
uniform lowp float u_halo_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_blur
|
||||
varying lowp float halo_blur;
|
||||
#else
|
||||
uniform lowp float u_halo_blur;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_fill_color
|
||||
highp vec4 fill_color = u_fill_color;
|
||||
#ifdef HAS_UNIFORM_u_fill_color
|
||||
highp vec4 fill_color = u_fill_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_halo_color
|
||||
highp vec4 halo_color = u_halo_color;
|
||||
#ifdef HAS_UNIFORM_u_halo_color
|
||||
highp vec4 halo_color = u_halo_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_halo_width
|
||||
lowp float halo_width = u_halo_width;
|
||||
#ifdef HAS_UNIFORM_u_halo_width
|
||||
lowp float halo_width = u_halo_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_halo_blur
|
||||
lowp float halo_blur = u_halo_blur;
|
||||
#ifdef HAS_UNIFORM_u_halo_blur
|
||||
lowp float halo_blur = u_halo_blur;
|
||||
#endif
|
||||
|
||||
|
||||
float EDGE_GAMMA = 0.105 / u_device_pixel_ratio;
|
||||
|
||||
vec2 tex = v_data0.xy;
|
||||
@@ -331,6 +256,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,45 +1,14 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/symbol_text_and_icon_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
namespace shaders {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<SymbolTextAndIconProgram> {
|
||||
static constexpr const char* name = "symbol_text_and_icon";
|
||||
static constexpr const uint8_t hash[8] = {0x7e, 0xbe, 0x72, 0x43, 0x55, 0x8e, 0xb5, 0xeb};
|
||||
static constexpr const auto vertexOffset = 59485;
|
||||
static constexpr const auto fragmentOffset = 63541;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<SymbolTextAndIconProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<SymbolTextAndIconProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<SymbolTextAndIconProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<SymbolTextAndIconProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of symbol_text_and_icon.vertex.glsl:
|
||||
/*
|
||||
const float PI = 3.141592653589793;
|
||||
template <> struct ShaderSource<BuiltIn::SymbolTextAndIconProgram, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = R"(const float PI = 3.141592653589793;
|
||||
|
||||
attribute vec4 a_pos_offset;
|
||||
attribute vec4 a_data;
|
||||
@@ -73,7 +42,6 @@ uniform vec2 u_texsize_icon;
|
||||
varying vec4 v_data0;
|
||||
varying vec4 v_data1;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_fill_color
|
||||
uniform lowp float u_fill_color_t;
|
||||
attribute highp vec4 a_fill_color;
|
||||
@@ -81,8 +49,6 @@ varying highp vec4 fill_color;
|
||||
#else
|
||||
uniform highp vec4 u_fill_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_color
|
||||
uniform lowp float u_halo_color_t;
|
||||
attribute highp vec4 a_halo_color;
|
||||
@@ -90,8 +56,6 @@ varying highp vec4 halo_color;
|
||||
#else
|
||||
uniform highp vec4 u_halo_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
@@ -99,8 +63,6 @@ varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_width
|
||||
uniform lowp float u_halo_width_t;
|
||||
attribute lowp vec2 a_halo_width;
|
||||
@@ -108,8 +70,6 @@ varying lowp float halo_width;
|
||||
#else
|
||||
uniform lowp float u_halo_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_blur
|
||||
uniform lowp float u_halo_blur_t;
|
||||
attribute lowp vec2 a_halo_blur;
|
||||
@@ -118,44 +78,33 @@ varying lowp float halo_blur;
|
||||
uniform lowp float u_halo_blur;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_fill_color
|
||||
fill_color = unpack_mix_color(a_fill_color, u_fill_color_t);
|
||||
#ifndef HAS_UNIFORM_u_fill_color
|
||||
fill_color = unpack_mix_color(a_fill_color, u_fill_color_t);
|
||||
#else
|
||||
highp vec4 fill_color = u_fill_color;
|
||||
highp vec4 fill_color = u_fill_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_color
|
||||
halo_color = unpack_mix_color(a_halo_color, u_halo_color_t);
|
||||
#ifndef HAS_UNIFORM_u_halo_color
|
||||
halo_color = unpack_mix_color(a_halo_color, u_halo_color_t);
|
||||
#else
|
||||
highp vec4 halo_color = u_halo_color;
|
||||
highp vec4 halo_color = u_halo_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_width
|
||||
halo_width = unpack_mix_vec2(a_halo_width, u_halo_width_t);
|
||||
#ifndef HAS_UNIFORM_u_halo_width
|
||||
halo_width = unpack_mix_vec2(a_halo_width, u_halo_width_t);
|
||||
#else
|
||||
lowp float halo_width = u_halo_width;
|
||||
lowp float halo_width = u_halo_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_blur
|
||||
halo_blur = unpack_mix_vec2(a_halo_blur, u_halo_blur_t);
|
||||
#ifndef HAS_UNIFORM_u_halo_blur
|
||||
halo_blur = unpack_mix_vec2(a_halo_blur, u_halo_blur_t);
|
||||
#else
|
||||
lowp float halo_blur = u_halo_blur;
|
||||
lowp float halo_blur = u_halo_blur;
|
||||
#endif
|
||||
|
||||
|
||||
vec2 a_pos = a_pos_offset.xy;
|
||||
vec2 a_offset = a_pos_offset.zw;
|
||||
|
||||
@@ -225,12 +174,8 @@ void main() {
|
||||
v_data0.zw = a_tex / u_texsize_icon;
|
||||
v_data1 = vec4(gamma_scale, size, interpolated_fade_opacity, is_sdf);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of symbol_text_and_icon.fragment.glsl:
|
||||
/*
|
||||
#define SDF_PX 8.0
|
||||
)";
|
||||
static constexpr const char* fragment = R"(#define SDF_PX 8.0
|
||||
|
||||
#define SDF 1.0
|
||||
#define ICON 0.0
|
||||
@@ -244,69 +189,49 @@ uniform lowp float u_device_pixel_ratio;
|
||||
varying vec4 v_data0;
|
||||
varying vec4 v_data1;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_fill_color
|
||||
varying highp vec4 fill_color;
|
||||
#else
|
||||
uniform highp vec4 u_fill_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_color
|
||||
varying highp vec4 halo_color;
|
||||
#else
|
||||
uniform highp vec4 u_halo_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_width
|
||||
varying lowp float halo_width;
|
||||
#else
|
||||
uniform lowp float u_halo_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_halo_blur
|
||||
varying lowp float halo_blur;
|
||||
#else
|
||||
uniform lowp float u_halo_blur;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_fill_color
|
||||
highp vec4 fill_color = u_fill_color;
|
||||
#ifdef HAS_UNIFORM_u_fill_color
|
||||
highp vec4 fill_color = u_fill_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_halo_color
|
||||
highp vec4 halo_color = u_halo_color;
|
||||
#ifdef HAS_UNIFORM_u_halo_color
|
||||
highp vec4 halo_color = u_halo_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_halo_width
|
||||
lowp float halo_width = u_halo_width;
|
||||
#ifdef HAS_UNIFORM_u_halo_width
|
||||
lowp float halo_width = u_halo_width;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_halo_blur
|
||||
lowp float halo_blur = u_halo_blur;
|
||||
#ifdef HAS_UNIFORM_u_halo_blur
|
||||
lowp float halo_blur = u_halo_blur;
|
||||
#endif
|
||||
|
||||
|
||||
float fade_opacity = v_data1[2];
|
||||
|
||||
if (v_data1.w == ICON) {
|
||||
@@ -348,6 +273,8 @@ void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)";
|
||||
};
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
35
include/mbgl/shaders/shader_manifest.hpp
Normal file
35
include/mbgl/shaders/shader_manifest.hpp
Normal file
@@ -0,0 +1,35 @@
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
|
||||
#ifdef MBGL_RENDER_BACKEND_OPENGL
|
||||
#include <mbgl/shaders/gl/prelude.hpp>
|
||||
#include <mbgl/shaders/gl/background.hpp>
|
||||
#include <mbgl/shaders/gl/background_pattern.hpp>
|
||||
#include <mbgl/shaders/gl/circle.hpp>
|
||||
#include <mbgl/shaders/gl/clipping_mask.hpp>
|
||||
#include <mbgl/shaders/gl/collision_box.hpp>
|
||||
#include <mbgl/shaders/gl/collision_circle.hpp>
|
||||
#include <mbgl/shaders/gl/debug.hpp>
|
||||
#include <mbgl/shaders/gl/fill_extrusion_pattern.hpp>
|
||||
#include <mbgl/shaders/gl/fill_extrusion.hpp>
|
||||
#include <mbgl/shaders/gl/fill_outline_pattern.hpp>
|
||||
#include <mbgl/shaders/gl/fill_outline.hpp>
|
||||
#include <mbgl/shaders/gl/fill_pattern.hpp>
|
||||
#include <mbgl/shaders/gl/fill.hpp>
|
||||
#include <mbgl/shaders/gl/heatmap_texture.hpp>
|
||||
#include <mbgl/shaders/gl/heatmap.hpp>
|
||||
#include <mbgl/shaders/gl/hillshade_prepare.hpp>
|
||||
#include <mbgl/shaders/gl/hillshade.hpp>
|
||||
#include <mbgl/shaders/gl/line_gradient.hpp>
|
||||
#include <mbgl/shaders/gl/line_pattern.hpp>
|
||||
#include <mbgl/shaders/gl/line_sdf.hpp>
|
||||
#include <mbgl/shaders/gl/line.hpp>
|
||||
#include <mbgl/shaders/gl/raster.hpp>
|
||||
#include <mbgl/shaders/gl/symbol_icon.hpp>
|
||||
#include <mbgl/shaders/gl/symbol_sdf_text.hpp>
|
||||
#include <mbgl/shaders/gl/symbol_sdf_icon.hpp>
|
||||
#include <mbgl/shaders/gl/symbol_text_and_icon.hpp>
|
||||
#endif
|
||||
57
include/mbgl/shaders/shader_source.hpp
Normal file
57
include/mbgl/shaders/shader_source.hpp
Normal file
@@ -0,0 +1,57 @@
|
||||
// Generated code, do not modify this file!
|
||||
// Generated on 2023-04-04T01:24:40.539Z by mwilsnd using shaders/generate_shader_code.js
|
||||
|
||||
#pragma once
|
||||
#include <mbgl/gfx/backend.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace shaders {
|
||||
|
||||
/// @brief This enum is used with the ShaderSource template to select
|
||||
/// source code for the desired program and graphics back-end.
|
||||
enum class BuiltIn {
|
||||
None,
|
||||
Prelude,
|
||||
BackgroundProgram,
|
||||
BackgroundPatternProgram,
|
||||
CircleProgram,
|
||||
ClippingMaskProgram,
|
||||
CollisionBoxProgram,
|
||||
CollisionCircleProgram,
|
||||
DebugProgram,
|
||||
FillExtrusionPatternProgram,
|
||||
FillExtrusionProgram,
|
||||
FillOutlinePatternProgram,
|
||||
FillOutlineProgram,
|
||||
FillPatternProgram,
|
||||
FillProgram,
|
||||
HeatmapTextureProgram,
|
||||
HeatmapProgram,
|
||||
HillshadePrepareProgram,
|
||||
HillshadeProgram,
|
||||
LineGradientProgram,
|
||||
LinePatternProgram,
|
||||
LineSDFProgram,
|
||||
LineProgram,
|
||||
RasterProgram,
|
||||
SymbolIconProgram,
|
||||
SymbolSDFTextProgram,
|
||||
SymbolSDFIconProgram,
|
||||
SymbolTextAndIconProgram
|
||||
};
|
||||
|
||||
/// @brief Select shader source based on a program type and a desired
|
||||
/// graphics API.
|
||||
/// @tparam T One of the built-in shader types available in the BuiltIn enum
|
||||
/// @tparam The desired graphics API to request shader code for. One of
|
||||
/// gfx::Backend::Type enums.
|
||||
template <BuiltIn T, gfx::Backend::Type> struct ShaderSource;
|
||||
|
||||
/// @brief A specialization of the ShaderSource template for no shader code.
|
||||
template <> struct ShaderSource<BuiltIn::None, gfx::Backend::Type::OpenGL> {
|
||||
static constexpr const char* vertex = "";
|
||||
static constexpr const char* fragment = "";
|
||||
};
|
||||
|
||||
} // namespace shaders
|
||||
} // namespace mbgl
|
||||
@@ -1,195 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
require('@mapbox/flow-remove-types/register');
|
||||
|
||||
const path = require('path');
|
||||
const outputPath = 'src/mbgl/programs';
|
||||
const zlib = require('zlib');
|
||||
const crypto = require('crypto');
|
||||
|
||||
var shaders = require('../shaders');
|
||||
|
||||
require('./style-code');
|
||||
|
||||
let concatenated = '';
|
||||
let offsets = {};
|
||||
|
||||
function basicMinify(src) {
|
||||
return src = src.trim() // strip whitespace at the start/end
|
||||
.replace(/\s*\/\/[^\n]*\n/g, '\n') // strip double-slash comments
|
||||
.replace(/\n+/g, '\n') // collapse multi line breaks
|
||||
.replace(/\n\s+/g, '\n') // strip identation
|
||||
.replace(/\s?([+-\/*=,])\s?/g, '$1') // strip whitespace around operators
|
||||
.replace(/([;\(\),\{\}])\n(?=[^#])/g, '$1'); // strip more line breaks
|
||||
}
|
||||
|
||||
for (const key in shaders) {
|
||||
const hash = crypto.createHash('sha1');
|
||||
|
||||
const vertex = concatenated.length;
|
||||
const vertexSource = basicMinify(shaders[key].vertexSource) + '\n\0';
|
||||
hash.update(vertexSource);
|
||||
concatenated += vertexSource;
|
||||
|
||||
const fragment = concatenated.length;
|
||||
const fragmentSource = basicMinify(shaders[key].fragmentSource) + '\n\0';
|
||||
hash.update(fragmentSource);
|
||||
concatenated += fragmentSource;
|
||||
|
||||
offsets[key] = {
|
||||
vertex,
|
||||
fragment,
|
||||
originalKey: key,
|
||||
hash: hash.digest('hex').substring(0, 16).match(/.{1,2}/g).map(n => `0x${n}`).join(', '),
|
||||
shaderName: key.replace(/[A-Z]+/g, (match) => `_${match.toLowerCase()}`),
|
||||
ShaderName: key.replace(/^[a-z]/g, (match) => match.toUpperCase())
|
||||
};
|
||||
}
|
||||
|
||||
// Overrides: The symbolSDF shader is used for two underlying programs.
|
||||
offsets.symbolSDFIcon = {
|
||||
vertex: offsets.symbolSDF.vertex,
|
||||
fragment: offsets.symbolSDF.fragment,
|
||||
hash: offsets.symbolSDF.hash,
|
||||
originalKey: 'symbolSDF',
|
||||
shaderName: 'symbol_sdf_icon',
|
||||
ShaderName: 'SymbolSDFIcon',
|
||||
};
|
||||
|
||||
offsets.symbolSDFText = {
|
||||
vertex: offsets.symbolSDF.vertex,
|
||||
fragment: offsets.symbolSDF.fragment,
|
||||
hash: offsets.symbolSDF.hash,
|
||||
originalKey: 'symbolSDF',
|
||||
shaderName: 'symbol_sdf_text',
|
||||
ShaderName: 'SymbolSDFText',
|
||||
};
|
||||
|
||||
delete offsets.symbolSDF;
|
||||
|
||||
const compressed = zlib.deflateSync(concatenated, {level: zlib.Z_BEST_COMPRESSION})
|
||||
.toString('hex')
|
||||
.match(/.{1,32}/g)
|
||||
.map(line => line.match(/.{1,2}/g).map(n => `0x${n}`).join(', '))
|
||||
.join(',\n ')
|
||||
.trim();
|
||||
|
||||
writeIfModified(path.join(outputPath, 'gl', 'shader_source.hpp'), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
const char* shaderSource();
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
} // namespace mbgl
|
||||
`);
|
||||
|
||||
writeIfModified(path.join(outputPath, 'gl', 'shader_source.cpp'), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/util/compression.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
constexpr const uint8_t compressedShaderSource[] = {
|
||||
${compressed}};
|
||||
|
||||
const char* shaderSource() {
|
||||
static std::string decompressed = util::decompress(std::string(reinterpret_cast<const char*>(compressedShaderSource), sizeof(compressedShaderSource)));
|
||||
return decompressed.c_str();
|
||||
};
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
} // namespace mbgl
|
||||
// clang-format on
|
||||
`);
|
||||
|
||||
writeIfModified(path.join(outputPath, 'gl', 'preludes.hpp'), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
constexpr const uint8_t preludeHash[8] = {${offsets['prelude'].hash}};
|
||||
constexpr const auto vertexPreludeOffset = ${offsets['prelude'].vertex};
|
||||
constexpr const auto fragmentPreludeOffset = ${offsets['prelude'].fragment};
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
} // namespace mbgl
|
||||
`);
|
||||
|
||||
for (const key in offsets) {
|
||||
if (key === 'prelude')
|
||||
continue;
|
||||
|
||||
const { shaderName, ShaderName, originalKey } = offsets[key];
|
||||
|
||||
writeIfModified(path.join(outputPath, 'gl', `${shaderName}.cpp`), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/${shaderName}_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<${ShaderName}Program> {
|
||||
static constexpr const char* name = "${shaderName}";
|
||||
static constexpr const uint8_t hash[8] = {${offsets[key].hash}};
|
||||
static constexpr const auto vertexOffset = ${offsets[key].vertex};
|
||||
static constexpr const auto fragmentOffset = ${offsets[key].fragment};
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<${ShaderName}Program>::name;
|
||||
constexpr const uint8_t ShaderSource<${ShaderName}Program>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<${ShaderName}Program>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<${ShaderName}Program>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of ${shaderName}.vertex.glsl:
|
||||
/*
|
||||
${shaders[originalKey].vertexSource}
|
||||
*/
|
||||
|
||||
// Uncompressed source of ${shaderName}.fragment.glsl:
|
||||
/*
|
||||
${shaders[originalKey].fragmentSource}
|
||||
*/
|
||||
// clang-format on
|
||||
`);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// @flow
|
||||
|
||||
import {clamp} from '../util/util';
|
||||
|
||||
/**
|
||||
* Packs two numbers, interpreted as 8-bit unsigned integers, into a single
|
||||
* float. Unpack them in the shader using the `unpack_float()` function,
|
||||
* defined in _prelude.vertex.glsl
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
export function packUint8ToFloat(a: number, b: number) {
|
||||
// coerce a and b to 8-bit ints
|
||||
a = clamp(Math.floor(a), 0, 255);
|
||||
b = clamp(Math.floor(b), 0, 255);
|
||||
return 256 * a + b;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// This file is intended for use in the GL-JS test suite
|
||||
// It provides the shaders entry point for Node (tests and GL Native)
|
||||
// In a browser environment, this file is replaced with ./src/shaders/shaders.js
|
||||
// when Rollup builds the main bundle.
|
||||
// See https://github.com/mapbox/mapbox-gl-js/blob/master/package.json#L104-L108
|
||||
|
||||
/* eslint-disable import/unambiguous, import/no-commonjs, flowtype/require-valid-file-annotation, no-global-assign */
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
// enable ES Modules in Node
|
||||
require = require("esm")(module);
|
||||
|
||||
// enable requiring GLSL in Node
|
||||
require.extensions['.glsl'] = function (module, filename) {
|
||||
const content = fs.readFileSync(filename, 'utf8');
|
||||
module._compile(`module.exports = \`${content}\``, filename);
|
||||
};
|
||||
|
||||
module.exports = require("./shaders.js");
|
||||
@@ -1,180 +0,0 @@
|
||||
|
||||
// Disable Flow annotations here because Flow doesn't support importing GLSL files
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
|
||||
import preludeFrag from './_prelude.fragment.glsl';
|
||||
import preludeVert from './_prelude.vertex.glsl';
|
||||
import backgroundFrag from './background.fragment.glsl';
|
||||
import backgroundVert from './background.vertex.glsl';
|
||||
import backgroundPatternFrag from './background_pattern.fragment.glsl';
|
||||
import backgroundPatternVert from './background_pattern.vertex.glsl';
|
||||
import circleFrag from './circle.fragment.glsl';
|
||||
import circleVert from './circle.vertex.glsl';
|
||||
import clippingMaskFrag from './clipping_mask.fragment.glsl';
|
||||
import clippingMaskVert from './clipping_mask.vertex.glsl';
|
||||
import heatmapFrag from './heatmap.fragment.glsl';
|
||||
import heatmapVert from './heatmap.vertex.glsl';
|
||||
import heatmapTextureFrag from './heatmap_texture.fragment.glsl';
|
||||
import heatmapTextureVert from './heatmap_texture.vertex.glsl';
|
||||
import collisionBoxFrag from './collision_box.fragment.glsl';
|
||||
import collisionBoxVert from './collision_box.vertex.glsl';
|
||||
import collisionCircleFrag from './collision_circle.fragment.glsl';
|
||||
import collisionCircleVert from './collision_circle.vertex.glsl';
|
||||
import debugFrag from './debug.fragment.glsl';
|
||||
import debugVert from './debug.vertex.glsl';
|
||||
import fillFrag from './fill.fragment.glsl';
|
||||
import fillVert from './fill.vertex.glsl';
|
||||
import fillOutlineFrag from './fill_outline.fragment.glsl';
|
||||
import fillOutlineVert from './fill_outline.vertex.glsl';
|
||||
import fillOutlinePatternFrag from './fill_outline_pattern.fragment.glsl';
|
||||
import fillOutlinePatternVert from './fill_outline_pattern.vertex.glsl';
|
||||
import fillPatternFrag from './fill_pattern.fragment.glsl';
|
||||
import fillPatternVert from './fill_pattern.vertex.glsl';
|
||||
import fillExtrusionFrag from './fill_extrusion.fragment.glsl';
|
||||
import fillExtrusionVert from './fill_extrusion.vertex.glsl';
|
||||
import fillExtrusionPatternFrag from './fill_extrusion_pattern.fragment.glsl';
|
||||
import fillExtrusionPatternVert from './fill_extrusion_pattern.vertex.glsl';
|
||||
import hillshadePrepareFrag from './hillshade_prepare.fragment.glsl';
|
||||
import hillshadePrepareVert from './hillshade_prepare.vertex.glsl';
|
||||
import hillshadeFrag from './hillshade.fragment.glsl';
|
||||
import hillshadeVert from './hillshade.vertex.glsl';
|
||||
import lineFrag from './line.fragment.glsl';
|
||||
import lineVert from './line.vertex.glsl';
|
||||
import lineGradientFrag from './line_gradient.fragment.glsl';
|
||||
import lineGradientVert from './line_gradient.vertex.glsl';
|
||||
import linePatternFrag from './line_pattern.fragment.glsl';
|
||||
import linePatternVert from './line_pattern.vertex.glsl';
|
||||
import lineSDFFrag from './line_sdf.fragment.glsl';
|
||||
import lineSDFVert from './line_sdf.vertex.glsl';
|
||||
import rasterFrag from './raster.fragment.glsl';
|
||||
import rasterVert from './raster.vertex.glsl';
|
||||
import symbolIconFrag from './symbol_icon.fragment.glsl';
|
||||
import symbolIconVert from './symbol_icon.vertex.glsl';
|
||||
import symbolSDFFrag from './symbol_sdf.fragment.glsl';
|
||||
import symbolSDFVert from './symbol_sdf.vertex.glsl';
|
||||
import symbolTextAndIconFrag from './symbol_text_and_icon.fragment.glsl';
|
||||
import symbolTextAndIconVert from './symbol_text_and_icon.vertex.glsl';
|
||||
|
||||
export const prelude = compile(preludeFrag, preludeVert);
|
||||
export const background = compile(backgroundFrag, backgroundVert);
|
||||
export const backgroundPattern = compile(backgroundPatternFrag, backgroundPatternVert);
|
||||
export const circle = compile(circleFrag, circleVert);
|
||||
export const clippingMask = compile(clippingMaskFrag, clippingMaskVert);
|
||||
export const heatmap = compile(heatmapFrag, heatmapVert);
|
||||
export const heatmapTexture = compile(heatmapTextureFrag, heatmapTextureVert);
|
||||
export const collisionBox = compile(collisionBoxFrag, collisionBoxVert);
|
||||
export const collisionCircle = compile(collisionCircleFrag, collisionCircleVert);
|
||||
export const debug = compile(debugFrag, debugVert);
|
||||
export const fill = compile(fillFrag, fillVert);
|
||||
export const fillOutline = compile(fillOutlineFrag, fillOutlineVert);
|
||||
export const fillOutlinePattern = compile(fillOutlinePatternFrag, fillOutlinePatternVert);
|
||||
export const fillPattern = compile(fillPatternFrag, fillPatternVert);
|
||||
export const fillExtrusion = compile(fillExtrusionFrag, fillExtrusionVert);
|
||||
export const fillExtrusionPattern = compile(fillExtrusionPatternFrag, fillExtrusionPatternVert);
|
||||
export const hillshadePrepare = compile(hillshadePrepareFrag, hillshadePrepareVert);
|
||||
export const hillshade = compile(hillshadeFrag, hillshadeVert);
|
||||
export const line = compile(lineFrag, lineVert);
|
||||
export const lineGradient = compile(lineGradientFrag, lineGradientVert);
|
||||
export const linePattern = compile(linePatternFrag, linePatternVert);
|
||||
export const lineSDF = compile(lineSDFFrag, lineSDFVert);
|
||||
export const raster = compile(rasterFrag, rasterVert);
|
||||
export const symbolIcon = compile(symbolIconFrag, symbolIconVert);
|
||||
export const symbolSDF = compile(symbolSDFFrag, symbolSDFVert);
|
||||
export const symbolTextAndIcon = compile(symbolTextAndIconFrag, symbolTextAndIconVert);
|
||||
|
||||
// Expand #pragmas to #ifdefs.
|
||||
|
||||
function compile(fragmentSource, vertexSource) {
|
||||
const re = /#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g;
|
||||
|
||||
const fragmentPragmas = {};
|
||||
|
||||
fragmentSource = fragmentSource.replace(re, (match, operation, precision, type, name) => {
|
||||
fragmentPragmas[name] = true;
|
||||
if (operation === 'define') {
|
||||
return `
|
||||
#ifndef HAS_UNIFORM_u_${name}
|
||||
varying ${precision} ${type} ${name};
|
||||
#else
|
||||
uniform ${precision} ${type} u_${name};
|
||||
#endif
|
||||
`;
|
||||
} else /* if (operation === 'initialize') */ {
|
||||
return `
|
||||
#ifdef HAS_UNIFORM_u_${name}
|
||||
${precision} ${type} ${name} = u_${name};
|
||||
#endif
|
||||
`;
|
||||
}
|
||||
});
|
||||
|
||||
vertexSource = vertexSource.replace(re, (match, operation, precision, type, name) => {
|
||||
const attrType = type === 'float' ? 'vec2' : 'vec4';
|
||||
const unpackType = name.match(/color/) ? 'color' : attrType;
|
||||
|
||||
if (fragmentPragmas[name]) {
|
||||
if (operation === 'define') {
|
||||
return `
|
||||
#ifndef HAS_UNIFORM_u_${name}
|
||||
uniform lowp float u_${name}_t;
|
||||
attribute ${precision} ${attrType} a_${name};
|
||||
varying ${precision} ${type} ${name};
|
||||
#else
|
||||
uniform ${precision} ${type} u_${name};
|
||||
#endif
|
||||
`;
|
||||
} else /* if (operation === 'initialize') */ {
|
||||
if (unpackType === 'vec4') {
|
||||
// vec4 attributes are only used for cross-faded properties, and are not packed
|
||||
return `
|
||||
#ifndef HAS_UNIFORM_u_${name}
|
||||
${name} = a_${name};
|
||||
#else
|
||||
${precision} ${type} ${name} = u_${name};
|
||||
#endif
|
||||
`;
|
||||
} else {
|
||||
return `
|
||||
#ifndef HAS_UNIFORM_u_${name}
|
||||
${name} = unpack_mix_${unpackType}(a_${name}, u_${name}_t);
|
||||
#else
|
||||
${precision} ${type} ${name} = u_${name};
|
||||
#endif
|
||||
`;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (operation === 'define') {
|
||||
return `
|
||||
#ifndef HAS_UNIFORM_u_${name}
|
||||
uniform lowp float u_${name}_t;
|
||||
attribute ${precision} ${attrType} a_${name};
|
||||
#else
|
||||
uniform ${precision} ${type} u_${name};
|
||||
#endif
|
||||
`;
|
||||
} else /* if (operation === 'initialize') */ {
|
||||
if (unpackType === 'vec4') {
|
||||
// vec4 attributes are only used for cross-faded properties, and are not packed
|
||||
return `
|
||||
#ifndef HAS_UNIFORM_u_${name}
|
||||
${precision} ${type} ${name} = a_${name};
|
||||
#else
|
||||
${precision} ${type} ${name} = u_${name};
|
||||
#endif
|
||||
`;
|
||||
} else /* */{
|
||||
return `
|
||||
#ifndef HAS_UNIFORM_u_${name}
|
||||
${precision} ${type} ${name} = unpack_mix_${unpackType}(a_${name}, u_${name}_t);
|
||||
#else
|
||||
${precision} ${type} ${name} = u_${name};
|
||||
#endif
|
||||
`;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return {fragmentSource, vertexSource};
|
||||
}
|
||||
@@ -76,12 +76,6 @@ public:
|
||||
protected:
|
||||
virtual std::unique_ptr<DrawScopeResource> createDrawScopeResource() = 0;
|
||||
|
||||
public:
|
||||
template <typename Name>
|
||||
std::unique_ptr<Program<Name>> createProgram(const ProgramParameters& programParameters) {
|
||||
return Backend::Create<Program<Name>, const ProgramParameters&>(programParameters);
|
||||
}
|
||||
|
||||
public:
|
||||
virtual std::unique_ptr<CommandEncoder> createCommandEncoder() = 0;
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
#include <mbgl/util/logging.hpp>
|
||||
#include <mbgl/programs/program_parameters.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/programs/gl/shaders.hpp>
|
||||
#include <mbgl/shaders/shader_manifest.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -37,9 +36,6 @@ public:
|
||||
|
||||
const ProgramParameters programParameters;
|
||||
|
||||
static constexpr const auto vertexOffset = programs::gl::ShaderSource<Name>::vertexOffset;
|
||||
static constexpr const auto fragmentOffset = programs::gl::ShaderSource<Name>::fragmentOffset;
|
||||
|
||||
class Instance {
|
||||
public:
|
||||
Instance(Context& context,
|
||||
@@ -63,19 +59,15 @@ public:
|
||||
std::initializer_list<const char*> vertexSource = {
|
||||
programParameters.getDefines().c_str(),
|
||||
additionalDefines.c_str(),
|
||||
(programs::gl::shaderSource() + programs::gl::vertexPreludeOffset),
|
||||
programParameters.vertexSource().length() == 0 ?
|
||||
(programs::gl::shaderSource() + vertexOffset) :
|
||||
programParameters.vertexSource().c_str()
|
||||
shaders::ShaderSource<shaders::BuiltIn::Prelude, gfx::Backend::Type::OpenGL>::vertex,
|
||||
programParameters.vertexSource(gfx::Backend::Type::OpenGL).c_str()
|
||||
};
|
||||
|
||||
std::initializer_list<const char*> fragmentSource = {
|
||||
programParameters.getDefines().c_str(),
|
||||
additionalDefines.c_str(),
|
||||
(programs::gl::shaderSource() + programs::gl::fragmentPreludeOffset),
|
||||
programParameters.fragmentSource().length() == 0 ?
|
||||
(programs::gl::shaderSource() + fragmentOffset) :
|
||||
programParameters.fragmentSource().c_str()
|
||||
shaders::ShaderSource<shaders::BuiltIn::Prelude, gfx::Backend::Type::OpenGL>::fragment,
|
||||
programParameters.fragmentSource(gfx::Backend::Type::OpenGL).c_str()
|
||||
};
|
||||
|
||||
return std::make_unique<Instance>(context, vertexSource, fragmentSource);
|
||||
@@ -111,13 +103,17 @@ public:
|
||||
const uint32_t key = gl::AttributeKey<AttributeList>::compute(attributeBindings);
|
||||
auto it = instances.find(key);
|
||||
if (it == instances.end()) {
|
||||
it = instances
|
||||
.emplace(key,
|
||||
Instance::createInstance(
|
||||
context,
|
||||
programParameters,
|
||||
gl::AttributeKey<AttributeList>::defines(attributeBindings)))
|
||||
.first;
|
||||
try {
|
||||
it = instances.emplace(key,
|
||||
Instance::createInstance(
|
||||
context,
|
||||
programParameters,
|
||||
gl::AttributeKey<AttributeList>::defines(attributeBindings)
|
||||
)).first;
|
||||
} catch (const std::runtime_error& e) {
|
||||
Log::Error(Event::OpenGL, e.what());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
auto& instance = *it->second;
|
||||
|
||||
@@ -39,8 +39,9 @@ using BackgroundPatternUniforms = TypeList<
|
||||
uniforms::pixel_coord_lower,
|
||||
uniforms::tile_units_to_pixels>;
|
||||
|
||||
class BackgroundProgram : public Program<
|
||||
class BackgroundProgram final : public Program<
|
||||
BackgroundProgram,
|
||||
shaders::BuiltIn::BackgroundProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
BackgroundLayoutAttributes,
|
||||
BackgroundUniforms,
|
||||
@@ -48,11 +49,17 @@ class BackgroundProgram : public Program<
|
||||
style::Properties<>>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"BackgroundProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
};
|
||||
|
||||
class BackgroundPatternProgram : public Program<
|
||||
class BackgroundPatternProgram final : public Program<
|
||||
BackgroundPatternProgram,
|
||||
shaders::BuiltIn::BackgroundPatternProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
BackgroundLayoutAttributes,
|
||||
BackgroundPatternUniforms,
|
||||
@@ -61,6 +68,11 @@ class BackgroundPatternProgram : public Program<
|
||||
style::Properties<>>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"BackgroundPatternProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static LayoutUniformValues layoutUniformValues(mat4 matrix,
|
||||
@@ -76,13 +88,4 @@ public:
|
||||
using BackgroundLayoutVertex = BackgroundProgram::LayoutVertex;
|
||||
using BackgroundAttributes = BackgroundProgram::AttributeList;
|
||||
|
||||
class BackgroundLayerPrograms final : public LayerTypePrograms {
|
||||
public:
|
||||
BackgroundLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
|
||||
: background(context, programParameters),
|
||||
backgroundPattern(context, programParameters) {}
|
||||
BackgroundProgram background;
|
||||
BackgroundPatternProgram backgroundPattern;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -12,8 +12,9 @@ namespace uniforms {
|
||||
MBGL_DEFINE_UNIFORM_SCALAR(bool, scale_with_map);
|
||||
} // namespace uniforms
|
||||
|
||||
class CircleProgram : public Program<
|
||||
class CircleProgram final : public Program<
|
||||
CircleProgram,
|
||||
shaders::BuiltIn::CircleProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
TypeList<
|
||||
attributes::pos>,
|
||||
@@ -28,6 +29,11 @@ class CircleProgram : public Program<
|
||||
style::CirclePaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"CircleProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
/*
|
||||
@@ -49,11 +55,4 @@ public:
|
||||
using CircleLayoutVertex = CircleProgram::LayoutVertex;
|
||||
using CircleAttributes = CircleProgram::AttributeList;
|
||||
|
||||
class CircleLayerPrograms final : public LayerTypePrograms {
|
||||
public:
|
||||
CircleLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
|
||||
: circle(context, programParameters) {}
|
||||
CircleProgram circle;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class ClippingMaskProgram : public Program<
|
||||
class ClippingMaskProgram final : public Program<
|
||||
ClippingMaskProgram,
|
||||
shaders::BuiltIn::ClippingMaskProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
PositionOnlyLayoutAttributes,
|
||||
TypeList<
|
||||
@@ -17,6 +18,11 @@ class ClippingMaskProgram : public Program<
|
||||
style::Properties<>>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"ClippingMaskProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
};
|
||||
|
||||
|
||||
@@ -17,8 +17,9 @@ using CollisionBoxLayoutAttributes = TypeList<
|
||||
|
||||
using CollisionBoxDynamicAttributes = TypeList<attributes::placed, attributes::shift>;
|
||||
|
||||
class CollisionBoxProgram : public Program<
|
||||
class CollisionBoxProgram final : public Program<
|
||||
CollisionBoxProgram,
|
||||
shaders::BuiltIn::CollisionBoxProgram,
|
||||
gfx::PrimitiveType::Line,
|
||||
TypeListConcat<CollisionBoxLayoutAttributes, CollisionBoxDynamicAttributes>,
|
||||
TypeList<
|
||||
@@ -29,6 +30,11 @@ class CollisionBoxProgram : public Program<
|
||||
style::Properties<>>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"CollisionBoxProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static gfx::Vertex<CollisionBoxLayoutAttributes> layoutVertex(Point<float> a, Point<float> anchor, Point<float> o) {
|
||||
@@ -108,8 +114,9 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class CollisionCircleProgram : public Program<
|
||||
class CollisionCircleProgram final : public Program<
|
||||
CollisionCircleProgram,
|
||||
shaders::BuiltIn::CollisionCircleProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
TypeListConcat<CollisionBoxLayoutAttributes, CollisionBoxDynamicAttributes>,
|
||||
TypeList<
|
||||
@@ -121,6 +128,11 @@ class CollisionCircleProgram : public Program<
|
||||
style::Properties<>>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"CollisionCircleProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static gfx::Vertex<CollisionBoxLayoutAttributes> vertex(Point<float> a, Point<float> anchor, Point<float> o) {
|
||||
|
||||
@@ -11,13 +11,21 @@ namespace mbgl {
|
||||
namespace uniforms {
|
||||
MBGL_DEFINE_UNIFORM_SCALAR(float, overlay_scale);
|
||||
}
|
||||
class DebugProgram : public Program<DebugProgram,
|
||||
gfx::PrimitiveType::Line,
|
||||
TypeList<attributes::pos>,
|
||||
TypeList<uniforms::matrix, uniforms::color, uniforms::overlay_scale>,
|
||||
TypeList<textures::overlay>,
|
||||
style::Properties<>> {
|
||||
class DebugProgram final : public Program<
|
||||
DebugProgram,
|
||||
shaders::BuiltIn::DebugProgram,
|
||||
gfx::PrimitiveType::Line,
|
||||
TypeList<attributes::pos>,
|
||||
TypeList<uniforms::matrix, uniforms::color, uniforms::overlay_scale>,
|
||||
TypeList<textures::overlay>,
|
||||
style::Properties<>>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"DebugProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
};
|
||||
|
||||
|
||||
@@ -54,8 +54,9 @@ using FillExtrusionPatternUniforms = TypeList<
|
||||
uniforms::lightintensity,
|
||||
uniforms::vertical_gradient>;
|
||||
|
||||
class FillExtrusionProgram : public Program<
|
||||
class FillExtrusionProgram final : public Program<
|
||||
FillExtrusionProgram,
|
||||
shaders::BuiltIn::FillExtrusionProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
FillExtrusionLayoutAttributes,
|
||||
FillExtrusionUniforms,
|
||||
@@ -63,6 +64,11 @@ class FillExtrusionProgram : public Program<
|
||||
style::FillExtrusionPaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"FillExtrusionProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static LayoutVertex layoutVertex(Point<int16_t> p, double nx, double ny, double nz, unsigned short t, uint16_t e) {
|
||||
@@ -89,8 +95,9 @@ public:
|
||||
mat4, const TransformState&, float opacity, const EvaluatedLight&, float verticalGradient);
|
||||
};
|
||||
|
||||
class FillExtrusionPatternProgram : public Program<
|
||||
class FillExtrusionPatternProgram final : public Program<
|
||||
FillExtrusionPatternProgram,
|
||||
shaders::BuiltIn::FillExtrusionPatternProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
FillExtrusionLayoutAttributes,
|
||||
FillExtrusionPatternUniforms,
|
||||
@@ -99,6 +106,11 @@ class FillExtrusionPatternProgram : public Program<
|
||||
style::FillExtrusionPaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"FillExtrusionPatternProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static LayoutUniformValues layoutUniformValues(mat4,
|
||||
@@ -116,15 +128,4 @@ public:
|
||||
using FillExtrusionLayoutVertex = FillExtrusionProgram::LayoutVertex;
|
||||
using FillExtrusionAttributes = FillExtrusionProgram::AttributeList;
|
||||
|
||||
|
||||
class FillExtrusionLayerPrograms final : public LayerTypePrograms {
|
||||
public:
|
||||
FillExtrusionLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
|
||||
: fillExtrusion(context, programParameters),
|
||||
fillExtrusionPattern(context, programParameters) {
|
||||
}
|
||||
FillExtrusionProgram fillExtrusion;
|
||||
FillExtrusionPatternProgram fillExtrusionPattern;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -33,8 +33,9 @@ using FillPatternUniforms = TypeList<
|
||||
uniforms::pixel_coord_upper,
|
||||
uniforms::pixel_coord_lower>;
|
||||
|
||||
class FillProgram : public Program<
|
||||
class FillProgram final : public Program<
|
||||
FillProgram,
|
||||
shaders::BuiltIn::FillProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
FillLayoutAttributes,
|
||||
FillUniforms,
|
||||
@@ -42,6 +43,11 @@ class FillProgram : public Program<
|
||||
style::FillPaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"FillProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static LayoutVertex layoutVertex(Point<int16_t> p) {
|
||||
@@ -54,8 +60,9 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class FillPatternProgram : public Program<
|
||||
class FillPatternProgram final : public Program<
|
||||
FillPatternProgram,
|
||||
shaders::BuiltIn::FillPatternProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
FillLayoutAttributes,
|
||||
FillPatternUniforms,
|
||||
@@ -64,6 +71,11 @@ class FillPatternProgram : public Program<
|
||||
style::FillPaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"FillPatternProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static LayoutUniformValues layoutUniformValues(mat4 matrix,
|
||||
@@ -75,8 +87,9 @@ public:
|
||||
float pixelRatio);
|
||||
};
|
||||
|
||||
class FillOutlineProgram : public Program<
|
||||
class FillOutlineProgram final : public Program<
|
||||
FillOutlineProgram,
|
||||
shaders::BuiltIn::FillOutlineProgram,
|
||||
gfx::PrimitiveType::Line,
|
||||
FillLayoutAttributes,
|
||||
FillUniforms,
|
||||
@@ -84,11 +97,17 @@ class FillOutlineProgram : public Program<
|
||||
style::FillPaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"FillOutlineProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
};
|
||||
|
||||
class FillOutlinePatternProgram : public Program<
|
||||
class FillOutlinePatternProgram final : public Program<
|
||||
FillOutlinePatternProgram,
|
||||
shaders::BuiltIn::FillOutlinePatternProgram,
|
||||
gfx::PrimitiveType::Line,
|
||||
FillLayoutAttributes,
|
||||
FillPatternUniforms,
|
||||
@@ -97,23 +116,15 @@ class FillOutlinePatternProgram : public Program<
|
||||
style::FillPaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"FillOutlinePatternProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
};
|
||||
|
||||
using FillLayoutVertex = FillProgram::LayoutVertex;
|
||||
using FillAttributes = FillProgram::AttributeList;
|
||||
|
||||
class FillLayerPrograms final : public LayerTypePrograms {
|
||||
public:
|
||||
FillLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
|
||||
: fill(context, programParameters),
|
||||
fillPattern(context, programParameters),
|
||||
fillOutline(context, programParameters),
|
||||
fillOutlinePattern(context, programParameters) {}
|
||||
FillProgram fill;
|
||||
FillPatternProgram fillPattern;
|
||||
FillOutlineProgram fillOutline;
|
||||
FillOutlinePatternProgram fillOutlinePattern;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/background_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<BackgroundProgram> {
|
||||
static constexpr const char* name = "background";
|
||||
static constexpr const uint8_t hash[8] = {0x2d, 0xef, 0x97, 0xa2, 0xec, 0xb5, 0x67, 0xef};
|
||||
static constexpr const auto vertexOffset = 1429;
|
||||
static constexpr const auto fragmentOffset = 1525;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<BackgroundProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<BackgroundProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<BackgroundProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<BackgroundProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of background.vertex.glsl:
|
||||
/*
|
||||
attribute vec2 a_pos;
|
||||
|
||||
uniform mat4 u_matrix;
|
||||
|
||||
void main() {
|
||||
gl_Position = u_matrix * vec4(a_pos, 0, 1);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of background.fragment.glsl:
|
||||
/*
|
||||
uniform vec4 u_color;
|
||||
uniform float u_opacity;
|
||||
|
||||
void main() {
|
||||
gl_FragColor = u_color * u_opacity;
|
||||
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
@@ -1,59 +0,0 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/clipping_mask_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<ClippingMaskProgram> {
|
||||
static constexpr const char* name = "clipping_mask";
|
||||
static constexpr const uint8_t hash[8] = {0x3e, 0x17, 0xc2, 0x3a, 0x1f, 0xf0, 0xa8, 0xa3};
|
||||
static constexpr const auto vertexOffset = 7891;
|
||||
static constexpr const auto fragmentOffset = 7987;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<ClippingMaskProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<ClippingMaskProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<ClippingMaskProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<ClippingMaskProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of clipping_mask.vertex.glsl:
|
||||
/*
|
||||
attribute vec2 a_pos;
|
||||
|
||||
uniform mat4 u_matrix;
|
||||
|
||||
void main() {
|
||||
gl_Position = u_matrix * vec4(a_pos, 0, 1);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of clipping_mask.fragment.glsl:
|
||||
/*
|
||||
void main() {
|
||||
gl_FragColor = vec4(1.0);
|
||||
}
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
@@ -1,70 +0,0 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/debug_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<DebugProgram> {
|
||||
static constexpr const char* name = "debug";
|
||||
static constexpr const uint8_t hash[8] = {0x07, 0x98, 0x41, 0xa8, 0x6b, 0x73, 0xaf, 0x34};
|
||||
static constexpr const auto vertexOffset = 12494;
|
||||
static constexpr const auto fragmentOffset = 12672;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<DebugProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<DebugProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<DebugProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<DebugProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of debug.vertex.glsl:
|
||||
/*
|
||||
attribute vec2 a_pos;
|
||||
varying vec2 v_uv;
|
||||
|
||||
uniform mat4 u_matrix;
|
||||
uniform float u_overlay_scale;
|
||||
|
||||
void main() {
|
||||
// This vertex shader expects a EXTENT x EXTENT quad,
|
||||
// The UV co-ordinates for the overlay texture can be calculated using that knowledge
|
||||
v_uv = a_pos / 8192.0;
|
||||
gl_Position = u_matrix * vec4(a_pos * u_overlay_scale, 0, 1);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of debug.fragment.glsl:
|
||||
/*
|
||||
uniform highp vec4 u_color;
|
||||
uniform sampler2D u_overlay;
|
||||
|
||||
varying vec2 v_uv;
|
||||
|
||||
void main() {
|
||||
vec4 overlay_color = texture2D(u_overlay, v_uv);
|
||||
gl_FragColor = mix(u_color, overlay_color, overlay_color.a);
|
||||
}
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
@@ -1,123 +0,0 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/fill_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<FillProgram> {
|
||||
static constexpr const char* name = "fill";
|
||||
static constexpr const uint8_t hash[8] = {0x87, 0xea, 0x65, 0x7f, 0x0c, 0x9b, 0x97, 0x5d};
|
||||
static constexpr const auto vertexOffset = 12862;
|
||||
static constexpr const auto fragmentOffset = 13506;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<FillProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<FillProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<FillProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<FillProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of fill.vertex.glsl:
|
||||
/*
|
||||
attribute vec2 a_pos;
|
||||
|
||||
uniform mat4 u_matrix;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
uniform lowp float u_color_t;
|
||||
attribute highp vec4 a_color;
|
||||
varying highp vec4 color;
|
||||
#else
|
||||
uniform highp vec4 u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
color = unpack_mix_color(a_color, u_color_t);
|
||||
#else
|
||||
highp vec4 color = u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
gl_Position = u_matrix * vec4(a_pos, 0, 1);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of fill.fragment.glsl:
|
||||
/*
|
||||
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
varying highp vec4 color;
|
||||
#else
|
||||
uniform highp vec4 u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_color
|
||||
highp vec4 color = u_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
gl_FragColor = color * opacity;
|
||||
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
@@ -1,131 +0,0 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/fill_outline_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<FillOutlineProgram> {
|
||||
static constexpr const char* name = "fill_outline";
|
||||
static constexpr const uint8_t hash[8] = {0x51, 0x25, 0x43, 0x9d, 0x41, 0x73, 0xe1, 0xbb};
|
||||
static constexpr const auto vertexOffset = 13930;
|
||||
static constexpr const auto fragmentOffset = 14755;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<FillOutlineProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<FillOutlineProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<FillOutlineProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<FillOutlineProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of fill_outline.vertex.glsl:
|
||||
/*
|
||||
attribute vec2 a_pos;
|
||||
|
||||
uniform mat4 u_matrix;
|
||||
uniform vec2 u_world;
|
||||
|
||||
varying vec2 v_pos;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_outline_color
|
||||
uniform lowp float u_outline_color_t;
|
||||
attribute highp vec4 a_outline_color;
|
||||
varying highp vec4 outline_color;
|
||||
#else
|
||||
uniform highp vec4 u_outline_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
uniform lowp float u_opacity_t;
|
||||
attribute lowp vec2 a_opacity;
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifndef HAS_UNIFORM_u_outline_color
|
||||
outline_color = unpack_mix_color(a_outline_color, u_outline_color_t);
|
||||
#else
|
||||
highp vec4 outline_color = u_outline_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
|
||||
#else
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
gl_Position = u_matrix * vec4(a_pos, 0, 1);
|
||||
v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of fill_outline.fragment.glsl:
|
||||
/*
|
||||
varying vec2 v_pos;
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_outline_color
|
||||
varying highp vec4 outline_color;
|
||||
#else
|
||||
uniform highp vec4 u_outline_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
#ifdef HAS_UNIFORM_u_outline_color
|
||||
highp vec4 outline_color = u_outline_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
|
||||
float dist = length(v_pos - gl_FragCoord.xy);
|
||||
float alpha = 1.0 - smoothstep(0.0, 1.0, dist);
|
||||
gl_FragColor = outline_color * (alpha * opacity);
|
||||
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
@@ -1,74 +0,0 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/heatmap_texture_program.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/gl/program.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
template <>
|
||||
struct ShaderSource<HeatmapTextureProgram> {
|
||||
static constexpr const char* name = "heatmap_texture";
|
||||
static constexpr const uint8_t hash[8] = {0x9f, 0xc7, 0x56, 0xb2, 0x9e, 0x8f, 0x15, 0xff};
|
||||
static constexpr const auto vertexOffset = 9535;
|
||||
static constexpr const auto fragmentOffset = 9715;
|
||||
};
|
||||
|
||||
constexpr const char* ShaderSource<HeatmapTextureProgram>::name;
|
||||
constexpr const uint8_t ShaderSource<HeatmapTextureProgram>::hash[8];
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
|
||||
namespace gfx {
|
||||
|
||||
template <>
|
||||
std::unique_ptr<gfx::Program<HeatmapTextureProgram>>
|
||||
Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) {
|
||||
return std::make_unique<gl::Program<HeatmapTextureProgram>>(programParameters);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
|
||||
// Uncompressed source of heatmap_texture.vertex.glsl:
|
||||
/*
|
||||
uniform mat4 u_matrix;
|
||||
uniform vec2 u_world;
|
||||
attribute vec2 a_pos;
|
||||
varying vec2 v_pos;
|
||||
|
||||
void main() {
|
||||
gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);
|
||||
|
||||
v_pos.x = a_pos.x;
|
||||
v_pos.y = 1.0 - a_pos.y;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Uncompressed source of heatmap_texture.fragment.glsl:
|
||||
/*
|
||||
uniform sampler2D u_image;
|
||||
uniform sampler2D u_color_ramp;
|
||||
uniform float u_opacity;
|
||||
varying vec2 v_pos;
|
||||
|
||||
void main() {
|
||||
float t = texture2D(u_image, v_pos).r;
|
||||
vec4 color = texture2D(u_color_ramp, vec2(t, 0.5));
|
||||
gl_FragColor = color * u_opacity;
|
||||
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
gl_FragColor = vec4(0.0);
|
||||
#endif
|
||||
}
|
||||
|
||||
*/
|
||||
// clang-format on
|
||||
@@ -1,17 +0,0 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
constexpr const uint8_t preludeHash[8] = {0x24, 0x91, 0x82, 0x37, 0x02, 0xad, 0x98, 0x0a};
|
||||
constexpr const auto vertexPreludeOffset = 0;
|
||||
constexpr const auto fragmentPreludeOffset = 1252;
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
} // namespace mbgl
|
||||
@@ -1,490 +0,0 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
// clang-format off
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/util/compression.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
constexpr const uint8_t compressedShaderSource[] = {
|
||||
0x78, 0xda, 0xed, 0x3d, 0x6b, 0x6f, 0xe3, 0x38, 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x24, 0xa7, 0xc3, 0x7f, 0xc4, 0xe3, 0xab, 0xd4, 0x6d, 0xfc, 0x27,
|
||||
0x9b, 0xb2, 0x94, 0xb3, 0x69, 0x81, 0x13, 0x23, 0x94, 0xe4, 0xc8, 0x40, 0x21, 0xc0, 0x5c, 0x77,
|
||||
0x22, 0x15, 0x2c, 0xe8, 0x9d, 0xbe, 0x0a, 0xe7, 0x69, 0x71, 0x35, 0x9f, 0x36, 0xa0, 0x42, 0xe7,
|
||||
0xba, 0xe3, 0xab, 0x10, 0xad, 0xeb, 0x8e, 0x87, 0x80, 0xdc, 0xf0, 0x4e, 0x26, 0x28, 0x47, 0xff,
|
||||
0x66, 0xc5, 0xca, 0x40, 0xd2, 0x17, 0x92, 0x43, 0x89, 0x42, 0xff, 0xd3, 0x04, 0x89, 0x20, 0x06,
|
||||
0x12, 0xf4, 0x94, 0xaa, 0x49, 0x23, 0x45, 0x09, 0x37, 0xe8, 0xf6, 0x5e, 0xb7, 0x3b, 0xfe, 0x24,
|
||||
0x1f, 0xaa, 0x05, 0xfd, 0x5e, 0xbb, 0xe3, 0x12, 0x82, 0x4e, 0x1a, 0xc3, 0x74, 0x90, 0x0f, 0xd3,
|
||||
0xfe, 0x20, 0x1f, 0xe7, 0x73, 0x4a, 0x0e, 0x26, 0x34, 0x9d, 0x42, 0xfa, 0xf0, 0x3d, 0xa4, 0x23,
|
||||
0x62, 0x44, 0x45, 0x27, 0x8e, 0xd2, 0xa9, 0x32, 0xdc, 0x1f, 0x9d, 0xef, 0x88, 0xa8, 0xd3, 0x53,
|
||||
0x54, 0xa9, 0x1d, 0xa6, 0xcb, 0x60, 0x8e, 0x10, 0x09, 0xa4, 0xe5, 0x14, 0x78, 0x92, 0x2d, 0xfb,
|
||||
0xb8, 0x25, 0x12, 0x19, 0xd2, 0x10, 0xf8, 0x72, 0x67, 0x15, 0x82, 0x26, 0x54, 0x4c, 0x1e, 0x29,
|
||||
0x44, 0x84, 0x2f, 0x7f, 0x76, 0xbf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xc9, 0x0e, 0x43, 0x4e, 0xd1, 0x45, 0xba, 0x1c, 0x31, 0x74, 0x89, 0x6f, 0xe8, 0x05, 0x9f, 0xb7,
|
||||
0xdb, 0xd3, 0x07, 0xc0, 0x37, 0x37, 0xd1, 0xc7, 0x95, 0xb3, 0x8a, 0x93, 0x7b, 0x57, 0x9c, 0xe8,
|
||||
0x15, 0x27, 0x6b, 0x2a, 0x56, 0x99, 0x5c, 0x66, 0x8d, 0x62, 0x6c, 0x67, 0x9b, 0x64, 0x6e, 0xcf,
|
||||
0x43, 0xe5, 0x92, 0x8a, 0x72, 0xa5, 0xbc, 0x22, 0x5d, 0x62, 0xf9, 0xa3, 0x73, 0xc4, 0x44, 0xe2,
|
||||
0x69, 0x7d, 0xaa, 0xb1, 0xf4, 0x45, 0x3c, 0x99, 0x8d, 0xd3, 0x79, 0xef, 0x03, 0xca, 0xcb, 0x26,
|
||||
0xf1, 0x28, 0xdd, 0x95, 0x3b, 0x70, 0x0e, 0xc6, 0x80, 0x7b, 0x15, 0x0b, 0x6a, 0x5a, 0xda, 0xc7,
|
||||
0xd3, 0x8f, 0x09, 0xf4, 0x08, 0x56, 0x20, 0xb5, 0x93, 0x02, 0xde, 0x06, 0x5f, 0xed, 0x21, 0x29,
|
||||
0x43, 0xa0, 0xa6, 0x8b, 0x21, 0x16, 0x08, 0xdd, 0x08, 0xe5, 0x23, 0x59, 0x9d, 0xf6, 0x3e, 0x38,
|
||||
0xb4, 0x01, 0x3e, 0x61, 0x07, 0x95, 0x1c, 0xc4, 0x18, 0x82, 0xa0, 0x44, 0x25, 0xa8, 0x57, 0xa6,
|
||||
0x28, 0xb1, 0x51, 0x94, 0x18, 0x29, 0xea, 0x27, 0x32, 0x4d, 0x3d, 0x33, 0x4d, 0x3d, 0x37, 0x54,
|
||||
0x04, 0x13, 0x54, 0x4a, 0xda, 0xe0, 0x93, 0x62, 0x3e, 0x1e, 0x31, 0xf7, 0x30, 0x32, 0x2e, 0xc9,
|
||||
0xf3, 0x31, 0x17, 0x26, 0x37, 0x59, 0x71, 0x89, 0x00, 0x66, 0x7a, 0xee, 0x2c, 0x2b, 0x06, 0x97,
|
||||
0xe5, 0x5c, 0xca, 0x76, 0xa8, 0x91, 0xf3, 0x2b, 0xa4, 0x85, 0x60, 0x1c, 0x3c, 0x13, 0x96, 0x2e,
|
||||
0xce, 0x6d, 0xc3, 0xf4, 0x3a, 0x1b, 0xa4, 0x74, 0xb6, 0xcd, 0x63, 0x24, 0x3a, 0x38, 0x9c, 0xa4,
|
||||
0xf6, 0xc3, 0xba, 0x10, 0x4f, 0xd2, 0x79, 0x0c, 0x93, 0x6b, 0x90, 0x4e, 0x51, 0x67, 0xf7, 0x87,
|
||||
0xd9, 0xa2, 0x88, 0xa7, 0x83, 0x74, 0xad, 0x04, 0x3b, 0x46, 0xec, 0x38, 0x8c, 0x8b, 0x18, 0x77,
|
||||
0xd6, 0x14, 0x7a, 0xeb, 0xbf, 0xdf, 0x9d, 0xf7, 0xff, 0xfe, 0xf9, 0xec, 0xd3, 0x97, 0x6f, 0xbf,
|
||||
0xf5, 0xe9, 0xba, 0x71, 0x64, 0xa4, 0x0e, 0x67, 0xf5, 0x0b, 0xa9, 0x0a, 0x42, 0x14, 0x1e, 0xca,
|
||||
0x98, 0xae, 0x55, 0xac, 0x2a, 0x29, 0x8b, 0x64, 0xd0, 0x55, 0x5c, 0x6d, 0x8f, 0xb2, 0xcc, 0x49,
|
||||
0x8b, 0xb2, 0x81, 0xb0, 0x79, 0x8c, 0x56, 0xee, 0x85, 0x99, 0x32, 0x92, 0xa7, 0x90, 0xc6, 0x54,
|
||||
0x08, 0xda, 0x0b, 0x04, 0x82, 0x53, 0xa7, 0x28, 0x18, 0x0d, 0x9a, 0xa9, 0x51, 0xa8, 0xc2, 0xb0,
|
||||
0x4a, 0xd6, 0x50, 0x99, 0x8c, 0xaf, 0x2c, 0xbd, 0x07, 0x39, 0x0a, 0x85, 0x38, 0x97, 0x92, 0x07,
|
||||
0x99, 0x9c, 0x38, 0xa9, 0x18, 0x4e, 0xd7, 0xe8, 0x2a, 0x61, 0x5d, 0x43, 0x12, 0x9d, 0x1d, 0xe6,
|
||||
0xf2, 0x34, 0xd3, 0x4a, 0x18, 0x57, 0x35, 0xca, 0xb4, 0x89, 0x59, 0x67, 0x27, 0x4f, 0x82, 0xa9,
|
||||
0xa0, 0x70, 0x51, 0xcc, 0xf3, 0x7f, 0xa7, 0x55, 0xac, 0x27, 0x43, 0xd8, 0x39, 0x50, 0x86, 0x32,
|
||||
0x31, 0xa2, 0x92, 0x5f, 0xc5, 0x8f, 0x3a, 0xe0, 0x7a, 0xda, 0x6f, 0xb2, 0x61, 0x71, 0x59, 0x49,
|
||||
0x3b, 0x86, 0xa8, 0x62, 0x51, 0x19, 0xce, 0xc2, 0xa8, 0x0a, 0xc8, 0x1a, 0x76, 0xd5, 0x61, 0xd7,
|
||||
0xb7, 0xa1, 0x92, 0x51, 0x54, 0x18, 0x2b, 0xbf, 0xa8, 0x60, 0x26, 0xb6, 0xd1, 0x20, 0xaa, 0xb8,
|
||||
0xa7, 0x0c, 0x4a, 0x5c, 0x0d, 0x7c, 0x1d, 0x85, 0x5f, 0x68, 0x2d, 0xad, 0x14, 0x65, 0x03, 0xa2,
|
||||
0x10, 0xeb, 0xa6, 0x28, 0x95, 0x57, 0x3e, 0x17, 0x6b, 0x2e, 0x23, 0x45, 0x97, 0x5c, 0xd1, 0x56,
|
||||
0xf2, 0x89, 0xfc, 0x89, 0x74, 0x1b, 0x9b, 0x49, 0x20, 0x5f, 0x08, 0x2b, 0x5e, 0xa1, 0x49, 0x18,
|
||||
0x45, 0xdb, 0xc8, 0x1b, 0xf8, 0xc7, 0x50, 0x23, 0x24, 0xfb, 0x4c, 0xf0, 0xf0, 0xda, 0x34, 0xe9,
|
||||
0x12, 0x6d, 0x25, 0x43, 0xe8, 0x5f, 0x43, 0x65, 0x34, 0xc7, 0x97, 0x44, 0x8a, 0xa9, 0x4a, 0x8e,
|
||||
0x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, 0xbc, 0x17, 0x54, 0x51, 0x28, 0x46, 0x55, 0xa4, 0x22, 0x6d, 0xdf, 0xa8, 0xc5,
|
||||
0xf2, 0xf1, 0x18, 0x9f, 0xd3, 0xe9, 0xcf, 0xd2, 0xf9, 0x62, 0x86, 0xe0, 0xb2, 0xeb, 0x94, 0x78,
|
||||
0x41, 0xa2, 0xc1, 0x18, 0x71, 0x04, 0x1a, 0xba, 0xd3, 0x26, 0xc8, 0x0c, 0xa7, 0xa2, 0xe5, 0x81,
|
||||
0xb5, 0x76, 0x17, 0xeb, 0xb8, 0x27, 0x30, 0xfc, 0x6b, 0x15, 0x3f, 0x26, 0x2a, 0x74, 0xef, 0x8f,
|
||||
0xc3, 0x47, 0xbb, 0x49, 0x87, 0x71, 0x8d, 0xcf, 0xc7, 0xab, 0x68, 0x55, 0xc8, 0x86, 0x25, 0x62,
|
||||
0xac, 0x82, 0xa7, 0x30, 0x1d, 0x13, 0x91, 0xb8, 0x92, 0xfd, 0x37, 0xbb, 0x0c, 0x28, 0xb5, 0x4a,
|
||||
0xc6, 0xb3, 0xcb, 0x38, 0x42, 0xfd, 0x17, 0x1a, 0xa5, 0x1c, 0x6e, 0x34, 0x6b, 0xb8, 0x87, 0x81,
|
||||
0xb1, 0xd7, 0x8d, 0x55, 0xd5, 0xf8, 0xaf, 0x06, 0x4c, 0x45, 0x93, 0x02, 0x2c, 0x95, 0xc4, 0xd3,
|
||||
0x95, 0x96, 0xbe, 0x23, 0xc5, 0x29, 0x49, 0xc6, 0xf2, 0x5e, 0xd4, 0xee, 0x86, 0x77, 0x07, 0x99,
|
||||
0x85, 0x4f, 0x6a, 0xba, 0x69, 0xe9, 0xda, 0x36, 0xb2, 0xa6, 0x08, 0x98, 0x93, 0x99, 0x92, 0x52,
|
||||
0xcf, 0x5c, 0xe3, 0xcc, 0x95, 0xe9, 0x9b, 0xc5, 0xc3, 0x21, 0xea, 0xc0, 0xfe, 0x45, 0x3c, 0x28,
|
||||
0x72, 0xf0, 0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0xe5, 0x68, 0x60,
|
||||
0x5a, 0x5c, 0x0c, 0xe6, 0x73, 0x64, 0xe0, 0xad, 0x98, 0xc6, 0x4b, 0xac, 0x11, 0xf0, 0xc3, 0x6a,
|
||||
0x5b, 0xba, 0x60, 0x4d, 0x00, 0x16, 0x5d, 0xb5, 0x95, 0xc9, 0xf6, 0x1c, 0x5c, 0x9c, 0x49, 0xe1,
|
||||
0xc3, 0x79, 0xac, 0x1f, 0xee, 0xfa, 0x14, 0x3b, 0x79, 0x82, 0x35, 0xe9, 0xfb, 0x5e, 0x7f, 0xda,
|
||||
0x7c, 0x3a, 0x3c, 0xf9, 0x33, 0xe9, 0xec, 0x12, 0xcb, 0xc5, 0x3c, 0x9f, 0x98, 0xf1, 0xc8, 0x10,
|
||||
0x46, 0x5a, 0x61, 0x99, 0x92, 0x81, 0x54, 0x82, 0xe9, 0x2d, 0x58, 0x29, 0xdb, 0x44, 0x34, 0x1d,
|
||||
0x1e, 0x1d, 0x6e, 0x03, 0xc2, 0x8b, 0xbc, 0x9a, 0x6c, 0x64, 0xb9, 0xad, 0x23, 0xba, 0xc8, 0x2b,
|
||||
0x48, 0x46, 0x99, 0x1b, 0x10, 0x4c, 0xa0, 0x36, 0x5f, 0xae, 0x1e, 0xeb, 0x9c, 0xb1, 0x32, 0xdc,
|
||||
0xf2, 0x47, 0x14, 0xf7, 0x4d, 0x83, 0x24, 0x6d, 0x65, 0xab, 0xa3, 0x18, 0xed, 0x3a, 0x58, 0xe2,
|
||||
0x67, 0x14, 0xf7, 0xcb, 0x9d, 0x6c, 0xac, 0x10, 0xc1, 0x9a, 0xbb, 0x5a, 0xbe, 0x45, 0x0c, 0x37,
|
||||
0xc6, 0x22, 0x99, 0x26, 0x38, 0x46, 0xa3, 0x40, 0xc0, 0xd5, 0x31, 0x15, 0xe2, 0xf6, 0x26, 0xd4,
|
||||
0x71, 0x24, 0x91, 0xa8, 0xc8, 0x84, 0x41, 0xc9, 0x47, 0xe5, 0xa9, 0x47, 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0xb3, 0xf9, 0x49, 0x8a, 0x4d, 0x74, 0x6c, 0x3c,
|
||||
0x1e, 0x72, 0x2b, 0x20, 0xc1, 0x14, 0x75, 0x04, 0x25, 0xfb, 0x6c, 0x90, 0x8c, 0xf7, 0xa0, 0x48,
|
||||
0xc1, 0x2d, 0x86, 0x41, 0x2e, 0x7c, 0x69, 0xbb, 0x83, 0x75, 0xc9, 0xee, 0x60, 0x5d, 0x56, 0xdd,
|
||||
0xc1, 0x62, 0xc5, 0xb7, 0x19, 0x81, 0xf2, 0xc9, 0x8e, 0x07, 0x3c, 0xc4, 0x83, 0x67, 0x2d, 0x99,
|
||||
0x21, 0x91, 0x34, 0x55, 0x90, 0xd4, 0xbe, 0x0d, 0x71, 0x47, 0xc1, 0x8d, 0x54, 0x70, 0x1d, 0xc0,
|
||||
0x87, 0x1b, 0x52, 0xfa, 0x59, 0x22, 0xf9, 0x64, 0x6e, 0x07, 0x12, 0xee, 0x93, 0xe0, 0x68, 0x2f,
|
||||
0xf1, 0x75, 0xad, 0xb5, 0x4a, 0x60, 0x81, 0x0f, 0x46, 0x76, 0x1a, 0x3f, 0xd3, 0xae, 0x69, 0xfc,
|
||||
0x84, 0xc7, 0x07, 0x54, 0x43, 0xe9, 0xbe, 0xea, 0x35, 0x0e, 0xd2, 0x4b, 0xce, 0x97, 0xcd, 0xbd,
|
||||
0x4e, 0xbb, 0xd7, 0xed, 0xbd, 0x6a, 0x92, 0xcf, 0x11, 0xfa, 0x7c, 0xdd, 0x3d, 0xed, 0xd1, 0xcf,
|
||||
0x04, 0x7d, 0x76, 0x5e, 0xf7, 0x7a, 0x21, 0x9d, 0xde, 0xea, 0x11, 0x4d, 0x7e, 0xea, 0x97, 0x30,
|
||||
0xea, 0x24, 0x01, 0x19, 0x83, 0x65, 0x12, 0x87, 0x3b, 0xf6, 0xc5, 0x3f, 0x18, 0x14, 0xa3, 0x69,
|
||||
0x46, 0x32, 0x30, 0xf7, 0xc7, 0xcc, 0xe1, 0x28, 0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x57, 0x68, 0x2d, 0x4c, 0x75, 0xb0, 0x18, 0x3f, 0x1b, 0x5a, 0x2f, 0xc7, 0x0f, 0x61, 0xbd,
|
||||
0xc0, 0x85, 0xce, 0x97, 0x62, 0xb2, 0xb0, 0x6e, 0x6d, 0xcf, 0x47, 0xdc, 0x0a, 0xb0, 0x69, 0xff,
|
||||
0x18, 0x33, 0x0e, 0xbb, 0x07, 0x4d, 0xf1, 0xe9, 0xaf, 0x63, 0xb7, 0x64, 0x07, 0xd0, 0x3c, 0x5c,
|
||||
0x8b, 0x34, 0x74, 0x9a, 0x39, 0x70, 0xe8, 0x9d, 0x84, 0x5d, 0x74, 0xd1, 0xfd, 0x2a, 0x95, 0x87,
|
||||
0xd2, 0x0c, 0x5f, 0xf6, 0xd6, 0x05, 0x1e, 0xa8, 0xf5, 0x1a, 0x96, 0x75, 0x14, 0x36, 0xd3, 0x96,
|
||||
0xea, 0x0d, 0x8f, 0x7a, 0xc3, 0x63, 0xe7, 0x0d, 0x0f, 0xfa, 0xf8, 0xd2, 0x92, 0x3e, 0x87, 0x64,
|
||||
0xdf, 0xf3, 0x28, 0x6d, 0x8d, 0xd0, 0x12, 0x9e, 0x26, 0xaf, 0xf6, 0xeb, 0x0f, 0x19, 0x66, 0x13,
|
||||
0x58, 0x29, 0xf2, 0x69, 0xb8, 0x59, 0x68, 0x0a, 0xda, 0xec, 0x87, 0x88, 0xf1, 0x23, 0xc7, 0x65,
|
||||
0x20, 0x11, 0xab, 0x66, 0x8b, 0x6c, 0x8c, 0x60, 0x69, 0x90, 0x58, 0x4e, 0x19, 0xbd, 0xf9, 0x8d,
|
||||
0xf5, 0x60, 0x47, 0xca, 0x40, 0x6a, 0x23, 0x28, 0x6c, 0x81, 0x92, 0xc4, 0xce, 0xbe, 0x2a, 0xa4,
|
||||
0xd2, 0xcb, 0xcc, 0xae, 0x87, 0x91, 0x34, 0x69, 0x45, 0x15, 0x4f, 0x28, 0x69, 0xcf, 0xc4, 0xe1,
|
||||
0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0x38, 0xa0, 0xc9, 0x8e, 0x9d,
|
||||
0xac, 0xb8, 0x77, 0xc8, 0x48, 0x04, 0x22, 0x95, 0x21, 0x25, 0x19, 0xae, 0xc7, 0xbe, 0x21, 0x02,
|
||||
0x30, 0x14, 0x60, 0x64, 0x63, 0x86, 0xc1, 0xe3, 0x25, 0x55, 0xc8, 0xf6, 0x50, 0x71, 0x26, 0xdd,
|
||||
0x6b, 0xc5, 0x03, 0x45, 0x52, 0x20, 0xdc, 0x19, 0xf9, 0x45, 0x0d, 0x71, 0xd1, 0xac, 0x5e, 0xd9,
|
||||
0x17, 0x01, 0x2c, 0x4c, 0xc2, 0xc3, 0x80, 0xf2, 0xe9, 0x90, 0xb1, 0x69, 0xd2, 0xfe, 0x72, 0x83,
|
||||
0xaf, 0x67, 0x58, 0x96, 0x08, 0x6e, 0x22, 0x01, 0xa7, 0xa1, 0x10, 0xad, 0x99, 0x04, 0x27, 0x21,
|
||||
0x33, 0xc1, 0x97, 0x98, 0xdf, 0xc7, 0x40, 0x48, 0x6d, 0x41, 0x9c, 0x2c, 0x13, 0x5f, 0x4d, 0x94,
|
||||
0x22, 0x87, 0xe4, 0x16, 0x12, 0x56, 0x94, 0x2a, 0x6e, 0xc7, 0x6e, 0x53, 0xfa, 0xbc, 0x9f, 0x70,
|
||||
0xe3, 0x53, 0x12, 0x53, 0x8a, 0x43, 0x32, 0x9f, 0xbe, 0x79, 0x7d, 0xdc, 0xe9, 0xbe, 0x3a, 0x32,
|
||||
0x49, 0x38, 0xea, 0x97, 0x2c, 0x6f, 0x3e, 0xe1, 0x98, 0xfd, 0xd5, 0xca, 0x6b, 0x39, 0xca, 0xad,
|
||||
0xfc, 0xd8, 0x17, 0x95, 0x36, 0xfa, 0xeb, 0x84, 0x9b, 0xbe, 0x19, 0xa6, 0xc9, 0x37, 0x4a, 0xa6,
|
||||
0x96, 0x8a, 0xa3, 0xf9, 0xf4, 0x4a, 0xb1, 0x9e, 0x46, 0xf1, 0x64, 0x12, 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xae, 0xfc, 0x2b, 0x78, 0xfa, 0x5d, 0x7b, 0xef,
|
||||
0x8b, 0xf1, 0x9f, 0x6a, 0xa7, 0x02, 0xfd, 0x01, 0x55, 0xec, 0xd8, 0xf6, 0x5f, 0xd5, 0x71, 0x4c,
|
||||
0xf1, 0x4c, 0x7a, 0x4f, 0x29, 0x86, 0xfb, 0xaf, 0x54, 0x99, 0x31, 0x10, 0x25, 0x7e, 0x70, 0x0b,
|
||||
0x75, 0x99, 0x1c, 0x25, 0x94, 0xdd, 0x57, 0x25, 0xb7, 0x4e, 0xad, 0xa5, 0x4c, 0x45, 0x4a, 0x95,
|
||||
0x96, 0xae, 0xe0, 0x7b, 0x25, 0x1d, 0x15, 0x8c, 0x72, 0x49, 0x85, 0x8c, 0xd6, 0x13, 0x18, 0xac,
|
||||
0xa1, 0x26, 0x64, 0xaa, 0x2a, 0xf1, 0xb4, 0x10, 0x8e, 0xf0, 0x31, 0x0b, 0x2b, 0x77, 0x7c, 0xb6,
|
||||
0x54, 0x8a, 0x35, 0xf5, 0xd7, 0xac, 0x2a, 0x9b, 0x94, 0xe2, 0xc7, 0x79, 0x8b, 0xeb, 0x19, 0xbd,
|
||||
0x91, 0xb5, 0xe7, 0x88, 0x79, 0x87, 0x79, 0x79, 0xc9, 0x74, 0xe1, 0x9b, 0x30, 0x87, 0xeb, 0x31,
|
||||
0xe6, 0x69, 0x2f, 0x42, 0x41, 0x42, 0x2f, 0xc2, 0xef, 0x06, 0x35, 0x6d, 0x0b, 0x16, 0x14, 0x93,
|
||||
0xd9, 0x48, 0xbe, 0x28, 0x4e, 0x6c, 0xe1, 0x09, 0xea, 0x31, 0xa8, 0xb0, 0xe5, 0xf0, 0x0a, 0x8a,
|
||||
0x16, 0x46, 0xed, 0xfa, 0xa2, 0x4a, 0x1c, 0x7a, 0xd5, 0x0d, 0x70, 0xba, 0xc5, 0x60, 0xde, 0x43,
|
||||
0x68, 0x2a, 0x6e, 0x19, 0xff, 0xf6, 0xee, 0x9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0xc2, 0x4d, 0xf0, 0xc7, 0x35, 0x79, 0x9f, 0x9a, 0x03, 0xe0, 0x50, 0x26, 0xf8,
|
||||
0x9f, 0xe1, 0x8a, 0xee, 0x23, 0xb9, 0x19, 0x18, 0xdc, 0x76, 0x9b, 0xd4, 0x06, 0x45, 0xab, 0xf6,
|
||||
0x33, 0xd4, 0x7e, 0x86, 0xda, 0xcf, 0x70, 0x28, 0x3f, 0x83, 0x98, 0xae, 0xb1, 0xac, 0xf4, 0x3f,
|
||||
0xac, 0xff, 0x61, 0x9b, 0xeb, 0xa8, 0x8a, 0xac, 0xd3, 0xe3, 0xbc, 0xac, 0x75, 0x64, 0x1c, 0xce,
|
||||
0xc8, 0x79, 0x29, 0xb7, 0x41, 0xff, 0x0c, 0xde, 0x99, 0x27, 0x74, 0xad, 0xf4, 0x11, 0xbd, 0x47,
|
||||
0x75, 0xdc, 0xe4, 0x97, 0xf5, 0x9a, 0x8a, 0xdc, 0xd5, 0x72, 0xfb, 0xd4, 0x36, 0xb7, 0x97, 0x1e,
|
||||
0xef, 0xb5, 0x40, 0x8d, 0x40, 0xac, 0x01, 0xae, 0x4c, 0x38, 0x13, 0x03, 0x4e, 0x44, 0xb5, 0x47,
|
||||
0xfb, 0xbb, 0x0a, 0x23, 0x50, 0x1c, 0x3e, 0x33, 0x97, 0x25, 0xc1, 0xb6, 0x44, 0x5d, 0x49, 0xae,
|
||||
0x37, 0xf3, 0x25, 0x22, 0x50, 0x7b, 0xba, 0xbd, 0x54, 0xe1, 0x93, 0x6a, 0xf8, 0x44, 0x85, 0x5f,
|
||||
0xf5, 0xf1, 0xcb, 0xd2, 0x4d, 0xde, 0x17, 0x48, 0x0f, 0xa2, 0x97, 0xe5, 0x38, 0x7d, 0x98, 0x26,
|
||||
0x47, 0xab, 0x75, 0xd5, 0xec, 0xd1, 0xd7, 0x64, 0x5c, 0x9d, 0xa0, 0x95, 0x40, 0x9e, 0xec, 0x82,
|
||||
0x3c, 0xb1, 0x23, 0x4f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|
||||
0x69, 0xdd, 0x5d, 0x23, 0xad, 0x75, 0x22, 0xc7, 0x31, 0x47, 0xa5, 0x6c, 0x81, 0x1e, 0x1d, 0xa8,
|
||||
0xf4, 0x37, 0x5c, 0x88, 0x19, 0x45, 0x4a, 0x76, 0x23, 0x12, 0x98, 0x0f, 0x9e, 0x6a, 0x97, 0x3b,
|
||||
0x00, 0x82, 0x89, 0x89, 0xae, 0x92, 0x3a, 0x57, 0xde, 0xc0, 0xee, 0x97, 0xfb, 0x49, 0x7f, 0x66,
|
||||
0xa4, 0xb4, 0xd8, 0x76, 0xec, 0x59, 0xdd, 0x8d, 0xbb, 0xa9, 0x34, 0x3a, 0x73, 0x88, 0x68, 0x85,
|
||||
0x94, 0x8e, 0x05, 0x84, 0x03, 0xaf, 0xca, 0x06, 0x71, 0x59, 0x1e, 0xf9, 0x18, 0x75, 0x1b, 0x0e,
|
||||
0xee, 0xa7, 0xbf, 0xbc, 0x22, 0x5c, 0x9a, 0xd3, 0x62, 0x1e, 0x2f, 0x4c, 0x2f, 0xb3, 0xc0, 0x33,
|
||||
0x29, 0x8b, 0x59, 0x36, 0xed, 0xdf, 0xe0, 0x60, 0xbf, 0x5a, 0xb4, 0x3c, 0x21, 0x98, 0x3b, 0xe5,
|
||||
0x89, 0xd9, 0x21, 0x21, 0xe2, 0x3a, 0x6b, 0xa2, 0xd1, 0x76, 0x09, 0x58, 0x97, 0x84, 0x02, 0x27,
|
||||
0xc8, 0xda, 0x31, 0xb1, 0x10, 0x50, 0x15, 0x34, 0x61, 0x3e, 0x4a, 0x22, 0xf1, 0x33, 0x60, 0x60,
|
||||
0xe1, 0x1d, 0x2f, 0xd4, 0xd5, 0x0b, 0x75, 0x45, 0xa1, 0xae, 0x28, 0xd4, 0x85, 0x42, 0xda, 0x16,
|
||||
0x03, 0xc1, 0xe6, 0xd3, 0x60, 0xb3, 0x6c, 0xf4, 0xe9, 0x0b, 0x50, 0xed, 0x58, 0x0e, 0xc9, 0x8d,
|
||||
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,
|
||||
0x83, 0x98, 0x9e, 0x7d, 0xdc, 0x92, 0x58, 0x5a, 0x06, 0x34, 0xa0, 0x8b, 0x34, 0xc6, 0x82, 0xb6,
|
||||
0x04, 0xa7, 0xbe, 0x25, 0x88, 0x61, 0xab, 0x32, 0x2d, 0x59, 0x83, 0x78, 0x82, 0x18, 0x14, 0xec,
|
||||
0x41, 0x88, 0xaf, 0x87, 0xc4, 0x36, 0x7b, 0xa1, 0xc1, 0x02, 0x3f, 0xcb, 0x8a, 0xc1, 0xa5, 0x4e,
|
||||
0xeb, 0x3c, 0x2f, 0xe2, 0x22, 0xed, 0x2f, 0x56, 0x93, 0x24, 0x1f, 0x5b, 0x0a, 0x92, 0x68, 0x82,
|
||||
0x9a, 0x7d, 0xa4, 0x48, 0xf8, 0xc1, 0xa5, 0x12, 0x6c, 0xd3, 0xb2, 0xbb, 0x46, 0x52, 0xc7, 0x71,
|
||||
0x82, 0xd4, 0xa3, 0xd9, 0x38, 0x9e, 0xa6, 0x16, 0x08, 0x12, 0xed, 0x5a, 0xcb, 0x13, 0x7d, 0x0b,
|
||||
0x92, 0x4f, 0x4f, 0xc6, 0x6d, 0x23, 0xf6, 0xec, 0x24, 0x9e, 0xd9, 0x8e, 0x57, 0x95, 0x6d, 0xaa,
|
||||
0x92, 0x45, 0xa5, 0x0c, 0xfe, 0x33, 0xd8, 0xa8, 0x79, 0x22, 0xaf, 0xab, 0x0b, 0x0d, 0x27, 0x92,
|
||||
0xe7, 0x2b, 0x3f, 0xf8, 0xc2, 0xdc, 0xb7, 0x6a, 0x2e, 0x3b, 0x36, 0x83, 0x75, 0x12, 0xe1, 0x69,
|
||||
0x64, 0x89, 0x30, 0x66, 0x2c, 0x95, 0x9f, 0x90, 0x21, 0xc9, 0x88, 0xf8, 0x29, 0xf7, 0x07, 0x42,
|
||||
0xc2, 0x1f, 0x9d, 0xef, 0xc4, 0x19, 0xc8, 0x28, 0x59, 0x8a, 0x0a, 0x85, 0x30, 0x90, 0x90, 0x23,
|
||||
0x04, 0x9f, 0x90, 0xbc, 0x26, 0x67, 0x63, 0x54, 0xa0, 0xdb, 0x9b, 0xa0, 0x77, 0xfa, 0x0a, 0xad,
|
||||
0x03, 0xf2, 0x34, 0x58, 0xa4, 0xa3, 0x09, 0x84, 0xb1, 0x44, 0x8c, 0x8e, 0x0a, 0xb4, 0x34, 0x31,
|
||||
0xf2, 0x47, 0xef, 0x3b, 0x53, 0x9a, 0x81, 0xd1, 0x60, 0x31, 0xfd, 0xc1, 0x22, 0x2d, 0xe0, 0xc1,
|
||||
0x95, 0x1f, 0xec, 0x42, 0x02, 0x0d, 0x23, 0x6e, 0x37, 0x88, 0x64, 0xd1, 0x56, 0x9f, 0xb6, 0xb2,
|
||||
0xfb, 0xdd, 0x67, 0x02, 0xc3, 0x0d, 0x88, 0x43, 0xf6, 0xae, 0x01, 0xc3, 0xd4, 0x80, 0x2a, 0xef,
|
||||
0x57, 0xa3, 0xa8, 0x4d, 0xc5, 0x4c, 0x72, 0xa9, 0x28, 0xba, 0x53, 0x1d, 0x72, 0x5f, 0xf3, 0x6c,
|
||||
0x5a, 0xac, 0x0b, 0xad, 0x4e, 0xa3, 0x62, 0x73, 0x71, 0x85, 0x64, 0xd4, 0x65, 0x2e, 0xc4, 0x55,
|
||||
0xa4, 0x62, 0x6b, 0xdf, 0x28, 0xc5, 0x18, 0x14, 0x11, 0x3f, 0x91, 0x3e, 0xd5, 0x1b, 0x3f, 0x1f,
|
||||
0x59, 0x11, 0x07, 0x15, 0x32, 0xb2, 0xf1, 0xd3, 0x51, 0x45, 0x6e, 0x60, 0xc5, 0xa9, 0xd0, 0x26,
|
||||
0xb9, 0xce, 0x28, 0x79, 0xc4, 0xa8, 0x03, 0x2b, 0x07, 0xfc, 0xa4, 0x2a, 0xed, 0xd8, 0x70, 0x03,
|
||||
0x2f, 0x77, 0x08, 0x3d, 0xe9, 0x45, 0xa5, 0xd2, 0xec, 0x28, 0x17, 0x67, 0x4b, 0x2e, 0xee, 0x1a,
|
||||
0x3f, 0x63, 0xbe, 0x0a, 0x7a, 0x27, 0xd8, 0x95, 0x8b, 0x47, 0x42, 0x61, 0x4e, 0x2c, 0xbe, 0x89,
|
||||
0x30, 0x07, 0x3b, 0x00, 0xd5, 0x14, 0x12, 0x86, 0x50, 0xe4, 0x3b, 0xd3, 0x34, 0x09, 0x9f, 0x7f,
|
||||
0x5d, 0x3b, 0x88, 0x24, 0x0e, 0x77, 0x17, 0x87, 0x07, 0xe7, 0x4f, 0x0a, 0xc5, 0xfa, 0x78, 0x2d,
|
||||
0x57, 0x41, 0x69, 0x04, 0x31, 0x64, 0x12, 0x99, 0x2a, 0x02, 0x78, 0x63, 0xfa, 0x4d, 0xa8, 0x37,
|
||||
0x03, 0xc7, 0x12, 0x76, 0xe0, 0xb8, 0x17, 0x3e, 0x53, 0xa6, 0xae, 0x44, 0x3e, 0x9c, 0x18, 0x83,
|
||||
0x63, 0x69, 0xe1, 0x9d, 0xdc, 0x15, 0x78, 0x7e, 0x22, 0x5e, 0x9d, 0x46, 0x38, 0x64, 0xad, 0x3c,
|
||||
0x6b, 0x9b, 0x1a, 0x7e, 0x95, 0x3f, 0x49, 0xc1, 0x01, 0x92, 0x60, 0x38, 0x50, 0x6f, 0x75, 0x41,
|
||||
0xf0, 0x52, 0x37, 0xd8, 0x27, 0xed, 0xb8, 0x08, 0xbb, 0xae, 0x39, 0x1a, 0x1f, 0x6f, 0x06, 0x70,
|
||||
0x72, 0x7c, 0xfd, 0xd7, 0x80, 0x46, 0x7d, 0x96, 0xdd, 0xdb, 0x20, 0x3f, 0x4d, 0x2b, 0x24, 0x1f,
|
||||
0x13, 0x19, 0x12, 0x75, 0xa4, 0x12, 0x40, 0x48, 0xb2, 0x02, 0xe5, 0x15, 0x94, 0xba, 0xbc, 0xb5,
|
||||
0x92, 0x81, 0x9a, 0x70, 0xd3, 0xd4, 0x1a, 0xe3, 0xf1, 0x1d, 0xb7, 0xe0, 0x18, 0xb6, 0x4f, 0xe0,
|
||||
0x2d, 0x22, 0x55, 0x68, 0xfa, 0x9c, 0x4f, 0x61, 0x17, 0x87, 0xc9, 0xdb, 0xa0, 0xfb, 0x4a, 0x09,
|
||||
0x56, 0x7e, 0x4d, 0x45, 0x3b, 0xfa, 0x37, 0x90, 0x16, 0x62, 0x60, 0x0f, 0x79, 0xa9, 0x65, 0x6b,
|
||||
0x12, 0xfd, 0x74, 0x54, 0x2d, 0x8c, 0x87, 0xb2, 0x17, 0xba, 0x46, 0x24, 0xe7, 0x23, 0xb1, 0x88,
|
||||
0x4d, 0x16, 0x08, 0xda, 0xac, 0x68, 0x24, 0x8d, 0x9f, 0x5a, 0xaa, 0x86, 0xa2, 0x2e, 0xf0, 0xfc,
|
||||
0x49, 0x2e, 0xf0, 0xc2, 0x40, 0xa0, 0x75, 0x05, 0x69, 0xe7, 0x7b, 0x53, 0x2a, 0xea, 0xba, 0xb6,
|
||||
0x98, 0xe4, 0xd4, 0x12, 0x7b, 0x68, 0xed, 0xe2, 0x70, 0x87, 0x80, 0xb7, 0xf2, 0xd6, 0x49, 0x40,
|
||||
0xc4, 0x8f, 0x45, 0x01, 0x3c, 0xad, 0x75, 0x8a, 0x21, 0x20, 0x1b, 0xab, 0xf4, 0x37, 0x71, 0x37,
|
||||
0xb9, 0xe4, 0x24, 0x59, 0x6d, 0x51, 0x3c, 0x92, 0x45, 0xf1, 0x64, 0x34, 0xf5, 0x7d, 0x9a, 0x2a,
|
||||
0xdb, 0x9a, 0x4d, 0x55, 0xa6, 0x4d, 0xb5, 0x45, 0x01, 0xbc, 0xa3, 0xf8, 0xa2, 0x8e, 0x69, 0x62,
|
||||
0xd7, 0x36, 0xdb, 0x2f, 0xb2, 0xf1, 0xb8, 0xea, 0x94, 0x9c, 0xc8, 0xb7, 0x1f, 0x95, 0x13, 0x30,
|
||||
0xa6, 0xf3, 0x72, 0x52, 0x6e, 0xd5, 0x66, 0x8f, 0x0a, 0x56, 0xf5, 0x9c, 0x58, 0x3c, 0xce, 0xab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 0xef, 0xcd, 0x4d, 0xc0, 0xda,
|
||||
0xc9, 0x5d, 0x3b, 0xb9, 0x1f, 0xc3, 0xc9, 0xfd, 0xa7, 0xf5, 0x6c, 0xa3, 0x4e, 0xb3, 0x38, 0xb7,
|
||||
0x3b, 0x68, 0x91, 0xd1, 0xb3, 0xa8, 0x69, 0x24, 0x9c, 0xdf, 0x27, 0x5b, 0x38, 0xbf, 0x7d, 0xb2,
|
||||
0x0a, 0xd9, 0x7c, 0xe0, 0x52, 0x12, 0x44, 0x78, 0xe0, 0xdf, 0x67, 0xef, 0xbf, 0x7c, 0x86, 0x7b,
|
||||
0x5a, 0xf7, 0x71, 0x92, 0x1b, 0xf2, 0x48, 0x53, 0x1e, 0xce, 0x8b, 0xfe, 0x90, 0xf6, 0x62, 0xed,
|
||||
0x2e, 0xaf, 0xdd, 0xe5, 0xb5, 0xbb, 0xfc, 0xf0, 0xee, 0x72, 0x9b, 0xf7, 0x1a, 0x94, 0x0e, 0xe6,
|
||||
0xe9, 0xbe, 0x89, 0x22, 0x90, 0x48, 0x44, 0xe9, 0xc0, 0x6e, 0x73, 0x2c, 0x49, 0x22, 0x21, 0x34,
|
||||
0x43, 0xeb, 0xd9, 0xe1, 0xad, 0x4e, 0x0e, 0x63, 0xb4, 0x3e, 0xc3, 0x7f, 0xff, 0x13, 0xc4, 0xf3,
|
||||
0x14, 0x61, 0x9d, 0x62, 0xbd, 0xd6, 0xe2, 0xed, 0xdf, 0x6c, 0xb7, 0x60, 0xd7, 0x9d, 0x01, 0x83,
|
||||
0xb2, 0x57, 0x3b, 0xfa, 0x6b, 0x47, 0x3f, 0x75, 0xf4, 0xff, 0x3f, 0xe9, 0x2d, 0xb6, 0x55};
|
||||
|
||||
const char* shaderSource() {
|
||||
static std::string decompressed = util::decompress(std::string(reinterpret_cast<const char*>(compressedShaderSource), sizeof(compressedShaderSource)));
|
||||
return decompressed.c_str();
|
||||
};
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
} // namespace mbgl
|
||||
// clang-format on
|
||||
@@ -1,16 +0,0 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
const char* shaderSource();
|
||||
|
||||
template <typename>
|
||||
struct ShaderSource;
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
} // namespace mbgl
|
||||
@@ -1,29 +0,0 @@
|
||||
#include <mbgl/programs/gl/shaders.hpp>
|
||||
#include <mbgl/programs/gl/shader_source.hpp>
|
||||
#include <mbgl/programs/gl/preludes.hpp>
|
||||
#include <mbgl/programs/program_parameters.hpp>
|
||||
#include <mbgl/util/string.hpp>
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace mbgl {
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
std::string programIdentifier(const std::string& defines1,
|
||||
const std::string& defines2,
|
||||
const uint8_t hash1[8],
|
||||
const uint8_t hash2[8]) {
|
||||
std::string result;
|
||||
result.reserve(8 + 8 + (sizeof(size_t) * 2) * 2 + 2);
|
||||
result.append(util::toHex(static_cast<uint64_t>(std::hash<std::string>()(defines1))));
|
||||
result.append(util::toHex(static_cast<uint64_t>(std::hash<std::string>()(defines2))));
|
||||
result.append(hash1, hash2 + 8);
|
||||
result.append(hash2, hash2 + 8);
|
||||
result.append("v3");
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
} // namespace mbgl
|
||||
@@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class ProgramParameters;
|
||||
|
||||
namespace programs {
|
||||
namespace gl {
|
||||
|
||||
std::string programIdentifier(const std::string& defines1,
|
||||
const std::string& defines2,
|
||||
const uint8_t hash1[8],
|
||||
const uint8_t hash2[8]);
|
||||
|
||||
} // namespace gl
|
||||
} // namespace programs
|
||||
} // namespace mbgl
|
||||
@@ -13,8 +13,9 @@ namespace uniforms {
|
||||
MBGL_DEFINE_UNIFORM_SCALAR(float, intensity);
|
||||
} // namespace uniforms
|
||||
|
||||
class HeatmapProgram : public Program<
|
||||
class HeatmapProgram final : public Program<
|
||||
HeatmapProgram,
|
||||
shaders::BuiltIn::HeatmapProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
TypeList<
|
||||
attributes::pos>,
|
||||
@@ -26,6 +27,11 @@ class HeatmapProgram : public Program<
|
||||
style::HeatmapPaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"HeatmapProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
/*
|
||||
@@ -47,13 +53,4 @@ public:
|
||||
using HeatmapLayoutVertex = HeatmapProgram::LayoutVertex;
|
||||
using HeatmapAttributes = HeatmapProgram::AttributeList;
|
||||
|
||||
class HeatmapLayerPrograms final : public LayerTypePrograms {
|
||||
public:
|
||||
HeatmapLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
|
||||
: heatmap(context, programParameters),
|
||||
heatmapTexture(context, programParameters) {}
|
||||
HeatmapProgram heatmap;
|
||||
HeatmapTextureProgram heatmapTexture;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -9,8 +9,9 @@
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class HeatmapTextureProgram : public Program<
|
||||
class HeatmapTextureProgram final : public Program<
|
||||
HeatmapTextureProgram,
|
||||
shaders::BuiltIn::HeatmapTextureProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
TypeList<attributes::pos>,
|
||||
TypeList<
|
||||
@@ -22,6 +23,11 @@ class HeatmapTextureProgram : public Program<
|
||||
textures::color_ramp>,
|
||||
style::Properties<>> {
|
||||
public:
|
||||
static constexpr std::string_view Name{"HeatmapTextureProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static LayoutVertex layoutVertex(Point<int16_t> p) {
|
||||
|
||||
@@ -14,8 +14,9 @@ MBGL_DEFINE_UNIFORM_SCALAR(float, maxzoom);
|
||||
MBGL_DEFINE_UNIFORM_VECTOR(float, 4, unpack);
|
||||
} // namespace uniforms
|
||||
|
||||
class HillshadePrepareProgram : public Program<
|
||||
class HillshadePrepareProgram final : public Program<
|
||||
HillshadePrepareProgram,
|
||||
shaders::BuiltIn::HillshadePrepareProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
TypeList<
|
||||
attributes::pos,
|
||||
@@ -30,6 +31,11 @@ class HillshadePrepareProgram : public Program<
|
||||
textures::image>,
|
||||
style::Properties<>> {
|
||||
public:
|
||||
static constexpr std::string_view Name{"HillshadePrepareProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static LayoutVertex layoutVertex(Point<int16_t> p, Point<uint16_t> t) {
|
||||
|
||||
@@ -18,8 +18,9 @@ MBGL_DEFINE_UNIFORM_VECTOR(float, 2, light);
|
||||
MBGL_DEFINE_UNIFORM_VECTOR(float, 2, latrange);
|
||||
} // namespace uniforms
|
||||
|
||||
class HillshadeProgram : public Program<
|
||||
class HillshadeProgram final : public Program<
|
||||
HillshadeProgram,
|
||||
shaders::BuiltIn::HillshadeProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
TypeList<
|
||||
attributes::pos,
|
||||
@@ -35,6 +36,11 @@ class HillshadeProgram : public Program<
|
||||
textures::image>,
|
||||
style::HillshadePaintProperties>{
|
||||
public:
|
||||
static constexpr std::string_view Name{"HillshadeProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static LayoutVertex layoutVertex(Point<int16_t> p, Point<uint16_t> t) {
|
||||
@@ -54,13 +60,4 @@ public:
|
||||
using HillshadeLayoutVertex = HillshadeProgram::LayoutVertex;
|
||||
using HillshadeAttributes = HillshadeProgram::AttributeList;
|
||||
|
||||
class HillshadeLayerPrograms final : public LayerTypePrograms {
|
||||
public:
|
||||
HillshadeLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
|
||||
: hillshade(context, programParameters),
|
||||
hillshadePrepare(context, programParameters) {}
|
||||
HillshadeProgram hillshade;
|
||||
HillshadePrepareProgram hillshadePrepare;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -30,8 +30,9 @@ using LineLayoutAttributes = TypeList<
|
||||
attributes::pos_normal,
|
||||
attributes::data<uint8_t, 4>>;
|
||||
|
||||
class LineProgram : public Program<
|
||||
class LineProgram final : public Program<
|
||||
LineProgram,
|
||||
shaders::BuiltIn::LineProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
LineLayoutAttributes,
|
||||
TypeList<
|
||||
@@ -43,6 +44,11 @@ class LineProgram : public Program<
|
||||
style::LinePaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"LineProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
/*
|
||||
@@ -95,8 +101,9 @@ public:
|
||||
float pixelRatio);
|
||||
};
|
||||
|
||||
class LinePatternProgram : public Program<
|
||||
class LinePatternProgram final : public Program<
|
||||
LinePatternProgram,
|
||||
shaders::BuiltIn::LinePatternProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
LineLayoutAttributes,
|
||||
TypeList<
|
||||
@@ -112,6 +119,11 @@ class LinePatternProgram : public Program<
|
||||
style::LinePaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"LinePatternProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static LayoutUniformValues layoutUniformValues(const style::LinePaintProperties::PossiblyEvaluated&,
|
||||
@@ -123,8 +135,9 @@ public:
|
||||
const CrossfadeParameters& crossfade);
|
||||
};
|
||||
|
||||
class LineSDFProgram : public Program<
|
||||
class LineSDFProgram final : public Program<
|
||||
LineSDFProgram,
|
||||
shaders::BuiltIn::LineSDFProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
LineLayoutAttributes,
|
||||
TypeList<
|
||||
@@ -143,6 +156,11 @@ class LineSDFProgram : public Program<
|
||||
style::LinePaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"LineSDFProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static LayoutUniformValues
|
||||
@@ -157,8 +175,9 @@ public:
|
||||
float atlasWidth);
|
||||
};
|
||||
|
||||
class LineGradientProgram : public Program<
|
||||
class LineGradientProgram final : public Program<
|
||||
LineGradientProgram,
|
||||
shaders::BuiltIn::LineGradientProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
LineLayoutAttributes,
|
||||
TypeList<
|
||||
@@ -171,6 +190,11 @@ class LineGradientProgram : public Program<
|
||||
style::LinePaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"LineGradientProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static LayoutUniformValues layoutUniformValues(const style::LinePaintProperties::PossiblyEvaluated&,
|
||||
@@ -183,17 +207,4 @@ public:
|
||||
using LineLayoutVertex = LineProgram::LayoutVertex;
|
||||
using LineAttributes = LineProgram::AttributeList;
|
||||
|
||||
class LineLayerPrograms final : public LayerTypePrograms {
|
||||
public:
|
||||
LineLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
|
||||
: line(context, programParameters),
|
||||
lineGradient(context, programParameters),
|
||||
lineSDF(context, programParameters),
|
||||
linePattern(context, programParameters) {}
|
||||
LineProgram line;
|
||||
LineGradientProgram lineGradient;
|
||||
LineSDFProgram lineSDF;
|
||||
LinePatternProgram linePattern;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/gfx/attribute.hpp>
|
||||
#include <mbgl/gfx/shader.hpp>
|
||||
#include <mbgl/gfx/uniform.hpp>
|
||||
#include <mbgl/gfx/draw_mode.hpp>
|
||||
#include <mbgl/programs/segment.hpp>
|
||||
@@ -12,6 +13,11 @@
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include <mbgl/shaders/shader_manifest.hpp>
|
||||
#ifdef MBGL_RENDER_BACKEND_OPENGL
|
||||
#include <mbgl/gl/program.hpp>
|
||||
#endif
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
namespace gfx {
|
||||
@@ -19,12 +25,13 @@ class RenderPass;
|
||||
} // namespace gfx
|
||||
|
||||
template <class Name,
|
||||
shaders::BuiltIn ShaderSource,
|
||||
gfx::PrimitiveType Primitive,
|
||||
class LayoutAttributeList,
|
||||
class LayoutUniformList,
|
||||
class Textures,
|
||||
class PaintProps>
|
||||
class Program {
|
||||
class Program : public gfx::Shader {
|
||||
public:
|
||||
using LayoutVertex = gfx::Vertex<LayoutAttributeList>;
|
||||
|
||||
@@ -45,8 +52,23 @@ public:
|
||||
|
||||
std::unique_ptr<gfx::Program<Name>> program;
|
||||
|
||||
Program(gfx::Context& context, const ProgramParameters& programParameters)
|
||||
: program(context.createProgram<Name>(programParameters)) {
|
||||
Program(const ProgramParameters& programParameters) {
|
||||
switch (gfx::Backend::GetType()) {
|
||||
#ifdef MBGL_RENDER_BACKEND_OPENGL
|
||||
case gfx::Backend::Type::OpenGL: {
|
||||
program = std::make_unique<gl::Program<Name>>(programParameters
|
||||
.withDefaultSource({
|
||||
gfx::Backend::Type::OpenGL,
|
||||
shaders::ShaderSource<ShaderSource, gfx::Backend::Type::OpenGL>::vertex,
|
||||
shaders::ShaderSource<ShaderSource, gfx::Backend::Type::OpenGL>::fragment
|
||||
}));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default: {
|
||||
throw std::runtime_error("Unsupported rendering backend!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static UniformValues computeAllUniformValues(
|
||||
|
||||
@@ -1,30 +1,44 @@
|
||||
#include <mbgl/programs/program_parameters.hpp>
|
||||
#include <mbgl/util/string.hpp>
|
||||
#include <string_view>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
ProgramParameters::ProgramParameters(const float pixelRatio,
|
||||
const bool overdraw)
|
||||
: defines([&] {
|
||||
std::string result;
|
||||
result.reserve(32);
|
||||
result += "#define DEVICE_PIXEL_RATIO ";
|
||||
result += util::toString(pixelRatio, true);
|
||||
result += '\n';
|
||||
if (overdraw) {
|
||||
result += "#define OVERDRAW_INSPECTOR\n";
|
||||
}
|
||||
return result;
|
||||
std::string result;
|
||||
result.reserve(32);
|
||||
result += "#define DEVICE_PIXEL_RATIO ";
|
||||
result += util::toString(pixelRatio, true);
|
||||
result += '\n';
|
||||
if (overdraw) {
|
||||
result += "#define OVERDRAW_INSPECTOR\n";
|
||||
}
|
||||
return result;
|
||||
}())
|
||||
{}
|
||||
|
||||
ProgramParameters ProgramParameters::withShaderSource(std::string_view vertexSource,
|
||||
std::string_view fragmentSource) const noexcept
|
||||
ProgramParameters ProgramParameters::withShaderSource(
|
||||
const ProgramSource &source) const noexcept
|
||||
{
|
||||
assert(gfx::Backend::Type::TYPE_MAX != source.backend);
|
||||
|
||||
ProgramParameters params = *this;
|
||||
params.vertexSource_ = vertexSource;
|
||||
params.fragmentSource_ = fragmentSource;
|
||||
params.userSources[static_cast<size_t>(source.backend)]
|
||||
= source;
|
||||
return params;
|
||||
}
|
||||
|
||||
ProgramParameters ProgramParameters::withDefaultSource(
|
||||
const ProgramSource &source) const noexcept
|
||||
{
|
||||
assert(gfx::Backend::Type::TYPE_MAX != source.backend);
|
||||
|
||||
ProgramParameters params = *this;
|
||||
params.defaultSources[static_cast<size_t>(source.backend)]
|
||||
= source;
|
||||
return params;
|
||||
}
|
||||
|
||||
@@ -32,12 +46,30 @@ const std::string& ProgramParameters::getDefines() const {
|
||||
return defines;
|
||||
}
|
||||
|
||||
const std::string& ProgramParameters::vertexSource() const noexcept {
|
||||
return vertexSource_;
|
||||
const std::string&
|
||||
ProgramParameters::vertexSource(gfx::Backend::Type backend) const {
|
||||
assert(gfx::Backend::Type::TYPE_MAX != backend);
|
||||
|
||||
if (userSources[static_cast<size_t>(backend)].vertex.length() > 0) {
|
||||
return userSources[static_cast<size_t>(backend)].vertex;
|
||||
} else if (defaultSources[static_cast<size_t>(backend)].vertex.length() > 0) {
|
||||
return defaultSources[static_cast<size_t>(backend)].vertex;
|
||||
} else {
|
||||
throw std::runtime_error("No vertex shader source provided for selected backend!");
|
||||
}
|
||||
}
|
||||
|
||||
const std::string& ProgramParameters::fragmentSource() const noexcept {
|
||||
return fragmentSource_;
|
||||
const std::string&
|
||||
ProgramParameters::fragmentSource(gfx::Backend::Type backend) const {
|
||||
assert(gfx::Backend::Type::TYPE_MAX != backend);
|
||||
|
||||
if (userSources[static_cast<size_t>(backend)].fragment.length() > 0) {
|
||||
return userSources[static_cast<size_t>(backend)].fragment;
|
||||
} else if (defaultSources[static_cast<size_t>(backend)].fragment.length() > 0) {
|
||||
return defaultSources[static_cast<size_t>(backend)].fragment;
|
||||
} else {
|
||||
throw std::runtime_error("No fragment shader source provided for selected backend!");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -1,25 +1,69 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/gfx/backend.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class ProgramParameters {
|
||||
public:
|
||||
ProgramParameters(float pixelRatio, bool overdraw);
|
||||
public:
|
||||
struct ProgramSource {
|
||||
gfx::Backend::Type backend{gfx::Backend::Type::TYPE_MAX};
|
||||
std::string vertex;
|
||||
std::string fragment;
|
||||
|
||||
ProgramParameters withShaderSource(std::string_view vertexSource,
|
||||
std::string_view fragmentSource) const noexcept;
|
||||
ProgramSource() = default;
|
||||
|
||||
const std::string& getDefines() const;
|
||||
/// @brief Construct a new ProgramSource object
|
||||
/// @param forBackend The provided source code is intended for use with the give
|
||||
/// rendering backend.
|
||||
/// @param vertex_ The vertex shader source code, or empty string if not provided.
|
||||
/// @param fragment_ The fragment shader source code, or empty string if not provided.
|
||||
ProgramSource(gfx::Backend::Type forBackend, const std::string& vertex_,
|
||||
const std::string& fragment_)
|
||||
: backend(forBackend), vertex(vertex_), fragment(fragment_)
|
||||
{
|
||||
assert(gfx::Backend::Type::TYPE_MAX != forBackend);
|
||||
}
|
||||
};
|
||||
|
||||
const std::string& vertexSource() const noexcept;
|
||||
const std::string& fragmentSource() const noexcept;
|
||||
ProgramParameters(float pixelRatio, bool overdraw);
|
||||
|
||||
/// @brief Provide custom shader code which overrides any default source present
|
||||
/// @param source ProgramSource
|
||||
/// @return Mutated ProgramParameters
|
||||
ProgramParameters withShaderSource(const ProgramSource& source) const noexcept;
|
||||
|
||||
private:
|
||||
std::string defines;
|
||||
std::string vertexSource_{""};
|
||||
std::string fragmentSource_{""};
|
||||
/// @brief Provide default shader source
|
||||
/// @param source ProgramSource
|
||||
/// @return Mutated ProgramParameters
|
||||
ProgramParameters withDefaultSource(const ProgramSource& source) const noexcept;
|
||||
|
||||
/// @brief Get a list of built-in shader preprocessor defines
|
||||
/// @return Shader source string
|
||||
/// @todo With the addition of future backends, defines should also be backend-aware
|
||||
const std::string& getDefines() const;
|
||||
|
||||
/// @brief Get source code for the vertex shader compatible with the requested backend
|
||||
/// @param backend Backend type
|
||||
/// @return Shader source string
|
||||
const std::string& vertexSource(gfx::Backend::Type backend) const;
|
||||
|
||||
/// @brief Get source code for the fragment shader compatible with the requested backend
|
||||
/// @param backend Backend type
|
||||
/// @return Shader source string
|
||||
const std::string& fragmentSource(gfx::Backend::Type backend) const;
|
||||
|
||||
private:
|
||||
std::string defines;
|
||||
|
||||
std::array<ProgramSource, static_cast<size_t>(gfx::Backend::Type::TYPE_MAX)>
|
||||
defaultSources;
|
||||
std::array<ProgramSource, static_cast<size_t>(gfx::Backend::Type::TYPE_MAX)>
|
||||
userSources;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -10,79 +10,71 @@
|
||||
#include <mbgl/programs/raster_program.hpp>
|
||||
#include <mbgl/programs/symbol_program.hpp>
|
||||
|
||||
#include <mbgl/util/logging.hpp>
|
||||
#include <exception>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
Programs::Programs(gfx::Context& context_, const ProgramParameters& programParameters_)
|
||||
: debug(context_, programParameters_),
|
||||
clippingMask(context_, programParameters_),
|
||||
context(context_),
|
||||
programParameters(programParameters_) {}
|
||||
Programs::Programs(const ProgramParameters& programParameters_)
|
||||
: programParameters(programParameters_) {}
|
||||
|
||||
Programs::~Programs() = default;
|
||||
|
||||
void Programs::registerWith([[maybe_unused]] gfx::ShaderRegistry& registry) noexcept {}
|
||||
/// @brief Register a list of types with a shader registry instance
|
||||
/// @tparam ...T Type list parameter pack
|
||||
/// @param registry A shader registry instance
|
||||
/// programParameters_ ProgramParameters used to initialize each instance
|
||||
template<typename ... T>
|
||||
void registerTypes(gfx::ShaderRegistry& registry,
|
||||
const ProgramParameters& programParameters_)
|
||||
{
|
||||
/// The following fold expression will create a shared_ptr for every type
|
||||
/// in the parameter pack and register it with the shader registry.
|
||||
|
||||
BackgroundLayerPrograms& Programs::getBackgroundLayerPrograms() noexcept {
|
||||
if (!backgroundPrograms) {
|
||||
backgroundPrograms = std::make_unique<BackgroundLayerPrograms>(context, programParameters);
|
||||
}
|
||||
return static_cast<BackgroundLayerPrograms&>(*backgroundPrograms);
|
||||
/// Registration calls are wrapped in a lambda that throws on registration
|
||||
/// failure, we shouldn't expect registration to faill unless the shader
|
||||
/// registry instance provided already has conflicting programs present.
|
||||
( [](bool expr) {
|
||||
if (!expr) {
|
||||
throw std::runtime_error(
|
||||
"Failed to register " +
|
||||
std::string(T::Name) +
|
||||
" with shader registry!");
|
||||
}
|
||||
}( registry.registerShader(
|
||||
std::make_shared<T>(programParameters_))), ... );
|
||||
}
|
||||
|
||||
RasterLayerPrograms& Programs::getRasterLayerPrograms() noexcept {
|
||||
if (!rasterPrograms) {
|
||||
rasterPrograms = std::make_unique<RasterLayerPrograms>(context, programParameters);
|
||||
}
|
||||
return static_cast<RasterLayerPrograms&>(*rasterPrograms);
|
||||
}
|
||||
|
||||
HeatmapLayerPrograms& Programs::getHeatmapLayerPrograms() noexcept {
|
||||
if (!heatmapPrograms) {
|
||||
heatmapPrograms = std::make_unique<HeatmapLayerPrograms>(context, programParameters);
|
||||
}
|
||||
return static_cast<HeatmapLayerPrograms&>(*heatmapPrograms);
|
||||
}
|
||||
|
||||
HillshadeLayerPrograms& Programs::getHillshadeLayerPrograms() noexcept {
|
||||
if (!hillshadePrograms) {
|
||||
hillshadePrograms = std::make_unique<HillshadeLayerPrograms>(context, programParameters);
|
||||
}
|
||||
return static_cast<HillshadeLayerPrograms&>(*hillshadePrograms);
|
||||
}
|
||||
|
||||
FillLayerPrograms& Programs::getFillLayerPrograms() noexcept {
|
||||
if (!fillPrograms) {
|
||||
fillPrograms = std::make_unique<FillLayerPrograms>(context, programParameters);
|
||||
}
|
||||
return static_cast<FillLayerPrograms&>(*fillPrograms);
|
||||
}
|
||||
|
||||
FillExtrusionLayerPrograms& Programs::getFillExtrusionLayerPrograms() noexcept {
|
||||
if (!fillExtrusionPrograms) {
|
||||
fillExtrusionPrograms = std::make_unique<FillExtrusionLayerPrograms>(context, programParameters);
|
||||
}
|
||||
return static_cast<FillExtrusionLayerPrograms&>(*fillExtrusionPrograms);
|
||||
}
|
||||
|
||||
CircleLayerPrograms& Programs::getCircleLayerPrograms() noexcept {
|
||||
if (!circlePrograms) {
|
||||
circlePrograms = std::make_unique<CircleLayerPrograms>(context, programParameters);
|
||||
}
|
||||
return static_cast<CircleLayerPrograms&>(*circlePrograms);
|
||||
}
|
||||
|
||||
LineLayerPrograms& Programs::getLineLayerPrograms() noexcept {
|
||||
if (!linePrograms) {
|
||||
linePrograms = std::make_unique<LineLayerPrograms>(context, programParameters);
|
||||
}
|
||||
return static_cast<LineLayerPrograms&>(*linePrograms);
|
||||
}
|
||||
|
||||
SymbolLayerPrograms& Programs::getSymbolLayerPrograms() noexcept {
|
||||
if (!symbolPrograms) {
|
||||
symbolPrograms = std::make_unique<SymbolLayerPrograms>(context, programParameters);
|
||||
}
|
||||
return static_cast<SymbolLayerPrograms&>(*symbolPrograms);
|
||||
void Programs::registerWith(gfx::ShaderRegistry& registry) {
|
||||
/// The following types will be registered
|
||||
registerTypes<
|
||||
BackgroundProgram,
|
||||
BackgroundPatternProgram,
|
||||
RasterProgram,
|
||||
HeatmapProgram,
|
||||
HeatmapTextureProgram,
|
||||
HillshadeProgram,
|
||||
HillshadePrepareProgram,
|
||||
FillProgram,
|
||||
FillPatternProgram,
|
||||
FillOutlineProgram,
|
||||
FillOutlinePatternProgram,
|
||||
FillExtrusionProgram,
|
||||
FillExtrusionPatternProgram,
|
||||
CircleProgram,
|
||||
LineProgram,
|
||||
LineGradientProgram,
|
||||
LineSDFProgram,
|
||||
LinePatternProgram,
|
||||
SymbolIconProgram,
|
||||
SymbolSDFIconProgram,
|
||||
SymbolSDFTextProgram,
|
||||
SymbolTextAndIconProgram,
|
||||
CollisionBoxProgram,
|
||||
CollisionCircleProgram,
|
||||
DebugProgram,
|
||||
ClippingMaskProgram
|
||||
>(registry, programParameters);
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -21,38 +21,14 @@ class SymbolLayerPrograms;
|
||||
|
||||
class Programs {
|
||||
public:
|
||||
Programs(gfx::Context&, const ProgramParameters&);
|
||||
Programs(const ProgramParameters&);
|
||||
~Programs();
|
||||
|
||||
/// @brief Registers built-in programs with the provided registry.
|
||||
/// @param registry gfx::ShaderRegistry to populate with built-in programs.
|
||||
void registerWith(gfx::ShaderRegistry& registry) noexcept;
|
||||
|
||||
BackgroundLayerPrograms& getBackgroundLayerPrograms() noexcept;
|
||||
RasterLayerPrograms& getRasterLayerPrograms() noexcept;
|
||||
HeatmapLayerPrograms& getHeatmapLayerPrograms() noexcept;
|
||||
CircleLayerPrograms& getCircleLayerPrograms() noexcept;
|
||||
HillshadeLayerPrograms& getHillshadeLayerPrograms() noexcept;
|
||||
FillLayerPrograms& getFillLayerPrograms() noexcept;
|
||||
FillExtrusionLayerPrograms& getFillExtrusionLayerPrograms() noexcept;
|
||||
LineLayerPrograms& getLineLayerPrograms() noexcept;
|
||||
SymbolLayerPrograms& getSymbolLayerPrograms() noexcept;
|
||||
|
||||
DebugProgram debug;
|
||||
ClippingMaskProgram clippingMask;
|
||||
void registerWith(gfx::ShaderRegistry& registry);
|
||||
|
||||
private:
|
||||
std::unique_ptr<LayerTypePrograms> backgroundPrograms;
|
||||
std::unique_ptr<LayerTypePrograms> circlePrograms;
|
||||
std::unique_ptr<LayerTypePrograms> rasterPrograms;
|
||||
std::unique_ptr<LayerTypePrograms> heatmapPrograms;
|
||||
std::unique_ptr<LayerTypePrograms> hillshadePrograms;
|
||||
std::unique_ptr<LayerTypePrograms> fillPrograms;
|
||||
std::unique_ptr<LayerTypePrograms> fillExtrusionPrograms;
|
||||
std::unique_ptr<LayerTypePrograms> linePrograms;
|
||||
std::unique_ptr<LayerTypePrograms> symbolPrograms;
|
||||
|
||||
gfx::Context& context;
|
||||
ProgramParameters programParameters;
|
||||
};
|
||||
|
||||
|
||||
@@ -21,8 +21,9 @@ MBGL_DEFINE_UNIFORM_VECTOR(float, 3, spin_weights);
|
||||
MBGL_DEFINE_UNIFORM_VECTOR(float, 2, tl_parent);
|
||||
} // namespace uniforms
|
||||
|
||||
class RasterProgram : public Program<
|
||||
class RasterProgram final : public Program<
|
||||
RasterProgram,
|
||||
shaders::BuiltIn::RasterProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
TypeList<
|
||||
attributes::pos,
|
||||
@@ -45,6 +46,11 @@ class RasterProgram : public Program<
|
||||
style::RasterPaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"RasterProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using Program::Program;
|
||||
|
||||
static LayoutVertex layoutVertex(Point<int16_t> p, Point<uint16_t> t) {
|
||||
@@ -64,11 +70,4 @@ public:
|
||||
using RasterLayoutVertex = RasterProgram::LayoutVertex;
|
||||
using RasterAttributes = RasterProgram::AttributeList;
|
||||
|
||||
class RasterLayerPrograms final : public LayerTypePrograms {
|
||||
public:
|
||||
RasterLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
|
||||
: raster(context, programParameters) {}
|
||||
RasterProgram raster;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -123,9 +123,9 @@ SymbolIconProgram::layoutUniformValues(const bool isText,
|
||||
);
|
||||
}
|
||||
|
||||
template <class Name, class PaintProperties>
|
||||
typename SymbolSDFProgram<Name, PaintProperties>::LayoutUniformValues
|
||||
SymbolSDFProgram<Name, PaintProperties>::layoutUniformValues(const bool isText,
|
||||
template <class Name, shaders::BuiltIn ShaderSource, class PaintProperties>
|
||||
typename SymbolSDFProgram<Name, ShaderSource, PaintProperties>::LayoutUniformValues
|
||||
SymbolSDFProgram<Name, ShaderSource, PaintProperties>::layoutUniformValues(const bool isText,
|
||||
const bool hasVariablePacement,
|
||||
const style::SymbolPropertyValues& values,
|
||||
const Size& texsize,
|
||||
@@ -140,7 +140,7 @@ SymbolSDFProgram<Name, PaintProperties>::layoutUniformValues(const bool isText,
|
||||
? static_cast<float>(std::cos(state.getPitch())) * state.getCameraToCenterDistance()
|
||||
: 1.0f);
|
||||
|
||||
return makeValues<SymbolSDFProgram<Name, PaintProperties>::LayoutUniformValues>(
|
||||
return makeValues<SymbolSDFProgram<Name, ShaderSource, PaintProperties>::LayoutUniformValues>(
|
||||
isText,
|
||||
hasVariablePacement,
|
||||
values,
|
||||
@@ -168,21 +168,23 @@ SymbolTextAndIconProgram::LayoutUniformValues SymbolTextAndIconProgram::layoutUn
|
||||
const TransformState& state,
|
||||
const float symbolFadeChange,
|
||||
const SymbolSDFPart part) {
|
||||
return {SymbolSDFProgram<SymbolSDFTextProgram, style::TextPaintProperties>::layoutUniformValues(true,
|
||||
hasVariablePacement,
|
||||
values,
|
||||
texsize,
|
||||
pixelsToGLUnits,
|
||||
pixelRatio,
|
||||
alongLine,
|
||||
tile,
|
||||
state,
|
||||
symbolFadeChange,
|
||||
part)
|
||||
.concat(gfx::UniformValues<SymbolTextAndIconProgramUniforms>(uniforms::texsize::Value(texsize_icon)))};
|
||||
return {SymbolSDFProgram<SymbolSDFTextProgram, shaders::BuiltIn::SymbolSDFTextProgram, style::TextPaintProperties>
|
||||
::layoutUniformValues(
|
||||
true,
|
||||
hasVariablePacement,
|
||||
values,
|
||||
texsize,
|
||||
pixelsToGLUnits,
|
||||
pixelRatio,
|
||||
alongLine,
|
||||
tile,
|
||||
state,
|
||||
symbolFadeChange,
|
||||
part)
|
||||
.concat(gfx::UniformValues<SymbolTextAndIconProgramUniforms>(uniforms::texsize::Value(texsize_icon)))};
|
||||
}
|
||||
|
||||
template class SymbolSDFProgram<SymbolSDFIconProgram, style::IconPaintProperties>;
|
||||
template class SymbolSDFProgram<SymbolSDFTextProgram, style::TextPaintProperties>;
|
||||
template class SymbolSDFProgram<SymbolSDFIconProgram, shaders::BuiltIn::SymbolSDFIconProgram, style::IconPaintProperties>;
|
||||
template class SymbolSDFProgram<SymbolSDFTextProgram, shaders::BuiltIn::SymbolSDFTextProgram, style::TextPaintProperties>;
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -17,6 +17,11 @@
|
||||
#include <cmath>
|
||||
#include <array>
|
||||
|
||||
#include <mbgl/shaders/shader_manifest.hpp>
|
||||
#ifdef MBGL_RENDER_BACKEND_OPENGL
|
||||
#include <mbgl/gl/program.hpp>
|
||||
#endif
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
const uint16_t MAX_GLYPH_ICON_SIZE = 255;
|
||||
@@ -195,7 +200,7 @@ public:
|
||||
Range<float> coveringZoomStops;
|
||||
};
|
||||
|
||||
class SymbolProgramBase {
|
||||
class SymbolProgramBase : public gfx::Shader {
|
||||
public:
|
||||
static gfx::Vertex<SymbolLayoutAttributes> layoutVertex(Point<float> labelAnchor,
|
||||
Point<float> o,
|
||||
@@ -241,6 +246,7 @@ public:
|
||||
};
|
||||
|
||||
template <class Name,
|
||||
shaders::BuiltIn ShaderSource,
|
||||
gfx::PrimitiveType Primitive,
|
||||
class LayoutAttributeList,
|
||||
class LayoutUniformList,
|
||||
@@ -270,8 +276,23 @@ public:
|
||||
|
||||
std::unique_ptr<gfx::Program<Name>> program;
|
||||
|
||||
SymbolProgram(gfx::Context& context, const ProgramParameters& programParameters)
|
||||
: program(context.createProgram<Name>(programParameters)) {
|
||||
SymbolProgram(const ProgramParameters& programParameters) {
|
||||
switch (gfx::Backend::GetType()) {
|
||||
#ifdef MBGL_RENDER_BACKEND_OPENGL
|
||||
case gfx::Backend::Type::OpenGL: {
|
||||
program = std::make_unique<gl::Program<Name>>(programParameters
|
||||
.withDefaultSource({
|
||||
gfx::Backend::Type::OpenGL,
|
||||
shaders::ShaderSource<ShaderSource, gfx::Backend::Type::OpenGL>::vertex,
|
||||
shaders::ShaderSource<ShaderSource, gfx::Backend::Type::OpenGL>::fragment
|
||||
}));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default: {
|
||||
throw std::runtime_error("Unsupported rendering backend!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static UniformValues computeAllUniformValues(
|
||||
@@ -382,8 +403,9 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class SymbolIconProgram : public SymbolProgram<
|
||||
class SymbolIconProgram final : public SymbolProgram<
|
||||
SymbolIconProgram,
|
||||
shaders::BuiltIn::SymbolIconProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
SymbolLayoutAttributes,
|
||||
TypeList<
|
||||
@@ -404,6 +426,11 @@ class SymbolIconProgram : public SymbolProgram<
|
||||
style::IconPaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"SymbolIconProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using SymbolProgram::SymbolProgram;
|
||||
|
||||
static LayoutUniformValues layoutUniformValues(bool isText,
|
||||
@@ -438,8 +465,9 @@ using SymbolSDFProgramUniforms = TypeList<uniforms::matrix,
|
||||
uniforms::device_pixel_ratio,
|
||||
uniforms::is_halo>;
|
||||
|
||||
template <class Name, class PaintProperties>
|
||||
template <class Name, shaders::BuiltIn ShaderSource, class PaintProperties>
|
||||
class SymbolSDFProgram : public SymbolProgram<Name,
|
||||
ShaderSource,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
SymbolLayoutAttributes,
|
||||
SymbolSDFProgramUniforms,
|
||||
@@ -447,6 +475,7 @@ class SymbolSDFProgram : public SymbolProgram<Name,
|
||||
PaintProperties> {
|
||||
public:
|
||||
using BaseProgram = SymbolProgram<Name,
|
||||
ShaderSource,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
SymbolLayoutAttributes,
|
||||
SymbolSDFProgramUniforms,
|
||||
@@ -472,15 +501,22 @@ public:
|
||||
|
||||
using SymbolTextAndIconProgramUniforms = TypeList<uniforms::texsize_icon>;
|
||||
|
||||
class SymbolTextAndIconProgram
|
||||
class SymbolTextAndIconProgram final
|
||||
: public SymbolProgram<SymbolTextAndIconProgram,
|
||||
shaders::BuiltIn::SymbolTextAndIconProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
SymbolLayoutAttributes,
|
||||
TypeListConcat<SymbolSDFProgramUniforms, SymbolTextAndIconProgramUniforms>,
|
||||
TypeList<textures::texture, textures::texture_icon>,
|
||||
style::TextPaintProperties> {
|
||||
public:
|
||||
static constexpr std::string_view Name{"SymbolTextAndIconProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using BaseProgram = SymbolProgram<SymbolTextAndIconProgram,
|
||||
shaders::BuiltIn::SymbolTextAndIconProgram,
|
||||
gfx::PrimitiveType::Triangle,
|
||||
SymbolLayoutAttributes,
|
||||
TypeListConcat<SymbolSDFProgramUniforms, SymbolTextAndIconProgramUniforms>,
|
||||
@@ -504,13 +540,31 @@ public:
|
||||
SymbolSDFPart);
|
||||
};
|
||||
|
||||
class SymbolSDFIconProgram : public SymbolSDFProgram<SymbolSDFIconProgram, style::IconPaintProperties> {
|
||||
class SymbolSDFIconProgram final : public SymbolSDFProgram<
|
||||
SymbolSDFIconProgram,
|
||||
shaders::BuiltIn::SymbolSDFIconProgram,
|
||||
style::IconPaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"SymbolSDFIconProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using SymbolSDFProgram::SymbolSDFProgram;
|
||||
};
|
||||
|
||||
class SymbolSDFTextProgram : public SymbolSDFProgram<SymbolSDFTextProgram, style::TextPaintProperties> {
|
||||
class SymbolSDFTextProgram final : public SymbolSDFProgram<
|
||||
SymbolSDFTextProgram,
|
||||
shaders::BuiltIn::SymbolSDFTextProgram,
|
||||
style::TextPaintProperties>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view Name{"SymbolSDFTextProgram"};
|
||||
const std::string_view name() const noexcept override {
|
||||
return Name;
|
||||
}
|
||||
|
||||
using SymbolSDFProgram::SymbolSDFProgram;
|
||||
};
|
||||
|
||||
@@ -518,21 +572,4 @@ using SymbolLayoutVertex = gfx::Vertex<SymbolLayoutAttributes>;
|
||||
using SymbolIconAttributes = SymbolIconProgram::AttributeList;
|
||||
using SymbolTextAttributes = SymbolSDFTextProgram::AttributeList;
|
||||
|
||||
class SymbolLayerPrograms final : public LayerTypePrograms {
|
||||
public:
|
||||
SymbolLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
|
||||
: symbolIcon(context, programParameters),
|
||||
symbolIconSDF(context, programParameters),
|
||||
symbolGlyph(context, programParameters),
|
||||
symbolTextAndIcon(context, programParameters),
|
||||
collisionBox(context, programParameters),
|
||||
collisionCircle(context, programParameters) {}
|
||||
SymbolIconProgram symbolIcon;
|
||||
SymbolSDFIconProgram symbolIconSDF;
|
||||
SymbolSDFTextProgram symbolGlyph;
|
||||
SymbolTextAndIconProgram symbolTextAndIcon;
|
||||
CollisionBoxProgram collisionBox;
|
||||
CollisionCircleProgram collisionCircle;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <mbgl/util/tile_cover.hpp>
|
||||
#include <mbgl/map/transform_state.hpp>
|
||||
#include <mbgl/gfx/cull_face_mode.hpp>
|
||||
#include <mbgl/gfx/shader_registry.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -64,6 +65,10 @@ void RenderBackgroundLayer::render(PaintParameters& parameters) {
|
||||
// Note that for bottommost layers without a pattern, the background color is drawn with
|
||||
// glClear rather than this method.
|
||||
|
||||
// Ensure programs are available
|
||||
if (!parameters.shaders.populate(backgroundProgram)) return;
|
||||
if (!parameters.shaders.populate(backgroundPatternProgram)) return;
|
||||
|
||||
const Properties<>::PossiblyEvaluated properties;
|
||||
const BackgroundProgram::Binders paintAttributeData(properties, 0);
|
||||
|
||||
@@ -117,7 +122,7 @@ void RenderBackgroundLayer::render(PaintParameters& parameters) {
|
||||
uint32_t i = 0;
|
||||
for (const auto& tileID : util::tileCover(parameters.state, parameters.state.getIntegerZoom())) {
|
||||
const UnwrappedTileID unwrappedTileID = tileID.toUnwrapped();
|
||||
draw(parameters.programs.getBackgroundLayerPrograms().backgroundPattern,
|
||||
draw(*backgroundPatternProgram,
|
||||
BackgroundPatternProgram::layoutUniformValues(parameters.matrixForTile(unwrappedTileID),
|
||||
evaluated.get<BackgroundOpacity>(),
|
||||
parameters.patternAtlas.getPixelSize(),
|
||||
@@ -140,7 +145,7 @@ void RenderBackgroundLayer::render(PaintParameters& parameters) {
|
||||
}
|
||||
uint32_t i = 0;
|
||||
for (const auto& tileID : util::tileCover(parameters.state, parameters.state.getIntegerZoom())) {
|
||||
draw(parameters.programs.getBackgroundLayerPrograms().background,
|
||||
draw(*backgroundProgram,
|
||||
BackgroundProgram::LayoutUniformValues{
|
||||
uniforms::matrix::Value(parameters.matrixForTile(tileID.toUnwrapped())),
|
||||
uniforms::color::Value(evaluated.get<BackgroundColor>()),
|
||||
|
||||
@@ -24,6 +24,10 @@ private:
|
||||
// Paint properties
|
||||
style::BackgroundPaintProperties::Unevaluated unevaluated;
|
||||
SegmentVector<BackgroundAttributes> segments;
|
||||
|
||||
// Programs
|
||||
std::shared_ptr<BackgroundProgram> backgroundProgram;
|
||||
std::shared_ptr<BackgroundPatternProgram> backgroundPatternProgram;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <mbgl/style/layers/circle_layer_impl.hpp>
|
||||
#include <mbgl/geometry/feature_index.hpp>
|
||||
#include <mbgl/gfx/cull_face_mode.hpp>
|
||||
#include <mbgl/gfx/shader_registry.hpp>
|
||||
#include <mbgl/util/math.hpp>
|
||||
#include <mbgl/util/intersection_tests.hpp>
|
||||
|
||||
@@ -80,6 +81,9 @@ void RenderCircleLayer::render(PaintParameters& parameters) {
|
||||
if (parameters.pass == RenderPass::Opaque) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!parameters.shaders.populate(circleProgram)) return;
|
||||
|
||||
const auto drawTile = [&](const RenderTile& tile, const LayerRenderData* data, const auto& segments) {
|
||||
auto& circleBucket = static_cast<CircleBucket&>(*data->bucket);
|
||||
const auto& evaluated = getEvaluated<CircleLayerProperties>(data->layerProperties);
|
||||
@@ -87,7 +91,6 @@ void RenderCircleLayer::render(PaintParameters& parameters) {
|
||||
const bool pitchWithMap = evaluated.template get<CirclePitchAlignment>() == AlignmentType::Map;
|
||||
const auto& paintPropertyBinders = circleBucket.paintPropertyBinders.at(getID());
|
||||
|
||||
auto& programInstance = parameters.programs.getCircleLayerPrograms().circle;
|
||||
using LayoutUniformValues = CircleProgram::LayoutUniformValues;
|
||||
const auto& allUniformValues = CircleProgram::computeAllUniformValues(
|
||||
LayoutUniformValues(
|
||||
@@ -110,19 +113,19 @@ void RenderCircleLayer::render(PaintParameters& parameters) {
|
||||
|
||||
checkRenderability(parameters, CircleProgram::activeBindingCount(allAttributeBindings));
|
||||
|
||||
programInstance.draw(parameters.context,
|
||||
*parameters.renderPass,
|
||||
gfx::Triangles(),
|
||||
parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly),
|
||||
gfx::StencilMode::disabled(),
|
||||
parameters.colorModeForRenderPass(),
|
||||
gfx::CullFaceMode::disabled(),
|
||||
*circleBucket.indexBuffer,
|
||||
segments,
|
||||
allUniformValues,
|
||||
allAttributeBindings,
|
||||
CircleProgram::TextureBindings{},
|
||||
getID());
|
||||
circleProgram->draw(parameters.context,
|
||||
*parameters.renderPass,
|
||||
gfx::Triangles(),
|
||||
parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly),
|
||||
gfx::StencilMode::disabled(),
|
||||
parameters.colorModeForRenderPass(),
|
||||
gfx::CullFaceMode::disabled(),
|
||||
*circleBucket.indexBuffer,
|
||||
segments,
|
||||
allUniformValues,
|
||||
allAttributeBindings,
|
||||
CircleProgram::TextureBindings{},
|
||||
getID());
|
||||
};
|
||||
|
||||
const bool sortFeaturesByKey = !impl_cast(baseImpl).layout.get<CircleSortKey>().isUndefined();
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class CircleProgram;
|
||||
|
||||
class RenderCircleLayer final : public RenderLayer {
|
||||
public:
|
||||
explicit RenderCircleLayer(Immutable<style::CircleLayer::Impl>);
|
||||
@@ -28,6 +30,9 @@ private:
|
||||
|
||||
// Paint properties
|
||||
style::CirclePaintProperties::Unevaluated unevaluated;
|
||||
|
||||
// Programs
|
||||
std::shared_ptr<CircleProgram> circleProgram;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <mbgl/gfx/cull_face_mode.hpp>
|
||||
#include <mbgl/gfx/render_pass.hpp>
|
||||
#include <mbgl/gfx/renderer_backend.hpp>
|
||||
#include <mbgl/gfx/shader_registry.hpp>
|
||||
#include <mbgl/programs/fill_extrusion_program.hpp>
|
||||
#include <mbgl/programs/programs.hpp>
|
||||
#include <mbgl/renderer/buckets/fill_extrusion_bucket.hpp>
|
||||
@@ -71,6 +72,9 @@ void RenderFillExtrusionLayer::render(PaintParameters& parameters) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!parameters.shaders.populate(fillExtrusionProgram)) return;
|
||||
if (!parameters.shaders.populate(fillExtrusionPatternProgram)) return;
|
||||
|
||||
const auto& evaluated = static_cast<const FillExtrusionLayerProperties&>(*evaluatedProperties).evaluated;
|
||||
const auto& crossfade = static_cast<const FillExtrusionLayerProperties&>(*evaluatedProperties).crossfade;
|
||||
if (evaluatedProperties->renderPasses == mbgl::underlying_type(RenderPass::None)) {
|
||||
@@ -133,7 +137,7 @@ void RenderFillExtrusionLayer::render(PaintParameters& parameters) {
|
||||
}
|
||||
auto& bucket = static_cast<FillExtrusionBucket&>(*renderData->bucket);
|
||||
draw(
|
||||
parameters.programs.getFillExtrusionLayerPrograms().fillExtrusion,
|
||||
*fillExtrusionProgram,
|
||||
evaluated,
|
||||
crossfade,
|
||||
stencilMode_,
|
||||
@@ -184,7 +188,7 @@ void RenderFillExtrusionLayer::render(PaintParameters& parameters) {
|
||||
std::optional<ImagePosition> patternPosB = tile.getPattern(fillPatternValue.to.id());
|
||||
|
||||
draw(
|
||||
parameters.programs.getFillExtrusionLayerPrograms().fillExtrusionPattern,
|
||||
*fillExtrusionPatternProgram,
|
||||
evaluated,
|
||||
crossfade,
|
||||
stencilMode_,
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class FillExtrusionProgram;
|
||||
class FillExtrusionPatternProgram;
|
||||
|
||||
class RenderFillExtrusionLayer final : public RenderLayer {
|
||||
public:
|
||||
explicit RenderFillExtrusionLayer(Immutable<style::FillExtrusionLayer::Impl>);
|
||||
@@ -31,6 +34,10 @@ private:
|
||||
// Paint properties
|
||||
style::FillExtrusionPaintProperties::Unevaluated unevaluated;
|
||||
|
||||
// Programs
|
||||
std::shared_ptr<FillExtrusionProgram> fillExtrusionProgram;
|
||||
std::shared_ptr<FillExtrusionPatternProgram> fillExtrusionPatternProgram;
|
||||
|
||||
std::unique_ptr<gfx::OffscreenTexture> renderTexture;
|
||||
};
|
||||
|
||||
|
||||
@@ -74,6 +74,12 @@ bool RenderFillLayer::hasCrossfade() const {
|
||||
|
||||
void RenderFillLayer::render(PaintParameters& parameters) {
|
||||
assert(renderTiles);
|
||||
|
||||
if (!parameters.shaders.populate(fillProgram)) return;
|
||||
if (!parameters.shaders.populate(fillPatternProgram)) return;
|
||||
if (!parameters.shaders.populate(fillOutlineProgram)) return;
|
||||
if (!parameters.shaders.populate(fillOutlinePatternProgram)) return;
|
||||
|
||||
if (unevaluated.get<FillPattern>().isUndefined()) {
|
||||
parameters.renderTileClippingMasks(renderTiles);
|
||||
for (const RenderTile& tile : *renderTiles) {
|
||||
@@ -132,7 +138,7 @@ void RenderFillLayer::render(PaintParameters& parameters) {
|
||||
&& evaluated.get<FillOpacity>().constantOr(0) >= 1.0f
|
||||
&& parameters.currentLayer >= parameters.opaquePassCutoff) ? RenderPass::Opaque : RenderPass::Translucent;
|
||||
if (bucket.triangleIndexBuffer && parameters.pass == fillRenderPass) {
|
||||
draw(parameters.programs.getFillLayerPrograms().fill,
|
||||
draw(*fillProgram,
|
||||
gfx::Triangles(),
|
||||
parameters.depthModeForSublayer(1, parameters.pass == RenderPass::Opaque
|
||||
? gfx::DepthMaskType::ReadWrite
|
||||
@@ -143,7 +149,7 @@ void RenderFillLayer::render(PaintParameters& parameters) {
|
||||
}
|
||||
|
||||
if (evaluated.get<FillAntialias>() && parameters.pass == RenderPass::Translucent) {
|
||||
draw(parameters.programs.getFillLayerPrograms().fillOutline,
|
||||
draw(*fillOutlineProgram,
|
||||
gfx::Lines{ 2.0f },
|
||||
parameters.depthModeForSublayer(
|
||||
unevaluated.get<FillOutlineColor>().isUndefined() ? 2 : 0,
|
||||
@@ -222,7 +228,7 @@ void RenderFillLayer::render(PaintParameters& parameters) {
|
||||
};
|
||||
|
||||
if (bucket.triangleIndexBuffer) {
|
||||
draw(parameters.programs.getFillLayerPrograms().fillPattern,
|
||||
draw(*fillPatternProgram,
|
||||
gfx::Triangles(),
|
||||
parameters.depthModeForSublayer(1, gfx::DepthMaskType::ReadWrite),
|
||||
*bucket.triangleIndexBuffer,
|
||||
@@ -232,7 +238,7 @@ void RenderFillLayer::render(PaintParameters& parameters) {
|
||||
});
|
||||
}
|
||||
if (evaluated.get<FillAntialias>() && unevaluated.get<FillOutlineColor>().isUndefined()) {
|
||||
draw(parameters.programs.getFillLayerPrograms().fillOutlinePattern,
|
||||
draw(*fillOutlinePatternProgram,
|
||||
gfx::Lines { 2.0f },
|
||||
parameters.depthModeForSublayer(2, gfx::DepthMaskType::ReadOnly),
|
||||
*bucket.lineIndexBuffer,
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
namespace mbgl {
|
||||
|
||||
class FillBucket;
|
||||
class FillProgram;
|
||||
class FillPatternProgram;
|
||||
class FillOutlineProgram;
|
||||
class FillOutlinePatternProgram;
|
||||
|
||||
class RenderFillLayer final : public RenderLayer {
|
||||
public:
|
||||
@@ -31,6 +35,12 @@ private:
|
||||
|
||||
// Paint properties
|
||||
style::FillPaintProperties::Unevaluated unevaluated;
|
||||
|
||||
// Programs
|
||||
std::shared_ptr<FillProgram> fillProgram;
|
||||
std::shared_ptr<FillPatternProgram> fillPatternProgram;
|
||||
std::shared_ptr<FillOutlineProgram> fillOutlineProgram;
|
||||
std::shared_ptr<FillOutlinePatternProgram> fillOutlinePatternProgram;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -72,6 +72,9 @@ void RenderHeatmapLayer::render(PaintParameters& parameters) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!parameters.shaders.populate(heatmapProgram)) return;
|
||||
if (!parameters.shaders.populate(heatmapTextureProgram)) return;
|
||||
|
||||
if (parameters.pass == RenderPass::Pass3D) {
|
||||
const auto& viewportSize = parameters.staticData.backendSize;
|
||||
const auto size = Size{viewportSize.width / 4, viewportSize.height / 4};
|
||||
@@ -110,8 +113,6 @@ void RenderHeatmapLayer::render(PaintParameters& parameters) {
|
||||
|
||||
const auto& paintPropertyBinders = bucket.paintPropertyBinders.at(getID());
|
||||
|
||||
auto& programInstance = parameters.programs.getHeatmapLayerPrograms().heatmap;
|
||||
|
||||
const auto allUniformValues = HeatmapProgram::computeAllUniformValues(
|
||||
HeatmapProgram::LayoutUniformValues{
|
||||
uniforms::intensity::Value(evaluated.get<style::HeatmapIntensity>()),
|
||||
@@ -125,7 +126,7 @@ void RenderHeatmapLayer::render(PaintParameters& parameters) {
|
||||
|
||||
checkRenderability(parameters, HeatmapProgram::activeBindingCount(allAttributeBindings));
|
||||
|
||||
programInstance.draw(parameters.context,
|
||||
heatmapProgram->draw(parameters.context,
|
||||
*renderPass,
|
||||
gfx::Triangles(),
|
||||
gfx::DepthMode::disabled(),
|
||||
@@ -149,8 +150,6 @@ void RenderHeatmapLayer::render(PaintParameters& parameters) {
|
||||
const Properties<>::PossiblyEvaluated properties;
|
||||
const HeatmapTextureProgram::Binders paintAttributeData{ properties, 0 };
|
||||
|
||||
auto& programInstance = parameters.programs.getHeatmapLayerPrograms().heatmapTexture;
|
||||
|
||||
const auto allUniformValues = HeatmapTextureProgram::computeAllUniformValues(
|
||||
HeatmapTextureProgram::LayoutUniformValues{
|
||||
uniforms::matrix::Value(viewportMat),
|
||||
@@ -169,7 +168,7 @@ void RenderHeatmapLayer::render(PaintParameters& parameters) {
|
||||
// Copy over the segments so that we can create our own DrawScopes.
|
||||
segments = RenderStaticData::heatmapTextureSegments();
|
||||
}
|
||||
programInstance.draw(
|
||||
heatmapTextureProgram->draw(
|
||||
parameters.context,
|
||||
*parameters.renderPass,
|
||||
gfx::Triangles(),
|
||||
|
||||
@@ -39,6 +39,10 @@ private:
|
||||
std::unique_ptr<gfx::OffscreenTexture> renderTexture;
|
||||
std::optional<gfx::Texture> colorRampTexture;
|
||||
SegmentVector<HeatmapTextureAttributes> segments;
|
||||
|
||||
// Programs
|
||||
std::shared_ptr<HeatmapProgram> heatmapProgram;
|
||||
std::shared_ptr<HeatmapTextureProgram> heatmapTextureProgram;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -78,6 +78,10 @@ void RenderHillshadeLayer::render(PaintParameters& parameters) {
|
||||
assert(renderTiles);
|
||||
if (parameters.pass != RenderPass::Translucent && parameters.pass != RenderPass::Pass3D)
|
||||
return;
|
||||
|
||||
if (!parameters.shaders.populate(hillshadeProgram)) return;
|
||||
if (!parameters.shaders.populate(hillshadePrepareProgram)) return;
|
||||
|
||||
const auto& evaluated = static_cast<const HillshadeLayerProperties&>(*evaluatedProperties).evaluated;
|
||||
auto draw = [&] (const mat4& matrix,
|
||||
const auto& vertexBuffer,
|
||||
@@ -85,8 +89,6 @@ void RenderHillshadeLayer::render(PaintParameters& parameters) {
|
||||
const auto& segments,
|
||||
const UnwrappedTileID& id,
|
||||
const auto& textureBindings) {
|
||||
auto& programInstance = parameters.programs.getHillshadeLayerPrograms().hillshade;
|
||||
|
||||
const HillshadeProgram::Binders paintAttributeData{ evaluated, 0 };
|
||||
|
||||
const auto allUniformValues = HillshadeProgram::computeAllUniformValues(
|
||||
@@ -106,7 +108,7 @@ void RenderHillshadeLayer::render(PaintParameters& parameters) {
|
||||
|
||||
checkRenderability(parameters, HillshadeProgram::activeBindingCount(allAttributeBindings));
|
||||
|
||||
programInstance.draw(parameters.context,
|
||||
hillshadeProgram->draw(parameters.context,
|
||||
*parameters.renderPass,
|
||||
gfx::Triangles(),
|
||||
parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly),
|
||||
@@ -148,8 +150,6 @@ void RenderHillshadeLayer::render(PaintParameters& parameters) {
|
||||
|
||||
const Properties<>::PossiblyEvaluated properties;
|
||||
const HillshadePrepareProgram::Binders paintAttributeData{ properties, 0 };
|
||||
|
||||
auto& programInstance = parameters.programs.getHillshadeLayerPrograms().hillshadePrepare;
|
||||
|
||||
const auto allUniformValues = HillshadePrepareProgram::computeAllUniformValues(
|
||||
HillshadePrepareProgram::LayoutUniformValues{
|
||||
@@ -170,7 +170,7 @@ void RenderHillshadeLayer::render(PaintParameters& parameters) {
|
||||
// Copy over the segments so that we can create our own DrawScopes that get destroyed
|
||||
// after this draw call.
|
||||
auto segments = RenderStaticData::rasterSegments();
|
||||
programInstance.draw(parameters.context,
|
||||
hillshadePrepareProgram->draw(parameters.context,
|
||||
*renderPass,
|
||||
gfx::Triangles(),
|
||||
parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly),
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class HillshadeProgram;
|
||||
class HillshadePrepareProgram;
|
||||
|
||||
class RenderHillshadeLayer: public RenderLayer {
|
||||
public:
|
||||
explicit RenderHillshadeLayer(Immutable<style::HillshadeLayer::Impl>);
|
||||
@@ -27,6 +30,10 @@ private:
|
||||
|
||||
std::array<float, 2> getLatRange(const UnwrappedTileID& id);
|
||||
std::array<float, 2> getLight(const PaintParameters& parameters);
|
||||
|
||||
// Programs
|
||||
std::shared_ptr<HillshadeProgram> hillshadeProgram;
|
||||
std::shared_ptr<HillshadePrepareProgram> hillshadePrepareProgram;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -95,6 +95,11 @@ void RenderLineLayer::render(PaintParameters& parameters) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!parameters.shaders.populate(lineProgram)) return;
|
||||
if (!parameters.shaders.populate(lineGradientProgram)) return;
|
||||
if (!parameters.shaders.populate(lineSDFProgram)) return;
|
||||
if (!parameters.shaders.populate(linePatternProgram)) return;
|
||||
|
||||
parameters.renderTileClippingMasks(renderTiles);
|
||||
|
||||
for (const RenderTile& tile : *renderTiles) {
|
||||
@@ -148,7 +153,7 @@ void RenderLineLayer::render(PaintParameters& parameters) {
|
||||
const auto& dashPatternTexture = parameters.lineAtlas.getDashPatternTexture(
|
||||
evaluated.get<LineDasharray>().from, evaluated.get<LineDasharray>().to, cap);
|
||||
|
||||
draw(parameters.programs.getLineLayerPrograms().lineSDF,
|
||||
draw(*lineSDFProgram,
|
||||
LineSDFProgram::layoutUniformValues(evaluated,
|
||||
parameters.pixelRatio,
|
||||
tile,
|
||||
@@ -171,7 +176,7 @@ void RenderLineLayer::render(PaintParameters& parameters) {
|
||||
std::optional<ImagePosition> posA = tile.getPattern(linePatternValue.from.id());
|
||||
std::optional<ImagePosition> posB = tile.getPattern(linePatternValue.to.id());
|
||||
|
||||
draw(parameters.programs.getLineLayerPrograms().linePattern,
|
||||
draw(*linePatternProgram,
|
||||
LinePatternProgram::layoutUniformValues(
|
||||
evaluated,
|
||||
tile,
|
||||
@@ -188,7 +193,7 @@ void RenderLineLayer::render(PaintParameters& parameters) {
|
||||
} else if (!unevaluated.get<LineGradient>().getValue().isUndefined()) {
|
||||
assert(colorRampTexture);
|
||||
|
||||
draw(parameters.programs.getLineLayerPrograms().lineGradient,
|
||||
draw(*lineGradientProgram,
|
||||
LineGradientProgram::layoutUniformValues(
|
||||
evaluated,
|
||||
tile,
|
||||
@@ -201,7 +206,7 @@ void RenderLineLayer::render(PaintParameters& parameters) {
|
||||
textures::image::Value{ colorRampTexture->getResource(), gfx::TextureFilterType::Linear },
|
||||
});
|
||||
} else {
|
||||
draw(parameters.programs.getLineLayerPrograms().line,
|
||||
draw(*lineProgram,
|
||||
LineProgram::layoutUniformValues(
|
||||
evaluated,
|
||||
tile,
|
||||
|
||||
@@ -10,6 +10,11 @@
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class LineProgram;
|
||||
class LineGradientProgram;
|
||||
class LineSDFProgram;
|
||||
class LinePatternProgram;
|
||||
|
||||
class RenderLineLayer final : public RenderLayer {
|
||||
public:
|
||||
explicit RenderLineLayer(Immutable<style::LineLayer::Impl>);
|
||||
@@ -40,6 +45,12 @@ private:
|
||||
|
||||
PremultipliedImage colorRamp;
|
||||
std::optional<gfx::Texture> colorRampTexture;
|
||||
|
||||
// Programs
|
||||
std::shared_ptr<LineProgram> lineProgram;
|
||||
std::shared_ptr<LineGradientProgram> lineGradientProgram;
|
||||
std::shared_ptr<LineSDFProgram> lineSDFProgram;
|
||||
std::shared_ptr<LinePatternProgram> linePatternProgram;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -89,6 +89,9 @@ void RenderRasterLayer::render(PaintParameters& parameters) {
|
||||
if (parameters.pass != RenderPass::Translucent || (!renderTiles && !imageData)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!parameters.shaders.populate(rasterProgram)) return;
|
||||
|
||||
const auto& evaluated = static_cast<const RasterLayerProperties&>(*evaluatedProperties).evaluated;
|
||||
RasterProgram::Binders paintAttributeData{ evaluated, 0 };
|
||||
|
||||
@@ -98,8 +101,6 @@ void RenderRasterLayer::render(PaintParameters& parameters) {
|
||||
const auto& segments,
|
||||
const auto& textureBindings,
|
||||
const std::string& drawScopeID) {
|
||||
auto& programInstance = parameters.programs.getRasterLayerPrograms().raster;
|
||||
|
||||
const auto allUniformValues = RasterProgram::computeAllUniformValues(
|
||||
RasterProgram::LayoutUniformValues{
|
||||
uniforms::matrix::Value(matrix),
|
||||
@@ -122,7 +123,7 @@ void RenderRasterLayer::render(PaintParameters& parameters) {
|
||||
|
||||
checkRenderability(parameters, RasterProgram::activeBindingCount(allAttributeBindings));
|
||||
|
||||
programInstance.draw(
|
||||
rasterProgram->draw(
|
||||
parameters.context,
|
||||
*parameters.renderPass,
|
||||
gfx::Triangles(),
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
namespace mbgl {
|
||||
|
||||
class ImageSourceRenderData;
|
||||
class RasterProgram;
|
||||
|
||||
class RenderRasterLayer final : public RenderLayer {
|
||||
public:
|
||||
@@ -24,6 +25,9 @@ private:
|
||||
// Paint properties
|
||||
style::RasterPaintProperties::Unevaluated unevaluated;
|
||||
const ImageSourceRenderData* imageData = nullptr;
|
||||
|
||||
// Programs
|
||||
std::shared_ptr<RasterProgram> rasterProgram;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -105,7 +105,8 @@ struct RenderableSegment {
|
||||
};
|
||||
|
||||
template <typename DrawFn>
|
||||
void drawIcon(const DrawFn& draw,
|
||||
void drawIcon(const RenderSymbolLayer::Programs& programs,
|
||||
const DrawFn& draw,
|
||||
const RenderTile& tile,
|
||||
const LayerRenderData& renderData,
|
||||
SegmentsWrapper iconSegments,
|
||||
@@ -136,7 +137,7 @@ void drawIcon(const DrawFn& draw,
|
||||
|
||||
if (sdfIcons) {
|
||||
if (values.hasHalo) {
|
||||
draw(parameters.programs.getSymbolLayerPrograms().symbolIconSDF,
|
||||
draw(*programs.symbolSDFIconProgram,
|
||||
SymbolSDFIconProgram::layoutUniformValues(false, variablePlacedIcon, values, iconSize, parameters.pixelsToGLUnits, parameters.pixelRatio, alongLine, tile, parameters.state, parameters.symbolFadeChange, SymbolSDFPart::Halo),
|
||||
bucket.sdfIcon,
|
||||
iconSegments,
|
||||
@@ -150,7 +151,7 @@ void drawIcon(const DrawFn& draw,
|
||||
}
|
||||
|
||||
if (values.hasFill) {
|
||||
draw(parameters.programs.getSymbolLayerPrograms().symbolIconSDF,
|
||||
draw(*programs.symbolSDFIconProgram,
|
||||
SymbolSDFIconProgram::layoutUniformValues(false, variablePlacedIcon, values, iconSize, parameters.pixelsToGLUnits, parameters.pixelRatio, alongLine, tile, parameters.state, parameters.symbolFadeChange, SymbolSDFPart::Fill),
|
||||
bucket.sdfIcon,
|
||||
iconSegments,
|
||||
@@ -163,7 +164,7 @@ void drawIcon(const DrawFn& draw,
|
||||
"fill");
|
||||
}
|
||||
} else {
|
||||
draw(parameters.programs.getSymbolLayerPrograms().symbolIcon,
|
||||
draw(*programs.symbolIconProgram,
|
||||
SymbolIconProgram::layoutUniformValues(false, variablePlacedIcon, values, iconSize, parameters.pixelsToGLUnits, alongLine, tile, parameters.state, parameters.symbolFadeChange),
|
||||
bucket.icon,
|
||||
iconSegments,
|
||||
@@ -178,7 +179,8 @@ void drawIcon(const DrawFn& draw,
|
||||
}
|
||||
|
||||
template <typename DrawFn>
|
||||
void drawText(const DrawFn& draw,
|
||||
void drawText(const RenderSymbolLayer::Programs& programs,
|
||||
const DrawFn& draw,
|
||||
const RenderTile& tile,
|
||||
const LayerRenderData& renderData,
|
||||
SegmentsWrapper textSegments,
|
||||
@@ -221,7 +223,7 @@ void drawText(const DrawFn& draw,
|
||||
? gfx::TextureFilterType::Linear
|
||||
: gfx::TextureFilterType::Nearest};
|
||||
if (values.hasHalo) {
|
||||
drawGlyphs(parameters.programs.getSymbolLayerPrograms().symbolTextAndIcon,
|
||||
drawGlyphs(*programs.symbolTextAndIconProgram,
|
||||
SymbolTextAndIconProgram::layoutUniformValues(bucket.hasVariablePlacement,
|
||||
values,
|
||||
glyphTexSize,
|
||||
@@ -238,7 +240,7 @@ void drawText(const DrawFn& draw,
|
||||
}
|
||||
|
||||
if (values.hasFill) {
|
||||
drawGlyphs(parameters.programs.getSymbolLayerPrograms().symbolTextAndIcon,
|
||||
drawGlyphs(*programs.symbolTextAndIconProgram,
|
||||
SymbolTextAndIconProgram::layoutUniformValues(bucket.hasVariablePlacement,
|
||||
values,
|
||||
glyphTexSize,
|
||||
@@ -255,7 +257,7 @@ void drawText(const DrawFn& draw,
|
||||
}
|
||||
} else {
|
||||
if (values.hasHalo) {
|
||||
drawGlyphs(parameters.programs.getSymbolLayerPrograms().symbolGlyph,
|
||||
drawGlyphs(*programs.symbolSDFTextProgram,
|
||||
SymbolSDFTextProgram::layoutUniformValues(true,
|
||||
bucket.hasVariablePlacement,
|
||||
values,
|
||||
@@ -272,7 +274,7 @@ void drawText(const DrawFn& draw,
|
||||
}
|
||||
|
||||
if (values.hasFill) {
|
||||
drawGlyphs(parameters.programs.getSymbolLayerPrograms().symbolGlyph,
|
||||
drawGlyphs(*programs.symbolSDFTextProgram,
|
||||
SymbolSDFTextProgram::layoutUniformValues(true,
|
||||
bucket.hasVariablePlacement,
|
||||
values,
|
||||
@@ -346,6 +348,13 @@ void RenderSymbolLayer::render(PaintParameters& parameters) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!parameters.shaders.populate(programs.symbolIconProgram)) return;
|
||||
if (!parameters.shaders.populate(programs.symbolSDFIconProgram)) return;
|
||||
if (!parameters.shaders.populate(programs.symbolSDFTextProgram)) return;
|
||||
if (!parameters.shaders.populate(programs.symbolTextAndIconProgram)) return;
|
||||
if (!parameters.shaders.populate(programs.collisionBoxProgram)) return;
|
||||
if (!parameters.shaders.populate(programs.collisionCircleProgram)) return;
|
||||
|
||||
const bool sortFeaturesByKey = !impl_cast(baseImpl).layout.get<SymbolSortKey>().isUndefined();
|
||||
std::multiset<RenderableSegment> renderableSegments;
|
||||
|
||||
@@ -437,7 +446,7 @@ void RenderSymbolLayer::render(PaintParameters& parameters) {
|
||||
if (sortFeaturesByKey) {
|
||||
addRenderables(bucket.icon.segments, SymbolType::IconRGBA);
|
||||
} else {
|
||||
drawIcon(draw, tile, *renderData, std::ref(bucket.icon.segments), bucketPaintProperties, parameters, false /*sdfIcon*/);
|
||||
drawIcon(programs, draw, tile, *renderData, std::ref(bucket.icon.segments), bucketPaintProperties, parameters, false /*sdfIcon*/);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,7 +454,7 @@ void RenderSymbolLayer::render(PaintParameters& parameters) {
|
||||
if (sortFeaturesByKey) {
|
||||
addRenderables(bucket.sdfIcon.segments, SymbolType::IconSDF);
|
||||
} else {
|
||||
drawIcon(draw, tile, *renderData, std::ref(bucket.sdfIcon.segments), bucketPaintProperties, parameters, true /*sdfIcon*/);
|
||||
drawIcon(programs, draw, tile, *renderData, std::ref(bucket.sdfIcon.segments), bucketPaintProperties, parameters, true /*sdfIcon*/);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,7 +462,7 @@ void RenderSymbolLayer::render(PaintParameters& parameters) {
|
||||
if (sortFeaturesByKey) {
|
||||
addRenderables(bucket.text.segments, SymbolType::Text);
|
||||
} else {
|
||||
drawText(draw, tile, *renderData, std::ref(bucket.text.segments), bucketPaintProperties, parameters);
|
||||
drawText(programs, draw, tile, *renderData, std::ref(bucket.text.segments), bucketPaintProperties, parameters);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -476,7 +485,7 @@ void RenderSymbolLayer::render(PaintParameters& parameters) {
|
||||
|
||||
if (hasCollisionBox) {
|
||||
const auto& collisionBox = isText ? bucket.textCollisionBox : bucket.iconCollisionBox;
|
||||
parameters.programs.getSymbolLayerPrograms().collisionBox.draw(
|
||||
programs.collisionBoxProgram->draw(
|
||||
parameters.context,
|
||||
*parameters.renderPass,
|
||||
gfx::Lines{ 1.0f },
|
||||
@@ -503,7 +512,7 @@ void RenderSymbolLayer::render(PaintParameters& parameters) {
|
||||
}
|
||||
if (hasCollisionCircle) {
|
||||
const auto& collisionCircle = isText ? bucket.textCollisionCircle : bucket.iconCollisionCircle;
|
||||
parameters.programs.getSymbolLayerPrograms().collisionCircle.draw(
|
||||
programs.collisionCircleProgram->draw(
|
||||
parameters.context,
|
||||
*parameters.renderPass,
|
||||
gfx::Triangles(),
|
||||
@@ -537,9 +546,9 @@ void RenderSymbolLayer::render(PaintParameters& parameters) {
|
||||
if (sortFeaturesByKey) {
|
||||
for (auto& renderable : renderableSegments) {
|
||||
if (renderable.type == SymbolType::Text) {
|
||||
drawText(draw, renderable.tile, renderable.renderData, renderable.segment, renderable.bucketPaintProperties, parameters);
|
||||
drawText(programs, draw, renderable.tile, renderable.renderData, renderable.segment, renderable.bucketPaintProperties, parameters);
|
||||
} else {
|
||||
drawIcon(draw, renderable.tile, renderable.renderData, renderable.segment, renderable.bucketPaintProperties, parameters, renderable.type == SymbolType::IconSDF);
|
||||
drawIcon(programs, draw, renderable.tile, renderable.renderData, renderable.segment, renderable.bucketPaintProperties, parameters, renderable.type == SymbolType::IconSDF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,24 @@ enum class SymbolType : uint8_t {
|
||||
|
||||
} // namespace style
|
||||
|
||||
class SymbolIconProgram;
|
||||
class SymbolSDFIconProgram;
|
||||
class SymbolSDFTextProgram;
|
||||
class SymbolTextAndIconProgram;
|
||||
class CollisionBoxProgram;
|
||||
class CollisionCircleProgram;
|
||||
|
||||
class RenderSymbolLayer final: public RenderLayer {
|
||||
public:
|
||||
struct Programs {
|
||||
std::shared_ptr<SymbolIconProgram> symbolIconProgram;
|
||||
std::shared_ptr<SymbolSDFIconProgram> symbolSDFIconProgram;
|
||||
std::shared_ptr<SymbolSDFTextProgram> symbolSDFTextProgram;
|
||||
std::shared_ptr<SymbolTextAndIconProgram> symbolTextAndIconProgram;
|
||||
std::shared_ptr<CollisionBoxProgram> collisionBoxProgram;
|
||||
std::shared_ptr<CollisionCircleProgram> collisionCircleProgram;
|
||||
};
|
||||
|
||||
public:
|
||||
explicit RenderSymbolLayer(Immutable<style::SymbolLayer::Impl>);
|
||||
~RenderSymbolLayer() override;
|
||||
@@ -81,6 +98,9 @@ private:
|
||||
float textSize = 16.0f;
|
||||
|
||||
bool hasFormatSectionOverrides = false;
|
||||
|
||||
// Programs
|
||||
Programs programs;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -122,7 +122,11 @@ void PaintParameters::renderTileClippingMasks(const RenderTiles& renderTiles) {
|
||||
|
||||
tileClippingMaskIDs.clear();
|
||||
|
||||
auto& program = staticData.programs.clippingMask;
|
||||
auto program = staticData.shaders->get<ClippingMaskProgram>();
|
||||
if (!program) {
|
||||
return;
|
||||
}
|
||||
|
||||
const style::Properties<>::PossiblyEvaluated properties {};
|
||||
const ClippingMaskProgram::Binders paintAttributeData(properties, 0);
|
||||
|
||||
@@ -130,7 +134,7 @@ void PaintParameters::renderTileClippingMasks(const RenderTiles& renderTiles) {
|
||||
const int32_t stencilID = nextStencilID++;
|
||||
tileClippingMaskIDs.emplace(renderTile.id, stencilID);
|
||||
|
||||
program.draw(context,
|
||||
program->draw(context,
|
||||
*renderPass,
|
||||
gfx::Triangles(),
|
||||
gfx::DepthMode::disabled(),
|
||||
|
||||
@@ -49,14 +49,14 @@ static gfx::VertexVector<HeatmapTextureLayoutVertex> heatmapTextureVertices() {
|
||||
return result;
|
||||
}
|
||||
|
||||
RenderStaticData::RenderStaticData(gfx::Context& context, float pixelRatio,
|
||||
RenderStaticData::RenderStaticData(float pixelRatio,
|
||||
std::unique_ptr<gfx::ShaderRegistry>&& shaders_)
|
||||
: programs(context, ProgramParameters{pixelRatio, false}),
|
||||
: programs(ProgramParameters{pixelRatio, false}),
|
||||
shaders(std::move(shaders_)),
|
||||
clippingMaskSegments(tileTriangleSegments())
|
||||
#ifndef NDEBUG
|
||||
,
|
||||
overdrawPrograms(context, ProgramParameters{pixelRatio, true})
|
||||
overdrawPrograms(ProgramParameters{pixelRatio, true})
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
@@ -20,8 +20,7 @@ class UploadPass;
|
||||
|
||||
class RenderStaticData {
|
||||
public:
|
||||
RenderStaticData(gfx::Context&, float pixelRatio,
|
||||
std::unique_ptr<gfx::ShaderRegistry>&& shaders_);
|
||||
RenderStaticData(float pixelRatio, std::unique_ptr<gfx::ShaderRegistry>&& shaders_);
|
||||
|
||||
void upload(gfx::UploadPass&);
|
||||
|
||||
|
||||
@@ -134,14 +134,17 @@ void RenderTile::finishRender(PaintParameters& parameters) const {
|
||||
static const style::Properties<>::PossiblyEvaluated properties {};
|
||||
static const DebugProgram::Binders paintAttributeData(properties, 0);
|
||||
|
||||
auto& program = parameters.programs.debug;
|
||||
auto program = parameters.shaders.get<DebugProgram>();
|
||||
if (!program) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (parameters.debugOptions & (MapDebugOptions::Timestamps | MapDebugOptions::ParseStatus)) {
|
||||
assert(debugBucket);
|
||||
const auto allAttributeBindings =
|
||||
DebugProgram::computeAllAttributeBindings(*debugBucket->vertexBuffer, paintAttributeData, properties);
|
||||
|
||||
program.draw(parameters.context,
|
||||
program->draw(parameters.context,
|
||||
*parameters.renderPass,
|
||||
gfx::Lines{4.0f * parameters.pixelRatio},
|
||||
gfx::DepthMode::disabled(),
|
||||
@@ -161,7 +164,7 @@ void RenderTile::finishRender(PaintParameters& parameters) const {
|
||||
DebugProgram::TextureBindings{textures::image::Value{debugBucket->texture->getResource()}},
|
||||
"text-outline");
|
||||
|
||||
program.draw(parameters.context,
|
||||
program->draw(parameters.context,
|
||||
*parameters.renderPass,
|
||||
gfx::Lines{2.0f * parameters.pixelRatio},
|
||||
gfx::DepthMode::disabled(),
|
||||
@@ -187,7 +190,7 @@ void RenderTile::finishRender(PaintParameters& parameters) const {
|
||||
if (debugBucket->tileBorderSegments.empty()) {
|
||||
debugBucket->tileBorderSegments = RenderStaticData::tileBorderSegments();
|
||||
}
|
||||
parameters.programs.debug.draw(
|
||||
program->draw(
|
||||
parameters.context,
|
||||
*parameters.renderPass,
|
||||
gfx::LineStrip{4.0f * parameters.pixelRatio},
|
||||
|
||||
@@ -48,7 +48,7 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
|
||||
const auto& renderTreeParameters = renderTree.getParameters();
|
||||
|
||||
if (!staticData) {
|
||||
staticData = std::make_unique<RenderStaticData>(backend.getContext(), pixelRatio,
|
||||
staticData = std::make_unique<RenderStaticData>(pixelRatio,
|
||||
std::make_unique<gfx::ShaderRegistry>());
|
||||
staticData->programs.registerWith(*staticData->shaders);
|
||||
observer->onRegisterShaders(*staticData->shaders);
|
||||
|
||||
@@ -39,10 +39,13 @@ void ImageSourceRenderData::render(PaintParameters& parameters) const {
|
||||
static const style::Properties<>::PossiblyEvaluated properties {};
|
||||
static const DebugProgram::Binders paintAttributeData(properties, 0);
|
||||
|
||||
auto& programInstance = parameters.programs.debug;
|
||||
auto programInstance = parameters.shaders.get<DebugProgram>();
|
||||
if (!programInstance) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto matrix : matrices) {
|
||||
programInstance.draw(parameters.context,
|
||||
programInstance->draw(parameters.context,
|
||||
*parameters.renderPass,
|
||||
gfx::LineStrip{4.0f * parameters.pixelRatio},
|
||||
gfx::DepthMode::disabled(),
|
||||
|
||||
BIN
test/fixtures/shader_registry/glsl_replace_1/expected.png
vendored
Normal file
BIN
test/fixtures/shader_registry/glsl_replace_1/expected.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
test/fixtures/shader_registry/glsl_replace_2/expected.png
vendored
Normal file
BIN
test/fixtures/shader_registry/glsl_replace_2/expected.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
test/fixtures/shader_registry/glsl_replace_noop/expected.png
vendored
Normal file
BIN
test/fixtures/shader_registry/glsl_replace_noop/expected.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -5,11 +5,64 @@
|
||||
|
||||
#include <string_view>
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
|
||||
#include <mbgl/storage/resource_options.hpp>
|
||||
#include <mbgl/map/map_snapshotter.hpp>
|
||||
#include <mbgl/style/layers/fill_layer.hpp>
|
||||
#include <mbgl/style/image_impl.hpp>
|
||||
#include <mbgl/style/style.hpp>
|
||||
#include <mbgl/util/io.hpp>
|
||||
#include <mbgl/util/image.hpp>
|
||||
#include <mbgl/util/run_loop.hpp>
|
||||
#include <mbgl/util/string.hpp>
|
||||
#include <mbgl/util/color.hpp>
|
||||
#include <mbgl/storage/main_resource_loader.hpp>
|
||||
#include <mbgl/gfx/backend_scope.hpp>
|
||||
#include <mbgl/gfx/headless_frontend.hpp>
|
||||
#include <mbgl/test/map_adapter.hpp>
|
||||
#include <mbgl/programs/fill_program.hpp>
|
||||
|
||||
using namespace mbgl;
|
||||
|
||||
namespace {
|
||||
|
||||
class MapInstance {
|
||||
public:
|
||||
class ShaderAndStyleObserver : public MapObserver {
|
||||
public:
|
||||
public:
|
||||
void onDidFinishLoadingStyle() override {
|
||||
styleLoaded();
|
||||
}
|
||||
|
||||
void onRegisterShaders(gfx::ShaderRegistry& registry) override {
|
||||
registerShaders(registry);
|
||||
};
|
||||
|
||||
std::function<void()> styleLoaded;
|
||||
std::function<void(gfx::ShaderRegistry&)> registerShaders;
|
||||
};
|
||||
|
||||
MapInstance(float pixelRatio, MapObserver& observer) :
|
||||
frontend(pixelRatio),
|
||||
adapter(frontend, observer, std::make_shared<MainResourceLoader>(
|
||||
ResourceOptions()
|
||||
.withCachePath(":memory:")
|
||||
.withAssetPath("test/fixtures/api/assets"),
|
||||
ClientOptions()
|
||||
),
|
||||
MapOptions()
|
||||
.withMapMode(MapMode::Static)
|
||||
.withSize(frontend.getSize())
|
||||
.withPixelRatio(pixelRatio))
|
||||
{}
|
||||
|
||||
public:
|
||||
HeadlessFrontend frontend;
|
||||
MapAdapter adapter;
|
||||
};
|
||||
|
||||
template<uint32_t token_value>
|
||||
class StubProgramBase : public gfx::Shader {
|
||||
public:
|
||||
@@ -111,3 +164,132 @@ TEST(ShaderRegistry, ShaderRTTI) {
|
||||
ASSERT_EQ(asBase->to<StubProgram_1>(), &program1);
|
||||
ASSERT_EQ(asBase->to<StubProgram_2>(), nullptr);
|
||||
}
|
||||
|
||||
// Test replacing an actual program instance with a similar instance
|
||||
TEST(ShaderRegistry, GLSLReplacement_NoOp) {
|
||||
MapInstance::ShaderAndStyleObserver observer;
|
||||
util::RunLoop runLoop;
|
||||
auto map = MapInstance(1.0f, observer);
|
||||
|
||||
// Just replace with a default instance
|
||||
observer.registerShaders = [&](gfx::ShaderRegistry& registry) {
|
||||
if (!registry.replaceShader(std::make_shared<FillProgram>(
|
||||
ProgramParameters(1.0f, false))))
|
||||
{
|
||||
throw std::runtime_error("Failed to register shader!");
|
||||
}
|
||||
};
|
||||
|
||||
observer.styleLoaded = [&] {
|
||||
auto fillLayer = std::make_unique<style::FillLayer>("green_fill", "mapbox");
|
||||
fillLayer->setSourceLayer("water");
|
||||
fillLayer->setFillColor(Color(0.25f, 0.88f, 0.82f, 1.0f));
|
||||
map.adapter.getStyle().addLayer(std::move(fillLayer));
|
||||
};
|
||||
|
||||
map.adapter.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json"));
|
||||
auto img = map.frontend.render(map.adapter).image;
|
||||
test::checkImage("test/fixtures/shader_registry/glsl_replace_noop", img, 0.005, 0.1);
|
||||
}
|
||||
|
||||
// Test replacing an actual program with a similar instance using a different fragment
|
||||
// shader
|
||||
TEST(ShaderRegistry, GLSLReplacement1) {
|
||||
MapInstance::ShaderAndStyleObserver observer;
|
||||
util::RunLoop runLoop;
|
||||
auto map = MapInstance(1.0f, observer);
|
||||
|
||||
// Replace with an instance that only renders blue
|
||||
observer.registerShaders = [&](gfx::ShaderRegistry& registry) {
|
||||
if (!registry.replaceShader(std::make_shared<FillProgram>(
|
||||
ProgramParameters(1.0f, false).withShaderSource(
|
||||
ProgramParameters::ProgramSource(
|
||||
gfx::Backend::Type::OpenGL,
|
||||
"",
|
||||
R"(
|
||||
void main() {
|
||||
gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);
|
||||
}
|
||||
)"
|
||||
)
|
||||
)
|
||||
)))
|
||||
{
|
||||
throw std::runtime_error("Failed to register shader!");
|
||||
}
|
||||
};
|
||||
|
||||
observer.styleLoaded = [&] {
|
||||
auto fillLayer = std::make_unique<style::FillLayer>("green_fill", "mapbox");
|
||||
fillLayer->setSourceLayer("water");
|
||||
fillLayer->setFillColor(Color(0.25f, 0.88f, 0.82f, 1.0f));
|
||||
map.adapter.getStyle().addLayer(std::move(fillLayer));
|
||||
};
|
||||
|
||||
map.adapter.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json"));
|
||||
auto img = map.frontend.render(map.adapter).image;
|
||||
test::checkImage("test/fixtures/shader_registry/glsl_replace_1", img, 0.005, 0.1);
|
||||
}
|
||||
|
||||
// Test replacing an actual program with a similar instance using a different fragment
|
||||
// shader
|
||||
TEST(ShaderRegistry, GLSLReplacement2) {
|
||||
MapInstance::ShaderAndStyleObserver observer;
|
||||
util::RunLoop runLoop;
|
||||
auto map = MapInstance(1.0f, observer);
|
||||
|
||||
// Replace with an instance that adds some red and green
|
||||
observer.registerShaders = [&](gfx::ShaderRegistry& registry) {
|
||||
if (!registry.replaceShader(std::make_shared<FillProgram>(
|
||||
ProgramParameters(1.0f, false).withShaderSource(
|
||||
ProgramParameters::ProgramSource(
|
||||
gfx::Backend::Type::OpenGL,
|
||||
"",
|
||||
R"(
|
||||
#ifndef HAS_UNIFORM_u_color
|
||||
varying highp vec4 color;
|
||||
#else
|
||||
uniform highp vec4 u_color;
|
||||
#endif
|
||||
|
||||
#ifndef HAS_UNIFORM_u_opacity
|
||||
varying lowp float opacity;
|
||||
#else
|
||||
uniform lowp float u_opacity;
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
#ifdef HAS_UNIFORM_u_color
|
||||
highp vec4 color = u_color;
|
||||
#endif
|
||||
#ifdef HAS_UNIFORM_u_opacity
|
||||
lowp float opacity = u_opacity;
|
||||
#endif
|
||||
|
||||
gl_FragColor = mix(color * opacity,
|
||||
vec4(0.3, 0.5, 0.0, 1.0), 0.5);
|
||||
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
gl_FragColor = vec4(1.0);
|
||||
#endif
|
||||
}
|
||||
)"
|
||||
)
|
||||
)
|
||||
)))
|
||||
{
|
||||
throw std::runtime_error("Failed to register shader!");
|
||||
}
|
||||
};
|
||||
|
||||
observer.styleLoaded = [&] {
|
||||
auto fillLayer = std::make_unique<style::FillLayer>("green_fill", "mapbox");
|
||||
fillLayer->setSourceLayer("water");
|
||||
fillLayer->setFillColor(Color(0.25f, 0.88f, 0.82f, 1.0f));
|
||||
map.adapter.getStyle().addLayer(std::move(fillLayer));
|
||||
};
|
||||
|
||||
map.adapter.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json"));
|
||||
auto img = map.frontend.render(map.adapter).image;
|
||||
test::checkImage("test/fixtures/shader_registry/glsl_replace_2", img, 0.005, 0.1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user