On Fri Aug 26 17:48:12 2022 +0000, Matteo Bruni wrote:
Interesting. I've always used the /Fx option (with a different fxc version, but that doesn't seem to matter) which outputs the bytecode grouped in DWORDs and for this shader I get 268 bytes worth of data with it, while indeed /Fo gives a 266 byte output. I guess I was thinking about the older <= d3d9 bytecode format, the one used for d3d10+ doesn't have that constraint technically (the format is generally DWORD-oriented but there is no alignment guarantee for individual chunks or the whole shader). In the end, I think I'd still prefer to have the shaders stored as DWORDs, to be consistent with the existing tests.
I tried the 268 bytes. However, the tests will fail on Windows for 268 bytes.
This line will fail on Windows: tests/d3dx10_43.c: line 4002. It returns E_FAIL for 268 bytes. Return S_OK for 266 bytes as expected.
I guess maybe /Fx option just output DWORDs even if its actual shader size is not DWORD aligned. It adds 2 bytes 0 to the end of the output to satisfy DWORD alignment. While the actual shader doesn't contains the 2 bytes.