<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/133767>133767</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL] Assigning array from cbuffer fails
</td>
</tr>
<tr>
<th>Labels</th>
<td>
HLSL
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
llvm-beanz
</td>
</tr>
</table>
<pre>
Now that cbuffer values are declared in a unique address space we're seeing a failure assigning an array from a cbuffer:
```hlsl
cbuffer CBArrays : register(b0) {
float c1[2];
int4 c2[2][2];
bool c3[2];
}
struct Arrays {
float c1[2];
int4 c2[2][2];
bool c3[2];
};
RWStructuredBuffer<Arrays> Out : register(u0);
[numthreads(1,1,1)]
void main() {
Out[0].c1 = c1;
Out[0].c2 = c2;
Out[0].c3 = c3;
}
```
[Compiler Explorer](https://hlsl.godbolt.org/z/ne6avb8vd)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0U01vozAQ_TXDZdTI2BDgwIEkjfZQbaXtYc82DIlXBmf9kW7761dAaJu9r2SENU_j9-bjSe_1aSSqId9BfkhkDGframOuw4MiOb4nynZv9Xf7iuEsA7Yq9j05vEoTyaN0hB21RjrqUI8oMY76dySUXefIe_QX2RK-EvDCEXoiPZ5QYi-1iY5woZ9jI0rn5Bv2zg4oVyIQDbD5bNlyzsYbYM0qZL9rpjSPIBp0dNI-kANeKga8Qih2wBrE3thJfAr5jkN-ALGE9RgybPkavQeVtQZbcReF4rDI8cHFNuDK_R9olgtrfvx8mbmio25368l-4QXxiM8x_Ft6nEr_yId8N8YhnB3JzgMvU-D721dNhKy5Wt3hIPUIvPzatOcYIN8xyA-bNkUQh6myRfVXiC8QXwv6iokFE3fdWyf5oW9vh4s25PDxz8VYR27SxctzCBc_LQA_Aj9Oc9-cbKesCRvrTsCP78CPI23lVZXXDniVdLXoKlHJhOq0yESWiSoXybmWLFNUZqxUZSdl3vZ9WqaiUorzbZESJbrmjOdMiDQt8ioVGyEKxYmVrFRUln0FGaNBarOZnDHRJ9r7SHUqRLEtEiMVGT-biPNvTy9PwKdpJquT4slDxoz2wX--EHQws_HmhPyAzacbPq2wLvpkGZ9EZ-r7vpx0OEe1ae0A_Di9ffs9XJz9RW0AfpyleuDHm9przf8GAAD__1ILKdk">