On Fri Aug 26 04:25:25 2022 +0000, Ziqing Hui wrote:
I compiled this shader like this on Windows: `fxc /Qstrip_debug /Qstrip_reflect /T fx_4_0 /Fo test_fx test_fx_source` It do give me a result shader of 266 bytes. If it's 266 bytes, it cannot be store as a DWORD array. PS, My fxc version: `Microsoft (R) Direct3D Shader Compiler 10.1 (using C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\D3DCOMPILER_47.dll) Copyright (C) 2013 Microsoft. All rights reserved.`
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.