[core] move VertexBuffer<> to gfx namespace
This commit is contained in:
@@ -506,6 +506,7 @@
|
||||
"mbgl/gfx/stencil_mode.hpp": "src/mbgl/gfx/stencil_mode.hpp",
|
||||
"mbgl/gfx/types.hpp": "src/mbgl/gfx/types.hpp",
|
||||
"mbgl/gfx/uniform.hpp": "src/mbgl/gfx/uniform.hpp",
|
||||
"mbgl/gfx/vertex_buffer.hpp": "src/mbgl/gfx/vertex_buffer.hpp",
|
||||
"mbgl/gfx/vertex_vector.hpp": "src/mbgl/gfx/vertex_vector.hpp",
|
||||
"mbgl/gl/attribute.hpp": "src/mbgl/gl/attribute.hpp",
|
||||
"mbgl/gl/context.hpp": "src/mbgl/gl/context.hpp",
|
||||
|
||||
25
src/mbgl/gfx/vertex_buffer.hpp
Normal file
25
src/mbgl/gfx/vertex_buffer.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace mbgl {
|
||||
namespace gfx {
|
||||
|
||||
class VertexBufferResource {
|
||||
protected:
|
||||
VertexBufferResource() = default;
|
||||
public:
|
||||
virtual ~VertexBufferResource() = default;
|
||||
};
|
||||
|
||||
// This class has a template argument that we use to specify the vertex type. It is not used by
|
||||
// the implementation, but serves type checking purposes during build time.
|
||||
template <class>
|
||||
class VertexBuffer {
|
||||
public:
|
||||
std::size_t elements;
|
||||
std::unique_ptr<const VertexBufferResource> resource;
|
||||
};
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mbgl
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <mbgl/gfx/attribute.hpp>
|
||||
#include <mbgl/gl/types.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/util/ignore.hpp>
|
||||
#include <mbgl/util/indexed_tuple.hpp>
|
||||
#include <mbgl/util/optional.hpp>
|
||||
@@ -22,13 +22,14 @@ class AttributeBinding {
|
||||
public:
|
||||
gfx::AttributeDescriptor attribute;
|
||||
uint8_t vertexStride;
|
||||
BufferID vertexBuffer;
|
||||
const gfx::VertexBufferResource* vertexBufferResource;
|
||||
uint32_t vertexOffset;
|
||||
|
||||
friend bool operator==(const AttributeBinding& lhs,
|
||||
const AttributeBinding& rhs) {
|
||||
return std::tie(lhs.attribute, lhs.vertexStride, lhs.vertexBuffer, lhs.vertexOffset)
|
||||
== std::tie(rhs.attribute, rhs.vertexStride, rhs.vertexBuffer, rhs.vertexOffset);
|
||||
friend bool operator==(const AttributeBinding& lhs, const AttributeBinding& rhs) {
|
||||
return lhs.attribute == rhs.attribute &&
|
||||
lhs.vertexStride == rhs.vertexStride &&
|
||||
lhs.vertexBufferResource == rhs.vertexBufferResource &&
|
||||
lhs.vertexOffset == rhs.vertexOffset;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -40,12 +41,12 @@ using AttributeBindingArray = std::vector<optional<AttributeBinding>>;
|
||||
a buffer with only one float for each vertex can be bound to a `vec2` attribute
|
||||
*/
|
||||
template <std::size_t I, typename Vertex>
|
||||
AttributeBinding attributeBinding(const VertexBuffer<Vertex>& buffer) {
|
||||
AttributeBinding attributeBinding(const gfx::VertexBuffer<Vertex>& buffer) {
|
||||
static_assert(I < gfx::VertexDescriptorOf<Vertex>::data.count, "vertex attribute index out of range");
|
||||
return {
|
||||
gfx::VertexDescriptorOf<Vertex>::data.attributes[I],
|
||||
gfx::VertexDescriptorOf<Vertex>::data.stride,
|
||||
buffer.buffer,
|
||||
buffer.resource.get(),
|
||||
0,
|
||||
};
|
||||
}
|
||||
@@ -106,7 +107,7 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
static Bindings bindings(const VertexBuffer<gfx::Vertex<Types>>& buffer) {
|
||||
static Bindings bindings(const gfx::VertexBuffer<gfx::Vertex<Types>>& buffer) {
|
||||
return Bindings { attributeBinding<TypeIndex<As, As...>::value>(buffer)... };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <mbgl/gl/context.hpp>
|
||||
#include <mbgl/gl/enum.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gl/index_buffer.hpp>
|
||||
#include <mbgl/gl/debugging_extension.hpp>
|
||||
#include <mbgl/gl/vertex_array_extension.hpp>
|
||||
@@ -248,17 +249,18 @@ void Context::verifyProgramLinkage(ProgramID program_) {
|
||||
throw std::runtime_error("program failed to link");
|
||||
}
|
||||
|
||||
UniqueBuffer Context::createVertexBuffer(const void* data, std::size_t size, const BufferUsage usage) {
|
||||
std::unique_ptr<const gfx::VertexBufferResource>
|
||||
Context::createVertexBuffer(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 } };
|
||||
vertexBuffer = result;
|
||||
MBGL_CHECK_ERROR(glBufferData(GL_ARRAY_BUFFER, size, data, static_cast<GLenum>(usage)));
|
||||
return result;
|
||||
return std::make_unique<gl::VertexBufferResource>(std::move(result));
|
||||
}
|
||||
|
||||
void Context::updateVertexBuffer(UniqueBuffer& buffer, const void* data, std::size_t size) {
|
||||
vertexBuffer = buffer;
|
||||
void Context::updateVertexBuffer(const gfx::VertexBufferResource& resource, const void* data, std::size_t size) {
|
||||
vertexBuffer = reinterpret_cast<const gl::VertexBufferResource&>(resource).buffer;
|
||||
MBGL_CHECK_ERROR(glBufferSubData(GL_ARRAY_BUFFER, 0, size, data));
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <mbgl/gl/texture.hpp>
|
||||
#include <mbgl/gl/renderbuffer.hpp>
|
||||
#include <mbgl/gl/framebuffer.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/index_buffer.hpp>
|
||||
#include <mbgl/gl/vertex_array.hpp>
|
||||
#include <mbgl/gl/types.hpp>
|
||||
@@ -66,17 +66,17 @@ public:
|
||||
optional<std::pair<BinaryProgramFormat, std::string>> getBinaryProgram(ProgramID) const;
|
||||
|
||||
template <class Vertex>
|
||||
VertexBuffer<Vertex> createVertexBuffer(gfx::VertexVector<Vertex>&& v, const BufferUsage usage = BufferUsage::StaticDraw) {
|
||||
return VertexBuffer<Vertex> {
|
||||
gfx::VertexBuffer<Vertex> createVertexBuffer(gfx::VertexVector<Vertex>&& v, const BufferUsage usage = BufferUsage::StaticDraw) {
|
||||
return {
|
||||
v.elements(),
|
||||
createVertexBuffer(v.data(), v.bytes(), usage)
|
||||
};
|
||||
}
|
||||
|
||||
template <class Vertex>
|
||||
void updateVertexBuffer(VertexBuffer<Vertex>& buffer, gfx::VertexVector<Vertex>&& v) {
|
||||
void updateVertexBuffer(gfx::VertexBuffer<Vertex>& buffer, gfx::VertexVector<Vertex>&& v) {
|
||||
assert(v.elements() == buffer.elements);
|
||||
updateVertexBuffer(buffer.buffer, v.data(), v.bytes());
|
||||
updateVertexBuffer(*buffer.resource, v.data(), v.bytes());
|
||||
}
|
||||
|
||||
template <class DrawMode>
|
||||
@@ -274,8 +274,8 @@ private:
|
||||
State<value::PointSize> pointSize;
|
||||
#endif // MBGL_USE_GLES2
|
||||
|
||||
UniqueBuffer createVertexBuffer(const void* data, std::size_t size, const BufferUsage usage);
|
||||
void updateVertexBuffer(UniqueBuffer& buffer, const void* data, std::size_t size);
|
||||
std::unique_ptr<const gfx::VertexBufferResource> createVertexBuffer(const void* data, std::size_t size, const BufferUsage usage);
|
||||
void updateVertexBuffer(const gfx::VertexBufferResource&, 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);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <mbgl/gl/types.hpp>
|
||||
#include <mbgl/gl/object.hpp>
|
||||
#include <mbgl/gl/context.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/index_buffer.hpp>
|
||||
#include <mbgl/gl/vertex_array.hpp>
|
||||
#include <mbgl/gl/attribute.hpp>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <mbgl/gl/value.hpp>
|
||||
#include <mbgl/gl/context.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gl/vertex_array_extension.hpp>
|
||||
#include <mbgl/gl/enum.hpp>
|
||||
|
||||
@@ -485,7 +486,7 @@ GLint components(const gfx::AttributeDataType type) {
|
||||
|
||||
void VertexAttribute::Set(const optional<AttributeBinding>& binding, Context& context, AttributeLocation location) {
|
||||
if (binding) {
|
||||
context.vertexBuffer = binding->vertexBuffer;
|
||||
context.vertexBuffer = reinterpret_cast<const gl::VertexBufferResource&>(*binding->vertexBufferResource).buffer;
|
||||
MBGL_CHECK_ERROR(glEnableVertexAttribArray(location));
|
||||
MBGL_CHECK_ERROR(glVertexAttribPointer(
|
||||
location,
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/gl/object.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace gl {
|
||||
|
||||
template <class V>
|
||||
class VertexBuffer {
|
||||
class VertexBufferResource : public gfx::VertexBufferResource {
|
||||
public:
|
||||
std::size_t elements;
|
||||
VertexBufferResource(UniqueBuffer&& buffer_) : buffer(std::move(buffer_)) {
|
||||
}
|
||||
|
||||
UniqueBuffer buffer;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/util/mat4.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/programs/symbol_program.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -63,8 +63,8 @@ public:
|
||||
gfx::ColorMode colorMode,
|
||||
gfx::CullFaceMode cullFaceMode,
|
||||
const UniformValues& uniformValues,
|
||||
const gl::VertexBuffer<gfx::Vertex<CollisionBoxLayoutAttributes>>& layoutVertexBuffer,
|
||||
const gl::VertexBuffer<gfx::Vertex<CollisionBoxDynamicAttributes>>& dynamicVertexBuffer,
|
||||
const gfx::VertexBuffer<gfx::Vertex<CollisionBoxLayoutAttributes>>& layoutVertexBuffer,
|
||||
const gfx::VertexBuffer<gfx::Vertex<CollisionBoxDynamicAttributes>>& dynamicVertexBuffer,
|
||||
const gfx::IndexBuffer& indexBuffer,
|
||||
const SegmentVector<Attributes>& segments,
|
||||
const Binders& paintPropertyBinders,
|
||||
@@ -144,8 +144,8 @@ public:
|
||||
gfx::ColorMode colorMode,
|
||||
gfx::CullFaceMode cullFaceMode,
|
||||
const UniformValues& uniformValues,
|
||||
const gl::VertexBuffer<gfx::Vertex<CollisionBoxLayoutAttributes>>& layoutVertexBuffer,
|
||||
const gl::VertexBuffer<gfx::Vertex<CollisionBoxDynamicAttributes>>& dynamicVertexBuffer,
|
||||
const gfx::VertexBuffer<gfx::Vertex<CollisionBoxLayoutAttributes>>& layoutVertexBuffer,
|
||||
const gfx::VertexBuffer<gfx::Vertex<CollisionBoxDynamicAttributes>>& dynamicVertexBuffer,
|
||||
const gfx::IndexBuffer& indexBuffer,
|
||||
const SegmentVector<Attributes>& segments,
|
||||
const Binders& paintPropertyBinders,
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
}
|
||||
|
||||
static typename Attributes::Bindings computeAllAttributeBindings(
|
||||
const gl::VertexBuffer<LayoutVertex>& layoutVertexBuffer,
|
||||
const gfx::VertexBuffer<LayoutVertex>& layoutVertexBuffer,
|
||||
const Binders& paintPropertyBinders,
|
||||
const typename PaintProperties::PossiblyEvaluated& currentProperties) {
|
||||
return LayoutAttributes::bindings(layoutVertexBuffer)
|
||||
|
||||
@@ -286,9 +286,9 @@ public:
|
||||
}
|
||||
|
||||
static typename Attributes::Bindings computeAllAttributeBindings(
|
||||
const gl::VertexBuffer<LayoutVertex>& layoutVertexBuffer,
|
||||
const gl::VertexBuffer<gfx::Vertex<SymbolDynamicLayoutAttributes>>& dynamicLayoutVertexBuffer,
|
||||
const gl::VertexBuffer<gfx::Vertex<SymbolOpacityAttributes>>& opacityVertexBuffer,
|
||||
const gfx::VertexBuffer<LayoutVertex>& layoutVertexBuffer,
|
||||
const gfx::VertexBuffer<gfx::Vertex<SymbolDynamicLayoutAttributes>>& dynamicLayoutVertexBuffer,
|
||||
const gfx::VertexBuffer<gfx::Vertex<SymbolOpacityAttributes>>& opacityVertexBuffer,
|
||||
const Binders& paintPropertyBinders,
|
||||
const typename PaintProperties::PossiblyEvaluated& currentProperties) {
|
||||
assert(layoutVertexBuffer.elements == dynamicLayoutVertexBuffer.elements &&
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <mbgl/renderer/bucket.hpp>
|
||||
#include <mbgl/map/mode.hpp>
|
||||
#include <mbgl/tile/geometry_tile_data.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/index_buffer.hpp>
|
||||
#include <mbgl/programs/segment.hpp>
|
||||
#include <mbgl/programs/circle_program.hpp>
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
gfx::IndexVector<gfx::Triangles> triangles;
|
||||
SegmentVector<CircleAttributes> segments;
|
||||
|
||||
optional<gl::VertexBuffer<CircleLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::VertexBuffer<CircleLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::IndexBuffer> indexBuffer;
|
||||
|
||||
std::map<std::string, CircleProgram::Binders> paintPropertyBinders;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <mbgl/util/geometry.hpp>
|
||||
#include <mbgl/util/optional.hpp>
|
||||
#include <mbgl/util/noncopyable.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/index_buffer.hpp>
|
||||
#include <mbgl/programs/debug_program.hpp>
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
const MapDebugOptions debugMode;
|
||||
|
||||
SegmentVector<DebugAttributes> segments;
|
||||
optional<gl::VertexBuffer<DebugLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::VertexBuffer<DebugLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::IndexBuffer> indexBuffer;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <mbgl/renderer/bucket.hpp>
|
||||
#include <mbgl/tile/geometry_tile_data.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/index_buffer.hpp>
|
||||
#include <mbgl/programs/segment.hpp>
|
||||
#include <mbgl/programs/fill_program.hpp>
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
SegmentVector<FillAttributes> lineSegments;
|
||||
SegmentVector<FillAttributes> triangleSegments;
|
||||
|
||||
optional<gl::VertexBuffer<FillLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::VertexBuffer<FillLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::IndexBuffer> lineIndexBuffer;
|
||||
optional<gfx::IndexBuffer> triangleIndexBuffer;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <mbgl/renderer/bucket.hpp>
|
||||
#include <mbgl/tile/geometry_tile_data.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/index_buffer.hpp>
|
||||
#include <mbgl/programs/segment.hpp>
|
||||
#include <mbgl/programs/fill_extrusion_program.hpp>
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
gfx::IndexVector<gfx::Triangles> triangles;
|
||||
SegmentVector<FillExtrusionAttributes> triangleSegments;
|
||||
|
||||
optional<gl::VertexBuffer<FillExtrusionLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::VertexBuffer<FillExtrusionLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::IndexBuffer> indexBuffer;
|
||||
|
||||
std::unordered_map<std::string, FillExtrusionProgram::Binders> paintPropertyBinders;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <mbgl/renderer/bucket.hpp>
|
||||
#include <mbgl/map/mode.hpp>
|
||||
#include <mbgl/tile/geometry_tile_data.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/index_buffer.hpp>
|
||||
#include <mbgl/programs/segment.hpp>
|
||||
#include <mbgl/programs/heatmap_program.hpp>
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
gfx::IndexVector<gfx::Triangles> triangles;
|
||||
SegmentVector<HeatmapAttributes> segments;
|
||||
|
||||
optional<gl::VertexBuffer<HeatmapLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::VertexBuffer<HeatmapLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::IndexBuffer> indexBuffer;
|
||||
|
||||
std::map<std::string, HeatmapProgram::Binders> paintPropertyBinders;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <mbgl/gfx/index_buffer.hpp>
|
||||
#include <mbgl/gl/texture.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/programs/hillshade_program.hpp>
|
||||
#include <mbgl/programs/hillshade_prepare_program.hpp>
|
||||
#include <mbgl/renderer/bucket.hpp>
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
gfx::IndexVector<gfx::Triangles> indices;
|
||||
SegmentVector<HillshadeAttributes> segments;
|
||||
|
||||
optional<gl::VertexBuffer<HillshadeLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::VertexBuffer<HillshadeLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::IndexBuffer> indexBuffer;
|
||||
private:
|
||||
DEMData demdata;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include <mbgl/renderer/bucket.hpp>
|
||||
#include <mbgl/tile/geometry_tile_data.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/index_buffer.hpp>
|
||||
#include <mbgl/programs/segment.hpp>
|
||||
#include <mbgl/programs/line_program.hpp>
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
gfx::IndexVector<gfx::Triangles> triangles;
|
||||
SegmentVector<LineAttributes> segments;
|
||||
|
||||
optional<gl::VertexBuffer<LineLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::VertexBuffer<LineLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::IndexBuffer> indexBuffer;
|
||||
|
||||
std::map<std::string, LineProgram::Binders> paintPropertyBinders;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <mbgl/gfx/index_buffer.hpp>
|
||||
#include <mbgl/gl/texture.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/programs/raster_program.hpp>
|
||||
#include <mbgl/renderer/bucket.hpp>
|
||||
#include <mbgl/renderer/tile_mask.hpp>
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
gfx::IndexVector<gfx::Triangles> indices;
|
||||
SegmentVector<RasterAttributes> segments;
|
||||
|
||||
optional<gl::VertexBuffer<RasterLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::VertexBuffer<RasterLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::IndexBuffer> indexBuffer;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <mbgl/renderer/bucket.hpp>
|
||||
#include <mbgl/map/mode.hpp>
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/index_buffer.hpp>
|
||||
#include <mbgl/programs/segment.hpp>
|
||||
#include <mbgl/programs/symbol_program.hpp>
|
||||
@@ -95,9 +95,9 @@ public:
|
||||
SegmentVector<SymbolTextAttributes> segments;
|
||||
std::vector<PlacedSymbol> placedSymbols;
|
||||
|
||||
optional<gl::VertexBuffer<SymbolLayoutVertex>> vertexBuffer;
|
||||
optional<gl::VertexBuffer<gfx::Vertex<SymbolDynamicLayoutAttributes>>> dynamicVertexBuffer;
|
||||
optional<gl::VertexBuffer<gfx::Vertex<SymbolOpacityAttributes>>> opacityVertexBuffer;
|
||||
optional<gfx::VertexBuffer<SymbolLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::VertexBuffer<gfx::Vertex<SymbolDynamicLayoutAttributes>>> dynamicVertexBuffer;
|
||||
optional<gfx::VertexBuffer<gfx::Vertex<SymbolOpacityAttributes>>> opacityVertexBuffer;
|
||||
optional<gfx::IndexBuffer> indexBuffer;
|
||||
} text;
|
||||
|
||||
@@ -112,9 +112,9 @@ public:
|
||||
std::vector<PlacedSymbol> placedSymbols;
|
||||
PremultipliedImage atlasImage;
|
||||
|
||||
optional<gl::VertexBuffer<SymbolLayoutVertex>> vertexBuffer;
|
||||
optional<gl::VertexBuffer<gfx::Vertex<SymbolDynamicLayoutAttributes>>> dynamicVertexBuffer;
|
||||
optional<gl::VertexBuffer<gfx::Vertex<SymbolOpacityAttributes>>> opacityVertexBuffer;
|
||||
optional<gfx::VertexBuffer<SymbolLayoutVertex>> vertexBuffer;
|
||||
optional<gfx::VertexBuffer<gfx::Vertex<SymbolDynamicLayoutAttributes>>> dynamicVertexBuffer;
|
||||
optional<gfx::VertexBuffer<gfx::Vertex<SymbolOpacityAttributes>>> opacityVertexBuffer;
|
||||
optional<gfx::IndexBuffer> indexBuffer;
|
||||
} icon;
|
||||
|
||||
@@ -123,8 +123,8 @@ public:
|
||||
gfx::VertexVector<gfx::Vertex<CollisionBoxDynamicAttributes>> dynamicVertices;
|
||||
SegmentVector<CollisionBoxProgram::Attributes> segments;
|
||||
|
||||
optional<gl::VertexBuffer<gfx::Vertex<CollisionBoxLayoutAttributes>>> vertexBuffer;
|
||||
optional<gl::VertexBuffer<gfx::Vertex<CollisionBoxDynamicAttributes>>> dynamicVertexBuffer;
|
||||
optional<gfx::VertexBuffer<gfx::Vertex<CollisionBoxLayoutAttributes>>> vertexBuffer;
|
||||
optional<gfx::VertexBuffer<gfx::Vertex<CollisionBoxDynamicAttributes>>> dynamicVertexBuffer;
|
||||
};
|
||||
|
||||
struct CollisionBoxBuffer : public CollisionBuffer {
|
||||
|
||||
@@ -223,7 +223,7 @@ private:
|
||||
style::PropertyExpression<T> expression;
|
||||
T defaultValue;
|
||||
gfx::VertexVector<BaseVertex> vertexVector;
|
||||
optional<gl::VertexBuffer<BaseVertex>> vertexBuffer;
|
||||
optional<gfx::VertexBuffer<BaseVertex>> vertexBuffer;
|
||||
};
|
||||
|
||||
template <class T, class A>
|
||||
@@ -288,7 +288,7 @@ private:
|
||||
T defaultValue;
|
||||
Range<float> zoomRange;
|
||||
gfx::VertexVector<Vertex> vertexVector;
|
||||
optional<gl::VertexBuffer<Vertex>> vertexBuffer;
|
||||
optional<gfx::VertexBuffer<Vertex>> vertexBuffer;
|
||||
};
|
||||
|
||||
template <class T, class A1, class A2>
|
||||
@@ -377,9 +377,9 @@ private:
|
||||
gfx::VertexVector<Vertex> patternToVertexVector;
|
||||
gfx::VertexVector<Vertex2> zoomInVertexVector;
|
||||
gfx::VertexVector<Vertex2> zoomOutVertexVector;
|
||||
optional<gl::VertexBuffer<Vertex>> patternToVertexBuffer;
|
||||
optional<gl::VertexBuffer<Vertex2>> zoomInVertexBuffer;
|
||||
optional<gl::VertexBuffer<Vertex2>> zoomOutVertexBuffer;
|
||||
optional<gfx::VertexBuffer<Vertex>> patternToVertexBuffer;
|
||||
optional<gfx::VertexBuffer<Vertex2>> zoomInVertexBuffer;
|
||||
optional<gfx::VertexBuffer<Vertex2>> zoomOutVertexBuffer;
|
||||
CrossfadeParameters crossfade;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/gl/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/vertex_buffer.hpp>
|
||||
#include <mbgl/gfx/index_buffer.hpp>
|
||||
#include <mbgl/programs/background_program.hpp>
|
||||
#include <mbgl/programs/extrusion_texture_program.hpp>
|
||||
@@ -16,9 +16,9 @@ class RenderStaticData {
|
||||
public:
|
||||
RenderStaticData(gl::Context&, float pixelRatio, const optional<std::string>& programCacheDir);
|
||||
|
||||
gl::VertexBuffer<gfx::Vertex<PositionOnlyLayoutAttributes>> tileVertexBuffer;
|
||||
gl::VertexBuffer<RasterLayoutVertex> rasterVertexBuffer;
|
||||
gl::VertexBuffer<ExtrusionTextureLayoutVertex> extrusionTextureVertexBuffer;
|
||||
gfx::VertexBuffer<gfx::Vertex<PositionOnlyLayoutAttributes>> tileVertexBuffer;
|
||||
gfx::VertexBuffer<RasterLayoutVertex> rasterVertexBuffer;
|
||||
gfx::VertexBuffer<ExtrusionTextureLayoutVertex> extrusionTextureVertexBuffer;
|
||||
|
||||
gfx::IndexBuffer quadTriangleIndexBuffer;
|
||||
gfx::IndexBuffer tileBorderIndexBuffer;
|
||||
|
||||
Reference in New Issue
Block a user