cbuffer A {
float a; float b;
}
will be translated to a global variable.
Something like
struct CB_Ty {
float a; float b;
};
CB_Ty A;
And all use of a and b will be replaced with A.a and A.b.
Only support none-legacy cbuffer layout now.
CodeGen for Resource binding will be in separate patch.
In the separate patch, resource binding will map the resource information to the global variable.
I'm a little confused by this. If it's possible to declare an HLSLBuffer inside a function, why don't you need to handle it? If it isn't possible to declare an HLSLBuffer this way, can you just move this to use the llvm_unreachable()?