Am Montag, 31. März 2008 08:54:18 schrieb H. Verbeet:
On 31/03/2008, Stefan Dösinger stefandoesinger@gmx.at wrote:
With WineD3D working on the same language, we have to share the language definition between the shader library and WineD3D, or put the shader compiler into WineD3D as well. I do not like the 2nd way, as it puts things together that don't have to be in one lib, and wastes runtime memory. A 3rd way I have to consider was a SlReadShader() function with callbacks which takes over the current role of shader_generate_main() in WineD3D. I am not quite convinced by this either.
Looks reasonable enough in general. I guess it would make sense to create some kind of "shader utilities" library that can be used from both wined3d and d3d9x.
Right, that is my plan. Although I am not sure yet in which way wined3d would use it. It might be best off by just parsing the asm tree itself.
You could in principle even move GLSL/ARB code generation in there, although that isn't required of course.
Not really, because the GLSL/ARB code generator doesn't compile shaders, it configures the GL pipeline. As such, it depends on many other things like the textures that are bound, the vertex declaration, etc.