Qt World Summit: Register Today!

Why is in Qt/Opengl glMapBuffer slower than glBufferData?

  • I tried on Android for a huge terrain model (around 10Mill vertices/indices, 250MB)

    m_vertexBuf.allocate(m_pVertices->size() * sizeof(QVector4D));
    void* buffer_data = m_vertexBuf.map(QOpenGLBuffer::WriteOnly);
    memcpy(buffer_data, m_pVertices->constData(), m_pVertices->size() * sizeof(QVector4D));

    instead of

    m_vertexBuf.allocate(m_pVertices->constData(), m_pVertices->size() * sizeof(QVector4D));

    but it's 0.4sec slower(!) during loading.

Log in to reply