From 8264a1c86b4af4754d6545e2f6d34256e65c7cc4 Mon Sep 17 00:00:00 2001 From: Alex Cristici Date: Tue, 16 Apr 2024 20:04:06 +0300 Subject: [PATCH] Fill outline triangulated reorganized (#2266) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- CMakeLists.txt | 11 +- bazel/core.bzl | 4 +- include/mbgl/shaders/fill_layer_ubo.hpp | 25 ++++ ...=> drawable_fill_outline_triangulated.hpp} | 19 +-- include/mbgl/shaders/gl/shader_info.hpp | 14 +- include/mbgl/shaders/line_layer_ubo.hpp | 25 ---- include/mbgl/shaders/mtl/common.hpp | 14 -- include/mbgl/shaders/mtl/fill.hpp | 92 ++++++++++++ include/mbgl/shaders/mtl/line.hpp | 79 ----------- include/mbgl/shaders/shader_defines.hpp | 2 +- include/mbgl/shaders/shader_manifest.hpp | 10 +- include/mbgl/shaders/shader_source.hpp | 10 +- ...e.fill_outline_triangulated.fragment.glsl} | 10 +- ...ble.fill_outline_triangulated.vertex.glsl} | 5 +- shaders/manifest.json | 70 +++++----- src/mbgl/gl/renderer_backend.cpp | 12 +- src/mbgl/mtl/renderer_backend.cpp | 4 +- .../renderer/layers/fill_layer_tweaker.cpp | 27 ++++ .../renderer/layers/fill_layer_tweaker.hpp | 2 + .../renderer/layers/render_fill_layer.cpp | 132 +----------------- .../renderer/layers/render_fill_layer.hpp | 11 +- src/mbgl/shaders/gl/shader_info.cpp | 25 ++-- src/mbgl/shaders/mtl/fill.cpp | 14 ++ src/mbgl/shaders/mtl/line.cpp | 10 -- test/util/hash.test.cpp | 10 +- 25 files changed, 264 insertions(+), 373 deletions(-) rename include/mbgl/shaders/gl/{drawable_line_basic.hpp => drawable_fill_outline_triangulated.hpp} (89%) rename shaders/{drawable.line_basic.fragment.glsl => drawable.fill_outline_triangulated.fragment.glsl} (78%) rename shaders/{drawable.line_basic.vertex.glsl => drawable.fill_outline_triangulated.vertex.glsl} (94%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c8fedabe..1b288860c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1025,18 +1025,19 @@ if(MLN_WITH_OPENGL) ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_debug.hpp ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_fill.hpp ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_fill_outline.hpp - ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_line.hpp - ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_line_gradient.hpp - ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_line_pattern.hpp - ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_line_sdf.hpp - ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_fill_outline_pattern.hpp ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_fill_pattern.hpp + ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_fill_outline_pattern.hpp + ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_fill_outline_triangulated.hpp ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_fill_extrusion.hpp ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_fill_extrusion_pattern.hpp ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_heatmap.hpp ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_heatmap_texture.hpp ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_hillshade_prepare.hpp ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_hillshade.hpp + ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_line.hpp + ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_line_gradient.hpp + ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_line_pattern.hpp + ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_line_sdf.hpp ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_raster.hpp ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_symbol_icon.hpp ${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_symbol_sdf.hpp diff --git a/bazel/core.bzl b/bazel/core.bzl index d43ff79c3..b9c36f306 100644 --- a/bazel/core.bzl +++ b/bazel/core.bzl @@ -71,10 +71,11 @@ MLN_GENERATED_OPENGL_SHADER_HEADERS = [ "include/mbgl/shaders/gl/drawable_debug.hpp", "include/mbgl/shaders/gl/drawable_fill.hpp", "include/mbgl/shaders/gl/drawable_fill_outline.hpp", + "include/mbgl/shaders/gl/drawable_fill_pattern.hpp", "include/mbgl/shaders/gl/drawable_fill_outline_pattern.hpp", + "include/mbgl/shaders/gl/drawable_fill_outline_triangulated.hpp", "include/mbgl/shaders/gl/drawable_fill_extrusion.hpp", "include/mbgl/shaders/gl/drawable_fill_extrusion_pattern.hpp", - "include/mbgl/shaders/gl/drawable_fill_pattern.hpp", "include/mbgl/shaders/gl/drawable_heatmap.hpp", "include/mbgl/shaders/gl/drawable_heatmap_texture.hpp", "include/mbgl/shaders/gl/drawable_hillshade_prepare.hpp", @@ -83,7 +84,6 @@ MLN_GENERATED_OPENGL_SHADER_HEADERS = [ "include/mbgl/shaders/gl/drawable_line_pattern.hpp", "include/mbgl/shaders/gl/drawable_line_sdf.hpp", "include/mbgl/shaders/gl/drawable_line.hpp", - "include/mbgl/shaders/gl/drawable_line_basic.hpp", "include/mbgl/shaders/gl/drawable_raster.hpp", "include/mbgl/shaders/gl/drawable_symbol_icon.hpp", "include/mbgl/shaders/gl/drawable_symbol_sdf.hpp", diff --git a/include/mbgl/shaders/fill_layer_ubo.hpp b/include/mbgl/shaders/fill_layer_ubo.hpp index 1959a401b..fd24f726d 100644 --- a/include/mbgl/shaders/fill_layer_ubo.hpp +++ b/include/mbgl/shaders/fill_layer_ubo.hpp @@ -151,5 +151,30 @@ enum { fillOutlinePatternUBOCount }; +// +// Fill outline triangulated + +struct alignas(16) FillOutlineTriangulatedDrawableUBO { + std::array matrix; + std::array units_to_pixels; + float ratio; + float pad; +}; +static_assert(sizeof(FillOutlineTriangulatedDrawableUBO) % 16 == 0); + +struct alignas(16) FillOutlineTriangulatedPropertiesUBO { + Color color; + float opacity; + float width; + float pad1, pad2; +}; +static_assert(sizeof(FillOutlineTriangulatedPropertiesUBO) % 16 == 0); + +enum { + idFillOutlineTriangulatedDrawableUBO, + idFillOutlineTriangulatedPropertiesUBO, + fillOutlineTriangulatedUBOCount +}; + } // namespace shaders } // namespace mbgl diff --git a/include/mbgl/shaders/gl/drawable_line_basic.hpp b/include/mbgl/shaders/gl/drawable_fill_outline_triangulated.hpp similarity index 89% rename from include/mbgl/shaders/gl/drawable_line_basic.hpp rename to include/mbgl/shaders/gl/drawable_fill_outline_triangulated.hpp index acdbef93c..1249da30a 100644 --- a/include/mbgl/shaders/gl/drawable_line_basic.hpp +++ b/include/mbgl/shaders/gl/drawable_fill_outline_triangulated.hpp @@ -6,8 +6,8 @@ namespace mbgl { namespace shaders { template <> -struct ShaderSource { - static constexpr const char* name = "LineBasicShader"; +struct ShaderSource { + static constexpr const char* name = "FillOutlineTriangulatedShader"; 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 @@ -19,18 +19,17 @@ struct ShaderSource { layout (location = 0) in vec2 a_pos_normal; layout (location = 1) in vec4 a_data; -layout (std140) uniform LineBasicUBO { +layout (std140) uniform FillOutlineTriangulatedDrawableUBO { highp mat4 u_matrix; highp vec2 u_units_to_pixels; mediump float u_ratio; lowp float pad0; }; -layout (std140) uniform LineBasicPropertiesUBO { +layout (std140) uniform FillOutlineTriangulatedPropertiesUBO { highp vec4 u_color; lowp float u_opacity; mediump float u_width; - highp vec2 pad1; }; @@ -77,18 +76,10 @@ void main() { v_width = outset; } )"; - static constexpr const char* fragment = R"(layout (std140) uniform LineBasicUBO { - highp mat4 u_matrix; - highp vec2 u_units_to_pixels; - mediump float u_ratio; - lowp float pad0; -}; - -layout (std140) uniform LineBasicPropertiesUBO { + static constexpr const char* fragment = R"(layout (std140) uniform FillOutlineTriangulatedPropertiesUBO { highp vec4 u_color; lowp float u_opacity; mediump float u_width; - highp vec2 pad1; }; diff --git a/include/mbgl/shaders/gl/shader_info.hpp b/include/mbgl/shaders/gl/shader_info.hpp index e43174980..2d62f3124 100644 --- a/include/mbgl/shaders/gl/shader_info.hpp +++ b/include/mbgl/shaders/gl/shader_info.hpp @@ -107,6 +107,13 @@ struct ShaderInfo static const std::vector textures; }; +template <> +struct ShaderInfo { + static const std::vector attributes; + static const std::vector uniformBlocks; + static const std::vector textures; +}; + template <> struct ShaderInfo { static const std::vector attributes; @@ -177,13 +184,6 @@ struct ShaderInfo { static const std::vector textures; }; -template <> -struct ShaderInfo { - static const std::vector attributes; - static const std::vector uniformBlocks; - static const std::vector textures; -}; - template <> struct ShaderInfo { static const std::vector attributes; diff --git a/include/mbgl/shaders/line_layer_ubo.hpp b/include/mbgl/shaders/line_layer_ubo.hpp index 152daa5a5..c8c12baaa 100644 --- a/include/mbgl/shaders/line_layer_ubo.hpp +++ b/include/mbgl/shaders/line_layer_ubo.hpp @@ -182,30 +182,5 @@ enum { lineSDFUBOCount }; -// -// Line basic - -struct alignas(16) LineBasicUBO { - std::array matrix; - std::array units_to_pixels; - float ratio; - float pad; -}; -static_assert(sizeof(LineBasicUBO) % 16 == 0); - -struct alignas(16) LineBasicPropertiesUBO { - Color color; - float opacity; - float width; - float pad1, pad2; -}; -static_assert(sizeof(LineBasicPropertiesUBO) % 16 == 0); - -enum { - idLineBasicUBO, - idLineBasicPropertiesUBO, - lineBasicUBOCount -}; - } // namespace shaders } // namespace mbgl diff --git a/include/mbgl/shaders/mtl/common.hpp b/include/mbgl/shaders/mtl/common.hpp index 0f33b5b61..39d655b14 100644 --- a/include/mbgl/shaders/mtl/common.hpp +++ b/include/mbgl/shaders/mtl/common.hpp @@ -65,13 +65,6 @@ struct alignas(16) LineUBO { float pad1, pad2, pad3; }; -struct alignas(16) LineBasicUBO { - float4x4 matrix; - float2 units_to_pixels; - float ratio; - float pad; -}; - struct alignas(16) LineGradientUBO { float4x4 matrix; float ratio; @@ -88,13 +81,6 @@ struct alignas(16) LinePropertiesUBO { float pad1, pad2, pad3; }; -struct alignas(16) LineBasicPropertiesUBO { - float4 color; - float opacity; - float width; - float pad1, pad2; -}; - struct alignas(16) LineGradientPropertiesUBO { float blur; float opacity; diff --git a/include/mbgl/shaders/mtl/fill.hpp b/include/mbgl/shaders/mtl/fill.hpp index 1951457b8..1cc80fa0f 100644 --- a/include/mbgl/shaders/mtl/fill.hpp +++ b/include/mbgl/shaders/mtl/fill.hpp @@ -518,5 +518,97 @@ half4 fragment fragmentMain(FragmentStage in [[stage_in]], )"; }; +template <> +struct ShaderSource { + static constexpr auto name = "FillOutlineTriangulatedShader"; + static constexpr auto vertexMainFunction = "vertexMain"; + static constexpr auto fragmentMainFunction = "fragmentMain"; + + static const std::array attributes; + static constexpr std::array instanceAttributes{}; + static const std::array uniforms; + static const std::array textures; + + static constexpr auto source = R"( +struct VertexStage { + short2 pos_normal [[attribute(0)]]; + uchar4 data [[attribute(1)]]; +}; + +struct FragmentStage { + float4 position [[position, invariant]]; + float width2; + float2 normal; + half gamma_scale; +}; + +struct alignas(16) FillOutlineTriangulatedDrawableUBO { + float4x4 matrix; + float2 units_to_pixels; + float ratio; + float pad; +}; + +struct alignas(16) FillOutlineTriangulatedPropertiesUBO { + float4 color; + float opacity; + float width; + float pad1, pad2; +}; + +FragmentStage vertex vertexMain(thread const VertexStage vertx [[stage_in]], + device const FillOutlineTriangulatedDrawableUBO& drawable [[buffer(2)]], + device const FillOutlineTriangulatedPropertiesUBO& props [[buffer(3)]]) { + + // the distance over which the line edge fades out. + // Retina devices need a smaller distance to avoid aliasing. + const float ANTIALIASING = 1.0 / DEVICE_PIXEL_RATIO / 2.0; + + const float2 a_extrude = float2(vertx.data.xy) - 128.0; + const float2 pos = floor(float2(vertx.pos_normal) * 0.5); + + // x is 1 if it's a round cap, 0 otherwise + // y is 1 if the normal points up, and -1 if it points down + // We store these in the least significant bit of a_pos_normal + const float2 normal = float2(vertx.pos_normal) - 2.0 * pos; + const float2 v_normal = float2(normal.x, normal.y * 2.0 - 1.0); + + const float halfwidth = props.width / 2.0; + const float outset = halfwidth + (halfwidth == 0.0 ? 0.0 : ANTIALIASING); + + // Scale the extrusion vector down to a normal and then up by the line width of this vertex. + const float2 dist = outset * a_extrude * LINE_NORMAL_SCALE; + + const float4 projected_extrude = drawable.matrix * float4(dist / drawable.ratio, 0.0, 0.0); + const float4 position = drawable.matrix * float4(pos, 0.0, 1.0) + projected_extrude; + + // calculate how much the perspective view squishes or stretches the extrude + const float extrude_length_without_perspective = length(dist); + const float extrude_length_with_perspective = length(projected_extrude.xy / position.w * drawable.units_to_pixels); + + return { + .position = position, + .width2 = outset, + .normal = v_normal, + .gamma_scale = half(extrude_length_without_perspective / extrude_length_with_perspective), + }; +} + +half4 fragment fragmentMain(FragmentStage in [[stage_in]], + device const FillOutlineTriangulatedPropertiesUBO& props [[buffer(3)]]) { + + // Calculate the distance of the pixel from the line in pixels. + const float dist = length(in.normal) * in.width2; + + // Calculate the antialiasing fade factor. This is either when fading in the + // line in case of an offset line (`v_width2.y`) or when fading out (`v_width2.x`) + const float blur2 = (1.0 / DEVICE_PIXEL_RATIO) * in.gamma_scale; + const float alpha = clamp(min(dist + blur2, in.width2 - dist) / blur2, 0.0, 1.0); + + return half4(props.color * (alpha * props.opacity)); +} +)"; +}; + } // namespace shaders } // namespace mbgl diff --git a/include/mbgl/shaders/mtl/line.hpp b/include/mbgl/shaders/mtl/line.hpp index 20b88845f..302260569 100644 --- a/include/mbgl/shaders/mtl/line.hpp +++ b/include/mbgl/shaders/mtl/line.hpp @@ -654,84 +654,5 @@ half4 fragment fragmentMain(FragmentStage in [[stage_in]], )"; }; -template <> -struct ShaderSource { - static constexpr auto name = "LineBasicShader"; - static constexpr auto vertexMainFunction = "vertexMain"; - static constexpr auto fragmentMainFunction = "fragmentMain"; - - static const std::array attributes; - static constexpr std::array instanceAttributes{}; - static const std::array uniforms; - static const std::array textures; - - static constexpr auto source = R"( -struct VertexStage { - short2 pos_normal [[attribute(0)]]; - uchar4 data [[attribute(1)]]; -}; - -struct FragmentStage { - float4 position [[position, invariant]]; - float width2; - float2 normal; - half gamma_scale; -}; - -FragmentStage vertex vertexMain(thread const VertexStage vertx [[stage_in]], - device const LineBasicUBO& line [[buffer(2)]], - device const LineBasicPropertiesUBO& props [[buffer(3)]]) { - - // the distance over which the line edge fades out. - // Retina devices need a smaller distance to avoid aliasing. - const float ANTIALIASING = 1.0 / DEVICE_PIXEL_RATIO / 2.0; - - const float2 a_extrude = float2(vertx.data.xy) - 128.0; - const float2 pos = floor(float2(vertx.pos_normal) * 0.5); - - // x is 1 if it's a round cap, 0 otherwise - // y is 1 if the normal points up, and -1 if it points down - // We store these in the least significant bit of a_pos_normal - const float2 normal = float2(vertx.pos_normal) - 2.0 * pos; - const float2 v_normal = float2(normal.x, normal.y * 2.0 - 1.0); - - const float halfwidth = props.width / 2.0; - const float outset = halfwidth + (halfwidth == 0.0 ? 0.0 : ANTIALIASING); - - // Scale the extrusion vector down to a normal and then up by the line width of this vertex. - const float2 dist = outset * a_extrude * LINE_NORMAL_SCALE; - - const float4 projected_extrude = line.matrix * float4(dist / line.ratio, 0.0, 0.0); - const float4 position = line.matrix * float4(pos, 0.0, 1.0) + projected_extrude; - - // calculate how much the perspective view squishes or stretches the extrude - const float extrude_length_without_perspective = length(dist); - const float extrude_length_with_perspective = length(projected_extrude.xy / position.w * line.units_to_pixels); - - return { - .position = position, - .width2 = outset, - .normal = v_normal, - .gamma_scale = half(extrude_length_without_perspective / extrude_length_with_perspective), - }; -} - -half4 fragment fragmentMain(FragmentStage in [[stage_in]], - device const LineBasicUBO& line [[buffer(2)]], - device const LineBasicPropertiesUBO& props [[buffer(3)]]) { - - // Calculate the distance of the pixel from the line in pixels. - const float dist = length(in.normal) * in.width2; - - // Calculate the antialiasing fade factor. This is either when fading in the - // line in case of an offset line (`v_width2.y`) or when fading out (`v_width2.x`) - const float blur2 = (1.0 / DEVICE_PIXEL_RATIO) * in.gamma_scale; - const float alpha = clamp(min(dist + blur2, in.width2 - dist) / blur2, 0.0, 1.0); - - return half4(props.color * (alpha * props.opacity)); -} -)"; -}; - } // namespace shaders } // namespace mbgl diff --git a/include/mbgl/shaders/shader_defines.hpp b/include/mbgl/shaders/shader_defines.hpp index 4c7133368..6984ead50 100644 --- a/include/mbgl/shaders/shader_defines.hpp +++ b/include/mbgl/shaders/shader_defines.hpp @@ -37,6 +37,7 @@ static constexpr auto maxUBOCountPerShader = std::max({static_cast(backg static_cast(fillOutlineUBOCount), static_cast(fillPatternUBOCount), static_cast(fillOutlinePatternUBOCount), + static_cast(fillOutlineTriangulatedUBOCount), static_cast(fillExtrusionUBOCount), static_cast(heatmapUBOCount), static_cast(heatmapTextureUBOCount), @@ -46,7 +47,6 @@ static constexpr auto maxUBOCountPerShader = std::max({static_cast(backg static_cast(lineGradientUBOCount), static_cast(linePatternUBOCount), static_cast(lineSDFUBOCount), - static_cast(lineBasicUBOCount), static_cast(rasterUBOCount), static_cast(symbolUBOCount), static_cast(wideVectorUBOCount)}); diff --git a/include/mbgl/shaders/shader_manifest.hpp b/include/mbgl/shaders/shader_manifest.hpp index f8d2188fe..b1ef49f06 100644 --- a/include/mbgl/shaders/shader_manifest.hpp +++ b/include/mbgl/shaders/shader_manifest.hpp @@ -11,19 +11,19 @@ #include #include #include -#include -#include -#include -#include -#include #include #include +#include #include #include #include #include #include #include +#include +#include +#include +#include #include #include #include diff --git a/include/mbgl/shaders/shader_source.hpp b/include/mbgl/shaders/shader_source.hpp index 6e3382cd3..4a2fc2c19 100644 --- a/include/mbgl/shaders/shader_source.hpp +++ b/include/mbgl/shaders/shader_source.hpp @@ -17,19 +17,19 @@ enum class BuiltIn { DebugShader, FillShader, FillOutlineShader, - LineGradientShader, - LinePatternShader, - LineSDFShader, - LineShader, - LineBasicShader, FillPatternShader, FillOutlinePatternShader, + FillOutlineTriangulatedShader, FillExtrusionShader, FillExtrusionPatternShader, HeatmapShader, HeatmapTextureShader, HillshadePrepareShader, HillshadeShader, + LineShader, + LineGradientShader, + LinePatternShader, + LineSDFShader, RasterShader, SymbolIconShader, SymbolSDFIconShader, diff --git a/shaders/drawable.line_basic.fragment.glsl b/shaders/drawable.fill_outline_triangulated.fragment.glsl similarity index 78% rename from shaders/drawable.line_basic.fragment.glsl rename to shaders/drawable.fill_outline_triangulated.fragment.glsl index a7b006377..8e7abe316 100644 --- a/shaders/drawable.line_basic.fragment.glsl +++ b/shaders/drawable.fill_outline_triangulated.fragment.glsl @@ -1,15 +1,7 @@ -layout (std140) uniform LineBasicUBO { - highp mat4 u_matrix; - highp vec2 u_units_to_pixels; - mediump float u_ratio; - lowp float pad0; -}; - -layout (std140) uniform LineBasicPropertiesUBO { +layout (std140) uniform FillOutlineTriangulatedPropertiesUBO { highp vec4 u_color; lowp float u_opacity; mediump float u_width; - highp vec2 pad1; }; diff --git a/shaders/drawable.line_basic.vertex.glsl b/shaders/drawable.fill_outline_triangulated.vertex.glsl similarity index 94% rename from shaders/drawable.line_basic.vertex.glsl rename to shaders/drawable.fill_outline_triangulated.vertex.glsl index 74b4ca7e5..c2d60d5b2 100644 --- a/shaders/drawable.line_basic.vertex.glsl +++ b/shaders/drawable.fill_outline_triangulated.vertex.glsl @@ -9,18 +9,17 @@ layout (location = 0) in vec2 a_pos_normal; layout (location = 1) in vec4 a_data; -layout (std140) uniform LineBasicUBO { +layout (std140) uniform FillOutlineTriangulatedDrawableUBO { highp mat4 u_matrix; highp vec2 u_units_to_pixels; mediump float u_ratio; lowp float pad0; }; -layout (std140) uniform LineBasicPropertiesUBO { +layout (std140) uniform FillOutlineTriangulatedPropertiesUBO { highp vec4 u_color; lowp float u_opacity; mediump float u_width; - highp vec2 pad1; }; diff --git a/shaders/manifest.json b/shaders/manifest.json index 64d930d25..1c2f640ae 100644 --- a/shaders/manifest.json +++ b/shaders/manifest.json @@ -55,41 +55,6 @@ "glsl_frag": "drawable.fill_outline.fragment.glsl", "uses_ubos": true }, - { - "name": "LineGradientShader", - "header": "drawable_line_gradient", - "glsl_vert": "drawable.line_gradient.vertex.glsl", - "glsl_frag": "drawable.line_gradient.fragment.glsl", - "uses_ubos": true - }, - { - "name": "LinePatternShader", - "header": "drawable_line_pattern", - "glsl_vert": "drawable.line_pattern.vertex.glsl", - "glsl_frag": "drawable.line_pattern.fragment.glsl", - "uses_ubos": true - }, - { - "name": "LineSDFShader", - "header": "drawable_line_sdf", - "glsl_vert": "drawable.line_sdf.vertex.glsl", - "glsl_frag": "drawable.line_sdf.fragment.glsl", - "uses_ubos": true - }, - { - "name": "LineShader", - "header": "drawable_line", - "glsl_vert": "drawable.line.vertex.glsl", - "glsl_frag": "drawable.line.fragment.glsl", - "uses_ubos": true - }, - { - "name": "LineBasicShader", - "header": "drawable_line_basic", - "glsl_vert": "drawable.line_basic.vertex.glsl", - "glsl_frag": "drawable.line_basic.fragment.glsl", - "uses_ubos": true - }, { "name": "FillPatternShader", "header": "drawable_fill_pattern", @@ -104,6 +69,13 @@ "glsl_frag": "drawable.fill_outline_pattern.fragment.glsl", "uses_ubos": true }, + { + "name": "FillOutlineTriangulatedShader", + "header": "drawable_fill_outline_triangulated", + "glsl_vert": "drawable.fill_outline_triangulated.vertex.glsl", + "glsl_frag": "drawable.fill_outline_triangulated.fragment.glsl", + "uses_ubos": true + }, { "name": "FillExtrusionShader", "header": "drawable_fill_extrusion", @@ -146,6 +118,34 @@ "glsl_frag": "drawable.hillshade.fragment.glsl", "uses_ubos": true }, + { + "name": "LineShader", + "header": "drawable_line", + "glsl_vert": "drawable.line.vertex.glsl", + "glsl_frag": "drawable.line.fragment.glsl", + "uses_ubos": true + }, + { + "name": "LineGradientShader", + "header": "drawable_line_gradient", + "glsl_vert": "drawable.line_gradient.vertex.glsl", + "glsl_frag": "drawable.line_gradient.fragment.glsl", + "uses_ubos": true + }, + { + "name": "LinePatternShader", + "header": "drawable_line_pattern", + "glsl_vert": "drawable.line_pattern.vertex.glsl", + "glsl_frag": "drawable.line_pattern.fragment.glsl", + "uses_ubos": true + }, + { + "name": "LineSDFShader", + "header": "drawable_line_sdf", + "glsl_vert": "drawable.line_sdf.vertex.glsl", + "glsl_frag": "drawable.line_sdf.fragment.glsl", + "uses_ubos": true + }, { "name": "RasterShader", "header": "drawable_raster", diff --git a/src/mbgl/gl/renderer_backend.cpp b/src/mbgl/gl/renderer_backend.cpp index 1e88e1684..c1b61afc1 100644 --- a/src/mbgl/gl/renderer_backend.cpp +++ b/src/mbgl/gl/renderer_backend.cpp @@ -102,19 +102,19 @@ void RendererBackend::initShaders(gfx::ShaderRegistry& shaders, const ProgramPar shaders::BuiltIn::DebugShader, shaders::BuiltIn::FillShader, shaders::BuiltIn::FillOutlineShader, - shaders::BuiltIn::LineBasicShader, - shaders::BuiltIn::LineShader, - shaders::BuiltIn::LineSDFShader, - shaders::BuiltIn::LinePatternShader, - shaders::BuiltIn::LineGradientShader, - shaders::BuiltIn::FillOutlinePatternShader, shaders::BuiltIn::FillPatternShader, + shaders::BuiltIn::FillOutlinePatternShader, + shaders::BuiltIn::FillOutlineTriangulatedShader, shaders::BuiltIn::FillExtrusionShader, shaders::BuiltIn::FillExtrusionPatternShader, shaders::BuiltIn::HeatmapShader, shaders::BuiltIn::HeatmapTextureShader, shaders::BuiltIn::HillshadePrepareShader, shaders::BuiltIn::HillshadeShader, + shaders::BuiltIn::LineShader, + shaders::BuiltIn::LineGradientShader, + shaders::BuiltIn::LinePatternShader, + shaders::BuiltIn::LineSDFShader, shaders::BuiltIn::RasterShader, shaders::BuiltIn::SymbolIconShader, shaders::BuiltIn::SymbolSDFIconShader, diff --git a/src/mbgl/mtl/renderer_backend.cpp b/src/mbgl/mtl/renderer_backend.cpp index 19279c8e9..796d36a20 100644 --- a/src/mbgl/mtl/renderer_backend.cpp +++ b/src/mbgl/mtl/renderer_backend.cpp @@ -135,15 +135,15 @@ void RendererBackend::initShaders(gfx::ShaderRegistry& shaders, const ProgramPar shaders::BuiltIn::DebugShader, shaders::BuiltIn::FillShader, shaders::BuiltIn::FillOutlineShader, - shaders::BuiltIn::FillOutlinePatternShader, shaders::BuiltIn::FillPatternShader, + shaders::BuiltIn::FillOutlinePatternShader, + shaders::BuiltIn::FillOutlineTriangulatedShader, shaders::BuiltIn::FillExtrusionShader, shaders::BuiltIn::FillExtrusionPatternShader, shaders::BuiltIn::HeatmapShader, shaders::BuiltIn::HeatmapTextureShader, shaders::BuiltIn::HillshadeShader, shaders::BuiltIn::HillshadePrepareShader, - shaders::BuiltIn::LineBasicShader, shaders::BuiltIn::LineShader, shaders::BuiltIn::LineGradientShader, shaders::BuiltIn::LineSDFShader, diff --git a/src/mbgl/renderer/layers/fill_layer_tweaker.cpp b/src/mbgl/renderer/layers/fill_layer_tweaker.cpp index bfb7020b2..625d8a63c 100644 --- a/src/mbgl/renderer/layers/fill_layer_tweaker.cpp +++ b/src/mbgl/renderer/layers/fill_layer_tweaker.cpp @@ -45,6 +45,7 @@ void FillLayerTweaker::execute(LayerGroupBase& layerGroup, const PaintParameters fillOutlineUniformBufferUpdated = true; fillPatternUniformBufferUpdated = true; fillOutlinePatternUniformBufferUpdated = true; + fillOutlineTriangulatedUniformBufferUpdated = true; propertiesUpdated = false; } @@ -102,6 +103,19 @@ void FillLayerTweaker::execute(LayerGroupBase& layerGroup, const PaintParameters } }; + const auto UpdateFillOutlineTriangulatedUniformBuffers = [&]() { + if (!fillOutlineTriangulatedUniformBuffer || fillOutlineTriangulatedUniformBufferUpdated) { + const shaders::FillOutlineTriangulatedPropertiesUBO paramsUBO = { + /* .color = */ evaluated.get().constantOr(FillOutlineColor::defaultValue()), + /* .opacity = */ evaluated.get().constantOr(FillOpacity::defaultValue()), + /* .width = */ 1.f, + /* .ratio = */ 0, + 0}; + context.emplaceOrUpdateUniformBuffer(fillOutlineTriangulatedUniformBuffer, ¶msUBO); + fillOutlineTriangulatedUniformBufferUpdated = false; + } + }; + const auto& translation = evaluated.get(); const auto anchor = evaluated.get(); @@ -193,6 +207,19 @@ void FillLayerTweaker::execute(LayerGroupBase& layerGroup, const PaintParameters uniforms.createOrUpdate(idFillOutlinePatternDrawableUBO, &drawableUBO, context); break; } + case RenderFillLayer::FillVariant::FillOutlineTriangulated: { + UpdateFillOutlineTriangulatedUniformBuffers(); + + uniforms.set(idFillOutlineTriangulatedPropertiesUBO, fillOutlineTriangulatedUniformBuffer); + + const FillOutlineTriangulatedDrawableUBO drawableUBO{ + /*matrix = */ util::cast(matrix), + /*units_to_pixels = */ {1.0f / parameters.pixelsToGLUnits[0], 1.0f / parameters.pixelsToGLUnits[1]}, + /*ratio = */ 1.0f / tileID.pixelsToTileUnits(1.0f, parameters.state.getZoom()), + 0}; + uniforms.createOrUpdate(idFillOutlineTriangulatedDrawableUBO, &drawableUBO, context); + break; + } default: { #ifndef NDEBUG mbgl::Log::Error(mbgl::Event::Render, "Invalid fill variant type supplied during drawable update!"); diff --git a/src/mbgl/renderer/layers/fill_layer_tweaker.hpp b/src/mbgl/renderer/layers/fill_layer_tweaker.hpp index a75279e0a..2dc40e3a7 100644 --- a/src/mbgl/renderer/layers/fill_layer_tweaker.hpp +++ b/src/mbgl/renderer/layers/fill_layer_tweaker.hpp @@ -24,12 +24,14 @@ private: gfx::UniformBufferPtr fillOutlinePropsUniformBuffer; gfx::UniformBufferPtr fillPatternPropsUniformBuffer; gfx::UniformBufferPtr fillOutlinePatternPropsUniformBuffer; + gfx::UniformBufferPtr fillOutlineTriangulatedUniformBuffer; // Only run each update function once per property update bool fillUniformBufferUpdated = true; bool fillOutlineUniformBufferUpdated = true; bool fillPatternUniformBufferUpdated = true; bool fillOutlinePatternUniformBufferUpdated = true; + bool fillOutlineTriangulatedUniformBufferUpdated = true; }; } // namespace mbgl diff --git a/src/mbgl/renderer/layers/render_fill_layer.cpp b/src/mbgl/renderer/layers/render_fill_layer.cpp index bdb758a44..ab73e0ec8 100644 --- a/src/mbgl/renderer/layers/render_fill_layer.cpp +++ b/src/mbgl/renderer/layers/render_fill_layer.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #endif namespace mbgl { @@ -42,12 +41,12 @@ namespace { #if MLN_DRAWABLE_RENDERER constexpr auto FillShaderName = "FillShader"; -#if MLN_TRIANGULATE_FILL_OUTLINES -constexpr auto FillOutlineTriangulatedShaderName = "LineBasicShader"; -#endif constexpr auto FillOutlineShaderName = "FillOutlineShader"; constexpr auto FillPatternShaderName = "FillPatternShader"; constexpr auto FillOutlinePatternShaderName = "FillOutlinePatternShader"; +#if MLN_TRIANGULATE_FILL_OUTLINES +constexpr auto FillOutlineTriangulatedShaderName = "FillOutlineTriangulatedShader"; +#endif #endif // MLN_DRAWABLE_RENDERER inline const FillLayer::Impl& impl_cast(const Immutable& impl) { @@ -105,49 +104,6 @@ bool RenderFillLayer::hasCrossfade() const { return getCrossfade(evaluatedProperties).t != 1; } -#if MLN_TRIANGULATE_FILL_OUTLINES -void RenderFillLayer::markLayerRenderable(bool willRender, UniqueChangeRequestVec& changes) { - RenderLayer::markLayerRenderable(willRender, changes); - if (outlineLayerGroup) { - activateLayerGroup(outlineLayerGroup, willRender, changes); - } -} - -void RenderFillLayer::layerRemoved(UniqueChangeRequestVec& changes) { - RenderLayer::layerRemoved(changes); - if (outlineLayerGroup) { - activateLayerGroup(outlineLayerGroup, false, changes); - } -} - -void RenderFillLayer::layerIndexChanged(int32_t newLayerIndex, UniqueChangeRequestVec& changes) { - RenderLayer::layerIndexChanged(newLayerIndex, changes); - - changeLayerIndex(outlineLayerGroup, newLayerIndex, changes); -} - -std::size_t RenderFillLayer::removeAllDrawables() { - auto count = RenderLayer::removeAllDrawables(); - if (outlineLayerGroup) { - auto count2 = outlineLayerGroup->clearDrawables(); - stats.drawablesRemoved += count2; - count += count2; - } - return count; -} - -std::size_t RenderFillLayer::removeTile(RenderPass renderPass, const OverscaledTileID& tileID) { - RenderLayer::removeTile(renderPass, tileID); - if (const auto tileGroup = static_cast(outlineLayerGroup.get())) { - const auto n = tileGroup->removeDrawables(renderPass, tileID).size(); - stats.drawablesRemoved += n; - return n; - } - return 0; -} - -#endif // MLN_TRIANGULATE_FILL_OUTLINES - #if MLN_LEGACY_RENDERER void RenderFillLayer::render(PaintParameters& parameters) { assert(renderTiles); @@ -338,60 +294,6 @@ bool RenderFillLayer::queryIntersectsFeature(const GeometryCoordinates& queryGeo #if MLN_DRAWABLE_RENDERER -#if MLN_TRIANGULATE_FILL_OUTLINES -class OutlineDrawableTweaker : public gfx::DrawableTweaker { -public: - OutlineDrawableTweaker(Color color_, float opacity_) - : color(color_), - opacity(opacity_) {} - ~OutlineDrawableTweaker() override = default; - - void init(gfx::Drawable&) override {}; - - virtual void execute(gfx::Drawable& drawable, const PaintParameters& parameters) override { - if (!drawable.getTileID().has_value()) { - return; - } - - const UnwrappedTileID tileID = drawable.getTileID()->toUnwrapped(); - const auto zoom = parameters.state.getZoom(); - auto& uniforms = drawable.mutableUniformBuffers(); - - { - const auto matrix = LayerTweaker::getTileMatrix( - tileID, parameters, {{0, 0}}, style::TranslateAnchorType::Viewport, false, false, drawable, false); - - const shaders::LineBasicUBO lineBasicUBO{ - /*matrix = */ util::cast(matrix), - /*units_to_pixels = */ {1.0f / parameters.pixelsToGLUnits[0], 1.0f / parameters.pixelsToGLUnits[1]}, - /*ratio = */ 1.0f / tileID.pixelsToTileUnits(1.0f, zoom), - 0}; - parameters.context.emplaceOrUpdateUniformBuffer(lineUniformBuffer, &lineBasicUBO); - } - uniforms.set(idLineBasicUBO, lineUniformBuffer); - - if (!linePropertiesUniformBuffer) { - const shaders::LineBasicPropertiesUBO linePropertiesUBO{/*color =*/color, - /*opacity =*/opacity, - /*width =*/1.f, - 0, - 0}; - parameters.context.emplaceOrUpdateUniformBuffer(linePropertiesUniformBuffer, &linePropertiesUBO); - } - if (!uniforms.get(idLineBasicPropertiesUBO)) { - uniforms.set(idLineBasicPropertiesUBO, linePropertiesUniformBuffer); - } - }; - -private: - Color color; - float opacity; - - gfx::UniformBufferPtr lineUniformBuffer; - gfx::UniformBufferPtr linePropertiesUniformBuffer; -}; -#endif // MLN_TRIANGULATE_FILL_OUTLINES - void RenderFillLayer::update(gfx::ShaderRegistry& shaders, gfx::Context& context, const TransformState& state, @@ -414,12 +316,6 @@ void RenderFillLayer::update(gfx::ShaderRegistry& shaders, auto* fillTileLayerGroup = static_cast(layerGroup.get()); #if MLN_TRIANGULATE_FILL_OUTLINES - // Set up a layer group for outlines - if (!outlineLayerGroup) { - outlineLayerGroup = context.createTileLayerGroup(layerIndex, /*initialCapacity=*/64, getID()); - activateLayerGroup(outlineLayerGroup, isRenderable, changes); - } - auto* outlineTileLayerGroup = static_cast(outlineLayerGroup.get()); if (!outlineTriangulatedShaderGroup) { outlineTriangulatedShaderGroup = shaders.getShaderGroup(std::string(FillOutlineTriangulatedShaderName)); } @@ -460,21 +356,11 @@ void RenderFillLayer::update(gfx::ShaderRegistry& shaders, builder.setEnableStencil(true); }; -#if MLN_TRIANGULATE_FILL_OUTLINES - for (auto layer : {fillTileLayerGroup, outlineTileLayerGroup}) { - stats.drawablesRemoved += layer->removeDrawablesIf([&](gfx::Drawable& drawable) { - // If the render pass has changed or the tile has dropped out of the cover set, remove it. - const auto& tileID = drawable.getTileID(); - return tileID && !hasRenderTile(*tileID); - }); - } -#else stats.drawablesRemoved += fillTileLayerGroup->removeDrawablesIf([&](gfx::Drawable& drawable) { // If the render pass has changed or the tile has dropped out of the cover set, remove it. const auto& tileID = drawable.getTileID(); return tileID && !hasRenderTile(*tileID); }); -#endif fillTileLayerGroup->setStencilTiles(renderTiles); @@ -690,7 +576,7 @@ void RenderFillLayer::update(gfx::ShaderRegistry& shaders, }() : nullptr; - auto createOutline = [&](auto& builder, Color color, float opacity) { + auto createOutlineTriangulated = [&](auto& builder) { if (doOutline && builder && bucket.sharedLineIndexes->elements()) { builder->setShader(outlineTriangulatedShader); builder->setRawVertices({}, bucket.lineVertices.elements(), gfx::AttributeDataType::Short2); @@ -717,14 +603,12 @@ void RenderFillLayer::update(gfx::ShaderRegistry& shaders, bucket.lineSegments.data(), bucket.lineSegments.size()); - auto tweaker = std::make_shared(color, opacity); - // finish builder->flush(context); for (auto& drawable : builder->clearDrawables()) { drawable->setTileID(tileID); - drawable->addTweaker(tweaker); - outlineTileLayerGroup->addDrawable(renderPass, tileID, std::move(drawable)); + drawable->setType(static_cast(FillVariant::FillOutlineTriangulated)); + fillTileLayerGroup->addDrawable(renderPass, tileID, std::move(drawable)); ++stats.drawablesAdded; } } @@ -808,9 +692,7 @@ void RenderFillLayer::update(gfx::ShaderRegistry& shaders, if (doOutline && outlineBuilder) { if (!dataDrivenOutline) { outlineBuilder->setSubLayerIndex(unevaluated.get().isUndefined() ? 2 : 0); - createOutline(outlineBuilder, - evaluated.get().constantOr(FillOutlineColor::defaultValue()), - evaluated.get().constantOr(FillOpacity::defaultValue())); + createOutlineTriangulated(outlineBuilder); } else { if (bucket.sharedBasicLineIndexes->elements()) { outlineBuilder->setShader(outlineShader); diff --git a/src/mbgl/renderer/layers/render_fill_layer.hpp b/src/mbgl/renderer/layers/render_fill_layer.hpp index dbe71fffa..91efe25a3 100644 --- a/src/mbgl/renderer/layers/render_fill_layer.hpp +++ b/src/mbgl/renderer/layers/render_fill_layer.hpp @@ -28,6 +28,7 @@ public: FillPattern, FillOutline, FillOutlinePattern, + FillOutlineTriangulated, Undefined = 255 }; @@ -45,15 +46,6 @@ public: UniqueChangeRequestVec&) override; #endif -protected: -#if MLN_TRIANGULATE_FILL_OUTLINES - void markLayerRenderable(bool willRender, UniqueChangeRequestVec&) override; - void layerIndexChanged(int32_t newLayerIndex, UniqueChangeRequestVec&) override; - void layerRemoved(UniqueChangeRequestVec&) override; - std::size_t removeAllDrawables() override; - std::size_t removeTile(RenderPass, const OverscaledTileID&) override; -#endif // MLN_DRAWABLE_RENDERER - private: void transition(const TransitionParameters&) override; void evaluate(const PropertyEvaluationParameters&) override; @@ -90,7 +82,6 @@ private: gfx::ShaderGroupPtr outlinePatternShaderGroup; #if MLN_TRIANGULATE_FILL_OUTLINES - LayerGroupBasePtr outlineLayerGroup; gfx::ShaderGroupPtr outlineTriangulatedShaderGroup; #endif // MLN_TRIANGULATE_FILL_OUTLINES diff --git a/src/mbgl/shaders/gl/shader_info.cpp b/src/mbgl/shaders/gl/shader_info.cpp index e3c07bd41..8e2724d8d 100644 --- a/src/mbgl/shaders/gl/shader_info.cpp +++ b/src/mbgl/shaders/gl/shader_info.cpp @@ -177,6 +177,20 @@ const std::vector ShaderInfo + ShaderInfo::attributes = { + AttributeInfo{"a_pos_normal", idLinePosNormalVertexAttribute}, + AttributeInfo{"a_data", idLineDataVertexAttribute}, +}; +const std::vector + ShaderInfo::uniformBlocks = { + UniformBlockInfo{"FillOutlineTriangulatedDrawableUBO", idFillOutlineTriangulatedDrawableUBO}, + UniformBlockInfo{"FillOutlineTriangulatedPropertiesUBO", idFillOutlineTriangulatedPropertiesUBO}, +}; +const std::vector + ShaderInfo::textures = {}; + // Fill Extrusion const std::vector ShaderInfo::attributes = { AttributeInfo{"a_pos", idFillExtrusionPosVertexAttribute}, @@ -353,17 +367,6 @@ const std::vector ShaderInfo ShaderInfo::attributes = { - AttributeInfo{"a_pos_normal", idLinePosNormalVertexAttribute}, - AttributeInfo{"a_data", idLineDataVertexAttribute}, -}; -const std::vector ShaderInfo::uniformBlocks = { - UniformBlockInfo{"LineBasicUBO", idLineBasicUBO}, - UniformBlockInfo{"LineBasicPropertiesUBO", idLineBasicPropertiesUBO}, -}; -const std::vector ShaderInfo::textures = {}; - // Raster const std::vector ShaderInfo::attributes = { AttributeInfo{"a_pos", idRasterPosVertexAttribute}, diff --git a/src/mbgl/shaders/mtl/fill.cpp b/src/mbgl/shaders/mtl/fill.cpp index 3bc99120b..893fd4ca4 100644 --- a/src/mbgl/shaders/mtl/fill.cpp +++ b/src/mbgl/shaders/mtl/fill.cpp @@ -62,5 +62,19 @@ const std::array ShaderSource + ShaderSource::attributes = { + AttributeInfo{0, gfx::AttributeDataType::Short2, idLinePosNormalVertexAttribute}, + AttributeInfo{1, gfx::AttributeDataType::UByte4, idLineDataVertexAttribute}, +}; +const std::array ShaderSource::uniforms = { + UniformBlockInfo{2, true, true, sizeof(FillOutlineTriangulatedDrawableUBO), idFillOutlineTriangulatedDrawableUBO}, + UniformBlockInfo{ + 3, true, true, sizeof(FillOutlineTriangulatedPropertiesUBO), idFillOutlineTriangulatedPropertiesUBO}, +}; +const std::array + ShaderSource::textures = {}; + } // namespace shaders } // namespace mbgl diff --git a/src/mbgl/shaders/mtl/line.cpp b/src/mbgl/shaders/mtl/line.cpp index 72ddc1009..8b4a2b3f4 100644 --- a/src/mbgl/shaders/mtl/line.cpp +++ b/src/mbgl/shaders/mtl/line.cpp @@ -64,15 +64,5 @@ const std::array ShaderSource ShaderSource::attributes = { - AttributeInfo{0, gfx::AttributeDataType::Short2, idLinePosNormalVertexAttribute}, - AttributeInfo{1, gfx::AttributeDataType::UByte4, idLineDataVertexAttribute}, -}; -const std::array ShaderSource::uniforms = { - UniformBlockInfo{2, true, true, sizeof(LineBasicUBO), idLineBasicUBO}, - UniformBlockInfo{3, true, true, sizeof(LineBasicPropertiesUBO), idLineBasicPropertiesUBO}, -}; -const std::array ShaderSource::textures = {}; - } // namespace shaders } // namespace mbgl diff --git a/test/util/hash.test.cpp b/test/util/hash.test.cpp index 033d2a0f0..1cab6fbc5 100644 --- a/test/util/hash.test.cpp +++ b/test/util/hash.test.cpp @@ -137,19 +137,19 @@ TEST(OrderIndependentHash, Shaders) { BuiltIn::DebugShader, BuiltIn::FillShader, BuiltIn::FillOutlineShader, - BuiltIn::LineGradientShader, - BuiltIn::LinePatternShader, - BuiltIn::LineSDFShader, - BuiltIn::LineShader, - BuiltIn::LineBasicShader, BuiltIn::FillPatternShader, BuiltIn::FillOutlinePatternShader, + BuiltIn::FillOutlineTriangulatedShader, BuiltIn::FillExtrusionShader, BuiltIn::FillExtrusionPatternShader, BuiltIn::HeatmapShader, BuiltIn::HeatmapTextureShader, BuiltIn::HillshadePrepareShader, BuiltIn::HillshadeShader, + BuiltIn::LineShader, + BuiltIn::LineGradientShader, + BuiltIn::LinePatternShader, + BuiltIn::LineSDFShader, BuiltIn::RasterShader, BuiltIn::SymbolIconShader, BuiltIn::SymbolSDFIconShader,