MINGW-packages icon indicating copy to clipboard operation
MINGW-packages copied to clipboard

New package - mingw-w64-efxc2.

Open JPeterMugaas opened this issue 1 year ago • 8 comments

an improved version of fxc2 compiler from myself.

JPeterMugaas avatar Feb 06 '24 07:02 JPeterMugaas

Why should one use it instead of fxc2?

lazka avatar Feb 06 '24 17:02 lazka

My program does not require that the compiler .DLL be in the same directory as the .EXE. In addition, the program does offer some options that fxc2 does not offer. I also made sure that the output would match some of Microsoft's code where the header defines something as an array of byte instead of an array of signed char. It also has better parsing than fxc2 did because it uses the patch ( https://github.com/mozilla/fxc2/pull/3 ). The program is now compiled with -MUnicode allowing paths to non-US ASCII. Another advantage over fxc2 is that is better maintained since I do that.

The program is based on fxc2 but it is not a mere recompilation with a minor tweak.

JPeterMugaas avatar Feb 06 '24 17:02 JPeterMugaas

I see, thanks.

I also found some patches in VLC: https://code.videolan.org/videolan/vlc/-/tree/master/contrib/src/fxc2

lazka avatar Feb 06 '24 17:02 lazka

I am still looking at those patches to see what can be integrated. But quite a bit looks like the source-code I found earlier or the author did something similar to what I did. The program I wrote uses CMake instead of the standard GNU make.

JPeterMugaas avatar Feb 06 '24 18:02 JPeterMugaas

https://code.videolan.org/videolan/vlc/-/blob/master/contrib/src/fxc2/0001-make-Vn-argument-as-optional-and-provide-default-var.patch looks similar to https://github.com/mozilla/fxc2/pull/3/files . I have confirmed that my program can accept -Vn as strictly optional (a default is used if none provided) and added the appropriate test in my CMakeLists.txt file. I did my own wchar_t adjustments to the source-code without seeing the patched you listed. I also did https://code.videolan.org/videolan/vlc/-/blob/master/contrib/src/fxc2/0004-Revert-Fix-narrowing-conversion-from-int-to-BYTE.patch without seeing that patch. I can also confirm that my program accepts MS-DOS style parameters.

I did not know of those patches you listed.

JPeterMugaas avatar Feb 06 '24 18:02 JPeterMugaas

The VLC group's work does not have as many options as I am aiming to provide. Those opetions can become very import when porting some of Microsoft's Open Source DirectX libraries for DirectX11.

JPeterMugaas avatar Feb 07 '24 22:02 JPeterMugaas

DirectXTK requires special documented parameters to compile shaders but unfortunately, fxc2 does not handle those special parameters. at all The efxc2 program handles those parameters by translating them into an appropriate value using a chart at: https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/d3dcompile-constants that is then passed to an appropriate API call (https://learn.microsoft.com/en-us/windows/win32/api/d3dcompiler/nf-d3dcompiler-d3dcompile2). I have had success compiling DirectXTK using the efxc2 program.

DirectXTex has optional DirectX11 support that requires a similar thing. I am hoping to enable that in the DirectXTex package.

JPeterMugaas avatar Feb 23 '24 05:02 JPeterMugaas

It is also worth to mention that the "Fo" parameter which is used by Qt 6's qsb tool is not supported by fxc2 but seems to be supported by efxc2 (Although Qt needs to be patched anyway to make use of fxc2 through Wine).

fuzun avatar Mar 05 '24 14:03 fuzun