llvm-beanz wrote:

> I was kind of hoping we might be able to generate the accesses off a handle 
> during codegen when the global is accessed. I'm not sure if that's possible 
> though.

I'm concerned that this will be more complex to make work with the other CBV 
syntaxes. For example, the implicit globals don't have a bufferdecl to attach 
to, so we'll need an extra implicit decl to attach them to, and the 
`ConstantBuffer` type has a similar problem.

If instead we treat CBV as a storage class with an associated address space 
(similar to `groupshared`), we can emit cbuffer elements as globals in that 
address space, standalone globals do the same, and `ConstantBuffer<T>` can 
effectively be an alias something like: `template <typename T> using 
ConstantBuffer = constant T`, where the `constant` storage class specifier 
denotes that it is a unique CBV declaration. This would also solve the problem 
of `ConstantBuffer`'s member expression operator lookup.

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

Reply via email to