llvm-beanz wrote:

> Could you explain more about can't put any vectors or matrices into the 
> cbuffer structure type?

Consider this example (regardless of packoffset):

```hlsl
cbuffer {
  float F;
  float2 V;
}
```

The layout for this is basically:
```c
struct {
  float F;
  float Vx; // v.x
  float Vy; // v.y
};
```
These elements are all packed.

If you translate this to an IR struct you get something like:

```llvm
type { float, <2 x float>}
```

The data layout will insert 4-bytes of padding between the float and the vector 
because the vector needs to be properly aligned.

https://github.com/llvm/llvm-project/pull/91999
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to