On Tue, Feb 16, 2016 at 5:31 PM, Nicolai Hähnle <nhaeh...@gmail.com> wrote:
> So, patches 12-16 also look good to me except for the comments I've sent on
> 12-14.
>
> I'm a bit worried though that there is a lot of "almost code duplication"
> around the handling of input and output positions etc., and maintaining the
> two different code paths for monolithic and non-monolithic is brittle.
>
> Here's an approach that I think could work to clean this up: keep only the
> non-monolithic code for LLVM IR function generation. Then implement
> monolithic mode with a helper that takes a sequence of LLVM IR functions and
> generates a master function that pipes each function's output into the input
> of the next. Then set the functions as always inline and rely on LLVM's
> inliner to stitch everything together.
>
> This ends up with slightly higher overhead for the monolithic code path
> (although the unconditional inlining should be fast), but it would help
> clean the code up tremendously.

Yes, I had the same idea. However, the incremental approach was the
most bearable way to do it and made fixing regressions and hangs a lot
easier. Doing a complete rewrite from monolithic to non-monolithic
would be a lot more frustrating.

Cleaning this up is definitely a good idea, but we need to make it all
more useful first and add an on-disk shader cache to mesa/main. That
will be quite a project too.

Marek
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to