yum-mirror/slang

Making it easier to work with shaders

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

jarcherNVAdd record and replay support for IComponentType2 (#8215)a5e6ddd00

master
101.2 KiB3278 linesraw
1#include "slang-decoder.h"
2
3#include "../util/record-utility.h"
4#include "decoder-helper.h"
5#include "parameter-decoder.h"
6
7namespace SlangRecord
8{
9
10bool SlangDecoder::processMethodCall(
11    FunctionHeader const& header,
12    ParameterBlock const& parameterBlock)
13{
14    ApiClassId classId = static_cast<ApiClassId>(getClassId(header.callId));
15    ObjectID objectId = header.handleId;
16    switch (classId)
17    {
18    default:
19        slangRecordLog(LogLevel::Error, "Unhandled Slang Class Id: %d\n", classId);
20        return false;
21    case ApiClassId::Class_IGlobalSession:
22        return processIGlobalSessionMethods(header.callId, objectId, parameterBlock);
23        break;
24    case ApiClassId::Class_ISession:
25        return processISessionMethods(header.callId, objectId, parameterBlock);
26        break;
27    case ApiClassId::Class_IModule:
28        return processIModuleMethods(header.callId, objectId, parameterBlock);
29        break;
30    case ApiClassId::Class_IEntryPoint:
31        return processIEntryPointMethods(header.callId, objectId, parameterBlock);
32        break;
33    case ApiClassId::Class_ICompositeComponentType:
34        return processICompositeComponentTypeMethods(header.callId, objectId, parameterBlock);
35        break;
36    case ApiClassId::Class_ITypeConformance:
37        return processITypeConformanceMethods(header.callId, objectId, parameterBlock);
38        break;
39    }
40}
41
42bool SlangDecoder::processIGlobalSessionMethods(
43    ApiCallId callId,
44    ObjectID objectId,
45    ParameterBlock const& parameterBlock)
46{
47    switch (callId)
48    {
49    default:
50        slangRecordLog(LogLevel::Error, "Unhandled Slang API call: %d\n", callId);
51        break;
52    case ApiCallId::IGlobalSession_createSession:
53        IGlobalSession_createSession(objectId, parameterBlock);
54        break;
55    case ApiCallId::IGlobalSession_findProfile:
56        IGlobalSession_findProfile(objectId, parameterBlock);
57        break;
58    case ApiCallId::IGlobalSession_setDownstreamCompilerPath:
59        IGlobalSession_setDownstreamCompilerPath(objectId, parameterBlock);
60        break;
61    case ApiCallId::IGlobalSession_setDownstreamCompilerPrelude:
62        IGlobalSession_setDownstreamCompilerPrelude(objectId, parameterBlock);
63        break;
64    case ApiCallId::IGlobalSession_getDownstreamCompilerPrelude:
65        IGlobalSession_getDownstreamCompilerPrelude(objectId, parameterBlock);
66        break;
67    case ApiCallId::IGlobalSession_getBuildTagString:
68        IGlobalSession_getBuildTagString(objectId, parameterBlock);
69        break;
70    case ApiCallId::IGlobalSession_setDefaultDownstreamCompiler:
71        IGlobalSession_setDefaultDownstreamCompiler(objectId, parameterBlock);
72        break;
73    case ApiCallId::IGlobalSession_getDefaultDownstreamCompiler:
74        IGlobalSession_getDefaultDownstreamCompiler(objectId, parameterBlock);
75        break;
76    case ApiCallId::IGlobalSession_setLanguagePrelude:
77        IGlobalSession_setLanguagePrelude(objectId, parameterBlock);
78        break;
79    case ApiCallId::IGlobalSession_getLanguagePrelude:
80        IGlobalSession_getLanguagePrelude(objectId, parameterBlock);
81        break;
82    case ApiCallId::IGlobalSession_createCompileRequest:
83        IGlobalSession_createCompileRequest(objectId, parameterBlock);
84        break;
85    case ApiCallId::IGlobalSession_addBuiltins:
86        IGlobalSession_addBuiltins(objectId, parameterBlock);
87        break;
88    case ApiCallId::IGlobalSession_setSharedLibraryLoader:
89        IGlobalSession_setSharedLibraryLoader(objectId, parameterBlock);
90        break;
91    case ApiCallId::IGlobalSession_getSharedLibraryLoader:
92        IGlobalSession_getSharedLibraryLoader(objectId, parameterBlock);
93        break;
94    case ApiCallId::IGlobalSession_checkCompileTargetSupport:
95        IGlobalSession_checkCompileTargetSupport(objectId, parameterBlock);
96        break;
97    case ApiCallId::IGlobalSession_checkPassThroughSupport:
98        IGlobalSession_checkPassThroughSupport(objectId, parameterBlock);
99        break;
100    case ApiCallId::IGlobalSession_compileCoreModule:
101        IGlobalSession_compileCoreModule(objectId, parameterBlock);
102        break;
103    case ApiCallId::IGlobalSession_loadCoreModule:
104        IGlobalSession_loadCoreModule(objectId, parameterBlock);
105        break;
106    case ApiCallId::IGlobalSession_saveCoreModule:
107        IGlobalSession_saveCoreModule(objectId, parameterBlock);
108        break;
109    case ApiCallId::IGlobalSession_findCapability:
110        IGlobalSession_findCapability(objectId, parameterBlock);
111        break;
112    case ApiCallId::IGlobalSession_setDownstreamCompilerForTransition:
113        IGlobalSession_setDownstreamCompilerForTransition(objectId, parameterBlock);
114        break;
115    case ApiCallId::IGlobalSession_getDownstreamCompilerForTransition:
116        IGlobalSession_getDownstreamCompilerForTransition(objectId, parameterBlock);
117        break;
118    case ApiCallId::IGlobalSession_getCompilerElapsedTime:
119        IGlobalSession_getCompilerElapsedTime(objectId, parameterBlock);
120        break;
121    case ApiCallId::IGlobalSession_setSPIRVCoreGrammar:
122        IGlobalSession_setSPIRVCoreGrammar(objectId, parameterBlock);
123        break;
124    case ApiCallId::IGlobalSession_parseCommandLineArguments:
125        IGlobalSession_parseCommandLineArguments(objectId, parameterBlock);
126        break;
127    case ApiCallId::IGlobalSession_getSessionDescDigest:
128        IGlobalSession_getSessionDescDigest(objectId, parameterBlock);
129        break;
130    }
131    return true;
132}
133
134
135bool SlangDecoder::processISessionMethods(
136    ApiCallId callId,
137    ObjectID objectId,
138    ParameterBlock const& parameterBlock)
139{
140    switch (callId)
141    {
142    default:
143        slangRecordLog(LogLevel::Error, "Unhandled Slang API call: %d\n", callId);
144        return false;
145    case ApiCallId::ISession_getGlobalSession:
146        ISession_getGlobalSession(objectId, parameterBlock);
147        break;
148    case ApiCallId::ISession_loadModule:
149        ISession_loadModule(objectId, parameterBlock);
150        break;
151    case ApiCallId::ISession_loadModuleFromIRBlob:
152        ISession_loadModuleFromIRBlob(objectId, parameterBlock);
153        break;
154    case ApiCallId::ISession_loadModuleFromSource:
155        ISession_loadModuleFromSource(objectId, parameterBlock);
156        break;
157    case ApiCallId::ISession_loadModuleFromSourceString:
158        ISession_loadModuleFromSourceString(objectId, parameterBlock);
159        break;
160    case ApiCallId::ISession_createCompositeComponentType:
161        ISession_createCompositeComponentType(objectId, parameterBlock);
162        break;
163    case ApiCallId::ISession_specializeType:
164        ISession_specializeType(objectId, parameterBlock);
165        break;
166    case ApiCallId::ISession_getTypeLayout:
167        ISession_getTypeLayout(objectId, parameterBlock);
168        break;
169    case ApiCallId::ISession_getContainerType:
170        ISession_getContainerType(objectId, parameterBlock);
171        break;
172    case ApiCallId::ISession_getDynamicType:
173        ISession_getDynamicType(objectId, parameterBlock);
174        break;
175    case ApiCallId::ISession_getTypeRTTIMangledName:
176        ISession_getTypeRTTIMangledName(objectId, parameterBlock);
177        break;
178    case ApiCallId::ISession_getTypeConformanceWitnessMangledName:
179        ISession_getTypeConformanceWitnessMangledName(objectId, parameterBlock);
180        break;
181    case ApiCallId::ISession_getTypeConformanceWitnessSequentialID:
182        ISession_getTypeConformanceWitnessSequentialID(objectId, parameterBlock);
183        break;
184    case ApiCallId::ISession_createTypeConformanceComponentType:
185        ISession_createTypeConformanceComponentType(objectId, parameterBlock);
186        break;
187    case ApiCallId::ISession_createCompileRequest:
188        ISession_createCompileRequest(objectId, parameterBlock);
189        break;
190    case ApiCallId::ISession_getLoadedModuleCount:
191        ISession_getLoadedModuleCount(objectId, parameterBlock);
192        break;
193    case ApiCallId::ISession_getLoadedModule:
194        ISession_getLoadedModule(objectId, parameterBlock);
195        break;
196    case ApiCallId::ISession_isBinaryModuleUpToDate:
197        ISession_isBinaryModuleUpToDate(objectId, parameterBlock);
198        break;
199    }
200    return true;
201}
202
203bool SlangDecoder::processIModuleMethods(
204    ApiCallId callId,
205    ObjectID objectId,
206    ParameterBlock const& parameterBlock)
207{
208    switch (callId)
209    {
210    default:
211        slangRecordLog(LogLevel::Error, "Unhandled Slang API call: %d\n", callId);
212        return false;
213    case ApiCallId::IModule_findEntryPointByName:
214        IModule_findEntryPointByName(objectId, parameterBlock);
215        break;
216    case ApiCallId::IModule_getDefinedEntryPointCount:
217        IModule_getDefinedEntryPointCount(objectId, parameterBlock);
218        break;
219    case ApiCallId::IModule_getDefinedEntryPoint:
220        IModule_getDefinedEntryPoint(objectId, parameterBlock);
221        break;
222    case ApiCallId::IModule_serialize:
223        IModule_serialize(objectId, parameterBlock);
224        break;
225    case ApiCallId::IModule_writeToFile:
226        IModule_writeToFile(objectId, parameterBlock);
227        break;
228    case ApiCallId::IModule_getName:
229        IModule_getName(objectId, parameterBlock);
230        break;
231    case ApiCallId::IModule_getFilePath:
232        IModule_getFilePath(objectId, parameterBlock);
233        break;
234    case ApiCallId::IModule_getUniqueIdentity:
235        IModule_getUniqueIdentity(objectId, parameterBlock);
236        break;
237    case ApiCallId::IModule_findAndCheckEntryPoint:
238        IModule_findAndCheckEntryPoint(objectId, parameterBlock);
239        break;
240    case ApiCallId::IModule_getSession:
241        IModule_getSession(objectId, parameterBlock);
242        break;
243    case ApiCallId::IModule_getLayout:
244        IModule_getLayout(objectId, parameterBlock);
245        break;
246    case ApiCallId::IModule_getSpecializationParamCount:
247        IModule_getSpecializationParamCount(objectId, parameterBlock);
248        break;
249    case ApiCallId::IModule_getEntryPointCode:
250        IModule_getEntryPointCode(objectId, parameterBlock);
251        break;
252    case ApiCallId::IModule_getTargetCode:
253        IModule_getTargetCode(objectId, parameterBlock);
254        break;
255    case ApiCallId::IModule_getResultAsFileSystem:
256        IModule_getResultAsFileSystem(objectId, parameterBlock);
257        break;
258    case ApiCallId::IModule_getEntryPointHash:
259        IModule_getEntryPointHash(objectId, parameterBlock);
260        break;
261    case ApiCallId::IModule_specialize:
262        IModule_specialize(objectId, parameterBlock);
263        break;
264    case ApiCallId::IModule_link:
265        IModule_link(objectId, parameterBlock);
266        break;
267    case ApiCallId::IModule_getEntryPointHostCallable:
268        IModule_getEntryPointHostCallable(objectId, parameterBlock);
269        break;
270    case ApiCallId::IModule_renameEntryPoint:
271        IModule_renameEntryPoint(objectId, parameterBlock);
272        break;
273    case ApiCallId::IModule_linkWithOptions:
274        IModule_linkWithOptions(objectId, parameterBlock);
275        break;
276    }
277    return true;
278}
279
280bool SlangDecoder::processIEntryPointMethods(
281    ApiCallId callId,
282    ObjectID objectId,
283    ParameterBlock const& parameterBlock)
284{
285    switch (callId)
286    {
287    default:
288        slangRecordLog(LogLevel::Error, "Unhandled Slang API call: %d\n", callId);
289        return false;
290    case ApiCallId::IEntryPoint_getSession:
291        IEntryPoint_getSession(objectId, parameterBlock);
292        break;
293    case ApiCallId::IEntryPoint_getLayout:
294        IEntryPoint_getLayout(objectId, parameterBlock);
295        break;
296    case ApiCallId::IEntryPoint_getSpecializationParamCount:
297        IEntryPoint_getSpecializationParamCount(objectId, parameterBlock);
298        break;
299    case ApiCallId::IEntryPoint_getEntryPointCode:
300        IEntryPoint_getEntryPointCode(objectId, parameterBlock);
301        break;
302    case ApiCallId::IEntryPoint_getTargetCode:
303        IEntryPoint_getTargetCode(objectId, parameterBlock);
304        break;
305    case ApiCallId::IEntryPoint_getResultAsFileSystem:
306        IEntryPoint_getResultAsFileSystem(objectId, parameterBlock);
307        break;
308    case ApiCallId::IEntryPoint_getEntryPointHash:
309        IEntryPoint_getEntryPointHash(objectId, parameterBlock);
310        break;
311    case ApiCallId::IEntryPoint_specialize:
312        IEntryPoint_specialize(objectId, parameterBlock);
313        break;
314    case ApiCallId::IEntryPoint_link:
315        IEntryPoint_link(objectId, parameterBlock);
316        break;
317    case ApiCallId::IEntryPoint_getEntryPointHostCallable:
318        IEntryPoint_getEntryPointHostCallable(objectId, parameterBlock);
319        break;
320    case ApiCallId::IEntryPoint_renameEntryPoint:
321        IEntryPoint_renameEntryPoint(objectId, parameterBlock);
322        break;
323    case ApiCallId::IEntryPoint_linkWithOptions:
324        IEntryPoint_linkWithOptions(objectId, parameterBlock);
325        break;
326    }
327    return true;
328}
329
330bool SlangDecoder::processICompositeComponentTypeMethods(
331    ApiCallId callId,
332    ObjectID objectId,
333    ParameterBlock const& parameterBlock)
334{
335    switch (callId)
336    {
337    default:
338        slangRecordLog(LogLevel::Error, "Unhandled Slang API call: %d\n", callId);
339        break;
340    case ApiCallId::ICompositeComponentType_getSession:
341        ICompositeComponentType_getSession(objectId, parameterBlock);
342        break;
343    case ApiCallId::ICompositeComponentType_getLayout:
344        ICompositeComponentType_getLayout(objectId, parameterBlock);
345        break;
346    case ApiCallId::ICompositeComponentType_getSpecializationParamCount:
347        ICompositeComponentType_getSpecializationParamCount(objectId, parameterBlock);
348        break;
349    case ApiCallId::ICompositeComponentType_getEntryPointCode:
350        ICompositeComponentType_getEntryPointCode(objectId, parameterBlock);
351        break;
352    case ApiCallId::ICompositeComponentType_getTargetCode:
353        ICompositeComponentType_getTargetCode(objectId, parameterBlock);
354        break;
355    case ApiCallId::ICompositeComponentType_getResultAsFileSystem:
356        ICompositeComponentType_getResultAsFileSystem(objectId, parameterBlock);
357        break;
358    case ApiCallId::ICompositeComponentType_getEntryPointHash:
359        ICompositeComponentType_getEntryPointHash(objectId, parameterBlock);
360        break;
361    case ApiCallId::ICompositeComponentType_specialize:
362        ICompositeComponentType_specialize(objectId, parameterBlock);
363        break;
364    case ApiCallId::ICompositeComponentType_link:
365        ICompositeComponentType_link(objectId, parameterBlock);
366        break;
367    case ApiCallId::ICompositeComponentType_getEntryPointHostCallable:
368        ICompositeComponentType_getEntryPointHostCallable(objectId, parameterBlock);
369        break;
370    case ApiCallId::ICompositeComponentType_renameEntryPoint:
371        ICompositeComponentType_renameEntryPoint(objectId, parameterBlock);
372        break;
373    case ApiCallId::ICompositeComponentType_linkWithOptions:
374        ICompositeComponentType_linkWithOptions(objectId, parameterBlock);
375        break;
376    case ApiCallId::ICompositeComponentType_queryInterface:
377        ICompositeComponentType_queryInterface(objectId, parameterBlock);
378        break;
379    }
380    return true;
381}
382
383bool SlangDecoder::processITypeConformanceMethods(
384    ApiCallId callId,
385    ObjectID objectId,
386    ParameterBlock const& parameterBlock)
387{
388    switch (callId)
389    {
390    default:
391        slangRecordLog(LogLevel::Error, "Unhandled Slang API call: %d\n", callId);
392        return false;
393    case ApiCallId::ITypeConformance_getSession:
394        ITypeConformance_getSession(objectId, parameterBlock);
395        break;
396    case ApiCallId::ITypeConformance_getLayout:
397        ITypeConformance_getLayout(objectId, parameterBlock);
398        break;
399    case ApiCallId::ITypeConformance_getSpecializationParamCount:
400        ITypeConformance_getSpecializationParamCount(objectId, parameterBlock);
401        break;
402    case ApiCallId::ITypeConformance_getEntryPointCode:
403        ITypeConformance_getEntryPointCode(objectId, parameterBlock);
404        break;
405    case ApiCallId::ITypeConformance_getTargetCode:
406        ITypeConformance_getTargetCode(objectId, parameterBlock);
407        break;
408    case ApiCallId::ITypeConformance_getResultAsFileSystem:
409        ITypeConformance_getResultAsFileSystem(objectId, parameterBlock);
410        break;
411    case ApiCallId::ITypeConformance_getEntryPointHash:
412        ITypeConformance_getEntryPointHash(objectId, parameterBlock);
413        break;
414    case ApiCallId::ITypeConformance_specialize:
415        ITypeConformance_specialize(objectId, parameterBlock);
416        break;
417    case ApiCallId::ITypeConformance_link:
418        ITypeConformance_link(objectId, parameterBlock);
419        break;
420    case ApiCallId::ITypeConformance_getEntryPointHostCallable:
421        ITypeConformance_getEntryPointHostCallable(objectId, parameterBlock);
422        break;
423    case ApiCallId::ITypeConformance_renameEntryPoint:
424        ITypeConformance_renameEntryPoint(objectId, parameterBlock);
425        break;
426    case ApiCallId::ITypeConformance_linkWithOptions:
427        ITypeConformance_linkWithOptions(objectId, parameterBlock);
428        break;
429    case ApiCallId::IComponentType2_getTargetCompileResult:
430        IComponentType2_getTargetCompileResult(objectId, parameterBlock);
431        break;
432    case ApiCallId::IComponentType2_getEntryPointCompileResult:
433        IComponentType2_getEntryPointCompileResult(objectId, parameterBlock);
434        break;
435    }
436    return true;
437}
438
439bool SlangDecoder::processFunctionCall(
440    FunctionHeader const& header,
441    ParameterBlock const& parameterBlock)
442{
443    switch (header.callId)
444    {
445    default:
446        slangRecordLog(LogLevel::Error, "Unhandled Slang API call: %d\n", header.callId);
447        return false;
448    case ApiCallId::CreateGlobalSession:
449        CreateGlobalSession(parameterBlock);
450        break;
451    }
452    return true;
453}
454
455
456bool SlangDecoder::CreateGlobalSession(ParameterBlock const& parameterBlock)
457{
458    StructDecoder<SlangGlobalSessionDesc> sessionDesc;
459    sessionDesc.decode(parameterBlock.parameterBuffer, parameterBlock.parameterBufferSize);
460
461    ObjectID outGlobalSessionId = 0;
462    ParameterDecoder::decodeAddress(
463        parameterBlock.outputBuffer,
464        parameterBlock.outputBufferSize,
465        outGlobalSessionId);
466
467    for (auto consumer : m_consumers)
468    {
469        consumer->CreateGlobalSession(sessionDesc.getValue(), outGlobalSessionId);
470    }
471    return true;
472}
473
474bool SlangDecoder::IGlobalSession_createSession(
475    ObjectID objectId,
476    ParameterBlock const& parameterBlock)
477{
478    StructDecoder<slang::SessionDesc> sessionDesc;
479    sessionDesc.decode(parameterBlock.parameterBuffer, parameterBlock.parameterBufferSize);
480
481    ObjectID outSessionId = 0;
482    ParameterDecoder::decodeAddress(
483        parameterBlock.outputBuffer,
484        parameterBlock.outputBufferSize,
485        outSessionId);
486
487    for (auto consumer : m_consumers)
488    {
489        consumer->IGlobalSession_createSession(objectId, sessionDesc.getValue(), outSessionId);
490    }
491
492    return true;
493}
494
495void SlangDecoder::IGlobalSession_findProfile(
496    ObjectID objectId,
497    ParameterBlock const& parameterBlock)
498{
499    StringDecoder name;
500    ParameterDecoder::decodeString(
501        parameterBlock.parameterBuffer,
502        parameterBlock.parameterBufferSize,
503        name);
504
505    for (auto consumer : m_consumers)
506    {
507        consumer->IGlobalSession_findProfile(objectId, name.getPointer());
508    }
509}
510
511void SlangDecoder::IGlobalSession_setDownstreamCompilerPath(
512    ObjectID objectId,
513    ParameterBlock const& parameterBlock)
514{
515    size_t readByte = 0;
516    SlangPassThrough passThrough{};
517    readByte = ParameterDecoder::decodeEnumValue(
518        parameterBlock.parameterBuffer,
519        parameterBlock.parameterBufferSize,
520        passThrough);
521    StringDecoder path;
522    readByte += ParameterDecoder::decodeString(
523        parameterBlock.parameterBuffer + readByte,
524        parameterBlock.parameterBufferSize - readByte,
525        path);
526
527    for (auto consumer : m_consumers)
528    {
529        consumer->IGlobalSession_setDownstreamCompilerPath(
530            objectId,
531            passThrough,
532            path.getPointer());
533    }
534}
535
536void SlangDecoder::IGlobalSession_setDownstreamCompilerPrelude(
537    ObjectID objectId,
538    ParameterBlock const& parameterBlock)
539{
540    size_t readByte = 0;
541    SlangPassThrough passThrough{};
542    readByte = ParameterDecoder::decodeEnumValue(
543        parameterBlock.parameterBuffer,
544        parameterBlock.parameterBufferSize,
545        passThrough);
546    StringDecoder prelude;
547    readByte += ParameterDecoder::decodeString(
548        parameterBlock.parameterBuffer + readByte,
549        parameterBlock.parameterBufferSize - readByte,
550        prelude);
551
552    for (auto consumer : m_consumers)
553    {
554        consumer->IGlobalSession_setDownstreamCompilerPrelude(
555            objectId,
556            passThrough,
557            prelude.getPointer());
558    }
559}
560
561void SlangDecoder::IGlobalSession_getDownstreamCompilerPrelude(
562    ObjectID objectId,
563    ParameterBlock const& parameterBlock)
564{
565    SlangPassThrough passThrough{};
566    ParameterDecoder::decodeEnumValue(
567        parameterBlock.parameterBuffer,
568        parameterBlock.parameterBufferSize,
569        passThrough);
570
571    ObjectID outPreludeId = 0;
572    ParameterDecoder::decodeAddress(
573        parameterBlock.outputBuffer,
574        parameterBlock.outputBufferSize,
575        outPreludeId);
576
577    for (auto consumer : m_consumers)
578    {
579        consumer->IGlobalSession_getDownstreamCompilerPrelude(objectId, passThrough, outPreludeId);
580    }
581}
582
583void SlangDecoder::IGlobalSession_getBuildTagString(
584    ObjectID objectId,
585    ParameterBlock const& parameterBlock)
586{
587    (void)objectId;
588    (void)parameterBlock;
589    slangRecordLog(
590        LogLevel::Debug,
591        "%s should not be called, it'a not recordd\n",
592        __PRETTY_FUNCTION__);
593}
594
595void SlangDecoder::IGlobalSession_setDefaultDownstreamCompiler(
596    ObjectID objectId,
597    ParameterBlock const& parameterBlock)
598{
599    size_t readByte = 0;
600    SlangSourceLanguage sourceLanguage{};
601    SlangPassThrough defaultCompiler{};
602    readByte = ParameterDecoder::decodeEnumValue(
603        parameterBlock.parameterBuffer,
604        parameterBlock.parameterBufferSize,
605        sourceLanguage);
606    readByte += ParameterDecoder::decodeEnumValue(
607        parameterBlock.parameterBuffer + readByte,
608        parameterBlock.parameterBufferSize - readByte,
609        defaultCompiler);
610
611    for (auto consumer : m_consumers)
612    {
613        consumer->IGlobalSession_setDefaultDownstreamCompiler(
614            objectId,
615            sourceLanguage,
616            defaultCompiler);
617    }
618}
619
620void SlangDecoder::IGlobalSession_getDefaultDownstreamCompiler(
621    ObjectID objectId,
622    ParameterBlock const& parameterBlock)
623{
624    SlangSourceLanguage sourceLanguage{};
625    ParameterDecoder::decodeEnumValue(
626        parameterBlock.parameterBuffer,
627        parameterBlock.parameterBufferSize,
628        sourceLanguage);
629
630    for (auto consumer : m_consumers)
631    {
632        consumer->IGlobalSession_getDefaultDownstreamCompiler(objectId, sourceLanguage);
633    }
634}
635
636void SlangDecoder::IGlobalSession_setLanguagePrelude(
637    ObjectID objectId,
638    ParameterBlock const& parameterBlock)
639{
640    size_t readByte = 0;
641    SlangSourceLanguage sourceLanguage{};
642    StringDecoder prelude;
643    readByte = ParameterDecoder::decodeEnumValue(
644        parameterBlock.parameterBuffer,
645        parameterBlock.parameterBufferSize,
646        sourceLanguage);
647    readByte += ParameterDecoder::decodeString(
648        parameterBlock.parameterBuffer + readByte,
649        parameterBlock.parameterBufferSize - readByte,
650        prelude);
651
652    for (auto consumer : m_consumers)
653    {
654        consumer->IGlobalSession_setLanguagePrelude(objectId, sourceLanguage, prelude.getPointer());
655    }
656}
657
658void SlangDecoder::IGlobalSession_getLanguagePrelude(
659    ObjectID objectId,
660    ParameterBlock const& parameterBlock)
661{
662    SlangSourceLanguage sourceLanguage{};
663    ObjectID outPreludeId = 0;
664    ParameterDecoder::decodeEnumValue(
665        parameterBlock.parameterBuffer,
666        parameterBlock.parameterBufferSize,
667        sourceLanguage);
668    ParameterDecoder::decodeAddress(
669        parameterBlock.outputBuffer,
670        parameterBlock.outputBufferSize,
671        outPreludeId);
672
673    for (auto consumer : m_consumers)
674    {
675        consumer->IGlobalSession_getLanguagePrelude(objectId, sourceLanguage, outPreludeId);
676    }
677}
678
679void SlangDecoder::IGlobalSession_createCompileRequest(
680    ObjectID objectId,
681    ParameterBlock const& parameterBlock)
682{
683    ObjectID outCompileRequestId = 0;
684    ParameterDecoder::decodeAddress(
685        parameterBlock.outputBuffer,
686        parameterBlock.outputBufferSize,
687        outCompileRequestId);
688
689    for (auto consumer : m_consumers)
690    {
691        consumer->IGlobalSession_createCompileRequest(objectId, outCompileRequestId);
692    }
693}
694
695void SlangDecoder::IGlobalSession_addBuiltins(
696    ObjectID objectId,
697    ParameterBlock const& parameterBlock)
698{
699    size_t readBytes = 0;
700    StringDecoder sourcePath;
701    StringDecoder sourceString;
702    readBytes = ParameterDecoder::decodeString(
703        parameterBlock.parameterBuffer,
704        parameterBlock.parameterBufferSize,
705        sourcePath);
706    readBytes += ParameterDecoder::decodeString(
707        parameterBlock.parameterBuffer + readBytes,
708        parameterBlock.parameterBufferSize - readBytes,
709        sourceString);
710
711    for (auto consumer : m_consumers)
712    {
713        consumer->IGlobalSession_addBuiltins(
714            objectId,
715            sourcePath.getPointer(),
716            sourceString.getPointer());
717    }
718}
719
720void SlangDecoder::IGlobalSession_setSharedLibraryLoader(
721    ObjectID objectId,
722    ParameterBlock const& parameterBlock)
723{
724    // TODO: Not sure if we need to record this function. Because this functions is something like
725    // the file system override, it's provided by user code. So capturing it makes no sense. The
726    // only way is to wrapper this interface by our own implementation, and record it there.
727    slangRecordLog(LogLevel::Error, "%s should not be called\n", __PRETTY_FUNCTION__);
728}
729
730void SlangDecoder::IGlobalSession_getSharedLibraryLoader(
731    ObjectID objectId,
732    ParameterBlock const& parameterBlock)
733{
734    ObjectID outLoaderId = 0;
735    ParameterDecoder::decodeAddress(
736        parameterBlock.outputBuffer,
737        parameterBlock.outputBufferSize,
738        outLoaderId);
739
740    for (auto consumer : m_consumers)
741    {
742        consumer->IGlobalSession_getSharedLibraryLoader(objectId, outLoaderId);
743    }
744}
745
746void SlangDecoder::IGlobalSession_checkCompileTargetSupport(
747    ObjectID objectId,
748    ParameterBlock const& parameterBlock)
749{
750    (void)objectId;
751    (void)parameterBlock;
752    slangRecordLog(
753        LogLevel::Debug,
754        "%s should not be called, it'a not recordd\n",
755        __PRETTY_FUNCTION__);
756}
757
758void SlangDecoder::IGlobalSession_checkPassThroughSupport(
759    ObjectID objectId,
760    ParameterBlock const& parameterBlock)
761{
762    (void)objectId;
763    (void)parameterBlock;
764    slangRecordLog(
765        LogLevel::Debug,
766        "%s should not be called, it'a not recordd\n",
767        __PRETTY_FUNCTION__);
768}
769
770void SlangDecoder::IGlobalSession_compileCoreModule(
771    ObjectID objectId,
772    ParameterBlock const& parameterBlock)
773{
774    slang::CompileCoreModuleFlags flags{};
775    ParameterDecoder::decodeEnumValue(
776        parameterBlock.parameterBuffer,
777        parameterBlock.parameterBufferSize,
778        flags);
779
780    for (auto consumer : m_consumers)
781    {
782        consumer->IGlobalSession_compileCoreModule(objectId, flags);
783    }
784}
785
786void SlangDecoder::IGlobalSession_loadCoreModule(
787    ObjectID objectId,
788    ParameterBlock const& parameterBlock)
789{
790    PointerDecoder<void*> coreModule;
791    ParameterDecoder::decodePointer(
792        parameterBlock.parameterBuffer,
793        parameterBlock.parameterBufferSize,
794        coreModule);
795
796    for (auto consumer : m_consumers)
797    {
798        consumer->IGlobalSession_loadCoreModule(
799            objectId,
800            coreModule.getPointer(),
801            coreModule.getDataSize());
802    }
803}
804
805void SlangDecoder::IGlobalSession_saveCoreModule(
806    ObjectID objectId,
807    ParameterBlock const& parameterBlock)
808{
809    SlangArchiveType archiveType{};
810    ObjectID outBlobId = 0;
811    ParameterDecoder::decodeEnumValue(
812        parameterBlock.parameterBuffer,
813        parameterBlock.parameterBufferSize,
814        archiveType);
815    ParameterDecoder::decodeAddress(
816        parameterBlock.outputBuffer,
817        parameterBlock.outputBufferSize,
818        outBlobId);
819
820    for (auto consumer : m_consumers)
821    {
822        consumer->IGlobalSession_saveCoreModule(objectId, archiveType, outBlobId);
823    }
824}
825
826void SlangDecoder::IGlobalSession_findCapability(
827    ObjectID objectId,
828    ParameterBlock const& parameterBlock)
829{
830    (void)objectId;
831    (void)parameterBlock;
832    slangRecordLog(
833        LogLevel::Debug,
834        "%s should not be called, it'a not recordd\n",
835        __PRETTY_FUNCTION__);
836}
837
838void SlangDecoder::IGlobalSession_setDownstreamCompilerForTransition(
839    ObjectID objectId,
840    ParameterBlock const& parameterBlock)
841{
842    size_t readByte = 0;
843    SlangCompileTarget source{};
844    SlangCompileTarget target{};
845    SlangPassThrough compiler{};
846
847    readByte = ParameterDecoder::decodeEnumValue(
848        parameterBlock.parameterBuffer,
849        parameterBlock.parameterBufferSize,
850        source);
851    readByte += ParameterDecoder::decodeEnumValue(
852        parameterBlock.parameterBuffer + readByte,
853        parameterBlock.parameterBufferSize - readByte,
854        target);
855    readByte += ParameterDecoder::decodeEnumValue(
856        parameterBlock.parameterBuffer + readByte,
857        parameterBlock.parameterBufferSize - readByte,
858        compiler);
859
860    for (auto consumer : m_consumers)
861    {
862        consumer
863            ->IGlobalSession_setDownstreamCompilerForTransition(objectId, source, target, compiler);
864    }
865}
866
867void SlangDecoder::IGlobalSession_getDownstreamCompilerForTransition(
868    ObjectID objectId,
869    ParameterBlock const& parameterBlock)
870{
871    (void)objectId;
872    (void)parameterBlock;
873    slangRecordLog(
874        LogLevel::Debug,
875        "%s should not be called, it'a not recordd\n",
876        __PRETTY_FUNCTION__);
877}
878
879void SlangDecoder::IGlobalSession_getCompilerElapsedTime(
880    ObjectID objectId,
881    ParameterBlock const& parameterBlock)
882{
883    (void)objectId;
884    (void)parameterBlock;
885    slangRecordLog(
886        LogLevel::Debug,
887        "%s should not be called, it'a not recordd\n",
888        __PRETTY_FUNCTION__);
889}
890
891void SlangDecoder::IGlobalSession_setSPIRVCoreGrammar(
892    ObjectID objectId,
893    ParameterBlock const& parameterBlock)
894{
895    (void)objectId;
896    (void)parameterBlock;
897    slangRecordLog(
898        LogLevel::Debug,
899        "%s should not be called, it'a not recordd\n",
900        __PRETTY_FUNCTION__);
901}
902
903void SlangDecoder::IGlobalSession_parseCommandLineArguments(
904    ObjectID objectId,
905    ParameterBlock const& parameterBlock)
906{
907    int argc = 0;
908    size_t readByte = 0;
909    readByte = ParameterDecoder::decodeInt32(
910        parameterBlock.parameterBuffer,
911        parameterBlock.parameterBufferSize,
912        argc);
913    std::vector<char*> argv;
914
915    if (argc > 0)
916    {
917        uint32_t arrayCount = 0;
918        readByte += ParameterDecoder::decodeUint32(
919            parameterBlock.parameterBuffer + readByte,
920            parameterBlock.parameterBufferSize - readByte,
921            arrayCount);
922
923        SLANG_RECORD_ASSERT(arrayCount == (uint32_t)argc);
924        argv.resize(arrayCount);
925
926        readByte += ParameterDecoder::decodeStringArray(
927            parameterBlock.parameterBuffer + readByte,
928            parameterBlock.parameterBufferSize - readByte,
929            argv.data(),
930            arrayCount);
931    }
932
933    ObjectID outSessionDescId = 0;
934    ObjectID outAllocationId = 0;
935    readByte = ParameterDecoder::decodeAddress(
936        parameterBlock.outputBuffer,
937        parameterBlock.outputBufferSize,
938        outSessionDescId);
939    readByte += ParameterDecoder::decodeAddress(
940        parameterBlock.outputBuffer + readByte,
941        parameterBlock.outputBufferSize - readByte,
942        outAllocationId);
943
944    for (auto consumer : m_consumers)
945    {
946        consumer->IGlobalSession_parseCommandLineArguments(
947            objectId,
948            argc,
949            argv.data(),
950            outSessionDescId,
951            outAllocationId);
952    }
953}
954
955void SlangDecoder::IGlobalSession_getSessionDescDigest(
956    ObjectID objectId,
957    ParameterBlock const& parameterBlock)
958{
959    StructDecoder<slang::SessionDesc> sessionDesc;
960    ObjectID outBlobId = 0;
961    size_t readByte = 0;
962    sessionDesc.decode(parameterBlock.parameterBuffer, parameterBlock.parameterBufferSize);
963    ParameterDecoder::decodeAddress(
964        parameterBlock.outputBuffer + readByte,
965        parameterBlock.outputBufferSize - readByte,
966        outBlobId);
967
968    for (auto consumer : m_consumers)
969    {
970        consumer->IGlobalSession_getSessionDescDigest(objectId, &sessionDesc.getValue(), outBlobId);
971    }
972}
973
974
975void SlangDecoder::ISession_getGlobalSession(
976    ObjectID objectId,
977    ParameterBlock const& parameterBlock)
978{
979    (void)objectId;
980    (void)parameterBlock;
981    slangRecordLog(
982        LogLevel::Debug,
983        "%s should not be called, it'a not recordd\n",
984        __PRETTY_FUNCTION__);
985}
986
987void SlangDecoder::ISession_loadModule(ObjectID objectId, ParameterBlock const& parameterBlock)
988{
989    size_t readByte = 0;
990    StringDecoder moduleName;
991    readByte += ParameterDecoder::decodeString(
992        parameterBlock.parameterBuffer,
993        parameterBlock.parameterBufferSize,
994        moduleName);
995
996    ObjectID outDiagnosticsId = 0;
997    ObjectID outModuleId = 0;
998    readByte = ParameterDecoder::decodeAddress(
999        parameterBlock.outputBuffer,
1000        parameterBlock.outputBufferSize,
1001        outDiagnosticsId);
1002    readByte += ParameterDecoder::decodeAddress(
1003        parameterBlock.outputBuffer + readByte,
1004        parameterBlock.outputBufferSize - readByte,
1005        outModuleId);
1006
1007    for (auto consumer : m_consumers)
1008    {
1009        consumer
1010            ->ISession_loadModule(objectId, moduleName.getPointer(), outDiagnosticsId, outModuleId);
1011    }
1012}
1013
1014void SlangDecoder::ISession_loadModuleFromIRBlob(
1015    ObjectID objectId,
1016    ParameterBlock const& parameterBlock)
1017{
1018    size_t readByte = 0;
1019    StringDecoder moduleName;
1020    StringDecoder path;
1021    BlobDecoder source;
1022    readByte = ParameterDecoder::decodeString(
1023        parameterBlock.parameterBuffer,
1024        parameterBlock.parameterBufferSize,
1025        moduleName);
1026    readByte += ParameterDecoder::decodeString(
1027        parameterBlock.parameterBuffer + readByte,
1028        parameterBlock.parameterBufferSize - readByte,
1029        path);
1030    readByte += source.decode(
1031        parameterBlock.parameterBuffer + readByte,
1032        parameterBlock.parameterBufferSize - readByte);
1033
1034    ObjectID outDiagnosticsId = 0;
1035    ObjectID outModuleId = 0;
1036    readByte = ParameterDecoder::decodeAddress(
1037        parameterBlock.outputBuffer,
1038        parameterBlock.outputBufferSize,
1039        outDiagnosticsId);
1040    readByte += ParameterDecoder::decodeAddress(
1041        parameterBlock.outputBuffer + readByte,
1042        parameterBlock.outputBufferSize - readByte,
1043        outModuleId);
1044
1045    for (auto consumer : m_consumers)
1046    {
1047        consumer->ISession_loadModuleFromIRBlob(
1048            objectId,
1049            moduleName.getPointer(),
1050            path.getPointer(),
1051            source.getBlob(),
1052            outDiagnosticsId,
1053            outModuleId);
1054    }
1055}
1056
1057void SlangDecoder::ISession_loadModuleFromSource(
1058    ObjectID objectId,
1059    ParameterBlock const& parameterBlock)
1060{
1061    size_t readByte = 0;
1062    StringDecoder moduleName;
1063    StringDecoder path;
1064    BlobDecoder source;
1065    readByte = ParameterDecoder::decodeString(
1066        parameterBlock.parameterBuffer,
1067        parameterBlock.parameterBufferSize,
1068        moduleName);
1069    readByte += ParameterDecoder::decodeString(
1070        parameterBlock.parameterBuffer + readByte,
1071        parameterBlock.parameterBufferSize - readByte,
1072        path);
1073    readByte += source.decode(
1074        parameterBlock.parameterBuffer + readByte,
1075        parameterBlock.parameterBufferSize - readByte);
1076
1077    ObjectID outDiagnosticsId = 0;
1078    ObjectID outModuleId = 0;
1079    readByte = ParameterDecoder::decodeAddress(
1080        parameterBlock.outputBuffer,
1081        parameterBlock.outputBufferSize,
1082        outDiagnosticsId);
1083    readByte += ParameterDecoder::decodeAddress(
1084        parameterBlock.outputBuffer + readByte,
1085        parameterBlock.outputBufferSize - readByte,
1086        outModuleId);
1087
1088    for (auto consumer : m_consumers)
1089    {
1090        consumer->ISession_loadModuleFromSource(
1091            objectId,
1092            moduleName.getPointer(),
1093            path.getPointer(),
1094            source.getBlob(),
1095            outDiagnosticsId,
1096            outModuleId);
1097    }
1098}
1099
1100void SlangDecoder::ISession_loadModuleFromSourceString(
1101    ObjectID objectId,
1102    ParameterBlock const& parameterBlock)
1103{
1104    size_t readByte = 0;
1105    StringDecoder moduleName;
1106    StringDecoder path;
1107    StringDecoder source;
1108    readByte = ParameterDecoder::decodeString(
1109        parameterBlock.parameterBuffer,
1110        parameterBlock.parameterBufferSize,
1111        moduleName);
1112    readByte += ParameterDecoder::decodeString(
1113        parameterBlock.parameterBuffer + readByte,
1114        parameterBlock.parameterBufferSize - readByte,
1115        path);
1116    readByte += ParameterDecoder::decodeString(
1117        parameterBlock.parameterBuffer + readByte,
1118        parameterBlock.parameterBufferSize - readByte,
1119        source);
1120
1121    ObjectID outDiagnosticsId = 0;
1122    ObjectID outModuleId = 0;
1123    readByte = ParameterDecoder::decodeAddress(
1124        parameterBlock.outputBuffer,
1125        parameterBlock.outputBufferSize,
1126        outDiagnosticsId);
1127    readByte += ParameterDecoder::decodeAddress(
1128        parameterBlock.outputBuffer + readByte,
1129        parameterBlock.outputBufferSize - readByte,
1130        outModuleId);
1131
1132    for (auto consumer : m_consumers)
1133    {
1134        consumer->ISession_loadModuleFromSourceString(
1135            objectId,
1136            moduleName.getPointer(),
1137            path.getPointer(),
1138            source.getPointer(),
1139            outDiagnosticsId,
1140            outModuleId);
1141    }
1142}
1143
1144void SlangDecoder::ISession_createCompositeComponentType(
1145    ObjectID objectId,
1146    ParameterBlock const& parameterBlock)
1147{
1148    size_t readByte = 0;
1149    std::vector<ObjectID> componentTypeIdList;
1150    uint32_t arrayCount = 0;
1151    readByte = ParameterDecoder::decodeUint32(
1152        parameterBlock.parameterBuffer,
1153        parameterBlock.parameterBufferSize,
1154        arrayCount);
1155
1156    componentTypeIdList.resize(arrayCount);
1157    readByte += ParameterDecoder::decodeAddressArray(
1158        parameterBlock.parameterBuffer + readByte,
1159        parameterBlock.parameterBufferSize - readByte,
1160        componentTypeIdList.data(),
1161        arrayCount);
1162
1163    ObjectID outCompositeComponentTypeId = 0;
1164    ObjectID outDiagnosticsId = 0;
1165    readByte = ParameterDecoder::decodeAddress(
1166        parameterBlock.outputBuffer,
1167        parameterBlock.outputBufferSize,
1168        outCompositeComponentTypeId);
1169    readByte += ParameterDecoder::decodeAddress(
1170        parameterBlock.outputBuffer + readByte,
1171        parameterBlock.outputBufferSize - readByte,
1172        outDiagnosticsId);
1173
1174    for (auto consumer : m_consumers)
1175    {
1176        consumer->ISession_createCompositeComponentType(
1177            objectId,
1178            componentTypeIdList.data(),
1179            componentTypeIdList.size(),
1180            outCompositeComponentTypeId,
1181            outDiagnosticsId);
1182    }
1183}
1184
1185// TODO: See https://github.com/shader-slang/slang/issues/4624 for more details
1186void SlangDecoder::ISession_specializeType(ObjectID objectId, ParameterBlock const& parameterBlock)
1187{
1188    slangRecordLog(
1189        LogLevel::Error,
1190        "%s: The shader reflection app is not recordd\n",
1191        __PRETTY_FUNCTION__);
1192
1193    size_t readByte = 0;
1194    ObjectID typeId = 0;
1195    uint32_t arrayCount = 0;
1196    readByte = ParameterDecoder::decodeAddress(
1197        parameterBlock.parameterBuffer,
1198        parameterBlock.parameterBufferSize,
1199        typeId);
1200    readByte += ParameterDecoder::decodeUint32(
1201        parameterBlock.parameterBuffer + readByte,
1202        parameterBlock.parameterBufferSize - readByte,
1203        arrayCount);
1204
1205    std::vector<slang::SpecializationArg> specializationArgs;
1206    specializationArgs.resize(arrayCount);
1207    readByte += ParameterDecoder::decodeStructArray(
1208        parameterBlock.parameterBuffer + readByte,
1209        parameterBlock.parameterBufferSize - readByte,
1210        specializationArgs.data(),
1211        arrayCount);
1212
1213    ObjectID outDiagnosticsId = 0;
1214    ObjectID outTypeReflectionId = 0;
1215
1216    readByte = ParameterDecoder::decodeAddress(
1217        parameterBlock.outputBuffer + readByte,
1218        parameterBlock.outputBufferSize,
1219        outDiagnosticsId);
1220    readByte += ParameterDecoder::decodeAddress(
1221        parameterBlock.outputBuffer + readByte,
1222        parameterBlock.outputBufferSize - readByte,
1223        outTypeReflectionId);
1224
1225    for (auto consumer : m_consumers)
1226    {
1227        consumer->ISession_specializeType(
1228            objectId,
1229            typeId,
1230            specializationArgs.data(),
1231            specializationArgs.size(),
1232            outDiagnosticsId,
1233            outTypeReflectionId);
1234    }
1235}
1236
1237void SlangDecoder::ISession_getTypeLayout(ObjectID objectId, ParameterBlock const& parameterBlock)
1238{
1239    slangRecordLog(
1240        LogLevel::Error,
1241        "%s: The shader reflection app is not recordd\n",
1242        __PRETTY_FUNCTION__);
1243
1244    size_t readByte = 0;
1245    ObjectID typeId = 0;
1246    int64_t targetIndex = 0;
1247    slang::LayoutRules rules{};
1248    readByte = ParameterDecoder::decodeAddress(
1249        parameterBlock.parameterBuffer,
1250        parameterBlock.parameterBufferSize,
1251        typeId);
1252    readByte += ParameterDecoder::decodeInt64(
1253        parameterBlock.parameterBuffer + readByte,
1254        parameterBlock.parameterBufferSize - readByte,
1255        targetIndex);
1256    readByte += ParameterDecoder::decodeEnumValue(
1257        parameterBlock.parameterBuffer + readByte,
1258        parameterBlock.parameterBufferSize - readByte,
1259        rules);
1260
1261    ObjectID outDiagnosticsId = 0;
1262    ObjectID outTypeLayoutReflectionId = 0;
1263    readByte = ParameterDecoder::decodeAddress(
1264        parameterBlock.outputBuffer + readByte,
1265        parameterBlock.outputBufferSize,
1266        outDiagnosticsId);
1267    readByte += ParameterDecoder::decodeAddress(
1268        parameterBlock.outputBuffer + readByte,
1269        parameterBlock.outputBufferSize - readByte,
1270        outTypeLayoutReflectionId);
1271
1272    for (auto consumer : m_consumers)
1273    {
1274        consumer->ISession_getTypeLayout(
1275            objectId,
1276            typeId,
1277            targetIndex,
1278            rules,
1279            outDiagnosticsId,
1280            outTypeLayoutReflectionId);
1281    }
1282}
1283
1284void SlangDecoder::ISession_getContainerType(
1285    ObjectID objectId,
1286    ParameterBlock const& parameterBlock)
1287{
1288    slangRecordLog(
1289        LogLevel::Error,
1290        "%s: The shader reflection app is not recordd\n",
1291        __PRETTY_FUNCTION__);
1292
1293    size_t readByte = 0;
1294    ObjectID elementType = 0;
1295    slang::ContainerType containerType{};
1296    readByte = ParameterDecoder::decodeAddress(
1297        parameterBlock.parameterBuffer,
1298        parameterBlock.parameterBufferSize,
1299        elementType);
1300    readByte += ParameterDecoder::decodeEnumValue(
1301        parameterBlock.parameterBuffer + readByte,
1302        parameterBlock.parameterBufferSize - readByte,
1303        containerType);
1304
1305    ObjectID outDiagnosticsId = 0;
1306    ObjectID outTypeReflectionId = 0;
1307    readByte = ParameterDecoder::decodeAddress(
1308        parameterBlock.outputBuffer + readByte,
1309        parameterBlock.outputBufferSize,
1310        outDiagnosticsId);
1311    readByte += ParameterDecoder::decodeAddress(
1312        parameterBlock.outputBuffer + readByte,
1313        parameterBlock.parameterBufferSize - readByte,
1314        outTypeReflectionId);
1315
1316    for (auto consumer : m_consumers)
1317    {
1318        consumer->ISession_getContainerType(
1319            objectId,
1320            elementType,
1321            containerType,
1322            outDiagnosticsId,
1323            outTypeReflectionId);
1324    }
1325}
1326
1327void SlangDecoder::ISession_getDynamicType(ObjectID objectId, ParameterBlock const& parameterBlock)
1328{
1329    slangRecordLog(
1330        LogLevel::Error,
1331        "%s: The shader reflection app is not recordd\n",
1332        __PRETTY_FUNCTION__);
1333
1334    ObjectID outTypeReflectionId = 0;
1335    ParameterDecoder::decodeAddress(
1336        parameterBlock.outputBuffer,
1337        parameterBlock.outputBufferSize,
1338        outTypeReflectionId);
1339
1340    for (auto consumer : m_consumers)
1341    {
1342        consumer->ISession_getDynamicType(objectId, outTypeReflectionId);
1343    }
1344}
1345
1346void SlangDecoder::ISession_getTypeRTTIMangledName(
1347    ObjectID objectId,
1348    ParameterBlock const& parameterBlock)
1349{
1350    slangRecordLog(
1351        LogLevel::Error,
1352        "%s: The shader reflection app is not recordd\n",
1353        __PRETTY_FUNCTION__);
1354
1355    ObjectID typeId = 0;
1356    ObjectID outNameBlobId = 0;
1357    ParameterDecoder::decodeAddress(
1358        parameterBlock.parameterBuffer,
1359        parameterBlock.parameterBufferSize,
1360        typeId);
1361    ParameterDecoder::decodeAddress(
1362        parameterBlock.outputBuffer,
1363        parameterBlock.outputBufferSize,
1364        outNameBlobId);
1365
1366    for (auto consumer : m_consumers)
1367    {
1368        consumer->ISession_getTypeRTTIMangledName(objectId, typeId, outNameBlobId);
1369    }
1370}
1371
1372void SlangDecoder::ISession_getTypeConformanceWitnessMangledName(
1373    ObjectID objectId,
1374    ParameterBlock const& parameterBlock)
1375{
1376    slangRecordLog(
1377        LogLevel::Error,
1378        "%s: The shader reflection app is not recordd\n",
1379        __PRETTY_FUNCTION__);
1380
1381    size_t readByte = 0;
1382    ObjectID typeId = 0;
1383    ObjectID interfaceTypeId = 0;
1384    ObjectID outNameBlobId = 0;
1385    readByte = ParameterDecoder::decodeAddress(
1386        parameterBlock.parameterBuffer,
1387        parameterBlock.parameterBufferSize,
1388        typeId);
1389    readByte += ParameterDecoder::decodeAddress(
1390        parameterBlock.parameterBuffer + readByte,
1391        parameterBlock.parameterBufferSize - readByte,
1392        interfaceTypeId);
1393
1394    readByte = ParameterDecoder::decodeAddress(
1395        parameterBlock.outputBuffer,
1396        parameterBlock.outputBufferSize,
1397        outNameBlobId);
1398
1399    for (auto consumer : m_consumers)
1400    {
1401        consumer->ISession_getTypeConformanceWitnessMangledName(
1402            objectId,
1403            typeId,
1404            interfaceTypeId,
1405            outNameBlobId);
1406    }
1407}
1408
1409void SlangDecoder::ISession_getTypeConformanceWitnessSequentialID(
1410    ObjectID objectId,
1411    ParameterBlock const& parameterBlock)
1412{
1413    slangRecordLog(
1414        LogLevel::Error,
1415        "%s: The shader reflection app is not recordd\n",
1416        __PRETTY_FUNCTION__);
1417
1418    size_t readByte = 0;
1419
1420    ObjectID typeId = 0;
1421    ObjectID interfaceTypeId = 0;
1422
1423    readByte = ParameterDecoder::decodeAddress(
1424        parameterBlock.parameterBuffer,
1425        parameterBlock.parameterBufferSize,
1426        typeId);
1427    readByte += ParameterDecoder::decodeAddress(
1428        parameterBlock.parameterBuffer + readByte,
1429        parameterBlock.parameterBufferSize - readByte,
1430        interfaceTypeId);
1431
1432    uint32_t outSequentialId = 0;
1433    for (auto consumer : m_consumers)
1434    {
1435        consumer->ISession_getTypeConformanceWitnessSequentialID(
1436            objectId,
1437            typeId,
1438            interfaceTypeId,
1439            outSequentialId);
1440    }
1441}
1442
1443void SlangDecoder::ISession_createTypeConformanceComponentType(
1444    ObjectID objectId,
1445    ParameterBlock const& parameterBlock)
1446{
1447    slangRecordLog(
1448        LogLevel::Error,
1449        "%s: The shader reflection app is not recordd\n",
1450        __PRETTY_FUNCTION__);
1451
1452    size_t readByte = 0;
1453    ObjectID typeId = 0;
1454    ObjectID interfaceTypeId = 0;
1455    int64_t conformanceIdOverride = 0;
1456    readByte = ParameterDecoder::decodeAddress(
1457        parameterBlock.parameterBuffer,
1458        parameterBlock.parameterBufferSize,
1459        typeId);
1460    readByte += ParameterDecoder::decodeAddress(
1461        parameterBlock.parameterBuffer + readByte,
1462        parameterBlock.parameterBufferSize - readByte,
1463        interfaceTypeId);
1464    readByte += ParameterDecoder::decodeInt64(
1465        parameterBlock.parameterBuffer + readByte,
1466        parameterBlock.parameterBufferSize - readByte,
1467        conformanceIdOverride);
1468
1469    ObjectID outDiagnosticsId = 0;
1470    ObjectID outConformanceId = 0;
1471    readByte = ParameterDecoder::decodeAddress(
1472        parameterBlock.outputBuffer + readByte,
1473        parameterBlock.outputBufferSize,
1474        outConformanceId);
1475    readByte += ParameterDecoder::decodeAddress(
1476        parameterBlock.outputBuffer + readByte,
1477        parameterBlock.outputBufferSize - readByte,
1478        outDiagnosticsId);
1479
1480    for (auto consumer : m_consumers)
1481    {
1482        consumer->ISession_createTypeConformanceComponentType(
1483            objectId,
1484            typeId,
1485            interfaceTypeId,
1486            conformanceIdOverride,
1487            outConformanceId,
1488            outDiagnosticsId);
1489    }
1490}
1491
1492void SlangDecoder::ISession_createCompileRequest(
1493    ObjectID objectId,
1494    ParameterBlock const& parameterBlock)
1495{
1496    ObjectID outCompileRequestId = 0;
1497    ParameterDecoder::decodeAddress(
1498        parameterBlock.outputBuffer,
1499        parameterBlock.outputBufferSize,
1500        outCompileRequestId);
1501
1502    for (auto consumer : m_consumers)
1503    {
1504        consumer->ISession_createCompileRequest(objectId, outCompileRequestId);
1505    }
1506}
1507
1508void SlangDecoder::ISession_getLoadedModuleCount(
1509    ObjectID objectId,
1510    ParameterBlock const& parameterBlock)
1511{
1512    (void)objectId;
1513    (void)parameterBlock;
1514    slangRecordLog(
1515        LogLevel::Debug,
1516        "%s should not be called, it'a not recordd\n",
1517        __PRETTY_FUNCTION__);
1518}
1519
1520void SlangDecoder::ISession_getLoadedModule(ObjectID objectId, ParameterBlock const& parameterBlock)
1521{
1522    int64_t index = 0;
1523    ParameterDecoder::decodeInt64(
1524        parameterBlock.parameterBuffer,
1525        parameterBlock.parameterBufferSize,
1526        index);
1527
1528    ObjectID outModuleId = 0;
1529    ParameterDecoder::decodeAddress(
1530        parameterBlock.outputBuffer,
1531        parameterBlock.outputBufferSize,
1532        outModuleId);
1533
1534    for (auto consumer : m_consumers)
1535    {
1536        consumer->ISession_getLoadedModule(objectId, index, outModuleId);
1537    }
1538}
1539
1540void SlangDecoder::ISession_isBinaryModuleUpToDate(
1541    ObjectID objectId,
1542    ParameterBlock const& parameterBlock)
1543{
1544    (void)objectId;
1545    (void)parameterBlock;
1546    slangRecordLog(
1547        LogLevel::Debug,
1548        "%s should not be called, it'a not recordd\n",
1549        __PRETTY_FUNCTION__);
1550}
1551
1552
1553void SlangDecoder::IModule_findEntryPointByName(
1554    ObjectID objectId,
1555    ParameterBlock const& parameterBlock)
1556{
1557    StringDecoder name;
1558    ParameterDecoder::decodeString(
1559        parameterBlock.parameterBuffer,
1560        parameterBlock.parameterBufferSize,
1561        name);
1562
1563    ObjectID outEntryPointId = 0;
1564    ParameterDecoder::decodeAddress(
1565        parameterBlock.outputBuffer,
1566        parameterBlock.outputBufferSize,
1567        outEntryPointId);
1568
1569    for (auto consumer : m_consumers)
1570    {
1571        consumer->IModule_findEntryPointByName(objectId, name.getPointer(), outEntryPointId);
1572    }
1573}
1574
1575void SlangDecoder::IModule_getDefinedEntryPointCount(
1576    ObjectID objectId,
1577    ParameterBlock const& parameterBlock)
1578{
1579    (void)objectId;
1580    (void)parameterBlock;
1581    slangRecordLog(
1582        LogLevel::Debug,
1583        "%s should not be called, it'a not recordd\n",
1584        __PRETTY_FUNCTION__);
1585}
1586
1587void SlangDecoder::IModule_getDefinedEntryPoint(
1588    ObjectID objectId,
1589    ParameterBlock const& parameterBlock)
1590{
1591    int32_t index;
1592    ObjectID outEntryPointId = 0;
1593    ParameterDecoder::decodeInt32(
1594        parameterBlock.parameterBuffer,
1595        parameterBlock.parameterBufferSize,
1596        index);
1597    ParameterDecoder::decodeAddress(
1598        parameterBlock.outputBuffer,
1599        parameterBlock.outputBufferSize,
1600        outEntryPointId);
1601
1602    for (auto consumer : m_consumers)
1603    {
1604        consumer->IModule_getDefinedEntryPoint(objectId, index, outEntryPointId);
1605    }
1606}
1607
1608void SlangDecoder::IModule_serialize(ObjectID objectId, ParameterBlock const& parameterBlock)
1609{
1610    ObjectID outSerializedBlobId = 0;
1611    ParameterDecoder::decodeAddress(
1612        parameterBlock.outputBuffer,
1613        parameterBlock.outputBufferSize,
1614        outSerializedBlobId);
1615
1616    for (auto consumer : m_consumers)
1617    {
1618        consumer->IModule_serialize(objectId, outSerializedBlobId);
1619    }
1620}
1621
1622void SlangDecoder::IModule_writeToFile(ObjectID objectId, ParameterBlock const& parameterBlock)
1623{
1624    StringDecoder fileName;
1625    ParameterDecoder::decodeString(
1626        parameterBlock.parameterBuffer,
1627        parameterBlock.parameterBufferSize,
1628        fileName);
1629
1630    for (auto consumer : m_consumers)
1631    {
1632        consumer->IModule_writeToFile(objectId, fileName.getPointer());
1633    }
1634}
1635
1636void SlangDecoder::IModule_getName(ObjectID objectId, ParameterBlock const& parameterBlock)
1637{
1638    (void)objectId;
1639    (void)parameterBlock;
1640    slangRecordLog(
1641        LogLevel::Debug,
1642        "%s should not be called, it'a not recordd\n",
1643        __PRETTY_FUNCTION__);
1644}
1645
1646void SlangDecoder::IModule_getFilePath(ObjectID objectId, ParameterBlock const& parameterBlock)
1647{
1648    (void)objectId;
1649    (void)parameterBlock;
1650    slangRecordLog(
1651        LogLevel::Debug,
1652        "%s should not be called, it'a not recordd\n",
1653        __PRETTY_FUNCTION__);
1654}
1655
1656void SlangDecoder::IModule_getUniqueIdentity(
1657    ObjectID objectId,
1658    ParameterBlock const& parameterBlock)
1659{
1660    (void)objectId;
1661    (void)parameterBlock;
1662    slangRecordLog(
1663        LogLevel::Debug,
1664        "%s should not be called, it'a not recordd\n",
1665        __PRETTY_FUNCTION__);
1666}
1667
1668void SlangDecoder::IModule_findAndCheckEntryPoint(
1669    ObjectID objectId,
1670    ParameterBlock const& parameterBlock)
1671{
1672    StringDecoder name;
1673    SlangStage stage{};
1674    size_t readByte = 0;
1675    readByte = ParameterDecoder::decodeString(
1676        parameterBlock.parameterBuffer,
1677        parameterBlock.parameterBufferSize,
1678        name);
1679    readByte += ParameterDecoder::decodeEnumValue(
1680        parameterBlock.parameterBuffer + readByte,
1681        parameterBlock.parameterBufferSize - readByte,
1682        stage);
1683
1684    ObjectID outEntryPointId = 0;
1685    ObjectID outDiagnosticsId = 0;
1686    readByte = ParameterDecoder::decodeAddress(
1687        parameterBlock.outputBuffer,
1688        parameterBlock.outputBufferSize,
1689        outEntryPointId);
1690    readByte += ParameterDecoder::decodeAddress(
1691        parameterBlock.outputBuffer + readByte,
1692        parameterBlock.outputBufferSize - readByte,
1693        outDiagnosticsId);
1694
1695    for (auto consumer : m_consumers)
1696    {
1697        consumer->IModule_findAndCheckEntryPoint(
1698            objectId,
1699            name.getPointer(),
1700            stage,
1701            outEntryPointId,
1702            outDiagnosticsId);
1703    }
1704}
1705
1706void SlangDecoder::IModule_getSession(ObjectID objectId, ParameterBlock const& parameterBlock)
1707{
1708    (void)objectId;
1709    (void)parameterBlock;
1710    slangRecordLog(
1711        LogLevel::Debug,
1712        "%s should not be called, it'a not recordd\n",
1713        __PRETTY_FUNCTION__);
1714}
1715
1716void SlangDecoder::IModule_getLayout(ObjectID objectId, ParameterBlock const& parameterBlock)
1717{
1718    int64_t targetIndex = 0;
1719    ParameterDecoder::decodeInt64(
1720        parameterBlock.parameterBuffer,
1721        parameterBlock.parameterBufferSize,
1722        targetIndex);
1723    ObjectID outDiagnosticsId = 0;
1724    ObjectID programLayoutId = 0;
1725
1726    size_t readByte = 0;
1727    readByte = ParameterDecoder::decodeAddress(
1728        parameterBlock.outputBuffer,
1729        parameterBlock.outputBufferSize,
1730        outDiagnosticsId);
1731    readByte += ParameterDecoder::decodeAddress(
1732        parameterBlock.outputBuffer + readByte,
1733        parameterBlock.outputBufferSize - readByte,
1734        programLayoutId);
1735
1736    for (auto consumer : m_consumers)
1737    {
1738        consumer->IModule_getLayout(objectId, targetIndex, outDiagnosticsId, programLayoutId);
1739    }
1740}
1741
1742void SlangDecoder::IModule_getSpecializationParamCount(
1743    ObjectID objectId,
1744    ParameterBlock const& parameterBlock)
1745{
1746    (void)objectId;
1747    (void)parameterBlock;
1748    slangRecordLog(
1749        LogLevel::Debug,
1750        "%s should not be called, it'a not recordd\n",
1751        __PRETTY_FUNCTION__);
1752}
1753
1754void SlangDecoder::IModule_getEntryPointCode(
1755    ObjectID objectId,
1756    ParameterBlock const& parameterBlock)
1757{
1758    size_t readByte = 0;
1759    int64_t entryPointIndex = 0;
1760    int64_t targetIndex = 0;
1761    readByte = ParameterDecoder::decodeInt64(
1762        parameterBlock.parameterBuffer,
1763        parameterBlock.parameterBufferSize,
1764        entryPointIndex);
1765    readByte += ParameterDecoder::decodeInt64(
1766        parameterBlock.parameterBuffer + readByte,
1767        parameterBlock.parameterBufferSize - readByte,
1768        targetIndex);
1769
1770    ObjectID outCodeId = 0;
1771    ObjectID outDiagnosticsId = 0;
1772    readByte = ParameterDecoder::decodeAddress(
1773        parameterBlock.outputBuffer,
1774        parameterBlock.outputBufferSize,
1775        outCodeId);
1776    readByte += ParameterDecoder::decodeAddress(
1777        parameterBlock.outputBuffer + readByte,
1778        parameterBlock.outputBufferSize - readByte,
1779        outDiagnosticsId);
1780
1781    for (auto consumer : m_consumers)
1782    {
1783        consumer->IModule_getEntryPointCode(
1784            objectId,
1785            entryPointIndex,
1786            targetIndex,
1787            outCodeId,
1788            outDiagnosticsId);
1789    }
1790}
1791
1792void SlangDecoder::IModule_getTargetCode(ObjectID objectId, ParameterBlock const& parameterBlock)
1793{
1794    size_t readByte = 0;
1795    int64_t targetIndex = 0;
1796    readByte = ParameterDecoder::decodeInt64(
1797        parameterBlock.parameterBuffer,
1798        parameterBlock.parameterBufferSize,
1799        targetIndex);
1800
1801    ObjectID outCodeId = 0;
1802    ObjectID outDiagnosticsId = 0;
1803    readByte = ParameterDecoder::decodeAddress(
1804        parameterBlock.outputBuffer,
1805        parameterBlock.outputBufferSize,
1806        outCodeId);
1807    readByte += ParameterDecoder::decodeAddress(
1808        parameterBlock.outputBuffer + readByte,
1809        parameterBlock.outputBufferSize - readByte,
1810        outDiagnosticsId);
1811
1812    for (auto consumer : m_consumers)
1813    {
1814        consumer->IModule_getTargetCode(objectId, targetIndex, outCodeId, outDiagnosticsId);
1815    }
1816}
1817
1818void SlangDecoder::IModule_getResultAsFileSystem(
1819    ObjectID objectId,
1820    ParameterBlock const& parameterBlock)
1821{
1822    size_t readByte = 0;
1823    int64_t entryPointIndex = 0;
1824    int64_t targetIndex = 0;
1825    readByte = ParameterDecoder::decodeInt64(
1826        parameterBlock.parameterBuffer,
1827        parameterBlock.parameterBufferSize,
1828        entryPointIndex);
1829    readByte += ParameterDecoder::decodeInt64(
1830        parameterBlock.parameterBuffer + readByte,
1831        parameterBlock.parameterBufferSize - readByte,
1832        targetIndex);
1833
1834    ObjectID outFileSystemId = 0;
1835    readByte = ParameterDecoder::decodeAddress(
1836        parameterBlock.outputBuffer,
1837        parameterBlock.outputBufferSize,
1838        outFileSystemId);
1839
1840    for (auto consumer : m_consumers)
1841    {
1842        consumer->IModule_getResultAsFileSystem(
1843            objectId,
1844            entryPointIndex,
1845            targetIndex,
1846            outFileSystemId);
1847    }
1848}
1849
1850void SlangDecoder::IModule_getEntryPointHash(
1851    ObjectID objectId,
1852    ParameterBlock const& parameterBlock)
1853{
1854    size_t readByte = 0;
1855    int64_t entryPointIndex = 0;
1856    int64_t targetIndex = 0;
1857    readByte = ParameterDecoder::decodeInt64(
1858        parameterBlock.parameterBuffer,
1859        parameterBlock.parameterBufferSize,
1860        entryPointIndex);
1861    readByte += ParameterDecoder::decodeInt64(
1862        parameterBlock.parameterBuffer + readByte,
1863        parameterBlock.parameterBufferSize - readByte,
1864        targetIndex);
1865
1866    ObjectID outBlobId = 0;
1867    readByte = ParameterDecoder::decodeAddress(
1868        parameterBlock.outputBuffer,
1869        parameterBlock.outputBufferSize,
1870        outBlobId);
1871
1872    for (auto consumer : m_consumers)
1873    {
1874        consumer->IModule_getEntryPointHash(objectId, entryPointIndex, targetIndex, outBlobId);
1875    }
1876}
1877
1878void SlangDecoder::IModule_specialize(ObjectID objectId, ParameterBlock const& parameterBlock)
1879{
1880    slangRecordLog(
1881        LogLevel::Error,
1882        "%s: The shader reflection interfaces are not recordd\n",
1883        __PRETTY_FUNCTION__);
1884
1885    size_t readByte = 0;
1886    int64_t specializationArgCount = 0;
1887    readByte = ParameterDecoder::decodeInt64(
1888        parameterBlock.parameterBuffer,
1889        parameterBlock.parameterBufferSize,
1890        specializationArgCount);
1891
1892    std::vector<slang::SpecializationArg> specializationArgs;
1893
1894    uint32_t arraySize = 0;
1895    readByte += ParameterDecoder::decodeUint32(
1896        parameterBlock.parameterBuffer + readByte,
1897        parameterBlock.parameterBufferSize - readByte,
1898        arraySize);
1899
1900    SLANG_RECORD_ASSERT(arraySize == specializationArgCount);
1901
1902    specializationArgs.resize(specializationArgCount);
1903    readByte += ParameterDecoder::decodeStructArray(
1904        parameterBlock.parameterBuffer + readByte,
1905        parameterBlock.parameterBufferSize - readByte,
1906        specializationArgs.data(),
1907        specializationArgCount);
1908
1909    ObjectID outSpecializedComponentTypeId = 0;
1910    ObjectID outDiagnosticsId = 0;
1911    readByte = ParameterDecoder::decodeAddress(
1912        parameterBlock.outputBuffer,
1913        parameterBlock.outputBufferSize,
1914        outSpecializedComponentTypeId);
1915    readByte += ParameterDecoder::decodeAddress(
1916        parameterBlock.outputBuffer + readByte,
1917        parameterBlock.outputBufferSize - readByte,
1918        outDiagnosticsId);
1919
1920    for (auto consumer : m_consumers)
1921    {
1922        consumer->IModule_specialize(
1923            objectId,
1924            specializationArgs.data(),
1925            specializationArgCount,
1926            outSpecializedComponentTypeId,
1927            outDiagnosticsId);
1928    }
1929}
1930
1931void SlangDecoder::IModule_link(ObjectID objectId, ParameterBlock const& parameterBlock)
1932{
1933    size_t readByte = 0;
1934    ObjectID outLinkedComponentTypeId = 0;
1935    ObjectID outDiagnosticsId = 0;
1936    readByte = ParameterDecoder::decodeAddress(
1937        parameterBlock.outputBuffer,
1938        parameterBlock.outputBufferSize,
1939        outLinkedComponentTypeId);
1940    readByte += ParameterDecoder::decodeAddress(
1941        parameterBlock.outputBuffer + readByte,
1942        parameterBlock.outputBufferSize - readByte,
1943        outDiagnosticsId);
1944
1945    for (auto consumer : m_consumers)
1946    {
1947        consumer->IModule_link(objectId, outLinkedComponentTypeId, outDiagnosticsId);
1948    }
1949}
1950
1951void SlangDecoder::IModule_getEntryPointHostCallable(
1952    ObjectID objectId,
1953    ParameterBlock const& parameterBlock)
1954{
1955    size_t readByte = 0;
1956    int32_t entryPointIndex = 0;
1957    int32_t targetIndex = 0;
1958    readByte = ParameterDecoder::decodeInt32(
1959        parameterBlock.parameterBuffer,
1960        parameterBlock.parameterBufferSize,
1961        entryPointIndex);
1962    readByte += ParameterDecoder::decodeInt32(
1963        parameterBlock.parameterBuffer + readByte,
1964        parameterBlock.parameterBufferSize - readByte,
1965        targetIndex);
1966
1967    ObjectID outSharedLibraryId = 0;
1968    ObjectID outDiagnosticsId = 0;
1969    readByte = ParameterDecoder::decodeAddress(
1970        parameterBlock.outputBuffer,
1971        parameterBlock.outputBufferSize,
1972        outSharedLibraryId);
1973    readByte += ParameterDecoder::decodeAddress(
1974        parameterBlock.outputBuffer + readByte,
1975        parameterBlock.outputBufferSize - readByte,
1976        outDiagnosticsId);
1977
1978    for (auto consumer : m_consumers)
1979    {
1980        consumer->IModule_getEntryPointHostCallable(
1981            objectId,
1982            entryPointIndex,
1983            targetIndex,
1984            outSharedLibraryId,
1985            outDiagnosticsId);
1986    }
1987}
1988
1989void SlangDecoder::IModule_renameEntryPoint(ObjectID objectId, ParameterBlock const& parameterBlock)
1990{
1991    StringDecoder newName;
1992    ParameterDecoder::decodeString(
1993        parameterBlock.parameterBuffer,
1994        parameterBlock.parameterBufferSize,
1995        newName);
1996
1997    ObjectID outEntryPointId = 0;
1998    ParameterDecoder::decodeAddress(
1999        parameterBlock.outputBuffer,
2000        parameterBlock.outputBufferSize,
2001        outEntryPointId);
2002
2003    for (auto consumer : m_consumers)
2004    {
2005        consumer->IModule_renameEntryPoint(objectId, newName.getPointer(), outEntryPointId);
2006    }
2007}
2008
2009void SlangDecoder::IModule_linkWithOptions(ObjectID objectId, ParameterBlock const& parameterBlock)
2010{
2011    size_t readByte = 0;
2012    uint32_t compilerOptionEntryCount = 0;
2013    readByte = ParameterDecoder::decodeUint32(
2014        parameterBlock.parameterBuffer,
2015        parameterBlock.parameterBufferSize,
2016        compilerOptionEntryCount);
2017
2018    std::vector<slang::CompilerOptionEntry> compilerOptionEntries;
2019
2020    uint32_t arrayCount = 0;
2021    readByte += ParameterDecoder::decodeUint32(
2022        parameterBlock.parameterBuffer + readByte,
2023        parameterBlock.parameterBufferSize - readByte,
2024        arrayCount);
2025
2026    SLANG_RECORD_ASSERT(arrayCount == compilerOptionEntryCount);
2027    compilerOptionEntries.resize(compilerOptionEntryCount);
2028
2029    readByte += ParameterDecoder::decodeStructArray(
2030        parameterBlock.parameterBuffer + readByte,
2031        parameterBlock.parameterBufferSize - readByte,
2032        compilerOptionEntries.data(),
2033        compilerOptionEntryCount);
2034
2035    ObjectID outLinkedComponentTypeId = 0;
2036    ObjectID outDiagnosticsId = 0;
2037    readByte = ParameterDecoder::decodeAddress(
2038        parameterBlock.outputBuffer,
2039        parameterBlock.outputBufferSize,
2040        outLinkedComponentTypeId);
2041    readByte += ParameterDecoder::decodeAddress(
2042        parameterBlock.outputBuffer + readByte,
2043        parameterBlock.outputBufferSize - readByte,
2044        outDiagnosticsId);
2045
2046    for (auto consumer : m_consumers)
2047    {
2048        consumer->IModule_linkWithOptions(
2049            objectId,
2050            outLinkedComponentTypeId,
2051            compilerOptionEntryCount,
2052            compilerOptionEntries.data(),
2053            outDiagnosticsId);
2054    }
2055}
2056
2057void SlangDecoder::IEntryPoint_getSession(ObjectID objectId, ParameterBlock const& parameterBlock)
2058{
2059    (void)objectId;
2060    (void)parameterBlock;
2061    slangRecordLog(
2062        LogLevel::Debug,
2063        "%s should not be called, it'a not recordd\n",
2064        __PRETTY_FUNCTION__);
2065}
2066
2067void SlangDecoder::IEntryPoint_getLayout(ObjectID objectId, ParameterBlock const& parameterBlock)
2068{
2069    int64_t targetIndex = 0;
2070    ParameterDecoder::decodeInt64(
2071        parameterBlock.parameterBuffer,
2072        parameterBlock.parameterBufferSize,
2073        targetIndex);
2074
2075    ObjectID outDiagnosticsId = 0;
2076    ObjectID programLayoutId = 0;
2077
2078    size_t readByte = 0;
2079    readByte = ParameterDecoder::decodeAddress(
2080        parameterBlock.outputBuffer,
2081        parameterBlock.outputBufferSize,
2082        outDiagnosticsId);
2083    readByte += ParameterDecoder::decodeAddress(
2084        parameterBlock.outputBuffer + readByte,
2085        parameterBlock.outputBufferSize - readByte,
2086        programLayoutId);
2087
2088    for (auto consumer : m_consumers)
2089    {
2090        consumer->IEntryPoint_getLayout(objectId, targetIndex, outDiagnosticsId, programLayoutId);
2091    }
2092}
2093
2094void SlangDecoder::IEntryPoint_getSpecializationParamCount(
2095    ObjectID objectId,
2096    ParameterBlock const& parameterBlock)
2097{
2098    (void)objectId;
2099    (void)parameterBlock;
2100    slangRecordLog(
2101        LogLevel::Debug,
2102        "%s should not be called, it'a not recordd\n",
2103        __PRETTY_FUNCTION__);
2104}
2105
2106void SlangDecoder::IEntryPoint_getEntryPointCode(
2107    ObjectID objectId,
2108    ParameterBlock const& parameterBlock)
2109{
2110    size_t readByte = 0;
2111    int64_t entryPointIndex = 0;
2112    int64_t targetIndex = 0;
2113    readByte = ParameterDecoder::decodeInt64(
2114        parameterBlock.parameterBuffer,
2115        parameterBlock.parameterBufferSize,
2116        entryPointIndex);
2117    readByte += ParameterDecoder::decodeInt64(
2118        parameterBlock.parameterBuffer + readByte,
2119        parameterBlock.parameterBufferSize - readByte,
2120        targetIndex);
2121
2122    ObjectID outCodeId = 0;
2123    ObjectID outDiagnosticsId = 0;
2124    readByte = ParameterDecoder::decodeAddress(
2125        parameterBlock.outputBuffer,
2126        parameterBlock.outputBufferSize,
2127        outCodeId);
2128    readByte += ParameterDecoder::decodeAddress(
2129        parameterBlock.outputBuffer + readByte,
2130        parameterBlock.outputBufferSize - readByte,
2131        outDiagnosticsId);
2132
2133    for (auto consumer : m_consumers)
2134    {
2135        consumer->IEntryPoint_getEntryPointCode(
2136            objectId,
2137            entryPointIndex,
2138            targetIndex,
2139            outCodeId,
2140            outDiagnosticsId);
2141    }
2142}
2143
2144void SlangDecoder::IEntryPoint_getTargetCode(
2145    ObjectID objectId,
2146    ParameterBlock const& parameterBlock)
2147{
2148    size_t readByte = 0;
2149    int64_t targetIndex = 0;
2150    readByte = ParameterDecoder::decodeInt64(
2151        parameterBlock.parameterBuffer,
2152        parameterBlock.parameterBufferSize,
2153        targetIndex);
2154
2155    ObjectID outCodeId = 0;
2156    ObjectID outDiagnosticsId = 0;
2157    readByte = ParameterDecoder::decodeAddress(
2158        parameterBlock.outputBuffer,
2159        parameterBlock.outputBufferSize,
2160        outCodeId);
2161    readByte += ParameterDecoder::decodeAddress(
2162        parameterBlock.outputBuffer + readByte,
2163        parameterBlock.outputBufferSize - readByte,
2164        outDiagnosticsId);
2165
2166    for (auto consumer : m_consumers)
2167    {
2168        consumer->IEntryPoint_getTargetCode(objectId, targetIndex, outCodeId, outDiagnosticsId);
2169    }
2170}
2171
2172void SlangDecoder::IEntryPoint_getResultAsFileSystem(
2173    ObjectID objectId,
2174    ParameterBlock const& parameterBlock)
2175{
2176    size_t readByte = 0;
2177    int64_t entryPointIndex = 0;
2178    int64_t targetIndex = 0;
2179    readByte = ParameterDecoder::decodeInt64(
2180        parameterBlock.parameterBuffer,
2181        parameterBlock.parameterBufferSize,
2182        entryPointIndex);
2183    readByte += ParameterDecoder::decodeInt64(
2184        parameterBlock.parameterBuffer + readByte,
2185        parameterBlock.parameterBufferSize - readByte,
2186        targetIndex);
2187
2188    ObjectID outFileSystemId = 0;
2189    readByte = ParameterDecoder::decodeAddress(
2190        parameterBlock.outputBuffer,
2191        parameterBlock.outputBufferSize,
2192        outFileSystemId);
2193
2194    for (auto consumer : m_consumers)
2195    {
2196        consumer->IEntryPoint_getResultAsFileSystem(
2197            objectId,
2198            entryPointIndex,
2199            targetIndex,
2200            outFileSystemId);
2201    }
2202}
2203
2204void SlangDecoder::IEntryPoint_getEntryPointHash(
2205    ObjectID objectId,
2206    ParameterBlock const& parameterBlock)
2207{
2208    size_t readByte = 0;
2209    int64_t entryPointIndex = 0;
2210    int64_t targetIndex = 0;
2211    readByte = ParameterDecoder::decodeInt64(
2212        parameterBlock.parameterBuffer,
2213        parameterBlock.parameterBufferSize,
2214        entryPointIndex);
2215    readByte += ParameterDecoder::decodeInt64(
2216        parameterBlock.parameterBuffer + readByte,
2217        parameterBlock.parameterBufferSize - readByte,
2218        targetIndex);
2219
2220    ObjectID outBlobId = 0;
2221    readByte = ParameterDecoder::decodeAddress(
2222        parameterBlock.outputBuffer,
2223        parameterBlock.outputBufferSize,
2224        outBlobId);
2225
2226    for (auto consumer : m_consumers)
2227    {
2228        consumer->IEntryPoint_getEntryPointHash(objectId, entryPointIndex, targetIndex, outBlobId);
2229    }
2230}
2231
2232void SlangDecoder::IEntryPoint_specialize(ObjectID objectId, ParameterBlock const& parameterBlock)
2233{
2234    slangRecordLog(
2235        LogLevel::Error,
2236        "%s: The shader reflection interfaces are not recordd\n",
2237        __PRETTY_FUNCTION__);
2238
2239    size_t readByte = 0;
2240    int64_t specializationArgCount = 0;
2241    readByte = ParameterDecoder::decodeInt64(
2242        parameterBlock.parameterBuffer,
2243        parameterBlock.parameterBufferSize,
2244        specializationArgCount);
2245
2246    std::vector<slang::SpecializationArg> specializationArgs;
2247
2248    uint32_t arraySize = 0;
2249    readByte += ParameterDecoder::decodeUint32(
2250        parameterBlock.parameterBuffer + readByte,
2251        parameterBlock.parameterBufferSize - readByte,
2252        arraySize);
2253
2254    SLANG_RECORD_ASSERT(arraySize == specializationArgCount);
2255
2256    specializationArgs.resize(specializationArgCount);
2257    readByte += ParameterDecoder::decodeStructArray(
2258        parameterBlock.parameterBuffer + readByte,
2259        parameterBlock.parameterBufferSize - readByte,
2260        specializationArgs.data(),
2261        specializationArgCount);
2262
2263    ObjectID outSpecializedComponentTypeId = 0;
2264    ObjectID outDiagnosticsId = 0;
2265    readByte = ParameterDecoder::decodeAddress(
2266        parameterBlock.outputBuffer,
2267        parameterBlock.outputBufferSize,
2268        outSpecializedComponentTypeId);
2269    readByte += ParameterDecoder::decodeAddress(
2270        parameterBlock.outputBuffer + readByte,
2271        parameterBlock.outputBufferSize - readByte,
2272        outDiagnosticsId);
2273
2274    for (auto consumer : m_consumers)
2275    {
2276        consumer->IEntryPoint_specialize(
2277            objectId,
2278            specializationArgs.data(),
2279            specializationArgCount,
2280            outSpecializedComponentTypeId,
2281            outDiagnosticsId);
2282    }
2283}
2284
2285void SlangDecoder::IEntryPoint_link(ObjectID objectId, ParameterBlock const& parameterBlock)
2286{
2287    size_t readByte = 0;
2288    ObjectID outLinkedComponentTypeId = 0;
2289    ObjectID outDiagnosticsId = 0;
2290    readByte = ParameterDecoder::decodeAddress(
2291        parameterBlock.outputBuffer,
2292        parameterBlock.outputBufferSize,
2293        outLinkedComponentTypeId);
2294    readByte += ParameterDecoder::decodeAddress(
2295        parameterBlock.outputBuffer + readByte,
2296        parameterBlock.outputBufferSize - readByte,
2297        outDiagnosticsId);
2298
2299    for (auto consumer : m_consumers)
2300    {
2301        consumer->IEntryPoint_link(objectId, outLinkedComponentTypeId, outDiagnosticsId);
2302    }
2303}
2304
2305void SlangDecoder::IEntryPoint_getEntryPointHostCallable(
2306    ObjectID objectId,
2307    ParameterBlock const& parameterBlock)
2308{
2309    size_t readByte = 0;
2310    int32_t entryPointIndex = 0;
2311    int32_t targetIndex = 0;
2312    readByte = ParameterDecoder::decodeInt32(
2313        parameterBlock.parameterBuffer,
2314        parameterBlock.parameterBufferSize,
2315        entryPointIndex);
2316    readByte += ParameterDecoder::decodeInt32(
2317        parameterBlock.parameterBuffer + readByte,
2318        parameterBlock.parameterBufferSize - readByte,
2319        targetIndex);
2320
2321    ObjectID outSharedLibraryId = 0;
2322    ObjectID outDiagnosticsId = 0;
2323    readByte = ParameterDecoder::decodeAddress(
2324        parameterBlock.outputBuffer,
2325        parameterBlock.outputBufferSize,
2326        outSharedLibraryId);
2327    readByte += ParameterDecoder::decodeAddress(
2328        parameterBlock.outputBuffer + readByte,
2329        parameterBlock.outputBufferSize - readByte,
2330        outDiagnosticsId);
2331
2332    for (auto consumer : m_consumers)
2333    {
2334        consumer->IEntryPoint_getEntryPointHostCallable(
2335            objectId,
2336            entryPointIndex,
2337            targetIndex,
2338            outSharedLibraryId,
2339            outDiagnosticsId);
2340    }
2341}
2342
2343void SlangDecoder::IEntryPoint_renameEntryPoint(
2344    ObjectID objectId,
2345    ParameterBlock const& parameterBlock)
2346{
2347    StringDecoder newName;
2348    ParameterDecoder::decodeString(
2349        parameterBlock.parameterBuffer,
2350        parameterBlock.parameterBufferSize,
2351        newName);
2352
2353    ObjectID outEntryPointId = 0;
2354    ParameterDecoder::decodeAddress(
2355        parameterBlock.outputBuffer,
2356        parameterBlock.outputBufferSize,
2357        outEntryPointId);
2358
2359    for (auto consumer : m_consumers)
2360    {
2361        consumer->IEntryPoint_renameEntryPoint(objectId, newName.getPointer(), outEntryPointId);
2362    }
2363}
2364
2365void SlangDecoder::IEntryPoint_linkWithOptions(
2366    ObjectID objectId,
2367    ParameterBlock const& parameterBlock)
2368{
2369    size_t readByte = 0;
2370    uint32_t compilerOptionEntryCount = 0;
2371    readByte = ParameterDecoder::decodeUint32(
2372        parameterBlock.parameterBuffer,
2373        parameterBlock.parameterBufferSize,
2374        compilerOptionEntryCount);
2375
2376    std::vector<slang::CompilerOptionEntry> compilerOptionEntries;
2377
2378    uint32_t arrayCount = 0;
2379    readByte += ParameterDecoder::decodeUint32(
2380        parameterBlock.parameterBuffer + readByte,
2381        parameterBlock.parameterBufferSize - readByte,
2382        arrayCount);
2383
2384    SLANG_RECORD_ASSERT(arrayCount == compilerOptionEntryCount);
2385    compilerOptionEntries.resize(compilerOptionEntryCount);
2386
2387    readByte += ParameterDecoder::decodeStructArray(
2388        parameterBlock.parameterBuffer + readByte,
2389        parameterBlock.parameterBufferSize - readByte,
2390        compilerOptionEntries.data(),
2391        compilerOptionEntryCount);
2392
2393    ObjectID outLinkedComponentTypeId = 0;
2394    ObjectID outDiagnosticsId = 0;
2395    readByte = ParameterDecoder::decodeAddress(
2396        parameterBlock.outputBuffer,
2397        parameterBlock.outputBufferSize,
2398        outLinkedComponentTypeId);
2399    readByte += ParameterDecoder::decodeAddress(
2400        parameterBlock.outputBuffer + readByte,
2401        parameterBlock.outputBufferSize - readByte,
2402        outDiagnosticsId);
2403
2404    for (auto consumer : m_consumers)
2405    {
2406        consumer->IEntryPoint_linkWithOptions(
2407            objectId,
2408            outLinkedComponentTypeId,
2409            compilerOptionEntryCount,
2410            compilerOptionEntries.data(),
2411            outDiagnosticsId);
2412    }
2413}
2414
2415
2416void SlangDecoder::ICompositeComponentType_getSession(
2417    ObjectID objectId,
2418    ParameterBlock const& parameterBlock)
2419{
2420    (void)objectId;
2421    (void)parameterBlock;
2422    slangRecordLog(
2423        LogLevel::Debug,
2424        "%s should not be called, it'a not recordd\n",
2425        __PRETTY_FUNCTION__);
2426}
2427
2428void SlangDecoder::ICompositeComponentType_getLayout(
2429    ObjectID objectId,
2430    ParameterBlock const& parameterBlock)
2431{
2432    int64_t targetIndex = 0;
2433    ParameterDecoder::decodeInt64(
2434        parameterBlock.parameterBuffer,
2435        parameterBlock.parameterBufferSize,
2436        targetIndex);
2437    ObjectID outDiagnosticsId = 0;
2438    ObjectID programLayoutId = 0;
2439
2440    size_t readByte = 0;
2441    readByte = ParameterDecoder::decodeAddress(
2442        parameterBlock.outputBuffer,
2443        parameterBlock.outputBufferSize,
2444        outDiagnosticsId);
2445    readByte += ParameterDecoder::decodeAddress(
2446        parameterBlock.outputBuffer + readByte,
2447        parameterBlock.outputBufferSize - readByte,
2448        programLayoutId);
2449
2450    for (auto consumer : m_consumers)
2451    {
2452        consumer->ICompositeComponentType_getLayout(
2453            objectId,
2454            targetIndex,
2455            outDiagnosticsId,
2456            programLayoutId);
2457    }
2458}
2459
2460void SlangDecoder::ICompositeComponentType_getSpecializationParamCount(
2461    ObjectID objectId,
2462    ParameterBlock const& parameterBlock)
2463{
2464    (void)objectId;
2465    (void)parameterBlock;
2466    slangRecordLog(
2467        LogLevel::Debug,
2468        "%s should not be called, it'a not recordd\n",
2469        __PRETTY_FUNCTION__);
2470}
2471
2472void SlangDecoder::ICompositeComponentType_getEntryPointCode(
2473    ObjectID objectId,
2474    ParameterBlock const& parameterBlock)
2475{
2476    size_t readByte = 0;
2477    int64_t entryPointIndex = 0;
2478    int64_t targetIndex = 0;
2479    readByte = ParameterDecoder::decodeInt64(
2480        parameterBlock.parameterBuffer,
2481        parameterBlock.parameterBufferSize,
2482        entryPointIndex);
2483    readByte += ParameterDecoder::decodeInt64(
2484        parameterBlock.parameterBuffer + readByte,
2485        parameterBlock.parameterBufferSize - readByte,
2486        targetIndex);
2487
2488    ObjectID outCodeId = 0;
2489    ObjectID outDiagnosticsId = 0;
2490    readByte = ParameterDecoder::decodeAddress(
2491        parameterBlock.outputBuffer,
2492        parameterBlock.outputBufferSize,
2493        outCodeId);
2494    readByte += ParameterDecoder::decodeAddress(
2495        parameterBlock.outputBuffer + readByte,
2496        parameterBlock.outputBufferSize - readByte,
2497        outDiagnosticsId);
2498
2499    for (auto consumer : m_consumers)
2500    {
2501        consumer->ICompositeComponentType_getEntryPointCode(
2502            objectId,
2503            entryPointIndex,
2504            targetIndex,
2505            outCodeId,
2506            outDiagnosticsId);
2507    }
2508}
2509
2510void SlangDecoder::ICompositeComponentType_getTargetCode(
2511    ObjectID objectId,
2512    ParameterBlock const& parameterBlock)
2513{
2514    size_t readByte = 0;
2515    int64_t targetIndex = 0;
2516    readByte = ParameterDecoder::decodeInt64(
2517        parameterBlock.parameterBuffer,
2518        parameterBlock.parameterBufferSize,
2519        targetIndex);
2520
2521    ObjectID outCodeId = 0;
2522    ObjectID outDiagnosticsId = 0;
2523    readByte = ParameterDecoder::decodeAddress(
2524        parameterBlock.outputBuffer,
2525        parameterBlock.outputBufferSize,
2526        outCodeId);
2527    readByte += ParameterDecoder::decodeAddress(
2528        parameterBlock.outputBuffer + readByte,
2529        parameterBlock.outputBufferSize - readByte,
2530        outDiagnosticsId);
2531
2532    for (auto consumer : m_consumers)
2533    {
2534        consumer->ICompositeComponentType_getTargetCode(
2535            objectId,
2536            targetIndex,
2537            outCodeId,
2538            outDiagnosticsId);
2539    }
2540}
2541
2542void SlangDecoder::ICompositeComponentType_getResultAsFileSystem(
2543    ObjectID objectId,
2544    ParameterBlock const& parameterBlock)
2545{
2546    size_t readByte = 0;
2547    int64_t entryPointIndex = 0;
2548    int64_t targetIndex = 0;
2549    readByte = ParameterDecoder::decodeInt64(
2550        parameterBlock.parameterBuffer,
2551        parameterBlock.parameterBufferSize,
2552        entryPointIndex);
2553    readByte += ParameterDecoder::decodeInt64(
2554        parameterBlock.parameterBuffer + readByte,
2555        parameterBlock.parameterBufferSize - readByte,
2556        targetIndex);
2557
2558    ObjectID outFileSystemId = 0;
2559    readByte = ParameterDecoder::decodeAddress(
2560        parameterBlock.outputBuffer,
2561        parameterBlock.outputBufferSize,
2562        outFileSystemId);
2563
2564    for (auto consumer : m_consumers)
2565    {
2566        consumer->ICompositeComponentType_getResultAsFileSystem(
2567            objectId,
2568            entryPointIndex,
2569            targetIndex,
2570            outFileSystemId);
2571    }
2572}
2573
2574void SlangDecoder::ICompositeComponentType_getEntryPointHash(
2575    ObjectID objectId,
2576    ParameterBlock const& parameterBlock)
2577{
2578    size_t readByte = 0;
2579    int64_t entryPointIndex = 0;
2580    int64_t targetIndex = 0;
2581    readByte = ParameterDecoder::decodeInt64(
2582        parameterBlock.parameterBuffer,
2583        parameterBlock.parameterBufferSize,
2584        entryPointIndex);
2585    readByte += ParameterDecoder::decodeInt64(
2586        parameterBlock.parameterBuffer + readByte,
2587        parameterBlock.parameterBufferSize - readByte,
2588        targetIndex);
2589
2590    ObjectID outBlobId = 0;
2591    readByte = ParameterDecoder::decodeAddress(
2592        parameterBlock.outputBuffer,
2593        parameterBlock.outputBufferSize,
2594        outBlobId);
2595
2596    for (auto consumer : m_consumers)
2597    {
2598        consumer->ICompositeComponentType_getEntryPointHash(
2599            objectId,
2600            entryPointIndex,
2601            targetIndex,
2602            outBlobId);
2603    }
2604}
2605
2606void SlangDecoder::ICompositeComponentType_specialize(
2607    ObjectID objectId,
2608    ParameterBlock const& parameterBlock)
2609{
2610    slangRecordLog(
2611        LogLevel::Error,
2612        "%s: The shader reflection interfaces are not recordd\n",
2613        __PRETTY_FUNCTION__);
2614
2615    size_t readByte = 0;
2616    int64_t specializationArgCount = 0;
2617    readByte = ParameterDecoder::decodeInt64(
2618        parameterBlock.parameterBuffer,
2619        parameterBlock.parameterBufferSize,
2620        specializationArgCount);
2621
2622    std::vector<slang::SpecializationArg> specializationArgs;
2623
2624    uint32_t arraySize = 0;
2625    readByte += ParameterDecoder::decodeUint32(
2626        parameterBlock.parameterBuffer + readByte,
2627        parameterBlock.parameterBufferSize - readByte,
2628        arraySize);
2629
2630    SLANG_RECORD_ASSERT(arraySize == specializationArgCount);
2631
2632    specializationArgs.resize(specializationArgCount);
2633    readByte += ParameterDecoder::decodeStructArray(
2634        parameterBlock.parameterBuffer + readByte,
2635        parameterBlock.parameterBufferSize - readByte,
2636        specializationArgs.data(),
2637        specializationArgCount);
2638
2639    ObjectID outSpecializedComponentTypeId = 0;
2640    ObjectID outDiagnosticsId = 0;
2641    readByte = ParameterDecoder::decodeAddress(
2642        parameterBlock.outputBuffer,
2643        parameterBlock.outputBufferSize,
2644        outSpecializedComponentTypeId);
2645    readByte += ParameterDecoder::decodeAddress(
2646        parameterBlock.outputBuffer + readByte,
2647        parameterBlock.outputBufferSize - readByte,
2648        outDiagnosticsId);
2649
2650    for (auto consumer : m_consumers)
2651    {
2652        consumer->ICompositeComponentType_specialize(
2653            objectId,
2654            specializationArgs.data(),
2655            specializationArgCount,
2656            outSpecializedComponentTypeId,
2657            outDiagnosticsId);
2658    }
2659}
2660
2661void SlangDecoder::ICompositeComponentType_link(
2662    ObjectID objectId,
2663    ParameterBlock const& parameterBlock)
2664{
2665    size_t readByte = 0;
2666    ObjectID outLinkedComponentTypeId = 0;
2667    ObjectID outDiagnosticsId = 0;
2668    readByte = ParameterDecoder::decodeAddress(
2669        parameterBlock.outputBuffer,
2670        parameterBlock.outputBufferSize,
2671        outLinkedComponentTypeId);
2672    readByte += ParameterDecoder::decodeAddress(
2673        parameterBlock.outputBuffer + readByte,
2674        parameterBlock.outputBufferSize - readByte,
2675        outDiagnosticsId);
2676
2677    for (auto consumer : m_consumers)
2678    {
2679        consumer->ICompositeComponentType_link(
2680            objectId,
2681            outLinkedComponentTypeId,
2682            outDiagnosticsId);
2683    }
2684}
2685
2686void SlangDecoder::ICompositeComponentType_getEntryPointHostCallable(
2687    ObjectID objectId,
2688    ParameterBlock const& parameterBlock)
2689{
2690    size_t readByte = 0;
2691    int32_t entryPointIndex = 0;
2692    int32_t targetIndex = 0;
2693    readByte = ParameterDecoder::decodeInt32(
2694        parameterBlock.parameterBuffer,
2695        parameterBlock.parameterBufferSize,
2696        entryPointIndex);
2697    readByte += ParameterDecoder::decodeInt32(
2698        parameterBlock.parameterBuffer + readByte,
2699        parameterBlock.parameterBufferSize - readByte,
2700        targetIndex);
2701
2702    ObjectID outSharedLibraryId = 0;
2703    ObjectID outDiagnosticsId = 0;
2704    readByte = ParameterDecoder::decodeAddress(
2705        parameterBlock.outputBuffer,
2706        parameterBlock.outputBufferSize,
2707        outSharedLibraryId);
2708    readByte += ParameterDecoder::decodeAddress(
2709        parameterBlock.outputBuffer + readByte,
2710        parameterBlock.outputBufferSize - readByte,
2711        outDiagnosticsId);
2712
2713    for (auto consumer : m_consumers)
2714    {
2715        consumer->ICompositeComponentType_getEntryPointHostCallable(
2716            objectId,
2717            entryPointIndex,
2718            targetIndex,
2719            outSharedLibraryId,
2720            outDiagnosticsId);
2721    }
2722}
2723
2724void SlangDecoder::ICompositeComponentType_renameEntryPoint(
2725    ObjectID objectId,
2726    ParameterBlock const& parameterBlock)
2727{
2728    StringDecoder newName;
2729    ParameterDecoder::decodeString(
2730        parameterBlock.parameterBuffer,
2731        parameterBlock.parameterBufferSize,
2732        newName);
2733
2734    ObjectID outEntryPointId = 0;
2735    ParameterDecoder::decodeAddress(
2736        parameterBlock.outputBuffer,
2737        parameterBlock.outputBufferSize,
2738        outEntryPointId);
2739
2740    for (auto consumer : m_consumers)
2741    {
2742        consumer->ICompositeComponentType_renameEntryPoint(
2743            objectId,
2744            newName.getPointer(),
2745            outEntryPointId);
2746    }
2747}
2748
2749void SlangDecoder::ICompositeComponentType_linkWithOptions(
2750    ObjectID objectId,
2751    ParameterBlock const& parameterBlock)
2752{
2753    size_t readByte = 0;
2754    uint32_t compilerOptionEntryCount = 0;
2755    readByte = ParameterDecoder::decodeUint32(
2756        parameterBlock.parameterBuffer,
2757        parameterBlock.parameterBufferSize,
2758        compilerOptionEntryCount);
2759
2760    std::vector<slang::CompilerOptionEntry> compilerOptionEntries;
2761
2762    uint32_t arrayCount = 0;
2763    readByte += ParameterDecoder::decodeUint32(
2764        parameterBlock.parameterBuffer + readByte,
2765        parameterBlock.parameterBufferSize - readByte,
2766        arrayCount);
2767
2768    SLANG_RECORD_ASSERT(arrayCount == compilerOptionEntryCount);
2769    compilerOptionEntries.resize(compilerOptionEntryCount);
2770
2771    readByte += ParameterDecoder::decodeStructArray(
2772        parameterBlock.parameterBuffer + readByte,
2773        parameterBlock.parameterBufferSize - readByte,
2774        compilerOptionEntries.data(),
2775        compilerOptionEntryCount);
2776
2777    ObjectID outLinkedComponentTypeId = 0;
2778    ObjectID outDiagnosticsId = 0;
2779    readByte = ParameterDecoder::decodeAddress(
2780        parameterBlock.outputBuffer,
2781        parameterBlock.outputBufferSize,
2782        outLinkedComponentTypeId);
2783    readByte += ParameterDecoder::decodeAddress(
2784        parameterBlock.outputBuffer + readByte,
2785        parameterBlock.outputBufferSize - readByte,
2786        outDiagnosticsId);
2787
2788    for (auto consumer : m_consumers)
2789    {
2790        consumer->ICompositeComponentType_linkWithOptions(
2791            objectId,
2792            outLinkedComponentTypeId,
2793            compilerOptionEntryCount,
2794            compilerOptionEntries.data(),
2795            outDiagnosticsId);
2796    }
2797}
2798
2799void SlangDecoder::ICompositeComponentType_queryInterface(
2800    ObjectID objectId,
2801    ParameterBlock const& parameterBlock)
2802{
2803    size_t readByte = 0;
2804
2805    // Decode the GUID
2806    SlangUUID guid;
2807    readByte = ParameterDecoder::decodeUint32(
2808        parameterBlock.parameterBuffer,
2809        parameterBlock.parameterBufferSize,
2810        guid.data1);
2811    readByte += ParameterDecoder::decodeUint16(
2812        parameterBlock.parameterBuffer + readByte,
2813        parameterBlock.parameterBufferSize - readByte,
2814        guid.data2);
2815    readByte += ParameterDecoder::decodeUint16(
2816        parameterBlock.parameterBuffer + readByte,
2817        parameterBlock.parameterBufferSize - readByte,
2818        guid.data3);
2819    for (int i = 0; i < 8; i++)
2820    {
2821        readByte += ParameterDecoder::decodeUint8(
2822            parameterBlock.parameterBuffer + readByte,
2823            parameterBlock.parameterBufferSize - readByte,
2824            guid.data4[i]);
2825    }
2826
2827    // Decode the output interface pointer
2828    ObjectID outInterfaceId = 0;
2829    readByte = ParameterDecoder::decodeAddress(
2830        parameterBlock.outputBuffer,
2831        parameterBlock.outputBufferSize,
2832        outInterfaceId);
2833
2834    for (auto consumer : m_consumers)
2835    {
2836        consumer->ICompositeComponentType_queryInterface(objectId, guid, outInterfaceId);
2837    }
2838}
2839
2840void SlangDecoder::ITypeConformance_getSession(
2841    ObjectID objectId,
2842    ParameterBlock const& parameterBlock)
2843{
2844    (void)objectId;
2845    (void)parameterBlock;
2846    slangRecordLog(
2847        LogLevel::Debug,
2848        "%s should not be called, it'a not recordd\n",
2849        __PRETTY_FUNCTION__);
2850}
2851
2852void SlangDecoder::ITypeConformance_getLayout(
2853    ObjectID objectId,
2854    ParameterBlock const& parameterBlock)
2855{
2856    int64_t targetIndex = 0;
2857    ParameterDecoder::decodeInt64(
2858        parameterBlock.parameterBuffer,
2859        parameterBlock.parameterBufferSize,
2860        targetIndex);
2861    ObjectID outDiagnosticsId = 0;
2862    ObjectID programLayoutId = 0;
2863
2864    size_t readByte = 0;
2865    readByte = ParameterDecoder::decodeAddress(
2866        parameterBlock.outputBuffer,
2867        parameterBlock.outputBufferSize,
2868        outDiagnosticsId);
2869    readByte += ParameterDecoder::decodeAddress(
2870        parameterBlock.outputBuffer + readByte,
2871        parameterBlock.outputBufferSize - readByte,
2872        programLayoutId);
2873
2874    for (auto consumer : m_consumers)
2875    {
2876        consumer
2877            ->ITypeConformance_getLayout(objectId, targetIndex, outDiagnosticsId, programLayoutId);
2878    }
2879}
2880
2881void SlangDecoder::ITypeConformance_getSpecializationParamCount(
2882    ObjectID objectId,
2883    ParameterBlock const& parameterBlock)
2884{
2885    (void)objectId;
2886    (void)parameterBlock;
2887    slangRecordLog(
2888        LogLevel::Debug,
2889        "%s should not be called, it'a not recordd\n",
2890        __PRETTY_FUNCTION__);
2891}
2892
2893void SlangDecoder::ITypeConformance_getEntryPointCode(
2894    ObjectID objectId,
2895    ParameterBlock const& parameterBlock)
2896{
2897    size_t readByte = 0;
2898    int64_t entryPointIndex = 0;
2899    int64_t targetIndex = 0;
2900    readByte = ParameterDecoder::decodeInt64(
2901        parameterBlock.parameterBuffer,
2902        parameterBlock.parameterBufferSize,
2903        entryPointIndex);
2904    readByte += ParameterDecoder::decodeInt64(
2905        parameterBlock.parameterBuffer + readByte,
2906        parameterBlock.parameterBufferSize - readByte,
2907        targetIndex);
2908
2909    ObjectID outCodeId = 0;
2910    ObjectID outDiagnosticsId = 0;
2911    readByte = ParameterDecoder::decodeAddress(
2912        parameterBlock.outputBuffer,
2913        parameterBlock.outputBufferSize,
2914        outCodeId);
2915    readByte += ParameterDecoder::decodeAddress(
2916        parameterBlock.outputBuffer + readByte,
2917        parameterBlock.outputBufferSize - readByte,
2918        outDiagnosticsId);
2919
2920    for (auto consumer : m_consumers)
2921    {
2922        consumer->ITypeConformance_getEntryPointCode(
2923            objectId,
2924            entryPointIndex,
2925            targetIndex,
2926            outCodeId,
2927            outDiagnosticsId);
2928    }
2929}
2930
2931void SlangDecoder::ITypeConformance_getTargetCode(
2932    ObjectID objectId,
2933    ParameterBlock const& parameterBlock)
2934{
2935    size_t readByte = 0;
2936    int64_t targetIndex = 0;
2937    readByte = ParameterDecoder::decodeInt64(
2938        parameterBlock.parameterBuffer,
2939        parameterBlock.parameterBufferSize,
2940        targetIndex);
2941
2942    ObjectID outCodeId = 0;
2943    ObjectID outDiagnosticsId = 0;
2944    readByte = ParameterDecoder::decodeAddress(
2945        parameterBlock.outputBuffer,
2946        parameterBlock.outputBufferSize,
2947        outCodeId);
2948    readByte += ParameterDecoder::decodeAddress(
2949        parameterBlock.outputBuffer + readByte,
2950        parameterBlock.parameterBufferSize - readByte,
2951        outDiagnosticsId);
2952
2953    for (auto consumer : m_consumers)
2954    {
2955        consumer
2956            ->ITypeConformance_getTargetCode(objectId, targetIndex, outCodeId, outDiagnosticsId);
2957    }
2958}
2959
2960void SlangDecoder::ITypeConformance_getResultAsFileSystem(
2961    ObjectID objectId,
2962    ParameterBlock const& parameterBlock)
2963{
2964    size_t readByte = 0;
2965    int64_t entryPointIndex = 0;
2966    int64_t targetIndex = 0;
2967    readByte = ParameterDecoder::decodeInt64(
2968        parameterBlock.parameterBuffer,
2969        parameterBlock.parameterBufferSize,
2970        entryPointIndex);
2971    readByte += ParameterDecoder::decodeInt64(
2972        parameterBlock.parameterBuffer + readByte,
2973        parameterBlock.parameterBufferSize - readByte,
2974        targetIndex);
2975
2976    ObjectID outFileSystemId = 0;
2977    readByte = ParameterDecoder::decodeAddress(
2978        parameterBlock.outputBuffer,
2979        parameterBlock.outputBufferSize,
2980        outFileSystemId);
2981
2982    for (auto consumer : m_consumers)
2983    {
2984        consumer->ITypeConformance_getResultAsFileSystem(
2985            objectId,
2986            entryPointIndex,
2987            targetIndex,
2988            outFileSystemId);
2989    }
2990}
2991
2992void SlangDecoder::ITypeConformance_getEntryPointHash(
2993    ObjectID objectId,
2994    ParameterBlock const& parameterBlock)
2995{
2996    size_t readByte = 0;
2997    int64_t entryPointIndex = 0;
2998    int64_t targetIndex = 0;
2999    readByte = ParameterDecoder::decodeInt64(
3000        parameterBlock.parameterBuffer,
3001        parameterBlock.parameterBufferSize,
3002        entryPointIndex);
3003    readByte += ParameterDecoder::decodeInt64(
3004        parameterBlock.parameterBuffer + readByte,
3005        parameterBlock.parameterBufferSize - readByte,
3006        targetIndex);
3007
3008    ObjectID outBlobId = 0;
3009    readByte = ParameterDecoder::decodeAddress(
3010        parameterBlock.outputBuffer,
3011        parameterBlock.outputBufferSize,
3012        outBlobId);
3013
3014    for (auto consumer : m_consumers)
3015    {
3016        consumer
3017            ->ITypeConformance_getEntryPointHash(objectId, entryPointIndex, targetIndex, outBlobId);
3018    }
3019}
3020
3021void SlangDecoder::ITypeConformance_specialize(
3022    ObjectID objectId,
3023    ParameterBlock const& parameterBlock)
3024{
3025    slangRecordLog(
3026        LogLevel::Error,
3027        "%s: The shader reflection interfaces are not recordd\n",
3028        __PRETTY_FUNCTION__);
3029
3030    size_t readByte = 0;
3031    int64_t specializationArgCount = 0;
3032    readByte = ParameterDecoder::decodeInt64(
3033        parameterBlock.parameterBuffer,
3034        parameterBlock.parameterBufferSize,
3035        specializationArgCount);
3036
3037    std::vector<slang::SpecializationArg> specializationArgs;
3038
3039    uint32_t arraySize = 0;
3040    readByte += ParameterDecoder::decodeUint32(
3041        parameterBlock.parameterBuffer + readByte,
3042        parameterBlock.parameterBufferSize - readByte,
3043        arraySize);
3044
3045    SLANG_RECORD_ASSERT(arraySize == specializationArgCount);
3046
3047    specializationArgs.resize(specializationArgCount);
3048    readByte += ParameterDecoder::decodeStructArray(
3049        parameterBlock.parameterBuffer + readByte,
3050        parameterBlock.parameterBufferSize - readByte,
3051        specializationArgs.data(),
3052        specializationArgCount);
3053
3054    ObjectID outSpecializedComponentTypeId = 0;
3055    ObjectID outDiagnosticsId = 0;
3056    readByte = ParameterDecoder::decodeAddress(
3057        parameterBlock.outputBuffer,
3058        parameterBlock.outputBufferSize,
3059        outSpecializedComponentTypeId);
3060    readByte += ParameterDecoder::decodeAddress(
3061        parameterBlock.outputBuffer + readByte,
3062        parameterBlock.outputBufferSize - readByte,
3063        outDiagnosticsId);
3064
3065    for (auto consumer : m_consumers)
3066    {
3067        consumer->IModule_specialize(
3068            objectId,
3069            specializationArgs.data(),
3070            specializationArgCount,
3071            outSpecializedComponentTypeId,
3072            outDiagnosticsId);
3073    }
3074}
3075
3076void SlangDecoder::ITypeConformance_link(ObjectID objectId, ParameterBlock const& parameterBlock)
3077{
3078    size_t readByte = 0;
3079    ObjectID outLinkedComponentTypeId = 0;
3080    ObjectID outDiagnosticsId = 0;
3081    readByte = ParameterDecoder::decodeAddress(
3082        parameterBlock.outputBuffer,
3083        parameterBlock.outputBufferSize,
3084        outLinkedComponentTypeId);
3085    readByte += ParameterDecoder::decodeAddress(
3086        parameterBlock.outputBuffer + readByte,
3087        parameterBlock.outputBufferSize - readByte,
3088        outDiagnosticsId);
3089
3090    for (auto consumer : m_consumers)
3091    {
3092        consumer->ITypeConformance_link(objectId, outLinkedComponentTypeId, outDiagnosticsId);
3093    }
3094}
3095
3096void SlangDecoder::ITypeConformance_getEntryPointHostCallable(
3097    ObjectID objectId,
3098    ParameterBlock const& parameterBlock)
3099{
3100    size_t readByte = 0;
3101    int32_t entryPointIndex = 0;
3102    int32_t targetIndex = 0;
3103    readByte = ParameterDecoder::decodeInt32(
3104        parameterBlock.parameterBuffer,
3105        parameterBlock.parameterBufferSize,
3106        entryPointIndex);
3107    readByte += ParameterDecoder::decodeInt32(
3108        parameterBlock.parameterBuffer + readByte,
3109        parameterBlock.parameterBufferSize - readByte,
3110        targetIndex);
3111
3112    ObjectID outSharedLibraryId = 0;
3113    ObjectID outDiagnosticsId = 0;
3114    readByte = ParameterDecoder::decodeAddress(
3115        parameterBlock.outputBuffer,
3116        parameterBlock.outputBufferSize,
3117        outSharedLibraryId);
3118    readByte += ParameterDecoder::decodeAddress(
3119        parameterBlock.outputBuffer + readByte,
3120        parameterBlock.outputBufferSize - readByte,
3121        outDiagnosticsId);
3122
3123    for (auto consumer : m_consumers)
3124    {
3125        consumer->ITypeConformance_getEntryPointHostCallable(
3126            objectId,
3127            entryPointIndex,
3128            targetIndex,
3129            outSharedLibraryId,
3130            outDiagnosticsId);
3131    }
3132}
3133
3134void SlangDecoder::ITypeConformance_renameEntryPoint(
3135    ObjectID objectId,
3136    ParameterBlock const& parameterBlock)
3137{
3138    StringDecoder newName;
3139    ParameterDecoder::decodeString(
3140        parameterBlock.parameterBuffer,
3141        parameterBlock.parameterBufferSize,
3142        newName);
3143
3144    ObjectID outEntryPointId = 0;
3145    ParameterDecoder::decodeAddress(
3146        parameterBlock.outputBuffer,
3147        parameterBlock.outputBufferSize,
3148        outEntryPointId);
3149
3150    for (auto consumer : m_consumers)
3151    {
3152        consumer->ITypeConformance_renameEntryPoint(
3153            objectId,
3154            newName.getPointer(),
3155            outEntryPointId);
3156    }
3157}
3158
3159void SlangDecoder::ITypeConformance_linkWithOptions(
3160    ObjectID objectId,
3161    ParameterBlock const& parameterBlock)
3162{
3163    size_t readByte = 0;
3164    uint32_t compilerOptionEntryCount = 0;
3165    readByte = ParameterDecoder::decodeUint32(
3166        parameterBlock.parameterBuffer,
3167        parameterBlock.parameterBufferSize,
3168        compilerOptionEntryCount);
3169
3170    std::vector<slang::CompilerOptionEntry> compilerOptionEntries;
3171
3172    uint32_t arrayCount = 0;
3173    readByte += ParameterDecoder::decodeUint32(
3174        parameterBlock.parameterBuffer + readByte,
3175        parameterBlock.parameterBufferSize - readByte,
3176        arrayCount);
3177
3178    SLANG_RECORD_ASSERT(arrayCount == compilerOptionEntryCount);
3179    compilerOptionEntries.resize(compilerOptionEntryCount);
3180
3181    readByte += ParameterDecoder::decodeStructArray(
3182        parameterBlock.parameterBuffer + readByte,
3183        parameterBlock.parameterBufferSize - readByte,
3184        compilerOptionEntries.data(),
3185        compilerOptionEntryCount);
3186
3187    ObjectID outLinkedComponentTypeId = 0;
3188    ObjectID outDiagnosticsId = 0;
3189    readByte = ParameterDecoder::decodeAddress(
3190        parameterBlock.outputBuffer,
3191        parameterBlock.outputBufferSize,
3192        outLinkedComponentTypeId);
3193    readByte += ParameterDecoder::decodeAddress(
3194        parameterBlock.outputBuffer + readByte,
3195        parameterBlock.outputBufferSize - readByte,
3196        outDiagnosticsId);
3197
3198    for (auto consumer : m_consumers)
3199    {
3200        consumer->ITypeConformance_linkWithOptions(
3201            objectId,
3202            outLinkedComponentTypeId,
3203            compilerOptionEntryCount,
3204            compilerOptionEntries.data(),
3205            outDiagnosticsId);
3206    }
3207}
3208
3209void SlangDecoder::IComponentType2_getTargetCompileResult(
3210    ObjectID objectId,
3211    ParameterBlock const& parameterBlock)
3212{
3213    size_t readByte = 0;
3214    int64_t targetIndex = 0;
3215    readByte = ParameterDecoder::decodeInt64(
3216        parameterBlock.parameterBuffer,
3217        parameterBlock.parameterBufferSize,
3218        targetIndex);
3219
3220    ObjectID outCompileResultId = 0;
3221    ObjectID outDiagnosticsId = 0;
3222    readByte = ParameterDecoder::decodeAddress(
3223        parameterBlock.outputBuffer,
3224        parameterBlock.outputBufferSize,
3225        outCompileResultId);
3226    readByte += ParameterDecoder::decodeAddress(
3227        parameterBlock.outputBuffer + readByte,
3228        parameterBlock.outputBufferSize - readByte,
3229        outDiagnosticsId);
3230
3231    for (auto consumer : m_consumers)
3232    {
3233        consumer->IComponentType2_getTargetCompileResult(
3234            objectId,
3235            targetIndex,
3236            outCompileResultId,
3237            outDiagnosticsId);
3238    }
3239}
3240
3241void SlangDecoder::IComponentType2_getEntryPointCompileResult(
3242    ObjectID objectId,
3243    ParameterBlock const& parameterBlock)
3244{
3245    size_t readByte = 0;
3246    int64_t targetIndex = 0;
3247    int64_t entryPointIndex = 0;
3248    readByte = ParameterDecoder::decodeInt64(
3249        parameterBlock.parameterBuffer,
3250        parameterBlock.parameterBufferSize,
3251        targetIndex);
3252    readByte += ParameterDecoder::decodeInt64(
3253        parameterBlock.parameterBuffer + readByte,
3254        parameterBlock.parameterBufferSize - readByte,
3255        entryPointIndex);
3256
3257    ObjectID outCompileResultId = 0;
3258    ObjectID outDiagnosticsId = 0;
3259    readByte = ParameterDecoder::decodeAddress(
3260        parameterBlock.outputBuffer,
3261        parameterBlock.outputBufferSize,
3262        outCompileResultId);
3263    readByte += ParameterDecoder::decodeAddress(
3264        parameterBlock.outputBuffer + readByte,
3265        parameterBlock.outputBufferSize - readByte,
3266        outDiagnosticsId);
3267
3268    for (auto consumer : m_consumers)
3269    {
3270        consumer->IComponentType2_getEntryPointCompileResult(
3271            objectId,
3272            entryPointIndex,
3273            targetIndex,
3274            outCompileResultId,
3275            outDiagnosticsId);
3276    }
3277}
3278} // namespace SlangRecord