From: Matt S. <ma...@ki...> - 2003-04-29 16:53:42
|
> -----Original Message----- > From: Keith Whitwell [mailto:ke...@tu...] > Sent: Tuesday, April 29, 2003 3:34 PM > To: Matt Sealey > Cc: DRI developer's list > Subject: Re: [Dri-devel] r200 driver questions from a dri development > newbie idiot :) > > > Matt Sealey wrote: > > Hello, > > > > If the vertex size is 4 or 6, what is being stored in the next > > 3 values, and why are they taken from the vb.vertex array? > > Color, texcoords, secondary color, etc. The rest of the vertex in other > words. This feeds the cards whole vertices in contiguous dma buffers, which > is a faster path than sending it random color,texcoord,etc values. Sure, but which one is it? :) I have a structure we call TQAVTexture which I can fill, but I have absolutely no clue what DRI is pushing from vb.vertex[i].i into this dma buffer. > Have a look at what's happening in the embedded-1-branch of mesa cvs - it > looks like that will shortly support 3 window systems - xfree86/dri, fbdev and > (coming soon?) directfb. Well I was using that but it still makes little sense to me given that I can't tell what it's doing. "f" and "i" are not the most intuitive of variable names, and when they're in a union.. eek :) > > I basically can't find any other code (after 10 minutes of > > variations on "grep vertex *.c") that *assigns* values to this > > array, let alone what the purpose of retreiving those values > > is..) > > Have a look at what happens to texcoordptr, floatcolorptr, etc in those files > - they get set to point into vb.vertex[] and later on (eg in Color3f or > elsewhere), those pointers are dereferenced & assigned. Right, so let me get this straight. Some functions like glTexCoord2f() or glColor3f() are called. This determines the "size" of the vertex. Then, when glVertex3f() is called, finally, the Vertex3f structure fills the xyz first, then it simply places all the colour information and texture coords after it (in an arbitrary order, since the Radeon is cute like that). So... All I have to do is work out which vb.vertex[i] offset points to which values..? Oh ho ho. It all became clear for a second :) -- Matt Sealey <ma...@ki...> |