Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
+ struct vkd3d_shader_immediate_constant_buffer *icb; + const struct sm6_type *elem_type; + unsigned int i, size, count; + + elem_type = type->u.array.elem_type; + /* Multidimensional arrays are emitted in flattened form. */ + if (elem_type->class != TYPE_CLASS_INTEGER && elem_type->class != TYPE_CLASS_FLOAT) + { + FIXME("Unhandled element type %u for data array.\n", elem_type->class); + vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND, + "The element data type for an immediate constant buffer is not scalar integer or floating point."); + return VKD3D_ERROR_INVALID_SHADER; + } + + /* Arrays of bool are not used in DXIL. dxc will emit an array of int32 instead if necessary. */ + if (!(size = elem_type->u.width / 8u)) I doubt this code is ever going to run on a machine whose bytes have something other than 8 bit, but using `CHAR_BIT` instead of 8 might make the code intention a little clearer.
-- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/372#note_47540