diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-03-19 14:02:10 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-03-20 15:40:47 +0100 |
commit | 53ab65d81165daf4e23ce28fa0e42861724ea687 (patch) | |
tree | 402a535476210bf3527b487011a0f7ccb78ef73d /src/mbgl/gl/texture.hpp | |
parent | 0ad2375e1047353fc65fabce3ac9123dc095179e (diff) | |
download | qtlocation-mapboxgl-53ab65d81165daf4e23ce28fa0e42861724ea687.tar.gz |
[core] use constexpr string concatenation for uniform/attribute names
Diffstat (limited to 'src/mbgl/gl/texture.hpp')
-rw-r--r-- | src/mbgl/gl/texture.hpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mbgl/gl/texture.hpp b/src/mbgl/gl/texture.hpp index 2058ecd495..44b81f9a45 100644 --- a/src/mbgl/gl/texture.hpp +++ b/src/mbgl/gl/texture.hpp @@ -2,6 +2,7 @@ #include <mbgl/gfx/texture.hpp> #include <mbgl/gl/uniform.hpp> +#include <mbgl/util/literal.hpp> #include <mbgl/util/ignore.hpp> #include <vector> @@ -27,16 +28,19 @@ private: public: void queryLocations(const ProgramID& id) { - state = State{ gl::uniformLocation(id, Ts::uniformName())... }; + state = State{ gl::uniformLocation(id, + concat_literals<&string_literal<'u', '_'>::value, &Ts::name>::value())... }; } template <class BinaryProgram> void loadNamedLocations(const BinaryProgram& program) { - state = State{ program.textureLocation(Ts::uniformName())... }; + state = State{ program.textureLocation( + concat_literals<&string_literal<'u', '_'>::value, &Ts::name>::value())... }; } NamedUniformLocations getNamedLocations() const { - return NamedUniformLocations{ { Ts::uniformName(), state.template get<Ts>().location }... }; + return NamedUniformLocations{ { concat_literals<&string_literal<'u', '_'>::value, &Ts::name>::value(), + state.template get<Ts>().location }... }; } void bind(gl::Context& context, const gfx::TextureBindings<TypeList<Ts...>>& bindings) { |