On Fri, 22 Jul 2022 at 11:58, Conor McCarthy conor.mccarthy.444@gmail.com wrote:
On Thu, Jul 21, 2022 at 2:45 AM Henri Verbeet hverbeet@gmail.com wrote:
So what this compile option then comes down to is using either the declared UAV type, or SpvImageFormatUnknown. And when not using SpvImageFormatUnknown, there's arguably still a bug of ignoring component counts. We could opt to not fix that bug, or fail shader compilation for those formats, but it doesn't seem terribly hard to fix, and I don't think there are that many additional formats anyway.
What do you propose to do for component counts? UAVs with < 4 components are still declared in DXBC as vec4, and loads declare e.g. u1.xyzw as the source. Information about the actual component count seems to be missing. It is stored in DXIL, so maybe it can be used there, but not for SM < 6.
I'm not entirely sure we're decoding these correctly. The format is certainly specified in the HLSL; it would seem surprising (though not inconceivable) that the information just gets dropped when generating the bytecode.