[Mesa-users] Driver call and TGSI IR Bytestream

Daniel Melo Jorge da Cunha dmjcunha at gmail.com
Wed Jul 17 12:10:55 PDT 2013


First, thank you for the previously two answers. I have already a lot to
study.
But regarding TGSI there is little information about it in the internet and
it is
confusing.

For example:http://people.freedesktop.org/~csimpson/gallium-docs/tgsi.html
says: "TGSI is the only intermediate representation used by all drivers"

so we may suppose it deals only with shaders as you said.

But what strikes me is: http://dri.freedesktop.org/doxygen/gallium/tgsi.html
when it says: "All Mesa vertex/fragment programs and shaders are translated
into the TGSI representation before being passed to the driver. In turn,
the driver
will convert the TGSI instructions into GPU-specific instructions"

so I presume TGSI is a complete intermediate representation that will pass
all the necessary information to the drivers in order the drivers will
write the
GPU specific code.

Sorry for the lameness.
Again, thank you very much!


2013/7/17 Brian Paul <brianp at vmware.com>

> 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
>
>
> ______________________________**_________________
> mesa-users mailing list
> mesa-users at lists.freedesktop.**org <mesa-users at lists.freedesktop.org>
> http://lists.freedesktop.org/**mailman/listinfo/mesa-users<http://lists.freedesktop.org/mailman/listinfo/mesa-users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-users/attachments/20130717/3d3b9640/attachment.html>


More information about the mesa-users mailing list