We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62490ee commit c1dff94Copy full SHA for c1dff94
include/nbl/builtin/hlsl/array_accessors.hlsl
@@ -0,0 +1,30 @@
1
+#ifndef _NBL_BUILTIN_HLSL_ARRAY_ACCESSORS_HLSL_INCLUDED_
2
+#define _NBL_BUILTIN_HLSL_ARRAY_ACCESSORS_HLSL_INCLUDED_
3
+
4
+#include <nbl/builtin/hlsl/cpp_compat/basic.h>
5
6
+namespace nbl
7
+{
8
+namespace hlsl
9
10
+template<typename ArrayType, typename ComponentType, typename I = uint32_t>
11
+struct array_get
12
13
+ ComponentType operator()(NBL_CONST_REF_ARG(ArrayType) arr, const I ix) NBL_CONST_MEMBER_FUNC
14
+ {
15
+ return arr[ix];
16
+ }
17
+};
18
19
20
+struct array_set
21
22
+ void operator()(NBL_REF_ARG(ArrayType) arr, I index, ComponentType val) NBL_CONST_MEMBER_FUNC
23
24
+ arr[index] = val;
25
26
27
+}
28
29
30
+#endif
0 commit comments