================
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -finclude-default-header -triple 
dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify
+
+using handle_t = __hlsl_resource_t [[hlsl::resource_class(UAV)]] 
[[hlsl::contained_type(int)]];
----------------
tex3d wrote:

Should we be ensuring the resource attributes are compatible with the 
operation?  This should be a `RWStructuredBuffer` only: UAV, raw and with 
contained_type.  Like diagnostics for each of the `bad_handle_*` cases below:
```suggestion
// RWStructuredBuffer<int>
using handle_t = __hlsl_resource_t [[hlsl::resource_class(UAV)]] 
[[hlsl::contained_type(int)]] [[hlsl::raw_buffer]];
// RWBuffer<int>
using bad_handle_not_raw_t = __hlsl_resource_t [[hlsl::resource_class(UAV)]] 
[[hlsl::contained_type(int)]];
// RWByteAddressBuffer
using bad_handle_no_type_t = __hlsl_resource_t [[hlsl::resource_class(UAV)]] 
[[hlsl::raw_buffer]];
// StructuredBuffer
using bad_handle_not_uav_t = __hlsl_resource_t [[hlsl::resource_class(SRV)]] 
[[hlsl::contained_type(int)]] [[hlsl::raw_buffer]];
```

https://github.com/llvm/llvm-project/pull/114148
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to