This fills out the default constructor for RWBuffer to assign the
handle with the result of __builtin_hlsl_create_handle which we can
then treat as a pointer to the resource data through the mid-level of
the compiler.
Depends on D130016
Paths
| Differential D130017
[HLSL] Add RWBuffer default constructor ClosedPublic Authored by beanz on Jul 18 2022, 8:12 AM.
Details Summary This fills out the default constructor for RWBuffer to assign the Depends on D130016
Diff Detail
Event TimelineComment Actions Is it worth adding a test that calls this constructor / checks that we end up with a call to the builtin?
This revision is now accepted and ready to land.Jul 27 2022, 11:57 AM This revision was landed with ongoing or failed builds.Jul 28 2022, 12:08 PM Closed by commit rG66eabeb65dc9: [HLSL] Add RWBuffer default constructor (authored by beanz). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 448409 clang/include/clang/Basic/HLSLRuntime.h
clang/lib/Sema/HLSLExternalSemaSource.cpp
clang/test/AST/HLSL/RWBuffer-AST.hlsl
clang/test/CodeGenHLSL/builtins/RWBuffer-constructor.hlsl
|
In this case it just creates a literal so it's technically fine, but in general seeing these "emit" functions in argument lists can lead to things like the generated IR being in a different order depending on the compiler. Better to store the Expr in a variable as a matter of style.