Remove gl::LinkResult.
Instead of returning a small struct from LinkProgram calls we use
angle::Result. Linking can have 3 cases:
- the link was successful -> angle::Result::Continue
- the link failed -> angle::Result::Incomplete
- there was an internal error -> angle::Result::Stop
Note that any unexpected Incomplete is still an error. Each function
that accepts Incomplete must check explicitly.
This is the last user of ErrorOrResult.
Bug: angleproject:2491
Change-Id: Idba23be27efe4b561720a4bdd8fe486b40779497
Reviewed-on: https://chromium-review.googlesource.com/c/1255645
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 58742c0..fa0edf9 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -5771,7 +5771,7 @@
// ProgramD3D.
if (programObject->isInUse())
{
- programObject->resolveLink();
+ programObject->resolveLink(this);
if (programObject->isLinked())
{
ANGLE_CONTEXT_TRY(mGLState.onProgramExecutableChange(this, programObject));
@@ -7781,7 +7781,7 @@
Program *program = mState.mShaderPrograms->getProgram(handle);
if (program)
{
- program->resolveLink();
+ program->resolveLink(this);
}
return program;
}
@@ -7924,6 +7924,7 @@
{
GLenum code = error.getCode();
mErrors.insert(code);
+
if (code == GL_OUT_OF_MEMORY && mContext->getWorkarounds().loseContextOnOutOfMemory)
{
mContext->markContextLost();