diff options
author | Andrew Hay Kurtz <andrew.hay.kurtz@gmail.com> | 2019-10-29 13:49:22 -0700 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2020-04-14 22:30:40 +0300 |
commit | 0c95acf10379266e4142572b6cc7fb1c29271f3b (patch) | |
tree | 562c723da46b44a6c5905586f7a25f5194213d15 /src/mbgl/programs/program.hpp | |
parent | 08ad74216442a8c306a3d7ca4696f5ddb780557f (diff) | |
download | qtlocation-mapboxgl-0c95acf10379266e4142572b6cc7fb1c29271f3b.tar.gz |
Enable 'circle-sort-key' layout property
Diffstat (limited to 'src/mbgl/programs/program.hpp')
-rw-r--r-- | src/mbgl/programs/program.hpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/mbgl/programs/program.hpp b/src/mbgl/programs/program.hpp index ae9d1d3669..9f833a774d 100644 --- a/src/mbgl/programs/program.hpp +++ b/src/mbgl/programs/program.hpp @@ -79,6 +79,47 @@ public: const gfx::ColorMode& colorMode, const gfx::CullFaceMode& cullFaceMode, const gfx::IndexBuffer& indexBuffer, + const Segment<AttributeList>& segment, + const UniformValues& uniformValues, + const AttributeBindings& allAttributeBindings, + const TextureBindings& textureBindings, + const std::string& layerID) { + static_assert(Primitive == gfx::PrimitiveTypeOf<DrawMode>::value, "incompatible draw mode"); + + if (!program) { + return; + } + + auto drawScopeIt = segment.drawScopes.find(layerID); + if (drawScopeIt == segment.drawScopes.end()) { + drawScopeIt = segment.drawScopes.emplace(layerID, context.createDrawScope()).first; + } + + program->draw(context, + renderPass, + drawMode, + depthMode, + stencilMode, + colorMode, + cullFaceMode, + uniformValues, + drawScopeIt->second, + allAttributeBindings.offset(segment.vertexOffset), + textureBindings, + indexBuffer, + segment.indexOffset, + segment.indexLength); + } + + template <class DrawMode> + void draw(gfx::Context& context, + gfx::RenderPass& renderPass, + const DrawMode& drawMode, + const gfx::DepthMode& depthMode, + const gfx::StencilMode& stencilMode, + const gfx::ColorMode& colorMode, + const gfx::CullFaceMode& cullFaceMode, + const gfx::IndexBuffer& indexBuffer, const SegmentVector<AttributeList>& segments, const UniformValues& uniformValues, const AttributeBindings& allAttributeBindings, |