<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/123801>123801</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL] Implement default constant buffer `$Globals`
</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>
All non-resource variable declarations in the global scope are implicitly added to `$Global` constant buffer.
In Sema we need to recognize these declarations and assign them `hlsl_constant` address space. At the end of Sema we will probably need to generate an implicit `HLSLBufferDecl` for the `$Globals` constant buffer and create its layout struct. Then we need to add support for this implicit buffer in codegen, making sure the code is generated in a similar way as other `cbuffer`s.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxskkFv2z4MxT-NfCFqyLKTOAcf0n-R_wr01t0HWqJtrbJkiHKL7NMPVrO06HbSQeR7v0cSme3oiTqxuxe7hwLXNIXYTfQSEhZ9MJfu5Bz44O8icVijJnjFaLF3BIa0w4jJBs9gPaSJYHShRwesw0KAkcDOi7PaJncBNIYMpABiL4Vq_s-lYi9BB88JfYJ-HQaKpZAnIU-PHp5pRngj8PTeGEmH0dtftHnxFwL0Bt7zbL_z5jI5dj_-qG9OaEwkZuAFNZVwShmavIEw3NzerHOwxNBj7y4375E8RUwE6G-hNo9vT89P95n7gXSOM4SYZT_H5H_kzMQ60iZqE4PDS1gTcIqrTiV8n8h_Do_GAK_LEmK6Wlj-ILlKWg86GBrJC_UfzPhi_Qi8xjyx_AWWb1nMVo_AdrYOI7zhBZAhpIniRq_fRcVeclmYrjbH-ogFddWhPjRtI4-ymLoj6QOZuiFNSu2bpmr7hrRGja3ROKjCdkqqnaxUVbWqrWRJ7TBoHI77oW7V8SBFI2lG60rnXucyxLGwzCt1lapbWRUOe3KcL1SpbdpCqe1WY7fV3_XryKKRznLiD4Vkk8tXnRt2D_A4L45m8gkMDbi69Nc2vq6rWKPrppQWFvVJqLNQ59Gmae1LHWahzpvX9blbYvhJOgl1zugs1PlK_9qp3wEAAP__844lng">