[Nouveau] more one question regarding gl and nouveau

Ilia Mirkin imirkin at alum.mit.edu
Tue Apr 19 14:04:44 UTC 2016


On Tue, Apr 19, 2016 at 8:52 AM, Daniel Melo Jorge da Cunha
<dmjcunha at gmail.com> wrote:
> Hi, for example, if I have glVertex3f(0.75, 0.75, 1.0) how the video card
> processes
> these three floats? Does the card work with floats? Does (mesa? gallium?
> driver?)
> process these three input floats before it is sent to the card? Where is the
> code
> for it?

src/mesa/vbo will upload it to a vbo. The driver then points the
hardware at the vbo and tells it to read from there. (Under some
circumstances, the vbo data might have to be transformed on the cpu as
well if the driver can't handle the format.)

>
> If you say the floats are memory mapped as in
> exec->vtx.buffer_map = (GLfloat *)ctx->Driver.MapBufferRange(...) I would
> say
> from what I learned that it has to pass through gallium and that means:
> st_draw_vbo(...) ending up in nv30_draw_vbo(..) but these functions don't
> make
> any reference to those (memory mapped) input floats. So where is the piece
> of
> code that instructs the card to fetch those three (possibly processed) input
> floats
> and send them to the card?
>
> Thanks in advance.

The vbo module converts this to the equivalent of

glGenBuffers(1, &buf)
glBindBuffer(GL_ARRAY_BUFFER, buf)
glBufferData(GL_ARRAY_BUFFER, ...)
foo = glMapBuffer(buf)
write vertex values to foo
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
draw

Hope that helps,

  -ilia


More information about the Nouveau mailing list