[Nouveau] a few questions about OpenGL and nouveau

Daniel Melo Jorge da Cunha dmjcunha at gmail.com
Tue Apr 5 18:38:57 UTC 2016


Hi... I know... glBegin/glEnd is deprecated but I have an old computer
32bit CPU,
running fedora 19, mesa-9.2.4, NV63... any help are welcomed.

Please forgive if I misuderstood everything.

So I have a simple OpenGL program that draws a black background and a white
line... I will write the code of myline() inside of main() so as I can
learn.

main (..) {
X and glX stuff...

/* at this moment I think what was sent to the card was the
nv30_screen_create(...)
that valgrind--mmt outputs 0x4e000 in the first line of valgrind--mmt hex
until
PUSH_DATA (push, NV05_SIFM_COLOR_CONVERSION_TRUNCATE); which happens to be
line 65
of valgrind--mmt output */

glViewport(...);

void mydrawline(void)
{
    glClearColor(0.0, 0.0, 0.0, 1.0);
    glClear(GL_COLOR_BUFFER_BIT);

/* at this point I guess it ends up calling nv30_clear(...) which calls
BEGIN_NV04(push, NV30_3D(CLEAR_DEPTH_VALUE), 3); and the valgrind--mmt
output is
0xcfd8c in line 281 of the valgrind-mmt's output file.
As I can see there is 215 lines (from 66 to 280) of valgrind--mmt that I do
not know
from where is it coming. I could dig in nv30_state_validate(...) but at
this moment I
think nv30->dirty is 0 so validate->func(nv30) is not called. Help,
please.*/


/* This I guess is mesa stuff... */
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(0, 300, 0, 300, -1, 1);
    glMatrixMode(GL_MODELVIEW);

/*Here another question. Does glBegin end up calling a driver code like
BEGIN_NV04(...) that instructs the card to get the next 3 floats for color
more 3 for the first vertex and another 3 for the other? Also at this moment
the video card memory is already mapped (I guess...) so are these floats
fetched
by the pusher of the card and draw the line, possibly when glXSwapBuffers
is called?
Is the glColor(...) (the three floats) stored in the mmapped twice, one for
each
vertex? HELP I'M LOST :( This mine consideration is wrong... I guess...
st_draw.c
coments that all "rendering" is done through st_draw_vbo() which would end
up
calling nv30_draw_vbo() which would send data to the card... but where is
the
missing link?? The floats (for the vertices and color) are already mapped by
ctx->Driver.MapBufferRange...*/

    glBegin(GL_LINES);
    glColor3f(1.0, 1.0, 1.0);
    glVertex3f(0.0f, 0.0f, 0.0f);
    glVertex3f(50.0f, 50.0f, 1.0f);
    glEnd();
}

glXSwapBuffers();
}

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20160405/bc06dc54/attachment.html>


More information about the Nouveau mailing list