More on GPU's: RapidMind

Craig Black cblack at ara.com
Fri Jul 13 07:43:15 PDT 2007


> Like I said in another thread, RapidMind is an extension/evolution of the 
> open software research project called Sh.  That would be a good place to 
> look for more implementation details if the RapidMind source code is not 
> easy to obtain.  Sh is really meant for writing nifty looking visual 
> shaders, but the basic idea is the same -- take an algorithmic description 
> in C++, metaprogram it to death, and out pops on-the-fly generated GPU 
> shader programs on the other end.
>
> With RapidMind they've apparently generalized it to work for other back 
> ends, but I would bet the core ideas used in both are the same.
>
> And in any event, even if RapidMind in D is too big a project, something 
> like Sh in D would still be a nice demo of D's power.  If it doesn't come 
> to a grinding halt because of symbol length limitations in OPTLINK. :-)
>
> --bb

I'm not so sure that they even use C++ metaprogramming features.  I'm not 
exactly sure but I suspect that they use macros to turn the shader code into 
a text string, which they parse and compile to a real shading language. 
That way they can define the language however they want.  I think the trick 
is that they make their syntax look like C++ syntax so that it seems to fit 
together properly.

-Craig 





More information about the Digitalmars-d mailing list