File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -7819,9 +7819,8 @@ randomized.
78197819def HLSLSV_GroupIDDocs : Documentation {
78207820 let Category = DocCatFunction;
78217821 let Content = [{
7822- The ``SV_GroupID`` semantic, when applied to an input parameter, specifies a
7823- data binding to map the group id to the specified parameter. This attribute is
7824- only supported in compute shaders.
7822+ The ``SV_GroupID`` semantic, when applied to an input parameter, specifies which
7823+ thread group a shader is executing in. This attribute is only supported in compute shaders.
78257824
78267825The full documentation is available here: https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/sv-groupid
78277826 }];
Original file line number Diff line number Diff line change @@ -19,3 +19,14 @@ void foo(uint Idx : SV_GroupID) {}
1919[numthreads (8 ,8 ,1 )]
2020void bar (uint2 Idx : SV_GroupID ) {}
2121
22+ // CHECK: define void @test()
23+ // CHECK: %[[#ID_X:]] = call i32 @llvm.dx.group.id(i32 0)
24+ // CHECK: %[[#ID_X_:]] = insertelement <3 x i32> poison, i32 %[[#ID_X]], i64 0
25+ // CHECK: %[[#ID_Y:]] = call i32 @llvm.dx.group.id(i32 1)
26+ // CHECK: %[[#ID_XY:]] = insertelement <3 x i32> %[[#ID_X_]], i32 %[[#ID_Y]], i64 1
27+ // CHECK: %[[#ID_Z:]] = call i32 @llvm.dx.group.id(i32 2)
28+ // CHECK: %[[#ID_XYZ:]] = insertelement <3 x i32> %[[#ID_XY]], i32 %[[#ID_Z]], i64 2
29+ // CHECK: call void @{{.*}}test{{.*}}(<3 x i32> %[[#ID_XYZ]])
30+ [shader ("compute" )]
31+ [numthreads (8 ,8 ,1 )]
32+ void test (uint3 Idx : SV_GroupID ) {}
Original file line number Diff line number Diff line change @@ -48,4 +48,4 @@ struct ST2_GID {
4848// expected-warning@+1 {{'SV_GroupID' attribute only applies to parameters and non-static data members}}
4949 static uint GID : SV_GroupID ;
5050 uint s_gid : SV_GroupID ;
51- };
51+ };
You can’t perform that action at this time.
0 commit comments