On 5/8/06, Aric Cyr Aric.Cyr@gmail.com wrote:
Out of curiosity, is anyone working on a HLSL->GLSL compiler? This seems like a large, non-trivial part of shader model 3 that would be required for Wine to properly implement HLSL.
At the moment, the d3d9x_##.dll files are shipped with games and those dlls convert the HLSL shaders to bytecode which we use for parsing (I think - I might be wrong about where exactly the bytecode comes from, but that's what we are using at the moment to generate shaders). Ideally, we could write our own d3d9x_## dlls to intercept the HLSL before it becomes bytecode and then perform some conversion to GLSL, but at the moment it's not needed. AFAIK, no one has done any more than talk about this type of project so far.
Current status on the implementing GLSL from the bytecode: - I have some very hacked-up code working which has successfully run a 2-line DX shader using GLSL (no, I won't submit anything yet - it's that embarrasingly bad ;-) At least I now know that it'll work. - Once all of the patches that were submitted during Alexandre's vacation make it into the master git repo, I'll get the framework submitted for implementing each DX shader opcode in GLSL. There were a couple of patches sent that were rejected, and most of the patches afterwards depended on those, so nothing is applying cleanly. That part should be resolved in the next few days [hopefully].
Jason