yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Xuanda YangAdd FindModifier for Declarations (#8308)f3e26754c

master
68.0 KiB1621 linesraw
1#pragma once
2
3#include "slang.h"
4
5/* DEPRECATED DEFINITIONS
6
7Everything in this file represents deprecated APIs/definition that are only
8being kept around for source/binary compatibility with old client code. New
9code should not use any of these declarations, and the Slang API will drop these
10declarations over time.
11*/
12
13#ifdef __cplusplus
14extern "C"
15{
16#endif
17
18    /*!
19    @brief Initialize an instance of the Slang library.
20    */
21    SLANG_API SlangSession* spCreateSession(const char* deprecated = 0);
22
23    /*!
24    @brief Clean up after an instance of the Slang library.
25    */
26    SLANG_API void spDestroySession(SlangSession* session);
27
28    /** @see slang::IGlobalSession::setSharedLibraryLoader
29     */
30    SLANG_API void spSessionSetSharedLibraryLoader(
31        SlangSession* session,
32        ISlangSharedLibraryLoader* loader);
33
34    /** @see slang::IGlobalSession::getSharedLibraryLoader
35     */
36    SLANG_API ISlangSharedLibraryLoader* spSessionGetSharedLibraryLoader(SlangSession* session);
37
38    /** @see slang::IGlobalSession::checkCompileTargetSupport
39     */
40    SLANG_API SlangResult
41    spSessionCheckCompileTargetSupport(SlangSession* session, SlangCompileTarget target);
42
43    /** @see slang::IGlobalSession::checkPassThroughSupport
44     */
45    SLANG_API SlangResult
46    spSessionCheckPassThroughSupport(SlangSession* session, SlangPassThrough passThrough);
47
48    /** @see slang::IGlobalSession::addBuiltins
49     */
50    SLANG_API void spAddBuiltins(
51        SlangSession* session,
52        char const* sourcePath,
53        char const* sourceString);
54
55    /* @see slang::IGlobalSession::createCompileRequest
56     */
57    SLANG_API SlangCompileRequest* spCreateCompileRequest(SlangSession* session);
58
59    /*!
60    @brief Destroy a compile request.
61    Note a request is a COM object and can be destroyed via 'Release'.
62    */
63    SLANG_API void spDestroyCompileRequest(SlangCompileRequest* request);
64
65    /*! @see slang::ICompileRequest::setFileSystem */
66    SLANG_API void spSetFileSystem(SlangCompileRequest* request, ISlangFileSystem* fileSystem);
67
68    /*! @see slang::ICompileRequest::setCompileFlags */
69    SLANG_API void spSetCompileFlags(SlangCompileRequest* request, SlangCompileFlags flags);
70
71    /*! @see slang::ICompileRequest::getCompileFlags */
72    SLANG_API SlangCompileFlags spGetCompileFlags(SlangCompileRequest* request);
73
74    /*! @see slang::ICompileRequest::setDumpIntermediates */
75    SLANG_API void spSetDumpIntermediates(SlangCompileRequest* request, int enable);
76
77    /*! @see slang::ICompileRequest::setDumpIntermediatePrefix */
78    SLANG_API void spSetDumpIntermediatePrefix(SlangCompileRequest* request, const char* prefix);
79
80    /*! DEPRECATED: use `spSetTargetLineDirectiveMode` instead.
81        @see slang::ICompileRequest::setLineDirectiveMode */
82    SLANG_API void spSetLineDirectiveMode(
83        SlangCompileRequest* request,
84        SlangLineDirectiveMode mode);
85
86    /*! @see slang::ICompileRequest::setTargetLineDirectiveMode */
87    SLANG_API void spSetTargetLineDirectiveMode(
88        SlangCompileRequest* request,
89        int targetIndex,
90        SlangLineDirectiveMode mode);
91
92    /*! @see slang::ICompileRequest::setTargetLineDirectiveMode */
93    SLANG_API void spSetTargetForceGLSLScalarBufferLayout(
94        SlangCompileRequest* request,
95        int targetIndex,
96        bool forceScalarLayout);
97
98    /*! @see slang::ICompileRequest::setTargetUseMinimumSlangOptimization */
99    SLANG_API void spSetTargetUseMinimumSlangOptimization(
100        slang::ICompileRequest* request,
101        int targetIndex,
102        bool val);
103
104    /*! @see slang::ICompileRequest::setIgnoreCapabilityCheck */
105    SLANG_API void spSetIgnoreCapabilityCheck(slang::ICompileRequest* request, bool val);
106
107    /*! @see slang::ICompileRequest::setCodeGenTarget */
108    SLANG_API void spSetCodeGenTarget(SlangCompileRequest* request, SlangCompileTarget target);
109
110    /*! @see slang::ICompileRequest::addCodeGenTarget */
111    SLANG_API int spAddCodeGenTarget(SlangCompileRequest* request, SlangCompileTarget target);
112
113    /*! @see slang::ICompileRequest::setTargetProfile */
114    SLANG_API void spSetTargetProfile(
115        SlangCompileRequest* request,
116        int targetIndex,
117        SlangProfileID profile);
118
119    /*! @see slang::ICompileRequest::setTargetFlags */
120    SLANG_API void spSetTargetFlags(
121        SlangCompileRequest* request,
122        int targetIndex,
123        SlangTargetFlags flags);
124
125
126    /*! @see slang::ICompileRequest::setTargetFloatingPointMode */
127    SLANG_API void spSetTargetFloatingPointMode(
128        SlangCompileRequest* request,
129        int targetIndex,
130        SlangFloatingPointMode mode);
131
132    /*! @see slang::ICompileRequest::addTargetCapability */
133    SLANG_API void spAddTargetCapability(
134        slang::ICompileRequest* request,
135        int targetIndex,
136        SlangCapabilityID capability);
137
138    /* DEPRECATED: use `spSetMatrixLayoutMode` instead. */
139    SLANG_API void spSetTargetMatrixLayoutMode(
140        SlangCompileRequest* request,
141        int targetIndex,
142        SlangMatrixLayoutMode mode);
143
144    /*! @see slang::ICompileRequest::setMatrixLayoutMode */
145    SLANG_API void spSetMatrixLayoutMode(SlangCompileRequest* request, SlangMatrixLayoutMode mode);
146
147    /*! @see slang::ICompileRequest::setDebugInfoLevel */
148    SLANG_API void spSetDebugInfoLevel(SlangCompileRequest* request, SlangDebugInfoLevel level);
149
150    /*! @see slang::ICompileRequest::setDebugInfoFormat */
151    SLANG_API void spSetDebugInfoFormat(SlangCompileRequest* request, SlangDebugInfoFormat format);
152
153    /*! @see slang::ICompileRequest::setOptimizationLevel */
154    SLANG_API void spSetOptimizationLevel(
155        SlangCompileRequest* request,
156        SlangOptimizationLevel level);
157
158
159    /*! @see slang::ICompileRequest::setOutputContainerFormat */
160    SLANG_API void spSetOutputContainerFormat(
161        SlangCompileRequest* request,
162        SlangContainerFormat format);
163
164    /*! @see slang::ICompileRequest::setPassThrough */
165    SLANG_API void spSetPassThrough(SlangCompileRequest* request, SlangPassThrough passThrough);
166
167    /*! @see slang::ICompileRequest::setDiagnosticCallback */
168    SLANG_API void spSetDiagnosticCallback(
169        SlangCompileRequest* request,
170        SlangDiagnosticCallback callback,
171        void const* userData);
172
173    /*! @see slang::ICompileRequest::setWriter */
174    SLANG_API void spSetWriter(
175        SlangCompileRequest* request,
176        SlangWriterChannel channel,
177        ISlangWriter* writer);
178
179    /*! @see slang::ICompileRequest::getWriter */
180    SLANG_API ISlangWriter* spGetWriter(SlangCompileRequest* request, SlangWriterChannel channel);
181
182    /*! @see slang::ICompileRequest::addSearchPath */
183    SLANG_API void spAddSearchPath(SlangCompileRequest* request, const char* searchDir);
184
185    /*! @see slang::ICompileRequest::addPreprocessorDefine */
186    SLANG_API void spAddPreprocessorDefine(
187        SlangCompileRequest* request,
188        const char* key,
189        const char* value);
190
191    /*! @see slang::ICompileRequest::processCommandLineArguments */
192    SLANG_API SlangResult spProcessCommandLineArguments(
193        SlangCompileRequest* request,
194        char const* const* args,
195        int argCount);
196
197    /*! @see slang::ICompileRequest::addTranslationUnit */
198    SLANG_API int spAddTranslationUnit(
199        SlangCompileRequest* request,
200        SlangSourceLanguage language,
201        char const* name);
202
203
204    /*! @see slang::ICompileRequest::setDefaultModuleName */
205    SLANG_API void spSetDefaultModuleName(
206        SlangCompileRequest* request,
207        const char* defaultModuleName);
208
209    /*! @see slang::ICompileRequest::addPreprocessorDefine */
210    SLANG_API void spTranslationUnit_addPreprocessorDefine(
211        SlangCompileRequest* request,
212        int translationUnitIndex,
213        const char* key,
214        const char* value);
215
216
217    /*! @see slang::ICompileRequest::addTranslationUnitSourceFile */
218    SLANG_API void spAddTranslationUnitSourceFile(
219        SlangCompileRequest* request,
220        int translationUnitIndex,
221        char const* path);
222
223    /*! @see slang::ICompileRequest::addTranslationUnitSourceString */
224    SLANG_API void spAddTranslationUnitSourceString(
225        SlangCompileRequest* request,
226        int translationUnitIndex,
227        char const* path,
228        char const* source);
229
230
231    /*! @see slang::ICompileRequest::addLibraryReference */
232    SLANG_API SlangResult spAddLibraryReference(
233        SlangCompileRequest* request,
234        const char* basePath,
235        const void* libData,
236        size_t libDataSize);
237
238    /*! @see slang::ICompileRequest::addTranslationUnitSourceStringSpan */
239    SLANG_API void spAddTranslationUnitSourceStringSpan(
240        SlangCompileRequest* request,
241        int translationUnitIndex,
242        char const* path,
243        char const* sourceBegin,
244        char const* sourceEnd);
245
246    /*! @see slang::ICompileRequest::addTranslationUnitSourceBlob */
247    SLANG_API void spAddTranslationUnitSourceBlob(
248        SlangCompileRequest* request,
249        int translationUnitIndex,
250        char const* path,
251        ISlangBlob* sourceBlob);
252
253    /*! @see slang::IGlobalSession::findProfile */
254    SLANG_API SlangProfileID spFindProfile(SlangSession* session, char const* name);
255
256    /*! @see slang::IGlobalSession::findCapability */
257    SLANG_API SlangCapabilityID spFindCapability(SlangSession* session, char const* name);
258
259    /*! @see slang::ICompileRequest::addEntryPoint */
260    SLANG_API int spAddEntryPoint(
261        SlangCompileRequest* request,
262        int translationUnitIndex,
263        char const* name,
264        SlangStage stage);
265
266    /*! @see slang::ICompileRequest::addEntryPointEx */
267    SLANG_API int spAddEntryPointEx(
268        SlangCompileRequest* request,
269        int translationUnitIndex,
270        char const* name,
271        SlangStage stage,
272        int genericArgCount,
273        char const** genericArgs);
274
275    /*! @see slang::ICompileRequest::setGlobalGenericArgs */
276    SLANG_API SlangResult spSetGlobalGenericArgs(
277        SlangCompileRequest* request,
278        int genericArgCount,
279        char const** genericArgs);
280
281    /*! @see slang::ICompileRequest::setTypeNameForGlobalExistentialTypeParam */
282    SLANG_API SlangResult spSetTypeNameForGlobalExistentialTypeParam(
283        SlangCompileRequest* request,
284        int slotIndex,
285        char const* typeName);
286
287    /*! @see slang::ICompileRequest::setTypeNameForEntryPointExistentialTypeParam */
288    SLANG_API SlangResult spSetTypeNameForEntryPointExistentialTypeParam(
289        SlangCompileRequest* request,
290        int entryPointIndex,
291        int slotIndex,
292        char const* typeName);
293
294    /*! @see slang::ICompileRequest::compile */
295    SLANG_API SlangResult spCompile(SlangCompileRequest* request);
296
297
298    /*! @see slang::ICompileRequest::getDiagnosticOutput */
299    SLANG_API char const* spGetDiagnosticOutput(SlangCompileRequest* request);
300
301    /*! @see slang::ICompileRequest::getDiagnosticOutputBlob */
302    SLANG_API SlangResult
303    spGetDiagnosticOutputBlob(SlangCompileRequest* request, ISlangBlob** outBlob);
304
305
306    /*! @see slang::ICompileRequest::getDependencyFileCount */
307    SLANG_API int spGetDependencyFileCount(SlangCompileRequest* request);
308
309    /*! @see slang::ICompileRequest::getDependencyFilePath */
310    SLANG_API char const* spGetDependencyFilePath(SlangCompileRequest* request, int index);
311
312    /*! @see slang::ICompileRequest::getTranslationUnitCount */
313    SLANG_API int spGetTranslationUnitCount(SlangCompileRequest* request);
314
315    /*! @see slang::ICompileRequest::getEntryPointSource */
316    SLANG_API char const* spGetEntryPointSource(SlangCompileRequest* request, int entryPointIndex);
317
318    /*! @see slang::ICompileRequest::getEntryPointCode */
319    SLANG_API void const* spGetEntryPointCode(
320        SlangCompileRequest* request,
321        int entryPointIndex,
322        size_t* outSize);
323
324    /*! @see slang::ICompileRequest::getEntryPointCodeBlob */
325    SLANG_API SlangResult spGetEntryPointCodeBlob(
326        SlangCompileRequest* request,
327        int entryPointIndex,
328        int targetIndex,
329        ISlangBlob** outBlob);
330
331    /*! @see slang::ICompileRequest::getEntryPointHostCallable */
332    SLANG_API SlangResult spGetEntryPointHostCallable(
333        SlangCompileRequest* request,
334        int entryPointIndex,
335        int targetIndex,
336        ISlangSharedLibrary** outSharedLibrary);
337
338    /*! @see slang::ICompileRequest::getTargetCodeBlob */
339    SLANG_API SlangResult
340    spGetTargetCodeBlob(SlangCompileRequest* request, int targetIndex, ISlangBlob** outBlob);
341
342    /*! @see slang::ICompileRequest::getTargetHostCallable */
343    SLANG_API SlangResult spGetTargetHostCallable(
344        SlangCompileRequest* request,
345        int targetIndex,
346        ISlangSharedLibrary** outSharedLibrary);
347
348    /*! @see slang::ICompileRequest::getCompileRequestCode */
349    SLANG_API void const* spGetCompileRequestCode(SlangCompileRequest* request, size_t* outSize);
350
351    /*! @see slang::ICompileRequest::getContainerCode */
352    SLANG_API SlangResult spGetContainerCode(SlangCompileRequest* request, ISlangBlob** outBlob);
353
354    /*! @see slang::ICompileRequest::loadRepro */
355    SLANG_API SlangResult spLoadRepro(
356        SlangCompileRequest* request,
357        ISlangFileSystem* fileSystem,
358        const void* data,
359        size_t size);
360
361    /*! @see slang::ICompileRequest::saveRepro */
362    SLANG_API SlangResult spSaveRepro(SlangCompileRequest* request, ISlangBlob** outBlob);
363
364    /*! @see slang::ICompileRequest::enableReproCapture */
365    SLANG_API SlangResult spEnableReproCapture(SlangCompileRequest* request);
366
367    /*! @see slang::ICompileRequest::getCompileTimeProfile */
368    SLANG_API SlangResult spGetCompileTimeProfile(
369        SlangCompileRequest* request,
370        ISlangProfiler** compileTimeProfile,
371        bool shouldClear);
372
373
374    /** Extract contents of a repro.
375
376    Writes the contained files and manifest with their 'unique' names into fileSystem. For more
377    details read the docs/repro.md documentation.
378
379    @param session          The slang session
380    @param reproData        Holds the repro data
381    @param reproDataSize    The size of the repro data
382    @param fileSystem       File system that the contents of the repro will be written to
383    @returns                A `SlangResult` to indicate success or failure.
384    */
385    SLANG_API SlangResult spExtractRepro(
386        SlangSession* session,
387        const void* reproData,
388        size_t reproDataSize,
389        ISlangMutableFileSystem* fileSystem);
390
391    /* Turns a repro into a file system.
392
393    Makes the contents of the repro available as a file system - that is able to access the files
394    with the same paths as were used on the original repro file system.
395
396    @param session          The slang session
397    @param reproData        The repro data
398    @param reproDataSize    The size of the repro data
399    @param replaceFileSystem  Will attempt to load by unique names from this file system before
400    using contents of the repro. Optional.
401    @param outFileSystem    The file system that can be used to access contents
402    @returns                A `SlangResult` to indicate success or failure.
403    */
404    SLANG_API SlangResult spLoadReproAsFileSystem(
405        SlangSession* session,
406        const void* reproData,
407        size_t reproDataSize,
408        ISlangFileSystem* replaceFileSystem,
409        ISlangFileSystemExt** outFileSystem);
410
411    /*! @see slang::ICompileRequest::overrideDiagnosticSeverity */
412    SLANG_API void spOverrideDiagnosticSeverity(
413        SlangCompileRequest* request,
414        SlangInt messageID,
415        SlangSeverity overrideSeverity);
416
417    /*! @see slang::ICompileRequest::getDiagnosticFlags */
418    SLANG_API SlangDiagnosticFlags spGetDiagnosticFlags(SlangCompileRequest* request);
419
420    /*! @see slang::ICompileRequest::setDiagnosticFlags */
421    SLANG_API void spSetDiagnosticFlags(SlangCompileRequest* request, SlangDiagnosticFlags flags);
422
423
424    // get reflection data from a compilation request
425    SLANG_API SlangReflection* spGetReflection(SlangCompileRequest* request);
426
427    // User Attribute
428    SLANG_API char const* spReflectionUserAttribute_GetName(SlangReflectionUserAttribute* attrib);
429    SLANG_API unsigned int spReflectionUserAttribute_GetArgumentCount(
430        SlangReflectionUserAttribute* attrib);
431    SLANG_API SlangReflectionType* spReflectionUserAttribute_GetArgumentType(
432        SlangReflectionUserAttribute* attrib,
433        unsigned int index);
434    SLANG_API SlangResult spReflectionUserAttribute_GetArgumentValueInt(
435        SlangReflectionUserAttribute* attrib,
436        unsigned int index,
437        int* rs);
438    SLANG_API SlangResult spReflectionUserAttribute_GetArgumentValueFloat(
439        SlangReflectionUserAttribute* attrib,
440        unsigned int index,
441        float* rs);
442
443    /** Returns the string-typed value of a user attribute argument
444        The string returned is not null-terminated. The length of the string is returned via
445       `outSize`. If index of out of range, or if the specified argument is not a string, the
446       function will return nullptr.
447    */
448    SLANG_API const char* spReflectionUserAttribute_GetArgumentValueString(
449        SlangReflectionUserAttribute* attrib,
450        unsigned int index,
451        size_t* outSize);
452
453    // Type Reflection
454
455    SLANG_API SlangTypeKind spReflectionType_GetKind(SlangReflectionType* type);
456    SLANG_API unsigned int spReflectionType_GetUserAttributeCount(SlangReflectionType* type);
457    SLANG_API SlangReflectionUserAttribute* spReflectionType_GetUserAttribute(
458        SlangReflectionType* type,
459        unsigned int index);
460    SLANG_API SlangReflectionUserAttribute* spReflectionType_FindUserAttributeByName(
461        SlangReflectionType* type,
462        char const* name);
463    SLANG_API SlangReflectionType* spReflectionType_applySpecializations(
464        SlangReflectionType* type,
465        SlangReflectionGeneric* generic);
466
467    SLANG_API unsigned int spReflectionType_GetFieldCount(SlangReflectionType* type);
468    SLANG_API SlangReflectionVariable* spReflectionType_GetFieldByIndex(
469        SlangReflectionType* type,
470        unsigned index);
471
472    /** Returns the number of elements in the given type.
473
474    This operation is valid for vector and array types. For other types it returns zero.
475
476    When invoked on an unbounded-size array it will return `SLANG_UNBOUNDED_SIZE`,
477    which is defined to be `~size_t(0)`.
478
479    If the size of a type cannot be statically computed, perhaps because it depends on
480    a generic parameter that has not been bound to a specific value, this function returns zero.
481
482    Use spReflectionType_GetSpecializedElementCount if the size is dependent on
483    a link time constant
484    */
485    SLANG_API size_t spReflectionType_GetElementCount(SlangReflectionType* type);
486
487    /** The same as spReflectionType_GetElementCount except it takes into account specialization
488     * information from the given reflection info
489     */
490    SLANG_API size_t spReflectionType_GetSpecializedElementCount(
491        SlangReflectionType* type,
492        SlangReflection* reflection);
493
494    SLANG_API SlangReflectionType* spReflectionType_GetElementType(SlangReflectionType* type);
495
496    SLANG_API unsigned int spReflectionType_GetRowCount(SlangReflectionType* type);
497    SLANG_API unsigned int spReflectionType_GetColumnCount(SlangReflectionType* type);
498    SLANG_API SlangScalarType spReflectionType_GetScalarType(SlangReflectionType* type);
499
500    SLANG_API SlangResourceShape spReflectionType_GetResourceShape(SlangReflectionType* type);
501    SLANG_API SlangResourceAccess spReflectionType_GetResourceAccess(SlangReflectionType* type);
502    SLANG_API SlangReflectionType* spReflectionType_GetResourceResultType(
503        SlangReflectionType* type);
504
505    SLANG_API char const* spReflectionType_GetName(SlangReflectionType* type);
506    SLANG_API SlangResult
507    spReflectionType_GetFullName(SlangReflectionType* type, ISlangBlob** outNameBlob);
508    SLANG_API SlangReflectionGeneric* spReflectionType_GetGenericContainer(
509        SlangReflectionType* type);
510
511    // Type Layout Reflection
512
513    SLANG_API SlangReflectionType* spReflectionTypeLayout_GetType(SlangReflectionTypeLayout* type);
514    SLANG_API SlangTypeKind spReflectionTypeLayout_getKind(SlangReflectionTypeLayout* type);
515    SLANG_API size_t spReflectionTypeLayout_GetSize(
516        SlangReflectionTypeLayout* type,
517        SlangParameterCategory category);
518    SLANG_API size_t spReflectionTypeLayout_GetStride(
519        SlangReflectionTypeLayout* type,
520        SlangParameterCategory category);
521    SLANG_API int32_t spReflectionTypeLayout_getAlignment(
522        SlangReflectionTypeLayout* type,
523        SlangParameterCategory category);
524
525    SLANG_API uint32_t spReflectionTypeLayout_GetFieldCount(SlangReflectionTypeLayout* type);
526    SLANG_API SlangReflectionVariableLayout* spReflectionTypeLayout_GetFieldByIndex(
527        SlangReflectionTypeLayout* type,
528        unsigned index);
529
530    SLANG_API SlangInt spReflectionTypeLayout_findFieldIndexByName(
531        SlangReflectionTypeLayout* typeLayout,
532        const char* nameBegin,
533        const char* nameEnd);
534
535    SLANG_API SlangReflectionVariableLayout* spReflectionTypeLayout_GetExplicitCounter(
536        SlangReflectionTypeLayout* typeLayout);
537
538    SLANG_API size_t spReflectionTypeLayout_GetElementStride(
539        SlangReflectionTypeLayout* type,
540        SlangParameterCategory category);
541    SLANG_API SlangReflectionTypeLayout* spReflectionTypeLayout_GetElementTypeLayout(
542        SlangReflectionTypeLayout* type);
543    SLANG_API SlangReflectionVariableLayout* spReflectionTypeLayout_GetElementVarLayout(
544        SlangReflectionTypeLayout* type);
545    SLANG_API SlangReflectionVariableLayout* spReflectionTypeLayout_getContainerVarLayout(
546        SlangReflectionTypeLayout* type);
547
548    SLANG_API SlangParameterCategory
549    spReflectionTypeLayout_GetParameterCategory(SlangReflectionTypeLayout* type);
550
551    SLANG_API unsigned spReflectionTypeLayout_GetCategoryCount(SlangReflectionTypeLayout* type);
552    SLANG_API SlangParameterCategory
553    spReflectionTypeLayout_GetCategoryByIndex(SlangReflectionTypeLayout* type, unsigned index);
554
555    SLANG_API SlangMatrixLayoutMode
556    spReflectionTypeLayout_GetMatrixLayoutMode(SlangReflectionTypeLayout* type);
557
558    SLANG_API int spReflectionTypeLayout_getGenericParamIndex(SlangReflectionTypeLayout* type);
559
560    SLANG_API SlangReflectionTypeLayout* spReflectionTypeLayout_getPendingDataTypeLayout(
561        SlangReflectionTypeLayout* type);
562
563    SLANG_API SlangReflectionVariableLayout*
564    spReflectionTypeLayout_getSpecializedTypePendingDataVarLayout(SlangReflectionTypeLayout* type);
565    SLANG_API SlangInt spReflectionType_getSpecializedTypeArgCount(SlangReflectionType* type);
566    SLANG_API SlangReflectionType* spReflectionType_getSpecializedTypeArgType(
567        SlangReflectionType* type,
568        SlangInt index);
569
570    SLANG_API SlangInt
571    spReflectionTypeLayout_getBindingRangeCount(SlangReflectionTypeLayout* typeLayout);
572    SLANG_API SlangBindingType spReflectionTypeLayout_getBindingRangeType(
573        SlangReflectionTypeLayout* typeLayout,
574        SlangInt index);
575    SLANG_API SlangInt spReflectionTypeLayout_isBindingRangeSpecializable(
576        SlangReflectionTypeLayout* typeLayout,
577        SlangInt index);
578    SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeBindingCount(
579        SlangReflectionTypeLayout* typeLayout,
580        SlangInt index);
581    SLANG_API SlangReflectionTypeLayout* spReflectionTypeLayout_getBindingRangeLeafTypeLayout(
582        SlangReflectionTypeLayout* typeLayout,
583        SlangInt index);
584    SLANG_API SlangReflectionVariable* spReflectionTypeLayout_getBindingRangeLeafVariable(
585        SlangReflectionTypeLayout* typeLayout,
586        SlangInt index);
587    SLANG_API SlangImageFormat spReflectionTypeLayout_getBindingRangeImageFormat(
588        SlangReflectionTypeLayout* typeLayout,
589        SlangInt index);
590    SLANG_API SlangInt spReflectionTypeLayout_getFieldBindingRangeOffset(
591        SlangReflectionTypeLayout* typeLayout,
592        SlangInt fieldIndex);
593    SLANG_API SlangInt spReflectionTypeLayout_getExplicitCounterBindingRangeOffset(
594        SlangReflectionTypeLayout* inTypeLayout);
595
596    SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeDescriptorSetIndex(
597        SlangReflectionTypeLayout* typeLayout,
598        SlangInt index);
599    SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeFirstDescriptorRangeIndex(
600        SlangReflectionTypeLayout* typeLayout,
601        SlangInt index);
602    SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeDescriptorRangeCount(
603        SlangReflectionTypeLayout* typeLayout,
604        SlangInt index);
605
606    SLANG_API SlangInt
607    spReflectionTypeLayout_getDescriptorSetCount(SlangReflectionTypeLayout* typeLayout);
608    SLANG_API SlangInt spReflectionTypeLayout_getDescriptorSetSpaceOffset(
609        SlangReflectionTypeLayout* typeLayout,
610        SlangInt setIndex);
611    SLANG_API SlangInt spReflectionTypeLayout_getDescriptorSetDescriptorRangeCount(
612        SlangReflectionTypeLayout* typeLayout,
613        SlangInt setIndex);
614    SLANG_API SlangInt spReflectionTypeLayout_getDescriptorSetDescriptorRangeIndexOffset(
615        SlangReflectionTypeLayout* typeLayout,
616        SlangInt setIndex,
617        SlangInt rangeIndex);
618    SLANG_API SlangInt spReflectionTypeLayout_getDescriptorSetDescriptorRangeDescriptorCount(
619        SlangReflectionTypeLayout* typeLayout,
620        SlangInt setIndex,
621        SlangInt rangeIndex);
622    SLANG_API SlangBindingType spReflectionTypeLayout_getDescriptorSetDescriptorRangeType(
623        SlangReflectionTypeLayout* typeLayout,
624        SlangInt setIndex,
625        SlangInt rangeIndex);
626    SLANG_API SlangParameterCategory spReflectionTypeLayout_getDescriptorSetDescriptorRangeCategory(
627        SlangReflectionTypeLayout* typeLayout,
628        SlangInt setIndex,
629        SlangInt rangeIndex);
630
631    SLANG_API SlangInt
632    spReflectionTypeLayout_getSubObjectRangeCount(SlangReflectionTypeLayout* typeLayout);
633    SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeBindingRangeIndex(
634        SlangReflectionTypeLayout* typeLayout,
635        SlangInt subObjectRangeIndex);
636    SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeSpaceOffset(
637        SlangReflectionTypeLayout* typeLayout,
638        SlangInt subObjectRangeIndex);
639    SLANG_API SlangReflectionVariableLayout* spReflectionTypeLayout_getSubObjectRangeOffset(
640        SlangReflectionTypeLayout* typeLayout,
641        SlangInt subObjectRangeIndex);
642
643#if 0
644    SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeCount(SlangReflectionTypeLayout* typeLayout);
645    SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeObjectCount(SlangReflectionTypeLayout* typeLayout, SlangInt index);
646    SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeBindingRangeIndex(SlangReflectionTypeLayout* typeLayout, SlangInt index);
647    SLANG_API SlangReflectionTypeLayout* spReflectionTypeLayout_getSubObjectRangeTypeLayout(SlangReflectionTypeLayout* typeLayout, SlangInt index);
648
649    SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeDescriptorRangeCount(SlangReflectionTypeLayout* typeLayout, SlangInt subObjectRangeIndex);
650    SLANG_API SlangBindingType spReflectionTypeLayout_getSubObjectRangeDescriptorRangeBindingType(SlangReflectionTypeLayout* typeLayout, SlangInt subObjectRangeIndex, SlangInt bindingRangeIndexInSubObject);
651    SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeDescriptorRangeBindingCount(SlangReflectionTypeLayout* typeLayout, SlangInt subObjectRangeIndex, SlangInt bindingRangeIndexInSubObject);
652    SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeDescriptorRangeIndexOffset(SlangReflectionTypeLayout* typeLayout, SlangInt subObjectRangeIndex, SlangInt bindingRangeIndexInSubObject);
653    SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeDescriptorRangeSpaceOffset(SlangReflectionTypeLayout* typeLayout, SlangInt subObjectRangeIndex, SlangInt bindingRangeIndexInSubObject);
654#endif
655
656    // Variable Reflection
657
658    SLANG_API char const* spReflectionVariable_GetName(SlangReflectionVariable* var);
659    SLANG_API SlangReflectionType* spReflectionVariable_GetType(SlangReflectionVariable* var);
660    SLANG_API SlangReflectionModifier* spReflectionVariable_FindModifier(
661        SlangReflectionVariable* var,
662        SlangModifierID modifierID);
663    SLANG_API unsigned int spReflectionVariable_GetUserAttributeCount(SlangReflectionVariable* var);
664    SLANG_API SlangReflectionUserAttribute* spReflectionVariable_GetUserAttribute(
665        SlangReflectionVariable* var,
666        unsigned int index);
667    SLANG_API SlangReflectionUserAttribute* spReflectionVariable_FindUserAttributeByName(
668        SlangReflectionVariable* var,
669        SlangSession* globalSession,
670        char const* name);
671    SLANG_API bool spReflectionVariable_HasDefaultValue(SlangReflectionVariable* inVar);
672    SLANG_API SlangResult
673    spReflectionVariable_GetDefaultValueInt(SlangReflectionVariable* inVar, int64_t* rs);
674    SLANG_API SlangReflectionGeneric* spReflectionVariable_GetGenericContainer(
675        SlangReflectionVariable* var);
676    SLANG_API SlangReflectionVariable* spReflectionVariable_applySpecializations(
677        SlangReflectionVariable* var,
678        SlangReflectionGeneric* generic);
679
680    // Variable Layout Reflection
681
682    SLANG_API SlangReflectionVariable* spReflectionVariableLayout_GetVariable(
683        SlangReflectionVariableLayout* var);
684
685    SLANG_API SlangReflectionTypeLayout* spReflectionVariableLayout_GetTypeLayout(
686        SlangReflectionVariableLayout* var);
687
688    SLANG_API size_t spReflectionVariableLayout_GetOffset(
689        SlangReflectionVariableLayout* var,
690        SlangParameterCategory category);
691    SLANG_API size_t spReflectionVariableLayout_GetSpace(
692        SlangReflectionVariableLayout* var,
693        SlangParameterCategory category);
694    SLANG_API SlangImageFormat
695    spReflectionVariableLayout_GetImageFormat(SlangReflectionVariableLayout* var);
696
697    SLANG_API char const* spReflectionVariableLayout_GetSemanticName(
698        SlangReflectionVariableLayout* var);
699    SLANG_API size_t
700    spReflectionVariableLayout_GetSemanticIndex(SlangReflectionVariableLayout* var);
701
702
703    // Function Reflection
704
705    SLANG_API SlangReflectionDecl* spReflectionFunction_asDecl(SlangReflectionFunction* func);
706    SLANG_API char const* spReflectionFunction_GetName(SlangReflectionFunction* func);
707    SLANG_API SlangReflectionModifier* spReflectionFunction_FindModifier(
708        SlangReflectionFunction* var,
709        SlangModifierID modifierID);
710    SLANG_API unsigned int spReflectionFunction_GetUserAttributeCount(
711        SlangReflectionFunction* func);
712    SLANG_API SlangReflectionUserAttribute* spReflectionFunction_GetUserAttribute(
713        SlangReflectionFunction* func,
714        unsigned int index);
715    SLANG_API SlangReflectionUserAttribute* spReflectionFunction_FindUserAttributeByName(
716        SlangReflectionFunction* func,
717        SlangSession* globalSession,
718        char const* name);
719    SLANG_API unsigned int spReflectionFunction_GetParameterCount(SlangReflectionFunction* func);
720    SLANG_API SlangReflectionVariable* spReflectionFunction_GetParameter(
721        SlangReflectionFunction* func,
722        unsigned index);
723    SLANG_API SlangReflectionType* spReflectionFunction_GetResultType(
724        SlangReflectionFunction* func);
725    SLANG_API SlangReflectionGeneric* spReflectionFunction_GetGenericContainer(
726        SlangReflectionFunction* func);
727    SLANG_API SlangReflectionFunction* spReflectionFunction_applySpecializations(
728        SlangReflectionFunction* func,
729        SlangReflectionGeneric* generic);
730    SLANG_API SlangReflectionFunction* spReflectionFunction_specializeWithArgTypes(
731        SlangReflectionFunction* func,
732        SlangInt argTypeCount,
733        SlangReflectionType* const* argTypes);
734    SLANG_API bool spReflectionFunction_isOverloaded(SlangReflectionFunction* func);
735    SLANG_API unsigned int spReflectionFunction_getOverloadCount(SlangReflectionFunction* func);
736    SLANG_API SlangReflectionFunction* spReflectionFunction_getOverload(
737        SlangReflectionFunction* func,
738        unsigned int index);
739
740    // Abstract Decl Reflection
741
742    SLANG_API unsigned int spReflectionDecl_getChildrenCount(SlangReflectionDecl* parentDecl);
743    SLANG_API SlangReflectionDecl* spReflectionDecl_getChild(
744        SlangReflectionDecl* parentDecl,
745        unsigned int index);
746    SLANG_API char const* spReflectionDecl_getName(SlangReflectionDecl* decl);
747    SLANG_API SlangDeclKind spReflectionDecl_getKind(SlangReflectionDecl* decl);
748    SLANG_API SlangReflectionFunction* spReflectionDecl_castToFunction(SlangReflectionDecl* decl);
749    SLANG_API SlangReflectionVariable* spReflectionDecl_castToVariable(SlangReflectionDecl* decl);
750    SLANG_API SlangReflectionGeneric* spReflectionDecl_castToGeneric(SlangReflectionDecl* decl);
751    SLANG_API SlangReflectionType* spReflection_getTypeFromDecl(SlangReflectionDecl* decl);
752    SLANG_API SlangReflectionDecl* spReflectionDecl_getParent(SlangReflectionDecl* decl);
753    SLANG_API SlangReflectionModifier* spReflectionDecl_findModifier(
754        SlangReflectionDecl* decl,
755        SlangModifierID modifierID);
756
757    // Generic Reflection
758
759    SLANG_API SlangReflectionDecl* spReflectionGeneric_asDecl(SlangReflectionGeneric* generic);
760    SLANG_API char const* spReflectionGeneric_GetName(SlangReflectionGeneric* generic);
761    SLANG_API unsigned int spReflectionGeneric_GetTypeParameterCount(
762        SlangReflectionGeneric* generic);
763    SLANG_API SlangReflectionVariable* spReflectionGeneric_GetTypeParameter(
764        SlangReflectionGeneric* generic,
765        unsigned index);
766    SLANG_API unsigned int spReflectionGeneric_GetValueParameterCount(
767        SlangReflectionGeneric* generic);
768    SLANG_API SlangReflectionVariable* spReflectionGeneric_GetValueParameter(
769        SlangReflectionGeneric* generic,
770        unsigned index);
771    SLANG_API unsigned int spReflectionGeneric_GetTypeParameterConstraintCount(
772        SlangReflectionGeneric* generic,
773        SlangReflectionVariable* typeParam);
774    SLANG_API SlangReflectionType* spReflectionGeneric_GetTypeParameterConstraintType(
775        SlangReflectionGeneric* generic,
776        SlangReflectionVariable* typeParam,
777        unsigned index);
778    SLANG_API SlangDeclKind spReflectionGeneric_GetInnerKind(SlangReflectionGeneric* generic);
779    SLANG_API SlangReflectionDecl* spReflectionGeneric_GetInnerDecl(
780        SlangReflectionGeneric* generic);
781    SLANG_API SlangReflectionGeneric* spReflectionGeneric_GetOuterGenericContainer(
782        SlangReflectionGeneric* generic);
783    SLANG_API SlangReflectionType* spReflectionGeneric_GetConcreteType(
784        SlangReflectionGeneric* generic,
785        SlangReflectionVariable* typeParam);
786    SLANG_API int64_t spReflectionGeneric_GetConcreteIntVal(
787        SlangReflectionGeneric* generic,
788        SlangReflectionVariable* valueParam);
789    SLANG_API SlangReflectionGeneric* spReflectionGeneric_applySpecializations(
790        SlangReflectionGeneric* currGeneric,
791        SlangReflectionGeneric* generic);
792
793
794    /** Get the stage that a variable belongs to (if any).
795
796    A variable "belongs" to a specific stage when it is a varying input/output
797    parameter either defined as part of the parameter list for an entry
798    point *or* at the global scope of a stage-specific GLSL code file (e.g.,
799    an `in` parameter in a GLSL `.vs` file belongs to the vertex stage).
800    */
801    SLANG_API SlangStage spReflectionVariableLayout_getStage(SlangReflectionVariableLayout* var);
802
803
804    SLANG_API SlangReflectionVariableLayout* spReflectionVariableLayout_getPendingDataLayout(
805        SlangReflectionVariableLayout* var);
806
807    // Shader Parameter Reflection
808
809    SLANG_API unsigned spReflectionParameter_GetBindingIndex(SlangReflectionParameter* parameter);
810    SLANG_API unsigned spReflectionParameter_GetBindingSpace(SlangReflectionParameter* parameter);
811
812    SLANG_API SlangResult spIsParameterLocationUsed(
813        SlangCompileRequest* request,
814        SlangInt entryPointIndex,
815        SlangInt targetIndex,
816        SlangParameterCategory category, // is this a `t` register? `s` register?
817        SlangUInt spaceIndex,            // `space` for D3D12, `set` for Vulkan
818        SlangUInt registerIndex,         // `register` for D3D12, `binding` for Vulkan
819        bool& outUsed);
820
821    // Entry Point Reflection
822
823    SLANG_API char const* spReflectionEntryPoint_getName(SlangReflectionEntryPoint* entryPoint);
824
825    SLANG_API char const* spReflectionEntryPoint_getNameOverride(
826        SlangReflectionEntryPoint* entryPoint);
827
828    SLANG_API SlangReflectionFunction* spReflectionEntryPoint_getFunction(
829        SlangReflectionEntryPoint* entryPoint);
830
831    SLANG_API unsigned spReflectionEntryPoint_getParameterCount(
832        SlangReflectionEntryPoint* entryPoint);
833
834    SLANG_API SlangReflectionVariableLayout* spReflectionEntryPoint_getParameterByIndex(
835        SlangReflectionEntryPoint* entryPoint,
836        unsigned index);
837
838    SLANG_API SlangStage spReflectionEntryPoint_getStage(SlangReflectionEntryPoint* entryPoint);
839
840    SLANG_API void spReflectionEntryPoint_getComputeThreadGroupSize(
841        SlangReflectionEntryPoint* entryPoint,
842        SlangUInt axisCount,
843        SlangUInt* outSizeAlongAxis);
844
845    SLANG_API void spReflectionEntryPoint_getComputeWaveSize(
846        SlangReflectionEntryPoint* entryPoint,
847        SlangUInt* outWaveSize);
848
849    SLANG_API int spReflectionEntryPoint_usesAnySampleRateInput(
850        SlangReflectionEntryPoint* entryPoint);
851
852    SLANG_API SlangReflectionVariableLayout* spReflectionEntryPoint_getVarLayout(
853        SlangReflectionEntryPoint* entryPoint);
854
855    SLANG_API SlangReflectionVariableLayout* spReflectionEntryPoint_getResultVarLayout(
856        SlangReflectionEntryPoint* entryPoint);
857
858    SLANG_API int spReflectionEntryPoint_hasDefaultConstantBuffer(
859        SlangReflectionEntryPoint* entryPoint);
860
861    // SlangReflectionTypeParameter
862    SLANG_API char const* spReflectionTypeParameter_GetName(
863        SlangReflectionTypeParameter* typeParam);
864    SLANG_API unsigned spReflectionTypeParameter_GetIndex(SlangReflectionTypeParameter* typeParam);
865    SLANG_API unsigned spReflectionTypeParameter_GetConstraintCount(
866        SlangReflectionTypeParameter* typeParam);
867    SLANG_API SlangReflectionType* spReflectionTypeParameter_GetConstraintByIndex(
868        SlangReflectionTypeParameter* typeParam,
869        unsigned int index);
870
871    // Shader Reflection
872
873    SLANG_API SlangResult spReflection_ToJson(
874        SlangReflection* reflection,
875        SlangCompileRequest* request,
876        ISlangBlob** outBlob);
877
878    SLANG_API unsigned spReflection_GetParameterCount(SlangReflection* reflection);
879    SLANG_API SlangReflectionParameter* spReflection_GetParameterByIndex(
880        SlangReflection* reflection,
881        unsigned index);
882
883    SLANG_API unsigned int spReflection_GetTypeParameterCount(SlangReflection* reflection);
884    SLANG_API SlangReflectionTypeParameter* spReflection_GetTypeParameterByIndex(
885        SlangReflection* reflection,
886        unsigned int index);
887    SLANG_API SlangReflectionTypeParameter* spReflection_FindTypeParameter(
888        SlangReflection* reflection,
889        char const* name);
890
891    SLANG_API SlangReflectionType* spReflection_FindTypeByName(
892        SlangReflection* reflection,
893        char const* name);
894    SLANG_API SlangReflectionTypeLayout* spReflection_GetTypeLayout(
895        SlangReflection* reflection,
896        SlangReflectionType* reflectionType,
897        SlangLayoutRules rules);
898
899    SLANG_API SlangReflectionFunction* spReflection_FindFunctionByName(
900        SlangReflection* reflection,
901        char const* name);
902    SLANG_API SlangReflectionFunction* spReflection_FindFunctionByNameInType(
903        SlangReflection* reflection,
904        SlangReflectionType* reflType,
905        char const* name);
906    SLANG_API SlangReflectionVariable* spReflection_FindVarByNameInType(
907        SlangReflection* reflection,
908        SlangReflectionType* reflType,
909        char const* name);
910    SLANG_API SlangReflectionFunction* spReflection_TryResolveOverloadedFunction(
911        SlangReflection* reflection,
912        uint32_t candidateCount,
913        SlangReflectionFunction** candidates);
914
915    SLANG_API SlangUInt spReflection_getEntryPointCount(SlangReflection* reflection);
916    SLANG_API SlangReflectionEntryPoint* spReflection_getEntryPointByIndex(
917        SlangReflection* reflection,
918        SlangUInt index);
919    SLANG_API SlangReflectionEntryPoint* spReflection_findEntryPointByName(
920        SlangReflection* reflection,
921        char const* name);
922
923    SLANG_API SlangUInt spReflection_getGlobalConstantBufferBinding(SlangReflection* reflection);
924    SLANG_API size_t spReflection_getGlobalConstantBufferSize(SlangReflection* reflection);
925
926    SLANG_API SlangReflectionType* spReflection_specializeType(
927        SlangReflection* reflection,
928        SlangReflectionType* type,
929        SlangInt specializationArgCount,
930        SlangReflectionType* const* specializationArgs,
931        ISlangBlob** outDiagnostics);
932
933    SLANG_API SlangReflectionGeneric* spReflection_specializeGeneric(
934        SlangReflection* inProgramLayout,
935        SlangReflectionGeneric* generic,
936        SlangInt argCount,
937        SlangReflectionGenericArgType const* argTypes,
938        SlangReflectionGenericArg const* args,
939        ISlangBlob** outDiagnostics);
940
941    SLANG_API bool spReflection_isSubType(
942        SlangReflection* reflection,
943        SlangReflectionType* subType,
944        SlangReflectionType* superType);
945
946    /// Get the number of hashed strings
947    SLANG_API SlangUInt spReflection_getHashedStringCount(SlangReflection* reflection);
948
949    /// Get a hashed string. The number of chars is written in outCount.
950    /// The count does *NOT* including terminating 0. The returned string will be 0 terminated.
951    SLANG_API const char* spReflection_getHashedString(
952        SlangReflection* reflection,
953        SlangUInt index,
954        size_t* outCount);
955
956    /// Compute a string hash.
957    /// Count should *NOT* include terminating zero.
958    SLANG_API SlangUInt32 spComputeStringHash(const char* chars, size_t count);
959
960    /// Get a type layout representing reflection information for the global-scope parameters.
961    SLANG_API SlangReflectionTypeLayout* spReflection_getGlobalParamsTypeLayout(
962        SlangReflection* reflection);
963
964    /// Get a variable layout representing reflection information for the global-scope parameters.
965    SLANG_API SlangReflectionVariableLayout* spReflection_getGlobalParamsVarLayout(
966        SlangReflection* reflection);
967
968    SLANG_API char const* spGetTranslationUnitSource(
969        SlangCompileRequest* request,
970        int translationUnitIndex);
971#ifdef __cplusplus
972}
973#endif
974
975#ifdef __cplusplus
976SLANG_API slang::ISession* spReflection_GetSession(SlangReflection* reflection);
977
978namespace slang
979{
980struct IComponentType;
981struct IModule;
982} // namespace slang
983
984extern "C"
985{
986    /** @see slang::ICompileRequest::getProgram
987     */
988    SLANG_API SlangResult
989    spCompileRequest_getProgram(SlangCompileRequest* request, slang::IComponentType** outProgram);
990
991    /** @see slang::ICompileRequest::getProgramWithEntryPoints
992     */
993    SLANG_API SlangResult spCompileRequest_getProgramWithEntryPoints(
994        SlangCompileRequest* request,
995        slang::IComponentType** outProgram);
996
997    /** @see slang::ICompileRequest::getEntryPoint
998     */
999    SLANG_API SlangResult spCompileRequest_getEntryPoint(
1000        SlangCompileRequest* request,
1001        SlangInt entryPointIndex,
1002        slang::IComponentType** outEntryPoint);
1003
1004    /** @see slang::ICompileRequest::getModule
1005     */
1006    SLANG_API SlangResult spCompileRequest_getModule(
1007        SlangCompileRequest* request,
1008        SlangInt translationUnitIndex,
1009        slang::IModule** outModule);
1010
1011    /** @see slang::ICompileRequest::getSession
1012     */
1013    SLANG_API SlangResult
1014    spCompileRequest_getSession(SlangCompileRequest* request, slang::ISession** outSession);
1015}
1016
1017namespace slang
1018{
1019/*!
1020@brief A request for one or more compilation actions to be performed.
1021*/
1022struct ICompileRequest : public ISlangUnknown
1023{
1024    SLANG_COM_INTERFACE(
1025        0x96d33993,
1026        0x317c,
1027        0x4db5,
1028        {0xaf, 0xd8, 0x66, 0x6e, 0xe7, 0x72, 0x48, 0xe2})
1029
1030    /** Set the filesystem hook to use for a compile request
1031
1032    The provided `fileSystem` will be used to load any files that
1033    need to be loaded during processing of the compile `request`.
1034    This includes:
1035
1036      - Source files loaded via `spAddTranslationUnitSourceFile`
1037      - Files referenced via `#include`
1038      - Files loaded to resolve `#import` operations
1039        */
1040    virtual SLANG_NO_THROW void SLANG_MCALL setFileSystem(ISlangFileSystem* fileSystem) = 0;
1041
1042    /*!
1043    @brief Set flags to be used for compilation.
1044    */
1045    virtual SLANG_NO_THROW void SLANG_MCALL setCompileFlags(SlangCompileFlags flags) = 0;
1046
1047    /*!
1048    @brief Returns the compilation flags previously set with `setCompileFlags`
1049    */
1050    virtual SLANG_NO_THROW SlangCompileFlags SLANG_MCALL getCompileFlags() = 0;
1051
1052    /*!
1053    @brief Set whether to dump intermediate results (for debugging) or not.
1054    */
1055    virtual SLANG_NO_THROW void SLANG_MCALL setDumpIntermediates(int enable) = 0;
1056
1057    virtual SLANG_NO_THROW void SLANG_MCALL setDumpIntermediatePrefix(const char* prefix) = 0;
1058
1059    /*!
1060    @brief Set whether (and how) `#line` directives should be output.
1061    */
1062    virtual SLANG_NO_THROW void SLANG_MCALL setLineDirectiveMode(SlangLineDirectiveMode mode) = 0;
1063
1064    /*!
1065    @brief Sets the target for code generation.
1066    @param target The code generation target. Possible values are:
1067    - SLANG_GLSL. Generates GLSL code.
1068    - SLANG_HLSL. Generates HLSL code.
1069    - SLANG_SPIRV. Generates SPIR-V code.
1070    */
1071    virtual SLANG_NO_THROW void SLANG_MCALL setCodeGenTarget(SlangCompileTarget target) = 0;
1072
1073    /*!
1074    @brief Add a code-generation target to be used.
1075    */
1076    virtual SLANG_NO_THROW int SLANG_MCALL addCodeGenTarget(SlangCompileTarget target) = 0;
1077
1078    virtual SLANG_NO_THROW void SLANG_MCALL
1079    setTargetProfile(int targetIndex, SlangProfileID profile) = 0;
1080
1081    virtual SLANG_NO_THROW void SLANG_MCALL
1082    setTargetFlags(int targetIndex, SlangTargetFlags flags) = 0;
1083
1084    /*!
1085    @brief Set the floating point mode (e.g., precise or fast) to use a target.
1086    */
1087    virtual SLANG_NO_THROW void SLANG_MCALL
1088    setTargetFloatingPointMode(int targetIndex, SlangFloatingPointMode mode) = 0;
1089
1090    /* DEPRECATED: use `spSetMatrixLayoutMode` instead. */
1091    virtual SLANG_NO_THROW void SLANG_MCALL
1092    setTargetMatrixLayoutMode(int targetIndex, SlangMatrixLayoutMode mode) = 0;
1093
1094    virtual SLANG_NO_THROW void SLANG_MCALL setMatrixLayoutMode(SlangMatrixLayoutMode mode) = 0;
1095
1096    /*!
1097    @brief Set the level of debug information to produce.
1098    */
1099    virtual SLANG_NO_THROW void SLANG_MCALL setDebugInfoLevel(SlangDebugInfoLevel level) = 0;
1100
1101    /*!
1102    @brief Set the level of optimization to perform.
1103    */
1104    virtual SLANG_NO_THROW void SLANG_MCALL setOptimizationLevel(SlangOptimizationLevel level) = 0;
1105
1106
1107    /*!
1108    @brief Set the container format to be used for binary output.
1109    */
1110    virtual SLANG_NO_THROW void SLANG_MCALL
1111    setOutputContainerFormat(SlangContainerFormat format) = 0;
1112
1113    virtual SLANG_NO_THROW void SLANG_MCALL setPassThrough(SlangPassThrough passThrough) = 0;
1114
1115
1116    virtual SLANG_NO_THROW void SLANG_MCALL
1117    setDiagnosticCallback(SlangDiagnosticCallback callback, void const* userData) = 0;
1118
1119    virtual SLANG_NO_THROW void SLANG_MCALL
1120    setWriter(SlangWriterChannel channel, ISlangWriter* writer) = 0;
1121
1122    virtual SLANG_NO_THROW ISlangWriter* SLANG_MCALL getWriter(SlangWriterChannel channel) = 0;
1123
1124    /*!
1125    @brief Add a path to use when searching for referenced files.
1126    This will be used for both `#include` directives and also for explicit `__import` declarations.
1127    @param ctx The compilation context.
1128    @param searchDir The additional search directory.
1129    */
1130    virtual SLANG_NO_THROW void SLANG_MCALL addSearchPath(const char* searchDir) = 0;
1131
1132    /*!
1133    @brief Add a macro definition to be used during preprocessing.
1134    @param key The name of the macro to define.
1135    @param value The value of the macro to define.
1136    */
1137    virtual SLANG_NO_THROW void SLANG_MCALL
1138    addPreprocessorDefine(const char* key, const char* value) = 0;
1139
1140    /*!
1141    @brief Set options using arguments as if specified via command line.
1142    @return Returns SlangResult. On success SLANG_SUCCEEDED(result) is true.
1143    */
1144    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1145    processCommandLineArguments(char const* const* args, int argCount) = 0;
1146
1147    /** Add a distinct translation unit to the compilation request
1148
1149    `name` is optional.
1150    Returns the zero-based index of the translation unit created.
1151    */
1152    virtual SLANG_NO_THROW int SLANG_MCALL
1153    addTranslationUnit(SlangSourceLanguage language, char const* name) = 0;
1154
1155
1156    /** Set a default module name. Translation units will default to this module name if one is not
1157    passed. If not set each translation unit will get a unique name.
1158    */
1159    virtual SLANG_NO_THROW void SLANG_MCALL setDefaultModuleName(const char* defaultModuleName) = 0;
1160
1161    /** Add a preprocessor definition that is scoped to a single translation unit.
1162
1163    @param translationUnitIndex The index of the translation unit to get the definition.
1164    @param key The name of the macro to define.
1165    @param value The value of the macro to define.
1166    */
1167    virtual SLANG_NO_THROW void SLANG_MCALL addTranslationUnitPreprocessorDefine(
1168        int translationUnitIndex,
1169        const char* key,
1170        const char* value) = 0;
1171
1172
1173    /** Add a source file to the given translation unit.
1174
1175    If a user-defined file system has been specified via
1176    `spSetFileSystem`, then it will be used to load the
1177    file at `path`. Otherwise, Slang will use the OS
1178    file system.
1179
1180    This function does *not* search for a file using
1181    the registered search paths (`spAddSearchPath`),
1182    and instead using the given `path` as-is.
1183    */
1184    virtual SLANG_NO_THROW void SLANG_MCALL
1185    addTranslationUnitSourceFile(int translationUnitIndex, char const* path) = 0;
1186
1187    /** Add a source string to the given translation unit.
1188
1189    @param translationUnitIndex The index of the translation unit to add source to.
1190    @param path The file-system path that should be assumed for the source code.
1191    @param source A null-terminated UTF-8 encoded string of source code.
1192
1193    The implementation will make a copy of the source code data.
1194    An application may free the buffer immediately after this call returns.
1195
1196    The `path` will be used in any diagnostic output, as well
1197    as to determine the base path when resolving relative
1198    `#include`s.
1199    */
1200    virtual SLANG_NO_THROW void SLANG_MCALL addTranslationUnitSourceString(
1201        int translationUnitIndex,
1202        char const* path,
1203        char const* source) = 0;
1204
1205
1206    /** Add a slang library - such that its contents can be referenced during linking.
1207    This is equivalent to the -r command line option.
1208
1209    @param basePath The base path used to lookup referenced modules.
1210    @param libData The library data
1211    @param libDataSize The size of the library data
1212    */
1213    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1214    addLibraryReference(const char* basePath, const void* libData, size_t libDataSize) = 0;
1215
1216    /** Add a source string to the given translation unit.
1217
1218    @param translationUnitIndex The index of the translation unit to add source to.
1219    @param path The file-system path that should be assumed for the source code.
1220    @param sourceBegin A pointer to a buffer of UTF-8 encoded source code.
1221    @param sourceEnd A pointer to to the end of the buffer specified in `sourceBegin`
1222
1223    The implementation will make a copy of the source code data.
1224    An application may free the buffer immediately after this call returns.
1225
1226    The `path` will be used in any diagnostic output, as well
1227    as to determine the base path when resolving relative
1228    `#include`s.
1229    */
1230    virtual SLANG_NO_THROW void SLANG_MCALL addTranslationUnitSourceStringSpan(
1231        int translationUnitIndex,
1232        char const* path,
1233        char const* sourceBegin,
1234        char const* sourceEnd) = 0;
1235
1236    /** Add a blob of source code to the given translation unit.
1237
1238    @param translationUnitIndex The index of the translation unit to add source to.
1239    @param path The file-system path that should be assumed for the source code.
1240    @param sourceBlob A blob containing UTF-8 encoded source code.
1241    @param sourceEnd A pointer to to the end of the buffer specified in `sourceBegin`
1242
1243    The compile request will retain a reference to the blob.
1244
1245    The `path` will be used in any diagnostic output, as well
1246    as to determine the base path when resolving relative
1247    `#include`s.
1248    */
1249    virtual SLANG_NO_THROW void SLANG_MCALL addTranslationUnitSourceBlob(
1250        int translationUnitIndex,
1251        char const* path,
1252        ISlangBlob* sourceBlob) = 0;
1253
1254    /** Add an entry point in a particular translation unit
1255     */
1256    virtual SLANG_NO_THROW int SLANG_MCALL
1257    addEntryPoint(int translationUnitIndex, char const* name, SlangStage stage) = 0;
1258
1259    /** Add an entry point in a particular translation unit,
1260        with additional arguments that specify the concrete
1261        type names for entry-point generic type parameters.
1262    */
1263    virtual SLANG_NO_THROW int SLANG_MCALL addEntryPointEx(
1264        int translationUnitIndex,
1265        char const* name,
1266        SlangStage stage,
1267        int genericArgCount,
1268        char const** genericArgs) = 0;
1269
1270    /** Specify the arguments to use for global generic parameters.
1271     */
1272    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1273    setGlobalGenericArgs(int genericArgCount, char const** genericArgs) = 0;
1274
1275    /** Specify the concrete type to be used for a global "existential slot."
1276
1277    Every shader parameter (or leaf field of a `struct`-type shader parameter)
1278    that has an interface or array-of-interface type introduces an existential
1279    slot. The number of slots consumed by a shader parameter, and the starting
1280    slot of each parameter can be queried via the reflection API using
1281    `SLANG_PARAMETER_CATEGORY_EXISTENTIAL_TYPE_PARAM`.
1282
1283    In order to generate specialized code, a concrete type needs to be specified
1284    for each existential slot. This function specifies the name of the type
1285    (or in general a type *expression*) to use for a specific slot at the
1286    global scope.
1287    */
1288    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1289    setTypeNameForGlobalExistentialTypeParam(int slotIndex, char const* typeName) = 0;
1290
1291    /** Specify the concrete type to be used for an entry-point "existential slot."
1292
1293    Every shader parameter (or leaf field of a `struct`-type shader parameter)
1294    that has an interface or array-of-interface type introduces an existential
1295    slot. The number of slots consumed by a shader parameter, and the starting
1296    slot of each parameter can be queried via the reflection API using
1297    `SLANG_PARAMETER_CATEGORY_EXISTENTIAL_TYPE_PARAM`.
1298
1299    In order to generate specialized code, a concrete type needs to be specified
1300    for each existential slot. This function specifies the name of the type
1301    (or in general a type *expression*) to use for a specific slot at the
1302    entry-point scope.
1303    */
1304    virtual SLANG_NO_THROW SlangResult SLANG_MCALL setTypeNameForEntryPointExistentialTypeParam(
1305        int entryPointIndex,
1306        int slotIndex,
1307        char const* typeName) = 0;
1308
1309    /** Enable or disable an experimental, best-effort GLSL frontend
1310     */
1311    virtual SLANG_NO_THROW void SLANG_MCALL setAllowGLSLInput(bool value) = 0;
1312
1313    /** Execute the compilation request.
1314
1315    @returns  SlangResult, SLANG_OK on success. Use SLANG_SUCCEEDED() and SLANG_FAILED() to test
1316    SlangResult.
1317    */
1318    virtual SLANG_NO_THROW SlangResult SLANG_MCALL compile() = 0;
1319
1320
1321    /** Get any diagnostic messages reported by the compiler.
1322
1323    @returns A null-terminated UTF-8 encoded string of diagnostic messages.
1324
1325    The returned pointer is only guaranteed to be valid
1326    until `request` is destroyed. Applications that wish to
1327    hold on to the diagnostic output for longer should use
1328    `getDiagnosticOutputBlob`.
1329    */
1330    virtual SLANG_NO_THROW char const* SLANG_MCALL getDiagnosticOutput() = 0;
1331
1332    /** Get diagnostic messages reported by the compiler.
1333
1334    @param outBlob A pointer to receive a blob holding a nul-terminated UTF-8 encoded string of
1335    diagnostic messages.
1336    @returns A `SlangResult` indicating success or failure.
1337    */
1338    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1339    getDiagnosticOutputBlob(ISlangBlob** outBlob) = 0;
1340
1341
1342    /** Get the number of files that this compilation depended on.
1343
1344    This includes both the explicit source files, as well as any
1345    additional files that were transitively referenced (e.g., via
1346    a `#include` directive).
1347    */
1348    virtual SLANG_NO_THROW int SLANG_MCALL getDependencyFileCount() = 0;
1349
1350    /** Get the path to a file this compilation depended on.
1351     */
1352    virtual SLANG_NO_THROW char const* SLANG_MCALL getDependencyFilePath(int index) = 0;
1353
1354    /** Get the number of translation units associated with the compilation request
1355     */
1356    virtual SLANG_NO_THROW int SLANG_MCALL getTranslationUnitCount() = 0;
1357
1358    /** Get the output source code associated with a specific entry point.
1359
1360    The lifetime of the output pointer is the same as `request`.
1361    */
1362    virtual SLANG_NO_THROW char const* SLANG_MCALL getEntryPointSource(int entryPointIndex) = 0;
1363
1364    /** Get the output bytecode associated with a specific entry point.
1365
1366    The lifetime of the output pointer is the same as `request`.
1367    */
1368    virtual SLANG_NO_THROW void const* SLANG_MCALL
1369    getEntryPointCode(int entryPointIndex, size_t* outSize) = 0;
1370
1371    /** Get the output code associated with a specific entry point.
1372
1373    @param entryPointIndex The index of the entry point to get code for.
1374    @param targetIndex The index of the target to get code for (default: zero).
1375    @param outBlob A pointer that will receive the blob of code
1376    @returns A `SlangResult` to indicate success or failure.
1377    */
1378    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1379    getEntryPointCodeBlob(int entryPointIndex, int targetIndex, ISlangBlob** outBlob) = 0;
1380
1381    /** Get entry point 'callable' functions accessible through the ISlangSharedLibrary interface.
1382
1383    That the functions remain in scope as long as the ISlangSharedLibrary interface is in scope.
1384
1385    NOTE! Requires a compilation target of SLANG_HOST_CALLABLE.
1386
1387    @param entryPointIndex  The index of the entry point to get code for.
1388    @param targetIndex      The index of the target to get code for (default: zero).
1389    @param outSharedLibrary A pointer to a ISharedLibrary interface which functions can be queried
1390    on.
1391    @returns                A `SlangResult` to indicate success or failure.
1392    */
1393    virtual SLANG_NO_THROW SlangResult SLANG_MCALL getEntryPointHostCallable(
1394        int entryPointIndex,
1395        int targetIndex,
1396        ISlangSharedLibrary** outSharedLibrary) = 0;
1397
1398    /** Get the output code associated with a specific target.
1399
1400    @param targetIndex The index of the target to get code for (default: zero).
1401    @param outBlob A pointer that will receive the blob of code
1402    @returns A `SlangResult` to indicate success or failure.
1403    */
1404    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1405    getTargetCodeBlob(int targetIndex, ISlangBlob** outBlob) = 0;
1406
1407    /** Get 'callable' functions for a target accessible through the ISlangSharedLibrary interface.
1408
1409    That the functions remain in scope as long as the ISlangSharedLibrary interface is in scope.
1410
1411    NOTE! Requires a compilation target of SLANG_HOST_CALLABLE.
1412
1413    @param targetIndex      The index of the target to get code for (default: zero).
1414    @param outSharedLibrary A pointer to a ISharedLibrary interface which functions can be queried
1415    on.
1416    @returns                A `SlangResult` to indicate success or failure.
1417    */
1418    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1419    getTargetHostCallable(int targetIndex, ISlangSharedLibrary** outSharedLibrary) = 0;
1420
1421    /** Get the output bytecode associated with an entire compile request.
1422
1423    The lifetime of the output pointer is the same as `request` and the last spCompile.
1424
1425    @param outSize          The size of the containers contents in bytes. Will be zero if there is
1426    no code available.
1427    @returns                Pointer to start of the contained data, or nullptr if there is no code
1428    available.
1429    */
1430    virtual SLANG_NO_THROW void const* SLANG_MCALL getCompileRequestCode(size_t* outSize) = 0;
1431
1432    /** Get the compilation result as a file system.
1433    The result is not written to the actual OS file system, but is made available as an
1434    in memory representation.
1435    */
1436    virtual SLANG_NO_THROW ISlangMutableFileSystem* SLANG_MCALL
1437    getCompileRequestResultAsFileSystem() = 0;
1438
1439    /** Return the container code as a blob. The container blob is created as part of a compilation
1440    (with spCompile), and a container is produced with a suitable ContainerFormat.
1441
1442    @param outSize          The blob containing the container data.
1443    @returns                A `SlangResult` to indicate success or failure.
1444    */
1445    virtual SLANG_NO_THROW SlangResult SLANG_MCALL getContainerCode(ISlangBlob** outBlob) = 0;
1446
1447    /** Load repro from memory specified.
1448
1449    Should only be performed on a newly created request.
1450
1451    NOTE! When using the fileSystem, files will be loaded via their `unique names` as if they are
1452    part of the flat file system. This mechanism is described more fully in docs/repro.md.
1453
1454    @param fileSystem       An (optional) filesystem. Pass nullptr to just use contents of repro
1455    held in data.
1456    @param data             The data to load from.
1457    @param size             The size of the data to load from.
1458    @returns                A `SlangResult` to indicate success or failure.
1459    */
1460    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1461    loadRepro(ISlangFileSystem* fileSystem, const void* data, size_t size) = 0;
1462
1463    /** Save repro state. Should *typically* be performed after spCompile, so that everything
1464    that is needed for a compilation is available.
1465
1466    @param outBlob          Blob that will hold the serialized state
1467    @returns                A `SlangResult` to indicate success or failure.
1468    */
1469    virtual SLANG_NO_THROW SlangResult SLANG_MCALL saveRepro(ISlangBlob** outBlob) = 0;
1470
1471    /** Enable repro capture.
1472
1473    Should be set after any ISlangFileSystem has been set, but before any compilation. It ensures
1474    that everything that the ISlangFileSystem accesses will be correctly recorded. Note that if a
1475    ISlangFileSystem/ISlangFileSystemExt isn't explicitly set (ie the default is used), then the
1476    request will automatically be set up to record everything appropriate.
1477
1478    @returns                A `SlangResult` to indicate success or failure.
1479    */
1480    virtual SLANG_NO_THROW SlangResult SLANG_MCALL enableReproCapture() = 0;
1481
1482    /** Get the (linked) program for a compile request.
1483
1484    The linked program will include all of the global-scope modules for the
1485    translation units in the program, plus any modules that they `import`
1486    (transitively), specialized to any global specialization arguments that
1487    were provided via the API.
1488    */
1489    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1490    getProgram(slang::IComponentType** outProgram) = 0;
1491
1492    /** Get the (partially linked) component type for an entry point.
1493
1494    The returned component type will include the entry point at the
1495    given index, and will be specialized using any specialization arguments
1496    that were provided for it via the API.
1497
1498    The returned component will *not* include the modules representing
1499    the global scope and its dependencies/specialization, so a client
1500    program will typically want to compose this component type with
1501    the one returned by `spCompileRequest_getProgram` to get a complete
1502    and usable component type from which kernel code can be requested.
1503    */
1504    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1505    getEntryPoint(SlangInt entryPointIndex, slang::IComponentType** outEntryPoint) = 0;
1506
1507    /** Get the (un-linked) module for a translation unit.
1508
1509    The returned module will not be linked against any dependencies,
1510    nor against any entry points (even entry points declared inside
1511    the module). Similarly, the module will not be specialized
1512    to the arguments that might have been provided via the API.
1513
1514    This function provides an atomic unit of loaded code that
1515    is suitable for looking up types and entry points in the
1516    given module, and for linking together to produce a composite
1517    program that matches the needs of an application.
1518    */
1519    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1520    getModule(SlangInt translationUnitIndex, slang::IModule** outModule) = 0;
1521
1522    /** Get the `ISession` handle behind the `SlangCompileRequest`.
1523    TODO(JS): Arguably this should just return the session pointer.
1524    */
1525    virtual SLANG_NO_THROW SlangResult SLANG_MCALL getSession(slang::ISession** outSession) = 0;
1526
1527    /** get reflection data from a compilation request */
1528    virtual SLANG_NO_THROW SlangReflection* SLANG_MCALL getReflection() = 0;
1529
1530    /** Make output specially handled for command line output */
1531    virtual SLANG_NO_THROW void SLANG_MCALL setCommandLineCompilerMode() = 0;
1532
1533    /** Add a defined capability that should be assumed available on the target */
1534    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1535    addTargetCapability(SlangInt targetIndex, SlangCapabilityID capability) = 0;
1536
1537    /** Get the (linked) program for a compile request, including all entry points.
1538
1539    The resulting program will include all of the global-scope modules for the
1540    translation units in the program, plus any modules that they `import`
1541    (transitively), specialized to any global specialization arguments that
1542    were provided via the API, as well as all entry points specified for compilation,
1543    specialized to their entry-point specialization arguments.
1544    */
1545    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1546    getProgramWithEntryPoints(slang::IComponentType** outProgram) = 0;
1547
1548    virtual SLANG_NO_THROW SlangResult SLANG_MCALL isParameterLocationUsed(
1549        SlangInt entryPointIndex,
1550        SlangInt targetIndex,
1551        SlangParameterCategory category,
1552        SlangUInt spaceIndex,
1553        SlangUInt registerIndex,
1554        bool& outUsed) = 0;
1555
1556    /** Set the line directive mode for a target.
1557     */
1558    virtual SLANG_NO_THROW void SLANG_MCALL
1559    setTargetLineDirectiveMode(SlangInt targetIndex, SlangLineDirectiveMode mode) = 0;
1560
1561    /** Set whether to use scalar buffer layouts for GLSL/Vulkan targets.
1562        If true, the generated GLSL/Vulkan code will use `scalar` layout for storage buffers.
1563        If false, the resulting code will std430 for storage buffers.
1564    */
1565    virtual SLANG_NO_THROW void SLANG_MCALL
1566    setTargetForceGLSLScalarBufferLayout(int targetIndex, bool forceScalarLayout) = 0;
1567
1568    /** Overrides the severity of a specific diagnostic message.
1569
1570    @param messageID            Numeric identifier of the message to override,
1571                                as defined in the 1st parameter of the DIAGNOSTIC macro.
1572    @param overrideSeverity     New severity of the message. If the message is originally Error or
1573    Fatal, the new severity cannot be lower than that.
1574    */
1575    virtual SLANG_NO_THROW void SLANG_MCALL
1576    overrideDiagnosticSeverity(SlangInt messageID, SlangSeverity overrideSeverity) = 0;
1577
1578    /** Returns the currently active flags of the request's diagnostic sink. */
1579    virtual SLANG_NO_THROW SlangDiagnosticFlags SLANG_MCALL getDiagnosticFlags() = 0;
1580
1581    /** Sets the flags of the request's diagnostic sink.
1582        The previously specified flags are discarded. */
1583    virtual SLANG_NO_THROW void SLANG_MCALL setDiagnosticFlags(SlangDiagnosticFlags flags) = 0;
1584
1585    /** Set the debug format to be used for debugging information */
1586    virtual SLANG_NO_THROW void SLANG_MCALL
1587    setDebugInfoFormat(SlangDebugInfoFormat debugFormat) = 0;
1588
1589    virtual SLANG_NO_THROW void SLANG_MCALL setEnableEffectAnnotations(bool value) = 0;
1590
1591    virtual SLANG_NO_THROW void SLANG_MCALL setReportDownstreamTime(bool value) = 0;
1592
1593    virtual SLANG_NO_THROW void SLANG_MCALL setReportPerfBenchmark(bool value) = 0;
1594
1595    virtual SLANG_NO_THROW void SLANG_MCALL setSkipSPIRVValidation(bool value) = 0;
1596
1597    virtual SLANG_NO_THROW void SLANG_MCALL
1598    setTargetUseMinimumSlangOptimization(int targetIndex, bool value) = 0;
1599
1600    virtual SLANG_NO_THROW void SLANG_MCALL setIgnoreCapabilityCheck(bool value) = 0;
1601
1602    // return a copy of internal profiling results, and if `shouldClear` is true, clear the internal
1603    // profiling results before returning.
1604    virtual SLANG_NO_THROW SlangResult SLANG_MCALL
1605    getCompileTimeProfile(ISlangProfiler** compileTimeProfile, bool shouldClear) = 0;
1606
1607    virtual SLANG_NO_THROW void SLANG_MCALL
1608    setTargetGenerateWholeProgram(int targetIndex, bool value) = 0;
1609
1610    virtual SLANG_NO_THROW void SLANG_MCALL setTargetForceDXLayout(int targetIndex, bool value) = 0;
1611
1612    virtual SLANG_NO_THROW void SLANG_MCALL
1613    setTargetEmbedDownstreamIR(int targetIndex, bool value) = 0;
1614
1615    virtual SLANG_NO_THROW void SLANG_MCALL setTargetForceCLayout(int targetIndex, bool value) = 0;
1616};
1617
1618    #define SLANG_UUID_ICompileRequest ICompileRequest::getTypeGuid()
1619
1620} // namespace slang
1621#endif