[clang] [llvm] [HLSL] Add handle initialization for simple resource declarations (PR #111207)

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 16 06:20:08 PDT 2024


================
@@ -5622,6 +5622,9 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D,
     getCUDARuntime().handleVarRegistration(D, *GV);
   }
 
+  if (LangOpts.HLSL)
+    getHLSLRuntime().handleGlobalVarDefinition(D, GV);
----------------
bogner wrote:

Pre-SM6.6 this will emit an error (https://godbolt.org/z/e8nGf8cKf):
```
<source>:4:3: error: local resource not guaranteed to map to unique global resource.
```

Looks like a bug in DXC to me.

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


More information about the cfe-commits mailing list