Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
}
static void sm6_parser_init_signature(struct sm6_parser *sm6, const struct shader_signature *s,
enum vkd3d_shader_register_type reg_type, struct vkd3d_shader_dst_param *params)
bool is_input, enum vkd3d_shader_register_type reg_type, struct vkd3d_shader_dst_param *params)
{
enum vkd3d_shader_type shader_type = sm6->p.program.shader_version.type;
bool is_patch_constant, is_control_point; struct vkd3d_shader_dst_param *param; const struct signature_element *e; unsigned int i, count;
is_patch_constant = reg_type == VKD3DSPR_PATCHCONST;
is_control_point = !is_patch_constant && ((is_input && (shader_type == VKD3D_SHADER_TYPE_HULL
|| shader_type == VKD3D_SHADER_TYPE_DOMAIN || shader_type == VKD3D_SHADER_TYPE_GEOMETRY))
|| (!is_input && !is_patch_constant && shader_type == VKD3D_SHADER_TYPE_HULL));
I find this pretty complicated to parse. Would you consider replacing these three lines with this expression (which I think it is equivalent) or something similar? ```c is_control_point = false; if (!is_patch_constant) { switch (shader_type) { case VKD3D_SHADER_TYPE_DOMAIN: case VKD3D_SHADER_TYPE_GEOMETRY: is_control_point = is_input; break;
case VKD3D_SHADER_TYPE_HULL: is_control_point = true; break;
default: break; } } ```