Rename Symbol SDF shader (#3473)

This commit is contained in:
Alex Cristici
2025-05-16 01:09:54 +03:00
committed by GitHub
parent 96c8c7fbae
commit ff38ee609e
14 changed files with 25 additions and 25 deletions

View File

@@ -220,7 +220,7 @@ struct ShaderInfo<BuiltIn::SymbolIconShader, gfx::Backend::Type::OpenGL> {
}; };
template <> template <>
struct ShaderInfo<BuiltIn::SymbolSDFIconShader, gfx::Backend::Type::OpenGL> { struct ShaderInfo<BuiltIn::SymbolSDFShader, gfx::Backend::Type::OpenGL> {
static const std::vector<AttributeInfo> attributes; static const std::vector<AttributeInfo> attributes;
static const std::vector<UniformBlockInfo> uniformBlocks; static const std::vector<UniformBlockInfo> uniformBlocks;
static const std::vector<TextureInfo> textures; static const std::vector<TextureInfo> textures;

View File

@@ -6,8 +6,8 @@ namespace mbgl {
namespace shaders { namespace shaders {
template <> template <>
struct ShaderSource<BuiltIn::SymbolSDFIconShader, gfx::Backend::Type::OpenGL> { struct ShaderSource<BuiltIn::SymbolSDFShader, gfx::Backend::Type::OpenGL> {
static constexpr const char* name = "SymbolSDFIconShader"; static constexpr const char* name = "SymbolSDFShader";
static constexpr const char* vertex = R"(layout (location = 0) in vec4 a_pos_offset; static constexpr const char* vertex = R"(layout (location = 0) in vec4 a_pos_offset;
layout (location = 1) in vec4 a_data; layout (location = 1) in vec4 a_data;
layout (location = 2) in vec4 a_pixeloffset; layout (location = 2) in vec4 a_pixeloffset;

View File

@@ -211,8 +211,8 @@ half4 fragment fragmentMain(FragmentStage in [[stage_in]],
}; };
template <> template <>
struct ShaderSource<BuiltIn::SymbolSDFIconShader, gfx::Backend::Type::Metal> { struct ShaderSource<BuiltIn::SymbolSDFShader, gfx::Backend::Type::Metal> {
static constexpr auto name = "SymbolSDFIconShader"; static constexpr auto name = "SymbolSDFShader";
static constexpr auto vertexMainFunction = "vertexMain"; static constexpr auto vertexMainFunction = "vertexMain";
static constexpr auto fragmentMainFunction = "fragmentMain"; static constexpr auto fragmentMainFunction = "fragmentMain";

View File

@@ -38,7 +38,7 @@ enum class BuiltIn {
LineSDFShader, LineSDFShader,
RasterShader, RasterShader,
SymbolIconShader, SymbolIconShader,
SymbolSDFIconShader, SymbolSDFShader,
SymbolTextAndIconShader, SymbolTextAndIconShader,
WideVectorShader WideVectorShader
}; };

View File

@@ -203,8 +203,8 @@ void main() {
}; };
template <> template <>
struct ShaderSource<BuiltIn::SymbolSDFIconShader, gfx::Backend::Type::Vulkan> { struct ShaderSource<BuiltIn::SymbolSDFShader, gfx::Backend::Type::Vulkan> {
static constexpr const char* name = "SymbolSDFIconShader"; static constexpr const char* name = "SymbolSDFShader";
static const std::array<AttributeInfo, 10> attributes; static const std::array<AttributeInfo, 10> attributes;
static constexpr std::array<AttributeInfo, 0> instanceAttributes{}; static constexpr std::array<AttributeInfo, 0> instanceAttributes{};

View File

@@ -201,7 +201,7 @@
"uses_ubos": true "uses_ubos": true
}, },
{ {
"name": "SymbolSDFIconShader", "name": "SymbolSDFShader",
"header": "symbol_sdf", "header": "symbol_sdf",
"glsl_vert": "symbol_sdf.vertex.glsl", "glsl_vert": "symbol_sdf.vertex.glsl",
"glsl_frag": "symbol_sdf.fragment.glsl", "glsl_frag": "symbol_sdf.fragment.glsl",

View File

@@ -144,7 +144,7 @@ void RendererBackend::initShaders(gfx::ShaderRegistry& shaders, const ProgramPar
shaders::BuiltIn::LocationIndicatorTexturedShader, shaders::BuiltIn::LocationIndicatorTexturedShader,
shaders::BuiltIn::RasterShader, shaders::BuiltIn::RasterShader,
shaders::BuiltIn::SymbolIconShader, shaders::BuiltIn::SymbolIconShader,
shaders::BuiltIn::SymbolSDFIconShader, shaders::BuiltIn::SymbolSDFShader,
shaders::BuiltIn::SymbolTextAndIconShader>(shaders, programParameters); shaders::BuiltIn::SymbolTextAndIconShader>(shaders, programParameters);
} }

View File

@@ -129,7 +129,7 @@ void RendererBackend::initShaders(gfx::ShaderRegistry& shaders, const ProgramPar
shaders::BuiltIn::LocationIndicatorTexturedShader, shaders::BuiltIn::LocationIndicatorTexturedShader,
shaders::BuiltIn::RasterShader, shaders::BuiltIn::RasterShader,
shaders::BuiltIn::SymbolIconShader, shaders::BuiltIn::SymbolIconShader,
shaders::BuiltIn::SymbolSDFIconShader, shaders::BuiltIn::SymbolSDFShader,
shaders::BuiltIn::SymbolTextAndIconShader, shaders::BuiltIn::SymbolTextAndIconShader,
shaders::BuiltIn::WideVectorShader>(shaders, programParameters); shaders::BuiltIn::WideVectorShader>(shaders, programParameters);
} }

View File

@@ -40,7 +40,7 @@ using namespace shaders;
namespace { namespace {
constexpr std::string_view SymbolIconShaderName = "SymbolIconShader"; constexpr std::string_view SymbolIconShaderName = "SymbolIconShader";
constexpr std::string_view SymbolSDFIconShaderName = "SymbolSDFIconShader"; constexpr std::string_view SymbolSDFShaderName = "SymbolSDFShader";
constexpr std::string_view SymbolTextAndIconShaderName = "SymbolTextAndIconShader"; constexpr std::string_view SymbolTextAndIconShaderName = "SymbolTextAndIconShader";
constexpr std::string_view CollisionBoxShaderName = "CollisionBoxShader"; constexpr std::string_view CollisionBoxShaderName = "CollisionBoxShader";
constexpr std::string_view CollisionCircleShaderName = "CollisionCircleShader"; constexpr std::string_view CollisionCircleShaderName = "CollisionCircleShader";
@@ -475,7 +475,7 @@ void RenderSymbolLayer::update(gfx::ShaderRegistry& shaders,
symbolIconGroup = shaders.getShaderGroup(std::string(SymbolIconShaderName)); symbolIconGroup = shaders.getShaderGroup(std::string(SymbolIconShaderName));
} }
if (!symbolSDFGroup) { if (!symbolSDFGroup) {
symbolSDFGroup = shaders.getShaderGroup(std::string(SymbolSDFIconShaderName)); symbolSDFGroup = shaders.getShaderGroup(std::string(SymbolSDFShaderName));
} }
if (!symbolTextAndIconGroup) { if (!symbolTextAndIconGroup) {
symbolTextAndIconGroup = shaders.getShaderGroup(std::string(SymbolTextAndIconShaderName)); symbolTextAndIconGroup = shaders.getShaderGroup(std::string(SymbolTextAndIconShaderName));

View File

@@ -467,15 +467,15 @@ const std::vector<TextureInfo> SymbolIconShaderInfo::textures = {
}; };
// Symbol SDF // Symbol SDF
using SymbolSDFIconShaderInfo = ShaderInfo<BuiltIn::SymbolSDFIconShader, gfx::Backend::Type::OpenGL>; using SymbolSDFShaderInfo = ShaderInfo<BuiltIn::SymbolSDFShader, gfx::Backend::Type::OpenGL>;
const std::vector<UniformBlockInfo> SymbolSDFIconShaderInfo::uniformBlocks = { const std::vector<UniformBlockInfo> SymbolSDFShaderInfo::uniformBlocks = {
UniformBlockInfo{"GlobalPaintParamsUBO", idGlobalPaintParamsUBO}, UniformBlockInfo{"GlobalPaintParamsUBO", idGlobalPaintParamsUBO},
UniformBlockInfo{"SymbolDrawableUBO", idSymbolDrawableUBO}, UniformBlockInfo{"SymbolDrawableUBO", idSymbolDrawableUBO},
UniformBlockInfo{"SymbolTilePropsUBO", idSymbolTilePropsUBO}, UniformBlockInfo{"SymbolTilePropsUBO", idSymbolTilePropsUBO},
UniformBlockInfo{"SymbolEvaluatedPropsUBO", idSymbolEvaluatedPropsUBO}, UniformBlockInfo{"SymbolEvaluatedPropsUBO", idSymbolEvaluatedPropsUBO},
}; };
const std::vector<AttributeInfo> SymbolSDFIconShaderInfo::attributes = { const std::vector<AttributeInfo> SymbolSDFShaderInfo::attributes = {
AttributeInfo{"a_pos_offset", idSymbolPosOffsetVertexAttribute}, AttributeInfo{"a_pos_offset", idSymbolPosOffsetVertexAttribute},
AttributeInfo{"a_data", idSymbolDataVertexAttribute}, AttributeInfo{"a_data", idSymbolDataVertexAttribute},
AttributeInfo{"a_pixeloffset", idSymbolPixelOffsetVertexAttribute}, AttributeInfo{"a_pixeloffset", idSymbolPixelOffsetVertexAttribute},
@@ -487,7 +487,7 @@ const std::vector<AttributeInfo> SymbolSDFIconShaderInfo::attributes = {
AttributeInfo{"a_halo_width", idSymbolHaloWidthVertexAttribute}, AttributeInfo{"a_halo_width", idSymbolHaloWidthVertexAttribute},
AttributeInfo{"a_halo_blur", idSymbolHaloBlurVertexAttribute}, AttributeInfo{"a_halo_blur", idSymbolHaloBlurVertexAttribute},
}; };
const std::vector<TextureInfo> SymbolSDFIconShaderInfo::textures = { const std::vector<TextureInfo> SymbolSDFShaderInfo::textures = {
TextureInfo{"u_texture", idSymbolImageTexture}, TextureInfo{"u_texture", idSymbolImageTexture},
}; };

View File

@@ -27,9 +27,9 @@ const std::array<TextureInfo, 1> SymbolIconShaderSource::textures = {
// //
// Symbol sdf // Symbol sdf
using SymbolSDFIconShaderSource = ShaderSource<BuiltIn::SymbolSDFIconShader, gfx::Backend::Type::Metal>; using SymbolSDFShaderSource = ShaderSource<BuiltIn::SymbolSDFShader, gfx::Backend::Type::Metal>;
const std::array<AttributeInfo, 10> SymbolSDFIconShaderSource::attributes = { const std::array<AttributeInfo, 10> SymbolSDFShaderSource::attributes = {
// always attributes // always attributes
AttributeInfo{symbolUBOCount + 0, gfx::AttributeDataType::Short4, idSymbolPosOffsetVertexAttribute}, AttributeInfo{symbolUBOCount + 0, gfx::AttributeDataType::Short4, idSymbolPosOffsetVertexAttribute},
AttributeInfo{symbolUBOCount + 1, gfx::AttributeDataType::UShort4, idSymbolDataVertexAttribute}, AttributeInfo{symbolUBOCount + 1, gfx::AttributeDataType::UShort4, idSymbolDataVertexAttribute},
@@ -44,7 +44,7 @@ const std::array<AttributeInfo, 10> SymbolSDFIconShaderSource::attributes = {
AttributeInfo{symbolUBOCount + 8, gfx::AttributeDataType::Float, idSymbolHaloWidthVertexAttribute}, AttributeInfo{symbolUBOCount + 8, gfx::AttributeDataType::Float, idSymbolHaloWidthVertexAttribute},
AttributeInfo{symbolUBOCount + 9, gfx::AttributeDataType::Float, idSymbolHaloBlurVertexAttribute}, AttributeInfo{symbolUBOCount + 9, gfx::AttributeDataType::Float, idSymbolHaloBlurVertexAttribute},
}; };
const std::array<TextureInfo, 1> SymbolSDFIconShaderSource::textures = { const std::array<TextureInfo, 1> SymbolSDFShaderSource::textures = {
TextureInfo{0, idSymbolImageTexture}, TextureInfo{0, idSymbolImageTexture},
}; };

View File

@@ -28,9 +28,9 @@ const std::array<TextureInfo, 1> SymbolIconShaderSource::textures = {
// //
// Symbol sdf // Symbol sdf
using SymbolSDFIconShaderSource = ShaderSource<BuiltIn::SymbolSDFIconShader, gfx::Backend::Type::Vulkan>; using SymbolSDFShaderSource = ShaderSource<BuiltIn::SymbolSDFShader, gfx::Backend::Type::Vulkan>;
const std::array<AttributeInfo, 10> SymbolSDFIconShaderSource::attributes = { const std::array<AttributeInfo, 10> SymbolSDFShaderSource::attributes = {
// always attributes // always attributes
AttributeInfo{0, gfx::AttributeDataType::Short4, idSymbolPosOffsetVertexAttribute}, AttributeInfo{0, gfx::AttributeDataType::Short4, idSymbolPosOffsetVertexAttribute},
AttributeInfo{1, gfx::AttributeDataType::UShort4, idSymbolDataVertexAttribute}, AttributeInfo{1, gfx::AttributeDataType::UShort4, idSymbolDataVertexAttribute},
@@ -45,7 +45,7 @@ const std::array<AttributeInfo, 10> SymbolSDFIconShaderSource::attributes = {
AttributeInfo{8, gfx::AttributeDataType::Float, idSymbolHaloWidthVertexAttribute}, AttributeInfo{8, gfx::AttributeDataType::Float, idSymbolHaloWidthVertexAttribute},
AttributeInfo{9, gfx::AttributeDataType::Float, idSymbolHaloBlurVertexAttribute}, AttributeInfo{9, gfx::AttributeDataType::Float, idSymbolHaloBlurVertexAttribute},
}; };
const std::array<TextureInfo, 1> SymbolSDFIconShaderSource::textures = { const std::array<TextureInfo, 1> SymbolSDFShaderSource::textures = {
TextureInfo{0, idSymbolImageTexture}, TextureInfo{0, idSymbolImageTexture},
}; };

View File

@@ -692,7 +692,7 @@ void RendererBackend::initShaders(gfx::ShaderRegistry& shaders, const ProgramPar
shaders::BuiltIn::LocationIndicatorTexturedShader, shaders::BuiltIn::LocationIndicatorTexturedShader,
shaders::BuiltIn::RasterShader, shaders::BuiltIn::RasterShader,
shaders::BuiltIn::SymbolIconShader, shaders::BuiltIn::SymbolIconShader,
shaders::BuiltIn::SymbolSDFIconShader, shaders::BuiltIn::SymbolSDFShader,
shaders::BuiltIn::SymbolTextAndIconShader, shaders::BuiltIn::SymbolTextAndIconShader,
shaders::BuiltIn::WideVectorShader>(shaders, programParameters); shaders::BuiltIn::WideVectorShader>(shaders, programParameters);
} }

View File

@@ -153,7 +153,7 @@ TEST(OrderIndependentHash, Shaders) {
BuiltIn::LocationIndicatorTexturedShader, BuiltIn::LocationIndicatorTexturedShader,
BuiltIn::RasterShader, BuiltIn::RasterShader,
BuiltIn::SymbolIconShader, BuiltIn::SymbolIconShader,
BuiltIn::SymbolSDFIconShader, BuiltIn::SymbolSDFShader,
BuiltIn::SymbolTextAndIconShader>(); BuiltIn::SymbolTextAndIconShader>();
} }