diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-03-05 16:07:58 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-03-06 16:12:51 +0100 |
commit | 4737a45383911fcddf93f0a33e7e25246a5da07e (patch) | |
tree | a41a32f4d05297ede3c6d685cabf81a0f6dadcdc | |
parent | f13c2b86e427e29a856ca8f0f79379203c61f431 (diff) | |
download | qtlocation-mapboxgl-4737a45383911fcddf93f0a33e7e25246a5da07e.tar.gz |
[core] move IndexBuffer to gfx namespace
-rw-r--r-- | src/core-files.json | 1 | ||||
-rw-r--r-- | src/mbgl/gfx/index_buffer.hpp | 22 | ||||
-rw-r--r-- | src/mbgl/gl/context.cpp | 10 | ||||
-rw-r--r-- | src/mbgl/gl/context.hpp | 14 | ||||
-rw-r--r-- | src/mbgl/gl/index_buffer.hpp | 7 | ||||
-rw-r--r-- | src/mbgl/gl/program.hpp | 8 | ||||
-rw-r--r-- | src/mbgl/gl/vertex_array.cpp | 7 | ||||
-rw-r--r-- | src/mbgl/gl/vertex_array.hpp | 7 | ||||
-rw-r--r-- | src/mbgl/programs/collision_box_program.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/programs/program.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/programs/symbol_program.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/circle_bucket.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/debug_bucket.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/fill_bucket.hpp | 6 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/heatmap_bucket.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/hillshade_bucket.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/line_bucket.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/raster_bucket.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/symbol_bucket.hpp | 10 | ||||
-rw-r--r-- | src/mbgl/renderer/render_static_data.hpp | 6 |
21 files changed, 85 insertions, 49 deletions
diff --git a/src/core-files.json b/src/core-files.json index e6d25c6798..7b07dcde5c 100644 --- a/src/core-files.json +++ b/src/core-files.json @@ -500,6 +500,7 @@ "mbgl/gfx/cull_face_mode.hpp": "src/mbgl/gfx/cull_face_mode.hpp", "mbgl/gfx/depth_mode.hpp": "src/mbgl/gfx/depth_mode.hpp", "mbgl/gfx/draw_mode.hpp": "src/mbgl/gfx/draw_mode.hpp", + "mbgl/gfx/index_buffer.hpp": "src/mbgl/gfx/index_buffer.hpp", "mbgl/gfx/index_vector.hpp": "src/mbgl/gfx/index_vector.hpp", "mbgl/gfx/primitives.hpp": "src/mbgl/gfx/primitives.hpp", "mbgl/gfx/stencil_mode.hpp": "src/mbgl/gfx/stencil_mode.hpp", diff --git a/src/mbgl/gfx/index_buffer.hpp b/src/mbgl/gfx/index_buffer.hpp new file mode 100644 index 0000000000..ede949764f --- /dev/null +++ b/src/mbgl/gfx/index_buffer.hpp @@ -0,0 +1,22 @@ +#pragma once + +#include <memory> + +namespace mbgl { +namespace gfx { + +class IndexBufferResource { +protected: + IndexBufferResource() = default; +public: + virtual ~IndexBufferResource() = default; +}; + +class IndexBuffer { +public: + std::size_t elements; + std::unique_ptr<const IndexBufferResource> resource; +}; + +} // namespace gfx +} // namespace mbgl diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index 72d59737f3..6fda803a94 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -1,5 +1,6 @@ #include <mbgl/gl/context.hpp> #include <mbgl/gl/enum.hpp> +#include <mbgl/gl/index_buffer.hpp> #include <mbgl/gl/debugging_extension.hpp> #include <mbgl/gl/vertex_array_extension.hpp> #include <mbgl/gl/program_binary_extension.hpp> @@ -261,21 +262,22 @@ void Context::updateVertexBuffer(UniqueBuffer& buffer, const void* data, std::si MBGL_CHECK_ERROR(glBufferSubData(GL_ARRAY_BUFFER, 0, size, data)); } -UniqueBuffer Context::createIndexBuffer(const void* data, std::size_t size, const BufferUsage usage) { +std::unique_ptr<const gfx::IndexBufferResource> +Context::createIndexBuffer(const void* data, std::size_t size, const BufferUsage usage) { BufferID id = 0; MBGL_CHECK_ERROR(glGenBuffers(1, &id)); UniqueBuffer result { std::move(id), { this } }; bindVertexArray = 0; globalVertexArrayState.indexBuffer = result; MBGL_CHECK_ERROR(glBufferData(GL_ELEMENT_ARRAY_BUFFER, size, data, static_cast<GLenum>(usage))); - return result; + return std::make_unique<gl::IndexBufferResource>(std::move(result)); } -void Context::updateIndexBuffer(UniqueBuffer& buffer, const void* data, std::size_t size) { +void Context::updateIndexBuffer(const gfx::IndexBufferResource& resource, const void* data, std::size_t size) { // Be sure to unbind any existing vertex array object before binding the index buffer // so that we don't mess up another VAO bindVertexArray = 0; - globalVertexArrayState.indexBuffer = buffer; + globalVertexArrayState.indexBuffer = reinterpret_cast<const gl::IndexBufferResource&>(resource).buffer; MBGL_CHECK_ERROR(glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, size, data)); } diff --git a/src/mbgl/gl/context.hpp b/src/mbgl/gl/context.hpp index ad62853495..2fe0d788bf 100644 --- a/src/mbgl/gl/context.hpp +++ b/src/mbgl/gl/context.hpp @@ -8,7 +8,7 @@ #include <mbgl/gl/renderbuffer.hpp> #include <mbgl/gl/framebuffer.hpp> #include <mbgl/gl/vertex_buffer.hpp> -#include <mbgl/gl/index_buffer.hpp> +#include <mbgl/gfx/index_buffer.hpp> #include <mbgl/gl/vertex_array.hpp> #include <mbgl/gl/types.hpp> #include <mbgl/gfx/vertex_vector.hpp> @@ -80,17 +80,17 @@ public: } template <class DrawMode> - IndexBuffer createIndexBuffer(gfx::IndexVector<DrawMode>&& v, const BufferUsage usage = BufferUsage::StaticDraw) { - return IndexBuffer { + gfx::IndexBuffer createIndexBuffer(gfx::IndexVector<DrawMode>&& v, const BufferUsage usage = BufferUsage::StaticDraw) { + return { v.elements(), createIndexBuffer(v.data(), v.bytes(), usage) }; } template <class DrawMode> - void updateIndexBuffer(IndexBuffer& buffer, gfx::IndexVector<DrawMode>&& v) { + void updateIndexBuffer(gfx::IndexBuffer& buffer, gfx::IndexVector<DrawMode>&& v) { assert(v.elements() == buffer.elements); - updateIndexBuffer(buffer.buffer, v.data(), v.bytes()); + updateIndexBuffer(*buffer.resource, v.data(), v.bytes()); } template <RenderbufferType type> @@ -276,8 +276,8 @@ private: UniqueBuffer createVertexBuffer(const void* data, std::size_t size, const BufferUsage usage); void updateVertexBuffer(UniqueBuffer& buffer, const void* data, std::size_t size); - UniqueBuffer createIndexBuffer(const void* data, std::size_t size, const BufferUsage usage); - void updateIndexBuffer(UniqueBuffer& buffer, const void* data, std::size_t size); + std::unique_ptr<const gfx::IndexBufferResource> createIndexBuffer(const void* data, std::size_t size, const BufferUsage usage); + void updateIndexBuffer(const gfx::IndexBufferResource&, const void* data, std::size_t size); UniqueTexture createTexture(Size size, const void* data, TextureFormat, TextureUnit, TextureType); void updateTexture(TextureID, Size size, const void* data, TextureFormat, TextureUnit, TextureType); UniqueFramebuffer createFramebuffer(); diff --git a/src/mbgl/gl/index_buffer.hpp b/src/mbgl/gl/index_buffer.hpp index 3b66e2b69c..2da25fdb96 100644 --- a/src/mbgl/gl/index_buffer.hpp +++ b/src/mbgl/gl/index_buffer.hpp @@ -1,13 +1,16 @@ #pragma once +#include <mbgl/gfx/index_buffer.hpp> #include <mbgl/gl/object.hpp> namespace mbgl { namespace gl { -class IndexBuffer { +class IndexBufferResource : public gfx::IndexBufferResource { public: - std::size_t elements; + IndexBufferResource(UniqueBuffer&& buffer_) : buffer(std::move(buffer_)) { + } + UniqueBuffer buffer; }; diff --git a/src/mbgl/gl/program.hpp b/src/mbgl/gl/program.hpp index 45aaa3eebb..6d3a4ce266 100644 --- a/src/mbgl/gl/program.hpp +++ b/src/mbgl/gl/program.hpp @@ -4,7 +4,7 @@ #include <mbgl/gl/object.hpp> #include <mbgl/gl/context.hpp> #include <mbgl/gl/vertex_buffer.hpp> -#include <mbgl/gl/index_buffer.hpp> +#include <mbgl/gfx/index_buffer.hpp> #include <mbgl/gl/vertex_array.hpp> #include <mbgl/gl/attribute.hpp> #include <mbgl/gl/uniform.hpp> @@ -120,9 +120,9 @@ public: gfx::ColorMode colorMode, gfx::CullFaceMode cullFaceMode, const UniformValues& uniformValues, - VertexArray& vertexArray, + gl::VertexArray& vertexArray, const AttributeBindings& attributeBindings, - const IndexBuffer& indexBuffer, + const gfx::IndexBuffer& indexBuffer, std::size_t indexOffset, std::size_t indexLength) { static_assert(std::is_same<Primitive, typename DrawMode::Primitive>::value, "incompatible draw mode"); @@ -138,7 +138,7 @@ public: Uniforms::bind(uniformsState, uniformValues); vertexArray.bind(context, - indexBuffer.buffer, + indexBuffer, Attributes::toBindingArray(attributeLocations, attributeBindings)); context.draw(drawMode.primitiveType, diff --git a/src/mbgl/gl/vertex_array.cpp b/src/mbgl/gl/vertex_array.cpp index 0892c3b08b..a73e50ae73 100644 --- a/src/mbgl/gl/vertex_array.cpp +++ b/src/mbgl/gl/vertex_array.cpp @@ -1,12 +1,15 @@ #include <mbgl/gl/vertex_array.hpp> +#include <mbgl/gl/index_buffer.hpp> #include <mbgl/gl/context.hpp> namespace mbgl { namespace gl { -void VertexArray::bind(Context& context, BufferID indexBuffer, const AttributeBindingArray& bindings) { +void VertexArray::bind(Context& context, + const gfx::IndexBuffer& indexBuffer, + const AttributeBindingArray& bindings) { context.bindVertexArray = state->vertexArray; - state->indexBuffer = indexBuffer; + state->indexBuffer = reinterpret_cast<const gl::IndexBufferResource&>(*indexBuffer.resource).buffer; state->bindings.reserve(bindings.size()); for (AttributeLocation location = 0; location < bindings.size(); ++location) { diff --git a/src/mbgl/gl/vertex_array.hpp b/src/mbgl/gl/vertex_array.hpp index 604754f672..70413050b2 100644 --- a/src/mbgl/gl/vertex_array.hpp +++ b/src/mbgl/gl/vertex_array.hpp @@ -9,6 +9,11 @@ #include <memory> namespace mbgl { + +namespace gfx { +class IndexBuffer; +} // namespace gfx + namespace gl { class Context; @@ -56,7 +61,7 @@ public: : state(std::move(state_)) { } - void bind(Context&, BufferID indexBuffer, const AttributeBindingArray&); + void bind(Context&, const gfx::IndexBuffer&, const AttributeBindingArray&); private: UniqueVertexArrayState state; diff --git a/src/mbgl/programs/collision_box_program.hpp b/src/mbgl/programs/collision_box_program.hpp index ce672705f8..ef13392323 100644 --- a/src/mbgl/programs/collision_box_program.hpp +++ b/src/mbgl/programs/collision_box_program.hpp @@ -65,7 +65,7 @@ public: const UniformValues& uniformValues, const gl::VertexBuffer<gfx::Vertex<CollisionBoxLayoutAttributes>>& layoutVertexBuffer, const gl::VertexBuffer<gfx::Vertex<CollisionBoxDynamicAttributes>>& dynamicVertexBuffer, - const gl::IndexBuffer& indexBuffer, + const gfx::IndexBuffer& indexBuffer, const SegmentVector<Attributes>& segments, const Binders& paintPropertyBinders, const typename PaintProperties::PossiblyEvaluated& currentProperties, @@ -146,7 +146,7 @@ public: const UniformValues& uniformValues, const gl::VertexBuffer<gfx::Vertex<CollisionBoxLayoutAttributes>>& layoutVertexBuffer, const gl::VertexBuffer<gfx::Vertex<CollisionBoxDynamicAttributes>>& dynamicVertexBuffer, - const gl::IndexBuffer& indexBuffer, + const gfx::IndexBuffer& indexBuffer, const SegmentVector<Attributes>& segments, const Binders& paintPropertyBinders, const typename PaintProperties::PossiblyEvaluated& currentProperties, diff --git a/src/mbgl/programs/program.hpp b/src/mbgl/programs/program.hpp index 29d6dd1735..6c9deab89f 100644 --- a/src/mbgl/programs/program.hpp +++ b/src/mbgl/programs/program.hpp @@ -75,7 +75,7 @@ public: gfx::StencilMode stencilMode, gfx::ColorMode colorMode, gfx::CullFaceMode cullFaceMode, - const gl::IndexBuffer& indexBuffer, + const gfx::IndexBuffer& indexBuffer, const SegmentVector<Attributes>& segments, const typename AllUniforms::Values& allUniformValues, const typename Attributes::Bindings& allAttributeBindings, diff --git a/src/mbgl/programs/symbol_program.hpp b/src/mbgl/programs/symbol_program.hpp index 1bb2580c1e..53c65bbecd 100644 --- a/src/mbgl/programs/symbol_program.hpp +++ b/src/mbgl/programs/symbol_program.hpp @@ -310,7 +310,7 @@ public: gfx::StencilMode stencilMode, gfx::ColorMode colorMode, gfx::CullFaceMode cullFaceMode, - const gl::IndexBuffer& indexBuffer, + const gfx::IndexBuffer& indexBuffer, const SegmentVector<Attributes>& segments, const typename AllUniforms::Values& allUniformValues, const typename Attributes::Bindings& allAttributeBindings, diff --git a/src/mbgl/renderer/buckets/circle_bucket.hpp b/src/mbgl/renderer/buckets/circle_bucket.hpp index 6e0011a4cd..9495a9650c 100644 --- a/src/mbgl/renderer/buckets/circle_bucket.hpp +++ b/src/mbgl/renderer/buckets/circle_bucket.hpp @@ -4,7 +4,7 @@ #include <mbgl/map/mode.hpp> #include <mbgl/tile/geometry_tile_data.hpp> #include <mbgl/gl/vertex_buffer.hpp> -#include <mbgl/gl/index_buffer.hpp> +#include <mbgl/gfx/index_buffer.hpp> #include <mbgl/programs/segment.hpp> #include <mbgl/programs/circle_program.hpp> #include <mbgl/style/layers/circle_layer_properties.hpp> @@ -35,7 +35,7 @@ public: SegmentVector<CircleAttributes> segments; optional<gl::VertexBuffer<CircleLayoutVertex>> vertexBuffer; - optional<gl::IndexBuffer> indexBuffer; + optional<gfx::IndexBuffer> indexBuffer; std::map<std::string, CircleProgram::Binders> paintPropertyBinders; diff --git a/src/mbgl/renderer/buckets/debug_bucket.hpp b/src/mbgl/renderer/buckets/debug_bucket.hpp index 92d575a3cd..e30d580df4 100644 --- a/src/mbgl/renderer/buckets/debug_bucket.hpp +++ b/src/mbgl/renderer/buckets/debug_bucket.hpp @@ -6,7 +6,7 @@ #include <mbgl/util/optional.hpp> #include <mbgl/util/noncopyable.hpp> #include <mbgl/gl/vertex_buffer.hpp> -#include <mbgl/gl/index_buffer.hpp> +#include <mbgl/gfx/index_buffer.hpp> #include <mbgl/programs/debug_program.hpp> namespace mbgl { @@ -35,7 +35,7 @@ public: SegmentVector<DebugAttributes> segments; optional<gl::VertexBuffer<DebugLayoutVertex>> vertexBuffer; - optional<gl::IndexBuffer> indexBuffer; + optional<gfx::IndexBuffer> indexBuffer; }; } // namespace mbgl diff --git a/src/mbgl/renderer/buckets/fill_bucket.hpp b/src/mbgl/renderer/buckets/fill_bucket.hpp index 41c3e2004f..dc7180ee3d 100644 --- a/src/mbgl/renderer/buckets/fill_bucket.hpp +++ b/src/mbgl/renderer/buckets/fill_bucket.hpp @@ -3,7 +3,7 @@ #include <mbgl/renderer/bucket.hpp> #include <mbgl/tile/geometry_tile_data.hpp> #include <mbgl/gl/vertex_buffer.hpp> -#include <mbgl/gl/index_buffer.hpp> +#include <mbgl/gfx/index_buffer.hpp> #include <mbgl/programs/segment.hpp> #include <mbgl/programs/fill_program.hpp> #include <mbgl/style/layers/fill_layer_properties.hpp> @@ -47,8 +47,8 @@ public: SegmentVector<FillAttributes> triangleSegments; optional<gl::VertexBuffer<FillLayoutVertex>> vertexBuffer; - optional<gl::IndexBuffer> lineIndexBuffer; - optional<gl::IndexBuffer> triangleIndexBuffer; + optional<gfx::IndexBuffer> lineIndexBuffer; + optional<gfx::IndexBuffer> triangleIndexBuffer; std::map<std::string, FillProgram::Binders> paintPropertyBinders; }; diff --git a/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp b/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp index c3ea537de5..840ed70b4c 100644 --- a/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp +++ b/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp @@ -3,7 +3,7 @@ #include <mbgl/renderer/bucket.hpp> #include <mbgl/tile/geometry_tile_data.hpp> #include <mbgl/gl/vertex_buffer.hpp> -#include <mbgl/gl/index_buffer.hpp> +#include <mbgl/gfx/index_buffer.hpp> #include <mbgl/programs/segment.hpp> #include <mbgl/programs/fill_extrusion_program.hpp> #include <mbgl/style/layers/fill_extrusion_layer_properties.hpp> @@ -44,7 +44,7 @@ public: SegmentVector<FillExtrusionAttributes> triangleSegments; optional<gl::VertexBuffer<FillExtrusionLayoutVertex>> vertexBuffer; - optional<gl::IndexBuffer> indexBuffer; + optional<gfx::IndexBuffer> indexBuffer; std::unordered_map<std::string, FillExtrusionProgram::Binders> paintPropertyBinders; }; diff --git a/src/mbgl/renderer/buckets/heatmap_bucket.hpp b/src/mbgl/renderer/buckets/heatmap_bucket.hpp index da60904f22..ad0ad7b99d 100644 --- a/src/mbgl/renderer/buckets/heatmap_bucket.hpp +++ b/src/mbgl/renderer/buckets/heatmap_bucket.hpp @@ -4,7 +4,7 @@ #include <mbgl/map/mode.hpp> #include <mbgl/tile/geometry_tile_data.hpp> #include <mbgl/gl/vertex_buffer.hpp> -#include <mbgl/gl/index_buffer.hpp> +#include <mbgl/gfx/index_buffer.hpp> #include <mbgl/programs/segment.hpp> #include <mbgl/programs/heatmap_program.hpp> #include <mbgl/style/layers/heatmap_layer_properties.hpp> @@ -34,7 +34,7 @@ public: SegmentVector<HeatmapAttributes> segments; optional<gl::VertexBuffer<HeatmapLayoutVertex>> vertexBuffer; - optional<gl::IndexBuffer> indexBuffer; + optional<gfx::IndexBuffer> indexBuffer; std::map<std::string, HeatmapProgram::Binders> paintPropertyBinders; diff --git a/src/mbgl/renderer/buckets/hillshade_bucket.hpp b/src/mbgl/renderer/buckets/hillshade_bucket.hpp index f3c13a4c63..89da41d174 100644 --- a/src/mbgl/renderer/buckets/hillshade_bucket.hpp +++ b/src/mbgl/renderer/buckets/hillshade_bucket.hpp @@ -1,6 +1,6 @@ #pragma once -#include <mbgl/gl/index_buffer.hpp> +#include <mbgl/gfx/index_buffer.hpp> #include <mbgl/gl/texture.hpp> #include <mbgl/gl/vertex_buffer.hpp> #include <mbgl/programs/hillshade_program.hpp> @@ -51,7 +51,7 @@ public: SegmentVector<HillshadeAttributes> segments; optional<gl::VertexBuffer<HillshadeLayoutVertex>> vertexBuffer; - optional<gl::IndexBuffer> indexBuffer; + optional<gfx::IndexBuffer> indexBuffer; private: DEMData demdata; bool prepared = false; diff --git a/src/mbgl/renderer/buckets/line_bucket.hpp b/src/mbgl/renderer/buckets/line_bucket.hpp index 4f46385a27..1faf775d55 100644 --- a/src/mbgl/renderer/buckets/line_bucket.hpp +++ b/src/mbgl/renderer/buckets/line_bucket.hpp @@ -2,7 +2,7 @@ #include <mbgl/renderer/bucket.hpp> #include <mbgl/tile/geometry_tile_data.hpp> #include <mbgl/gl/vertex_buffer.hpp> -#include <mbgl/gl/index_buffer.hpp> +#include <mbgl/gfx/index_buffer.hpp> #include <mbgl/programs/segment.hpp> #include <mbgl/programs/line_program.hpp> #include <mbgl/style/layers/line_layer_properties.hpp> @@ -48,7 +48,7 @@ public: SegmentVector<LineAttributes> segments; optional<gl::VertexBuffer<LineLayoutVertex>> vertexBuffer; - optional<gl::IndexBuffer> indexBuffer; + optional<gfx::IndexBuffer> indexBuffer; std::map<std::string, LineProgram::Binders> paintPropertyBinders; diff --git a/src/mbgl/renderer/buckets/raster_bucket.hpp b/src/mbgl/renderer/buckets/raster_bucket.hpp index 3608f91626..510dbf1f8f 100644 --- a/src/mbgl/renderer/buckets/raster_bucket.hpp +++ b/src/mbgl/renderer/buckets/raster_bucket.hpp @@ -1,6 +1,6 @@ #pragma once -#include <mbgl/gl/index_buffer.hpp> +#include <mbgl/gfx/index_buffer.hpp> #include <mbgl/gl/texture.hpp> #include <mbgl/gl/vertex_buffer.hpp> #include <mbgl/programs/raster_program.hpp> @@ -37,7 +37,7 @@ public: SegmentVector<RasterAttributes> segments; optional<gl::VertexBuffer<RasterLayoutVertex>> vertexBuffer; - optional<gl::IndexBuffer> indexBuffer; + optional<gfx::IndexBuffer> indexBuffer; }; } // namespace mbgl diff --git a/src/mbgl/renderer/buckets/symbol_bucket.hpp b/src/mbgl/renderer/buckets/symbol_bucket.hpp index 2d58a7ce0f..c28a2cbc95 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.hpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.hpp @@ -3,7 +3,7 @@ #include <mbgl/renderer/bucket.hpp> #include <mbgl/map/mode.hpp> #include <mbgl/gl/vertex_buffer.hpp> -#include <mbgl/gl/index_buffer.hpp> +#include <mbgl/gfx/index_buffer.hpp> #include <mbgl/programs/segment.hpp> #include <mbgl/programs/symbol_program.hpp> #include <mbgl/programs/collision_box_program.hpp> @@ -98,7 +98,7 @@ public: optional<gl::VertexBuffer<SymbolLayoutVertex>> vertexBuffer; optional<gl::VertexBuffer<gfx::Vertex<SymbolDynamicLayoutAttributes>>> dynamicVertexBuffer; optional<gl::VertexBuffer<gfx::Vertex<SymbolOpacityAttributes>>> opacityVertexBuffer; - optional<gl::IndexBuffer> indexBuffer; + optional<gfx::IndexBuffer> indexBuffer; } text; std::unique_ptr<SymbolSizeBinder> iconSizeBinder; @@ -115,7 +115,7 @@ public: optional<gl::VertexBuffer<SymbolLayoutVertex>> vertexBuffer; optional<gl::VertexBuffer<gfx::Vertex<SymbolDynamicLayoutAttributes>>> dynamicVertexBuffer; optional<gl::VertexBuffer<gfx::Vertex<SymbolOpacityAttributes>>> opacityVertexBuffer; - optional<gl::IndexBuffer> indexBuffer; + optional<gfx::IndexBuffer> indexBuffer; } icon; struct CollisionBuffer { @@ -129,12 +129,12 @@ public: struct CollisionBoxBuffer : public CollisionBuffer { gfx::IndexVector<gfx::Lines> lines; - optional<gl::IndexBuffer> indexBuffer; + optional<gfx::IndexBuffer> indexBuffer; } collisionBox; struct CollisionCircleBuffer : public CollisionBuffer { gfx::IndexVector<gfx::Triangles> triangles; - optional<gl::IndexBuffer> indexBuffer; + optional<gfx::IndexBuffer> indexBuffer; } collisionCircle; uint32_t bucketInstanceId = 0; diff --git a/src/mbgl/renderer/render_static_data.hpp b/src/mbgl/renderer/render_static_data.hpp index 73e92c85b9..3d4f3e7dbe 100644 --- a/src/mbgl/renderer/render_static_data.hpp +++ b/src/mbgl/renderer/render_static_data.hpp @@ -1,7 +1,7 @@ #pragma once #include <mbgl/gl/vertex_buffer.hpp> -#include <mbgl/gl/index_buffer.hpp> +#include <mbgl/gfx/index_buffer.hpp> #include <mbgl/programs/background_program.hpp> #include <mbgl/programs/extrusion_texture_program.hpp> #include <mbgl/programs/programs.hpp> @@ -20,8 +20,8 @@ public: gl::VertexBuffer<RasterLayoutVertex> rasterVertexBuffer; gl::VertexBuffer<ExtrusionTextureLayoutVertex> extrusionTextureVertexBuffer; - gl::IndexBuffer quadTriangleIndexBuffer; - gl::IndexBuffer tileBorderIndexBuffer; + gfx::IndexBuffer quadTriangleIndexBuffer; + gfx::IndexBuffer tileBorderIndexBuffer; SegmentVector<BackgroundAttributes> tileTriangleSegments; SegmentVector<DebugAttributes> tileBorderSegments; |