Skip to content

Application locks when sending few vertices at a time #111

@mardy

Description

@mardy

Bug Report

This is a "funny" one. An application sending lots of glBegin()/glEnd() with very few vertices in them (say, just a triangle) ends up locking the Wii (on Doplhin this issue does not happen):

glBegin(GL_TRIANGLES);
glNormal3f(0.6983, -0.2564, -0.6683);
glVertex3f(0.0045, -0.001628, 8.2e-05);
glNormal3f(0.594, -0.4907, -0.6375);
glVertex3f(0.003717, -0.00307, 0.000116);
glNormal3f(0.364, -0.6469, -0.6701);
glVertex3f(0.002371, -0.004133, 9e-05);
glEnd();
glBegin(GL_TRIANGLES);
glNormal3f(0.364, -0.6469, -0.6701);
glVertex3f(0.002371, -0.004133, 9e-05);
glNormal3f(0.4056, 0.629, -0.6632);
glVertex3f(0.002408, 0.004109, 6.2e-05);
glNormal3f(0.6983, -0.2564, -0.6683);
glVertex3f(0.0045, -0.001628, 8.2e-05);
glEnd();

While debugging the issue, I noticed that adding aGX_DrawDone() in opengx near the end of glEnd() was making this issue go away, and then I verified that a ppcsync() call is good enough to fix the issue. On the application side, removing the useless glEnd() / glBegin() pairs also makes the issue disappear.

I believe this happens because the amount of the data sent into the pipe might be less than 32 bytes. It's as if the GX pipe is getting full without GX realizing it.

I'm not rushing to fix this bug, since working around it in the application is easy, and because it's not clear to me yet if the bug is in opengx or in libogc's GX API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions