[Mesa-dev] GLSL IR int-to-float pass
Keith Whitwell
keithw at vmware.com
Wed May 25 06:41:48 PDT 2011
On Wed, 2011-05-25 at 09:32 -0400, Jerome Glisse wrote:
> On Tue, May 24, 2011 at 8:09 PM, Bryan Cain <bryancain3 at gmail.com> wrote:
> > Hi,
> >
> > In the past few days, I've been working on native integer support in my
> > GLSL to TGSI translator. Something that's come to my attention is that
> > supporting Gallium targets with and without integer support using a
> > single GLSL IR backend will more or less require a GLSL IR pass to
> > convert int, uint, and possibly bool variables and operations to floats.
> >
> > Currently, this is done directly in the backend, in both ir_to_mesa and
> > st_glsl_to_tgsi. However, the mod_to_fract and div_to_mul_rcp lowering
> > passes for GLSL IR need to know whether to lower integer modulus and
> > division operations to their corresponding float operations. (They both
> > do this in Mesa master without asking the backend, but that will be easy
> > to change later.) So a GLSL IR pass will be needed to do the type lowering.
> >
> > Such a pass would also have the advantage of less duplicated
> > functionality between backends, since ir_to_mesa could also take
> > advantage of the pass to eliminate some code.
> >
> > I'm more than willing to try writing such a pass myself if no one else
> > is interested in doing it, but I figure I should make sure there are no
> > objections before starting on it.
> >
> > Bryan
>
> TGSI needs to grow type support (int, uint and possibly int8,16,32..)
Or go away entirely...
I'm not trying to impose a direction on this, but it seems like the GLSL
IR->TGSI converter (once running) could be pushed down into the
individual drivers and GLSL IR or a close cousin of it could become the
gallium-level interface. Then individual drivers could be modified to
consume IR directly.
Keith
More information about the mesa-dev
mailing list