[clang] [llvm] [HLSL] Add support for dynamic resources (PR #221103)
Justin Bogner via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 14 07:56:59 PDT 2026
================
@@ -0,0 +1,36 @@
+//===----- hlsl_resources.h - HLSL definitions for resources ----------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _HLSL_HLSL_RESOURCES_H_
+#define _HLSL_HLSL_RESOURCES_H_
+
+namespace hlsl {
+
+#define _HLSL_AVAILABILITY(platform, version) \
+ __attribute__((availability(platform, introduced = version)))
+
+struct __hlsl_resource_descriptor_heap_struct {
+ __hlsl_heap_resource_info operator[](uint32_t Index) {
+ return __hlsl_heap_resource_info{Index};
+ }
+};
+
+struct __hlsl_sampler_descriptor_heap_struct {
+ __hlsl_heap_sampler_info operator[](uint32_t Index) {
+ return __hlsl_heap_sampler_info{Index};
+ }
+};
----------------
bogner wrote:
These should probably be in a `__detail` namespace rather than introducing reserved words in `hlsl::` itself. We can presumably drop `__hlsl_` in that case at least though.
https://github.com/llvm/llvm-project/pull/221103
More information about the llvm-commits
mailing list