|
| 1 | +#include "capture_utility.h" |
| 2 | +#include "slang-composite-component-type.h" |
| 3 | + |
| 4 | +namespace SlangCapture |
| 5 | +{ |
| 6 | + CompositeComponentTypeCapture::CompositeComponentTypeCapture(slang::IComponentType* componentType) |
| 7 | + : m_actualCompositeComponentType(componentType) |
| 8 | + { |
| 9 | + SLANG_CAPTURE_ASSERT(m_actualCompositeComponentType != nullptr); |
| 10 | + slangCaptureLog(LogLevel::Verbose, "%s: %p\n", __PRETTY_FUNCTION__, componentType); |
| 11 | + } |
| 12 | + |
| 13 | + CompositeComponentTypeCapture::~CompositeComponentTypeCapture() |
| 14 | + { |
| 15 | + m_actualCompositeComponentType->release(); |
| 16 | + } |
| 17 | + |
| 18 | + ISlangUnknown* CompositeComponentTypeCapture::getInterface(const Guid& guid) |
| 19 | + { |
| 20 | + if (guid == IComponentType::getTypeGuid()) |
| 21 | + { |
| 22 | + return static_cast<ISlangUnknown*>(this); |
| 23 | + } |
| 24 | + return nullptr; |
| 25 | + } |
| 26 | + |
| 27 | + SLANG_NO_THROW slang::ISession* CompositeComponentTypeCapture::getSession() |
| 28 | + { |
| 29 | + slangCaptureLog(LogLevel::Verbose, "%s\n", __PRETTY_FUNCTION__); |
| 30 | + slang::ISession* res = m_actualCompositeComponentType->getSession(); |
| 31 | + return res; |
| 32 | + } |
| 33 | + |
| 34 | + SLANG_NO_THROW slang::ProgramLayout* CompositeComponentTypeCapture::getLayout( |
| 35 | + SlangInt targetIndex, |
| 36 | + slang::IBlob** outDiagnostics) |
| 37 | + { |
| 38 | + slangCaptureLog(LogLevel::Verbose, "%s\n", __PRETTY_FUNCTION__); |
| 39 | + slang::ProgramLayout* res = m_actualCompositeComponentType->getLayout(targetIndex, outDiagnostics); |
| 40 | + return res; |
| 41 | + } |
| 42 | + |
| 43 | + SLANG_NO_THROW SlangInt CompositeComponentTypeCapture::getSpecializationParamCount() |
| 44 | + { |
| 45 | + slangCaptureLog(LogLevel::Verbose, "%s\n", __PRETTY_FUNCTION__); |
| 46 | + SlangInt res = m_actualCompositeComponentType->getSpecializationParamCount(); |
| 47 | + return res; |
| 48 | + } |
| 49 | + |
| 50 | + SLANG_NO_THROW SlangResult CompositeComponentTypeCapture::getEntryPointCode( |
| 51 | + SlangInt entryPointIndex, |
| 52 | + SlangInt targetIndex, |
| 53 | + slang::IBlob** outCode, |
| 54 | + slang::IBlob** outDiagnostics) |
| 55 | + { |
| 56 | + slangCaptureLog(LogLevel::Verbose, "%s\n", __PRETTY_FUNCTION__); |
| 57 | + SlangResult res = m_actualCompositeComponentType->getEntryPointCode(entryPointIndex, targetIndex, outCode, outDiagnostics); |
| 58 | + return res; |
| 59 | + } |
| 60 | + |
| 61 | + SLANG_NO_THROW SlangResult CompositeComponentTypeCapture::getResultAsFileSystem( |
| 62 | + SlangInt entryPointIndex, |
| 63 | + SlangInt targetIndex, |
| 64 | + ISlangMutableFileSystem** outFileSystem) |
| 65 | + { |
| 66 | + slangCaptureLog(LogLevel::Verbose, "%s\n", __PRETTY_FUNCTION__); |
| 67 | + SlangResult res = m_actualCompositeComponentType->getResultAsFileSystem(entryPointIndex, targetIndex, outFileSystem); |
| 68 | + return res; |
| 69 | + } |
| 70 | + |
| 71 | + SLANG_NO_THROW void CompositeComponentTypeCapture::getEntryPointHash( |
| 72 | + SlangInt entryPointIndex, |
| 73 | + SlangInt targetIndex, |
| 74 | + slang::IBlob** outHash) |
| 75 | + { |
| 76 | + slangCaptureLog(LogLevel::Verbose, "%s\n", __PRETTY_FUNCTION__); |
| 77 | + m_actualCompositeComponentType->getEntryPointHash(entryPointIndex, targetIndex, outHash); |
| 78 | + } |
| 79 | + |
| 80 | + SLANG_NO_THROW SlangResult CompositeComponentTypeCapture::specialize( |
| 81 | + slang::SpecializationArg const* specializationArgs, |
| 82 | + SlangInt specializationArgCount, |
| 83 | + slang::IComponentType** outSpecializedComponentType, |
| 84 | + ISlangBlob** outDiagnostics) |
| 85 | + { |
| 86 | + slangCaptureLog(LogLevel::Verbose, "%s\n", __PRETTY_FUNCTION__); |
| 87 | + SlangResult res = m_actualCompositeComponentType->specialize(specializationArgs, specializationArgCount, outSpecializedComponentType, outDiagnostics); |
| 88 | + return res; |
| 89 | + } |
| 90 | + |
| 91 | + SLANG_NO_THROW SlangResult CompositeComponentTypeCapture::link( |
| 92 | + slang::IComponentType** outLinkedComponentType, |
| 93 | + ISlangBlob** outDiagnostics) |
| 94 | + { |
| 95 | + slangCaptureLog(LogLevel::Verbose, "%s\n", __PRETTY_FUNCTION__); |
| 96 | + SlangResult res = m_actualCompositeComponentType->link(outLinkedComponentType, outDiagnostics); |
| 97 | + return res; |
| 98 | + } |
| 99 | + |
| 100 | + SLANG_NO_THROW SlangResult CompositeComponentTypeCapture::getEntryPointHostCallable( |
| 101 | + int entryPointIndex, |
| 102 | + int targetIndex, |
| 103 | + ISlangSharedLibrary** outSharedLibrary, |
| 104 | + slang::IBlob** outDiagnostics) |
| 105 | + { |
| 106 | + slangCaptureLog(LogLevel::Verbose, "%s\n", __PRETTY_FUNCTION__); |
| 107 | + SlangResult res = m_actualCompositeComponentType->getEntryPointHostCallable(entryPointIndex, targetIndex, outSharedLibrary, outDiagnostics); |
| 108 | + return res; |
| 109 | + } |
| 110 | + |
| 111 | + SLANG_NO_THROW SlangResult CompositeComponentTypeCapture::renameEntryPoint( |
| 112 | + const char* newName, IComponentType** outEntryPoint) |
| 113 | + { |
| 114 | + slangCaptureLog(LogLevel::Verbose, "%s\n", __PRETTY_FUNCTION__); |
| 115 | + SlangResult res = m_actualCompositeComponentType->renameEntryPoint(newName, outEntryPoint); |
| 116 | + return res; |
| 117 | + } |
| 118 | + |
| 119 | + SLANG_NO_THROW SlangResult CompositeComponentTypeCapture::linkWithOptions( |
| 120 | + IComponentType** outLinkedComponentType, |
| 121 | + uint32_t compilerOptionEntryCount, |
| 122 | + slang::CompilerOptionEntry* compilerOptionEntries, |
| 123 | + ISlangBlob** outDiagnostics) |
| 124 | + { |
| 125 | + slangCaptureLog(LogLevel::Verbose, "%s\n", __PRETTY_FUNCTION__); |
| 126 | + SlangResult res = m_actualCompositeComponentType->linkWithOptions(outLinkedComponentType, compilerOptionEntryCount, compilerOptionEntries, outDiagnostics); |
| 127 | + return res; |
| 128 | + } |
| 129 | +} |
0 commit comments