<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/124561>124561</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL][SPIR-V] Resource binding allocation
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
s-perron
</td>
</tr>
</table>
<pre>
HLSL has a syntax and rules for resource binding that are DirectX specific. In order to make the same code work for DirectX and Vulkan, DXC created a way of translating the DirectX binding information into Vulkan. See the [DXC documetantion](https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/SPIR-V.rst#hlsl-register-and-vulkan-binding) for description of how it works.
First, we must implement the explicit binding attribute:
- [ ] Implement the `vk::binding(X[, Y])` attribute
- [ ] Implement the `[vk::counter_binding(Z)]` attribute
For backwards compatibility we will want to implement command line options:
- [ ] Implement -fvk-b-shift
- [ ] Implement -fvk-s-shift
- [ ] Implement -fvk-t-shift
- [ ] Implement -fvk-u-shift
We will also want to implement the Vulkan specific implicit set and binding algorithm. It is different from the DirectX algorithm because Vulkan does not have the different register types.
- [ ] Implement implicit set and binding assignment for resources.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEVM2O2zgTfBr60pAgUdbIPujgsWF8A-TwIQNkZ_eyoMiWxTVFCmTLjt9-QfpnJkF2cvLBxaquUneJEPTBIrasfmb1biFmGpxvQzah984uOqcu7f--vH6BQQQQEC6WxHcQVoGfDQbonQePwc1eInTaKm0PQIMgEB5hpz1KeoMwodS9ljm8WHBeoQdyMIojAg0IQYwI0imEs_PHxHl_GZW-zeYoLONb2L1tQXoUhAoEnMUFXA_khQ1G0FX5XfQ-jba986Mg7SxoS-7Gl8MrXuVZ_RyJlZPziCRsRLJ6x_hqIJoCqzaM7xnfHzQNc5dLNzK-H7X0LrieGN_fFF8HodBv3Thpg57xfWdcF6FCW8b3ysnA-P71_y9fs2-5D8R4NZhgMo8HHQh9JqzKTmm47DY84-sUh8IgvZ6SB9fD4M6gKaUVclZsWLHZ68S4hTPCOAcCPU4GR7SUPOL3yWip6ZGKIPK6mwmjvcSQxSCA1Tt4-eEpeypOx4iqNo-pVm9xYfgW_kxBrdlT8YHxUy5WP9_ppJstof_7nfavyFXvfqaL_pyHTsjjWXgVQLpxEqQ7bTRdouWzNgbOIsq4D9alG8e4QkZbBJfyC58azvrTMeuyMOiePoOE30Po95D5AWHF5o-bC2GC-4WVGN91cx_nlP5NXzUgpVN5fF1zcF7TMObwQqADKN336CNP7934w508sNChFHN4yCiHAawjGMTpeinvLPedBbpMeN_BX_n87xFT9STMxxIJ-UK1lVpXa7HAtmyqZr0ul02zGNpaLquKV0W5kmXRyYqXhSxXRbfumw5Vs1zolhe8LkrelDVfVk1ed8t1o0qxXCE2itdsWeAotMmNOY2584eFDmHGtuTL-qlcGNGhCakLObd4hvQv4zxWo2_jo6ybD4EtC6MDhXca0mRSicaujAtcP1_vPIbx9ed-FMY4mQppMXvTftIyUeD2k03e_YMy9k0aK3bJbe5Ty_8NAAD__8Fy7pA">