On Thursday, 10 July 2014 at 00:22:39 UTC, Tofu Ninja wrote:


I think its a fine abstraction level, buffers and shaders are not
hard concepts at all. All api's that Aurora is going to be based
on offers them as well as all modern gpu's support them. If
shaders were written in a DLS then in the case where Aurora needs to fall back to software rendering then they can be translated to
D code and mixed right in. When they need to be turned into some
api specific shader then they could be translated at compile
time(the differences should mostly just be syntax). If the DSL
was a subset of D then that would simplify it even further as
well as make the learning curve much smaller. Its a perfectly
fine level of abstraction for any sort of graphics that also
happens to be supported very well by modern GPU's. I don't see
the problem.

You might want to look at what bgfx does: https://github.com/bkaradzic/bgfx
It provides a shader compiler to various supported backends.

Abstracting shaders more or less mandates having a shader compiler from your language to graphics API out there. It does make an additional build step. Compiling such a shader abstraction language at compile-time seems a bit optimistic to me.

Reply via email to