<div dir="ltr"><div><div>Hi, TBH not even I know what do I want :)))<br><br></div>The "dirty...", "I think, but am not sure..." and "The gallium<br>state tracker..." paragraphs are enough "food for thought" for me.<br><br></div><div>I'll spend eons digging it... Thank you.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-05 14:54 GMT-04:00 Ilia Mirkin <span dir="ltr"><<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Apr 5, 2016 at 2:38 PM, Daniel Melo Jorge da Cunha<br>
<<a href="mailto:dmjcunha@gmail.com">dmjcunha@gmail.com</a>> wrote:<br>
> Hi... I know... glBegin/glEnd is deprecated but I have an old computer 32bit<br>
> CPU,<br>
> running fedora 19, mesa-9.2.4, NV63... any help are welcomed.<br>
<br>
</span>I've fixed a *ton* of nv3x/nv4x issues since then, I'd recommend<br>
giving Mesa 11.2.0 a whirl.<br>
<span class=""><br>
><br>
> Please forgive if I misuderstood everything.<br>
><br>
> So I have a simple OpenGL program that draws a black background and a white<br>
> line... I will write the code of myline() inside of main() so as I can<br>
> learn.<br>
><br>
> main (..) {<br>
> X and glX stuff...<br>
><br>
> /* at this moment I think what was sent to the card was the<br>
> nv30_screen_create(...)<br>
> that valgrind--mmt outputs 0x4e000 in the first line of valgrind--mmt hex<br>
> until<br>
<br>
</span>You'll want to use demmt, part of envytools. It should auto-decode<br>
stuff. If it doesn't, let me know (and send me the mmt).<br>
<span class=""><br>
> PUSH_DATA (push, NV05_SIFM_COLOR_CONVERSION_TRUNCATE); which happens to be<br>
> line 65<br>
> of valgrind--mmt output */<br>
><br>
> glViewport(...);<br>
><br>
> void mydrawline(void)<br>
> {<br>
> glClearColor(0.0, 0.0, 0.0, 1.0);<br>
> glClear(GL_COLOR_BUFFER_BIT);<br>
><br>
> /* at this point I guess it ends up calling nv30_clear(...) which calls<br>
> BEGIN_NV04(push, NV30_3D(CLEAR_DEPTH_VALUE), 3); and the valgrind--mmt<br>
> output is<br>
> 0xcfd8c in line 281 of the valgrind-mmt's output file.<br>
> As I can see there is 215 lines (from 66 to 280) of valgrind--mmt that I do<br>
> not know<br>
> from where is it coming. I could dig in nv30_state_validate(...) but at this<br>
> moment I<br>
> think nv30->dirty is 0 so validate->func(nv30) is not called. Help,<br>
> please.*/<br>
<br>
</span>dirty definitely shouldn't be 0... it has to bind a framebuffer at least.<br>
<span class=""><br>
><br>
><br>
> /* This I guess is mesa stuff... */<br>
> glMatrixMode(GL_PROJECTION);<br>
> glLoadIdentity();<br>
> glOrtho(0, 300, 0, 300, -1, 1);<br>
> glMatrixMode(GL_MODELVIEW);<br>
><br>
> /*Here another question. Does glBegin end up calling a driver code like<br>
> BEGIN_NV04(...) that instructs the card to get the next 3 floats for color<br>
> more 3 for the first vertex and another 3 for the other? Also at this moment<br>
> the video card memory is already mapped (I guess...) so are these floats<br>
> fetched<br>
> by the pusher of the card and draw the line, possibly when glXSwapBuffers is<br>
> called?<br>
> Is the glColor(...) (the three floats) stored in the mmapped twice, one for<br>
> each<br>
> vertex?<br>
<br>
</span>I think, but am not sure, that it will come in as a constant attribute<br>
(i.e. a VBO attribute with stride 0).<br>
<span class=""><br>
> HELP I'M LOST :( This mine consideration is wrong... I guess...<br>
> st_draw.c<br>
> coments that all "rendering" is done through st_draw_vbo() which would end<br>
> up<br>
> calling nv30_draw_vbo() which would send data to the card... but where is<br>
> the<br>
> missing link?? The floats (for the vertices and color) are already mapped by<br>
> ctx->Driver.MapBufferRange...*/<br>
<br>
</span>The gallium state tracker does not support immediate vertex<br>
submission. There's a "vbo" layer in front of it which converts<br>
immediate vertex submissions into writes to a VBO, which is then bound<br>
and drawn with.<br>
<br>
You may be interested in doing GALLIUM_TRACE=foo.xml [on a debug mesa<br>
build] which will create an xml file of all the state tracker calls.<br>
It will show you the VBO setup, etc.<br>
<br>
State is only emitted at draw time (or something like blits, clears,<br>
etc). So doing glViewport() does nothing. It dirties internal state,<br>
which is then emitted at draw time.<br>
<br>
TBH I'm not sure what your actual question is... but hope I've<br>
answered at least some of it?<br>
<span class="HOEnZb"><font color="#888888"><br>
-ilia<br>
</font></span></blockquote></div><br></div>