Pass a gl::Context to ShaderImpl methods.
Also add a destroy method.
BUG=angleproject:2464
Change-Id: I7346b799af4e7d64ed5cc3d5eca8e108ce2cf699
Reviewed-on: https://chromium-review.googlesource.com/1054213
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/Shader.cpp b/src/libANGLE/Shader.cpp
index a43b147..0da1039 100644
--- a/src/libANGLE/Shader.cpp
+++ b/src/libANGLE/Shader.cpp
@@ -130,6 +130,7 @@
void Shader::onDestroy(const gl::Context *context)
{
+ mImplementation->destroy(context);
mBoundCompiler.set(context, nullptr);
mImplementation.reset(nullptr);
delete this;
@@ -226,7 +227,7 @@
{
resolveCompile(context);
- const std::string &debugInfo = mImplementation->getDebugInfo();
+ const std::string &debugInfo = mImplementation->getDebugInfo(context);
if (debugInfo.empty())
{
return 0;
@@ -282,7 +283,7 @@
char *buffer)
{
resolveCompile(context);
- const std::string &debugInfo = mImplementation->getDebugInfo();
+ const std::string &debugInfo = mImplementation->getDebugInfo(context);
GetSourceImpl(debugInfo, bufSize, length, buffer);
}
@@ -312,8 +313,8 @@
std::stringstream sourceStream;
- mLastCompileOptions =
- mImplementation->prepareSourceAndReturnOptions(&sourceStream, &mLastCompiledSourcePath);
+ mLastCompileOptions = mImplementation->prepareSourceAndReturnOptions(context, &sourceStream,
+ &mLastCompiledSourcePath);
mLastCompileOptions |= (SH_OBJECT_CODE | SH_VARIABLES);
mLastCompiledSource = sourceStream.str();
@@ -447,7 +448,7 @@
ASSERT(!mState.mTranslatedSource.empty());
- bool success = mImplementation->postTranslateCompile(mBoundCompiler.get(), &mInfoLog);
+ bool success = mImplementation->postTranslateCompile(context, mBoundCompiler.get(), &mInfoLog);
mState.mCompileStatus = success ? CompileStatus::COMPILED : CompileStatus::NOT_COMPILED;
}