summaryrefslogtreecommitdiff
path: root/src/mbgl/gfx
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-03-19 14:02:10 +0100
committerKonstantin Käfer <mail@kkaefer.com>2019-03-20 15:40:47 +0100
commit53ab65d81165daf4e23ce28fa0e42861724ea687 (patch)
tree402a535476210bf3527b487011a0f7ccb78ef73d /src/mbgl/gfx
parent0ad2375e1047353fc65fabce3ac9123dc095179e (diff)
downloadqtlocation-mapboxgl-53ab65d81165daf4e23ce28fa0e42861724ea687.tar.gz
[core] use constexpr string concatenation for uniform/attribute names
Diffstat (limited to 'src/mbgl/gfx')
-rw-r--r--src/mbgl/gfx/attribute.hpp4
-rw-r--r--src/mbgl/gfx/texture.hpp4
-rw-r--r--src/mbgl/gfx/uniform.hpp12
3 files changed, 10 insertions, 10 deletions
diff --git a/src/mbgl/gfx/attribute.hpp b/src/mbgl/gfx/attribute.hpp
index aff27d9c1d..f5188ccfdb 100644
--- a/src/mbgl/gfx/attribute.hpp
+++ b/src/mbgl/gfx/attribute.hpp
@@ -14,8 +14,8 @@
#define MBGL_DEFINE_ATTRIBUTE(type_, n_, name_) \
struct name_ { \
using Type = ::mbgl::gfx::AttributeType<type_, n_>; \
- static auto attributeName() { \
- return "a_" #name_; \
+ static constexpr auto name() { \
+ return #name_; \
} \
}
diff --git a/src/mbgl/gfx/texture.hpp b/src/mbgl/gfx/texture.hpp
index 05f98686a1..a957c4ebdf 100644
--- a/src/mbgl/gfx/texture.hpp
+++ b/src/mbgl/gfx/texture.hpp
@@ -10,8 +10,8 @@
#define MBGL_DEFINE_TEXTURE(name_) \
struct name_ { \
using Value = ::mbgl::gfx::TextureBinding; \
- static constexpr auto uniformName() { \
- return "u_" #name_; \
+ static constexpr auto name() { \
+ return #name_; \
} \
}
diff --git a/src/mbgl/gfx/uniform.hpp b/src/mbgl/gfx/uniform.hpp
index 44cfe35510..f6896b9138 100644
--- a/src/mbgl/gfx/uniform.hpp
+++ b/src/mbgl/gfx/uniform.hpp
@@ -8,24 +8,24 @@
#define MBGL_DEFINE_UNIFORM_SCALAR(type_, name_) \
struct name_ { \
using Value = type_; \
- static constexpr auto uniformName() { \
- return "u_" #name_; \
+ static constexpr auto name() { \
+ return #name_; \
} \
}
#define MBGL_DEFINE_UNIFORM_VECTOR(type_, n_, name_) \
struct name_ { \
using Value = std::array<type_, n_>; \
- static constexpr auto uniformName() { \
- return "u_" #name_; \
+ static constexpr auto name() { \
+ return #name_; \
} \
}
#define MBGL_DEFINE_UNIFORM_MATRIX(type_, n_, name_) \
struct name_ { \
using Value = std::array<type_, n_ * n_>; \
- static constexpr auto uniformName() { \
- return "u_" #name_; \
+ static constexpr auto name() { \
+ return #name_; \
} \
}