From 8ec5b3e6ef2e7e5c3adaa5accb375676b1c09ff0 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 22 Feb 2024 07:14:55 -0800 Subject: Add API for querying and reusing precompiled binary modules. (#3614) --- slang.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'slang.h') diff --git a/slang.h b/slang.h index 8fad8fbc6..30aa8f2a8 100644 --- a/slang.h +++ b/slang.h @@ -947,6 +947,8 @@ extern "C" DebugInformationFormat, // intValue0: DebugInfoFormat VulkanBindShiftAll, // intValue0: kind; intValue1: shift GenerateWholeProgram, // bool + UseUpToDateBinaryModule, // bool, when set, will only load + // precompiled modules if it is up-to-date with its source. CountOf, }; @@ -4633,6 +4635,12 @@ namespace slang virtual SLANG_NO_THROW SlangInt SLANG_MCALL getLoadedModuleCount() = 0; virtual SLANG_NO_THROW IModule* SLANG_MCALL getLoadedModule(SlangInt index) = 0; + + /** Checks if a precompiled binary module is up-to-date with the current compiler + * option settings and the source file contents. + */ + virtual SLANG_NO_THROW bool SLANG_MCALL isBinaryModuleUpToDate( + const char* modulePath, slang::IBlob* binaryModuleBlob) = 0; }; #define SLANG_UUID_ISession ISession::getTypeGuid() -- cgit v1.2.3