Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
FIXME("Unhandled dxil instruction %u.\n", record->code); return VKD3D_ERROR_INVALID_SHADER; }
/* Allocation failure. */
That's not necessarily the case, is it? Any call to `vkd3d_shader_parser_error()`, such as in `dxil_record_validate_operand_min_count()`, could trigger this failure.
More in general, I think we there is some confusion between whether to use the parser `failed` bit vs using the return value. We could use the same convention as the HLSL compiler: `failed` is set as soon as an error is found, and it should always set via `vkd3d_shader_parser_error()` so that a diagnostic is always available; an error return value should only be used when an error was found and parsing must halt immediately.
In this scheme you should never look at `failed` to decide what to return, because you don't know if `failed` was set because of an error that still allows parsing or not. You have to genuinely propagate the return code at each level.
It is useful to have memory allocation functions that also set the `failed` bit, like the HLSL compiler.