Skip to content

[HLSL] implement SV_GroupThreadId semantic #70122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #25 ...
llvm-beanz opened this issue Oct 24, 2023 · 3 comments · Fixed by #117781
Closed
Tracked by #25 ...

[HLSL] implement SV_GroupThreadId semantic #70122

llvm-beanz opened this issue Oct 24, 2023 · 3 comments · Fixed by #117781
Assignees
Labels
backend:SPIR-V clang:codegen IR generation bugs: mangling, exceptions, etc. clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support

Comments

@llvm-beanz
Copy link
Collaborator

Implement the HLSL SV_GroupThreadId semantic for entry parameter declarations:

https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sv-groupthreadid

@llvm-beanz llvm-beanz converted this from a draft issue Oct 24, 2023
@llvm-beanz llvm-beanz added the HLSL HLSL Language Support label Oct 24, 2023
@lizhengxing
Copy link
Contributor

I'll work on this task.

@damyanp damyanp moved this to Active in HLSL Support Oct 9, 2024
@damyanp damyanp moved this from Active to Ready in HLSL Support Oct 24, 2024
@damyanp damyanp moved this from Ready to Active in HLSL Support Nov 12, 2024
lizhengxing added a commit to lizhengxing/llvm-project that referenced this issue Nov 26, 2024
Support SV_GroupThreadId attribute.
Translate it into dx.thread.id.in.group in clang codeGen.

Fixes: llvm#70122
@damyanp damyanp moved this from Active to Needs Review in HLSL Support Dec 2, 2024
lizhengxing added a commit to lizhengxing/llvm-project that referenced this issue Dec 6, 2024
Support SV_GroupThreadId attribute.
Translate it into dx.thread.id.in.group in clang codeGen.

Fixes: llvm#70122
lizhengxing added a commit to lizhengxing/llvm-project that referenced this issue Dec 6, 2024
The HLSL SV_GroupThreadID semantic attribute is lowered into @llvm.spv.thread.id.in.group intrinsic in LLVM IR for SPIR-V target.

In the SPIR-V backend, this is now correctly translated to a `LocalInvocationId` builtin variable.

Fixes llvm#70122
lizhengxing added a commit to lizhengxing/llvm-project that referenced this issue Dec 10, 2024
Support SV_GroupThreadId attribute.
Translate it into dx.thread.id.in.group in clang codeGen.

Fixes: llvm#70122
lizhengxing added a commit to lizhengxing/llvm-project that referenced this issue Dec 10, 2024
The HLSL SV_GroupThreadID semantic attribute is lowered into @llvm.spv.thread.id.in.group intrinsic in LLVM IR for SPIR-V target.

In the SPIR-V backend, this is now correctly translated to a `LocalInvocationId` builtin variable.

Fixes llvm#70122
spall pushed a commit that referenced this issue Dec 10, 2024
Support HLSL SV_GroupThreadId attribute.

For `directx` target, translate it into `dx.thread.id.in.group` in clang
codeGen and lower `dx.thread.id.in.group` to `dx.op.threadIdInGroup` in
LLVM DirectX backend.

For `spir-v` target, translate it into `spv.thread.id.in.group` in clang
codeGen and lower `spv.thread.id.in.group` to a `LocalInvocationId`
builtin variable in LLVM SPIR-V backend.

Fixes: #70122
@github-project-automation github-project-automation bot moved this from Needs Review to Closed in HLSL Support Dec 10, 2024
@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:codegen IR generation bugs: mangling, exceptions, etc. backend:SPIR-V labels Dec 10, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 10, 2024

@llvm/issue-subscribers-clang-codegen

Author: Chris B (llvm-beanz)

Implement the HLSL `SV_GroupThreadId` semantic for entry parameter declarations:

https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sv-groupthreadid

@llvmbot
Copy link
Member

llvmbot commented Dec 10, 2024

@llvm/issue-subscribers-clang-frontend

Author: Chris B (llvm-beanz)

Implement the HLSL `SV_GroupThreadId` semantic for entry parameter declarations:

https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sv-groupthreadid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:SPIR-V clang:codegen IR generation bugs: mangling, exceptions, etc. clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants