This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

OpenGL ES 2.0: glDrawArrays(GL_LINES, ) drawing problem on Mali-T830 GPU

Hello Mali developers!

I have Samsung Galaxy J7(2016) device with Mali-T830 GPU.

The simple code with drawing of line list causes some graphics artifacts, i changed code from QT example hellogl2.

Code:

static const char *vertexShaderSource =  

     "attribute vec4 vertex;\n"

   "uniform mat4 projMatrix;\n"

     "uniform mat4 mvMatrix;\n"

     "void main() {\n"

          "gl_Position = projMatrix * mvMatrix * vertex;\n"

     "}\n";

     static const char *fragmentShaderSource =
          "void main() {\n"

               "gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n"

          "}\n";

void GLWidget::initializeGL()

{

...

     m_program = new QOpenGLShaderProgram;

     m_program->addShaderFromSourceCode(QOpenGLShader::Vertex, vertexShaderSource);

     m_program->addShaderFromSourceCode(QOpenGLShader::Fragment, fragmentShaderSource);

     m_program->bindAttributeLocation("vertex", 0);

     m_program->link();

     m_program->bind();

     m_projMatrixLoc = m_program->uniformLocation("projMatrix");

     m_mvMatrixLoc = m_program->uniformLocation("mvMatrix");

...

}

void GLWidget::CreateBuffer(const void* data, size_t size, uint& vb)

{

     glGenBuffers(1, &vb);

     glBindBuffer(GL_ARRAY_BUFFER, vb);

     CheckOpenGLErrorImpl();

     glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW);

}

void GLWidget::DrawLines(const VertexData& gridData)

{

     glBindBuffer(GL_ARRAY_BUFFER, gridData.vb);

     glEnableVertexAttribArray(0);

     glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), 0);

     glDrawArrays(GL_LINES, 0, gridData.numVertices);

}

void GLWidget::paintGL()

{

     m_program->bind();

     m_program->setUniformValue(m_projMatrixLoc, m_proj);

     m_program->setUniformValue(m_mvMatrixLoc, m_camera * m_world);

     DrawLines(gridData);

}

I attached the simple project with Qt, apk file and some screeenshots. The last screenshot shows correct image from Samsung Galaxy Tab 4 7.0(Vivante GC1000 GPU, OpenGL ES 2.0)

Bug1.png Bug2.png Valid.png

OpenGL ES Info from Mali-T830 GPU:

glGetString(GL_RENDERER): Mali-T830

glGetString(GL_VENDOR): ARM

glGetString(GL_VERSION): OpenGL ES 3.1 v1.r7p0-03rel0.dec36ba15c3f1bc697cb53aefb95b03e

On other devices it working without artefacts(Nexus 7, Samsung Galaxy Tab 4), also it working on IOS(IPhone 6+, IPod 6).

May be this is depth buffer problem or invalid clipping of the line between screen coords ?

10827.zip