[clang] [HLSL] Add RWStructuredBuffer definition to HLSLExternalSemaSource (PR #113477)

Helena Kotas via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 23 17:06:11 PDT 2024


================
@@ -4,21 +4,30 @@
 // NOTE: SPIRV codegen for resource types is not yet implemented
 
 StructuredBuffer<float> Buf : register(t10);
+RWStructuredBuffer<float> Buf2 : register(u5, space1);
 
 // CHECK: %"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer", float, 0, 0), float }
+// CHECK: %"class.hlsl::RWStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), float }
+
 // CHECK: @Buf = global %"class.hlsl::StructuredBuffer" zeroinitializer, align 4
+// CHECK: @Buf2 = global %"class.hlsl::RWStructuredBuffer" zeroinitializer, align 4
 
 // CHECK: define linkonce_odr void @_ZN4hlsl16StructuredBufferIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %this)
----------------
hekota wrote:

It did not change. The constructors are both `linkonce_odr`. The internal function that starts with `@_GLOBAL__sub_` is the module initializer. It has a different name now because the name of the file changed.

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


More information about the cfe-commits mailing list