summaryrefslogtreecommitdiff
path: root/src/mbgl/shader/attributes.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-10-29 14:51:07 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-11-08 08:09:28 -0800
commit36210fe4e9c68a52dedc90548d90e77cf39a2228 (patch)
treebe6f8e5c84f98094a372fc7518a5384fd37563bc /src/mbgl/shader/attributes.hpp
parent687ee1e1c92275f65469412591ff262b46e7ccd9 (diff)
downloadqtlocation-mapboxgl-36210fe4e9c68a52dedc90548d90e77cf39a2228.tar.gz
[core] Make attribute binding more similar to uniform binding
Diffstat (limited to 'src/mbgl/shader/attributes.hpp')
-rw-r--r--src/mbgl/shader/attributes.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mbgl/shader/attributes.hpp b/src/mbgl/shader/attributes.hpp
new file mode 100644
index 0000000000..38bbe89377
--- /dev/null
+++ b/src/mbgl/shader/attributes.hpp
@@ -0,0 +1,23 @@
+#pragma once
+
+#include <mbgl/gl/attribute.hpp>
+
+#include <cstdint>
+
+namespace mbgl {
+namespace attributes {
+
+// Attributes common to several shaders.
+
+MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_pos);
+MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_offset);
+MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_extrude);
+MBGL_DEFINE_ATTRIBUTE(uint16_t, 2, a_texture_pos);
+
+template <std::size_t N>
+struct a_data : gl::Attribute<a_data<N>, uint8_t, N> {
+ static constexpr auto name = "a_data";
+};
+
+} // namespace attributes
+} // namespace mbgl