[llvm] [clang] [DirectX] Move ROV info into HLSL metadata. NFC (PR #74896)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 16:22:25 PST 2023


================
@@ -219,7 +221,7 @@ void CGHLSLRuntime::addBufferResourceAnnotation(llvm::GlobalVariable *GV,
          "ResourceMD must have been set by the switch above.");
 
   llvm::hlsl::FrontendResource Res(
-      GV, TyName, RK, Binding.Reg.value_or(UINT_MAX), Binding.Space);
+      GV, TyName, RK, IsROV, Binding.Reg.value_or(UINT_MAX), Binding.Space);
----------------
bogner wrote:

I considered flags (and a few other ways of trying to represent this), but I'm reasonably confident that we're not going to be adding a lot of flags here and that the bool is clearer if that's the case. Append and Consume buffers don't need any extra information passed along to the middle/backend, because they only differ from StructuredBuffer in what methods are legal. I'm picturing this going in a direction sort of like this:

https://github.com/bogner/llvm-project/commit/45c49457c38ad4b89e6e308100fa8266e4ceff6f

Note that I haven't really dealt with Textures yet, so some things may need to change, but I think this design makes sense to make incremental progress on.

https://github.com/llvm/llvm-project/pull/74896


More information about the llvm-commits mailing list