D3DXAssembleShader, unknown texture formats and misc

Stefan Dösinger stefan at codeweavers.com
Fri Oct 3 10:12:34 CDT 2008


I have a mostly finished assembler, and a HLSL compiler in the works. I have a git tree out there which has the patches, but the server is currently shut down. I'm currently away from home, but I'll return tomorrow. If I forget to reply, can you remind me in a few days?

 

From: wine-devel-bounces at winehq.org [mailto:wine-devel-bounces at winehq.org] On Behalf Of Kjell Rune Skaaraas
Sent: Thursday, October 02, 2008 1:57 PM
To: wine-devel at winehq.org
Subject: D3DXAssembleShader, unknown texture formats and misc

 


Hello,

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.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.

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.

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. 

Regards,

Kjell Rune

 

  _____  

 


Alt i ett. Få Yahoo! <http://no.mail.yahoo.com>  Mail med adressekartotek, kalender og notisblokk.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winehq.org/pipermail/wine-devel/attachments/20081003/919acf32/attachment.htm 


More information about the wine-devel mailing list