[clang] [llvm] [HLSL][SPIR-V] Add SV_DispatchThreadID semantic support (PR #82536)

Natalie Chouinard via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 26 13:03:13 PST 2024


================
@@ -0,0 +1,76 @@
+; RUN: llc -O0 -mtriple=spirv-vulkan-unknown %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-vulkan-unknown %s -o - -filetype=obj | spirv-val %}
+
+; This file generated from the following HLSL:
+; clang -cc1 -triple spirv-vulkan-library -x hlsl -emit-llvm -disable-llvm-passes -finclude-default-header -o - DispatchThreadID.hlsl
+;
+; [shader("compute")]
----------------
sudonatalie wrote:

Agreed, I don't think there's a logical way to do it, but since adding the SPIR-V intrinsic for thread ID we now have frontend tests for HLSL->SPIR-V, so I think that's sufficient coverage.

https://github.com/llvm/llvm-project/pull/82536


More information about the cfe-commits mailing list