summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 66e75a282..f820bf8cd 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -6245,6 +6245,25 @@ void const* EndToEndCompileRequest::getEntryPointCode(int entryPointIndex, size_
return (void*)blob->getBufferPointer();
}
+SlangResult EndToEndCompileRequest::getCompileTimeProfile(ISlangProfiler** compileTimeProfile, bool shouldClear)
+{
+ if (compileTimeProfile == nullptr)
+ {
+ return SLANG_E_INVALID_ARG;
+ }
+
+ SlangProfiler* profiler = new SlangProfiler(PerformanceProfiler::getProfiler());
+
+ if (shouldClear)
+ {
+ PerformanceProfiler::getProfiler()->clear();
+ }
+
+ ComPtr<ISlangProfiler> result(profiler);
+ *compileTimeProfile = result.detach();
+ return SLANG_OK;
+}
+
static SlangResult _getEntryPointResult(
EndToEndCompileRequest* req,
int entryPointIndex,