Re: D3D shader assembler (round 2)

2009-08-13 Thread Henri Verbeet
2009/8/13 Stefan Dösinger : > I'd say give wine-patches a try :-) Make sure Alexandre can see how these > patches will work together with the wpp ones and the actual implementation of > D3DXAssembleShader > If you do, try to split it up a bit more where possible, it's still a pretty large patch to

Re: D3D shader assembler (round 2)

2009-08-13 Thread Stefan Dösinger
Am Wednesday 12 August 2009 21:57:36 schrieb Matteo Bruni: > > I think it doesn't need two include files, especially since both of them > > are d3dx9-private anyway. The question is, is it better to just merge > > them into d3dx9_36_private.h, or have assembler things in a separate > > file? I tend

D3D shader assembler (round 2)

2009-08-12 Thread Matteo Bruni
2009/8/10 Stefan Dösinger : > Hi, > A few comments - mostly things I haven't spotted earlier. Hi, I fixed the code, almost completely following your reviews (thank you, of course). I'm reporting the differences with your suggestions: > >> --- /dev/null >> +++ b/dlls/d3dx9_36/asmshader.h >> --- /d

Re: D3D shader assembler (round 2)

2009-08-10 Thread Henri Verbeet
I only looked at the first patch. 2009/8/9 Matteo Bruni : > +static void asmparser_instr(struct asm_parser *This, DWORD opcode, ... > +if(srcs) { > +for(i=0; inr; i++) { ... > +if(srcs && (srcs->nr != expectednsrcs)) { ... > +if(srcs) { > +for(i=0; inr; i++) { You can s

Re: D3D shader assembler (round 2)

2009-08-10 Thread Stefan Dösinger
Hi, A few comments - mostly things I haven't spotted earlier. > --- /dev/null > +++ b/dlls/d3dx9_36/asmshader.h > --- /dev/null > +++ b/dlls/d3dx9_36/asmshader_private.h I think it doesn't need two include files, especially since both of them are d3dx9-private anyway. The question is, is it bette

Re: D3D shader assembler

2009-07-20 Thread Stefan Dösinger
Am Monday 20 July 2009 20:33:44 schrieb Henri Verbeet: > > While in principle this is right, as many functions are indeed very > > similar, this won't be pretty practically, even excluding that some > > instructions really need special treatment. One more thing comes to my mind here: The assembler

Re: D3D shader assembler

2009-07-20 Thread Henri Verbeet
2009/7/20 Matteo Bruni : > 2009/7/20 Henri Verbeet : >> Yeah, but you can treat the debug output just like another >> asmparser_backend. That would mean calling the parser twice when >> debugging, but that should be ok. You can do something similar on the >> bytecode writing side. > > I'm not so pe

Re: D3D shader assembler

2009-07-20 Thread Matteo Bruni
2009/7/20 Henri Verbeet : > 2009/7/20 Matteo Bruni : >> That function, in particular, should really be into asmparser.c and >> not be visible from outside. Then the wine_dbg_sprintf() function >> comes really handy in this situation, I didn't know it. Note also that >> this debug_src function is us

RE: D3D shader assembler (Matteo Bruni)

2009-07-20 Thread Matteo Bruni
2009/7/20 "Luis C. Busquets Pérez" : > I read several months ago that the itnetion was to create the assembler > inside the wined3d and then use its functionality inside the diverse d3dx9 > implementations. Has this changed? I think it was Stefan Dösinger sho > proposed it: > > d3dx -> wined3d asse

Re: D3D shader assembler

2009-07-20 Thread Henri Verbeet
2009/7/20 Matteo Bruni : > That function, in particular, should really be into asmparser.c and > not be visible from outside. Then the wine_dbg_sprintf() function > comes really handy in this situation, I didn't know it. Note also that > this debug_src function is used just to print trace info duri

Re: D3D shader assembler

2009-07-20 Thread Stefan Dösinger
Am Monday 20 July 2009 01:38:35 schrieb Matteo Bruni: > 2009/7/19 Henri Verbeet : > > 2009/7/19 Matteo Bruni : > >> +const char *debug_src(struct shader_reg *reg, BOOL vs) { > >> +    static char buffer[128]; > >> + > >> +    memset(buffer, 0, sizeof(buffer)); >> > >  - "buffer" is static. Using wi

Re: D3D shader assembler

2009-07-19 Thread Stefan Dösinger
Am Sunday 19 July 2009 23:01:08 schrieb Henri Verbeet: > > +const char *debug_src(struct shader_reg *reg, BOOL vs) { > > +static char buffer[128]; > > + > > +memset(buffer, 0, sizeof(buffer)); > > This really isn't acceptable: > > Note that I think your mentor should have caught basic thing

RE: D3D shader assembler (Matteo Bruni)

2009-07-19 Thread Luis C. Busquets Pérez
I read several months ago that the itnetion was to create the assembler inside the wined3d and then use its functionality inside the diverse d3dx9 implementations. Has this changed? I think it was Stefan Dösinger sho proposed it: d3dx -> wined3d assembler the wined3d will be re-usable and the

Re: D3D shader assembler

2009-07-19 Thread Matteo Bruni
2009/7/19 Henri Verbeet : > 2009/7/19 Matteo Bruni : >> Hi to everybody, >> I'm sending here the main assembler patch for reviews and suggestions. >> It is bzipped as it is quite a big patch, but I couldn't find a >> meaningful way to split it. > It really is much easier to review as separate patch

Re: D3D shader assembler

2009-07-19 Thread Henri Verbeet
2009/7/19 Matteo Bruni : > Hi to everybody, > I'm sending here the main assembler patch for reviews and suggestions. > It is bzipped as it is quite a big patch, but I couldn't find a > meaningful way to split it. It really is much easier to review as separate patches. The part that follows is reall

D3D shader assembler

2009-07-19 Thread Matteo Bruni
Hi to everybody, I'm sending here the main assembler patch for reviews and suggestions. It is bzipped as it is quite a big patch, but I couldn't find a meaningful way to split it. A quick mile-high overview: the assembler is divided in a parser and a bytecode writer. The parser is made by the flex