From e39893e8eb1a9411fca4e5f885456a27a770d3a2 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 10 Mar 2023 12:24:51 -0500 Subject: Add struct version to DownstreamCompiler::CompileOptions interface (#2692) * #include an absolute path didn't work - because paths were taken to always be relative. * Add versioning to CompileOptions for DownstreamCompiler so we can add new options without breaking binary interface. * Use builtin offset of directly. --- source/compiler-core/slang-nvrtc-compiler.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/compiler-core/slang-nvrtc-compiler.cpp') diff --git a/source/compiler-core/slang-nvrtc-compiler.cpp b/source/compiler-core/slang-nvrtc-compiler.cpp index f650a11f5..e7e90be60 100644 --- a/source/compiler-core/slang-nvrtc-compiler.cpp +++ b/source/compiler-core/slang-nvrtc-compiler.cpp @@ -699,8 +699,16 @@ SlangResult NVRTCDownstreamCompiler::_maybeAddHalfSupport(const DownstreamCompil return SLANG_OK; } -SlangResult NVRTCDownstreamCompiler::compile(const DownstreamCompileOptions& options, IArtifact** outArtifact) +SlangResult NVRTCDownstreamCompiler::compile(const DownstreamCompileOptions& inOptions, IArtifact** outArtifact) { + if (!isVersionCompatible(inOptions)) + { + // Not possible to compile with this version of the interface. + return SLANG_E_NOT_IMPLEMENTED; + } + + CompileOptions options = getCompatibleVersion(&inOptions); + // This compiler can only deal with a single artifact if (options.sourceArtifacts.count != 1) { -- cgit v1.2.3