<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/154390>154390</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL] Make global resource arrays read-only
</td>
</tr>
<tr>
<th>Labels</th>
<td>
HLSL
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hekota
</td>
</tr>
</table>
<pre>
Global resource arrays are read-only. The compiler needs to report an error when somebody attempts to assign a value to an array element or the whole array.
```
RWBuffer<float> A[10];
RWBuffer<float> B;
RWBuffer<float> C[10];
[numthreads(4,1,1)]
void main() {
A[1] = B;
A = C;
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx0Uk2vmzAQ_DXLZRVk_AHh4AOEpj28XtpKPRvYBPoMjmyTp_z7CkJbteqTBiHbM7Oz0pgQxutMpEHVoJrELHFwXg_06qJJWtc_9EfrWmPRU3CL7wiN9-YR0HhCT6Y_uNk-Uvw2EHZuuo2WPM5EfcDo0NPN-YhmRvLeeXwbaMbgJlqd0cRI0y1uzGcQNHg3dqHtZn6OQrI00RzReYwD4dvg7J4iBVatyNkOVn35Xi-XC3kQp4t1JoL4gBWoOmOgGhD1O5T6_afT3-oVqp6XKQ7r-gH4UQI_Zc-vXHmsuruxx8mMM_Aj8BKhWKX4TAKqQRDNr5mI1XY87f5F889KSa9FX4rSJKSzQqmci1zKZNAsl12fi6xVFy54eyzKVtIxb_Oeis6oMhk1Z1yxY1ZmRSaZTDsSeddKkZW864W4gGQ0mdGm1t6n1PlrMoawkM6UFCVLrGnJhq0bnH96-foCnK8t8XrlH9rlGkAyO4YY_jjEMdqtT5tANfjZvBJe_9-i3w1KFm_1EOMtgKiAn4Gfr2Mcljbt3AT8vNrvv8PNux_UReDnLW0Aft4D3zX_GQAA__8u2tvY">