diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-02-28 14:28:58 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-03-01 09:33:37 +0100 |
commit | 95deab32ceadd2bca3912d866e76c6b0f1b931f4 (patch) | |
tree | 09a2178cd034d67370cd9b9bc62312fd45f5af0d /src/mbgl/gl/attribute.cpp | |
parent | 3f1d754369fe0a12f924c3dd47ad028c98b8e3b7 (diff) | |
download | qtlocation-mapboxgl-95deab32ceadd2bca3912d866e76c6b0f1b931f4.tar.gz |
[core] extract attribute structs and gl::Vertex to separate namespace
Diffstat (limited to 'src/mbgl/gl/attribute.cpp')
-rw-r--r-- | src/mbgl/gl/attribute.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mbgl/gl/attribute.cpp b/src/mbgl/gl/attribute.cpp index 4983a8c204..1b43ad2b64 100644 --- a/src/mbgl/gl/attribute.cpp +++ b/src/mbgl/gl/attribute.cpp @@ -7,6 +7,17 @@ namespace gl { using namespace platform; +optional<AttributeBinding> offsetAttributeBinding(const optional<AttributeBinding>& binding, std::size_t vertexOffset) { + assert(vertexOffset <= std::numeric_limits<uint32_t>::max()); + if (binding) { + AttributeBinding result = *binding; + result.vertexOffset = static_cast<uint32_t>(vertexOffset); + return result; + } else { + return binding; + } +} + void bindAttributeLocation(Context& context, ProgramID id, AttributeLocation location, const char* name) { // We're using sequentially numberered attribute locations starting with 0. Therefore we can use // the location as a proxy for the number of attributes. |