[HLSL] Implement the `SV_StartVertexLocation` semantic
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Add `SV_StartVertexLocation` to the list of parsed semantics. Requires Shader Model 6.8. Then lower as follows:
DXIL: `StartVertexLocation` op (`dx.op.startVertexLocation`, opcode 256).
SPIRV: `BaseVertex` built-in load.
Reference [here](https://github.com/llvm/wg-hlsl/blob/main/proposals/0040-semantics-overview.md#system-value-constraints) for its type constraints. Reference the [vertex](https://github.com/llvm/wg-hlsl/blob/main/proposals/0040-semantics-overview.md#vertex-shader) shader section for packing info and where valid.
Offload test suite testing implemented in https://github.com/llvm/offload-test-suite/issues/1444
AC:
- [ ] Add the semantic spelling in `Attr.td`
- [ ] Update `CGHLSLRuntime` to handle the semantic spelling
- [ ] Update `SemaHLSL` to add additional diagnostics
- [ ] Add LIT testing of sema and codegen
Contributor guide
Assessment
This issue has not been assessed yet.