<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/124178>124178</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [HLSL] Update layout struct code to ignore interfaces
        </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>
    Once interfaces are added to Clang, the code that creates layout structs for constant buffer needs to be updated to ignore them. Currently the code assumes there can only be one base struct/class.

The following code should fail on an `assert` after interfaces are added:

```
interface A {
 void AAA();
};

struct B {
    float a;
};

struct Foo : A, B {
 float b;
    void AAA(){}
    RWBuffer<float> Buf;
};

cbuffer CB1 {
 Foo foo;
}

RWBuffer<float> Buf;

[numthreads(4,1,1)]
void main() {
 Buf[0] = foo.a + foo.b;
}
```
https://godbolt.org/z/831jTjzax
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8k01vvDYQxj_NcBllZcz7gQPsFvUQqVKbqucBhoXUa0e2Sbv59JVhk23yf5F2hWWe-T2jGR5ybjlr5hqyFrJTRKufja1n_tt4inozXuvf9MC4aM92ooEdkmWkceQRvcGjIn0GeUQ_Mw5mZPQzeRwsk2eHiq5m9ei8XQfvcDIWB6OdJ-2xX6eJLWrm0QVUz7i-jOR38HLWxgYaXw54XK1l7dX1bkPOrRd24cIyDqTRaHUNEKMZe3J8cwXZDYqcO4BoQDRPM-NklDL_LPq8o9xsVjXiRItCo5E0Qi7IObYecoE0ebbfHQAkzQ6FXNx-ovkQYoNQtCAafDXLiE3TgCxBVpCESyhOt4No9kaxfdcj4qQMeaQfajtjEJIGmzD7j8K9qt_FAfPFuWgDan_1-1_ttgBIjlsZJL9gu07fOg63RR3b-N0nuE_G3LWb8OdE0UDW6vXiZ8s0OpBlCvIY7_8KsgDZ2r3Qovd-3-0CJGsFZCeE5BScD4Qg2-3Uf-rif4uYvX9xYUWyA9mdzdgb5Q_GnkF2byC7Momfn57f6N9orJOxSiqKuI6LpMhzmWR5NNd5HpfMWSom2XMlJi57OXEseyGySdIQLbUUMhOxTOIqq-L8UKZVMWRpn1IxFmU8QSr4Qos6KPV6Cd7R4tzKdSzTuCgjRT0rt2VPyl8f_3gEKUMKbR30D_16dpAKtTjv7gS_eLXldSvITvjnlprPWbtl8SNH9883Wq2qv8xm8fPaHwZzAdkFn9vj4cWaZ94itLXtQHa3zl9r-V8AAAD__7nRSck">