<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/138276>138276</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[SPIRV] Add the `spirv.Layout` type to the SPIR-V backend.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
HLSL,
backend:SPIR-V
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
s-perron
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
s-perron
</td>
</tr>
</table>
<pre>
Add this type in accordance with the [design doc](https://github.com/llvm/wg-hlsl/pull/171).
TL/DR; This type is needed because CBuffer have a feature where the developer can set the offset of a particular member, and there are no restrictions on that member. We also want to keep the order of the member in llvm-ir the same as the declaration order in HLSL. This means we cannot use the standard algorithm to determine the offset of a member in a CBuffer struct.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEUs2O4jgQfhrnUiJyHALkkAM0QrsSh1V3q_dcsQviaceO7Aqo337kwEwf5jAnJ2XX96cPU7JXT9SJ5iCUSquJYgxeKCWaY4EzDyF2v6ZFH8xXtzcGeLAJ-GsisB5Q6xANek1wtzwADwSiORjK0GCCFs1RqN3APCVR74U6CXW6Wh7mvtRhFOrk3C0f9-tqcMkJdZpml49qWwnVlkLuhdy_n4U6HV9FfYD3b_oEnsiQgZ40zong5TBfLhRhwBsBwoWQ50hwHyjSIs3QjVyYKIJGD4l4mYbLJX-GCyBMGNnq2WGEkcaeolAvgD7bziAYCXyASImj1WyDTxA88ID8fF_C_wToUoA7egYO8Ek0PXiioZhp8s_jdc4wJ7CycZkmHAkwPcVqhxEzyXPVevjn_HYuHyGMhD7BnbIXHxhyAgsGozcYDaC7hmh5GLMKQ0xxtJ7-sPytBH8nmDjOmksoTFebtm6xoK7arjdVW8tdWwzdul63qlnrjZFb3LQ9yp1ZV5XRlcK23prCdkqqRjZSVXW9k23Zqy3WWCGZ3Q4ruRVrSSNaV2b_ZYjXwqY0U1fVO7XdFA57cunZzew691K9CKV61J_kjaj3b__9-7r6eBY2dkuQ_XxNYi2dTZy-odmyW4qeVz5Ec4RHlQnERqbJxlt5xq8ws9jIR7s4LNcPCnhylsUcXff3Ni9Kphh-kGahTouxlEv98Hbr1M8AAAD__09eJsg">