[HLSL] Implement the `SV_DepthGreaterEqual` semantic
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Add `SV_DepthGreaterEqual` to the list of parsed semantics. Then lower as follows:
DXIL: `StoreOutput` op (`dx.op.storeOutput`, opcode 5) to a not-packed output element, plus the conservative-depth output mode.
SPIRV: `FragDepth` built-in store with the `DepthReplacing` and `DepthGreater` execution modes.
Reference [here](https://github.com/llvm/wg-hlsl/blob/main/proposals/0040-semantics-overview.md#system-value-constraints) for its type constraints. Reference the [pixel](https://github.com/llvm/wg-hlsl/blob/main/proposals/0040-semantics-overview.md#pixel-shader) shader section for packing info and where valid.
Offload test suite testing implemented as part of https://github.com/llvm/offload-test-suite/issues/1046.
AC:
- [ ] Add the semantic spelling in `Attr.td`
- [ ] Update `CGHLSLRuntime` to handle the semantic spelling
- [ ] Update `SemaHLSL` to add additional diagnostics
- [ ] Update shader flag analysis to set the conservative-depth (`DepthGreater`) output-mode bit in the pixel-shader program flags when this semantic is present
- [ ] Add LIT testing of sema and codegen
Contributor guide
Assessment
This issue has not been assessed yet.