<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/98556>98556</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL] Move resource attributes to resource's handles instead of the class itself
</td>
</tr>
<tr>
<th>Labels</th>
<td>
metabug,
HLSL
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bogner
</td>
</tr>
</table>
<pre>
Currently resource attributes sit on the resource class itself, like so:
```hlsl
[[hlsl::resource(...)]]
[[hlsl::resource_class(uav)]]
template <typename T> class RWBuffer {
// ...
};
```
We'd like the attributes to be attached to the resource's internal handle instead as we move towards the "intangible" handle type:
```hlsl
template <typename T> class RWBuffer {
[[hlsl::resource(...)]]
[[hlsl::resource_class(uav)]]
__hlsl_resource_t Handle;
};
```
Note that this is *not* blocked by the introduction of the intangible handle type - resources already have a `void *Handle` member, and we can simply attach these attributes there.
AC:
- All of the HLSL resource attributes are attached to the handle
- Diagnostic and backend logic that refers to these attributes continues to work
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVMGO4zYM_Rr5Qkxg03GcHHxwkgZ72PbQFtjjQLYYWx1ZCiQ6g_x9IduZyWy3U3QBIYFkPZHvPZIyBN1ZokoUe1EcEzly73zVuM6STxqnbtVh9J4smxt4Cm70LYFk9roZmQIEzeAscE_vn1sjQwDNgcxZ4AGMfiEITuS1SI8ircUmnVdvglmOYvj9tM9rkdf3twRuV6uVwJ0ojnF9evl5CixwO8rrdxCm4WIkE4j8wLcLWTkQ_CnyX5Zkf_-2H89n8iDK_YwAEHgSeIIYfw5bHkW-_47Csp1-v5HAUs10oyAPMrGDZjqQbU8qbh8VE1gG0JbJW2mgl1YZAm0Dk1QgA7wSDO5KwO5VehUmrEDUlqXtdGNIIN5hkd1nSv-UEv_HnX-9_Yk9AM_PEfD8dpfhy8TnXfH_Uv83x1F2ycC9DqADCKytY4E1NMa1L6SguU3aacveqbFl7Sy48_1sEfNRSXh6MymANJ6kukEvrwQSxCa9Oq1imCXXTQoDDQ35WPXSqmhcKy0EPVzMbbE_Rgsfi6MnT6tHLvXhzcInqI25J_nl6x9ff9iG0v-zumYa91eOWnbWBdbtlFkj2xeyCozrdDvL5ulMPizojxm2zrK241zIr86_JKrK1S7fyYSqrMS0zPPNep301bnYYlFm2bYoVdru0hJlkeK23GaSFLaU6ApTXKdllmGWr9P1qiEli7zJspyKtdqWYp3SILVZGXMdVs53iQ5hpGq3LYpNYmRDJkzjCnEgls3YCUSBB4EY5Ymb4pj4KsKfmrELYp0aHTi8P8iazTTyJkBxhF9jd_1IV3Yfm3TWNLw15-LL48RLRm-qnvkSoofTDOk092Ozat0g8BSzWP6eLt79RS0LPE0cg8DTTPNa4d8BAAD__xMNxZA">