[Mesa-users] Driver call and TGSI IR Bytestream

Brian Paul brianp at vmware.com
Wed Jul 17 08:45:11 PDT 2013


On 07/16/2013 03:04 PM, Daniel Melo Jorge da Cunha wrote:> Hi, I have 3 
questions. Please be nice... I'm struggling myself...
 >
 > Let's say I am in file src/gallium/auxiliary/cso_cache/cso_context.c.
 > So, there is a function call pipe->draw_vbo(pipe, info) in the
 > function cso_draw_vbo(...).
 >
 > 1- Is this function call (pipe->draw_vbo(pipe, info)) really calling,
 > for a NV30 driver, pipe->draw_vbo = nv30_draw_vbo? Or for other driver
 > like NVC0, is it really calling pipe->draw_vbo = nvc0_draw_vbo?

Yes.

 > 2- If it is so, how could (mesa3d? gallium3d? X? ddx? the responsible)
 > call the correct one for the correct driver?

There's some bootstrap code that finds the right driver and its "create 
screen" function.  In the case of DRI/GLX, look at 
src/gallium/state_tracker/dri/drm/dri2.c's dri2_init_screen() function. 
  Once we have the create_screen function we can use that to create a 
pipe_context.  When a driver creates a context it plugs its draw_vbo() 
function into the context along with all the other per-context methods.


 > 3- Is the pipe and info arguments in the function call mentionated
 > the encoded TGSI IR Bytestream? If it is not, how and where is it
 > encoded?

I'm not quite clear on your question, but pipe_draw_info only contains 
the info for what to draw (number of vertices, etc).  There are separate 
functions for creating/binding shaders - that's where TGSI comes in.

-Brian




More information about the mesa-users mailing list