Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).


Comment: Re:Not there yet for "real" interactive framerates (Score 2, Informative) 139

by mdmccool (#10327868) Attached to: Metaprogramming GPUs with Sh
It's similar to preshaders (we thought of the idea independently, and call it something different in the book... uniform lifting... but it is basically the same idea). So I guess it's a little unfair to say "an optimization that no other shading language provides". It also would be possible, in theory, for OpenGL SL implementations to provide this optimization.

In Sh, though, this optimization is internal and automatic, and so invisible to the user. It's important to do it that way, because the shader algebra in Sh lets you turn uniforms into inputs and vice-versa. If you convert an input to a uniform, new uniform lifting optimizations become available, and vice-versa. The system keeps track of the "preshaders" for you in this case, and actually includes a dependency tracking and lazy update system internally. You can create your own "dependent uniforms" if you want, but in general it's unnecessary for a user to worry about or explicitly define lifted computations.

The idea is also related to hoisting computations out of loops. If you think of the data-parallel shading of vertices or fragments as a loop over all vertices and fragments...

Is your job running? You'd better go catch it!