From 812e478989e27983b8dea7ab11964de751654ba2 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 4 Jun 2025 13:05:58 -0700 Subject: Make interface types non c-style in Slang2026. (#7260) * Make interface types non c-style. * Make Optional work with autodiff and existential types. * Fix. * patch behind slang 2026. * Fix warnings. * cleanup. * Fix tests. * Fix. * Fix com interface lowering. * Add comment to test. * regenerate command line reference * Add test for passing `none` to autodiff function. * Fix recording of `getDynamicObjectRTTIBytes`. * Fix nested Optional types. --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- source/slang/slang-options.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/slang/slang-options.cpp') diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index 3ce107135..c269b10c4 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -530,6 +530,10 @@ void initCommandOptions(CommandOptions& options) nullptr, "Preserve all resource parameters in the output code, even if they are not used by the " "shader."}, + {OptionKind::TypeConformance, + "-conformance", + "-conformance :[=]", + "Include additional type conformance during linking for dynamic dispatch."}, {OptionKind::EmitReflectionJSON, "-reflection-json", "reflection-json ", @@ -2736,6 +2740,17 @@ SlangResult OptionsParser::_parse(int argc, char const* const* argv) m_compileRequest->addSearchPath(String(slice).getBuffer()); break; } + case OptionKind::TypeConformance: + { + if (!m_reader.hasArg()) + break; + CommandLineArg operand; + SLANG_RETURN_ON_FAIL(m_reader.expectArg(operand)); + auto unquoted = + StringEscapeUtil::maybeUnquoteCommandLineArg(operand.value.getUnownedSlice()); + linkage->m_optionSet.add(OptionKind::TypeConformance, unquoted); + break; + } case OptionKind::Output: { // -- cgit v1.2.3