Hello.
I am developing a games for android. There is a device Samsung Galaxy S3 with gpu Mali-400MP, android version 4.3. I have a problem when rendering buffer in parts. I wrote a test application to demonstrate the problem.
First I created a vertex buffer and fill them with random values. Then created an index buffer with random values, but within the number of vertices.
If draw the entire buffer, then all is well.
GLES20.glDrawElements(GLES20.GL_TRIANGLES, ICOUNT, GLES20.GL_UNSIGNED_SHORT, 0);
But if I try to draw one triangle, application fail at random iteration.
private int i_offset = 0;
...
GLES20.glDrawElements(GLES20.GL_TRIANGLES, 3, GLES20.GL_UNSIGNED_SHORT, i_offset*2);
i_offset += 3;
if((i_offset + 3) > ICOUNT) i_offset = 0;
What could be the problem? On the other gpu all drawn normally.
Hi alexandr,
I've created a ticket for this to be looked at (MPDDEVREL-1074), and we'll get back to you with any findings. Thanks for the reproducer
Thanks,
Chris
Chris, thanks for help.
I want to clarify, after a reboot device the previous application for reproduce the error wont work. But I created a new application that shows the error.
Is there any new information on this issue?
Just assigned this to myself so will take a look
Am still looking into this but your code looks fine to me so definitely a driver bug. Thanks for the report and reproducer! I am also seeing some strange interactions with reboots, for me it can work absolutely fine for multiple runs, then reboot and it fails every time thereafter, very strange.
Hi Chris!
Thanks for you help. Is it possible to avoid the problem, if still work with the index buffer, or find out in what versions of driver it exists, to determine the conditions for choosing another way of drawing?
Hi alex.
Have got it triggering every time now with indices 8191, 6948, 8190. It doesn't matter what the vert data is, but seems to trigger based on some interaction between delta and offset of indices. We're still looking into it, but until we know exactly what's causing it, I'd recommend reordering your verts so the delta between them is as small as possible (think Forsyth triangle reordering, but also reordering the verts themselves to line up linearly in order of access. This is a good optimization anyway). The driver version can be found in the /system/lib/libMali.so file by grepping for REVISION, but isn't queryable in GLES to my knowledge.
UPDATE: Does not reproduce on trunk, so is fixed. Checking r4p0 (latest release) also.
UPDATE: Doesn't reproduce on r4p0 either, so has been fixed there also.
Hope this helps,