marciano wrote:
Another thing I want to add is a general shader preamble. This is just a string settable through the API that is added at the beginning of all shaders. The shader preamble could contain platform-specific defines that make it possible to write conditional code paths using #ifdef. For example you could create different paths for shader model 2.0 and 3.0 hardware.
This is a very good idea.
marciano wrote:
Finally I was thinking about implementing a small preprocessor that makes it possible to use #inlcude in the shaders. This would repalce the current InsCode/DefCode mechanism. The advantage is that also plain text code resources could include other code resources. But on the other hand that would prohibit the described system for the line numbers. So I dropped the idea again.
Scratch what I just said. My solution would have required parsing the glsl error logs manually, and I don't imagine that the error logs are portable.