[PATCH] D122699: [HLSL] Add Semantic syntax, and SV_GroupIndex

Chris Bieneman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 1 07:12:05 PDT 2022


beanz added a comment.

In D122699#3422298 <https://reviews.llvm.org/D122699#3422298>, @aaron.ballman wrote:

> General question about the new syntax -- how does this work on field declarations of a record? e.g.,
>
>   struct S {
>     int i : SV_GroupIndex;
>   };
>
> (Please tell me the answer is: it doesn't, because bit-fields are a thing.)

Oh @aaron.ballman… you’re such an optimist… Thankfully HLSL does’t support bitfields… or didn’t, until HLSL 2021…

This patch doesn’t add support for the semantic syntax anywhere other than on parameter declarations, which is enough to get us rolling to start. I was hoping to flesh out the rest of the places it is used over time so that we can figure out good ways to handle the bitfield ambiguity…

> Similar question applies to other places where a colon can show up. like `for (int i : SV_GroupIndex)` or `class C : SV_GroupIndex`.

Thankfully it can’t be used like that! HLSL doesn’t support range-based for, and it wouldn’t be valid in a for loop declaration anyways.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122699/new/

https://reviews.llvm.org/D122699



More information about the cfe-commits mailing list