diff options
Diffstat (limited to 'src/mbgl/programs')
-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, |