On 2/23/07, Brian Paul <[EMAIL PROTECTED]> wrote:
> Oliver McFadden wrote:
> > On 2/22/07, Brian Paul <[EMAIL PROTECTED]> wrote:
> >> 2. A stand-alone GLSL compiler.  At XDC, Dave Reveman mentioned that it
> >> would be useful for him to have a tool to convert shaders into low-level
> >> GPU programs, like those of GL_ARB_fragment_program.  It occured to me
> >> that it would be possible to write a Mesa driver (an executable,
> >> actually) that would just compile shaders and emit GPU programs.  So, I
> >> wrote a driver to do just that.  It's also described in the
> >> docs/shading.html file.
> >
> > I'd also find this very useful, too. It's nice to be able to prototype
> > shaders
> > in GLSL quickly, then convert to ARB fragment and vertex programs to get
> > finer
> > control and manual optimization.
> >
> > If you plan to implement optimization into the compiler, which I'm sure
> > you do,
> > or have done already, then it would be a good idea to include an option to
> > disable optimization, or an optimization level option (like gcc) so that
> > it's
> > still possible to produce readable output from the stand alone compiler.
>
> There's presently no control over optimization level.  I have a few
> #ifdefs in the compiler that I occasionally use for debugging, but I'd
> rather not expose them as options right now.
>
> The readability of the GPU programs isn't too bad.  I encourage people
> to try it out and see.
>
> There's lots of room for improvement in the formatting of the GPU
> programs which are emitted.  The syntax is usually not 100% legal and
> the programs require hand-editing before they can be fed back into
> glProgramStringARB().  That's an area I'll probably leave to others to
> work on.

Requiring hand editing isn't necessarily a bad thing. It's pretty hard to guess
which uniform parameter should correspond to which program.local[X]. Besides, if
you're converting a GLSL program to an ARB program, you have to edit the
parameter specifying code anyway...

The same applies to the parameters passed from GLSL vertex programs to fragment
programs. You can't figure out how they map to each other unless you compile
both the fragment and vertex program at once.

I think the easiest way would be to just emit some markers for manual editing; I
guess you could do something more complicated, but for the purpose of GLSL to
ARB conversion, I don't really see the benefit.

I hope all that made sense. ;)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to