slot 0.0.1
A real time UI render framework
载入中...
搜索中...
未找到
slang.h
浏览该文件的文档.
1#ifndef SLANG_H
2#define SLANG_H
3
4#ifdef SLANG_USER_CONFIG
5 #include SLANG_USER_CONFIG
6#endif
7
14/*
15The following section attempts to detect the compiler and version in use.
16
17If an application defines `SLANG_COMPILER` before including this header,
18they take responsibility for setting any compiler-dependent macros
19used later in the file.
20
21Most applications should not need to touch this section.
22*/
23#ifndef SLANG_COMPILER
24 #define SLANG_COMPILER
25
26 /*
27 Compiler defines, see http://sourceforge.net/p/predef/wiki/Compilers/
28 NOTE that SLANG_VC holds the compiler version - not just 1 or 0
29 */
30 #if defined(_MSC_VER)
31 #if _MSC_VER >= 1900
32 #define SLANG_VC 14
33 #elif _MSC_VER >= 1800
34 #define SLANG_VC 12
35 #elif _MSC_VER >= 1700
36 #define SLANG_VC 11
37 #elif _MSC_VER >= 1600
38 #define SLANG_VC 10
39 #elif _MSC_VER >= 1500
40 #define SLANG_VC 9
41 #else
42 #error "unknown version of Visual C++ compiler"
43 #endif
44 #elif defined(__clang__)
45 #define SLANG_CLANG 1
46 #elif defined(__SNC__)
47 #define SLANG_SNC 1
48 #elif defined(__ghs__)
49 #define SLANG_GHS 1
50 #elif defined(__GNUC__) /* note: __clang__, __SNC__, or __ghs__ imply __GNUC__ */
51 #define SLANG_GCC 1
52 #else
53 #error "unknown compiler"
54 #endif
55 /*
56 Any compilers not detected by the above logic are now now explicitly zeroed out.
57 */
58 #ifndef SLANG_VC
59 #define SLANG_VC 0
60 #endif
61 #ifndef SLANG_CLANG
62 #define SLANG_CLANG 0
63 #endif
64 #ifndef SLANG_SNC
65 #define SLANG_SNC 0
66 #endif
67 #ifndef SLANG_GHS
68 #define SLANG_GHS 0
69 #endif
70 #ifndef SLANG_GCC
71 #define SLANG_GCC 0
72 #endif
73#endif /* SLANG_COMPILER */
74
75/*
76The following section attempts to detect the target platform being compiled for.
77
78If an application defines `SLANG_PLATFORM` before including this header,
79they take responsibility for setting any compiler-dependent macros
80used later in the file.
81
82Most applications should not need to touch this section.
83*/
84#ifndef SLANG_PLATFORM
85 #define SLANG_PLATFORM
89 #if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_PARTITION_APP
90 #define SLANG_WINRT 1 /* Windows Runtime, either on Windows RT or Windows 8 */
91 #elif defined(XBOXONE)
92 #define SLANG_XBOXONE 1
93 #elif defined(_WIN64) /* note: XBOXONE implies _WIN64 */
94 #define SLANG_WIN64 1
95 #elif defined(_M_PPC)
96 #define SLANG_X360 1
97 #elif defined(_WIN32) /* note: _M_PPC implies _WIN32 */
98 #define SLANG_WIN32 1
99 #elif defined(__ANDROID__)
100 #define SLANG_ANDROID 1
101 #elif defined(__linux__) || defined(__CYGWIN__) /* note: __ANDROID__ implies __linux__ */
102 #define SLANG_LINUX 1
103 #elif defined(__APPLE__)
104 #include "TargetConditionals.h"
105 #if TARGET_OS_MAC
106 #define SLANG_OSX 1
107 #else
108 #define SLANG_IOS 1
109 #endif
110 #elif defined(__CELLOS_LV2__)
111 #define SLANG_PS3 1
112 #elif defined(__ORBIS__)
113 #define SLANG_PS4 1
114 #elif defined(__SNC__) && defined(__arm__)
115 #define SLANG_PSP2 1
116 #elif defined(__ghs__)
117 #define SLANG_WIIU 1
118 #elif defined(__EMSCRIPTEN__)
119 #define SLANG_WASM 1
120 #else
121 #error "unknown target platform"
122 #endif
123 /*
124 Any platforms not detected by the above logic are now now explicitly zeroed out.
125 */
126 #ifndef SLANG_WINRT
127 #define SLANG_WINRT 0
128 #endif
129 #ifndef SLANG_XBOXONE
130 #define SLANG_XBOXONE 0
131 #endif
132 #ifndef SLANG_WIN64
133 #define SLANG_WIN64 0
134 #endif
135 #ifndef SLANG_X360
136 #define SLANG_X360 0
137 #endif
138 #ifndef SLANG_WIN32
139 #define SLANG_WIN32 0
140 #endif
141 #ifndef SLANG_ANDROID
142 #define SLANG_ANDROID 0
143 #endif
144 #ifndef SLANG_LINUX
145 #define SLANG_LINUX 0
146 #endif
147 #ifndef SLANG_IOS
148 #define SLANG_IOS 0
149 #endif
150 #ifndef SLANG_OSX
151 #define SLANG_OSX 0
152 #endif
153 #ifndef SLANG_PS3
154 #define SLANG_PS3 0
155 #endif
156 #ifndef SLANG_PS4
157 #define SLANG_PS4 0
158 #endif
159 #ifndef SLANG_PSP2
160 #define SLANG_PSP2 0
161 #endif
162 #ifndef SLANG_WIIU
163 #define SLANG_WIIU 0
164 #endif
165 #ifndef SLANG_WASM
166 #define SLANG_WASM 0
167 #endif
168#endif /* SLANG_PLATFORM */
169
170/* Shorthands for "families" of compilers/platforms */
171#define SLANG_GCC_FAMILY (SLANG_CLANG || SLANG_SNC || SLANG_GHS || SLANG_GCC)
172#define SLANG_WINDOWS_FAMILY (SLANG_WINRT || SLANG_WIN32 || SLANG_WIN64)
173#define SLANG_MICROSOFT_FAMILY (SLANG_XBOXONE || SLANG_X360 || SLANG_WINDOWS_FAMILY)
174#define SLANG_LINUX_FAMILY (SLANG_LINUX || SLANG_ANDROID)
175#define SLANG_APPLE_FAMILY (SLANG_IOS || SLANG_OSX) /* equivalent to #if __APPLE__ */
176#define SLANG_UNIX_FAMILY \
177 (SLANG_LINUX_FAMILY || SLANG_APPLE_FAMILY) /* shortcut for unix/posix platforms */
178
179/* Macros concerning DirectX */
180#if !defined(SLANG_CONFIG_DX_ON_VK) || !SLANG_CONFIG_DX_ON_VK
181 #define SLANG_ENABLE_DXVK 0
182 #define SLANG_ENABLE_VKD3D 0
183#else
184 #define SLANG_ENABLE_DXVK 1
185 #define SLANG_ENABLE_VKD3D 1
186#endif
187
188#if SLANG_WINDOWS_FAMILY
189 #define SLANG_ENABLE_DIRECTX 1
190 #define SLANG_ENABLE_DXGI_DEBUG 1
191 #define SLANG_ENABLE_DXBC_SUPPORT 1
192 #define SLANG_ENABLE_PIX 1
193#elif SLANG_LINUX_FAMILY
194 #define SLANG_ENABLE_DIRECTX (SLANG_ENABLE_DXVK || SLANG_ENABLE_VKD3D)
195 #define SLANG_ENABLE_DXGI_DEBUG 0
196 #define SLANG_ENABLE_DXBC_SUPPORT 0
197 #define SLANG_ENABLE_PIX 0
198#else
199 #define SLANG_ENABLE_DIRECTX 0
200 #define SLANG_ENABLE_DXGI_DEBUG 0
201 #define SLANG_ENABLE_DXBC_SUPPORT 0
202 #define SLANG_ENABLE_PIX 0
203#endif
204
205/* Macro for declaring if a method is no throw. Should be set before the return parameter. */
206#ifndef SLANG_NO_THROW
207 #if SLANG_WINDOWS_FAMILY && !defined(SLANG_DISABLE_EXCEPTIONS)
208 #define SLANG_NO_THROW __declspec(nothrow)
209 #endif
210#endif
211#ifndef SLANG_NO_THROW
212 #define SLANG_NO_THROW
213#endif
214
215/* The `SLANG_STDCALL` and `SLANG_MCALL` defines are used to set the calling
216convention for interface methods.
217*/
218#ifndef SLANG_STDCALL
219 #if SLANG_MICROSOFT_FAMILY
220 #define SLANG_STDCALL __stdcall
221 #else
222 #define SLANG_STDCALL
223 #endif
224#endif
225#ifndef SLANG_MCALL
226 #define SLANG_MCALL SLANG_STDCALL
227#endif
228
229
230#if !defined(SLANG_STATIC) && !defined(SLANG_DYNAMIC)
231 #define SLANG_DYNAMIC
232#endif
233
234#if defined(_MSC_VER)
235 #define SLANG_DLL_EXPORT __declspec(dllexport)
236#else
237 #if SLANG_WINDOWS_FAMILY
238 #define SLANG_DLL_EXPORT \
239 __attribute__((dllexport)) __attribute__((__visibility__("default")))
240 #else
241 #define SLANG_DLL_EXPORT __attribute__((__visibility__("default")))
242 #endif
243#endif
244
245#if defined(SLANG_DYNAMIC)
246 #if defined(_MSC_VER)
247 #ifdef SLANG_DYNAMIC_EXPORT
248 #define SLANG_API SLANG_DLL_EXPORT
249 #else
250 #define SLANG_API __declspec(dllimport)
251 #endif
252 #else
253 // TODO: need to consider compiler capabilities
254 // # ifdef SLANG_DYNAMIC_EXPORT
255 #define SLANG_API SLANG_DLL_EXPORT
256 // # endif
257 #endif
258#endif
259
260#ifndef SLANG_API
261 #define SLANG_API
262#endif
263
264// GCC Specific
265#if SLANG_GCC_FAMILY
266 #define SLANG_NO_INLINE __attribute__((noinline))
267 #define SLANG_FORCE_INLINE inline __attribute__((always_inline))
268 #define SLANG_BREAKPOINT(id) __builtin_trap();
269#endif // SLANG_GCC_FAMILY
270
271#if SLANG_GCC_FAMILY || defined(__clang__)
272 // Use the builtin directly so we don't need to have an include of stddef.h
273 #define SLANG_OFFSET_OF(T, ELEMENT) __builtin_offsetof(T, ELEMENT)
274#endif
275
276#ifndef SLANG_OFFSET_OF
277 #define SLANG_OFFSET_OF(T, ELEMENT) (size_t(&((T*)1)->ELEMENT) - 1)
278#endif
279
280// Microsoft VC specific
281#if SLANG_VC
282 #define SLANG_NO_INLINE __declspec(noinline)
283 #define SLANG_FORCE_INLINE __forceinline
284 #define SLANG_BREAKPOINT(id) __debugbreak();
285
286 #define SLANG_INT64(x) (x##i64)
287 #define SLANG_UINT64(x) (x##ui64)
288#endif // SLANG_MICROSOFT_FAMILY
289
290#ifndef SLANG_FORCE_INLINE
291 #define SLANG_FORCE_INLINE inline
292#endif
293#ifndef SLANG_NO_INLINE
294 #define SLANG_NO_INLINE
295#endif
296
297#ifndef SLANG_COMPILE_TIME_ASSERT
298 #define SLANG_COMPILE_TIME_ASSERT(x) static_assert(x)
299#endif
300
301#ifndef SLANG_BREAKPOINT
302 // Make it crash with a write to 0!
303 #define SLANG_BREAKPOINT(id) (*((int*)0) = int(id));
304#endif
305
306// Use for getting the amount of members of a standard C array.
307// Use 0[x] here to catch the case where x has an overloaded subscript operator
308#define SLANG_COUNT_OF(x) (SlangSSizeT(sizeof(x) / sizeof(0 [x])))
310#define SLANG_INLINE inline
311
312// If explicitly disabled and not set, set to not available
313#if !defined(SLANG_HAS_EXCEPTIONS) && defined(SLANG_DISABLE_EXCEPTIONS)
314 #define SLANG_HAS_EXCEPTIONS 0
315#endif
316
317// If not set, the default is exceptions are available
318#ifndef SLANG_HAS_EXCEPTIONS
319 #define SLANG_HAS_EXCEPTIONS 1
320#endif
321
322// Other defines
323#define SLANG_STRINGIZE_HELPER(X) #X
324#define SLANG_STRINGIZE(X) SLANG_STRINGIZE_HELPER(X)
325
326#define SLANG_CONCAT_HELPER(X, Y) X##Y
327#define SLANG_CONCAT(X, Y) SLANG_CONCAT_HELPER(X, Y)
328
329#ifndef SLANG_UNUSED
330 #define SLANG_UNUSED(v) (void)v;
331#endif
332
333#if defined(__llvm__)
334 #define SLANG_MAYBE_UNUSED [[maybe_unused]]
335#else
336 #define SLANG_MAYBE_UNUSED
337#endif
338
339// Used for doing constant literals
340#ifndef SLANG_INT64
341 #define SLANG_INT64(x) (x##ll)
342#endif
343#ifndef SLANG_UINT64
344 #define SLANG_UINT64(x) (x##ull)
345#endif
346
347
348#ifdef __cplusplus
349 #define SLANG_EXTERN_C extern "C"
350#else
351 #define SLANG_EXTERN_C
352#endif
353
354#ifdef __cplusplus
355 // C++ specific macros
356 // Clang
357 #if SLANG_CLANG
358 #if (__clang_major__ * 10 + __clang_minor__) >= 33
359 #define SLANG_HAS_MOVE_SEMANTICS 1
360 #define SLANG_HAS_ENUM_CLASS 1
361 #define SLANG_OVERRIDE override
362 #endif
363
364 // Gcc
365 #elif SLANG_GCC_FAMILY
366 // Check for C++11
367 #if (__cplusplus >= 201103L)
368 #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
369 #define SLANG_HAS_MOVE_SEMANTICS 1
370 #endif
371 #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
372 #define SLANG_HAS_ENUM_CLASS 1
373 #endif
374 #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407
375 #define SLANG_OVERRIDE override
376 #endif
377 #endif
378 #endif // SLANG_GCC_FAMILY
379
380 // Visual Studio
381
382 #if SLANG_VC
383 // C4481: nonstandard extension used: override specifier 'override'
384 #if _MSC_VER < 1700
385 #pragma warning(disable : 4481)
386 #endif
387 #define SLANG_OVERRIDE override
388 #if _MSC_VER >= 1600
389 #define SLANG_HAS_MOVE_SEMANTICS 1
390 #endif
391 #if _MSC_VER >= 1700
392 #define SLANG_HAS_ENUM_CLASS 1
393 #endif
394 #endif // SLANG_VC
395
396 // Set non set
397 #ifndef SLANG_OVERRIDE
398 #define SLANG_OVERRIDE
399 #endif
400 #ifndef SLANG_HAS_ENUM_CLASS
401 #define SLANG_HAS_ENUM_CLASS 0
402 #endif
403 #ifndef SLANG_HAS_MOVE_SEMANTICS
404 #define SLANG_HAS_MOVE_SEMANTICS 0
405 #endif
406
407#endif // __cplusplus
408
409/* Macros for detecting processor */
410#if defined(_M_ARM) || defined(__ARM_EABI__)
411 // This is special case for nVidia tegra
412 #define SLANG_PROCESSOR_ARM 1
413#elif defined(__i386__) || defined(_M_IX86)
414 #define SLANG_PROCESSOR_X86 1
415#elif defined(_M_AMD64) || defined(_M_X64) || defined(__amd64) || defined(__x86_64)
416 #define SLANG_PROCESSOR_X86_64 1
417#elif defined(_PPC_) || defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC)
418 #if defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) || \
419 defined(__64BIT__) || defined(_LP64) || defined(__LP64__)
420 #define SLANG_PROCESSOR_POWER_PC_64 1
421 #else
422 #define SLANG_PROCESSOR_POWER_PC 1
423 #endif
424#elif defined(__arm__)
425 #define SLANG_PROCESSOR_ARM 1
426#elif defined(_M_ARM64) || defined(__aarch64__) || defined(__ARM_ARCH_ISA_A64)
427 #define SLANG_PROCESSOR_ARM_64 1
428#elif defined(__EMSCRIPTEN__)
429 #define SLANG_PROCESSOR_WASM 1
430#endif
431
432#ifndef SLANG_PROCESSOR_ARM
433 #define SLANG_PROCESSOR_ARM 0
434#endif
435
436#ifndef SLANG_PROCESSOR_ARM_64
437 #define SLANG_PROCESSOR_ARM_64 0
438#endif
439
440#ifndef SLANG_PROCESSOR_X86
441 #define SLANG_PROCESSOR_X86 0
442#endif
443
444#ifndef SLANG_PROCESSOR_X86_64
445 #define SLANG_PROCESSOR_X86_64 0
446#endif
447
448#ifndef SLANG_PROCESSOR_POWER_PC
449 #define SLANG_PROCESSOR_POWER_PC 0
450#endif
451
452#ifndef SLANG_PROCESSOR_POWER_PC_64
453 #define SLANG_PROCESSOR_POWER_PC_64 0
454#endif
455
456#ifndef SLANG_PROCESSOR_WASM
457 #define SLANG_PROCESSOR_WASM 0
458#endif
459
460// Processor families
461
462#define SLANG_PROCESSOR_FAMILY_X86 (SLANG_PROCESSOR_X86_64 | SLANG_PROCESSOR_X86)
463#define SLANG_PROCESSOR_FAMILY_ARM (SLANG_PROCESSOR_ARM | SLANG_PROCESSOR_ARM_64)
464#define SLANG_PROCESSOR_FAMILY_POWER_PC (SLANG_PROCESSOR_POWER_PC_64 | SLANG_PROCESSOR_POWER_PC)
465
466// Pointer size
467#define SLANG_PTR_IS_64 \
468 (SLANG_PROCESSOR_ARM_64 | SLANG_PROCESSOR_X86_64 | SLANG_PROCESSOR_POWER_PC_64)
469#define SLANG_PTR_IS_32 (SLANG_PTR_IS_64 ^ 1)
470
471// Processor features
472#if SLANG_PROCESSOR_FAMILY_X86
473 #define SLANG_LITTLE_ENDIAN 1
474 #define SLANG_UNALIGNED_ACCESS 1
475#elif SLANG_PROCESSOR_FAMILY_ARM
476 #if defined(__ARMEB__)
477 #define SLANG_BIG_ENDIAN 1
478 #else
479 #define SLANG_LITTLE_ENDIAN 1
480 #endif
481#elif SLANG_PROCESSOR_FAMILY_POWER_PC
482 #define SLANG_BIG_ENDIAN 1
483#elif SLANG_WASM
484 #define SLANG_LITTLE_ENDIAN 1
485#endif
486
487#ifndef SLANG_LITTLE_ENDIAN
488 #define SLANG_LITTLE_ENDIAN 0
489#endif
490
491#ifndef SLANG_BIG_ENDIAN
492 #define SLANG_BIG_ENDIAN 0
493#endif
494
495#ifndef SLANG_UNALIGNED_ACCESS
496 #define SLANG_UNALIGNED_ACCESS 0
497#endif
498
499// Backtrace
500#if SLANG_LINUX_FAMILY
501 #include <features.h> // for __GLIBC__ define, if using GNU libc
502 #if defined(__GLIBC__) || (__ANDROID_API__ >= 33)
503 #define SLANG_HAS_BACKTRACE 1
504 #else
505 #define SLANG_HAS_BACKTRACE 0
506 #endif
507#else
508 #define SLANG_HAS_BACKTRACE 0
509#endif
510
511// One endianness must be set
512#if ((SLANG_BIG_ENDIAN | SLANG_LITTLE_ENDIAN) == 0)
513 #error "Couldn't determine endianness"
514#endif
515
516#ifndef SLANG_NO_INTTYPES
517 #include <inttypes.h>
518#endif // ! SLANG_NO_INTTYPES
519
520#ifndef SLANG_NO_STDDEF
521 #include <stddef.h>
522#endif // ! SLANG_NO_STDDEF
523
524#ifdef SLANG_NO_DEPRECATION
525 #define SLANG_DEPRECATED
526#else
527 #define SLANG_DEPRECATED [[deprecated]]
528#endif
529
530#ifdef __cplusplus
531extern "C"
532{
533#endif
542 typedef uint32_t SlangUInt32;
543 typedef int32_t SlangInt32;
544
545 // Use SLANG_PTR_ macros to determine SlangInt/SlangUInt types.
546 // This is used over say using size_t/ptrdiff_t/intptr_t/uintptr_t, because on some targets,
547 // these types are distinct from their uint_t/int_t equivalents and so produce ambiguity with
548 // function overloading.
549 //
550 // SlangSizeT is helpful as on some compilers size_t is distinct from a regular integer type and
551 // so overloading doesn't work. Casting to SlangSizeT works around this.
552#if SLANG_PTR_IS_64
553 typedef int64_t SlangInt;
554 typedef uint64_t SlangUInt;
555
556 typedef int64_t SlangSSizeT;
557 typedef uint64_t SlangSizeT;
558#else
559typedef int32_t SlangInt;
560typedef uint32_t SlangUInt;
561
562typedef int32_t SlangSSizeT;
563typedef uint32_t SlangSizeT;
564#endif
565
566 typedef bool SlangBool;
567
568
587
589 enum
590 {
593 };
594
604
605 /* NOTE! To keep binary compatibility care is needed with this enum!
606
607 * To add value, only add at the bottom (before COUNT_OF)
608 * To remove a value, add _DEPRECATED as a suffix, but leave in the list
609
610 This will make the enum values stable, and compatible with libraries that might not use the
611 latest enum values.
612 */
660
661 /* A "container format" describes the way that the outputs
662 for multiple files, entry points, targets, etc. should be
663 combined into a single artifact for output. */
666 {
667 /* Don't generate a container. */
669
670 /* Generate a container in the `.slang-module` format,
671 which includes reflection information, compiled kernels, etc. */
673 };
674
696
697 /* Defines an archive type used to holds a 'file system' type structure. */
708
712 typedef unsigned int SlangCompileFlags;
713 enum
714 {
715 /* Do as little mangling of names as possible, to try to preserve original names */
717
718 /* Skip code generation step, just check the code and generate layout */
720
721 /* Obfuscate shader names on release products */
723
724 /* Deprecated flags: kept around to allow existing applications to
725 compile. Note that the relevant features will still be left in
726 their default state. */
729 };
730
733 typedef unsigned int SlangTargetFlags;
734 enum
735 {
736 /* When compiling for a D3D Shader Model 5.1 or higher target, allocate
737 distinct register spaces for parameter blocks.
738
739 @deprecated This behavior is now enabled unconditionally.
740 */
742
743 /* When set, will generate target code that contains all entrypoints defined
744 in the input source or specified via the `spAddEntryPoint` function in a
745 single output module (library/source file).
746 */
748
749 /* When set, will dump out the IR between intermediate compilation steps.*/
751
752 /* When set, will generate SPIRV directly rather than via glslang. */
753 // This flag will be deprecated, use CompilerOption instead.
755 };
758
762 typedef unsigned int SlangFloatingPointModeIntegral;
769
773 typedef unsigned int SlangFpDenormalModeIntegral;
780
784 typedef unsigned int SlangLineDirectiveModeIntegral;
796
813
814 typedef unsigned int SlangProfileIDIntegral;
819
820
826
827 typedef unsigned int SlangMatrixLayoutModeIntegral;
834
860
869
877
886
898
899 /* Describes the debugging information format produced during a compilation. */
915
927
934
941
943 {
944 SLANG_DIAGNOSTIC_COLOR_AUTO = 0, // Use color if output sink is a tty
945 SLANG_DIAGNOSTIC_COLOR_ALWAYS = 1, // Always use color
946 SLANG_DIAGNOSTIC_COLOR_NEVER = 2, // Never use color
947 };
948
949 // All compiler option names supported by Slang.
950 //
951 // IMPORTANT: ABI STABILITY POLICY FOR CompilerOptionName
952 //
953 // Every enumerator has an explicit integer value. Rules:
954 // 1. NEVER insert a new enumerator in the middle of the list.
955 // 2. NEVER remove an enumerator; rename to REMOVED_<Name> and keep the value.
956 // 3. NEVER reuse an integer value from a removed/deprecated entry.
957 // 4. NEW entries MUST be appended immediately before CountOf, assigning the next
958 // sequential integer (equal to the preceding enumerator's value + 1).
959 //
960 // Violation of these rules silently breaks binary compatibility for any caller
961 // compiled against an older version of this header.
962 namespace slang
963 {
965 {
966 MacroDefine = 0, // stringValue0: macro name; stringValue1: macro value
967 DepFile = 1,
968 EntryPointName = 2,
969 Specialize = 3,
970 Help = 4,
971 HelpStyle = 5,
972 Include = 6, // stringValue: additional include path.
973 Language = 7,
974 MatrixLayoutColumn = 8, // bool
975 MatrixLayoutRow = 9, // bool
976 ZeroInitialize = 10, // bool
977 IgnoreCapabilities = 11, // bool
978 RestrictiveCapabilityCheck = 12, // bool
979 ModuleName = 13, // stringValue0: module name.
980 Output = 14,
981 Profile = 15, // intValue0: profile
982 Stage = 16, // intValue0: stage
983 Target = 17, // intValue0: CodeGenTarget
984 Version = 18,
985 WarningsAsErrors = 19, // stringValue0: "all" or comma-separated list of
986 // warning codes or names.
987 DisableWarnings = 20, // stringValue0: comma separated list of warning codes or names.
988 EnableWarning = 21, // stringValue0: warning code or name.
989 DisableWarning = 22, // stringValue0: warning code or name.
991 InputFilesRemain = 24,
992 EmitIr = 25, // bool
993 ReportDownstreamTime = 26, // bool
994 ReportPerfBenchmark = 27, // bool
996 SkipSPIRVValidation = 29, // bool
997 SourceEmbedStyle = 30,
998 SourceEmbedName = 31,
1000 DisableShortCircuit = 33, // bool
1001 MinimumSlangOptimization = 34, // bool
1002 DisableNonEssentialValidations = 35, // bool
1003 DisableSourceMap = 36, // bool
1004 UnscopedEnum = 37, // bool
1005 PreserveParameters = 38, // bool: preserve all resource parameters in the output code.
1006
1007 // Target
1008 Capability = 39, // intValue0: CapabilityName
1009 DefaultImageFormatUnknown = 40, // bool
1010 DisableDynamicDispatch = 41, // bool
1011 DisableSpecialization = 42, // bool
1012 FloatingPointMode = 43, // intValue0: FloatingPointMode
1013 DebugInformation = 44, // intValue0: DebugInfoLevel
1014 LineDirectiveMode = 45,
1015 Optimization = 46, // intValue0: OptimizationLevel
1016 Obfuscate = 47, // bool
1017
1018 VulkanBindShift = 48, // intValue0 (higher 8 bits): kind; intValue0(lower bits): set;
1019 // intValue1: shift
1020 VulkanBindGlobals = 49, // intValue0: index; intValue1: set
1021 VulkanInvertY = 50, // bool
1022 VulkanUseDxPositionW = 51, // bool
1023 VulkanUseEntryPointName = 52, // bool
1024 VulkanUseGLLayout = 53, // bool
1025 VulkanEmitReflection = 54, // bool
1026
1027 GLSLForceScalarLayout = 55, // bool
1028 EnableEffectAnnotations = 56, // bool
1029
1030 EmitSpirvViaGLSL = 57, // bool (will be deprecated)
1031 EmitSpirvDirectly = 58, // bool (will be deprecated)
1032 SPIRVCoreGrammarJSON = 59, // stringValue0: json path
1033 IncompleteLibrary = 60, // bool, when set, will not issue an error when the linked program
1034 // has unresolved extern function symbols.
1035
1036 // Downstream
1037 CompilerPath = 61,
1039 DownstreamArgs = 63, // stringValue0: downstream compiler name. stringValue1: argument list,
1040 // one per line.
1041 PassThrough = 64,
1042
1043 // Repro
1044 DumpRepro = 65,
1045 DumpReproOnError = 66,
1046 ExtractRepro = 67,
1047 LoadRepro = 68,
1048 LoadReproDirectory = 69,
1050
1051 // Debugging
1052 DumpAst = 71,
1054 DumpIntermediates = 73, // bool
1055 DumpIr = 74, // bool
1056 DumpIrIds = 75,
1057 PreprocessorOutput = 76,
1058 OutputIncludes = 77,
1059 ReproFileSystem = 78,
1060 REMOVED_SerialIR = 79, // deprecated and removed; value must never be reused
1061 SkipCodeGen = 80, // bool
1062 ValidateIr = 81, // bool
1063 VerbosePaths = 82,
1065 NoCodeGen = 84, // Not used.
1066
1067 // Experimental
1068 FileSystem = 85,
1069 Heterogeneous = 86,
1070 NoMangle = 87,
1071 NoHLSLBinding = 88,
1073 ValidateUniformity = 90,
1074 AllowGLSL = 91,
1076 BindlessSpaceIndex = 93, // int
1077 SPIRVResourceHeapStride = 94, // int: byte stride for SPIRV resource descriptor heap
1078 SPIRVSamplerHeapStride = 95, // int: byte stride for SPIRV sampler descriptor heap
1079
1080 // Internal
1081 ArchiveType = 96,
1082 CompileCoreModule = 97,
1083 Doc = 98,
1084
1085 IrCompression = 99, // deprecated; value must never be reused
1086
1087 LoadCoreModule = 100,
1088 ReferenceModule = 101,
1089 SaveCoreModule = 102,
1091 TrackLiveness = 104,
1092 LoopInversion = 105, // bool, enable loop inversion optimization
1093
1094 ParameterBlocksUseRegisterSpaces = 106, // Deprecated; value must never be reused
1095 LanguageVersion = 107, // intValue0: SlangLanguageVersion
1096 TypeConformance = 108, // stringValue0: type conformance to link; format:
1097 // "<TypeName>:<IInterfaceName>[=<sequentialId>]",
1098 // e.g. "Impl:IFoo=3" or "Impl:IFoo".
1099 EnableExperimentalDynamicDispatch = 109, // bool, experimental
1100 EmitReflectionJSON = 110, // bool
1101
1102 CountOfParsableOptions = 111, // historical sentinel; value must not be reused
1103
1104 // Options added after the original set. Most have CLI flags; a few are
1105 // API-only (marked below). All future additions belong after DiagnosticColor,
1106 // immediately before CountOf.
1107 DebugInformationFormat = 112, // intValue0: DebugInfoFormat (derived from -g; no direct CLI
1108 // flag)
1109 VulkanBindShiftAll = 113, // intValue0: kind; intValue1: shift (derived from
1110 // -fvk-x-shift; no direct CLI flag)
1111 GenerateWholeProgram = 114, // bool
1112 UseUpToDateBinaryModule = 115, // bool, when set, will only load precompiled modules
1113 // if up-to-date with source. (API-only; no direct CLI flag)
1114 EmbedDownstreamIR = 116, // bool
1115 ForceDXLayout = 117, // bool
1116
1117 // Setting of EmitSpirvDirectly or EmitSpirvViaGLSL will turn into this option internally.
1118 EmitSpirvMethod = 118, // enum SlangEmitSpirvMethod (derived; no direct CLI flag)
1119
1121
1122 SkipDownstreamLinking = 120, // bool, experimental (API-only; no direct CLI flag)
1123 DumpModule = 121,
1124
1125 GetModuleInfo = 122, // Print serialized module version and name
1126 GetSupportedModuleVersions = 123, // Print the min and max module versions this compiler
1127 // supports
1128
1129 EmitSeparateDebug = 124, // bool
1130
1131 // Floating point denormal handling modes
1132 DenormalModeFp16 = 125,
1133 DenormalModeFp32 = 126,
1134 DenormalModeFp64 = 127,
1135
1136 // Bitfield options
1137 UseMSVCStyleBitfieldPacking = 128, // bool
1138
1139 ForceCLayout = 129, // bool
1140
1141 ExperimentalFeature = 130, // bool, enable experimental features
1142
1143 ReportDetailedPerfBenchmark = 131, // bool, reports detailed compiler performance benchmark
1144 // results
1145 ValidateIRDetailed = 132, // bool, enable detailed IR validation
1146 DumpIRBefore = 133, // string, pass name to dump IR before
1147 DumpIRAfter = 134, // string, pass name to dump IR after
1148
1149 EmitCPUMethod = 135, // enum SlangEmitCPUMethod (derived; no direct CLI flag)
1150 EmitCPUViaCPP = 136, // bool
1151 EmitCPUViaLLVM = 137, // bool
1152 LLVMTargetTriple = 138, // string
1153 LLVMCPU = 139, // string
1154 LLVMFeatures = 140, // string
1155
1156 EnableRichDiagnostics = 141, // bool, enable the experimental rich diagnostics
1157
1158 ReportDynamicDispatchSites = 142, // bool
1159
1160 EnableMachineReadableDiagnostics = 143, // bool, enable machine-readable diagnostic output
1161 // (implies EnableRichDiagnostics)
1162
1163 DiagnosticColor = 144, // intValue0: SlangDiagnosticColor (always, never, auto)
1164
1165 // Add new options HERE, immediately before CountOf.
1166
1167 TraceCoverage = 145, // bool: insert per-statement execution counters
1169 146, // intValue0: register index; intValue1: register space — explicit
1170 // binding for the synthesized __slang_coverage buffer. Consumed
1171 // only when TraceCoverage is enabled; the slangc CLI spelling also
1172 // enables TraceCoverage.
1174 147, // intValue0: descriptor/register space reserved by the host when
1175 // auto-allocating the synthesized __slang_coverage buffer. This is
1176 // a repeatable hint consumed only when TraceCoverage is enabled.
1177
1178 CountOf,
1179 };
1180
1182 {
1183 Int = 0,
1184 String = 1,
1185 };
1186
1188 {
1190 int32_t intValue0 = 0;
1191 int32_t intValue1 = 0;
1192 const char* stringValue0 = nullptr;
1193 const char* stringValue1 = nullptr;
1194 };
1195
1201 } // namespace slang
1202
1243 typedef int32_t SlangResult;
1244
1247#define SLANG_FAILED(status) ((status) < 0)
1250#define SLANG_SUCCEEDED(status) ((status) >= 0)
1251
1253#define SLANG_GET_RESULT_FACILITY(r) ((int32_t)(((r) >> 16) & 0x7fff))
1255#define SLANG_GET_RESULT_CODE(r) ((int32_t)((r) & 0xffff))
1256
1257#define SLANG_MAKE_ERROR(fac, code) \
1258 ((((int32_t)(fac)) << 16) | ((int32_t)(code)) | int32_t(0x80000000))
1259#define SLANG_MAKE_SUCCESS(fac, code) ((((int32_t)(fac)) << 16) | ((int32_t)(code)))
1260
1261 /*************************** Facilities ************************************/
1262
1264#define SLANG_FACILITY_WIN_GENERAL 0
1265#define SLANG_FACILITY_WIN_INTERFACE 4
1266#define SLANG_FACILITY_WIN_API 7
1267
1270#define SLANG_FACILITY_BASE 0x200
1271
1275#define SLANG_FACILITY_CORE SLANG_FACILITY_BASE
1276 /* Facility for codes, that are not uniquely defined/protected. Can be used to pass back a
1277 specific error without requiring system wide facility uniqueness. Codes should never be part of
1278 a public API. */
1279#define SLANG_FACILITY_INTERNAL SLANG_FACILITY_BASE + 1
1280
1282#define SLANG_FACILITY_EXTERNAL_BASE 0x210
1283
1284 /* ************************ Win COM compatible Results ******************************/
1285 // https://msdn.microsoft.com/en-us/library/windows/desktop/aa378137(v=vs.85).aspx
1286
1289#define SLANG_OK 0
1292#define SLANG_FAIL SLANG_MAKE_ERROR(SLANG_FACILITY_WIN_GENERAL, 0x4005)
1293
1294#define SLANG_MAKE_WIN_GENERAL_ERROR(code) SLANG_MAKE_ERROR(SLANG_FACILITY_WIN_GENERAL, code)
1295
1297#define SLANG_E_NOT_IMPLEMENTED SLANG_MAKE_WIN_GENERAL_ERROR(0x4001)
1299#define SLANG_E_NO_INTERFACE SLANG_MAKE_WIN_GENERAL_ERROR(0x4002)
1301#define SLANG_E_ABORT SLANG_MAKE_WIN_GENERAL_ERROR(0x4004)
1302
1304#define SLANG_E_INVALID_HANDLE SLANG_MAKE_ERROR(SLANG_FACILITY_WIN_API, 6)
1306#define SLANG_E_INVALID_ARG SLANG_MAKE_ERROR(SLANG_FACILITY_WIN_API, 0x57)
1308#define SLANG_E_OUT_OF_MEMORY SLANG_MAKE_ERROR(SLANG_FACILITY_WIN_API, 0xe)
1309
1310 /* *************************** other Results **************************************/
1311
1312#define SLANG_MAKE_CORE_ERROR(code) SLANG_MAKE_ERROR(SLANG_FACILITY_CORE, code)
1313
1314 // Supplied buffer is too small to be able to complete
1315#define SLANG_E_BUFFER_TOO_SMALL SLANG_MAKE_CORE_ERROR(1)
1319#define SLANG_E_UNINITIALIZED SLANG_MAKE_CORE_ERROR(2)
1322#define SLANG_E_PENDING SLANG_MAKE_CORE_ERROR(3)
1324#define SLANG_E_CANNOT_OPEN SLANG_MAKE_CORE_ERROR(4)
1326#define SLANG_E_NOT_FOUND SLANG_MAKE_CORE_ERROR(5)
1328#define SLANG_E_INTERNAL_FAIL SLANG_MAKE_CORE_ERROR(6)
1330#define SLANG_E_NOT_AVAILABLE SLANG_MAKE_CORE_ERROR(7)
1332#define SLANG_E_TIME_OUT SLANG_MAKE_CORE_ERROR(8)
1333
1343 struct SlangUUID
1344 {
1345 uint32_t data1;
1346 uint16_t data2;
1347 uint16_t data3;
1348 uint8_t data4[8];
1349 };
1350
1351// Place at the start of an interface with the guid.
1352// Guid should be specified as SLANG_COM_INTERFACE(0x00000000, 0x0000, 0x0000, { 0xC0, 0x00, 0x00,
1353// 0x00, 0x00, 0x00, 0x00, 0x46 }) NOTE: it's the typical guid struct definition, without the
1354// surrounding {} It is not necessary to use the multiple parameters (we can wrap in parens), but
1355// this is simple.
1356#define SLANG_COM_INTERFACE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
1357public: \
1358 SLANG_FORCE_INLINE constexpr static SlangUUID getTypeGuid() \
1359 { \
1360 return {a, b, c, d0, d1, d2, d3, d4, d5, d6, d7}; \
1361 }
1362
1363// Sometimes it's useful to associate a guid with a class to identify it. This macro can used for
1364// this, and the guid extracted via the getTypeGuid() function defined in the type
1365#define SLANG_CLASS_GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
1366 SLANG_FORCE_INLINE constexpr static SlangUUID getTypeGuid() \
1367 { \
1368 return {a, b, c, d0, d1, d2, d3, d4, d5, d6, d7}; \
1369 }
1370
1371// Helper to fill in pairs of GUIDs and return pointers. This ensures that the
1372// type of the GUID passed matches the pointer type, and that it is derived
1373// from ISlangUnknown,
1374// TODO(c++20): would is_derived_from be more appropriate here for private inheritance of
1375// ISlangUnknown?
1376//
1377// with : void createFoo(SlangUUID, void**);
1378// Slang::ComPtr<Bar> myBar;
1379// call with: createFoo(SLANG_IID_PPV_ARGS(myBar.writeRef()))
1380// to call : createFoo(Bar::getTypeGuid(), (void**)(myBar.writeRef()))
1381#define SLANG_IID_PPV_ARGS(ppType) \
1382 std::decay_t<decltype(**(ppType))>::getTypeGuid(), \
1383 ( \
1384 (void)[] { \
1385 static_assert( \
1386 std::is_base_of_v<ISlangUnknown, std::decay_t<decltype(**(ppType))>>); \
1387 }, \
1388 reinterpret_cast<void**>(ppType))
1389
1390
1397 struct ISlangUnknown
1398 {
1400 0x00000000,
1401 0x0000,
1402 0x0000,
1403 {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46})
1404
1406 queryInterface(SlangUUID const& uuid, void** outObject) = 0;
1407 virtual SLANG_NO_THROW uint32_t SLANG_MCALL addRef() = 0;
1408 virtual SLANG_NO_THROW uint32_t SLANG_MCALL release() = 0;
1409
1410 /*
1411 Inline methods are provided to allow the above operations to be called
1412 using their traditional COM names/signatures:
1413 */
1414 SlangResult QueryInterface(struct _GUID const& uuid, void** outObject)
1415 {
1416 return queryInterface(*(SlangUUID const*)&uuid, outObject);
1417 }
1418 uint32_t AddRef() { return addRef(); }
1419 uint32_t Release() { return release(); }
1420 };
1421#define SLANG_UUID_ISlangUnknown ISlangUnknown::getTypeGuid()
1422
1423
1424 /* An interface to provide a mechanism to cast, that doesn't require ref counting
1425 and doesn't have to return a pointer to a ISlangUnknown derived class */
1427 {
1429 0x87ede0e1,
1430 0x4852,
1431 0x44b0,
1432 {0x8b, 0xf2, 0xcb, 0x31, 0x87, 0x4d, 0xe2, 0x39});
1433
1437 virtual SLANG_NO_THROW void* SLANG_MCALL castAs(const SlangUUID& guid) = 0;
1438 };
1439
1441 {
1443 0x1ec36168,
1444 0xe9f4,
1445 0x430d,
1446 {0xbb, 0x17, 0x4, 0x8a, 0x80, 0x46, 0xb3, 0x1f});
1447
1452 SLANG_NO_THROW virtual void* SLANG_MCALL clone(const SlangUUID& guid) = 0;
1453 };
1454
1460 {
1462 0x8BA5FB08,
1463 0x5195,
1464 0x40e2,
1465 {0xAC, 0x58, 0x0D, 0x98, 0x9C, 0x3A, 0x01, 0x02})
1466
1467 virtual SLANG_NO_THROW void const* SLANG_MCALL getBufferPointer() = 0;
1469 };
1470#define SLANG_UUID_ISlangBlob ISlangBlob::getTypeGuid()
1471
1472 /* Can be requested from ISlangCastable cast to indicate the contained chars are null
1473 * terminated.
1474 */
1476 {
1478 0xbe0db1a8,
1479 0x3594,
1480 0x4603,
1481 {0xa7, 0x8b, 0xc4, 0x86, 0x84, 0x30, 0xdf, 0xbb});
1482 operator const char*() const { return chars; }
1483 char chars[1];
1484 };
1485
1498 {
1500 0x003A09FC,
1501 0x3A4D,
1502 0x4BA0,
1503 {0xAD, 0x60, 0x1F, 0xD8, 0x63, 0xA9, 0x15, 0xAB})
1504
1519 loadFile(char const* path, ISlangBlob** outBlob) = 0;
1520 };
1521#define SLANG_UUID_ISlangFileSystem ISlangFileSystem::getTypeGuid()
1522
1523
1524 typedef void (*SlangFuncPtr)(void);
1525
1530 {
1532 0x9c9d5bc5,
1533 0xeb61,
1534 0x496f,
1535 {0x80, 0xd7, 0xd1, 0x47, 0xc4, 0xa2, 0x37, 0x30})
1536
1537 virtual SLANG_NO_THROW void* SLANG_MCALL findSymbolAddressByName(char const* name) = 0;
1538 };
1539#define SLANG_UUID_ISlangSharedLibrary_Dep1 ISlangSharedLibrary_Dep1::getTypeGuid()
1540
1545 {
1547 0x70dbc7c4,
1548 0xdc3b,
1549 0x4a07,
1550 {0xae, 0x7e, 0x75, 0x2a, 0xf6, 0xa8, 0x15, 0x55})
1551
1556 SLANG_FORCE_INLINE SlangFuncPtr findFuncByName(char const* name)
1557 {
1559 }
1560
1565 virtual SLANG_NO_THROW void* SLANG_MCALL findSymbolAddressByName(char const* name) = 0;
1566 };
1567#define SLANG_UUID_ISlangSharedLibrary ISlangSharedLibrary::getTypeGuid()
1568
1570 {
1572 0x6264ab2b,
1573 0xa3e8,
1574 0x4a06,
1575 {0x97, 0xf1, 0x49, 0xbc, 0x2d, 0x2a, 0xb1, 0x4d})
1576
1584 loadSharedLibrary(const char* path, ISlangSharedLibrary** sharedLibraryOut) = 0;
1585 };
1586#define SLANG_UUID_ISlangSharedLibraryLoader ISlangSharedLibraryLoader::getTypeGuid()
1587
1588 /* Type that identifies how a path should be interpreted */
1589 typedef unsigned int SlangPathTypeIntegral;
1595
1596 /* Callback to enumerate the contents of of a directory in a ISlangFileSystemExt.
1597 The name is the name of a file system object (directory/file) in the specified path (ie it is
1598 without a path) */
1599 typedef void (
1600 *FileSystemContentsCallBack)(SlangPathType pathType, const char* name, void* userData);
1601
1602 /* Determines how paths map to files on the OS file system */
1603 enum class OSPathKind : uint8_t
1604 {
1605 None = 0,
1606 Direct = 1,
1607 OperatingSystem = 2,
1609 };
1610
1611 /* Used to determine what kind of path is required from an input path */
1612 enum class PathKind
1613 {
1617 Simplified = 0,
1618
1628 Canonical = 1,
1629
1636 Display = 2,
1637
1639 OperatingSystem = 3,
1640
1641 CountOf,
1642 };
1643
1653 {
1655 0x5fb632d2,
1656 0x979d,
1657 0x4481,
1658 {0x9f, 0xee, 0x66, 0x3c, 0x3f, 0x14, 0x49, 0xe1})
1659
1693 getFileUniqueIdentity(const char* path, ISlangBlob** outUniqueIdentity) = 0;
1694
1707 SlangPathType fromPathType,
1708 const char* fromPath,
1709 const char* path,
1710 ISlangBlob** pathOut) = 0;
1711
1719 getPathType(const char* path, SlangPathType* pathTypeOut) = 0;
1720
1730 getPath(PathKind kind, const char* path, ISlangBlob** outPath) = 0;
1731
1734
1746 const char* path,
1748 void* userData) = 0;
1749
1755 };
1756
1757#define SLANG_UUID_ISlangFileSystemExt ISlangFileSystemExt::getTypeGuid()
1758
1760 {
1762 0xa058675c,
1763 0x1d65,
1764 0x452a,
1765 {0x84, 0x58, 0xcc, 0xde, 0xd1, 0x42, 0x71, 0x5})
1766
1776 saveFile(const char* path, const void* data, size_t size) = 0;
1777
1792 saveFileBlob(const char* path, ISlangBlob* dataBlob) = 0;
1793
1800 virtual SLANG_NO_THROW SlangResult SLANG_MCALL remove(const char* path) = 0;
1801
1811 };
1812
1813#define SLANG_UUID_ISlangMutableFileSystem ISlangMutableFileSystem::getTypeGuid()
1814
1815 /* Identifies different types of writer target*/
1816 typedef unsigned int SlangWriterChannelIntegral;
1824
1825 typedef unsigned int SlangWriterModeIntegral;
1831
1835 {
1837 0xec457f0e,
1838 0x9add,
1839 0x4e6b,
1840 {0x85, 0x1c, 0xd7, 0xfa, 0x71, 0x6d, 0x15, 0xfd})
1841
1846 virtual SLANG_NO_THROW char* SLANG_MCALL beginAppendBuffer(size_t maxNumChars) = 0;
1855 endAppendBuffer(char* buffer, size_t numChars) = 0;
1861 write(const char* chars, size_t numChars) = 0;
1871 };
1872
1873#define SLANG_UUID_ISlangWriter ISlangWriter::getTypeGuid()
1874
1876 {
1878 0x197772c7,
1879 0x0155,
1880 0x4b91,
1881 {0x84, 0xe8, 0x66, 0x68, 0xba, 0xff, 0x06, 0x19})
1882 virtual SLANG_NO_THROW size_t SLANG_MCALL getEntryCount() = 0;
1883 virtual SLANG_NO_THROW const char* SLANG_MCALL getEntryName(uint32_t index) = 0;
1884 virtual SLANG_NO_THROW long SLANG_MCALL getEntryTimeMS(uint32_t index) = 0;
1885 virtual SLANG_NO_THROW uint32_t SLANG_MCALL getEntryInvocationTimes(uint32_t index) = 0;
1886 };
1887#define SLANG_UUID_ISlangProfiler ISlangProfiler::getTypeGuid()
1888
1889 namespace slang
1890 {
1891 struct IGlobalSession;
1892 struct ICompileRequest;
1893
1894 } // namespace slang
1895
1899 typedef slang::IGlobalSession SlangSession;
1900
1901
1903
1907 typedef struct slang::ICompileRequest SlangCompileRequest;
1908
1909
1913 typedef void (*SlangDiagnosticCallback)(char const* message, void* userData);
1914
1932
1933 /*
1934 Forward declarations of types used in the reflection interface;
1935 */
1936
1940
1952
1959
1966
1967 /*
1968 Type aliases to maintain backward compatibility.
1969 */
1972
1973 // type reflection
1974
1975 typedef unsigned int SlangTypeKindIntegral;
2001
2002 typedef unsigned int SlangScalarTypeIntegral;
2025
2026 // abstract decl reflection
2027 typedef unsigned int SlangDeclKindIntegral;
2039
2040#ifndef SLANG_RESOURCE_SHAPE
2041 #define SLANG_RESOURCE_SHAPE
2042 typedef unsigned int SlangResourceShapeIntegral;
2078#endif
2079 typedef unsigned int SlangResourceAccessIntegral;
2092
2095 {
2108
2109 // HLSL register `space`, Vulkan GLSL `set`
2111
2112 // TODO: Ellie, Both APIs treat mesh outputs as more or less varying output,
2113 // Does it deserve to be represented here??
2114
2115 // A parameter whose type is to be specialized by a global generic type argument
2117
2122
2123 // An existential type parameter represents a "hole" that
2124 // needs to be filled with a concrete type to enable
2125 // generation of specialized code.
2126 //
2127 // Consider this example:
2128 //
2129 // struct MyParams
2130 // {
2131 // IMaterial material;
2132 // ILight lights[3];
2133 // };
2134 //
2135 // This `MyParams` type introduces two existential type parameters:
2136 // one for `material` and one for `lights`. Even though `lights`
2137 // is an array, it only introduces one type parameter, because
2138 // we need to have a *single* concrete type for all the array
2139 // elements to be able to generate specialized code.
2140 //
2142
2143 // An existential object parameter represents a value
2144 // that needs to be passed in to provide data for some
2145 // interface-type shader parameter.
2146 //
2147 // Consider this example:
2148 //
2149 // struct MyParams
2150 // {
2151 // IMaterial material;
2152 // ILight lights[3];
2153 // };
2154 //
2155 // This `MyParams` type introduces four existential object parameters:
2156 // one for `material` and three for `lights` (one for each array
2157 // element). This is consistent with the number of interface-type
2158 // "objects" that are being passed through to the shader.
2159 //
2161
2162 // The register space offset for the sub-elements that occupies register spaces.
2164
2165 // The input_attachment_index subpass occupancy tracker
2167
2168 // Metal tier-1 argument buffer element [[id]].
2170
2171 // Metal [[attribute]] inputs.
2173
2174 // Metal [[payload]] inputs
2176
2177 //
2179
2180 // Aliases for Metal-specific categories.
2184
2185 // DEPRECATED:
2189 };
2190
2248
2257
2273
2276 {
2277#define SLANG_FORMAT(NAME, DESC) SLANG_IMAGE_FORMAT_##NAME,
2279#undef SLANG_FORMAT
2280 };
2281
2282#define SLANG_UNBOUNDED_SIZE (~size_t(0))
2283#define SLANG_UNKNOWN_SIZE (SLANG_UNBOUNDED_SIZE - 1)
2284
2285 // Shader Parameter Reflection
2286
2288
2289#ifdef __cplusplus
2290}
2291#endif
2292
2293#ifdef __cplusplus
2294namespace slang
2295{
2296struct ISession;
2297}
2298#endif
2299
2300#include "slang-deprecated.h"
2301
2302#ifdef __cplusplus
2303
2304/* Helper interfaces for C++ users */
2305namespace slang
2306{
2307struct BufferReflection;
2308struct DeclReflection;
2309struct TypeLayoutReflection;
2310struct TypeReflection;
2311struct VariableLayoutReflection;
2312struct VariableReflection;
2313struct FunctionReflection;
2314struct GenericReflection;
2315
2316union GenericArgReflection
2317{
2318 TypeReflection* typeVal;
2319 int64_t intVal;
2320 bool boolVal;
2321};
2322
2323struct Attribute
2324{
2325 char const* getName()
2326 {
2328 }
2329 uint32_t getArgumentCount()
2330 {
2333 }
2334 TypeReflection* getArgumentType(uint32_t index)
2335 {
2336 return (TypeReflection*)spReflectionUserAttribute_GetArgumentType(
2338 index);
2339 }
2340 SlangResult getArgumentValueInt(uint32_t index, int* value)
2341 {
2344 index,
2345 value);
2346 }
2347 SlangResult getArgumentValueFloat(uint32_t index, float* value)
2348 {
2351 index,
2352 value);
2353 }
2354 const char* getArgumentValueString(uint32_t index, size_t* outSize)
2355 {
2358 index,
2359 outSize);
2360 }
2361};
2362
2363typedef Attribute UserAttribute;
2364
2365struct TypeReflection
2366{
2367 enum class Kind
2368 {
2370 Struct = SLANG_TYPE_KIND_STRUCT,
2374 Scalar = SLANG_TYPE_KIND_SCALAR,
2376 Resource = SLANG_TYPE_KIND_RESOURCE,
2378 TextureBuffer = SLANG_TYPE_KIND_TEXTURE_BUFFER,
2379 ShaderStorageBuffer = SLANG_TYPE_KIND_SHADER_STORAGE_BUFFER,
2380 ParameterBlock = SLANG_TYPE_KIND_PARAMETER_BLOCK,
2381 GenericTypeParameter = SLANG_TYPE_KIND_GENERIC_TYPE_PARAMETER,
2382 Interface = SLANG_TYPE_KIND_INTERFACE,
2383 OutputStream = SLANG_TYPE_KIND_OUTPUT_STREAM,
2384 Specialized = SLANG_TYPE_KIND_SPECIALIZED,
2385 Feedback = SLANG_TYPE_KIND_FEEDBACK,
2386 Pointer = SLANG_TYPE_KIND_POINTER,
2387 DynamicResource = SLANG_TYPE_KIND_DYNAMIC_RESOURCE,
2388 MeshOutput = SLANG_TYPE_KIND_MESH_OUTPUT,
2389 Enum = SLANG_TYPE_KIND_ENUM,
2390 };
2391
2392 enum ScalarType : SlangScalarTypeIntegral
2393 {
2408 IntPtr = SLANG_SCALAR_TYPE_INTPTR,
2409 UIntPtr = SLANG_SCALAR_TYPE_UINTPTR,
2410 BFloat16 = SLANG_SCALAR_TYPE_BFLOAT16,
2413 };
2414
2415 Kind getKind() { return (Kind)spReflectionType_GetKind((SlangReflectionType*)this); }
2416
2417 // only useful if `getKind() == Kind::Struct`
2418 unsigned int getFieldCount()
2419 {
2421 }
2422
2423 VariableReflection* getFieldByIndex(unsigned int index)
2424 {
2425 return (
2426 VariableReflection*)spReflectionType_GetFieldByIndex((SlangReflectionType*)this, index);
2427 }
2428
2429 bool isArray() { return getKind() == TypeReflection::Kind::Array; }
2430
2431 TypeReflection* unwrapArray()
2432 {
2433 TypeReflection* type = this;
2434 while (type->isArray())
2435 {
2436 type = type->getElementType();
2437 }
2438 return type;
2439 }
2440
2449 size_t getElementCount(SlangReflection* reflection = nullptr)
2450 {
2452 }
2453
2460 size_t getTotalArrayElementCount()
2461 {
2462 if (!isArray())
2463 return 0;
2464 size_t result = 1;
2465 TypeReflection* type = this;
2466 for (;;)
2467 {
2468 if (!type->isArray())
2469 return result;
2470
2471 const auto c = type->getElementCount();
2472 if (c == SLANG_UNKNOWN_SIZE)
2473 return SLANG_UNKNOWN_SIZE;
2474 if (c == SLANG_UNBOUNDED_SIZE)
2475 return SLANG_UNBOUNDED_SIZE;
2476 result *= c;
2477 type = type->getElementType();
2478 }
2479 }
2480
2481 TypeReflection* getElementType()
2482 {
2483 return (TypeReflection*)spReflectionType_GetElementType((SlangReflectionType*)this);
2484 }
2485
2486 unsigned getRowCount() { return spReflectionType_GetRowCount((SlangReflectionType*)this); }
2487
2488 unsigned getColumnCount()
2489 {
2491 }
2492
2493 ScalarType getScalarType()
2494 {
2495 return (ScalarType)spReflectionType_GetScalarType((SlangReflectionType*)this);
2496 }
2497
2498 TypeReflection* getResourceResultType()
2499 {
2500 return (TypeReflection*)spReflectionType_GetResourceResultType((SlangReflectionType*)this);
2501 }
2502
2503 SlangResourceShape getResourceShape()
2504 {
2506 }
2507
2508 SlangResourceAccess getResourceAccess()
2509 {
2511 }
2512
2513 char const* getName() { return spReflectionType_GetName((SlangReflectionType*)this); }
2514
2515 SlangResult getFullName(ISlangBlob** outNameBlob)
2516 {
2517 return spReflectionType_GetFullName((SlangReflectionType*)this, outNameBlob);
2518 }
2519
2520 unsigned int getUserAttributeCount()
2521 {
2523 }
2524
2525 UserAttribute* getUserAttributeByIndex(unsigned int index)
2526 {
2527 return (UserAttribute*)spReflectionType_GetUserAttribute((SlangReflectionType*)this, index);
2528 }
2529
2530 UserAttribute* findAttributeByName(char const* name)
2531 {
2532 return (UserAttribute*)spReflectionType_FindUserAttributeByName(
2533 (SlangReflectionType*)this,
2534 name);
2535 }
2536
2537 UserAttribute* findUserAttributeByName(char const* name) { return findAttributeByName(name); }
2538
2539 TypeReflection* applySpecializations(GenericReflection* generic)
2540 {
2541 return (TypeReflection*)spReflectionType_applySpecializations(
2542 (SlangReflectionType*)this,
2543 (SlangReflectionGeneric*)generic);
2544 }
2545
2546 GenericReflection* getGenericContainer()
2547 {
2548 return (GenericReflection*)spReflectionType_GetGenericContainer((SlangReflectionType*)this);
2549 }
2550};
2551
2552enum ParameterCategory : SlangParameterCategoryIntegral
2553{
2554 // TODO: these aren't scoped...
2565 SpecializationConstant = SLANG_PARAMETER_CATEGORY_SPECIALIZATION_CONSTANT,
2568 GenericResource = SLANG_PARAMETER_CATEGORY_GENERIC,
2569
2573
2575
2578
2580
2581 InputAttachmentIndex = SLANG_PARAMETER_CATEGORY_SUBPASS,
2582
2585 MetalArgumentBufferElement = SLANG_PARAMETER_CATEGORY_METAL_ARGUMENT_BUFFER_ELEMENT,
2588
2589 // DEPRECATED:
2592};
2593
2594enum class BindingType : SlangBindingTypeIntegral
2595{
2597
2601 ParameterBlock = SLANG_BINDING_TYPE_PARAMETER_BLOCK,
2602 TypedBuffer = SLANG_BINDING_TYPE_TYPED_BUFFER,
2604 CombinedTextureSampler = SLANG_BINDING_TYPE_COMBINED_TEXTURE_SAMPLER,
2605 InputRenderTarget = SLANG_BINDING_TYPE_INPUT_RENDER_TARGET,
2606 InlineUniformData = SLANG_BINDING_TYPE_INLINE_UNIFORM_DATA,
2607 RayTracingAccelerationStructure = SLANG_BINDING_TYPE_RAY_TRACING_ACCELERATION_STRUCTURE,
2608 VaryingInput = SLANG_BINDING_TYPE_VARYING_INPUT,
2609 VaryingOutput = SLANG_BINDING_TYPE_VARYING_OUTPUT,
2610 ExistentialValue = SLANG_BINDING_TYPE_EXISTENTIAL_VALUE,
2611 PushConstant = SLANG_BINDING_TYPE_PUSH_CONSTANT,
2612
2613 MutableFlag = SLANG_BINDING_TYPE_MUTABLE_FLAG,
2614
2615 MutableTexture = SLANG_BINDING_TYPE_MUTABLE_TETURE,
2616 MutableTypedBuffer = SLANG_BINDING_TYPE_MUTABLE_TYPED_BUFFER,
2617 MutableRawBuffer = SLANG_BINDING_TYPE_MUTABLE_RAW_BUFFER,
2618
2621};
2622
2623struct ShaderReflection;
2624
2625struct TypeLayoutReflection
2626{
2627 TypeReflection* getType()
2628 {
2629 return (TypeReflection*)spReflectionTypeLayout_GetType((SlangReflectionTypeLayout*)this);
2630 }
2631
2632 TypeReflection::Kind getKind()
2633 {
2634 return (TypeReflection::Kind)spReflectionTypeLayout_getKind(
2636 }
2637
2644 size_t getSize(SlangParameterCategory category)
2645 {
2647 }
2648
2655 size_t getStride(SlangParameterCategory category)
2656 {
2658 }
2659
2660 int32_t getAlignment(SlangParameterCategory category)
2661 {
2663 }
2664
2671 size_t getSize(slang::ParameterCategory category = slang::ParameterCategory::Uniform)
2672 {
2675 (SlangParameterCategory)category);
2676 }
2677
2684 size_t getStride(slang::ParameterCategory category = slang::ParameterCategory::Uniform)
2685 {
2688 (SlangParameterCategory)category);
2689 }
2690
2691 int32_t getAlignment(slang::ParameterCategory category = slang::ParameterCategory::Uniform)
2692 {
2695 (SlangParameterCategory)category);
2696 }
2697
2698
2699 unsigned int getFieldCount()
2700 {
2702 }
2703
2704 VariableLayoutReflection* getFieldByIndex(unsigned int index)
2705 {
2706 return (VariableLayoutReflection*)spReflectionTypeLayout_GetFieldByIndex(
2708 index);
2709 }
2710
2711 SlangInt findFieldIndexByName(char const* nameBegin, char const* nameEnd = nullptr)
2712 {
2715 nameBegin,
2716 nameEnd);
2717 }
2718
2719 VariableLayoutReflection* getExplicitCounter()
2720 {
2721 return (VariableLayoutReflection*)spReflectionTypeLayout_GetExplicitCounter(
2723 }
2724
2725 bool isArray() { return getType()->isArray(); }
2726
2727 TypeLayoutReflection* unwrapArray()
2728 {
2729 TypeLayoutReflection* typeLayout = this;
2730 while (typeLayout->isArray())
2731 {
2732 typeLayout = typeLayout->getElementTypeLayout();
2733 }
2734 return typeLayout;
2735 }
2736
2745 size_t getElementCount(ShaderReflection* reflection = nullptr)
2746 {
2747 return getType()->getElementCount((SlangReflection*)reflection);
2748 }
2749
2756 size_t getTotalArrayElementCount() { return getType()->getTotalArrayElementCount(); }
2757
2764 size_t getElementStride(SlangParameterCategory category)
2765 {
2767 }
2768
2769 TypeLayoutReflection* getElementTypeLayout()
2770 {
2771 return (TypeLayoutReflection*)spReflectionTypeLayout_GetElementTypeLayout(
2773 }
2774
2775 VariableLayoutReflection* getElementVarLayout()
2776 {
2777 return (VariableLayoutReflection*)spReflectionTypeLayout_GetElementVarLayout(
2779 }
2780
2781 VariableLayoutReflection* getContainerVarLayout()
2782 {
2783 return (VariableLayoutReflection*)spReflectionTypeLayout_getContainerVarLayout(
2785 }
2786
2787 // How is this type supposed to be bound?
2788 ParameterCategory getParameterCategory()
2789 {
2790 return (ParameterCategory)spReflectionTypeLayout_GetParameterCategory(
2792 }
2793
2794 unsigned int getCategoryCount()
2795 {
2797 }
2798
2799 ParameterCategory getCategoryByIndex(unsigned int index)
2800 {
2801 return (ParameterCategory)spReflectionTypeLayout_GetCategoryByIndex(
2803 index);
2804 }
2805
2806 unsigned getRowCount() { return getType()->getRowCount(); }
2807
2808 unsigned getColumnCount() { return getType()->getColumnCount(); }
2809
2810 TypeReflection::ScalarType getScalarType() { return getType()->getScalarType(); }
2811
2812 TypeReflection* getResourceResultType() { return getType()->getResourceResultType(); }
2813
2814 SlangResourceShape getResourceShape() { return getType()->getResourceShape(); }
2815
2816 SlangResourceAccess getResourceAccess() { return getType()->getResourceAccess(); }
2817
2818 char const* getName() { return getType()->getName(); }
2819
2820 SlangMatrixLayoutMode getMatrixLayoutMode()
2821 {
2823 }
2824
2825 int getGenericParamIndex()
2826 {
2828 }
2829
2830 // Pending Type Layout functionality has been removed
2831 [[deprecated]] TypeLayoutReflection* getPendingDataTypeLayout() { return nullptr; }
2832
2833 // Pending Type Layout functionality has been removed
2834 [[deprecated]] VariableLayoutReflection* getSpecializedTypePendingDataVarLayout()
2835 {
2836 return nullptr;
2837 }
2838
2839 SlangInt getBindingRangeCount()
2840 {
2842 }
2843
2844 BindingType getBindingRangeType(SlangInt index)
2845 {
2848 index);
2849 }
2850
2851 bool isBindingRangeSpecializable(SlangInt index)
2852 {
2855 index);
2856 }
2857
2864 SlangInt getBindingRangeBindingCount(SlangInt index)
2865 {
2868 index);
2869 }
2870
2871 /*
2872 SlangInt getBindingRangeIndexOffset(SlangInt index)
2873 {
2874 return spReflectionTypeLayout_getBindingRangeIndexOffset(
2875 (SlangReflectionTypeLayout*) this,
2876 index);
2877 }
2878
2879 SlangInt getBindingRangeSpaceOffset(SlangInt index)
2880 {
2881 return spReflectionTypeLayout_getBindingRangeSpaceOffset(
2882 (SlangReflectionTypeLayout*) this,
2883 index);
2884 }
2885 */
2886
2887 SlangInt getFieldBindingRangeOffset(SlangInt fieldIndex)
2888 {
2891 fieldIndex);
2892 }
2893
2894 SlangInt getExplicitCounterBindingRangeOffset()
2895 {
2898 }
2899
2900 TypeLayoutReflection* getBindingRangeLeafTypeLayout(SlangInt index)
2901 {
2902 return (TypeLayoutReflection*)spReflectionTypeLayout_getBindingRangeLeafTypeLayout(
2904 index);
2905 }
2906
2907 VariableReflection* getBindingRangeLeafVariable(SlangInt index)
2908 {
2909 return (VariableReflection*)spReflectionTypeLayout_getBindingRangeLeafVariable(
2911 index);
2912 }
2913
2914 SlangImageFormat getBindingRangeImageFormat(SlangInt index)
2915 {
2918 index);
2919 }
2920
2921 SlangInt getBindingRangeDescriptorSetIndex(SlangInt index)
2922 {
2925 index);
2926 }
2927
2928 SlangInt getBindingRangeFirstDescriptorRangeIndex(SlangInt index)
2929 {
2932 index);
2933 }
2934
2935 SlangInt getBindingRangeDescriptorRangeCount(SlangInt index)
2936 {
2939 index);
2940 }
2941
2942 SlangInt getDescriptorSetCount()
2943 {
2945 }
2946
2947 SlangInt getDescriptorSetSpaceOffset(SlangInt setIndex)
2948 {
2951 setIndex);
2952 }
2953
2954 SlangInt getDescriptorSetDescriptorRangeCount(SlangInt setIndex)
2955 {
2958 setIndex);
2959 }
2960
2966 SlangInt getDescriptorSetDescriptorRangeIndexOffset(SlangInt setIndex, SlangInt rangeIndex)
2967 {
2970 setIndex,
2971 rangeIndex);
2972 }
2973
2980 SlangInt getDescriptorSetDescriptorRangeDescriptorCount(SlangInt setIndex, SlangInt rangeIndex)
2981 {
2984 setIndex,
2985 rangeIndex);
2986 }
2987
2988 BindingType getDescriptorSetDescriptorRangeType(SlangInt setIndex, SlangInt rangeIndex)
2989 {
2992 setIndex,
2993 rangeIndex);
2994 }
2995
2996 ParameterCategory getDescriptorSetDescriptorRangeCategory(
2997 SlangInt setIndex,
2998 SlangInt rangeIndex)
2999 {
3002 setIndex,
3003 rangeIndex);
3004 }
3005
3006 SlangInt getSubObjectRangeCount()
3007 {
3009 }
3010
3011 SlangInt getSubObjectRangeBindingRangeIndex(SlangInt subObjectRangeIndex)
3012 {
3015 subObjectRangeIndex);
3016 }
3017
3023 SlangInt getSubObjectRangeSpaceOffset(SlangInt subObjectRangeIndex)
3024 {
3027 subObjectRangeIndex);
3028 }
3029
3030 VariableLayoutReflection* getSubObjectRangeOffset(SlangInt subObjectRangeIndex)
3031 {
3032 return (VariableLayoutReflection*)spReflectionTypeLayout_getSubObjectRangeOffset(
3034 subObjectRangeIndex);
3035 }
3036};
3037
3038struct Modifier
3039{
3040 enum ID : SlangModifierIDIntegral
3041 {
3042 Shared = SLANG_MODIFIER_SHARED,
3043 NoDiff = SLANG_MODIFIER_NO_DIFF,
3045 Const = SLANG_MODIFIER_CONST,
3046 Export = SLANG_MODIFIER_EXPORT,
3047 Extern = SLANG_MODIFIER_EXTERN,
3048 Differentiable = SLANG_MODIFIER_DIFFERENTIABLE,
3049 Mutating = SLANG_MODIFIER_MUTATING,
3050 In = SLANG_MODIFIER_IN,
3051 Out = SLANG_MODIFIER_OUT,
3052 InOut = SLANG_MODIFIER_INOUT
3053 };
3054};
3055
3056struct VariableReflection
3057{
3058 char const* getName() { return spReflectionVariable_GetName((SlangReflectionVariable*)this); }
3059
3060 TypeReflection* getType()
3061 {
3062 return (TypeReflection*)spReflectionVariable_GetType((SlangReflectionVariable*)this);
3063 }
3064
3065 Modifier* findModifier(Modifier::ID id)
3066 {
3067 return (Modifier*)spReflectionVariable_FindModifier(
3069 (SlangModifierID)id);
3070 }
3071
3072 unsigned int getUserAttributeCount()
3073 {
3075 }
3076
3077 Attribute* getUserAttributeByIndex(unsigned int index)
3078 {
3079 return (UserAttribute*)spReflectionVariable_GetUserAttribute(
3081 index);
3082 }
3083
3084 Attribute* findAttributeByName(SlangSession* globalSession, char const* name)
3085 {
3086 return (UserAttribute*)spReflectionVariable_FindUserAttributeByName(
3088 globalSession,
3089 name);
3090 }
3091
3092 Attribute* findUserAttributeByName(SlangSession* globalSession, char const* name)
3093 {
3094 return findAttributeByName(globalSession, name);
3095 }
3096
3097 bool hasDefaultValue()
3098 {
3100 }
3101
3102 SlangResult getDefaultValueInt(int64_t* value)
3103 {
3105 }
3106
3107 SlangResult getDefaultValueFloat(float* value)
3108 {
3110 }
3111
3112 GenericReflection* getGenericContainer()
3113 {
3114 return (GenericReflection*)spReflectionVariable_GetGenericContainer(
3116 }
3117
3118 VariableReflection* applySpecializations(GenericReflection* generic)
3119 {
3120 return (VariableReflection*)spReflectionVariable_applySpecializations(
3122 (SlangReflectionGeneric*)generic);
3123 }
3124};
3125
3126struct VariableLayoutReflection
3127{
3128 VariableReflection* getVariable()
3129 {
3130 return (VariableReflection*)spReflectionVariableLayout_GetVariable(
3132 }
3133
3134 char const* getName()
3135 {
3136 if (auto var = getVariable())
3137 return var->getName();
3138 return nullptr;
3139 }
3140
3141 Modifier* findModifier(Modifier::ID id) { return getVariable()->findModifier(id); }
3142
3143 TypeLayoutReflection* getTypeLayout()
3144 {
3145 return (TypeLayoutReflection*)spReflectionVariableLayout_GetTypeLayout(
3147 }
3148
3149 ParameterCategory getCategory() { return getTypeLayout()->getParameterCategory(); }
3150
3151 unsigned int getCategoryCount() { return getTypeLayout()->getCategoryCount(); }
3152
3153 ParameterCategory getCategoryByIndex(unsigned int index)
3154 {
3155 return getTypeLayout()->getCategoryByIndex(index);
3156 }
3157
3158
3164 size_t getOffset(SlangParameterCategory category)
3165 {
3167 }
3168
3174 size_t getOffset(slang::ParameterCategory category = slang::ParameterCategory::Uniform)
3175 {
3178 (SlangParameterCategory)category);
3179 }
3180
3181
3182 TypeReflection* getType() { return getVariable()->getType(); }
3183
3189 unsigned getBindingIndex()
3190 {
3192 }
3193
3199 unsigned getBindingSpace()
3200 {
3202 }
3203
3209 size_t getBindingSpace(SlangParameterCategory category)
3210 {
3212 }
3213
3219 size_t getBindingSpace(slang::ParameterCategory category)
3220 {
3223 (SlangParameterCategory)category);
3224 }
3225
3226 SlangImageFormat getImageFormat()
3227 {
3229 }
3230
3231 char const* getSemanticName()
3232 {
3234 }
3235
3236 size_t getSemanticIndex()
3237 {
3239 }
3240
3241 SlangStage getStage()
3242 {
3244 }
3245
3246 // Pending Type Layout functionality has been removed
3247 [[deprecated]] VariableLayoutReflection* getPendingDataLayout() { return nullptr; }
3248};
3249
3250struct FunctionReflection
3251{
3252 char const* getName() { return spReflectionFunction_GetName((SlangReflectionFunction*)this); }
3253
3254 TypeReflection* getReturnType()
3255 {
3256 return (TypeReflection*)spReflectionFunction_GetResultType((SlangReflectionFunction*)this);
3257 }
3258
3259 unsigned int getParameterCount()
3260 {
3262 }
3263
3264 VariableReflection* getParameterByIndex(unsigned int index)
3265 {
3266 return (VariableReflection*)spReflectionFunction_GetParameter(
3268 index);
3269 }
3270
3271 unsigned int getUserAttributeCount()
3272 {
3274 }
3275 Attribute* getUserAttributeByIndex(unsigned int index)
3276 {
3277 return (
3279 }
3280 Attribute* findAttributeByName(SlangSession* globalSession, char const* name)
3281 {
3284 globalSession,
3285 name);
3286 }
3287 Attribute* findUserAttributeByName(SlangSession* globalSession, char const* name)
3288 {
3289 return findAttributeByName(globalSession, name);
3290 }
3291 Modifier* findModifier(Modifier::ID id)
3292 {
3293 return (Modifier*)spReflectionFunction_FindModifier(
3295 (SlangModifierID)id);
3296 }
3297
3298 GenericReflection* getGenericContainer()
3299 {
3300 return (GenericReflection*)spReflectionFunction_GetGenericContainer(
3302 }
3303
3304 FunctionReflection* applySpecializations(GenericReflection* generic)
3305 {
3306 return (FunctionReflection*)spReflectionFunction_applySpecializations(
3308 (SlangReflectionGeneric*)generic);
3309 }
3310
3311 FunctionReflection* specializeWithArgTypes(unsigned int argCount, TypeReflection* const* types)
3312 {
3313 return (FunctionReflection*)spReflectionFunction_specializeWithArgTypes(
3315 argCount,
3316 (SlangReflectionType* const*)types);
3317 }
3318
3319 bool isOverloaded()
3320 {
3322 }
3323
3324 unsigned int getOverloadCount()
3325 {
3327 }
3328
3329 FunctionReflection* getOverload(unsigned int index)
3330 {
3331 return (FunctionReflection*)spReflectionFunction_getOverload(
3333 index);
3334 }
3335};
3336
3337struct GenericReflection
3338{
3339
3340 DeclReflection* asDecl()
3341 {
3342 return (DeclReflection*)spReflectionGeneric_asDecl((SlangReflectionGeneric*)this);
3343 }
3344
3345 char const* getName() { return spReflectionGeneric_GetName((SlangReflectionGeneric*)this); }
3346
3347 unsigned int getTypeParameterCount()
3348 {
3350 }
3351
3352 VariableReflection* getTypeParameter(unsigned index)
3353 {
3354 return (VariableReflection*)spReflectionGeneric_GetTypeParameter(
3356 index);
3357 }
3358
3359 unsigned int getValueParameterCount()
3360 {
3362 }
3363
3364 VariableReflection* getValueParameter(unsigned index)
3365 {
3366 return (VariableReflection*)spReflectionGeneric_GetValueParameter(
3368 index);
3369 }
3370
3371 unsigned int getTypeParameterConstraintCount(VariableReflection* typeParam)
3372 {
3375 (SlangReflectionVariable*)typeParam);
3376 }
3377
3378 TypeReflection* getTypeParameterConstraintType(VariableReflection* typeParam, unsigned index)
3379 {
3382 (SlangReflectionVariable*)typeParam,
3383 index);
3384 }
3385
3386 DeclReflection* getInnerDecl()
3387 {
3388 return (DeclReflection*)spReflectionGeneric_GetInnerDecl((SlangReflectionGeneric*)this);
3389 }
3390
3391 SlangDeclKind getInnerKind()
3392 {
3394 }
3395
3396 GenericReflection* getOuterGenericContainer()
3397 {
3398 return (GenericReflection*)spReflectionGeneric_GetOuterGenericContainer(
3399 (SlangReflectionGeneric*)this);
3400 }
3401
3402 TypeReflection* getConcreteType(VariableReflection* typeParam)
3403 {
3404 return (TypeReflection*)spReflectionGeneric_GetConcreteType(
3406 (SlangReflectionVariable*)typeParam);
3407 }
3408
3409 int64_t getConcreteIntVal(VariableReflection* valueParam)
3410 {
3413 (SlangReflectionVariable*)valueParam);
3414 }
3415
3416 GenericReflection* applySpecializations(GenericReflection* generic)
3417 {
3418 return (GenericReflection*)spReflectionGeneric_applySpecializations(
3420 (SlangReflectionGeneric*)generic);
3421 }
3422};
3423
3424struct EntryPointReflection
3425{
3426 char const* getName()
3427 {
3429 }
3430
3431 char const* getNameOverride()
3432 {
3434 }
3435
3436 unsigned getParameterCount()
3437 {
3439 }
3440
3441 FunctionReflection* getFunction()
3442 {
3443 return (FunctionReflection*)spReflectionEntryPoint_getFunction(
3445 }
3446
3447 VariableLayoutReflection* getParameterByIndex(unsigned index)
3448 {
3449 return (VariableLayoutReflection*)spReflectionEntryPoint_getParameterByIndex(
3451 index);
3452 }
3453
3454 SlangStage getStage()
3455 {
3457 }
3458
3459 void getComputeThreadGroupSize(SlangUInt axisCount, SlangUInt* outSizeAlongAxis)
3460 {
3463 axisCount,
3464 outSizeAlongAxis);
3465 }
3466
3467 void getComputeWaveSize(SlangUInt* outWaveSize)
3468 {
3471 outWaveSize);
3472 }
3473
3474 bool usesAnySampleRateInput()
3475 {
3477 }
3478
3479 VariableLayoutReflection* getVarLayout()
3480 {
3481 return (VariableLayoutReflection*)spReflectionEntryPoint_getVarLayout(
3483 }
3484
3485 TypeLayoutReflection* getTypeLayout() { return getVarLayout()->getTypeLayout(); }
3486
3487 VariableLayoutReflection* getResultVarLayout()
3488 {
3489 return (VariableLayoutReflection*)spReflectionEntryPoint_getResultVarLayout(
3491 }
3492
3493 bool hasDefaultConstantBuffer()
3494 {
3496 0;
3497 }
3498};
3499
3500typedef EntryPointReflection EntryPointLayout;
3501
3502struct TypeParameterReflection
3503{
3504 char const* getName()
3505 {
3507 }
3508 unsigned getIndex()
3509 {
3511 }
3512 unsigned getConstraintCount()
3513 {
3515 }
3516 TypeReflection* getConstraintByIndex(int index)
3517 {
3518 return (TypeReflection*)spReflectionTypeParameter_GetConstraintByIndex(
3520 index);
3521 }
3522};
3523
3524enum class LayoutRules : SlangLayoutRulesIntegral
3525{
3527 MetalArgumentBufferTier2 = SLANG_LAYOUT_RULES_METAL_ARGUMENT_BUFFER_TIER_2,
3528 DefaultStructuredBuffer = SLANG_LAYOUT_RULES_DEFAULT_STRUCTURED_BUFFER,
3529 DefaultConstantBuffer = SLANG_LAYOUT_RULES_DEFAULT_CONSTANT_BUFFER,
3530};
3531
3532typedef struct ShaderReflection ProgramLayout;
3533typedef enum SlangReflectionGenericArgType GenericArgType;
3534
3535struct ShaderReflection
3536{
3537 unsigned getParameterCount() { return spReflection_GetParameterCount((SlangReflection*)this); }
3538
3539 unsigned getTypeParameterCount()
3540 {
3542 }
3543
3544 slang::ISession* getSession() { return spReflection_GetSession((SlangReflection*)this); }
3545
3546 TypeParameterReflection* getTypeParameterByIndex(unsigned index)
3547 {
3548 return (TypeParameterReflection*)spReflection_GetTypeParameterByIndex(
3549 (SlangReflection*)this,
3550 index);
3551 }
3552
3553 TypeParameterReflection* findTypeParameter(char const* name)
3554 {
3555 return (
3556 TypeParameterReflection*)spReflection_FindTypeParameter((SlangReflection*)this, name);
3557 }
3558
3559 VariableLayoutReflection* getParameterByIndex(unsigned index)
3560 {
3561 return (VariableLayoutReflection*)spReflection_GetParameterByIndex(
3562 (SlangReflection*)this,
3563 index);
3564 }
3565
3566 static ProgramLayout* get(SlangCompileRequest* request)
3567 {
3568 return (ProgramLayout*)spGetReflection(request);
3569 }
3570
3571 SlangUInt getEntryPointCount()
3572 {
3574 }
3575
3576 EntryPointReflection* getEntryPointByIndex(SlangUInt index)
3577 {
3578 return (
3579 EntryPointReflection*)spReflection_getEntryPointByIndex((SlangReflection*)this, index);
3580 }
3581
3587 SlangUInt getGlobalConstantBufferBinding()
3588 {
3590 }
3591
3598 size_t getGlobalConstantBufferSize()
3599 {
3601 }
3602
3603 TypeReflection* findTypeByName(const char* name)
3604 {
3605 return (TypeReflection*)spReflection_FindTypeByName((SlangReflection*)this, name);
3606 }
3607
3608 FunctionReflection* findFunctionByName(const char* name)
3609 {
3610 return (FunctionReflection*)spReflection_FindFunctionByName((SlangReflection*)this, name);
3611 }
3612
3613 FunctionReflection* findFunctionByNameInType(TypeReflection* type, const char* name)
3614 {
3615 return (FunctionReflection*)spReflection_FindFunctionByNameInType(
3616 (SlangReflection*)this,
3617 (SlangReflectionType*)type,
3618 name);
3619 }
3620
3621 SLANG_DEPRECATED FunctionReflection* tryResolveOverloadedFunction(
3622 uint32_t candidateCount,
3623 FunctionReflection** candidates)
3624 {
3625 return (FunctionReflection*)spReflection_TryResolveOverloadedFunction(
3626 (SlangReflection*)this,
3627 candidateCount,
3628 (SlangReflectionFunction**)candidates);
3629 }
3630
3631 VariableReflection* findVarByNameInType(TypeReflection* type, const char* name)
3632 {
3633 return (VariableReflection*)spReflection_FindVarByNameInType(
3634 (SlangReflection*)this,
3635 (SlangReflectionType*)type,
3636 name);
3637 }
3638
3639 TypeLayoutReflection* getTypeLayout(
3640 TypeReflection* type,
3641 LayoutRules rules = LayoutRules::Default)
3642 {
3643 return (TypeLayoutReflection*)spReflection_GetTypeLayout(
3644 (SlangReflection*)this,
3645 (SlangReflectionType*)type,
3646 SlangLayoutRules(rules));
3647 }
3648
3649 EntryPointReflection* findEntryPointByName(const char* name)
3650 {
3651 return (
3652 EntryPointReflection*)spReflection_findEntryPointByName((SlangReflection*)this, name);
3653 }
3654
3655 TypeReflection* specializeType(
3656 TypeReflection* type,
3657 SlangInt specializationArgCount,
3658 TypeReflection* const* specializationArgs,
3659 ISlangBlob** outDiagnostics)
3660 {
3661 return (TypeReflection*)spReflection_specializeType(
3662 (SlangReflection*)this,
3663 (SlangReflectionType*)type,
3664 specializationArgCount,
3665 (SlangReflectionType* const*)specializationArgs,
3666 outDiagnostics);
3667 }
3668
3669 GenericReflection* specializeGeneric(
3670 GenericReflection* generic,
3671 SlangInt specializationArgCount,
3672 GenericArgType const* specializationArgTypes,
3673 GenericArgReflection const* specializationArgVals,
3674 ISlangBlob** outDiagnostics)
3675 {
3676 return (GenericReflection*)spReflection_specializeGeneric(
3677 (SlangReflection*)this,
3678 (SlangReflectionGeneric*)generic,
3679 specializationArgCount,
3680 (SlangReflectionGenericArgType const*)specializationArgTypes,
3681 (SlangReflectionGenericArg const*)specializationArgVals,
3682 outDiagnostics);
3683 }
3684
3685 bool isSubType(TypeReflection* subType, TypeReflection* superType)
3686 {
3688 (SlangReflection*)this,
3689 (SlangReflectionType*)subType,
3690 (SlangReflectionType*)superType);
3691 }
3692
3693 SlangUInt getHashedStringCount() const
3694 {
3696 }
3697
3698 const char* getHashedString(SlangUInt index, size_t* outCount) const
3699 {
3700 return spReflection_getHashedString((SlangReflection*)this, index, outCount);
3701 }
3702
3703 TypeLayoutReflection* getGlobalParamsTypeLayout()
3704 {
3705 return (TypeLayoutReflection*)spReflection_getGlobalParamsTypeLayout(
3706 (SlangReflection*)this);
3707 }
3708
3709 VariableLayoutReflection* getGlobalParamsVarLayout()
3710 {
3711 return (VariableLayoutReflection*)spReflection_getGlobalParamsVarLayout(
3712 (SlangReflection*)this);
3713 }
3714
3715 SlangResult toJson(ISlangBlob** outBlob)
3716 {
3717 return spReflection_ToJson((SlangReflection*)this, nullptr, outBlob);
3718 }
3719
3723 SlangInt getBindlessSpaceIndex()
3724 {
3726 }
3727};
3728
3729
3730struct DeclReflection
3731{
3732 enum class Kind
3733 {
3735 Struct = SLANG_DECL_KIND_STRUCT,
3736 Func = SLANG_DECL_KIND_FUNC,
3737 Module = SLANG_DECL_KIND_MODULE,
3738 Generic = SLANG_DECL_KIND_GENERIC,
3739 Variable = SLANG_DECL_KIND_VARIABLE,
3740 Namespace = SLANG_DECL_KIND_NAMESPACE,
3741 Enum = SLANG_DECL_KIND_ENUM,
3742 };
3743
3744 char const* getName() { return spReflectionDecl_getName((SlangReflectionDecl*)this); }
3745
3746 Kind getKind() { return (Kind)spReflectionDecl_getKind((SlangReflectionDecl*)this); }
3747
3748 unsigned int getChildrenCount()
3749 {
3751 }
3752
3753 DeclReflection* getChild(unsigned int index)
3754 {
3755 return (DeclReflection*)spReflectionDecl_getChild((SlangReflectionDecl*)this, index);
3756 }
3757
3758 TypeReflection* getType()
3759 {
3760 return (TypeReflection*)spReflection_getTypeFromDecl((SlangReflectionDecl*)this);
3761 }
3762
3763 VariableReflection* asVariable()
3764 {
3765 return (VariableReflection*)spReflectionDecl_castToVariable((SlangReflectionDecl*)this);
3766 }
3767
3768 FunctionReflection* asFunction()
3769 {
3770 return (FunctionReflection*)spReflectionDecl_castToFunction((SlangReflectionDecl*)this);
3771 }
3772
3773 GenericReflection* asGeneric()
3774 {
3775 return (GenericReflection*)spReflectionDecl_castToGeneric((SlangReflectionDecl*)this);
3776 }
3777
3778 DeclReflection* getParent()
3779 {
3780 return (DeclReflection*)spReflectionDecl_getParent((SlangReflectionDecl*)this);
3781 }
3782
3783 Modifier* findModifier(Modifier::ID id)
3784 {
3785 return (Modifier*)spReflectionDecl_findModifier(
3786 (SlangReflectionDecl*)this,
3787 (SlangModifierID)id);
3788 }
3789
3790 template<Kind K>
3791 struct FilteredList
3792 {
3793 unsigned int count;
3794 DeclReflection* parent;
3795
3796 struct FilteredIterator
3797 {
3798 DeclReflection* parent;
3799 unsigned int count;
3800 unsigned int index;
3801
3802 DeclReflection* operator*() { return parent->getChild(index); }
3803 void operator++()
3804 {
3805 index++;
3806 while (index < count && !(parent->getChild(index)->getKind() == K))
3807 {
3808 index++;
3809 }
3810 }
3811 bool operator!=(FilteredIterator const& other) { return index != other.index; }
3812 };
3813
3814 // begin/end for range-based for that checks the kind
3815 FilteredIterator begin()
3816 {
3817 // Find the first child of the right kind
3818 unsigned int index = 0;
3819 while (index < count && !(parent->getChild(index)->getKind() == K))
3820 {
3821 index++;
3822 }
3823 return FilteredIterator{parent, count, index};
3824 }
3825
3826 FilteredIterator end() { return FilteredIterator{parent, count, count}; }
3827 };
3828
3829 template<Kind K>
3830 FilteredList<K> getChildrenOfKind()
3831 {
3832 return FilteredList<K>{getChildrenCount(), (DeclReflection*)this};
3833 }
3834
3835 struct IteratedList
3836 {
3837 unsigned int count;
3838 DeclReflection* parent;
3839
3840 struct Iterator
3841 {
3842 DeclReflection* parent;
3843 unsigned int count;
3844 unsigned int index;
3845
3846 DeclReflection* operator*() { return parent->getChild(index); }
3847 void operator++() { index++; }
3848 bool operator!=(Iterator const& other) { return index != other.index; }
3849 };
3850
3851 // begin/end for range-based for that checks the kind
3852 IteratedList::Iterator begin() { return IteratedList::Iterator{parent, count, 0}; }
3853 IteratedList::Iterator end() { return IteratedList::Iterator{parent, count, count}; }
3854 };
3855
3856 IteratedList getChildren() { return IteratedList{getChildrenCount(), (DeclReflection*)this}; }
3857};
3858
3859typedef uint32_t CompileCoreModuleFlags;
3860struct CompileCoreModuleFlag
3861{
3862 enum Enum : CompileCoreModuleFlags
3863 {
3864 WriteDocumentation = 0x1,
3865 };
3866};
3867
3868typedef ISlangBlob IBlob;
3869
3870struct IComponentType;
3871struct ITypeConformance;
3872struct IGlobalSession;
3873struct IModule;
3874
3875struct SessionDesc;
3876struct SpecializationArg;
3877struct TargetDesc;
3878
3879enum class BuiltinModuleName
3880{
3881 Core = 0,
3882 GLSL = 1,
3883};
3884
3896struct IGlobalSession : public ISlangUnknown
3897{
3898 SLANG_COM_INTERFACE(0xc140b5fd, 0xc78, 0x452e, {0xba, 0x7c, 0x1a, 0x1e, 0x70, 0xc7, 0xf7, 0x1c})
3899
3903 createSession(SessionDesc const& desc, ISession** outSession) = 0;
3904
3911 virtual SLANG_NO_THROW SlangProfileID SLANG_MCALL findProfile(char const* name) = 0;
3912
3921 virtual SLANG_NO_THROW void SLANG_MCALL
3922 setDownstreamCompilerPath(SlangPassThrough passThrough, char const* path) = 0;
3923
3933 virtual SLANG_NO_THROW void SLANG_MCALL
3934 setDownstreamCompilerPrelude(SlangPassThrough passThrough, const char* preludeText) = 0;
3935
3943 virtual SLANG_NO_THROW void SLANG_MCALL
3944 getDownstreamCompilerPrelude(SlangPassThrough passThrough, ISlangBlob** outPrelude) = 0;
3945
3955 virtual SLANG_NO_THROW const char* SLANG_MCALL getBuildTagString() = 0;
3956
3957 /* For a given source language set the default compiler.
3958 If a default cannot be chosen (for example the target cannot be achieved by the default),
3959 the default will not be used.
3960
3961 @param sourceLanguage the source language
3962 @param defaultCompiler the default compiler for that language
3963 @return
3964 */
3965 virtual SLANG_NO_THROW SlangResult SLANG_MCALL setDefaultDownstreamCompiler(
3966 SlangSourceLanguage sourceLanguage,
3967 SlangPassThrough defaultCompiler) = 0;
3968
3969 /* For a source type get the default compiler
3970
3971 @param sourceLanguage the source language
3972 @return The downstream compiler for that source language */
3974 getDefaultDownstreamCompiler(SlangSourceLanguage sourceLanguage) = 0;
3975
3976 /* Set the 'prelude' placed before generated code for a specific language type.
3977
3978 @param sourceLanguage The language the prelude should be inserted on.
3979 @param preludeText The text added pre-pended verbatim before the generated source
3980
3981 Note! That for pass-through usage, prelude is not pre-pended, preludes are for code generation
3982 only.
3983 */
3984 virtual SLANG_NO_THROW void SLANG_MCALL
3985 setLanguagePrelude(SlangSourceLanguage sourceLanguage, const char* preludeText) = 0;
3986
3991 virtual SLANG_NO_THROW void SLANG_MCALL
3992 getLanguagePrelude(SlangSourceLanguage sourceLanguage, ISlangBlob** outPrelude) = 0;
3993
3996 [[deprecated]] virtual SLANG_NO_THROW SlangResult SLANG_MCALL
3997 createCompileRequest(slang::ICompileRequest** outCompileRequest) = 0;
3998
4001 virtual SLANG_NO_THROW void SLANG_MCALL
4002 addBuiltins(char const* sourcePath, char const* sourceString) = 0;
4003
4008 virtual SLANG_NO_THROW void SLANG_MCALL
4009 setSharedLibraryLoader(ISlangSharedLibraryLoader* loader) = 0;
4010
4014 virtual SLANG_NO_THROW ISlangSharedLibraryLoader* SLANG_MCALL getSharedLibraryLoader() = 0;
4015
4024 checkCompileTargetSupport(SlangCompileTarget target) = 0;
4025
4034 checkPassThroughSupport(SlangPassThrough passThrough) = 0;
4035
4042 compileCoreModule(CompileCoreModuleFlags flags) = 0;
4043
4051 loadCoreModule(const void* coreModule, size_t coreModuleSizeInBytes) = 0;
4052
4059 saveCoreModule(SlangArchiveType archiveType, ISlangBlob** outBlob) = 0;
4060
4067 virtual SLANG_NO_THROW SlangCapabilityID SLANG_MCALL findCapability(char const* name) = 0;
4068
4075 virtual SLANG_NO_THROW void SLANG_MCALL setDownstreamCompilerForTransition(
4076 SlangCompileTarget source,
4077 SlangCompileTarget target,
4078 SlangPassThrough compiler) = 0;
4079
4087 getDownstreamCompilerForTransition(SlangCompileTarget source, SlangCompileTarget target) = 0;
4088
4091 virtual SLANG_NO_THROW void SLANG_MCALL
4092 getCompilerElapsedTime(double* outTotalTime, double* outDownstreamTime) = 0;
4093
4097 virtual SLANG_NO_THROW SlangResult SLANG_MCALL setSPIRVCoreGrammar(char const* jsonPath) = 0;
4098
4106 virtual SLANG_NO_THROW SlangResult SLANG_MCALL parseCommandLineArguments(
4107 int argc,
4108 const char* const* argv,
4109 SessionDesc* outSessionDesc,
4110 ISlangUnknown** outAuxAllocation) = 0;
4111
4115 getSessionDescDigest(SessionDesc* sessionDesc, ISlangBlob** outBlob) = 0;
4116
4124 compileBuiltinModule(BuiltinModuleName module, CompileCoreModuleFlags flags) = 0;
4125
4134 loadBuiltinModule(BuiltinModuleName module, const void* moduleData, size_t sizeInBytes) = 0;
4135
4142 virtual SLANG_NO_THROW SlangResult SLANG_MCALL saveBuiltinModule(
4143 BuiltinModuleName module,
4144 SlangArchiveType archiveType,
4145 ISlangBlob** outBlob) = 0;
4146};
4147
4148 #define SLANG_UUID_IGlobalSession IGlobalSession::getTypeGuid()
4149
4152struct TargetDesc
4153{
4156 size_t structureSize = sizeof(TargetDesc);
4157
4161
4165
4168
4172
4176
4179 bool forceGLSLScalarBufferLayout = false;
4180
4183 const CompilerOptionEntry* compilerOptionEntries = nullptr;
4184
4187 uint32_t compilerOptionEntryCount = 0;
4188};
4189
4190typedef uint32_t SessionFlags;
4191enum
4192{
4193 kSessionFlags_None = 0
4194};
4195
4196struct PreprocessorMacroDesc
4197{
4198 const char* name;
4199 const char* value;
4200};
4201
4202struct SessionDesc
4203{
4206 size_t structureSize = sizeof(SessionDesc);
4207
4210 TargetDesc const* targets = nullptr;
4211 SlangInt targetCount = 0;
4212
4215 SessionFlags flags = kSessionFlags_None;
4216
4219 SlangMatrixLayoutMode defaultMatrixLayoutMode = SLANG_MATRIX_LAYOUT_ROW_MAJOR;
4220
4223 char const* const* searchPaths = nullptr;
4224 SlangInt searchPathCount = 0;
4225
4226 PreprocessorMacroDesc const* preprocessorMacros = nullptr;
4227 SlangInt preprocessorMacroCount = 0;
4228
4229 ISlangFileSystem* fileSystem = nullptr;
4230
4231 bool enableEffectAnnotations = false;
4232 bool allowGLSLSyntax = false;
4233
4236 const CompilerOptionEntry* compilerOptionEntries = nullptr;
4237
4240 uint32_t compilerOptionEntryCount = 0;
4241
4244 bool skipSPIRVValidation = false;
4245};
4246
4247enum class ContainerType
4248{
4249 None = 0,
4250 UnsizedArray = 1,
4251 StructuredBuffer = 2,
4252 ConstantBuffer = 3,
4253 ParameterBlock = 4,
4254};
4255
4256struct SourceLocation
4257{
4258 const char* filePath = nullptr;
4259 SlangInt line = -1;
4260 SlangInt column = -1;
4261};
4262
4288struct ISession : public ISlangUnknown
4289{
4290 SLANG_COM_INTERFACE(0x67618701, 0xd116, 0x468f, {0xab, 0x3b, 0x47, 0x4b, 0xed, 0xce, 0xe, 0x3d})
4291
4294 virtual SLANG_NO_THROW IGlobalSession* SLANG_MCALL getGlobalSession() = 0;
4295
4298 virtual SLANG_NO_THROW IModule* SLANG_MCALL
4299 loadModule(const char* moduleName, IBlob** outDiagnostics = nullptr) = 0;
4300
4303 virtual SLANG_NO_THROW IModule* SLANG_MCALL loadModuleFromSource(
4304 const char* moduleName,
4305 const char* path,
4306 slang::IBlob* source,
4307 slang::IBlob** outDiagnostics = nullptr) = 0;
4308
4338 virtual SLANG_NO_THROW SlangResult SLANG_MCALL createCompositeComponentType(
4339 IComponentType* const* componentTypes,
4340 SlangInt componentTypeCount,
4341 IComponentType** outCompositeComponentType,
4342 ISlangBlob** outDiagnostics = nullptr) = 0;
4343
4346 virtual SLANG_NO_THROW TypeReflection* SLANG_MCALL specializeType(
4347 TypeReflection* type,
4348 SpecializationArg const* specializationArgs,
4349 SlangInt specializationArgCount,
4350 ISlangBlob** outDiagnostics = nullptr) = 0;
4351
4352
4355 virtual SLANG_NO_THROW TypeLayoutReflection* SLANG_MCALL getTypeLayout(
4356 TypeReflection* type,
4357 SlangInt targetIndex = 0,
4358 LayoutRules rules = LayoutRules::Default,
4359 ISlangBlob** outDiagnostics = nullptr) = 0;
4360
4368 virtual SLANG_NO_THROW TypeReflection* SLANG_MCALL getContainerType(
4369 TypeReflection* elementType,
4370 ContainerType containerType,
4371 ISlangBlob** outDiagnostics = nullptr) = 0;
4372
4377 virtual SLANG_NO_THROW TypeReflection* SLANG_MCALL getDynamicType() = 0;
4378
4382 getTypeRTTIMangledName(TypeReflection* type, ISlangBlob** outNameBlob) = 0;
4383
4386 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getTypeConformanceWitnessMangledName(
4387 TypeReflection* type,
4388 TypeReflection* interfaceType,
4389 ISlangBlob** outNameBlob) = 0;
4390
4394 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getTypeConformanceWitnessSequentialID(
4395 slang::TypeReflection* type,
4396 slang::TypeReflection* interfaceType,
4397 uint32_t* outId) = 0;
4398
4402 createCompileRequest(SlangCompileRequest** outCompileRequest) = 0;
4403
4404
4423 virtual SLANG_NO_THROW SlangResult SLANG_MCALL createTypeConformanceComponentType(
4424 slang::TypeReflection* type,
4425 slang::TypeReflection* interfaceType,
4426 ITypeConformance** outConformance,
4427 SlangInt conformanceIdOverride,
4428 ISlangBlob** outDiagnostics) = 0;
4429
4432 virtual SLANG_NO_THROW IModule* SLANG_MCALL loadModuleFromIRBlob(
4433 const char* moduleName,
4434 const char* path,
4435 slang::IBlob* source,
4436 slang::IBlob** outDiagnostics = nullptr) = 0;
4437
4438 virtual SLANG_NO_THROW SlangInt SLANG_MCALL getLoadedModuleCount() = 0;
4439 virtual SLANG_NO_THROW IModule* SLANG_MCALL getLoadedModule(SlangInt index) = 0;
4440
4444 virtual SLANG_NO_THROW bool SLANG_MCALL
4445 isBinaryModuleUpToDate(const char* modulePath, slang::IBlob* binaryModuleBlob) = 0;
4446
4449 virtual SLANG_NO_THROW IModule* SLANG_MCALL loadModuleFromSourceString(
4450 const char* moduleName,
4451 const char* path,
4452 const char* string,
4453 slang::IBlob** outDiagnostics = nullptr) = 0;
4454
4455
4480 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getDynamicObjectRTTIBytes(
4481 slang::TypeReflection* type,
4482 slang::TypeReflection* interfaceType,
4483 uint32_t* outRTTIDataBuffer,
4484 uint32_t bufferSizeInBytes) = 0;
4485
4490 virtual SLANG_NO_THROW SlangResult SLANG_MCALL loadModuleInfoFromIRBlob(
4491 slang::IBlob* source,
4492 SlangInt& outModuleVersion,
4493 const char*& outModuleCompilerVersion,
4494 const char*& outModuleName) = 0;
4495
4501 getDeclSourceLocation(slang::DeclReflection* decl, slang::SourceLocation* outLocation) = 0;
4502};
4503
4504 #define SLANG_UUID_ISession ISession::getTypeGuid()
4505
4506struct IMetadata : public ISlangCastable
4507{
4508 SLANG_COM_INTERFACE(0x8044a8a3, 0xddc0, 0x4b7f, {0xaf, 0x8e, 0x2, 0x6e, 0x90, 0x5d, 0x73, 0x32})
4509
4510 /*
4511 Returns whether a resource parameter at the specified binding location is actually being used
4512 in the compiled shader.
4513 */
4514 virtual SlangResult isParameterLocationUsed(
4515 SlangParameterCategory category, // is this a `t` register? `s` register?
4516 SlangUInt spaceIndex, // `space` for D3D12, `set` for Vulkan
4517 SlangUInt registerIndex, // `register` for D3D12, `binding` for Vulkan
4518 bool& outUsed) = 0;
4519
4520 /*
4521 Returns the debug build identifier for a base and debug spirv pair.
4522 */
4523 virtual const char* SLANG_MCALL getDebugBuildIdentifier() = 0;
4524};
4525 #define SLANG_UUID_IMetadata IMetadata::getTypeGuid()
4526
4584struct CoverageEntryInfo
4585{
4586 size_t structSize = sizeof(CoverageEntryInfo);
4587
4591 const char* file = nullptr;
4592
4598 uint32_t line = 0;
4599};
4600
4613struct CoverageBufferInfo
4614{
4615 size_t structSize = sizeof(CoverageBufferInfo);
4616
4620 int32_t space = -1;
4621
4625 int32_t binding = -1;
4626};
4627
4628struct ICoverageTracingMetadata : public ISlangCastable
4629{
4631 0x7c9f1d50,
4632 0x1e4a,
4633 0x4b9c,
4634 {0x8e, 0x21, 0x3f, 0x7b, 0x82, 0xa3, 0xd9, 0x51})
4635
4642 virtual SLANG_NO_THROW uint32_t SLANG_MCALL getCounterCount() = 0;
4643
4650 getEntryInfo(uint32_t index, CoverageEntryInfo* outInfo) = 0;
4651
4663 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getBufferInfo(CoverageBufferInfo* outInfo) = 0;
4664};
4665 #define SLANG_UUID_ICoverageTracingMetadata ICoverageTracingMetadata::getTypeGuid()
4666
4704enum class SyntheticResourceScope : uint32_t
4705{
4707 Global = 0,
4708
4710 EntryPoint = 1,
4711};
4712
4713enum class SyntheticResourceAccess : uint32_t
4714{
4715 Read = 0,
4716 Write = 1,
4717 ReadWrite = 2,
4718};
4719
4720struct SyntheticResourceInfo
4721{
4722 size_t structSize = sizeof(SyntheticResourceInfo);
4723
4731 uint32_t id = 0;
4732
4735 BindingType bindingType = BindingType::Unknown;
4736
4739 uint32_t arraySize = 1;
4740
4745 SyntheticResourceScope scope = SyntheticResourceScope::Global;
4746
4748 SyntheticResourceAccess access = SyntheticResourceAccess::Read;
4749
4752 int32_t entryPointIndex = -1;
4753
4770 int32_t space = -1;
4771 int32_t binding = -1;
4772
4775 int32_t uniformOffset = -1;
4776
4779 int32_t uniformStride = 0;
4780
4784 const char* debugName = nullptr;
4785};
4786
4787struct ISyntheticResourceMetadata : public ISlangCastable
4788{
4790 0x47a33723,
4791 0x181b,
4792 0x4d2b,
4793 {0xb8, 0x9e, 0x21, 0x54, 0x95, 0xbb, 0x38, 0x8b})
4794
4797 virtual SLANG_NO_THROW uint32_t SLANG_MCALL getResourceCount() = 0;
4798
4807 getResourceInfo(uint32_t index, SyntheticResourceInfo* outInfo) = 0;
4808
4814 findResourceIndexByID(uint32_t id, uint32_t* outIndex) = 0;
4815};
4816 #define SLANG_UUID_ISyntheticResourceMetadata ISyntheticResourceMetadata::getTypeGuid()
4817
4818struct CooperativeMatrixType
4819{
4820 // Component type `NONE` means this type is not valid.
4823
4824 uint32_t rowCount = 0;
4825 uint32_t columnCount = 0;
4826
4828};
4829
4830struct CooperativeMatrixCombination
4831{
4832 // Number of rows of matrix A and the result.
4833 uint32_t m = 0;
4834 // Number of columns of matrix B and the result.
4835 uint32_t n = 0;
4836 // Shared inner dimension: columns of A and rows of B.
4837 uint32_t k = 0;
4838
4839 SlangScalarType componentTypeA = SLANG_SCALAR_TYPE_NONE;
4840 SlangScalarType componentTypeB = SLANG_SCALAR_TYPE_NONE;
4841 SlangScalarType componentTypeC = SLANG_SCALAR_TYPE_NONE;
4842 SlangScalarType componentTypeResult = SLANG_SCALAR_TYPE_NONE;
4843
4844 SlangBool saturate = false;
4846};
4847
4848struct CooperativeVectorTypeUsageInfo
4849{
4851
4852 // Maximum element count used for this component type in cooperative
4853 // operations (e.g. MatMul).
4854 uint32_t maxSize = 0;
4855
4856 // Whether this component type is used as an accumulation/storage type for
4857 // cooperative training operations (e.g. outer-product accumulation and
4858 // reduce-sum accumulation). This flag is independent of `maxSize`.
4859 SlangBool usedForTrainingOp = false;
4860};
4861
4862struct CooperativeVectorCombination
4863{
4865 SlangScalarType inputInterpretation = SLANG_SCALAR_TYPE_NONE;
4866 // Number of logical elements packed into each physical input element.
4867 // For example, this is 4 when four int8 values are packed into one uint32 input element.
4868 uint32_t inputPackingFactor = 1;
4869 SlangScalarType matrixInterpretation = SLANG_SCALAR_TYPE_NONE;
4870 // `NONE` means the operation has no bias operand/matrix.
4871 SlangScalarType biasInterpretation = SLANG_SCALAR_TYPE_NONE;
4873 SlangBool transpose = false;
4874};
4875
4895struct ICooperativeTypesMetadata : public ISlangCastable
4896{
4898 0x64c4d536,
4899 0xd949,
4900 0x49c3,
4901 {0x9f, 0xde, 0x3f, 0x0f, 0x9c, 0x6f, 0x01, 0x31})
4902
4903 virtual SLANG_NO_THROW SlangUInt SLANG_MCALL getCooperativeMatrixTypeCount() = 0;
4905 getCooperativeMatrixTypeByIndex(SlangUInt index, CooperativeMatrixType* outType) = 0;
4906
4907 virtual SLANG_NO_THROW SlangUInt SLANG_MCALL getCooperativeMatrixCombinationCount() = 0;
4908 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getCooperativeMatrixCombinationByIndex(
4909 SlangUInt index,
4910 CooperativeMatrixCombination* outCombination) = 0;
4911
4912 virtual SLANG_NO_THROW SlangUInt SLANG_MCALL getCooperativeVectorTypeCount() = 0;
4914 getCooperativeVectorTypeByIndex(SlangUInt index, CooperativeVectorTypeUsageInfo* outType) = 0;
4915
4916 virtual SLANG_NO_THROW SlangUInt SLANG_MCALL getCooperativeVectorCombinationCount() = 0;
4917 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getCooperativeVectorCombinationByIndex(
4918 SlangUInt index,
4919 CooperativeVectorCombination* outCombination) = 0;
4920};
4921 #define SLANG_UUID_ICooperativeTypesMetadata ICooperativeTypesMetadata::getTypeGuid()
4922
4927struct ICompileResult : public ISlangCastable
4928{
4930 0x5fa9380e,
4931 0xb62f,
4932 0x41e5,
4933 {0x9f, 0x12, 0x4b, 0xad, 0x4d, 0x9e, 0xaa, 0xe4})
4934
4935 virtual uint32_t SLANG_MCALL getItemCount() = 0;
4936 virtual SlangResult SLANG_MCALL getItemData(uint32_t index, IBlob** outblob) = 0;
4937 virtual SlangResult SLANG_MCALL getMetadata(IMetadata** outMetadata) = 0;
4938};
4939 #define SLANG_UUID_ICompileResult ICompileResult::getTypeGuid()
4940
5002struct IComponentType : public ISlangUnknown
5003{
5004 SLANG_COM_INTERFACE(0x5bc42be8, 0x5c50, 0x4929, {0x9e, 0x5e, 0xd1, 0x5e, 0x7c, 0x24, 0x1, 0x5f})
5005
5008 virtual SLANG_NO_THROW ISession* SLANG_MCALL getSession() = 0;
5009
5033 virtual SLANG_NO_THROW ProgramLayout* SLANG_MCALL
5034 getLayout(SlangInt targetIndex = 0, IBlob** outDiagnostics = nullptr) = 0;
5035
5038 virtual SLANG_NO_THROW SlangInt SLANG_MCALL getSpecializationParamCount() = 0;
5039
5062 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getEntryPointCode(
5063 SlangInt entryPointIndex,
5064 SlangInt targetIndex,
5065 IBlob** outCode,
5066 IBlob** outDiagnostics = nullptr) = 0;
5067
5076 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getResultAsFileSystem(
5077 SlangInt entryPointIndex,
5078 SlangInt targetIndex,
5079 ISlangMutableFileSystem** outFileSystem) = 0;
5080
5087 virtual SLANG_NO_THROW void SLANG_MCALL
5088 getEntryPointHash(SlangInt entryPointIndex, SlangInt targetIndex, IBlob** outHash) = 0;
5089
5097 virtual SLANG_NO_THROW SlangResult SLANG_MCALL specialize(
5098 SpecializationArg const* specializationArgs,
5099 SlangInt specializationArgCount,
5100 IComponentType** outSpecializedComponentType,
5101 ISlangBlob** outDiagnostics = nullptr) = 0;
5102
5122 link(IComponentType** outLinkedComponentType, ISlangBlob** outDiagnostics = nullptr) = 0;
5123
5136 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getEntryPointHostCallable(
5137 int entryPointIndex,
5138 int targetIndex,
5139 ISlangSharedLibrary** outSharedLibrary,
5140 slang::IBlob** outDiagnostics = 0) = 0;
5141
5148 renameEntryPoint(const char* newName, IComponentType** outEntryPoint) = 0;
5149
5153 virtual SLANG_NO_THROW SlangResult SLANG_MCALL linkWithOptions(
5154 IComponentType** outLinkedComponentType,
5155 uint32_t compilerOptionEntryCount,
5156 CompilerOptionEntry const* compilerOptionEntries,
5157 ISlangBlob** outDiagnostics = nullptr) = 0;
5158
5165 getTargetCode(SlangInt targetIndex, IBlob** outCode, IBlob** outDiagnostics = nullptr) = 0;
5166
5172 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getTargetMetadata(
5173 SlangInt targetIndex,
5174 IMetadata** outMetadata,
5175 IBlob** outDiagnostics = nullptr) = 0;
5176
5183 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getEntryPointMetadata(
5184 SlangInt entryPointIndex,
5185 SlangInt targetIndex,
5186 IMetadata** outMetadata,
5187 IBlob** outDiagnostics = nullptr) = 0;
5188};
5189 #define SLANG_UUID_IComponentType IComponentType::getTypeGuid()
5190
5191struct IEntryPoint : public IComponentType
5192{
5193 SLANG_COM_INTERFACE(0x8f241361, 0xf5bd, 0x4ca0, {0xa3, 0xac, 0x2, 0xf7, 0xfa, 0x24, 0x2, 0xb8})
5194
5195 virtual SLANG_NO_THROW FunctionReflection* SLANG_MCALL getFunctionReflection() = 0;
5196};
5197
5198 #define SLANG_UUID_IEntryPoint IEntryPoint::getTypeGuid()
5199
5200struct ITypeConformance : public IComponentType
5201{
5202 SLANG_COM_INTERFACE(0x73eb3147, 0xe544, 0x41b5, {0xb8, 0xf0, 0xa2, 0x44, 0xdf, 0x21, 0x94, 0xb})
5203};
5204 #define SLANG_UUID_ITypeConformance ITypeConformance::getTypeGuid()
5205
5215struct IComponentType2 : public ISlangUnknown
5216{
5218 0x9c2a4b3d,
5219 0x7f68,
5220 0x4e91,
5221 {0xa5, 0x2c, 0x8b, 0x19, 0x3e, 0x45, 0x7a, 0x9f})
5222
5223 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getTargetCompileResult(
5224 SlangInt targetIndex,
5225 ICompileResult** outCompileResult,
5226 IBlob** outDiagnostics = nullptr) = 0;
5227 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getEntryPointCompileResult(
5228 SlangInt entryPointIndex,
5229 SlangInt targetIndex,
5230 ICompileResult** outCompileResult,
5231 IBlob** outDiagnostics = nullptr) = 0;
5243 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getTargetHostCallable(
5244 int targetIndex,
5245 ISlangSharedLibrary** outSharedLibrary,
5246 slang::IBlob** outDiagnostics = 0) = 0;
5247};
5248 #define SLANG_UUID_IComponentType2 IComponentType2::getTypeGuid()
5249
5263struct IModule : public IComponentType
5264{
5265 SLANG_COM_INTERFACE(0xc720e64, 0x8722, 0x4d31, {0x89, 0x90, 0x63, 0x8a, 0x98, 0xb1, 0xc2, 0x79})
5266
5272 findEntryPointByName(char const* name, IEntryPoint** outEntryPoint) = 0;
5273
5278 virtual SLANG_NO_THROW SlangInt32 SLANG_MCALL getDefinedEntryPointCount() = 0;
5281 getDefinedEntryPoint(SlangInt32 index, IEntryPoint** outEntryPoint) = 0;
5282
5284 virtual SLANG_NO_THROW SlangResult SLANG_MCALL serialize(ISlangBlob** outSerializedBlob) = 0;
5285
5287 virtual SLANG_NO_THROW SlangResult SLANG_MCALL writeToFile(char const* fileName) = 0;
5288
5290 virtual SLANG_NO_THROW const char* SLANG_MCALL getName() = 0;
5291
5293 virtual SLANG_NO_THROW const char* SLANG_MCALL getFilePath() = 0;
5294
5296 virtual SLANG_NO_THROW const char* SLANG_MCALL getUniqueIdentity() = 0;
5297
5300 virtual SLANG_NO_THROW SlangResult SLANG_MCALL findAndCheckEntryPoint(
5301 char const* name,
5302 SlangStage stage,
5303 IEntryPoint** outEntryPoint,
5304 ISlangBlob** outDiagnostics) = 0;
5305
5310 virtual SLANG_NO_THROW SlangInt32 SLANG_MCALL getDependencyFileCount() = 0;
5311
5313 virtual SLANG_NO_THROW char const* SLANG_MCALL getDependencyFilePath(SlangInt32 index) = 0;
5314
5315 virtual SLANG_NO_THROW DeclReflection* SLANG_MCALL getModuleReflection() = 0;
5316
5320 disassemble(slang::IBlob** outDisassembledBlob) = 0;
5321};
5322
5323 #define SLANG_UUID_IModule IModule::getTypeGuid()
5324
5325/* Experimental interface for doing target precompilation of slang modules */
5326struct IModulePrecompileService_Experimental : public ISlangUnknown
5327{
5328 // uuidgen output: 8e12e8e3 - 5fcd - 433e - afcb - 13a088bc5ee5
5330 0x8e12e8e3,
5331 0x5fcd,
5332 0x433e,
5333 {0xaf, 0xcb, 0x13, 0xa0, 0x88, 0xbc, 0x5e, 0xe5})
5334
5336 precompileForTarget(SlangCompileTarget target, ISlangBlob** outDiagnostics) = 0;
5337
5338 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getPrecompiledTargetCode(
5339 SlangCompileTarget target,
5340 IBlob** outCode,
5341 IBlob** outDiagnostics = nullptr) = 0;
5342
5343 virtual SLANG_NO_THROW SlangInt SLANG_MCALL getModuleDependencyCount() = 0;
5344
5345 virtual SLANG_NO_THROW SlangResult SLANG_MCALL getModuleDependency(
5346 SlangInt dependencyIndex,
5347 IModule** outModule,
5348 IBlob** outDiagnostics = nullptr) = 0;
5349};
5350
5351 #define SLANG_UUID_IModulePrecompileService_Experimental \
5352 IModulePrecompileService_Experimental::getTypeGuid()
5353
5356struct SpecializationArg
5357{
5358 enum class Kind : int32_t
5359 {
5360 Unknown = 0,
5361 Type = 1,
5362 Expr = 2,
5363 };
5364
5366 Kind kind;
5367 union
5368 {
5370 TypeReflection* type;
5372 const char* expr;
5373 };
5374
5375 static SpecializationArg fromType(TypeReflection* inType)
5376 {
5377 SpecializationArg rs;
5378 rs.kind = Kind::Type;
5379 rs.type = inType;
5380 return rs;
5381 }
5382
5383 static SpecializationArg fromExpr(const char* inExpr)
5384 {
5385 SpecializationArg rs;
5386 rs.kind = Kind::Expr;
5387 rs.expr = inExpr;
5388 return rs;
5389 }
5390};
5391} // namespace slang
5392
5393 // Passed into functions to create globalSession to identify the API version client code is
5394 // using.
5395 #define SLANG_API_VERSION 0
5396
5397enum SlangLanguageVersion
5398{
5399 SLANG_LANGUAGE_VERSION_UNKNOWN = 0,
5400 SLANG_LANGUAGE_VERSION_LEGACY = 2018,
5401 SLANG_LANGUAGE_VERSION_2025 = 2025,
5402 SLANG_LANGUAGE_VERSION_2026 = 2026,
5403 /* Deprecated: retained for source compatibility; prefer SLANG_LANGUAGE_VERSION_DEFAULT. */
5404 SLANG_LANGAUGE_VERSION_DEFAULT = SLANG_LANGUAGE_VERSION_LEGACY,
5405 SLANG_LANGUAGE_VERSION_DEFAULT = SLANG_LANGUAGE_VERSION_LEGACY,
5406 SLANG_LANGUAGE_VERSION_LATEST = SLANG_LANGUAGE_VERSION_2026,
5407};
5408
5409
5410/* Description of a Slang global session.
5411 */
5412struct SlangGlobalSessionDesc
5413{
5415 uint32_t structureSize = sizeof(SlangGlobalSessionDesc);
5416
5418 uint32_t apiVersion = SLANG_API_VERSION;
5419
5421 uint32_t minLanguageVersion = SLANG_LANGUAGE_VERSION_2025;
5422
5424 bool enableGLSL = false;
5425
5427 uint32_t reserved[16] = {};
5428};
5429
5430/* Create a blob from binary data.
5431 *
5432 * @param data Pointer to the binary data to store in the blob. Must not be null.
5433 * @param size Size of the data in bytes. Must be greater than 0.
5434 * @return The created blob on success, or nullptr on failure.
5435 */
5436SLANG_EXTERN_C SLANG_API ISlangBlob* slang_createBlob(const void* data, size_t size);
5437
5438/* Serialize coverage metadata into the canonical
5439 * `.coverage-mapping.json` shape. Same bytes that `slangc` writes
5440 * alongside compiled output when `-trace-coverage` is on, available
5441 * in-process for hosts compiling via the C++ API.
5442 *
5443 * The returned JSON is consumable by
5444 * `tools/shader-coverage/slang-coverage-to-lcov.py` and any tool
5445 * expecting the version-1 manifest format. If `metadata` is the
5446 * artifact metadata object returned by Slang, it also supports
5447 * `ISyntheticResourceMetadata`, and the serializer includes the
5448 * coverage buffer's descriptor-facing binding fields when available.
5449 *
5450 * @param metadata The coverage metadata, obtained via
5451 * `castAs<ICoverageTracingMetadata>` on the artifact's
5452 * `IMetadata`. Must not be null.
5453 * @param outBlob (out) The JSON bytes. Caller releases when done.
5454 * @return `SLANG_OK` on success, `SLANG_E_INVALID_ARG` for null
5455 * arguments.
5456 */
5458slang_writeCoverageManifestJson(slang::ICoverageTracingMetadata* metadata, ISlangBlob** outBlob);
5459
5460/* Load a module from source code with size specification.
5461 *
5462 * @param session The session to load the module into.
5463 * @param moduleName The name of the module.
5464 * @param path The path for the module.
5465 * @param source Pointer to the source code data.
5466 * @param sourceSize Size of the source code data in bytes.
5467 * @param outDiagnostics (out, optional) Diagnostics output.
5468 * @return The loaded module on success, or nullptr on failure.
5469 */
5470SLANG_EXTERN_C SLANG_API slang::IModule* slang_loadModuleFromSource(
5471 slang::ISession* session,
5472 const char* moduleName,
5473 const char* path,
5474 const char* source,
5475 size_t sourceSize,
5476 ISlangBlob** outDiagnostics = nullptr);
5477
5487SLANG_EXTERN_C SLANG_API slang::IModule* slang_loadModuleFromIRBlob(
5488 slang::ISession* session,
5489 const char* moduleName,
5490 const char* path,
5491 const void* source,
5492 size_t sourceSize,
5493 ISlangBlob** outDiagnostics = nullptr);
5494
5504SLANG_EXTERN_C SLANG_API SlangResult slang_loadModuleInfoFromIRBlob(
5505 slang::ISession* session,
5506 const void* source,
5507 size_t sourceSize,
5508 SlangInt& outModuleVersion,
5509 const char*& outModuleCompilerVersion,
5510 const char*& outModuleName);
5511
5512/* Create a global session, with the built-in core module.
5513
5514@param apiVersion Pass in SLANG_API_VERSION
5515@param outGlobalSession (out)The created global session.
5516*/
5518slang_createGlobalSession(SlangInt apiVersion, slang::IGlobalSession** outGlobalSession);
5519
5520
5521/* Create a global session, with the built-in core module.
5522
5523@param desc Description of the global session.
5524@param outGlobalSession (out)The created global session.
5525*/
5526SLANG_EXTERN_C SLANG_API SlangResult slang_createGlobalSession2(
5527 const SlangGlobalSessionDesc* desc,
5528 slang::IGlobalSession** outGlobalSession);
5529
5530/* Create a global session, but do not set up the core module. The core module can
5531then be loaded via loadCoreModule or compileCoreModule
5532
5533@param apiVersion Pass in SLANG_API_VERSION
5534@param outGlobalSession (out)The created global session that doesn't have a core module setup.
5535
5536NOTE! API is experimental and not ready for production code
5537*/
5538SLANG_EXTERN_C SLANG_API SlangResult slang_createGlobalSessionWithoutCoreModule(
5539 SlangInt apiVersion,
5540 slang::IGlobalSession** outGlobalSession);
5541
5542/* Returns a blob that contains the serialized core module.
5543Returns nullptr if there isn't an embedded core module.
5544
5545NOTE! API is experimental and not ready for production code
5546*/
5547SLANG_API ISlangBlob* slang_getEmbeddedCoreModule();
5548
5549
5550/* Cleanup all global allocations used by Slang, to prevent memory leak detectors from
5551 reporting them as leaks. This function should only be called after all Slang objects
5552 have been released. No other Slang functions such as `createGlobalSession`
5553 should be called after this function.
5554 */
5555SLANG_EXTERN_C SLANG_API void slang_shutdown();
5556
5557/* Enable or disable the record layer for API call recording.
5558 When enabled, API calls are captured for later replay.
5559 The record layer can also be enabled by setting the SLANG_RECORD_LAYER=1 environment variable.
5560
5561 Environment variables:
5562 - SLANG_RECORD_LAYER=1: Enable recording on startup
5563 - SLANG_RECORD_PATH=<path>: Use the exact path specified for recording output
5564 instead of generating a timestamped folder under .slang-replays/
5565 */
5566SLANG_EXTERN_C SLANG_API void slang_enableRecordLayer(bool enable);
5567
5568/* Check if the record layer is currently enabled.
5569 */
5570SLANG_EXTERN_C SLANG_API bool slang_isRecordLayerEnabled();
5571
5572/* Set the base directory for replay files (default: ".slang-replays").
5573 Must be called before enabling recording.
5574 @param path Path to the replay directory.
5575 */
5576SLANG_EXTERN_C SLANG_API void slang_setReplayDirectory(const char* path);
5577
5578/* Get the current replay base directory.
5579 @return Path to the replay directory.
5580 */
5581SLANG_EXTERN_C SLANG_API const char* slang_getReplayDirectory();
5582
5583/* Get the path to the current recording session folder.
5584 @return Path to the current replay folder, or nullptr if not recording.
5585 */
5586SLANG_EXTERN_C SLANG_API const char* slang_getCurrentReplayPath();
5587
5588/* Load a replay from a folder path (reads stream.bin).
5589 Switches to playback mode on success.
5590 @param folderPath Path to the replay folder.
5591 @return SLANG_OK on success, SLANG_E_NOT_FOUND if stream.bin doesn't exist.
5592 */
5593SLANG_EXTERN_C SLANG_API SlangResult slang_loadReplay(const char* folderPath);
5594
5595/* Load the most recent replay from the replay directory.
5596 Switches to playback mode on success.
5597 @return SLANG_OK on success, SLANG_E_NOT_FOUND if no replays exist.
5598 */
5599SLANG_EXTERN_C SLANG_API SlangResult slang_loadLatestReplay();
5600
5601/* Insert a labeled marker into the replay stream.
5602 Useful for debugging replay streams. Marks a point with a human-readable label.
5603 No-op if the record layer is not active.
5604 @param label The marker label string.
5605 */
5606SLANG_EXTERN_C SLANG_API void slang_replayMarker(const char* label);
5607
5608/* Return the last signaled internal error message.
5609 */
5610SLANG_EXTERN_C SLANG_API const char* slang_getLastInternalErrorMessage();
5611
5612// Slang VM
5613namespace slang
5614{
5615
5616enum class OperandDataType
5617{
5618 General = 0, // General data type, can be any type.
5619 Int32 = 1, // 32-bit integer.
5620 Int64 = 2, // 64-bit integer.
5621 Float32 = 3, // 32-bit floating-point number.
5622 Float64 = 4, // 64-bit floating-point number.
5623 String = 5, // String data type, represented as a pointer to a null-terminated string.
5624};
5625
5626struct VMExecOperand
5627{
5628 uint8_t** section; // Pointer to the section start pointer.
5629 #if SLANG_PTR_IS_32
5630 uint32_t padding;
5631 #endif
5632 uint32_t type : 8; // type of the operand data.
5633 uint32_t size : 24;
5634 uint32_t offset;
5635 void* getPtr() const { return *section + offset; }
5636 OperandDataType getType() const { return (OperandDataType)type; }
5637};
5638
5639struct VMExecInstHeader;
5640class IByteCodeRunner;
5641
5642typedef void (*VMExtFunction)(IByteCodeRunner* context, VMExecInstHeader* inst, void* userData);
5643typedef void (*VMPrintFunc)(const char* message, void* userData);
5644
5645struct VMExecInstHeader
5646{
5647 VMExtFunction functionPtr; // Pointer to the function that executes this instruction.
5648 #if SLANG_PTR_IS_32
5649 uint32_t padding;
5650 #endif
5651 uint32_t opcodeExtension;
5652 uint32_t operandCount;
5653 VMExecInstHeader* getNextInst()
5654 {
5655 return (VMExecInstHeader*)((VMExecOperand*)(this + 1) + operandCount);
5656 }
5657 VMExecOperand& getOperand(SlangInt index) const
5658 {
5659 return *((VMExecOperand*)(this + 1) + index);
5660 }
5661};
5662
5663struct ByteCodeFuncInfo
5664{
5665 uint32_t parameterCount;
5666 uint32_t returnValueSize;
5667};
5668
5669struct ByteCodeRunnerDesc
5670{
5673 size_t structSize = sizeof(ByteCodeRunnerDesc);
5674};
5675
5677class IByteCodeRunner : public ISlangUnknown
5678{
5679public:
5680 // {AFDAB195-361F-42CB-9513-9006261DD8CD}
5681 SLANG_COM_INTERFACE(0xafdab195, 0x361f, 0x42cb, {0x95, 0x13, 0x90, 0x6, 0x26, 0x1d, 0xd8, 0xcd})
5682
5684 virtual SLANG_NO_THROW SlangResult SLANG_MCALL loadModule(IBlob* moduleBlob) = 0;
5685
5688 selectFunctionByIndex(uint32_t functionIndex) = 0;
5689
5690 virtual SLANG_NO_THROW int SLANG_MCALL findFunctionByName(const char* name) = 0;
5691
5693 getFunctionInfo(uint32_t index, ByteCodeFuncInfo* outInfo) = 0;
5694
5696 virtual SLANG_NO_THROW void* SLANG_MCALL getCurrentWorkingSet() = 0;
5697
5700 execute(void* argumentData, size_t argumentSize) = 0;
5701
5703 virtual SLANG_NO_THROW void SLANG_MCALL getErrorString(IBlob** outBlob) = 0;
5704
5706 virtual SLANG_NO_THROW void* SLANG_MCALL getReturnValue(size_t* outValueSize) = 0;
5707
5709 virtual SLANG_NO_THROW void SLANG_MCALL setExtInstHandlerUserData(void* userData) = 0;
5710
5713 registerExtCall(const char* name, VMExtFunction functionPtr) = 0;
5714
5717 setPrintCallback(VMPrintFunc callback, void* userData) = 0;
5718};
5719
5720} // namespace slang
5721
5723SLANG_EXTERN_C SLANG_API SlangResult slang_createByteCodeRunner(
5724 const slang::ByteCodeRunnerDesc* desc,
5725 slang::IByteCodeRunner** outByteCodeRunner);
5726
5729slang_disassembleByteCode(slang::IBlob* moduleBlob, slang::IBlob** outDisassemblyBlob);
5730
5731namespace slang
5732{
5733inline SlangResult createGlobalSession(slang::IGlobalSession** outGlobalSession)
5734{
5735 SlangGlobalSessionDesc defaultDesc = {};
5736 return slang_createGlobalSession2(&defaultDesc, outGlobalSession);
5737}
5738inline SlangResult createGlobalSession(
5739 const SlangGlobalSessionDesc* desc,
5740 slang::IGlobalSession** outGlobalSession)
5741{
5742 return slang_createGlobalSession2(desc, outGlobalSession);
5743}
5744inline void shutdown()
5745{
5746 slang_shutdown();
5747}
5748inline const char* getLastInternalErrorMessage()
5749{
5750 return slang_getLastInternalErrorMessage();
5751}
5752} // namespace slang
5753
5754#endif // C++ helpers
5755
5756#define SLANG_ERROR_INSUFFICIENT_BUFFER SLANG_E_BUFFER_TOO_SMALL
5757#define SLANG_ERROR_INVALID_PARAMETER SLANG_E_INVALID_ARG
5758
5759#endif
static std::vector< YGNodeRef > getChildren(YGNodeRef const node)
Definition YGTreeMutationTest.cpp:11
Definition slang.h:1427
SLANG_COM_INTERFACE(0x87ede0e1, 0x4852, 0x44b0, {0x8b, 0xf2, 0xcb, 0x31, 0x87, 0x4d, 0xe2, 0x39})
virtual SLANG_NO_THROW void *SLANG_MCALL castAs(const SlangUUID &guid)=0
Definition slang.h:1441
virtual SLANG_NO_THROW void *SLANG_MCALL clone(const SlangUUID &guid)=0
SLANG_COM_INTERFACE(0x1ec36168, 0xe9f4, 0x430d, {0xbb, 0x17, 0x4, 0x8a, 0x80, 0x46, 0xb3, 0x1f})
bool operator!=(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
Definition json.hpp:14762
@ value
the parser finished reading a JSON value
auto get(const nlohmann::detail::iteration_proxy_value< IteratorType > &i) -> decltype(i.key())
Definition json.hpp:5342
uint8_t Type
Definition slang-gfx.h:1359
file
Definition set-version.py:14
Definition slang.h:963
CompilerOptionName
Definition slang.h:965
CompilerOptionValueKind
Definition slang.h:1182
int32_t SlangResult
Definition slang-cpp-prelude.h:300
#define SLANG_NO_THROW
Definition slang-cpp-prelude.h:268
#define SLANG_MCALL
Definition slang-cpp-prelude.h:282
#define SLANG_COM_INTERFACE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)
Definition slang-cpp-prelude.h:310
__inline__ __device__ uint3 operator*(uint3 a, dim3 b)
Definition slang-cuda-prelude.h:4314
SLANG_API char const * spReflectionDecl_getName(SlangReflectionDecl *decl)
SLANG_API SlangReflectionTypeLayout * spReflectionTypeLayout_GetElementTypeLayout(SlangReflectionTypeLayout *type)
SLANG_API SlangReflectionEntryPoint * spReflection_findEntryPointByName(SlangReflection *reflection, char const *name)
SLANG_API SlangResult spReflectionVariable_GetDefaultValueFloat(SlangReflectionVariable *inVar, float *rs)
SLANG_API SlangInt spReflectionTypeLayout_getDescriptorSetSpaceOffset(SlangReflectionTypeLayout *typeLayout, SlangInt setIndex)
SLANG_API int spReflectionEntryPoint_hasDefaultConstantBuffer(SlangReflectionEntryPoint *entryPoint)
SLANG_API size_t spReflectionVariableLayout_GetSemanticIndex(SlangReflectionVariableLayout *var)
SLANG_API unsigned spReflectionTypeParameter_GetConstraintCount(SlangReflectionTypeParameter *typeParam)
SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeSpaceOffset(SlangReflectionTypeLayout *typeLayout, SlangInt subObjectRangeIndex)
SLANG_API char const * spReflectionEntryPoint_getName(SlangReflectionEntryPoint *entryPoint)
SLANG_API int32_t spReflectionTypeLayout_getAlignment(SlangReflectionTypeLayout *type, SlangParameterCategory category)
SLANG_API SlangUInt spReflection_getHashedStringCount(SlangReflection *reflection)
Get the number of hashed strings
SLANG_API size_t spReflectionTypeLayout_GetElementStride(SlangReflectionTypeLayout *type, SlangParameterCategory category)
SLANG_API SlangReflectionType * spReflectionVariable_GetType(SlangReflectionVariable *var)
SLANG_API SlangReflectionVariable * spReflectionGeneric_GetValueParameter(SlangReflectionGeneric *generic, unsigned index)
SLANG_API SlangBindingType spReflectionTypeLayout_getBindingRangeType(SlangReflectionTypeLayout *typeLayout, SlangInt index)
SLANG_API SlangUInt spReflection_getGlobalConstantBufferBinding(SlangReflection *reflection)
SLANG_API unsigned int spReflectionUserAttribute_GetArgumentCount(SlangReflectionUserAttribute *attrib)
SLANG_API unsigned int spReflectionGeneric_GetValueParameterCount(SlangReflectionGeneric *generic)
SLANG_API SlangInt spReflection_getBindlessSpaceIndex(SlangReflection *reflection)
SLANG_API SlangScalarType spReflectionType_GetScalarType(SlangReflectionType *type)
SLANG_API SlangStage spReflectionEntryPoint_getStage(SlangReflectionEntryPoint *entryPoint)
SLANG_API SlangReflectionVariable * spReflectionVariable_applySpecializations(SlangReflectionVariable *var, SlangReflectionGeneric *generic)
SLANG_API SlangTypeKind spReflectionType_GetKind(SlangReflectionType *type)
SLANG_API SlangImageFormat spReflectionTypeLayout_getBindingRangeImageFormat(SlangReflectionTypeLayout *typeLayout, SlangInt index)
SLANG_API SlangResult spReflectionVariable_GetDefaultValueInt(SlangReflectionVariable *inVar, int64_t *rs)
SLANG_API SlangParameterCategory spReflectionTypeLayout_getDescriptorSetDescriptorRangeCategory(SlangReflectionTypeLayout *typeLayout, SlangInt setIndex, SlangInt rangeIndex)
SLANG_API int64_t spReflectionGeneric_GetConcreteIntVal(SlangReflectionGeneric *generic, SlangReflectionVariable *valueParam)
SLANG_API unsigned int spReflectionType_GetFieldCount(SlangReflectionType *type)
SLANG_API unsigned spReflectionEntryPoint_getParameterCount(SlangReflectionEntryPoint *entryPoint)
SLANG_API size_t spReflectionTypeLayout_GetSize(SlangReflectionTypeLayout *type, SlangParameterCategory category)
SLANG_API SlangReflectionType * spReflectionType_GetElementType(SlangReflectionType *type)
SLANG_API SlangReflectionUserAttribute * spReflectionType_GetUserAttribute(SlangReflectionType *type, unsigned int index)
SLANG_API SlangInt spReflectionTypeLayout_getDescriptorSetCount(SlangReflectionTypeLayout *typeLayout)
SLANG_API const char * spReflection_getHashedString(SlangReflection *reflection, SlangUInt index, size_t *outCount)
SLANG_API SlangReflectionUserAttribute * spReflectionType_FindUserAttributeByName(SlangReflectionType *type, char const *name)
SLANG_API SlangReflectionType * spReflectionGeneric_GetTypeParameterConstraintType(SlangReflectionGeneric *generic, SlangReflectionVariable *typeParam, unsigned index)
SLANG_API SlangReflectionType * spReflectionTypeLayout_GetType(SlangReflectionTypeLayout *type)
SLANG_API SlangReflectionGeneric * spReflectionGeneric_applySpecializations(SlangReflectionGeneric *currGeneric, SlangReflectionGeneric *generic)
SLANG_API SlangResourceAccess spReflectionType_GetResourceAccess(SlangReflectionType *type)
SLANG_API unsigned int spReflection_GetTypeParameterCount(SlangReflection *reflection)
SLANG_API SlangUInt spReflection_getEntryPointCount(SlangReflection *reflection)
SLANG_API SlangReflectionGeneric * spReflectionType_GetGenericContainer(SlangReflectionType *type)
SLANG_API char const * spReflectionGeneric_GetName(SlangReflectionGeneric *generic)
SLANG_API void spReflectionEntryPoint_getComputeWaveSize(SlangReflectionEntryPoint *entryPoint, SlangUInt *outWaveSize)
SLANG_API unsigned int spReflectionGeneric_GetTypeParameterConstraintCount(SlangReflectionGeneric *generic, SlangReflectionVariable *typeParam)
SLANG_API SlangReflectionFunction * spReflectionEntryPoint_getFunction(SlangReflectionEntryPoint *entryPoint)
SLANG_API SlangReflectionTypeParameter * spReflection_GetTypeParameterByIndex(SlangReflection *reflection, unsigned int index)
SLANG_API char const * spReflectionType_GetName(SlangReflectionType *type)
SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeDescriptorRangeCount(SlangReflectionTypeLayout *typeLayout, SlangInt index)
SLANG_API SlangReflectionGeneric * spReflectionFunction_GetGenericContainer(SlangReflectionFunction *func)
SLANG_API SlangReflectionParameter * spReflection_GetParameterByIndex(SlangReflection *reflection, unsigned index)
SLANG_API unsigned int spReflectionType_GetRowCount(SlangReflectionType *type)
SLANG_API size_t spReflectionType_GetSpecializedElementCount(SlangReflectionType *type, SlangReflection *reflection)
SLANG_API SlangReflectionModifier * spReflectionFunction_FindModifier(SlangReflectionFunction *var, SlangModifierID modifierID)
SLANG_API unsigned int spReflectionFunction_GetParameterCount(SlangReflectionFunction *func)
SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeFirstDescriptorRangeIndex(SlangReflectionTypeLayout *typeLayout, SlangInt index)
SLANG_API char const * spReflectionUserAttribute_GetName(SlangReflectionUserAttribute *attrib)
SLANG_API SlangReflectionType * spReflectionType_GetResourceResultType(SlangReflectionType *type)
SLANG_API SlangReflectionVariable * spReflectionTypeLayout_getBindingRangeLeafVariable(SlangReflectionTypeLayout *typeLayout, SlangInt index)
SLANG_API unsigned spReflection_GetParameterCount(SlangReflection *reflection)
SLANG_API SlangReflectionFunction * spReflection_FindFunctionByNameInType(SlangReflection *reflection, SlangReflectionType *reflType, char const *name)
SLANG_API SlangBindingType spReflectionTypeLayout_getDescriptorSetDescriptorRangeType(SlangReflectionTypeLayout *typeLayout, SlangInt setIndex, SlangInt rangeIndex)
SLANG_API size_t spReflection_getGlobalConstantBufferSize(SlangReflection *reflection)
SLANG_API SlangReflectionUserAttribute * spReflectionFunction_GetUserAttribute(SlangReflectionFunction *func, unsigned int index)
SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeBindingCount(SlangReflectionTypeLayout *typeLayout, SlangInt index)
SLANG_API size_t spReflectionVariableLayout_GetOffset(SlangReflectionVariableLayout *var, SlangParameterCategory category)
SLANG_API SlangResult spReflectionUserAttribute_GetArgumentValueFloat(SlangReflectionUserAttribute *attrib, unsigned int index, float *rs)
SLANG_API SlangReflectionTypeLayout * spReflectionVariableLayout_GetTypeLayout(SlangReflectionVariableLayout *var)
SLANG_API SlangReflectionVariable * spReflectionDecl_castToVariable(SlangReflectionDecl *decl)
SLANG_API SlangReflectionFunction * spReflectionDecl_castToFunction(SlangReflectionDecl *decl)
SLANG_API SlangDeclKind spReflectionGeneric_GetInnerKind(SlangReflectionGeneric *generic)
SLANG_API SlangReflectionType * spReflectionUserAttribute_GetArgumentType(SlangReflectionUserAttribute *attrib, unsigned int index)
SLANG_API SlangReflectionUserAttribute * spReflectionVariable_GetUserAttribute(SlangReflectionVariable *var, unsigned int index)
SLANG_API SlangReflectionType * spReflection_specializeType(SlangReflection *reflection, SlangReflectionType *type, SlangInt specializationArgCount, SlangReflectionType *const *specializationArgs, ISlangBlob **outDiagnostics)
SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeDescriptorSetIndex(SlangReflectionTypeLayout *typeLayout, SlangInt index)
SLANG_API unsigned int spReflectionType_GetUserAttributeCount(SlangReflectionType *type)
SLANG_API unsigned int spReflectionGeneric_GetTypeParameterCount(SlangReflectionGeneric *generic)
SLANG_API SlangReflectionType * spReflectionFunction_GetResultType(SlangReflectionFunction *func)
SLANG_API SlangReflectionGeneric * spReflectionVariable_GetGenericContainer(SlangReflectionVariable *var)
SLANG_API int spReflectionTypeLayout_getGenericParamIndex(SlangReflectionTypeLayout *type)
SLANG_API SlangReflectionType * spReflectionType_applySpecializations(SlangReflectionType *type, SlangReflectionGeneric *generic)
SLANG_API SlangReflectionFunction * spReflectionFunction_getOverload(SlangReflectionFunction *func, unsigned int index)
SLANG_API SlangMatrixLayoutMode spReflectionTypeLayout_GetMatrixLayoutMode(SlangReflectionTypeLayout *type)
SLANG_API SlangReflectionDecl * spReflectionGeneric_asDecl(SlangReflectionGeneric *generic)
SLANG_API SlangReflectionVariableLayout * spReflectionTypeLayout_GetFieldByIndex(SlangReflectionTypeLayout *type, unsigned index)
SLANG_API SlangReflectionVariable * spReflection_FindVarByNameInType(SlangReflection *reflection, SlangReflectionType *reflType, char const *name)
SLANG_API SlangReflectionTypeLayout * spReflectionTypeLayout_getBindingRangeLeafTypeLayout(SlangReflectionTypeLayout *typeLayout, SlangInt index)
SLANG_API int spReflectionEntryPoint_usesAnySampleRateInput(SlangReflectionEntryPoint *entryPoint)
SLANG_API unsigned int spReflectionDecl_getChildrenCount(SlangReflectionDecl *parentDecl)
SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeCount(SlangReflectionTypeLayout *typeLayout)
SLANG_API SlangReflectionVariable * spReflectionGeneric_GetTypeParameter(SlangReflectionGeneric *generic, unsigned index)
SLANG_API SlangReflectionVariableLayout * spReflectionEntryPoint_getResultVarLayout(SlangReflectionEntryPoint *entryPoint)
SLANG_API char const * spReflectionEntryPoint_getNameOverride(SlangReflectionEntryPoint *entryPoint)
SLANG_API SlangReflectionVariableLayout * spReflectionTypeLayout_getContainerVarLayout(SlangReflectionTypeLayout *type)
SLANG_API SlangReflectionVariableLayout * spReflectionEntryPoint_getVarLayout(SlangReflectionEntryPoint *entryPoint)
SLANG_API char const * spReflectionVariable_GetName(SlangReflectionVariable *var)
SLANG_API bool spReflectionFunction_isOverloaded(SlangReflectionFunction *func)
SLANG_API SlangReflectionEntryPoint * spReflection_getEntryPointByIndex(SlangReflection *reflection, SlangUInt index)
SLANG_API SlangInt spReflectionTypeLayout_getExplicitCounterBindingRangeOffset(SlangReflectionTypeLayout *inTypeLayout)
SLANG_API SlangReflectionFunction * spReflectionFunction_applySpecializations(SlangReflectionFunction *func, SlangReflectionGeneric *generic)
SLANG_API SlangReflectionGeneric * spReflectionDecl_castToGeneric(SlangReflectionDecl *decl)
SLANG_API const char * spReflectionUserAttribute_GetArgumentValueString(SlangReflectionUserAttribute *attrib, unsigned int index, size_t *outSize)
SLANG_API SlangReflectionTypeLayout * spReflection_getGlobalParamsTypeLayout(SlangReflection *reflection)
Get a type layout representing reflection information for the global-scope parameters.
SLANG_API SlangReflectionType * spReflection_getTypeFromDecl(SlangReflectionDecl *decl)
SLANG_API unsigned int spReflectionFunction_getOverloadCount(SlangReflectionFunction *func)
SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeBindingRangeIndex(SlangReflectionTypeLayout *typeLayout, SlangInt subObjectRangeIndex)
SLANG_API unsigned int spReflectionType_GetColumnCount(SlangReflectionType *type)
SLANG_API SlangReflectionDecl * spReflectionDecl_getParent(SlangReflectionDecl *decl)
SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeCount(SlangReflectionTypeLayout *typeLayout)
SLANG_API SlangResourceShape spReflectionType_GetResourceShape(SlangReflectionType *type)
SLANG_API char const * spReflectionVariableLayout_GetSemanticName(SlangReflectionVariableLayout *var)
SLANG_API SlangReflectionDecl * spReflectionGeneric_GetInnerDecl(SlangReflectionGeneric *generic)
SLANG_API SlangReflectionModifier * spReflectionVariable_FindModifier(SlangReflectionVariable *var, SlangModifierID modifierID)
SLANG_API SlangReflectionFunction * spReflectionFunction_specializeWithArgTypes(SlangReflectionFunction *func, SlangInt argTypeCount, SlangReflectionType *const *argTypes)
SLANG_API SlangReflectionGeneric * spReflectionGeneric_GetOuterGenericContainer(SlangReflectionGeneric *generic)
SLANG_API void spReflectionEntryPoint_getComputeThreadGroupSize(SlangReflectionEntryPoint *entryPoint, SlangUInt axisCount, SlangUInt *outSizeAlongAxis)
SLANG_API SlangReflection * spGetReflection(SlangCompileRequest *request)
SLANG_API char const * spReflectionFunction_GetName(SlangReflectionFunction *func)
SLANG_API SlangInt spReflectionTypeLayout_getFieldBindingRangeOffset(SlangReflectionTypeLayout *typeLayout, SlangInt fieldIndex)
SLANG_API SlangReflectionVariableLayout * spReflectionTypeLayout_GetExplicitCounter(SlangReflectionTypeLayout *typeLayout)
SLANG_API SlangReflectionVariable * spReflectionType_GetFieldByIndex(SlangReflectionType *type, unsigned index)
SLANG_API SlangParameterCategory spReflectionTypeLayout_GetCategoryByIndex(SlangReflectionTypeLayout *type, unsigned index)
SLANG_API SlangReflectionDecl * spReflectionDecl_getChild(SlangReflectionDecl *parentDecl, unsigned int index)
SLANG_API unsigned spReflectionTypeParameter_GetIndex(SlangReflectionTypeParameter *typeParam)
SLANG_API SlangInt spReflectionTypeLayout_getDescriptorSetDescriptorRangeDescriptorCount(SlangReflectionTypeLayout *typeLayout, SlangInt setIndex, SlangInt rangeIndex)
SLANG_API unsigned spReflectionTypeLayout_GetCategoryCount(SlangReflectionTypeLayout *type)
SLANG_API SlangReflectionVariableLayout * spReflection_getGlobalParamsVarLayout(SlangReflection *reflection)
Get a variable layout representing reflection information for the global-scope parameters.
SLANG_API size_t spReflectionVariableLayout_GetSpace(SlangReflectionVariableLayout *var, SlangParameterCategory category)
SLANG_API SlangReflectionGeneric * spReflection_specializeGeneric(SlangReflection *inProgramLayout, SlangReflectionGeneric *generic, SlangInt argCount, SlangReflectionGenericArgType const *argTypes, SlangReflectionGenericArg const *args, ISlangBlob **outDiagnostics)
SLANG_API SlangReflectionType * spReflectionGeneric_GetConcreteType(SlangReflectionGeneric *generic, SlangReflectionVariable *typeParam)
SLANG_API unsigned spReflectionParameter_GetBindingIndex(SlangReflectionParameter *parameter)
SLANG_API SlangReflectionVariableLayout * spReflectionTypeLayout_getSubObjectRangeOffset(SlangReflectionTypeLayout *typeLayout, SlangInt subObjectRangeIndex)
SLANG_API SlangDeclKind spReflectionDecl_getKind(SlangReflectionDecl *decl)
SLANG_API SlangReflectionModifier * spReflectionDecl_findModifier(SlangReflectionDecl *decl, SlangModifierID modifierID)
SLANG_API SlangResult spReflectionUserAttribute_GetArgumentValueInt(SlangReflectionUserAttribute *attrib, unsigned int index, int *rs)
SLANG_API SlangReflectionFunction * spReflection_FindFunctionByName(SlangReflection *reflection, char const *name)
SLANG_API SlangStage spReflectionVariableLayout_getStage(SlangReflectionVariableLayout *var)
SLANG_API SlangParameterCategory spReflectionTypeLayout_GetParameterCategory(SlangReflectionTypeLayout *type)
SLANG_API uint32_t spReflectionTypeLayout_GetFieldCount(SlangReflectionTypeLayout *type)
SLANG_API SlangTypeKind spReflectionTypeLayout_getKind(SlangReflectionTypeLayout *type)
SLANG_API SlangResult spReflection_ToJson(SlangReflection *reflection, SlangCompileRequest *request, ISlangBlob **outBlob)
SLANG_API SlangReflectionVariable * spReflectionVariableLayout_GetVariable(SlangReflectionVariableLayout *var)
SLANG_API SlangReflectionType * spReflectionTypeParameter_GetConstraintByIndex(SlangReflectionTypeParameter *typeParam, unsigned int index)
SLANG_API SlangReflectionVariableLayout * spReflectionEntryPoint_getParameterByIndex(SlangReflectionEntryPoint *entryPoint, unsigned index)
SLANG_API SlangReflectionType * spReflection_FindTypeByName(SlangReflection *reflection, char const *name)
SLANG_API char const * spReflectionTypeParameter_GetName(SlangReflectionTypeParameter *typeParam)
SLANG_API SlangResult spReflectionType_GetFullName(SlangReflectionType *type, ISlangBlob **outNameBlob)
SLANG_API unsigned int spReflectionFunction_GetUserAttributeCount(SlangReflectionFunction *func)
SLANG_API size_t spReflectionTypeLayout_GetStride(SlangReflectionTypeLayout *type, SlangParameterCategory category)
SLANG_API bool spReflectionVariable_HasDefaultValue(SlangReflectionVariable *inVar)
SLANG_API SlangReflectionVariableLayout * spReflectionTypeLayout_GetElementVarLayout(SlangReflectionTypeLayout *type)
SLANG_API SlangInt spReflectionTypeLayout_isBindingRangeSpecializable(SlangReflectionTypeLayout *typeLayout, SlangInt index)
SLANG_API unsigned spReflectionParameter_GetBindingSpace(SlangReflectionParameter *parameter)
SLANG_API SlangInt spReflectionTypeLayout_findFieldIndexByName(SlangReflectionTypeLayout *typeLayout, const char *nameBegin, const char *nameEnd)
SLANG_API SlangReflectionTypeLayout * spReflection_GetTypeLayout(SlangReflection *reflection, SlangReflectionType *reflectionType, SlangLayoutRules rules)
SLANG_API SlangReflectionUserAttribute * spReflectionFunction_FindUserAttributeByName(SlangReflectionFunction *func, SlangSession *globalSession, char const *name)
SLANG_API SlangReflectionUserAttribute * spReflectionVariable_FindUserAttributeByName(SlangReflectionVariable *var, SlangSession *globalSession, char const *name)
SLANG_API SlangReflectionVariable * spReflectionFunction_GetParameter(SlangReflectionFunction *func, unsigned index)
SLANG_API SlangReflectionTypeParameter * spReflection_FindTypeParameter(SlangReflection *reflection, char const *name)
SLANG_API SlangInt spReflectionTypeLayout_getDescriptorSetDescriptorRangeIndexOffset(SlangReflectionTypeLayout *typeLayout, SlangInt setIndex, SlangInt rangeIndex)
SLANG_API bool spReflection_isSubType(SlangReflection *reflection, SlangReflectionType *subType, SlangReflectionType *superType)
SLANG_API SlangReflectionFunction * spReflection_TryResolveOverloadedFunction(SlangReflection *reflection, uint32_t candidateCount, SlangReflectionFunction **candidates)
SLANG_API SlangInt spReflectionTypeLayout_getDescriptorSetDescriptorRangeCount(SlangReflectionTypeLayout *typeLayout, SlangInt setIndex)
SLANG_API SlangImageFormat spReflectionVariableLayout_GetImageFormat(SlangReflectionVariableLayout *var)
SLANG_API unsigned int spReflectionVariable_GetUserAttributeCount(SlangReflectionVariable *var)
unsigned int SlangFloatingPointModeIntegral
Options to control floating-point precision guarantees for a target.
Definition slang.h:762
unsigned int SlangLineDirectiveModeIntegral
Options to control emission of #line directives
Definition slang.h:784
#define SLANG_UNBOUNDED_SIZE
Definition slang.h:2282
struct SlangReflectionGeneric SlangReflectionGeneric
Definition slang.h:1951
SlangSeverity
Definition slang.h:577
@ SLANG_SEVERITY_DISABLED
Definition slang.h:578
@ SLANG_SEVERITY_FATAL
Definition slang.h:582
@ SLANG_SEVERITY_INTERNAL
Definition slang.h:583
@ SLANG_SEVERITY_ERROR
Definition slang.h:581
@ SLANG_SEVERITY_NOTE
Definition slang.h:579
@ SLANG_SEVERITY_WARNING
Definition slang.h:580
unsigned int SlangProfileIDIntegral
Definition slang.h:814
int32_t SlangInt
Definition slang.h:559
SlangEmitCPUMethod
Definition slang.h:936
@ SLANG_EMIT_CPU_VIA_CPP
Definition slang.h:938
@ SLANG_EMIT_CPU_DEFAULT
Definition slang.h:937
@ SLANG_EMIT_CPU_VIA_LLVM
Definition slang.h:939
bool SlangBool
Definition slang.h:566
struct SlangReflectionModifier SlangReflectionModifier
Definition slang.h:1942
int SlangDiagnosticFlags
Definition slang.h:588
SlangResourceShape
Definition slang.h:2044
@ SLANG_TEXTURE_SUBPASS_MULTISAMPLE
Definition slang.h:2076
@ SLANG_RESOURCE_BASE_SHAPE_MASK
Definition slang.h:2045
@ SLANG_ACCELERATION_STRUCTURE
Definition slang.h:2058
@ SLANG_TEXTURE_CUBE_ARRAY
Definition slang.h:2071
@ SLANG_TEXTURE_2D
Definition slang.h:2050
@ SLANG_TEXTURE_BUFFER
Definition slang.h:2053
@ SLANG_TEXTURE_COMBINED_FLAG
Definition slang.h:2067
@ SLANG_TEXTURE_FEEDBACK_FLAG
Definition slang.h:2063
@ SLANG_TEXTURE_2D_MULTISAMPLE
Definition slang.h:2073
@ SLANG_RESOURCE_UNKNOWN
Definition slang.h:2057
@ SLANG_STRUCTURED_BUFFER
Definition slang.h:2055
@ SLANG_RESOURCE_EXT_SHAPE_MASK
Definition slang.h:2061
@ SLANG_TEXTURE_1D_ARRAY
Definition slang.h:2069
@ SLANG_TEXTURE_1D
Definition slang.h:2049
@ SLANG_RESOURCE_NONE
Definition slang.h:2047
@ SLANG_TEXTURE_2D_MULTISAMPLE_ARRAY
Definition slang.h:2074
@ SLANG_TEXTURE_MULTISAMPLE_FLAG
Definition slang.h:2066
@ SLANG_TEXTURE_ARRAY_FLAG
Definition slang.h:2065
@ SLANG_BYTE_ADDRESS_BUFFER
Definition slang.h:2056
@ SLANG_TEXTURE_SHADOW_FLAG
Definition slang.h:2064
@ SLANG_TEXTURE_2D_ARRAY
Definition slang.h:2070
@ SLANG_TEXTURE_SUBPASS
Definition slang.h:2059
@ SLANG_TEXTURE_CUBE
Definition slang.h:2052
@ SLANG_TEXTURE_3D
Definition slang.h:2051
unsigned int SlangTargetFlags
Flags to control code generation behavior of a compilation target
Definition slang.h:733
uint32_t SlangUInt32
Definition slang.h:542
struct SlangReflectionFunction SlangReflectionFunction
Definition slang.h:1950
SlangUInt32 SlangCooperativeVectorMatrixLayoutIntegral
Definition slang.h:878
unsigned int SlangPathTypeIntegral
Definition slang.h:1589
SlangPathType
Definition slang.h:1591
@ SLANG_PATH_TYPE_DIRECTORY
Definition slang.h:1592
@ SLANG_PATH_TYPE_FILE
Definition slang.h:1593
struct SlangReflectionVariableLayout SlangReflectionVariableLayout
Definition slang.h:1946
SlangUInt32 SlangBindingTypeIntegral
Definition slang.h:2214
SlangUInt32 SlangDebugInfoFormatIntegral
Definition slang.h:900
slang::IGlobalSession SlangSession
An instance of the Slang library.
Definition slang.h:1899
unsigned int SlangFpDenormalModeIntegral
Options to control floating-point denormal handling mode for a target.
Definition slang.h:773
SlangLayoutRules
Definition slang.h:2251
@ SLANG_LAYOUT_RULES_DEFAULT
Definition slang.h:2252
@ SLANG_LAYOUT_RULES_DEFAULT_STRUCTURED_BUFFER
Definition slang.h:2254
@ SLANG_LAYOUT_RULES_METAL_ARGUMENT_BUFFER_TIER_2
Definition slang.h:2253
@ SLANG_LAYOUT_RULES_DEFAULT_CONSTANT_BUFFER
Definition slang.h:2255
int SlangBindableResourceIntegral
Definition slang.h:595
unsigned int SlangTypeKindIntegral
Definition slang.h:1975
SlangReflectionVariableLayout SlangReflectionParameter
Definition slang.h:2287
SlangPassThrough
Definition slang.h:677
@ SLANG_PASS_THROUGH_GLSLANG
Definition slang.h:681
@ SLANG_PASS_THROUGH_SPIRV_OPT
SPIRV-opt
Definition slang.h:690
@ SLANG_PASS_THROUGH_GCC
GCC C/C++ compiler
Definition slang.h:685
@ SLANG_PASS_THROUGH_CLANG
Clang C/C++ compiler
Definition slang.h:683
@ SLANG_PASS_THROUGH_SPIRV_DIS
Definition slang.h:682
@ SLANG_PASS_THROUGH_FXC
Definition slang.h:679
@ SLANG_PASS_THROUGH_DXC
Definition slang.h:680
@ SLANG_PASS_THROUGH_GENERIC_C_CPP
Definition slang.h:686
@ SLANG_PASS_THROUGH_NONE
Definition slang.h:678
@ SLANG_PASS_THROUGH_NVRTC
NVRTC Cuda compiler
Definition slang.h:688
@ SLANG_PASS_THROUGH_TINT
Tint WGSL compiler
Definition slang.h:692
@ SLANG_PASS_THROUGH_METAL
Metal compiler
Definition slang.h:691
@ SLANG_PASS_THROUGH_SPIRV_LINK
SPIRV-link
Definition slang.h:693
@ SLANG_PASS_THROUGH_COUNT_OF
Definition slang.h:694
@ SLANG_PASS_THROUGH_VISUAL_STUDIO
Visual studio C/C++ compiler
Definition slang.h:684
@ SLANG_PASS_THROUGH_LLVM
LLVM 'compiler' - includes LLVM and Clang
Definition slang.h:689
int32_t SlangResult
Definition slang.h:1243
SlangEntryPointLayout SlangReflectionEntryPoint
Definition slang.h:1971
SlangProfileID
Definition slang.h:816
@ SLANG_PROFILE_UNKNOWN
Definition slang.h:817
#define SLANG_NO_THROW
Definition slang.h:212
SlangParameterCategory
Definition slang.h:2095
@ SLANG_PARAMETER_CATEGORY_RAY_PAYLOAD
Definition slang.h:2118
@ SLANG_PARAMETER_CATEGORY_METAL_BUFFER
Definition slang.h:2181
@ SLANG_PARAMETER_CATEGORY_METAL_PAYLOAD
Definition slang.h:2175
@ SLANG_PARAMETER_CATEGORY_COUNT
Definition slang.h:2178
@ SLANG_PARAMETER_CATEGORY_SUB_ELEMENT_REGISTER_SPACE
Definition slang.h:2163
@ SLANG_PARAMETER_CATEGORY_CONSTANT_BUFFER
Definition slang.h:2098
@ SLANG_PARAMETER_CATEGORY_REGISTER_SPACE
Definition slang.h:2110
@ SLANG_PARAMETER_CATEGORY_DESCRIPTOR_TABLE_SLOT
Definition slang.h:2105
@ SLANG_PARAMETER_CATEGORY_EXISTENTIAL_TYPE_PARAM
Definition slang.h:2141
@ SLANG_PARAMETER_CATEGORY_VARYING_OUTPUT
Definition slang.h:2102
@ SLANG_PARAMETER_CATEGORY_COUNT_V1
Definition slang.h:2188
@ SLANG_PARAMETER_CATEGORY_METAL_ARGUMENT_BUFFER_ELEMENT
Definition slang.h:2169
@ SLANG_PARAMETER_CATEGORY_FRAGMENT_OUTPUT
Definition slang.h:2187
@ SLANG_PARAMETER_CATEGORY_VERTEX_INPUT
Definition slang.h:2186
@ SLANG_PARAMETER_CATEGORY_EXISTENTIAL_OBJECT_PARAM
Definition slang.h:2160
@ SLANG_PARAMETER_CATEGORY_METAL_TEXTURE
Definition slang.h:2182
@ SLANG_PARAMETER_CATEGORY_METAL_SAMPLER
Definition slang.h:2183
@ SLANG_PARAMETER_CATEGORY_METAL_ATTRIBUTE
Definition slang.h:2172
@ SLANG_PARAMETER_CATEGORY_MIXED
Definition slang.h:2097
@ SLANG_PARAMETER_CATEGORY_VARYING_INPUT
Definition slang.h:2101
@ SLANG_PARAMETER_CATEGORY_SHADER_RESOURCE
Definition slang.h:2099
@ SLANG_PARAMETER_CATEGORY_NONE
Definition slang.h:2096
@ SLANG_PARAMETER_CATEGORY_HIT_ATTRIBUTES
Definition slang.h:2119
@ SLANG_PARAMETER_CATEGORY_UNORDERED_ACCESS
Definition slang.h:2100
@ SLANG_PARAMETER_CATEGORY_GENERIC
Definition slang.h:2116
@ SLANG_PARAMETER_CATEGORY_CALLABLE_PAYLOAD
Definition slang.h:2120
@ SLANG_PARAMETER_CATEGORY_UNIFORM
Definition slang.h:2104
@ SLANG_PARAMETER_CATEGORY_SAMPLER_STATE
Definition slang.h:2103
@ SLANG_PARAMETER_CATEGORY_SUBPASS
Definition slang.h:2166
@ SLANG_PARAMETER_CATEGORY_PUSH_CONSTANT_BUFFER
Definition slang.h:2107
@ SLANG_PARAMETER_CATEGORY_SHADER_RECORD
Definition slang.h:2121
@ SLANG_PARAMETER_CATEGORY_SPECIALIZATION_CONSTANT
Definition slang.h:2106
SlangWriterMode
Definition slang.h:1827
@ SLANG_WRITER_MODE_TEXT
Definition slang.h:1828
@ SLANG_WRITER_MODE_BINARY
Definition slang.h:1829
SlangContainerFormat
Definition slang.h:666
@ SLANG_CONTAINER_FORMAT_SLANG_MODULE
Definition slang.h:672
@ SLANG_CONTAINER_FORMAT_NONE
Definition slang.h:668
#define SLANG_API
Definition slang.h:255
SlangCooperativeVectorMatrixLayout
Definition slang.h:880
@ SLANG_COOPERATIVE_VECTOR_MATRIX_LAYOUT_TRAINING_OPTIMAL
Definition slang.h:884
@ SLANG_COOPERATIVE_VECTOR_MATRIX_LAYOUT_COLUMN_MAJOR
Definition slang.h:882
@ SLANG_COOPERATIVE_VECTOR_MATRIX_LAYOUT_ROW_MAJOR
Definition slang.h:881
@ SLANG_COOPERATIVE_VECTOR_MATRIX_LAYOUT_INFERENCING_OPTIMAL
Definition slang.h:883
struct SlangEntryPoint SlangEntryPoint
Definition slang.h:1938
SlangUInt32 SlangStageIntegral
Definition slang.h:835
SlangDeclKind
Definition slang.h:2029
@ SLANG_DECL_KIND_STRUCT
Definition slang.h:2031
@ SLANG_DECL_KIND_UNSUPPORTED_FOR_REFLECTION
Definition slang.h:2030
@ SLANG_DECL_KIND_NAMESPACE
Definition slang.h:2036
@ SLANG_DECL_KIND_ENUM
Definition slang.h:2037
@ SLANG_DECL_KIND_GENERIC
Definition slang.h:2034
@ SLANG_DECL_KIND_VARIABLE
Definition slang.h:2035
@ SLANG_DECL_KIND_FUNC
Definition slang.h:2032
@ SLANG_DECL_KIND_MODULE
Definition slang.h:2033
SlangResourceAccess
Definition slang.h:2081
@ SLANG_RESOURCE_ACCESS_FEEDBACK
Definition slang.h:2089
@ SLANG_RESOURCE_ACCESS_NONE
Definition slang.h:2082
@ SLANG_RESOURCE_ACCESS_WRITE
Definition slang.h:2088
@ SLANG_RESOURCE_ACCESS_UNKNOWN
Definition slang.h:2090
@ SLANG_RESOURCE_ACCESS_RASTER_ORDERED
Definition slang.h:2085
@ SLANG_RESOURCE_ACCESS_APPEND
Definition slang.h:2086
@ SLANG_RESOURCE_ACCESS_READ_WRITE
Definition slang.h:2084
@ SLANG_RESOURCE_ACCESS_READ
Definition slang.h:2083
@ SLANG_RESOURCE_ACCESS_CONSUME
Definition slang.h:2087
unsigned int SlangMatrixLayoutModeIntegral
Definition slang.h:827
unsigned int SlangWriterModeIntegral
Definition slang.h:1825
#define SLANG_EXTERN_C
Definition slang.h:351
@ SLANG_COMPILE_FLAG_OBFUSCATE
Definition slang.h:722
@ SLANG_COMPILE_FLAG_NO_MANGLING
Definition slang.h:716
@ SLANG_COMPILE_FLAG_NO_CODEGEN
Definition slang.h:719
@ SLANG_COMPILE_FLAG_NO_CHECKING
Definition slang.h:727
@ SLANG_COMPILE_FLAG_SPLIT_MIXED_TYPES
Definition slang.h:728
SlangLineDirectiveMode
Definition slang.h:786
@ SLANG_LINE_DIRECTIVE_MODE_NONE
Definition slang.h:789
@ SLANG_LINE_DIRECTIVE_MODE_SOURCE_MAP
Definition slang.h:793
@ SLANG_LINE_DIRECTIVE_MODE_STANDARD
Definition slang.h:790
@ SLANG_LINE_DIRECTIVE_MODE_DEFAULT
Definition slang.h:787
@ SLANG_LINE_DIRECTIVE_MODE_GLSL
Definition slang.h:791
#define SLANG_FORCE_INLINE
Definition slang.h:291
unsigned int SlangScalarTypeIntegral
Definition slang.h:2002
struct slang::ICompileRequest SlangCompileRequest
A request for one or more compilation actions to be performed.
Definition slang.h:1907
SlangImageFormat
Definition slang.h:2276
SlangReflectionGenericArgType
Definition slang.h:1961
@ SLANG_GENERIC_ARG_BOOL
Definition slang.h:1964
@ SLANG_GENERIC_ARG_TYPE
Definition slang.h:1962
@ SLANG_GENERIC_ARG_INT
Definition slang.h:1963
struct SlangReflectionUserAttribute SlangReflectionUserAttribute
Definition slang.h:1948
int SlangCompileTargetIntegral
Definition slang.h:613
void(* SlangDiagnosticCallback)(char const *message, void *userData)
Callback type used for diagnostic output.
Definition slang.h:1913
@ SLANG_TARGET_FLAG_GENERATE_WHOLE_PROGRAM
Definition slang.h:747
@ SLANG_TARGET_FLAG_PARAMETER_BLOCKS_USE_REGISTER_SPACES
Definition slang.h:741
@ SLANG_TARGET_FLAG_GENERATE_SPIRV_DIRECTLY
Definition slang.h:754
@ SLANG_TARGET_FLAG_DUMP_IR
Definition slang.h:750
SlangSourceLanguage
Definition slang.h:799
@ SLANG_SOURCE_LANGUAGE_HLSL
Definition slang.h:802
@ SLANG_SOURCE_LANGUAGE_METAL
Definition slang.h:808
@ SLANG_SOURCE_LANGUAGE_GLSL
Definition slang.h:803
@ SLANG_SOURCE_LANGUAGE_WGSL
Definition slang.h:809
@ SLANG_SOURCE_LANGUAGE_SPIRV
Definition slang.h:807
@ SLANG_SOURCE_LANGUAGE_COUNT_OF
Definition slang.h:811
@ SLANG_SOURCE_LANGUAGE_CUDA
Definition slang.h:806
@ SLANG_SOURCE_LANGUAGE_CPP
Definition slang.h:805
@ SLANG_SOURCE_LANGUAGE_UNKNOWN
Definition slang.h:800
@ SLANG_SOURCE_LANGUAGE_C
Definition slang.h:804
@ SLANG_SOURCE_LANGUAGE_LLVM
Definition slang.h:810
@ SLANG_SOURCE_LANGUAGE_SLANG
Definition slang.h:801
SLANG_API const char * spGetBuildTagString()
Get the build version 'tag' string. The string is the same as produced via git describe --tags --matc...
int SlangArchiveTypeIntegral
Definition slang.h:698
uint32_t SlangSizeT
Definition slang.h:563
struct SlangReflectionTypeParameter SlangReflectionTypeParameter
Definition slang.h:1947
SlangUInt32 SlangScopeIntegral
Definition slang.h:861
int SlangSeverityIntegral
Severity of a diagnostic generated by the compiler. Values come from the enum below,...
Definition slang.h:575
SlangCapabilityID
Definition slang.h:823
@ SLANG_CAPABILITY_UNKNOWN
Definition slang.h:824
SlangMatrixLayoutMode
Definition slang.h:829
@ SLANG_MATRIX_LAYOUT_MODE_UNKNOWN
Definition slang.h:830
@ SLANG_MATRIX_LAYOUT_ROW_MAJOR
Definition slang.h:831
@ SLANG_MATRIX_LAYOUT_COLUMN_MAJOR
Definition slang.h:832
SlangUInt32 SlangCooperativeMatrixUseIntegral
Definition slang.h:870
SlangArchiveType
Definition slang.h:700
@ SLANG_ARCHIVE_TYPE_RIFF
Riff container with no compression
Definition slang.h:703
@ SLANG_ARCHIVE_TYPE_ZIP
Definition slang.h:702
@ SLANG_ARCHIVE_TYPE_COUNT_OF
Definition slang.h:706
@ SLANG_ARCHIVE_TYPE_UNDEFINED
Definition slang.h:701
@ SLANG_ARCHIVE_TYPE_RIFF_DEFLATE
Definition slang.h:704
@ SLANG_ARCHIVE_TYPE_RIFF_LZ4
Definition slang.h:705
OSPathKind
Definition slang.h:1604
@ None
Paths do not map to the file system
@ Direct
Paths map directly to the file system
SlangDebugInfoLevel
Definition slang.h:889
@ SLANG_DEBUG_INFO_LEVEL_STANDARD
Definition slang.h:893
@ SLANG_DEBUG_INFO_LEVEL_MINIMAL
Definition slang.h:891
@ SLANG_DEBUG_INFO_LEVEL_MAXIMAL
Definition slang.h:895
@ SLANG_DEBUG_INFO_LEVEL_NONE
Definition slang.h:890
struct SlangReflectionDecl SlangReflectionDecl
Definition slang.h:1941
SlangBindingType
Definition slang.h:2216
@ SLANG_BINDING_TYPE_MUTABLE_FLAG
Definition slang.h:2236
@ SLANG_BINDING_TYPE_VARYING_OUTPUT
Definition slang.h:2231
@ SLANG_BINDING_TYPE_BASE_MASK
Definition slang.h:2245
@ SLANG_BINDING_TYPE_TEXTURE
Definition slang.h:2220
@ SLANG_BINDING_TYPE_MUTABLE_TETURE
Definition slang.h:2238
@ SLANG_BINDING_TYPE_VARYING_INPUT
Definition slang.h:2230
@ SLANG_BINDING_TYPE_MUTABLE_RAW_BUFFER
Definition slang.h:2242
@ SLANG_BINDING_TYPE_TYPED_BUFFER
Definition slang.h:2223
@ SLANG_BINDING_TYPE_CONSTANT_BUFFER
Definition slang.h:2221
@ SLANG_BINDING_TYPE_MUTABLE_TYPED_BUFFER
Definition slang.h:2240
@ SLANG_BINDING_TYPE_EXT_MASK
Definition slang.h:2246
@ SLANG_BINDING_TYPE_PUSH_CONSTANT
Definition slang.h:2234
@ SLANG_BINDING_TYPE_RAY_TRACING_ACCELERATION_STRUCTURE
Definition slang.h:2228
@ SLANG_BINDING_TYPE_COMBINED_TEXTURE_SAMPLER
Definition slang.h:2225
@ SLANG_BINDING_TYPE_INPUT_RENDER_TARGET
Definition slang.h:2226
@ SLANG_BINDING_TYPE_PARAMETER_BLOCK
Definition slang.h:2222
@ SLANG_BINDING_TYPE_UNKNOWN
Definition slang.h:2217
@ SLANG_BINDING_TYPE_SAMPLER
Definition slang.h:2219
@ SLANG_BINDING_TYPE_INLINE_UNIFORM_DATA
Definition slang.h:2227
@ SLANG_BINDING_TYPE_EXISTENTIAL_VALUE
Definition slang.h:2233
@ SLANG_BINDING_TYPE_RAW_BUFFER
Definition slang.h:2224
struct SlangProgramLayout SlangProgramLayout
Definition slang.h:1902
uint32_t SlangUInt
Definition slang.h:560
unsigned int SlangDeclKindIntegral
Definition slang.h:2027
SlangStage
Definition slang.h:837
@ SLANG_STAGE_VERTEX
Definition slang.h:839
@ SLANG_STAGE_CALLABLE
Definition slang.h:850
@ SLANG_STAGE_COUNT
Definition slang.h:855
@ SLANG_STAGE_FRAGMENT
Definition slang.h:843
@ SLANG_STAGE_NONE
Definition slang.h:838
@ SLANG_STAGE_CLOSEST_HIT
Definition slang.h:848
@ SLANG_STAGE_RAY_GENERATION
Definition slang.h:845
@ SLANG_STAGE_HULL
Definition slang.h:840
@ SLANG_STAGE_COMPUTE
Definition slang.h:844
@ SLANG_STAGE_MISS
Definition slang.h:849
@ SLANG_STAGE_AMPLIFICATION
Definition slang.h:852
@ SLANG_STAGE_ANY_HIT
Definition slang.h:847
@ SLANG_STAGE_PIXEL
Definition slang.h:858
@ SLANG_STAGE_DISPATCH
Definition slang.h:853
@ SLANG_STAGE_MESH
Definition slang.h:851
@ SLANG_STAGE_GEOMETRY
Definition slang.h:842
@ SLANG_STAGE_INTERSECTION
Definition slang.h:846
@ SLANG_STAGE_DOMAIN
Definition slang.h:841
int SlangSourceLanguageIntegral
Definition slang.h:797
struct SlangEntryPointLayout SlangEntryPointLayout
Definition slang.h:1939
SlangUInt32 SlangModifierIDIntegral
Definition slang.h:2258
unsigned int SlangWriterChannelIntegral
Definition slang.h:1816
SlangCompileTarget
Definition slang.h:615
@ SLANG_TARGET_COUNT_OF
Definition slang.h:658
@ SLANG_HOST_SHARED_LIBRARY
A shared library/Dll for host code (for hosting CPU/OS)
Definition slang.h:645
@ SLANG_OBJECT_CODE
Object code that can be used for later linking (kernel/shader)
Definition slang.h:638
@ SLANG_CPP_PYTORCH_BINDING
C++ PyTorch binding code.
Definition slang.h:641
@ SLANG_SHADER_SHARED_LIBRARY
Definition slang.h:631
@ SLANG_HLSL
Definition slang.h:621
@ SLANG_HOST_HOST_CALLABLE
Host callable host code (ie non kernel/shader)
Definition slang.h:640
@ SLANG_SPIRV_ASM
Definition slang.h:623
@ SLANG_SPIRV
Definition slang.h:622
@ SLANG_DXIL
Definition slang.h:626
@ SLANG_HOST_LLVM_IR
Host LLVM IR assembly
Definition slang.h:655
@ SLANG_DXBC_ASM
Definition slang.h:625
@ SLANG_CPP_SOURCE
C++ code for shader kernels.
Definition slang.h:629
@ SLANG_WGSL
WebGPU shading language
Definition slang.h:646
@ SLANG_TARGET_UNKNOWN
Definition slang.h:616
@ SLANG_METAL_LIB_ASM
Metal library assembly
Definition slang.h:644
@ SLANG_METAL_LIB
Metal library
Definition slang.h:643
@ SLANG_C_SOURCE
The C language
Definition slang.h:628
@ SLANG_GLSL
Definition slang.h:618
@ SLANG_HOST_VM
Bytecode that can be interpreted by the Slang VM
Definition slang.h:650
@ SLANG_WGSL_SPIRV
SPIR-V via WebGPU shading language
Definition slang.h:648
@ SLANG_HOST_EXECUTABLE
Standalone binary executable (for hosting CPU/OS)
Definition slang.h:630
@ SLANG_CUDA_OBJECT_CODE
Object code that contains CUDA functions.
Definition slang.h:637
@ SLANG_SHADER_HOST_CALLABLE
Definition slang.h:633
@ SLANG_PTX
PTX
Definition slang.h:636
@ SLANG_CUDA_HEADER
Cuda header
Definition slang.h:652
@ SLANG_HOST_CPP_SOURCE
C++ code for host library or executable.
Definition slang.h:639
@ SLANG_GLSL_VULKAN_ONE_DESC_DEPRECATED
Definition slang.h:620
@ SLANG_WGSL_SPIRV_ASM
SPIR-V assembly via WebGPU shading language
Definition slang.h:647
@ SLANG_CUDA_SOURCE
Cuda source
Definition slang.h:635
@ SLANG_DXBC
Definition slang.h:624
@ SLANG_TARGET_NONE
Definition slang.h:617
@ SLANG_CPP_HEADER
C++ header for shader kernels.
Definition slang.h:651
@ SLANG_GLSL_VULKAN_DEPRECATED
Definition slang.h:619
@ SLANG_DXIL_ASM
Definition slang.h:627
@ SLANG_HOST_OBJECT_CODE
Host object code
Definition slang.h:654
@ SLANG_METAL
Metal shading language
Definition slang.h:642
@ SLANG_SHADER_LLVM_IR
Host LLVM IR assembly (kernel/shader)
Definition slang.h:656
PathKind
Definition slang.h:1613
SlangUInt32 SlangImageFormatIntegral
Definition slang.h:2274
SlangOptimizationLevel
Definition slang.h:918
@ SLANG_OPTIMIZATION_LEVEL_NONE
Definition slang.h:919
@ SLANG_OPTIMIZATION_LEVEL_MAXIMAL
Definition slang.h:923
@ SLANG_OPTIMIZATION_LEVEL_HIGH
Definition slang.h:922
@ SLANG_OPTIMIZATION_LEVEL_DEFAULT
Definition slang.h:920
#define SLANG_UNKNOWN_SIZE
Definition slang.h:2283
unsigned int SlangParameterCategoryIntegral
Definition slang.h:2093
SlangUInt32 SlangLayoutRulesIntegral
Definition slang.h:2249
SlangBindableResourceType
Definition slang.h:597
@ SLANG_TEXTURE
Definition slang.h:599
@ SLANG_STORAGE_BUFFER
Definition slang.h:602
@ SLANG_SAMPLER
Definition slang.h:600
@ SLANG_NON_BINDABLE
Definition slang.h:598
@ SLANG_UNIFORM_BUFFER
Definition slang.h:601
struct SlangReflectionType SlangReflectionType
Definition slang.h:1943
SlangFpDenormalMode
Definition slang.h:775
@ SLANG_FP_DENORM_MODE_PRESERVE
Definition slang.h:777
@ SLANG_FP_DENORM_MODE_FTZ
Definition slang.h:778
@ SLANG_FP_DENORM_MODE_ANY
Definition slang.h:776
struct SlangReflectionVariable SlangReflectionVariable
Definition slang.h:1945
int32_t SlangInt32
Definition slang.h:543
int32_t SlangSSizeT
Definition slang.h:562
SlangDiagnosticColor
Definition slang.h:943
@ SLANG_DIAGNOSTIC_COLOR_NEVER
Definition slang.h:946
@ SLANG_DIAGNOSTIC_COLOR_AUTO
Definition slang.h:944
@ SLANG_DIAGNOSTIC_COLOR_ALWAYS
Definition slang.h:945
SlangCooperativeMatrixUse
Definition slang.h:872
@ SLANG_COOPERATIVE_MATRIX_USE_A
Definition slang.h:873
@ SLANG_COOPERATIVE_MATRIX_USE_B
Definition slang.h:874
@ SLANG_COOPERATIVE_MATRIX_USE_ACCUMULATOR
Definition slang.h:875
#define SLANG_DEPRECATED
Definition slang.h:527
SlangFloatingPointMode
Definition slang.h:764
@ SLANG_FLOATING_POINT_MODE_PRECISE
Definition slang.h:767
@ SLANG_FLOATING_POINT_MODE_DEFAULT
Definition slang.h:765
@ SLANG_FLOATING_POINT_MODE_FAST
Definition slang.h:766
SlangScalarType
Definition slang.h:2004
@ SLANG_SCALAR_TYPE_UINTPTR
Definition slang.h:2020
@ SLANG_SCALAR_TYPE_FLOAT16
Definition slang.h:2012
@ SLANG_SCALAR_TYPE_BOOL
Definition slang.h:2007
@ SLANG_SCALAR_TYPE_BFLOAT16
Definition slang.h:2021
@ SLANG_SCALAR_TYPE_INT8
Definition slang.h:2015
@ SLANG_SCALAR_TYPE_UINT16
Definition slang.h:2018
@ SLANG_SCALAR_TYPE_FLOAT64
Definition slang.h:2014
@ SLANG_SCALAR_TYPE_NONE
Definition slang.h:2005
@ SLANG_SCALAR_TYPE_UINT32
Definition slang.h:2009
@ SLANG_SCALAR_TYPE_VOID
Definition slang.h:2006
@ SLANG_SCALAR_TYPE_INT64
Definition slang.h:2010
@ SLANG_SCALAR_TYPE_FLOAT_E4M3
Definition slang.h:2022
@ SLANG_SCALAR_TYPE_INT32
Definition slang.h:2008
@ SLANG_SCALAR_TYPE_UINT8
Definition slang.h:2016
@ SLANG_SCALAR_TYPE_INT16
Definition slang.h:2017
@ SLANG_SCALAR_TYPE_FLOAT_E5M2
Definition slang.h:2023
@ SLANG_SCALAR_TYPE_UINT64
Definition slang.h:2011
@ SLANG_SCALAR_TYPE_INTPTR
Definition slang.h:2019
@ SLANG_SCALAR_TYPE_FLOAT32
Definition slang.h:2013
SlangUInt32 SlangDebugInfoLevelIntegral
Definition slang.h:887
SlangReflectionUserAttribute SlangReflectionAttribute
Definition slang.h:1949
SlangInt32 SlangCapabilityIDIntegral
Definition slang.h:821
struct SlangReflectionTypeLayout SlangReflectionTypeLayout
Definition slang.h:1944
SlangTypeKind
Definition slang.h:1977
@ SLANG_TYPE_KIND_SHADER_STORAGE_BUFFER
Definition slang.h:1988
@ SLANG_TYPE_KIND_MESH_OUTPUT
Definition slang.h:1993
@ SLANG_TYPE_KIND_SPECIALIZED
Definition slang.h:1994
@ SLANG_TYPE_KIND_VECTOR
Definition slang.h:1982
@ SLANG_TYPE_KIND_POINTER
Definition slang.h:1996
@ SLANG_TYPE_KIND_TEXTURE_BUFFER
Definition slang.h:1987
@ SLANG_TYPE_KIND_ENUM
Definition slang.h:1998
@ SLANG_TYPE_KIND_OUTPUT_STREAM
Definition slang.h:1992
@ SLANG_TYPE_KIND_ARRAY
Definition slang.h:1980
@ SLANG_TYPE_KIND_STRUCT
Definition slang.h:1979
@ SLANG_TYPE_KIND_FEEDBACK
Definition slang.h:1995
@ SLANG_TYPE_KIND_CONSTANT_BUFFER
Definition slang.h:1984
@ SLANG_TYPE_KIND_COUNT
Definition slang.h:1999
@ SLANG_TYPE_KIND_DYNAMIC_RESOURCE
Definition slang.h:1997
@ SLANG_TYPE_KIND_MATRIX
Definition slang.h:1981
@ SLANG_TYPE_KIND_GENERIC_TYPE_PARAMETER
Definition slang.h:1990
@ SLANG_TYPE_KIND_RESOURCE
Definition slang.h:1985
@ SLANG_TYPE_KIND_SAMPLER_STATE
Definition slang.h:1986
@ SLANG_TYPE_KIND_PARAMETER_BLOCK
Definition slang.h:1989
@ SLANG_TYPE_KIND_NONE
Definition slang.h:1978
@ SLANG_TYPE_KIND_SCALAR
Definition slang.h:1983
@ SLANG_TYPE_KIND_INTERFACE
Definition slang.h:1991
SlangDebugInfoFormat
Definition slang.h:902
@ SLANG_DEBUG_INFO_FORMAT_STABS
Stabs
Definition slang.h:908
@ SLANG_DEBUG_INFO_FORMAT_DEFAULT
Use the default debugging format for the target
Definition slang.h:903
@ SLANG_DEBUG_INFO_FORMAT_C7
Definition slang.h:904
@ SLANG_DEBUG_INFO_FORMAT_COUNT_OF
Definition slang.h:913
@ SLANG_DEBUG_INFO_FORMAT_DWARF
Definition slang.h:910
@ SLANG_DEBUG_INFO_FORMAT_PDB
Program database
Definition slang.h:906
@ SLANG_DEBUG_INFO_FORMAT_COFF
COFF debug info
Definition slang.h:909
SlangUInt32 SlangOptimizationLevelIntegral
Definition slang.h:916
SlangScope
Definition slang.h:863
@ SLANG_SCOPE_WAVE
Definition slang.h:866
@ SLANG_SCOPE_THREAD
Definition slang.h:865
@ SLANG_SCOPE_NONE
Definition slang.h:864
@ SLANG_SCOPE_THREAD_GROUP
Definition slang.h:867
unsigned int SlangResourceAccessIntegral
Definition slang.h:2079
int SlangContainerFormatIntegral
Definition slang.h:664
@ SLANG_DIAGNOSTIC_FLAG_VERBOSE_PATHS
Definition slang.h:591
@ SLANG_DIAGNOSTIC_FLAG_TREAT_WARNINGS_AS_ERRORS
Definition slang.h:592
constexpr SlangTargetFlags kDefaultTargetFlags
Definition slang.h:756
#define SLANG_MCALL
Definition slang.h:226
unsigned int SlangCompileFlags
Definition slang.h:712
void(* FileSystemContentsCallBack)(SlangPathType pathType, const char *name, void *userData)
Definition slang.h:1600
SlangWriterChannel
Definition slang.h:1818
@ SLANG_WRITER_CHANNEL_COUNT_OF
Definition slang.h:1822
@ SLANG_WRITER_CHANNEL_STD_ERROR
Definition slang.h:1821
@ SLANG_WRITER_CHANNEL_STD_OUTPUT
Definition slang.h:1820
@ SLANG_WRITER_CHANNEL_DIAGNOSTIC
Definition slang.h:1819
void(* SlangFuncPtr)(void)
Definition slang.h:1524
int SlangPassThroughIntegral
Definition slang.h:675
SlangProgramLayout SlangReflection
Definition slang.h:1970
unsigned int SlangResourceShapeIntegral
Definition slang.h:2042
SlangEmitSpirvMethod
Definition slang.h:929
@ SLANG_EMIT_SPIRV_VIA_GLSL
Definition slang.h:931
@ SLANG_EMIT_SPIRV_DIRECTLY
Definition slang.h:932
@ SLANG_EMIT_SPIRV_DEFAULT
Definition slang.h:930
SlangModifierID
Definition slang.h:2260
@ SLANG_MODIFIER_DIFFERENTIABLE
Definition slang.h:2267
@ SLANG_MODIFIER_STATIC
Definition slang.h:2263
@ SLANG_MODIFIER_SHARED
Definition slang.h:2261
@ SLANG_MODIFIER_IN
Definition slang.h:2269
@ SLANG_MODIFIER_EXPORT
Definition slang.h:2265
@ SLANG_MODIFIER_CONST
Definition slang.h:2264
@ SLANG_MODIFIER_OUT
Definition slang.h:2270
@ SLANG_MODIFIER_EXTERN
Definition slang.h:2266
@ SLANG_MODIFIER_INOUT
Definition slang.h:2271
@ SLANG_MODIFIER_MUTATING
Definition slang.h:2268
@ SLANG_MODIFIER_NO_DIFF
Definition slang.h:2262
Definition slang-cpp-types-core.h:82
Definition slang.h:1460
virtual SLANG_NO_THROW size_t SLANG_MCALL getBufferSize()=0
SLANG_COM_INTERFACE(0x8BA5FB08, 0x5195, 0x40e2, {0xAC, 0x58, 0x0D, 0x98, 0x9C, 0x3A, 0x01, 0x02}) virtual SLANG_NO_THROW void const *SLANG_MCALL getBufferPointer()=0
Definition slang.h:1653
SLANG_COM_INTERFACE(0x5fb632d2, 0x979d, 0x4481, {0x9f, 0xee, 0x66, 0x3c, 0x3f, 0x14, 0x49, 0xe1}) virtual SLANG_NO_THROW SlangResult SLANG_MCALL getFileUniqueIdentity(const char *path
virtual SLANG_NO_THROW SlangResult SLANG_MCALL enumeratePathContents(const char *path, FileSystemContentsCallBack callback, void *userData)=0
virtual SLANG_NO_THROW SlangResult SLANG_MCALL calcCombinedPath(SlangPathType fromPathType, const char *fromPath, const char *path, ISlangBlob **pathOut)=0
virtual SLANG_NO_THROW SlangResult SLANG_MCALL getPath(PathKind kind, const char *path, ISlangBlob **outPath)=0
virtual SLANG_NO_THROW OSPathKind SLANG_MCALL getOSPathKind()=0
virtual SLANG_NO_THROW SlangResult SLANG_MCALL getPathType(const char *path, SlangPathType *pathTypeOut)=0
virtual SLANG_NO_THROW void SLANG_MCALL clearCache()=0
ISlangBlob ** outUniqueIdentity
Definition slang.h:1693
Definition slang.h:1498
SLANG_COM_INTERFACE(0x003A09FC, 0x3A4D, 0x4BA0, {0xAD, 0x60, 0x1F, 0xD8, 0x63, 0xA9, 0x15, 0xAB}) virtual SLANG_NO_THROW SlangResult SLANG_MCALL loadFile(char const *path
ISlangBlob ** outBlob
Definition slang.h:1519
Definition slang.h:1760
virtual SLANG_NO_THROW SlangResult SLANG_MCALL createDirectory(const char *path)=0
const void * data
Definition slang.h:1776
virtual SLANG_NO_THROW SlangResult SLANG_MCALL remove(const char *path)=0
virtual SLANG_NO_THROW SlangResult SLANG_MCALL saveFileBlob(const char *path, ISlangBlob *dataBlob)=0
SLANG_COM_INTERFACE(0xa058675c, 0x1d65, 0x452a, {0x84, 0x58, 0xcc, 0xde, 0xd1, 0x42, 0x71, 0x5}) virtual SLANG_NO_THROW SlangResult SLANG_MCALL saveFile(const char *path
const void size_t size
Definition slang.h:1776
Definition slang.h:1876
SLANG_COM_INTERFACE(0x197772c7, 0x0155, 0x4b91, {0x84, 0xe8, 0x66, 0x68, 0xba, 0xff, 0x06, 0x19}) virtual SLANG_NO_THROW size_t SLANG_MCALL getEntryCount()=0
virtual SLANG_NO_THROW long SLANG_MCALL getEntryTimeMS(uint32_t index)=0
virtual SLANG_NO_THROW const char *SLANG_MCALL getEntryName(uint32_t index)=0
virtual SLANG_NO_THROW uint32_t SLANG_MCALL getEntryInvocationTimes(uint32_t index)=0
Definition slang.h:1530
SLANG_COM_INTERFACE(0x9c9d5bc5, 0xeb61, 0x496f, {0x80, 0xd7, 0xd1, 0x47, 0xc4, 0xa2, 0x37, 0x30}) virtual SLANG_NO_THROW void *SLANG_MCALL findSymbolAddressByName(char const *name)=0
Definition slang.h:1545
virtual SLANG_NO_THROW void *SLANG_MCALL findSymbolAddressByName(char const *name)=0
SLANG_COM_INTERFACE(0x70dbc7c4, 0xdc3b, 0x4a07, {0xae, 0x7e, 0x75, 0x2a, 0xf6, 0xa8, 0x15, 0x55}) SLANG_FORCE_INLINE SlangFuncPtr findFuncByName(char const *name)
Definition slang.h:1546
Definition slang.h:1570
ISlangSharedLibrary ** sharedLibraryOut
Definition slang.h:1584
SLANG_COM_INTERFACE(0x6264ab2b, 0xa3e8, 0x4a06, {0x97, 0xf1, 0x49, 0xbc, 0x2d, 0x2a, 0xb1, 0x4d}) virtual SLANG_NO_THROW SlangResult SLANG_MCALL loadSharedLibrary(const char *path
Definition slang-cpp-prelude.h:303
SlangResult QueryInterface(struct _GUID const &uuid, void **outObject)
Definition slang.h:1414
void ** outObject
Definition slang.h:1406
virtual SLANG_NO_THROW uint32_t SLANG_MCALL addRef()=0
virtual SLANG_NO_THROW SlangResult SLANG_MCALL queryInterface(SlangUUID const &uuid, void **outObject)=0
virtual SLANG_NO_THROW uint32_t SLANG_MCALL release()=0
SLANG_COM_INTERFACE(0x00000000, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}) virtual SLANG_NO_THROW SlangResult SLANG_MCALL queryInterface(SlangUUID const &uuid
uint32_t AddRef()
Definition slang.h:1418
uint32_t Release()
Definition slang.h:1419
Definition slang.h:1835
virtual SLANG_NO_THROW SlangResult SLANG_MCALL endAppendBuffer(char *buffer, size_t numChars)=0
virtual SLANG_NO_THROW SlangBool SLANG_MCALL isConsole()=0
virtual SLANG_NO_THROW SlangResult SLANG_MCALL write(const char *chars, size_t numChars)=0
SLANG_COM_INTERFACE(0xec457f0e, 0x9add, 0x4e6b, {0x85, 0x1c, 0xd7, 0xfa, 0x71, 0x6d, 0x15, 0xfd}) virtual SLANG_NO_THROW char *SLANG_MCALL beginAppendBuffer(size_t maxNumChars)=0
virtual SLANG_NO_THROW SlangResult SLANG_MCALL setMode(SlangWriterMode mode)=0
virtual SLANG_NO_THROW void SLANG_MCALL flush()=0
Definition slang-cpp-types-core.h:401
Definition slang-cpp-types.h:240
Definition slang.h:1476
char chars[1]
Definition slang.h:1483
SLANG_CLASS_GUID(0xbe0db1a8, 0x3594, 0x4603, {0xa7, 0x8b, 0xc4, 0x86, 0x84, 0x30, 0xdf, 0xbb})
Definition slang-cpp-prelude.h:293
uint16_t data3
Definition slang-cpp-prelude.h:296
uint32_t data1
Definition slang-cpp-prelude.h:294
uint16_t data2
Definition slang-cpp-prelude.h:295
uint8_t data4[8]
Definition slang-cpp-prelude.h:297
Definition slang-cpp-types.h:61
Definition slang-cpp-types-core.h:103
Definition slang.h:1197
CompilerOptionName name
Definition slang.h:1198
CompilerOptionValue value
Definition slang.h:1199
Definition slang.h:1188
int32_t intValue0
Definition slang.h:1190
const char * stringValue1
Definition slang.h:1193
int32_t intValue1
Definition slang.h:1191
const char * stringValue0
Definition slang.h:1192
CompilerOptionValueKind kind
Definition slang.h:1189
Definition slang.h:1954
int64_t intVal
Definition slang.h:1956
SlangReflectionType * typeVal
Definition slang.h:1955
bool boolVal
Definition slang.h:1957