[PATCH] D136482: [HLSL] support unbounded global resource array.

Xiang Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 21 12:25:59 PDT 2022


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

unbounded resource array is allowed in HLSL.
Here is an example.

RWBuffer<float> B[];
 float main(uint ID : BufID) : SV_Target {

    return B[ID][0];
  }

Type::isHLSLResourceType is added to check HLSLResource.
HLSLResourceAttr is added on the forward decl so it is ready when check incomplete array type.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136482

Files:
  clang/include/clang/AST/Type.h
  clang/lib/AST/Type.cpp
  clang/lib/Sema/HLSLExternalSemaSource.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/test/AST/HLSL/unbounded_global_resource_array.hlsl
  clang/test/SemaHLSL/unbounded_global_resource_array.hlsl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136482.469714.patch
Type: text/x-patch
Size: 4631 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221021/b48aa4a5/attachment-0001.bin>


More information about the cfe-commits mailing list