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