yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
a5e6ddd00
master
1#ifndef DECODER_CONSUMER_H 2#define DECODER_CONSUMER_H 3 4#include "../../core/slang-stream.h" 5#include "../util/record-format.h" 6#include "../util/record-utility.h" 7#include "slang.h" 8 9namespace SlangRecord 10{ 11class IDecoderConsumer 12{ 13public : 14virtual void CreateGlobalSession ( 15SlangGlobalSessionDesc const & desc , 16ObjectID outGlobalSessionId )= 0 ; 17virtual void IGlobalSession_createSession ( 18ObjectID objectId , 19slang ::SessionDesc const & desc , 20ObjectID outSessionId )= 0 ; 21virtual void IGlobalSession_findProfile (ObjectID objectId ,char const * name )= 0 ; 22virtual void IGlobalSession_setDownstreamCompilerPath ( 23ObjectID objectId , 24SlangPassThrough passThrough , 25char const * path )= 0 ; 26virtual void IGlobalSession_setDownstreamCompilerPrelude ( 27ObjectID objectId , 28SlangPassThrough inPassThrough , 29char const * prelude )= 0 ; 30virtual void IGlobalSession_getDownstreamCompilerPrelude ( 31ObjectID objectId , 32SlangPassThrough inPassThrough , 33ObjectID outPreludeId )= 0 ; 34 35virtual void IGlobalSession_getBuildTagString (ObjectID objectId ) { (void )objectId ; } 36 37virtual void IGlobalSession_setDefaultDownstreamCompiler ( 38ObjectID objectId , 39SlangSourceLanguage sourceLanguage , 40SlangPassThrough defaultCompiler )= 0 ; 41virtual void IGlobalSession_getDefaultDownstreamCompiler ( 42ObjectID objectId , 43SlangSourceLanguage sourceLanguage )= 0 ; 44virtual void IGlobalSession_setLanguagePrelude ( 45ObjectID objectId , 46SlangSourceLanguage inSourceLanguage , 47char const * prelude )= 0 ; 48virtual void IGlobalSession_getLanguagePrelude ( 49ObjectID objectId , 50SlangSourceLanguage inSourceLanguage , 51ObjectID outPreludeId )= 0 ; 52virtual void IGlobalSession_createCompileRequest ( 53ObjectID objectId , 54ObjectID outCompileRequest )= 0 ; 55virtual void IGlobalSession_addBuiltins ( 56ObjectID objectId , 57char const * sourcePath , 58char const * sourceString )= 0 ; 59virtual void IGlobalSession_setSharedLibraryLoader (ObjectID objectId ,ObjectID loaderId )= 0 ; 60virtual void IGlobalSession_getSharedLibraryLoader (ObjectID objectId ,ObjectID outLoaderId )= 0 ; 61virtual void IGlobalSession_checkCompileTargetSupport ( 62ObjectID objectId , 63SlangCompileTarget target )= 0 ; 64virtual void IGlobalSession_checkPassThroughSupport ( 65ObjectID objectId , 66SlangPassThrough passThrough )= 0 ; 67virtual void IGlobalSession_compileCoreModule ( 68ObjectID objectId , 69slang ::CompileCoreModuleFlags flags )= 0 ; 70virtual void IGlobalSession_loadCoreModule ( 71ObjectID objectId , 72const void * coreModule , 73size_t coreModuleSizeInBytes )= 0 ; 74virtual void IGlobalSession_saveCoreModule ( 75ObjectID objectId , 76SlangArchiveType archiveType , 77ObjectID outBlobId )= 0 ; 78virtual void IGlobalSession_findCapability (ObjectID objectId ,char const * name )= 0 ; 79virtual void IGlobalSession_setDownstreamCompilerForTransition ( 80ObjectID objectId , 81SlangCompileTarget source , 82SlangCompileTarget target , 83SlangPassThrough compiler )= 0 ; 84virtual void IGlobalSession_getDownstreamCompilerForTransition ( 85ObjectID objectId , 86SlangCompileTarget source , 87SlangCompileTarget target )= 0 ; 88 89virtual void IGlobalSession_getCompilerElapsedTime (ObjectID objectId ) { (void )objectId ; } 90 91virtual void IGlobalSession_setSPIRVCoreGrammar (ObjectID objectId ,char const * jsonPath )= 0 ; 92virtual void IGlobalSession_parseCommandLineArguments ( 93ObjectID objectId , 94int argc , 95const char * const * argv , 96ObjectID outSessionDescId , 97ObjectID outAllocationId )= 0 ; 98virtual void IGlobalSession_getSessionDescDigest ( 99ObjectID objectId , 100slang ::SessionDesc * sessionDesc , 101ObjectID outBlobId )= 0 ; 102 103// ISession 104virtual void ISession_getGlobalSession (ObjectID objectId ,ObjectID outGlobalSessionId )= 0 ; 105virtual void ISession_loadModule ( 106ObjectID objectId , 107const char * moduleName , 108ObjectID outDiagnostics , 109ObjectID outModuleId )= 0 ; 110 111virtual void ISession_loadModuleFromIRBlob ( 112ObjectID objectId , 113const char * moduleName , 114const char * path , 115slang ::IBlob * source , 116ObjectID outDiagnosticsId , 117ObjectID outModuleId )= 0 ; 118virtual void ISession_loadModuleFromSource ( 119ObjectID objectId , 120const char * moduleName , 121const char * path , 122slang ::IBlob * source , 123ObjectID outDiagnosticsId , 124ObjectID outModuleId )= 0 ; 125virtual void ISession_loadModuleFromSourceString ( 126ObjectID objectId , 127const char * moduleName , 128const char * path , 129const char * string , 130ObjectID outDiagnosticsId , 131ObjectID outModuleId )= 0 ; 132virtual void ISession_createCompositeComponentType ( 133ObjectID objectId , 134ObjectID * componentTypeIds , 135SlangInt componentTypeCount , 136ObjectID outCompositeComponentTypeIds , 137ObjectID outDiagnosticsId )= 0 ; 138 139virtual void ISession_specializeType ( 140ObjectID objectId , 141ObjectID typeId , 142slang ::SpecializationArg const * specializationArgs , 143SlangInt specializationArgCount , 144ObjectID outDiagnosticsId , 145ObjectID outTypeReflectionId )= 0 ; 146 147virtual void ISession_getTypeLayout ( 148ObjectID objectId , 149ObjectID typeId , 150SlangInt targetIndex , 151slang ::LayoutRules rules , 152ObjectID outDiagnosticsId , 153ObjectID outTypeLayoutReflection )= 0 ; 154 155virtual void ISession_getContainerType ( 156ObjectID objectId , 157ObjectID elementType , 158slang ::ContainerType containerType , 159ObjectID outDiagnosticsId , 160ObjectID outTypeReflectionId )= 0 ; 161 162virtual void ISession_getDynamicType (ObjectID objectId ,ObjectID outTypeReflectionId )= 0 ; 163 164virtual void ISession_getTypeRTTIMangledName ( 165ObjectID objectId , 166ObjectID typeId , 167ObjectID outNameBlobId )= 0 ; 168 169virtual void ISession_getTypeConformanceWitnessMangledName ( 170ObjectID objectId , 171ObjectID typeId , 172ObjectID interfaceTypeId , 173ObjectID outNameBlobId )= 0 ; 174 175virtual void ISession_getTypeConformanceWitnessSequentialID ( 176ObjectID objectId , 177ObjectID typeId , 178ObjectID interfaceTypeId , 179uint32_t outId )= 0 ; 180 181virtual void ISession_createTypeConformanceComponentType ( 182ObjectID objectId , 183ObjectID typeId , 184ObjectID interfaceTypeId , 185ObjectID outConformanceId , 186SlangInt conformanceIdOverride , 187ObjectID outDiagnosticsId )= 0 ; 188 189virtual void ISession_createCompileRequest (ObjectID objectId ,ObjectID outCompileRequestId )= 0 ; 190 191virtual void ISession_getLoadedModuleCount (ObjectID objectId ) { (void )objectId ; } 192 193virtual void ISession_getLoadedModule ( 194ObjectID objectId , 195SlangInt index , 196ObjectID outModuleId )= 0 ; 197 198virtual void ISession_isBinaryModuleUpToDate (ObjectID objectId ) { (void )objectId ; } 199 200// IModule 201virtual void IModule_findEntryPointByName ( 202ObjectID objectId , 203char const * name , 204ObjectID outEntryPointId )= 0 ; 205 206virtual void IModule_getDefinedEntryPointCount (ObjectID objectId ) { (void )objectId ; } 207 208virtual void IModule_getDefinedEntryPoint ( 209ObjectID objectId , 210SlangInt32 index , 211ObjectID outEntryPointId )= 0 ; 212virtual void IModule_serialize (ObjectID objectId ,ObjectID outSerializedBlobId )= 0 ; 213virtual void IModule_writeToFile (ObjectID objectId ,char const * fileName )= 0 ; 214 215virtual void IModule_getName (ObjectID objectId ) { (void )objectId ; } 216virtual void IModule_getFilePath (ObjectID objectId ) { (void )objectId ; } 217virtual void IModule_getUniqueIdentity (ObjectID objectId ) { (void )objectId ; } 218 219virtual void IModule_findAndCheckEntryPoint ( 220ObjectID objectId , 221char const * name , 222SlangStage stage , 223ObjectID outEntryPointId , 224ObjectID outDiagnostics )= 0 ; 225 226virtual void IModule_getSession (ObjectID objectId ,ObjectID outSessionId )= 0 ; 227virtual void IModule_getLayout ( 228ObjectID objectId , 229SlangInt targetIndex , 230ObjectID outDiagnosticsId , 231ObjectID retProgramLayoutId )= 0 ; 232 233virtual void IModule_getSpecializationParamCount (ObjectID objectId ) { (void )objectId ; } 234 235virtual void IModule_getEntryPointCode ( 236ObjectID objectId , 237SlangInt entryPointIndex , 238SlangInt targetIndex , 239ObjectID outCodeId , 240ObjectID outDiagnosticsId )= 0 ; 241virtual void IModule_getTargetCode ( 242ObjectID objectId , 243SlangInt targetIndex , 244ObjectID outCodeId , 245ObjectID outDiagnosticsId )= 0 ; 246virtual void IModule_getResultAsFileSystem ( 247ObjectID objectId , 248SlangInt entryPointIndex , 249SlangInt targetIndex , 250ObjectID outFileSystem )= 0 ; 251virtual void IModule_getEntryPointHash ( 252ObjectID objectId , 253SlangInt entryPointIndex , 254SlangInt targetIndex , 255ObjectID outHashId )= 0 ; 256virtual void IModule_specialize ( 257ObjectID objectId , 258slang ::SpecializationArg const * specializationArgs , 259SlangInt specializationArgCount , 260ObjectID outSpecializedComponentTypeId , 261ObjectID outDiagnosticsId )= 0 ; 262virtual void IModule_link ( 263ObjectID objectId , 264ObjectID outLinkedComponentTypeId , 265ObjectID outDiagnosticsId )= 0 ; 266virtual void IModule_getEntryPointHostCallable ( 267ObjectID objectId , 268int entryPointIndex , 269int targetIndex , 270ObjectID outSharedLibrary , 271ObjectID outDiagnostics )= 0 ; 272virtual void IModule_renameEntryPoint ( 273ObjectID objectId , 274const char * newName , 275ObjectID outEntryPointId )= 0 ; 276virtual void IModule_linkWithOptions ( 277ObjectID objectId , 278ObjectID outLinkedComponentTypeId , 279uint32_t compilerOptionEntryCount , 280slang ::CompilerOptionEntry * compilerOptionEntries , 281ObjectID outDiagnosticsId )= 0 ; 282 283// IEntryPoint 284virtual void IEntryPoint_getSession (ObjectID objectId ,ObjectID outSessionId )= 0 ; 285virtual void IEntryPoint_getLayout ( 286ObjectID objectId , 287SlangInt targetIndex , 288ObjectID outDiagnosticsId , 289ObjectID retProgramLayoutId )= 0 ; 290 291virtual void IEntryPoint_getSpecializationParamCount (ObjectID objectId ) { (void )objectId ; }; 292 293virtual void IEntryPoint_getEntryPointCode ( 294ObjectID objectId , 295SlangInt entryPointIndex , 296SlangInt targetIndex , 297ObjectID outCodeId , 298ObjectID outDiagnosticsId )= 0 ; 299virtual void IEntryPoint_getTargetCode ( 300ObjectID objectId , 301SlangInt targetIndex , 302ObjectID outCodeId , 303ObjectID outDiagnosticsId )= 0 ; 304virtual void IEntryPoint_getResultAsFileSystem ( 305ObjectID objectId , 306SlangInt entryPointIndex , 307SlangInt targetIndex , 308ObjectID outFileSystem )= 0 ; 309virtual void IEntryPoint_getEntryPointHash ( 310ObjectID objectId , 311SlangInt entryPointIndex , 312SlangInt targetIndex , 313ObjectID outHashId )= 0 ; 314virtual void IEntryPoint_specialize ( 315ObjectID objectId , 316slang ::SpecializationArg const * specializationArgs , 317SlangInt specializationArgCount , 318ObjectID outSpecializedComponentTypeId , 319ObjectID outDiagnosticsId )= 0 ; 320virtual void IEntryPoint_link ( 321ObjectID objectId , 322ObjectID outLinkedComponentTypeId , 323ObjectID outDiagnosticsId )= 0 ; 324virtual void IEntryPoint_getEntryPointHostCallable ( 325ObjectID objectId , 326int entryPointIndex , 327int targetIndex , 328ObjectID outSharedLibrary , 329ObjectID outDiagnostics )= 0 ; 330virtual void IEntryPoint_renameEntryPoint ( 331ObjectID objectId , 332const char * newName , 333ObjectID outEntryPointId )= 0 ; 334virtual void IEntryPoint_linkWithOptions ( 335ObjectID objectId , 336ObjectID outLinkedComponentTypeId , 337uint32_t compilerOptionEntryCount , 338slang ::CompilerOptionEntry * compilerOptionEntries , 339ObjectID outDiagnosticsId )= 0 ; 340 341// ICompositeComponentType 342virtual void ICompositeComponentType_getSession (ObjectID objectId ,ObjectID outSessionId )= 0 ; 343virtual void ICompositeComponentType_getLayout ( 344ObjectID objectId , 345SlangInt targetIndex , 346ObjectID outDiagnosticsId , 347ObjectID retProgramLayoutId )= 0 ; 348 349virtual void ICompositeComponentType_getSpecializationParamCount (ObjectID objectId ) 350 { 351 (void )objectId ; 352 }; 353 354virtual void ICompositeComponentType_getEntryPointCode ( 355ObjectID objectId , 356SlangInt entryPointIndex , 357SlangInt targetIndex , 358ObjectID outCodeId , 359ObjectID outDiagnosticsId )= 0 ; 360virtual void ICompositeComponentType_getTargetCode ( 361ObjectID objectId , 362SlangInt targetIndex , 363ObjectID outCodeId , 364ObjectID outDiagnosticsId )= 0 ; 365virtual void ICompositeComponentType_getResultAsFileSystem ( 366ObjectID objectId , 367SlangInt entryPointIndex , 368SlangInt targetIndex , 369ObjectID outFileSystem )= 0 ; 370virtual void ICompositeComponentType_getEntryPointHash ( 371ObjectID objectId , 372SlangInt entryPointIndex , 373SlangInt targetIndex , 374ObjectID outHashId )= 0 ; 375virtual void ICompositeComponentType_specialize ( 376ObjectID objectId , 377slang ::SpecializationArg const * specializationArgs , 378SlangInt specializationArgCount , 379ObjectID outSpecializedComponentTypeId , 380ObjectID outDiagnosticsId )= 0 ; 381virtual void ICompositeComponentType_link ( 382ObjectID objectId , 383ObjectID outLinkedComponentTypeId , 384ObjectID outDiagnosticsId )= 0 ; 385virtual void ICompositeComponentType_getEntryPointHostCallable ( 386ObjectID objectId , 387int entryPointIndex , 388int targetIndex , 389ObjectID outSharedLibrary , 390ObjectID outDiagnostics )= 0 ; 391virtual void ICompositeComponentType_renameEntryPoint ( 392ObjectID objectId , 393const char * newName , 394ObjectID outEntryPointId )= 0 ; 395virtual void ICompositeComponentType_linkWithOptions ( 396ObjectID objectId , 397ObjectID outLinkedComponentTypeId , 398uint32_t compilerOptionEntryCount , 399slang ::CompilerOptionEntry * compilerOptionEntries , 400ObjectID outDiagnosticsId )= 0 ; 401 402virtual void ICompositeComponentType_queryInterface ( 403ObjectID objectId , 404const SlangUUID & guid , 405ObjectID outInterfaceId )= 0 ; 406 407// ITypeConformance 408virtual void ITypeConformance_getSession (ObjectID objectId ,ObjectID outSessionId )= 0 ; 409virtual void ITypeConformance_getLayout ( 410ObjectID objectId , 411SlangInt targetIndex , 412ObjectID outDiagnosticsId , 413ObjectID retProgramLayoutId )= 0 ; 414 415virtual void ITypeConformance_getSpecializationParamCount (ObjectID objectId ) 416 { 417 (void )objectId ; 418 }; 419 420virtual void ITypeConformance_getEntryPointCode ( 421ObjectID objectId , 422SlangInt entryPointIndex , 423SlangInt targetIndex , 424ObjectID outCodeId , 425ObjectID outDiagnosticsId )= 0 ; 426virtual void ITypeConformance_getTargetCode ( 427ObjectID objectId , 428SlangInt targetIndex , 429ObjectID outCodeId , 430ObjectID outDiagnosticsId )= 0 ; 431virtual void ITypeConformance_getResultAsFileSystem ( 432ObjectID objectId , 433SlangInt entryPointIndex , 434SlangInt targetIndex , 435ObjectID outFileSystem )= 0 ; 436virtual void ITypeConformance_getEntryPointHash ( 437ObjectID objectId , 438SlangInt entryPointIndex , 439SlangInt targetIndex , 440ObjectID outHashId )= 0 ; 441virtual void ITypeConformance_specialize ( 442ObjectID objectId , 443slang ::SpecializationArg const * specializationArgs , 444SlangInt specializationArgCount , 445ObjectID outSpecializedComponentTypeId , 446ObjectID outDiagnosticsId )= 0 ; 447virtual void ITypeConformance_link ( 448ObjectID objectId , 449ObjectID outLinkedComponentTypeId , 450ObjectID outDiagnosticsId )= 0 ; 451virtual void ITypeConformance_getEntryPointHostCallable ( 452ObjectID objectId , 453int entryPointIndex , 454int targetIndex , 455ObjectID outSharedLibrary , 456ObjectID outDiagnostics )= 0 ; 457virtual void ITypeConformance_renameEntryPoint ( 458ObjectID objectId , 459const char * newName , 460ObjectID outEntryPointId )= 0 ; 461virtual void ITypeConformance_linkWithOptions ( 462ObjectID objectId , 463ObjectID outLinkedComponentTypeId , 464uint32_t compilerOptionEntryCount , 465slang ::CompilerOptionEntry * compilerOptionEntries , 466ObjectID outDiagnosticsId )= 0 ; 467 468// IComponentType2 methods. 469virtual void IComponentType2_getTargetCompileResult ( 470ObjectID objectId , 471SlangInt targetIndex , 472ObjectID outCompileResultId , 473ObjectID outDiagnosticsId )= 0 ; 474virtual void IComponentType2_getEntryPointCompileResult ( 475ObjectID objectId , 476SlangInt entryPointIndex , 477SlangInt targetIndex , 478ObjectID outCompileResultId , 479ObjectID outDiagnosticsIdId )= 0 ; 480}; 481}// namespace SlangRecord 482 483 484#endif // DECODER_CONSUMER_H