[core] Use gl::Program to resolve some rough edges in the GL binding types
* Extract `ignore` util to separate header. * `Segment` now tracks offset and length of indices, rather than primitives. This is more natural. * Introduce `VertexVector` and `IndexVector` types. These types carry information about the intended draw mode (`Triangles`, `LineStrip`, etc.), and ensure that elements are always appended in a group size appropriate for that draw mode, for both indexed and unindexed rendering. * `Program`, rather than `Drawable`, is now the unifying object for draw calls. `Program` is the best place to type check the draw call, because it is typed to carry information about the intended primitive, vertex type, attributes, and uniforms. * Use the debug shaders for debug tile rendering, like gl-js. * Fix the draw mode for background. It was drawing triangle strips with a triangles array. Surprised this didn’t cause issues. Now it’s type checked.
This commit is contained in:
@@ -6,7 +6,9 @@
|
||||
namespace mbgl {
|
||||
|
||||
void Painter::renderClippingMask(const UnwrappedTileID& tileID, const ClipID& clip) {
|
||||
context.draw({
|
||||
programs->fill.draw(
|
||||
context,
|
||||
gl::Triangles(),
|
||||
gl::DepthMode::disabled(),
|
||||
gl::StencilMode {
|
||||
gl::StencilMode::Always(),
|
||||
@@ -17,7 +19,6 @@ void Painter::renderClippingMask(const UnwrappedTileID& tileID, const ClipID& cl
|
||||
gl::StencilMode::Replace
|
||||
},
|
||||
gl::ColorMode::disabled(),
|
||||
programs->fill,
|
||||
FillProgram::UniformValues {
|
||||
uniforms::u_matrix::Value{ matrixForTile(tileID) },
|
||||
uniforms::u_opacity::Value{ 0.0f },
|
||||
@@ -25,8 +26,8 @@ void Painter::renderClippingMask(const UnwrappedTileID& tileID, const ClipID& cl
|
||||
uniforms::u_outline_color::Value{ Color {} },
|
||||
uniforms::u_world::Value{ context.viewport.getCurrentValue().size },
|
||||
},
|
||||
gl::Unindexed<gl::Triangles>(tileTriangleVertexBuffer)
|
||||
});
|
||||
tileTriangleVertexBuffer
|
||||
);
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user