python3kgae wrote:

> > This PR will not change this. The padding will only be added when required.
> 
> _That's the problem_
> 
> > ```hlsl
> > cbuffer {
> >   float F;
> >   float2 V;
> > }
> > ```
> > 
> > 
> >     
> >       
> >     
> > 
> >       
> >     
> > 
> >     
> >   
> > will still got
> > ```llvm
> > type { float, <2 x float>}
> > ```
> 
> And there will implicitly be padding between the two elements based on what 
> data layout does because the vector will be 64-bit aligned, which _is not_ 
> how cbuffers work.
> 
> But that's actually not the biggest problem here. The biggest problem is that 
> we shouldn't add padding for `packoffset`, but not for things that are 
> implicitly laid out, and we should have a plan for how we lower this before 
> we do any of this.
> 
> Your design document that you based this off of explicitly excluded all the 
> IR representations. We shouldn't write this code until the design doc is 
> updated with the IR and lowering design.

This will only affect a compiler generated struct for cbuffer layout. It should 
not affect any other struct layout of the compiler.

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