Subject: [PATCH 3/6] vkd3d-shader/spirv: Return an error if an invalid handler is encountered. Prevents assertions while handling later instructions, and prevents return of an invalid SPIR-V module.
What kind of assertions are those? In principle adding the spirv_compiler_error() call should be enough; it'll set "compiler->failed", and that should cause compilation to fail. And failing at the end seems preferable to immediately aborting compilation, because there may be more than a single issue to report.
Ah, right. Well, I think your solution is fine. There is some discussion ongoing in !434 about how to fix this longer term. Maybe it's not even true that D3D11 can ingest SM1-3, who knows where I got that from.
Direct3D 11 can use pre-SM4 shaders in some cases, but it can't consume d3dbc shaders directly; they need to be wrapped in a DXBC container (and prefixed with their size). Look at the fxc output of the "ps_4_0_level_9_0" and similar target profiles to get a basic idea of what these look like. It shouldn't be too hard to implement generating these, but currently we don't.