<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/114275>114275</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL] DIspatchThreadID/GroupID and related semantic support
</td>
</tr>
<tr>
<th>Labels</th>
<td>
HLSL
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
llvm-beanz
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Keenuts
</td>
</tr>
</table>
<pre>
Hi!
As I started to look into some thread/group related semantics, I noticed SV_DispatchThreadID has been implemented.
>From MSDN, semantic is a uint3, each element for 1 dimension.
However, the dx_thread_id intrinsic is implemented as `i32 dx_thread_id(i32)`, and it looks like this intrinsic is called 1 time for each dimension. Do you know why? Is that expected?
On the SPIR-V side, we gather all 3 dimensions at the same time, hence it would be convenient to have the following intrinsic prototype instead: `<3 x i32> thread_id()`.
On the DXIL side (generated by DXC), looks like there are no builtin call, the semantic is directly linked to an `<3 x i32>` input parameter with the semantic.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkVE1v6zYQ_DXUZRFDIi1_HHRIo6oxmn6gKR7eLaDEjbU1RQrkyo776wvKDmL3XSRA2BnODmekY6S9Q6xE-ZOQ0trj8NCidv8KKUVZZ3ri3ofqV0Q3ccxab87VMwlZiLwW-ePl-RhhB5F1YDTAHqz3ByDHHqIfELgPqI2QzT74aYSAVqfBiIN2TF0U8gl24DxThwZev73VFEfNXf_3DNzV0OsILaIDGkaLAzpGs7hV0AQ_wG-v9e-J65MYKIKGiRyr9Bl11wNe4PDuAxRgaEAXybsr2bM_4RFDmuYewXy8XbS_kUn7BHLxQnujA3QEscpJybt5ITekpJBbscoTn3YGiGdrIlg6JFsS0S1rp61FAwUwDThLnDV_qYTaw9lPcHD-BKf-LFQDuwjcawb8GLFjNEI1t8784eZVXv_c_fXwDSIZTGpOCHvNPQbQ1oL6OiKC5hkQdbo5GubxHl2HSf7JT9ZAi9B5d0RHyUr20Osjzqh3b60_kdvfLDYGz57PIwK5yCkJ6jE5JtSTgg9ILqmf4da4i2uLuwXq77uXWT4IudmjwzCHqD1D_f0pAeTTvbkYEHRAcB7aiSyTm_39vNvbkBgK2LE9gyV3uERYux8kilUO5MaJYdRBD8gY4ETc39HdpTIzlTJbtdUZVsVa5SrfbJXK-qrdlLkpzaZsV6ZEs94WndyYvGhzXHfbrsuokrlcFrnKi7WUhVp0RbHevJcS5ftq2cqtWOY4aLKL1NiFD_uMYpywKoqlXJeZ1S3aeC3188vry7XOobo0fNpHscwtRY5fDExs5x_BDChrqHf3PRSy-SVVeFfPcf5_kSFO4-gDZ1OwVc88RqEehWxS84n7qV10fhCySQdeXw9j8P9gx0I2s_4oZHNd4VjJ_wIAAP__yH-B9g">