Add ShClearResults() for clearing last compilation results.
This helps reclaiming memory used by the results when we don't need
them anymore.
BUG=492725
Change-Id: I4bc11be27b23589548120f0dc43e9979bf894089
Reviewed-on: https://chromium-review.googlesource.com/277808
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Dmitry Skiba <dskiba@google.com>
Tested-by: Dmitry Skiba <dskiba@google.com>
Reviewed-by: Dmitry Skiba <dskiba@google.com>
diff --git a/src/compiler/translator/ShaderLang.cpp b/src/compiler/translator/ShaderLang.cpp
index b8040da..ae9c3a4 100644
--- a/src/compiler/translator/ShaderLang.cpp
+++ b/src/compiler/translator/ShaderLang.cpp
@@ -240,6 +240,13 @@
return compiler->compile(shaderStrings, numStrings, compileOptions);
}
+void ShClearResults(const ShHandle handle)
+{
+ TCompiler *compiler = GetCompilerFromHandle(handle);
+ ASSERT(compiler);
+ compiler->clearResults();
+}
+
int ShGetShaderVersion(const ShHandle handle)
{
TCompiler* compiler = GetCompilerFromHandle(handle);