<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><P>Hello,</P><P></P><P>I'm taking a stab at implmenting D3DXAssembleShader, which takes shader instructions like "mul r1, r2.xy, r3.z" and turns them into binary code (one-to-one mapping). Although I've got very little clue what I'm really doing, I've come quite a way on a parser that breaks it down into the separate parts and made some reverse lookups on tables of opcodes, registrys, masks etc. that I found in the wine code. I've basicly come so far that I got the parts like mul = 0x00000005, r = temp registry = 0x00000000, register number = 0x00000001, writemask = 0x000F0000 etc. for all the arguments, but I'm struggling a bit putting it all together into the correct binary format. I have found a lot of material on the *text* format of the shader instructions, but pretty much none on the binary format. Clearly some documentation must have been used/made when
 you implemented glsl and the other shader backends as they read this stuff and translates it to OpenGL calls. Does anyone have anything they could share with me? </P><P></P><P>P.S. Don't expect too much of me though, 1) It's so ugly it makes grown men cry, 2) Current it leaks memory bigtime and 3) It's a text hack that will never validate shader code or anything like that BUT I think I can make this work for code that already works.</P><P></P><P>On a different note, a game I have is pulling up two completely unknown texture formats R16 and AL16 as fourcc. I figured I could at least find out something about them and add them to the debug tables, but the only references I find on google are to wine and wine bug reports. I figure they may be related to R16F (same with ints?) and L16 (luminosity, so AL16 with alpha?) but I can't find anything on them.</P><P></P><P>Oh yeah and for the misc question - where's the right place to add test code? I expect
 my D3DXAssembleShader function will need a lot of it - at least one for each opcode, registry tests, write mask tests, whitespace and commenting tests+++. No code for you to review yet, not until it works. THEN you can bring out the tar and feathers over the code. </P><P></P><P>Regards,</P><P>Kjell Rune</P></td></tr></table><br>


      <hr size=1><br><table><tr><td>Alt i ett. Få <a href=http://no.mail.yahoo.com>Yahoo! Mail</a> med adressekartotek, kalender og notisblokk.</td></tr></table>