Drealmer
Drealmer

Reputation: 5676

Can "Uninitialized Buffer Data" be a false positive in OpenGL ES Analyzer?

When rendering only a subset of an index buffer, if the rest of the buffer contains indices of uninitialized vertices, the "OpenGL ES Analyzer" from Instruments seems to reports an "Uninitialized Buffer Data" warning.

Is it safe to ignore? Is there a way to get rid of it? Could it hide a real problem?

Upvotes: 3

Views: 660

Answers (1)

Martin Berger
Martin Berger

Reputation: 1708

contains indices of uninitialized vertices -> "Uninitialized Buffer Data"

Is it safe to ignore?

No. Because you may have set incorrect value for subset and illegal memory access can occur.

Is there a way to get rid of it?

Yes. Initialize your vertices. Or vertex buffer object (VBO) if you use one.

Could it hide a real problem?

No. It says clearly what your problem is.

This here snippet from my app with rendering only a subset of buffer:

glBindVertexArrayOES(_vertexArrays[currentObjectIndex]);
glUseProgram(_program);
glUniformMatrix4fv(uniforms[UNIFORM_MODELVIEWPROJECTION_MATRIX], 1, 0, _mvpMatrices[currentObjectIndex].m);
ObjectGL* object = [self.graphicsDataSource.arrayOfObjects objectAtIndex:currentObjectIndex];
// first part of buffer
glDrawArrays(GL_TRIANGLES, 0, section_object.sglSize);
// second part of buffer, accessed with offset given by second parameter
glDrawArrays(GL_LINE_LOOP, section_object.sglSize, section_object.sglSizeBounds); 

Upvotes: 1

Related Questions