crosire / d3d8to9

A D3D8 pseudo-driver which converts API calls and bytecode shaders to equivalent D3D9 ones.
BSD 2-Clause "Simplified" License
880 stars 78 forks source link

D3DXAssembleShader can't handle D3DXASM_DEBUG flag #64

Closed PatrickvL closed 6 years ago

PatrickvL commented 6 years ago

D3DXAssembleShader can't handle D3DXASM_DEBUG flag - this introduces additional comment lines, which throws off the d3d8to9 regex'es.

elishacloud commented 6 years ago

From what I can tell the D3DXASM_DEBUG flag is only allowed in the D3DXAssembleShader function and not the D3DXDisassembleShader function. By the time the D3DXAssembleShader function has been called all the RegEx's have been completed.

I did a quick test by adding this flag to all D3DXAssembleShader functions in d3d8to9 and ran a few tests on some games without any issues.

I am wondering if you are sending shaders that have been pre-assembled with the D3DXASM_DEBUG flag to d3d8to9. If so why not just wait until the shaders go to d3d8to9 and then have d3d8to9 add the debug flag?

Can you describe a little bit more what you are doing here and how I can reproduce this?

BTW: if it would help we could easily make it so that debug builds of d3d8to9 automatically set this flag.

elishacloud commented 6 years ago

Ok, I added a fix for this. I filtered out the additional comment lines and I made it so that when you compile d3d8to9 for debugging it will compile with the D3DXASM_DEBUG flag set.

Here is the code check-in: a051684

The release dll can be found here: d3d8.zip The debug dll can be found here: d3d8.zip