[Mesa-dev] [Mesa3d-dev] r300g: hack around issue with doom3 and 0 stride

Luca Barbieri luca at luca-barbieri.com
Sun Apr 11 01:33:31 PDT 2010


Why?

At least all nVidia cards directly support this, and it allows code like this:

hw_set_vertex_attrib(idx, v)
{
    write command to set vertex attrib on GPU fifo
    write idx on GPU fifo
    write v on GPU fifo
    return;
}

glColor()
{
    pipe->set_vertex_attrib(COLOR, v);
    return;
}

Instead of this simple approach, we instead currently use the "vbo
module", which attempts to store all the GL attributes in a vertex
buffer, with all kinds of unnecessary complexity like having to resize
the buffer in the middle of a primitive because you just used another
vertex attribute, having to deal with memory allocation, vertex
element CSO hashing and so on.

Of course this results in not-so-good performance, which could
otherwise be avoided with the approach described above (guess what the
binary drivers use).

I have no idea whether Radeon or Intel GPUs support this, but it
doesn't seem unlikely since it is the basic OpenGL model.


More information about the mesa-dev mailing list