Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
+static void sm6_parser_decode_dx_op(struct sm6_parser *sm6, struct sm6_block *code_block, enum dx_intrinsic_opcode op, const char *name, const struct sm6_value **operands, unsigned int operand_count, struct vkd3d_shader_instruction *ins, struct sm6_value *dst) {
- FIXME("Unhandled dx intrinsic function id %u, '%s'.\n", op, name);
- return sm6_parser_emit_unhandled(sm6, ins, dst);
- if (op >= ARRAY_SIZE(sm6_dx_op_table) || !sm6_dx_op_table[op].operand_info)
- {
FIXME("Unhandled dx intrinsic function id %u, '%s'.\n", op, name);
return sm6_parser_emit_unhandled(sm6, ins, dst);
- }
- if (sm6_parser_validate_dx_op(sm6, op, name, operands, operand_count, dst))
sm6_dx_op_table[op].handler(sm6, code_block, op, operands, ins);
- else
sm6_parser_emit_unhandled(sm6, ins, dst);
`return` is used a bit inconsistently here. The C syntax is valid because you can `return` a void expression in a void function, but maybe it's a bit useless here.
OTOH, I wouldn't have anything against returning an error code here (and from the DX handlers and `sm6_parser_emit_*()`). In https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/283#note_40445 I was a bit confused by the convoluted error handling code, but now that it's much better returning an error code and using that to decide whether to continue parsing or not is totally fine for me.