Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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));
    m_vertexBuf.unmap();
    m_vertexBuf.release();
    

    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