Things have been slow recently on the main branch due to work on a massive rewrite of the compiler. Currently, the compiler was mostly a proof of concept, doing a direct translation of the parsed syntax tree into a corresponding javascript representation. While this approach produces a pretty good result, there are some things which would not have worked or would have been extremely difficult to implement as such (e.g. LHS swizzles). Furthermore, a full rewrite would have been necessary anyway to output different targets, such as when Flash Stage3D/AGAL support is built in. This rewrite should be complete in the next week or two.
When done, the new compiler will function as a GLSL->ARB compiler, meaning that it could in theory be used to produce real ARB assembly code, though most likely the output will be very unoptimized.
On the back-end will be a set of translators from ARB to other output formats. At first, it will be limited to an ARB->Javascript translator, but an AGAL translator should be extremely easy to implement afterwards. This leads to all sorts of interesting usage possibilities, such as the ability to debug production shaders in javascript using a virtual GPU/debugger, even if the required level of performance is too great to use the library for software emulation. Also of interest will be the eventual integration of Flash, and for pure-flash developers/applications, the ability to compile GLSL down to AGAL without having to pay for or install external software might be very appealing.
Does anyone have any other ideas?
3 Responses to GLSL Compiler Rewrite