Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Problem with VAOs bind function #493

Closed
ljbade opened this issue Oct 19, 2014 · 6 comments
Closed

Problem with VAOs bind function #493

ljbade opened this issue Oct 19, 2014 · 6 comments

Comments

@ljbade
Copy link
Contributor

ljbade commented Oct 19, 2014

I came across this while working on getting Android to compile again:

In file included from ../../src/renderer/painter_prerender.cpp:1:
In file included from ../../include/mbgl/renderer/painter.hpp:4:
In file included from ../../include/mbgl/map/tile_data.hpp:5:
In file included from ../../include/mbgl/renderer/debug_bucket.hpp:6:
../../include/mbgl/geometry/vao.hpp:74:27: error: invalid range expression of type 'mbgl::StaticVertexBuffer'; no viable 'begin' function
      available
        for (auto &buffer : buffers) {
                          ^ ~~~~~~~
../../src/renderer/painter_prerender.cpp:43:25: note: in instantiation of function template specialization
      'mbgl::VertexArrayObject::bind<mbgl::RasterShader, mbgl::StaticVertexBuffer>' requested here
    coveringRasterArray.bind(*rasterShader, tileStencilBuffer, BUFFER_OFFSET(0));
                        ^
1 error generated.

Haven't figured out what it is supposed to be doing.

@ljbade
Copy link
Contributor Author

ljbade commented Oct 19, 2014

Looks like an oversight in the GL_ARB_vertex_array_object not defined path, need to copy functions from the normal code:

class VertexArrayObject : public util::noncopyable {
public:
    template <typename Shader, typename VertexBuffer>
    inline void bind(Shader& shader, VertexBuffer &vertexBuffer, char *offset) {
        vertexBuffer.bind();
        shader.bind(offset);
    }

    template <typename Shader, typename VertexBuffer, typename ElementsBuffer>
    inline void bind(Shader& shader, VertexBuffer &vertexBuffer, ElementsBuffer &elementsBuffer, char *offset) {
        vertexBuffer.bind();
        elementsBuffer.bind();
        shader.bind(offset);
    }
};

@ljbade
Copy link
Contributor Author

ljbade commented Oct 19, 2014

More problems!

In file included from ../../include/mbgl/renderer/line_bucket.hpp:6:
../../include/mbgl/geometry/elements_buffer.hpp:25:11: error: call to implicitly-deleted copy constructor of 'std::array<VertexArrayObject, 1>'
        : array(std::move(rhs.array)),
          ^     ~~~~~~~~~~~~~~~~~~~~

@ljbade
Copy link
Contributor Author

ljbade commented Oct 19, 2014

Needed to add:

inline VertexArrayObject() {};

inline VertexArrayObject(VertexArrayObject &&rhs) noexcept {};

@springmeyer
Copy link
Contributor

might relate #515

@kkaefer
Copy link
Member

kkaefer commented Nov 10, 2014

Is this still relevant?

@ljbade
Copy link
Contributor Author

ljbade commented Nov 10, 2014

This was fixed in master recently.

@ljbade ljbade closed this as completed Nov 10, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants