[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

Xiang Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 19 16:07:37 PDT 2022


python3kgae created this revision.
python3kgae added reviewers: aaron.ballman, Anastasia, kuhar, bogner, beanz, pow2clk.
Herald added a project: All.
python3kgae requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

cbuffer A {

  float a;
  float b;

}

will be translated to a global variable with special address space.

Something like

struct CB_Ty {

  float a;
  float b;

};

__attribute__((address_space(3)))
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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130131

Files:
  clang/lib/CodeGen/CGDecl.cpp
  clang/lib/CodeGen/CGHLSLRuntime.cpp
  clang/lib/CodeGen/CGHLSLRuntime.h
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/test/CodeGenHLSL/cbuf.hlsl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130131.445975.patch
Type: text/x-patch
Size: 8558 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220719/9710b2f9/attachment-0001.bin>


More information about the cfe-commits mailing list