Use angle::Result in front-end (Part 2)

Handles the gl::Context class and its implementation.

Bug: angleproject:2491
Change-Id: I7b7eb0897d131a194f6b563b7e01756fd7adb7e1
Reviewed-on: https://chromium-review.googlesource.com/c/1280742
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index b30a8b3..5c8462b 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -690,8 +690,9 @@
         }
     }
 
-    // Notify the renderer of a context switch
-    ANGLE_TRY(mImplementation->onMakeCurrent(this));
+    // Notify the renderer of a context switch.
+    // TODO(jmadill): Fix this error handling. http://anglebug.com/2491
+    (void)(mImplementation->onMakeCurrent(this));
     return egl::NoError();
 }
 
diff --git a/src/libANGLE/renderer/ContextImpl.h b/src/libANGLE/renderer/ContextImpl.h
index 8d51287..4026ddf 100644
--- a/src/libANGLE/renderer/ContextImpl.h
+++ b/src/libANGLE/renderer/ContextImpl.h
@@ -34,49 +34,49 @@
 
     virtual void onDestroy(const gl::Context *context) {}
 
-    virtual gl::Error initialize() = 0;
+    virtual angle::Result initialize() = 0;
 
     // Flush and finish.
-    virtual gl::Error flush(const gl::Context *context)  = 0;
-    virtual gl::Error finish(const gl::Context *context) = 0;
+    virtual angle::Result flush(const gl::Context *context)  = 0;
+    virtual angle::Result finish(const gl::Context *context) = 0;
 
     // Drawing methods.
     virtual angle::Result drawArrays(const gl::Context *context,
                                      gl::PrimitiveMode mode,
                                      GLint first,
                                      GLsizei count)              = 0;
-    virtual gl::Error drawArraysInstanced(const gl::Context *context,
-                                          gl::PrimitiveMode mode,
-                                          GLint first,
-                                          GLsizei count,
-                                          GLsizei instanceCount) = 0;
+    virtual angle::Result drawArraysInstanced(const gl::Context *context,
+                                              gl::PrimitiveMode mode,
+                                              GLint first,
+                                              GLsizei count,
+                                              GLsizei instanceCount) = 0;
 
-    virtual gl::Error drawElements(const gl::Context *context,
-                                   gl::PrimitiveMode mode,
-                                   GLsizei count,
-                                   GLenum type,
-                                   const void *indices)        = 0;
-    virtual gl::Error drawElementsInstanced(const gl::Context *context,
+    virtual angle::Result drawElements(const gl::Context *context,
+                                       gl::PrimitiveMode mode,
+                                       GLsizei count,
+                                       GLenum type,
+                                       const void *indices)        = 0;
+    virtual angle::Result drawElementsInstanced(const gl::Context *context,
+                                                gl::PrimitiveMode mode,
+                                                GLsizei count,
+                                                GLenum type,
+                                                const void *indices,
+                                                GLsizei instances) = 0;
+    virtual angle::Result drawRangeElements(const gl::Context *context,
                                             gl::PrimitiveMode mode,
+                                            GLuint start,
+                                            GLuint end,
                                             GLsizei count,
                                             GLenum type,
-                                            const void *indices,
-                                            GLsizei instances) = 0;
-    virtual gl::Error drawRangeElements(const gl::Context *context,
-                                        gl::PrimitiveMode mode,
-                                        GLuint start,
-                                        GLuint end,
-                                        GLsizei count,
-                                        GLenum type,
-                                        const void *indices)   = 0;
+                                            const void *indices)   = 0;
 
-    virtual gl::Error drawArraysIndirect(const gl::Context *context,
-                                         gl::PrimitiveMode mode,
-                                         const void *indirect)   = 0;
-    virtual gl::Error drawElementsIndirect(const gl::Context *context,
-                                           gl::PrimitiveMode mode,
-                                           GLenum type,
-                                           const void *indirect) = 0;
+    virtual angle::Result drawArraysIndirect(const gl::Context *context,
+                                             gl::PrimitiveMode mode,
+                                             const void *indirect)   = 0;
+    virtual angle::Result drawElementsIndirect(const gl::Context *context,
+                                               gl::PrimitiveMode mode,
+                                               GLenum type,
+                                               const void *indirect) = 0;
 
     // CHROMIUM_path_rendering path drawing methods.
     virtual void stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask);
@@ -150,7 +150,7 @@
     virtual GLint64 getTimestamp() = 0;
 
     // Context switching
-    virtual gl::Error onMakeCurrent(const gl::Context *context) = 0;
+    virtual angle::Result onMakeCurrent(const gl::Context *context) = 0;
 
     // Native capabilities, unmodified by gl::Context.
     virtual gl::Caps getNativeCaps() const                         = 0;
@@ -160,14 +160,16 @@
 
     virtual void applyNativeWorkarounds(gl::Workarounds *workarounds) const {}
 
-    virtual gl::Error dispatchCompute(const gl::Context *context,
-                                      GLuint numGroupsX,
-                                      GLuint numGroupsY,
-                                      GLuint numGroupsZ)                                     = 0;
-    virtual gl::Error dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) = 0;
+    virtual angle::Result dispatchCompute(const gl::Context *context,
+                                          GLuint numGroupsX,
+                                          GLuint numGroupsY,
+                                          GLuint numGroupsZ)         = 0;
+    virtual angle::Result dispatchComputeIndirect(const gl::Context *context,
+                                                  GLintptr indirect) = 0;
 
-    virtual gl::Error memoryBarrier(const gl::Context *context, GLbitfield barriers)         = 0;
-    virtual gl::Error memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) = 0;
+    virtual angle::Result memoryBarrier(const gl::Context *context, GLbitfield barriers) = 0;
+    virtual angle::Result memoryBarrierByRegion(const gl::Context *context,
+                                                GLbitfield barriers)                     = 0;
 
     const gl::ContextState &getContextState() { return mState; }
     int getClientMajorVersion() const { return mState.getClientMajorVersion(); }
diff --git a/src/libANGLE/renderer/d3d/d3d11/Context11.cpp b/src/libANGLE/renderer/d3d/d3d11/Context11.cpp
index 2fb7d06..95883d2 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Context11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/Context11.cpp
@@ -88,9 +88,9 @@
 }
 
 template <typename IndirectBufferT>
-gl::Error ReadbackIndirectBuffer(const gl::Context *context,
-                                 const void *indirect,
-                                 const IndirectBufferT **bufferPtrOut)
+angle::Result ReadbackIndirectBuffer(const gl::Context *context,
+                                     const void *indirect,
+                                     const IndirectBufferT **bufferPtrOut)
 {
     const gl::State &glState       = context->getGLState();
     gl::Buffer *drawIndirectBuffer = glState.getTargetBuffer(gl::BufferBinding::DrawIndirect);
@@ -103,7 +103,7 @@
     ASSERT(bufferData);
 
     *bufferPtrOut = reinterpret_cast<const IndirectBufferT *>(bufferData + offset);
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 }  // anonymous namespace
 
@@ -116,9 +116,9 @@
 {
 }
 
-gl::Error Context11::initialize()
+angle::Result Context11::initialize()
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 void Context11::onDestroy(const gl::Context *context)
@@ -230,12 +230,12 @@
     return std::vector<PathImpl *>();
 }
 
-gl::Error Context11::flush(const gl::Context *context)
+angle::Result Context11::flush(const gl::Context *context)
 {
     return mRenderer->flush(this);
 }
 
-gl::Error Context11::finish(const gl::Context *context)
+angle::Result Context11::finish(const gl::Context *context)
 {
     return mRenderer->finish(this);
 }
@@ -251,11 +251,11 @@
     return mRenderer->drawArrays(context, drawCallParams);
 }
 
-gl::Error Context11::drawArraysInstanced(const gl::Context *context,
-                                         gl::PrimitiveMode mode,
-                                         GLint first,
-                                         GLsizei count,
-                                         GLsizei instanceCount)
+angle::Result Context11::drawArraysInstanced(const gl::Context *context,
+                                             gl::PrimitiveMode mode,
+                                             GLint first,
+                                             GLsizei count,
+                                             GLsizei instanceCount)
 {
     const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>();
     ASSERT(!drawCallParams.isDrawElements() && !drawCallParams.isDrawIndirect());
@@ -263,11 +263,11 @@
     return mRenderer->drawArrays(context, drawCallParams);
 }
 
-gl::Error Context11::drawElements(const gl::Context *context,
-                                  gl::PrimitiveMode mode,
-                                  GLsizei count,
-                                  GLenum type,
-                                  const void *indices)
+angle::Result Context11::drawElements(const gl::Context *context,
+                                      gl::PrimitiveMode mode,
+                                      GLsizei count,
+                                      GLenum type,
+                                      const void *indices)
 {
     const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>();
     ASSERT(drawCallParams.isDrawElements() && !drawCallParams.isDrawIndirect());
@@ -275,12 +275,26 @@
     return mRenderer->drawElements(context, drawCallParams);
 }
 
-gl::Error Context11::drawElementsInstanced(const gl::Context *context,
+angle::Result Context11::drawElementsInstanced(const gl::Context *context,
+                                               gl::PrimitiveMode mode,
+                                               GLsizei count,
+                                               GLenum type,
+                                               const void *indices,
+                                               GLsizei instances)
+{
+    const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>();
+    ASSERT(drawCallParams.isDrawElements() && !drawCallParams.isDrawIndirect());
+    ANGLE_TRY(prepareForDrawCall(context, drawCallParams));
+    return mRenderer->drawElements(context, drawCallParams);
+}
+
+angle::Result Context11::drawRangeElements(const gl::Context *context,
                                            gl::PrimitiveMode mode,
+                                           GLuint start,
+                                           GLuint end,
                                            GLsizei count,
                                            GLenum type,
-                                           const void *indices,
-                                           GLsizei instances)
+                                           const void *indices)
 {
     const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>();
     ASSERT(drawCallParams.isDrawElements() && !drawCallParams.isDrawIndirect());
@@ -288,23 +302,9 @@
     return mRenderer->drawElements(context, drawCallParams);
 }
 
-gl::Error Context11::drawRangeElements(const gl::Context *context,
-                                       gl::PrimitiveMode mode,
-                                       GLuint start,
-                                       GLuint end,
-                                       GLsizei count,
-                                       GLenum type,
-                                       const void *indices)
-{
-    const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>();
-    ASSERT(drawCallParams.isDrawElements() && !drawCallParams.isDrawIndirect());
-    ANGLE_TRY(prepareForDrawCall(context, drawCallParams));
-    return mRenderer->drawElements(context, drawCallParams);
-}
-
-gl::Error Context11::drawArraysIndirect(const gl::Context *context,
-                                        gl::PrimitiveMode mode,
-                                        const void *indirect)
+angle::Result Context11::drawArraysIndirect(const gl::Context *context,
+                                            gl::PrimitiveMode mode,
+                                            const void *indirect)
 {
     if (DrawCallHasStreamingVertexArrays(context, mode))
     {
@@ -324,10 +324,10 @@
     }
 }
 
-gl::Error Context11::drawElementsIndirect(const gl::Context *context,
-                                          gl::PrimitiveMode mode,
-                                          GLenum type,
-                                          const void *indirect)
+angle::Result Context11::drawElementsIndirect(const gl::Context *context,
+                                              gl::PrimitiveMode mode,
+                                              GLenum type,
+                                              const void *indirect)
 {
     if (DrawCallHasStreamingVertexArrays(context, mode) ||
         DrawCallHasStreamingElementArray(context, type))
@@ -345,7 +345,7 @@
         // We must explicitly resolve the index range for the slow-path indirect drawElements to
         // make sure we are using the correct 'baseVertex'. This parameter does not exist for the
         // direct drawElements.
-        ANGLE_TRY(drawCallParams.ensureIndexRangeResolved(context));
+        ANGLE_TRY_HANDLE(context, drawCallParams.ensureIndexRangeResolved(context));
 
         ANGLE_TRY(prepareForDrawCall(context, drawCallParams));
         return mRenderer->drawElements(context, drawCallParams);
@@ -427,10 +427,9 @@
     return mRenderer->getTimestamp();
 }
 
-gl::Error Context11::onMakeCurrent(const gl::Context *context)
+angle::Result Context11::onMakeCurrent(const gl::Context *context)
 {
-    ANGLE_TRY(mRenderer->getStateManager()->onMakeCurrent(context));
-    return gl::NoError();
+    return mRenderer->getStateManager()->onMakeCurrent(context);
 }
 
 gl::Caps Context11::getNativeCaps() const
@@ -474,15 +473,15 @@
     return mRenderer->getNativeLimitations();
 }
 
-gl::Error Context11::dispatchCompute(const gl::Context *context,
-                                     GLuint numGroupsX,
-                                     GLuint numGroupsY,
-                                     GLuint numGroupsZ)
+angle::Result Context11::dispatchCompute(const gl::Context *context,
+                                         GLuint numGroupsX,
+                                         GLuint numGroupsY,
+                                         GLuint numGroupsZ)
 {
     return mRenderer->dispatchCompute(context, numGroupsX, numGroupsY, numGroupsZ);
 }
 
-gl::Error Context11::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect)
+angle::Result Context11::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect)
 {
     return mRenderer->dispatchComputeIndirect(context, indirect);
 }
@@ -566,14 +565,14 @@
     return angle::Result::Continue();
 }
 
-gl::Error Context11::memoryBarrier(const gl::Context *context, GLbitfield barriers)
+angle::Result Context11::memoryBarrier(const gl::Context *context, GLbitfield barriers)
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error Context11::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers)
+angle::Result Context11::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers)
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 angle::Result Context11::getIncompleteTexture(const gl::Context *context,
diff --git a/src/libANGLE/renderer/d3d/d3d11/Context11.h b/src/libANGLE/renderer/d3d/d3d11/Context11.h
index 8b5ed05..601677c 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Context11.h
+++ b/src/libANGLE/renderer/d3d/d3d11/Context11.h
@@ -24,7 +24,7 @@
     Context11(const gl::ContextState &state, Renderer11 *renderer);
     ~Context11() override;
 
-    gl::Error initialize() override;
+    angle::Result initialize() override;
     void onDestroy(const gl::Context *context) override;
 
     // Shader creation
@@ -66,45 +66,45 @@
     std::vector<PathImpl *> createPaths(GLsizei) override;
 
     // Flush and finish.
-    gl::Error flush(const gl::Context *context) override;
-    gl::Error finish(const gl::Context *context) override;
+    angle::Result flush(const gl::Context *context) override;
+    angle::Result finish(const gl::Context *context) override;
 
     // Drawing methods.
     angle::Result drawArrays(const gl::Context *context,
                              gl::PrimitiveMode mode,
                              GLint first,
                              GLsizei count) override;
-    gl::Error drawArraysInstanced(const gl::Context *context,
-                                  gl::PrimitiveMode mode,
-                                  GLint first,
-                                  GLsizei count,
-                                  GLsizei instanceCount) override;
+    angle::Result drawArraysInstanced(const gl::Context *context,
+                                      gl::PrimitiveMode mode,
+                                      GLint first,
+                                      GLsizei count,
+                                      GLsizei instanceCount) override;
 
-    gl::Error drawElements(const gl::Context *context,
-                           gl::PrimitiveMode mode,
-                           GLsizei count,
-                           GLenum type,
-                           const void *indices) override;
-    gl::Error drawElementsInstanced(const gl::Context *context,
+    angle::Result drawElements(const gl::Context *context,
+                               gl::PrimitiveMode mode,
+                               GLsizei count,
+                               GLenum type,
+                               const void *indices) override;
+    angle::Result drawElementsInstanced(const gl::Context *context,
+                                        gl::PrimitiveMode mode,
+                                        GLsizei count,
+                                        GLenum type,
+                                        const void *indices,
+                                        GLsizei instances) override;
+    angle::Result drawRangeElements(const gl::Context *context,
                                     gl::PrimitiveMode mode,
+                                    GLuint start,
+                                    GLuint end,
                                     GLsizei count,
                                     GLenum type,
-                                    const void *indices,
-                                    GLsizei instances) override;
-    gl::Error drawRangeElements(const gl::Context *context,
-                                gl::PrimitiveMode mode,
-                                GLuint start,
-                                GLuint end,
-                                GLsizei count,
-                                GLenum type,
-                                const void *indices) override;
-    gl::Error drawArraysIndirect(const gl::Context *context,
-                                 gl::PrimitiveMode mode,
-                                 const void *indirect) override;
-    gl::Error drawElementsIndirect(const gl::Context *context,
-                                   gl::PrimitiveMode mode,
-                                   GLenum type,
-                                   const void *indirect) override;
+                                    const void *indices) override;
+    angle::Result drawArraysIndirect(const gl::Context *context,
+                                     gl::PrimitiveMode mode,
+                                     const void *indirect) override;
+    angle::Result drawElementsIndirect(const gl::Context *context,
+                                       gl::PrimitiveMode mode,
+                                       GLenum type,
+                                       const void *indirect) override;
 
     // Device loss
     GLenum getResetStatus() override;
@@ -132,7 +132,7 @@
     GLint64 getTimestamp() override;
 
     // Context switching
-    gl::Error onMakeCurrent(const gl::Context *context) override;
+    angle::Result onMakeCurrent(const gl::Context *context) override;
 
     // Caps queries
     gl::Caps getNativeCaps() const override;
@@ -142,14 +142,14 @@
 
     Renderer11 *getRenderer() const { return mRenderer; }
 
-    gl::Error dispatchCompute(const gl::Context *context,
-                              GLuint numGroupsX,
-                              GLuint numGroupsY,
-                              GLuint numGroupsZ) override;
-    gl::Error dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
+    angle::Result dispatchCompute(const gl::Context *context,
+                                  GLuint numGroupsX,
+                                  GLuint numGroupsY,
+                                  GLuint numGroupsZ) override;
+    angle::Result dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
 
-    gl::Error memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
-    gl::Error memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
+    angle::Result memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
+    angle::Result memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
 
     angle::Result triggerDrawCallProgramRecompilation(const gl::Context *context,
                                                       gl::PrimitiveMode drawMode);
diff --git a/src/libANGLE/renderer/d3d/d3d9/Context9.cpp b/src/libANGLE/renderer/d3d/d3d9/Context9.cpp
index bf0cb55..623f8a1 100644
--- a/src/libANGLE/renderer/d3d/d3d9/Context9.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/Context9.cpp
@@ -36,9 +36,9 @@
 {
 }
 
-gl::Error Context9::initialize()
+angle::Result Context9::initialize()
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 void Context9::onDestroy(const gl::Context *context)
@@ -136,12 +136,12 @@
     return std::vector<PathImpl *>();
 }
 
-gl::Error Context9::flush(const gl::Context *context)
+angle::Result Context9::flush(const gl::Context *context)
 {
     return mRenderer->flush(context);
 }
 
-gl::Error Context9::finish(const gl::Context *context)
+angle::Result Context9::finish(const gl::Context *context)
 {
     return mRenderer->finish(context);
 }
@@ -154,60 +154,60 @@
     return mRenderer->genericDrawArrays(context, mode, first, count, 0);
 }
 
-gl::Error Context9::drawArraysInstanced(const gl::Context *context,
-                                        gl::PrimitiveMode mode,
-                                        GLint first,
-                                        GLsizei count,
-                                        GLsizei instanceCount)
+angle::Result Context9::drawArraysInstanced(const gl::Context *context,
+                                            gl::PrimitiveMode mode,
+                                            GLint first,
+                                            GLsizei count,
+                                            GLsizei instanceCount)
 {
     return mRenderer->genericDrawArrays(context, mode, first, count, instanceCount);
 }
 
-gl::Error Context9::drawElements(const gl::Context *context,
-                                 gl::PrimitiveMode mode,
-                                 GLsizei count,
-                                 GLenum type,
-                                 const void *indices)
+angle::Result Context9::drawElements(const gl::Context *context,
+                                     gl::PrimitiveMode mode,
+                                     GLsizei count,
+                                     GLenum type,
+                                     const void *indices)
 {
     return mRenderer->genericDrawElements(context, mode, count, type, indices, 0);
 }
 
-gl::Error Context9::drawElementsInstanced(const gl::Context *context,
-                                          gl::PrimitiveMode mode,
-                                          GLsizei count,
-                                          GLenum type,
-                                          const void *indices,
-                                          GLsizei instances)
+angle::Result Context9::drawElementsInstanced(const gl::Context *context,
+                                              gl::PrimitiveMode mode,
+                                              GLsizei count,
+                                              GLenum type,
+                                              const void *indices,
+                                              GLsizei instances)
 {
     return mRenderer->genericDrawElements(context, mode, count, type, indices, instances);
 }
 
-gl::Error Context9::drawRangeElements(const gl::Context *context,
-                                      gl::PrimitiveMode mode,
-                                      GLuint start,
-                                      GLuint end,
-                                      GLsizei count,
-                                      GLenum type,
-                                      const void *indices)
+angle::Result Context9::drawRangeElements(const gl::Context *context,
+                                          gl::PrimitiveMode mode,
+                                          GLuint start,
+                                          GLuint end,
+                                          GLsizei count,
+                                          GLenum type,
+                                          const void *indices)
 {
     return mRenderer->genericDrawElements(context, mode, count, type, indices, 0);
 }
 
-gl::Error Context9::drawArraysIndirect(const gl::Context *context,
-                                       gl::PrimitiveMode mode,
-                                       const void *indirect)
+angle::Result Context9::drawArraysIndirect(const gl::Context *context,
+                                           gl::PrimitiveMode mode,
+                                           const void *indirect)
 {
-    UNREACHABLE();
-    return gl::InternalError() << "D3D9 doesn't support ES 3.1 DrawArraysIndirect API";
+    ANGLE_HR_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
-gl::Error Context9::drawElementsIndirect(const gl::Context *context,
-                                         gl::PrimitiveMode mode,
-                                         GLenum type,
-                                         const void *indirect)
+angle::Result Context9::drawElementsIndirect(const gl::Context *context,
+                                             gl::PrimitiveMode mode,
+                                             GLenum type,
+                                             const void *indirect)
 {
-    UNREACHABLE();
-    return gl::InternalError() << "D3D9 doesn't support ES 3.1 DrawElementsIndirect API";
+    ANGLE_HR_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
 GLenum Context9::getResetStatus()
@@ -278,7 +278,7 @@
     return mRenderer->getTimestamp();
 }
 
-gl::Error Context9::onMakeCurrent(const gl::Context *context)
+angle::Result Context9::onMakeCurrent(const gl::Context *context)
 {
     return mRenderer->ensureVertexDataManagerInitialized(context);
 }
@@ -303,31 +303,31 @@
     return mRenderer->getNativeLimitations();
 }
 
-gl::Error Context9::dispatchCompute(const gl::Context *context,
-                                    GLuint numGroupsX,
-                                    GLuint numGroupsY,
-                                    GLuint numGroupsZ)
+angle::Result Context9::dispatchCompute(const gl::Context *context,
+                                        GLuint numGroupsX,
+                                        GLuint numGroupsY,
+                                        GLuint numGroupsZ)
 {
-    UNREACHABLE();
-    return gl::InternalError() << "D3D9 doesn't support ES 3.1 DispatchCompute API";
+    ANGLE_HR_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
-gl::Error Context9::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect)
+angle::Result Context9::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect)
 {
-    UNREACHABLE();
-    return gl::InternalError() << "D3D9 doesn't support ES 3.1 dispatchComputeIndirect API";
+    ANGLE_HR_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
-gl::Error Context9::memoryBarrier(const gl::Context *context, GLbitfield barriers)
+angle::Result Context9::memoryBarrier(const gl::Context *context, GLbitfield barriers)
 {
-    UNREACHABLE();
-    return gl::InternalError() << "D3D9 doesn't support ES 3.1 memoryBarrier API";
+    ANGLE_HR_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
-gl::Error Context9::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers)
+angle::Result Context9::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers)
 {
-    UNREACHABLE();
-    return gl::InternalError() << "D3D9 doesn't support ES 3.1 memoryBarrierByRegion API";
+    ANGLE_HR_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
 angle::Result Context9::getIncompleteTexture(const gl::Context *context,
diff --git a/src/libANGLE/renderer/d3d/d3d9/Context9.h b/src/libANGLE/renderer/d3d/d3d9/Context9.h
index 4ccd3d0..04168d1 100644
--- a/src/libANGLE/renderer/d3d/d3d9/Context9.h
+++ b/src/libANGLE/renderer/d3d/d3d9/Context9.h
@@ -22,7 +22,7 @@
     Context9(const gl::ContextState &state, Renderer9 *renderer);
     ~Context9() override;
 
-    gl::Error initialize() override;
+    angle::Result initialize() override;
     void onDestroy(const gl::Context *context) override;
 
     // Shader creation
@@ -64,45 +64,45 @@
     std::vector<PathImpl *> createPaths(GLsizei) override;
 
     // Flush and finish.
-    gl::Error flush(const gl::Context *context) override;
-    gl::Error finish(const gl::Context *context) override;
+    angle::Result flush(const gl::Context *context) override;
+    angle::Result finish(const gl::Context *context) override;
 
     // Drawing methods.
     angle::Result drawArrays(const gl::Context *context,
                              gl::PrimitiveMode mode,
                              GLint first,
                              GLsizei count) override;
-    gl::Error drawArraysInstanced(const gl::Context *context,
-                                  gl::PrimitiveMode mode,
-                                  GLint first,
-                                  GLsizei count,
-                                  GLsizei instanceCount) override;
+    angle::Result drawArraysInstanced(const gl::Context *context,
+                                      gl::PrimitiveMode mode,
+                                      GLint first,
+                                      GLsizei count,
+                                      GLsizei instanceCount) override;
 
-    gl::Error drawElements(const gl::Context *context,
-                           gl::PrimitiveMode mode,
-                           GLsizei count,
-                           GLenum type,
-                           const void *indices) override;
-    gl::Error drawElementsInstanced(const gl::Context *context,
+    angle::Result drawElements(const gl::Context *context,
+                               gl::PrimitiveMode mode,
+                               GLsizei count,
+                               GLenum type,
+                               const void *indices) override;
+    angle::Result drawElementsInstanced(const gl::Context *context,
+                                        gl::PrimitiveMode mode,
+                                        GLsizei count,
+                                        GLenum type,
+                                        const void *indices,
+                                        GLsizei instances) override;
+    angle::Result drawRangeElements(const gl::Context *context,
                                     gl::PrimitiveMode mode,
+                                    GLuint start,
+                                    GLuint end,
                                     GLsizei count,
                                     GLenum type,
-                                    const void *indices,
-                                    GLsizei instances) override;
-    gl::Error drawRangeElements(const gl::Context *context,
-                                gl::PrimitiveMode mode,
-                                GLuint start,
-                                GLuint end,
-                                GLsizei count,
-                                GLenum type,
-                                const void *indices) override;
-    gl::Error drawArraysIndirect(const gl::Context *context,
-                                 gl::PrimitiveMode mode,
-                                 const void *indirect) override;
-    gl::Error drawElementsIndirect(const gl::Context *context,
-                                   gl::PrimitiveMode mode,
-                                   GLenum type,
-                                   const void *indirect) override;
+                                    const void *indices) override;
+    angle::Result drawArraysIndirect(const gl::Context *context,
+                                     gl::PrimitiveMode mode,
+                                     const void *indirect) override;
+    angle::Result drawElementsIndirect(const gl::Context *context,
+                                       gl::PrimitiveMode mode,
+                                       GLenum type,
+                                       const void *indirect) override;
 
     // Device loss
     GLenum getResetStatus() override;
@@ -130,7 +130,7 @@
     GLint64 getTimestamp() override;
 
     // Context switching
-    gl::Error onMakeCurrent(const gl::Context *context) override;
+    angle::Result onMakeCurrent(const gl::Context *context) override;
 
     // Caps queries
     gl::Caps getNativeCaps() const override;
@@ -138,14 +138,14 @@
     const gl::Extensions &getNativeExtensions() const override;
     const gl::Limitations &getNativeLimitations() const override;
 
-    gl::Error dispatchCompute(const gl::Context *context,
-                              GLuint numGroupsX,
-                              GLuint numGroupsY,
-                              GLuint numGroupsZ) override;
-    gl::Error dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
+    angle::Result dispatchCompute(const gl::Context *context,
+                                  GLuint numGroupsX,
+                                  GLuint numGroupsY,
+                                  GLuint numGroupsZ) override;
+    angle::Result dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
 
-    gl::Error memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
-    gl::Error memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
+    angle::Result memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
+    angle::Result memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
 
     Renderer9 *getRenderer() const { return mRenderer; }
 
diff --git a/src/libANGLE/renderer/gl/ContextGL.cpp b/src/libANGLE/renderer/gl/ContextGL.cpp
index 5c639c3..98b9c23 100644
--- a/src/libANGLE/renderer/gl/ContextGL.cpp
+++ b/src/libANGLE/renderer/gl/ContextGL.cpp
@@ -41,9 +41,9 @@
 {
 }
 
-gl::Error ContextGL::initialize()
+angle::Result ContextGL::initialize()
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 CompilerImpl *ContextGL::createCompiler()
@@ -160,12 +160,12 @@
     return ret;
 }
 
-gl::Error ContextGL::flush(const gl::Context *context)
+angle::Result ContextGL::flush(const gl::Context *context)
 {
     return mRenderer->flush();
 }
 
-gl::Error ContextGL::finish(const gl::Context *context)
+angle::Result ContextGL::finish(const gl::Context *context)
 {
     return mRenderer->finish();
 }
@@ -178,56 +178,56 @@
     return mRenderer->drawArrays(context, mode, first, count);
 }
 
-gl::Error ContextGL::drawArraysInstanced(const gl::Context *context,
-                                         gl::PrimitiveMode mode,
-                                         GLint first,
-                                         GLsizei count,
-                                         GLsizei instanceCount)
+angle::Result ContextGL::drawArraysInstanced(const gl::Context *context,
+                                             gl::PrimitiveMode mode,
+                                             GLint first,
+                                             GLsizei count,
+                                             GLsizei instanceCount)
 {
     return mRenderer->drawArraysInstanced(context, mode, first, count, instanceCount);
 }
 
-gl::Error ContextGL::drawElements(const gl::Context *context,
-                                  gl::PrimitiveMode mode,
-                                  GLsizei count,
-                                  GLenum type,
-                                  const void *indices)
+angle::Result ContextGL::drawElements(const gl::Context *context,
+                                      gl::PrimitiveMode mode,
+                                      GLsizei count,
+                                      GLenum type,
+                                      const void *indices)
 {
     return mRenderer->drawElements(context, mode, count, type, indices);
 }
 
-gl::Error ContextGL::drawElementsInstanced(const gl::Context *context,
-                                           gl::PrimitiveMode mode,
-                                           GLsizei count,
-                                           GLenum type,
-                                           const void *indices,
-                                           GLsizei instances)
+angle::Result ContextGL::drawElementsInstanced(const gl::Context *context,
+                                               gl::PrimitiveMode mode,
+                                               GLsizei count,
+                                               GLenum type,
+                                               const void *indices,
+                                               GLsizei instances)
 {
     return mRenderer->drawElementsInstanced(context, mode, count, type, indices, instances);
 }
 
-gl::Error ContextGL::drawRangeElements(const gl::Context *context,
-                                       gl::PrimitiveMode mode,
-                                       GLuint start,
-                                       GLuint end,
-                                       GLsizei count,
-                                       GLenum type,
-                                       const void *indices)
+angle::Result ContextGL::drawRangeElements(const gl::Context *context,
+                                           gl::PrimitiveMode mode,
+                                           GLuint start,
+                                           GLuint end,
+                                           GLsizei count,
+                                           GLenum type,
+                                           const void *indices)
 {
     return mRenderer->drawRangeElements(context, mode, start, end, count, type, indices);
 }
 
-gl::Error ContextGL::drawArraysIndirect(const gl::Context *context,
-                                        gl::PrimitiveMode mode,
-                                        const void *indirect)
+angle::Result ContextGL::drawArraysIndirect(const gl::Context *context,
+                                            gl::PrimitiveMode mode,
+                                            const void *indirect)
 {
     return mRenderer->drawArraysIndirect(context, mode, indirect);
 }
 
-gl::Error ContextGL::drawElementsIndirect(const gl::Context *context,
-                                          gl::PrimitiveMode mode,
-                                          GLenum type,
-                                          const void *indirect)
+angle::Result ContextGL::drawElementsIndirect(const gl::Context *context,
+                                              gl::PrimitiveMode mode,
+                                              GLenum type,
+                                              const void *indirect)
 {
     return mRenderer->drawElementsIndirect(context, mode, type, indirect);
 }
@@ -384,11 +384,10 @@
     return mRenderer->getTimestamp();
 }
 
-gl::Error ContextGL::onMakeCurrent(const gl::Context *context)
+angle::Result ContextGL::onMakeCurrent(const gl::Context *context)
 {
     // Queries need to be paused/resumed on context switches
-    ANGLE_TRY(mRenderer->getStateManager()->onMakeCurrent(context));
-    return gl::NoError();
+    return mRenderer->getStateManager()->onMakeCurrent(context);
 }
 
 gl::Caps ContextGL::getNativeCaps() const
@@ -441,24 +440,24 @@
     return mRenderer->getMultiviewClearer();
 }
 
-gl::Error ContextGL::dispatchCompute(const gl::Context *context,
-                                     GLuint numGroupsX,
-                                     GLuint numGroupsY,
-                                     GLuint numGroupsZ)
+angle::Result ContextGL::dispatchCompute(const gl::Context *context,
+                                         GLuint numGroupsX,
+                                         GLuint numGroupsY,
+                                         GLuint numGroupsZ)
 {
     return mRenderer->dispatchCompute(context, numGroupsX, numGroupsY, numGroupsZ);
 }
 
-gl::Error ContextGL::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect)
+angle::Result ContextGL::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect)
 {
     return mRenderer->dispatchComputeIndirect(context, indirect);
 }
 
-gl::Error ContextGL::memoryBarrier(const gl::Context *context, GLbitfield barriers)
+angle::Result ContextGL::memoryBarrier(const gl::Context *context, GLbitfield barriers)
 {
     return mRenderer->memoryBarrier(barriers);
 }
-gl::Error ContextGL::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers)
+angle::Result ContextGL::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers)
 {
     return mRenderer->memoryBarrierByRegion(barriers);
 }
diff --git a/src/libANGLE/renderer/gl/ContextGL.h b/src/libANGLE/renderer/gl/ContextGL.h
index a887052..e0a073c 100644
--- a/src/libANGLE/renderer/gl/ContextGL.h
+++ b/src/libANGLE/renderer/gl/ContextGL.h
@@ -32,7 +32,7 @@
     ContextGL(const gl::ContextState &state, const std::shared_ptr<RendererGL> &renderer);
     ~ContextGL() override;
 
-    gl::Error initialize() override;
+    angle::Result initialize() override;
 
     // Shader creation
     CompilerImpl *createCompiler() override;
@@ -73,45 +73,45 @@
     std::vector<PathImpl *> createPaths(GLsizei range) override;
 
     // Flush and finish.
-    gl::Error flush(const gl::Context *context) override;
-    gl::Error finish(const gl::Context *context) override;
+    angle::Result flush(const gl::Context *context) override;
+    angle::Result finish(const gl::Context *context) override;
 
     // Drawing methods.
     angle::Result drawArrays(const gl::Context *context,
                              gl::PrimitiveMode mode,
                              GLint first,
                              GLsizei count) override;
-    gl::Error drawArraysInstanced(const gl::Context *context,
-                                  gl::PrimitiveMode mode,
-                                  GLint first,
-                                  GLsizei count,
-                                  GLsizei instanceCount) override;
+    angle::Result drawArraysInstanced(const gl::Context *context,
+                                      gl::PrimitiveMode mode,
+                                      GLint first,
+                                      GLsizei count,
+                                      GLsizei instanceCount) override;
 
-    gl::Error drawElements(const gl::Context *context,
-                           gl::PrimitiveMode mode,
-                           GLsizei count,
-                           GLenum type,
-                           const void *indices) override;
-    gl::Error drawElementsInstanced(const gl::Context *context,
+    angle::Result drawElements(const gl::Context *context,
+                               gl::PrimitiveMode mode,
+                               GLsizei count,
+                               GLenum type,
+                               const void *indices) override;
+    angle::Result drawElementsInstanced(const gl::Context *context,
+                                        gl::PrimitiveMode mode,
+                                        GLsizei count,
+                                        GLenum type,
+                                        const void *indices,
+                                        GLsizei instances) override;
+    angle::Result drawRangeElements(const gl::Context *context,
                                     gl::PrimitiveMode mode,
+                                    GLuint start,
+                                    GLuint end,
                                     GLsizei count,
                                     GLenum type,
-                                    const void *indices,
-                                    GLsizei instances) override;
-    gl::Error drawRangeElements(const gl::Context *context,
-                                gl::PrimitiveMode mode,
-                                GLuint start,
-                                GLuint end,
-                                GLsizei count,
-                                GLenum type,
-                                const void *indices) override;
-    gl::Error drawArraysIndirect(const gl::Context *context,
-                                 gl::PrimitiveMode mode,
-                                 const void *indirect) override;
-    gl::Error drawElementsIndirect(const gl::Context *context,
-                                   gl::PrimitiveMode mode,
-                                   GLenum type,
-                                   const void *indirect) override;
+                                    const void *indices) override;
+    angle::Result drawArraysIndirect(const gl::Context *context,
+                                     gl::PrimitiveMode mode,
+                                     const void *indirect) override;
+    angle::Result drawElementsIndirect(const gl::Context *context,
+                                       gl::PrimitiveMode mode,
+                                       GLenum type,
+                                       const void *indirect) override;
 
     // CHROMIUM_path_rendering implementation
     void stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask) override;
@@ -183,7 +183,7 @@
     GLint64 getTimestamp() override;
 
     // Context switching
-    gl::Error onMakeCurrent(const gl::Context *context) override;
+    angle::Result onMakeCurrent(const gl::Context *context) override;
 
     // Caps queries
     gl::Caps getNativeCaps() const override;
@@ -200,14 +200,14 @@
     BlitGL *getBlitter() const;
     ClearMultiviewGL *getMultiviewClearer() const;
 
-    gl::Error dispatchCompute(const gl::Context *context,
-                              GLuint numGroupsX,
-                              GLuint numGroupsY,
-                              GLuint numGroupsZ) override;
-    gl::Error dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
+    angle::Result dispatchCompute(const gl::Context *context,
+                                  GLuint numGroupsX,
+                                  GLuint numGroupsY,
+                                  GLuint numGroupsZ) override;
+    angle::Result dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
 
-    gl::Error memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
-    gl::Error memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
+    angle::Result memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
+    angle::Result memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
 
     void handleError(GLenum errorCode,
                      const char *message,
diff --git a/src/libANGLE/renderer/null/ContextNULL.cpp b/src/libANGLE/renderer/null/ContextNULL.cpp
index cb8e1ff..786b9ab 100644
--- a/src/libANGLE/renderer/null/ContextNULL.cpp
+++ b/src/libANGLE/renderer/null/ContextNULL.cpp
@@ -106,19 +106,19 @@
 {
 }
 
-gl::Error ContextNULL::initialize()
+angle::Result ContextNULL::initialize()
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error ContextNULL::flush(const gl::Context *context)
+angle::Result ContextNULL::flush(const gl::Context *context)
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error ContextNULL::finish(const gl::Context *context)
+angle::Result ContextNULL::finish(const gl::Context *context)
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 angle::Result ContextNULL::drawArrays(const gl::Context *context,
@@ -129,58 +129,58 @@
     return angle::Result::Continue();
 }
 
-gl::Error ContextNULL::drawArraysInstanced(const gl::Context *context,
-                                           gl::PrimitiveMode mode,
-                                           GLint first,
-                                           GLsizei count,
-                                           GLsizei instanceCount)
+angle::Result ContextNULL::drawArraysInstanced(const gl::Context *context,
+                                               gl::PrimitiveMode mode,
+                                               GLint first,
+                                               GLsizei count,
+                                               GLsizei instanceCount)
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error ContextNULL::drawElements(const gl::Context *context,
-                                    gl::PrimitiveMode mode,
-                                    GLsizei count,
-                                    GLenum type,
-                                    const void *indices)
+angle::Result ContextNULL::drawElements(const gl::Context *context,
+                                        gl::PrimitiveMode mode,
+                                        GLsizei count,
+                                        GLenum type,
+                                        const void *indices)
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error ContextNULL::drawElementsInstanced(const gl::Context *context,
+angle::Result ContextNULL::drawElementsInstanced(const gl::Context *context,
+                                                 gl::PrimitiveMode mode,
+                                                 GLsizei count,
+                                                 GLenum type,
+                                                 const void *indices,
+                                                 GLsizei instances)
+{
+    return angle::Result::Continue();
+}
+
+angle::Result ContextNULL::drawRangeElements(const gl::Context *context,
                                              gl::PrimitiveMode mode,
+                                             GLuint start,
+                                             GLuint end,
                                              GLsizei count,
                                              GLenum type,
-                                             const void *indices,
-                                             GLsizei instances)
+                                             const void *indices)
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error ContextNULL::drawRangeElements(const gl::Context *context,
-                                         gl::PrimitiveMode mode,
-                                         GLuint start,
-                                         GLuint end,
-                                         GLsizei count,
-                                         GLenum type,
-                                         const void *indices)
+angle::Result ContextNULL::drawArraysIndirect(const gl::Context *context,
+                                              gl::PrimitiveMode mode,
+                                              const void *indirect)
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error ContextNULL::drawArraysIndirect(const gl::Context *context,
-                                          gl::PrimitiveMode mode,
-                                          const void *indirect)
+angle::Result ContextNULL::drawElementsIndirect(const gl::Context *context,
+                                                gl::PrimitiveMode mode,
+                                                GLenum type,
+                                                const void *indirect)
 {
-    return gl::NoError();
-}
-
-gl::Error ContextNULL::drawElementsIndirect(const gl::Context *context,
-                                            gl::PrimitiveMode mode,
-                                            GLenum type,
-                                            const void *indirect)
-{
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 void ContextNULL::stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask)
@@ -313,9 +313,9 @@
     return 0;
 }
 
-gl::Error ContextNULL::onMakeCurrent(const gl::Context *context)
+angle::Result ContextNULL::onMakeCurrent(const gl::Context *context)
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 gl::Caps ContextNULL::getNativeCaps() const
@@ -418,27 +418,27 @@
     return result;
 }
 
-gl::Error ContextNULL::dispatchCompute(const gl::Context *context,
-                                       GLuint numGroupsX,
-                                       GLuint numGroupsY,
-                                       GLuint numGroupsZ)
+angle::Result ContextNULL::dispatchCompute(const gl::Context *context,
+                                           GLuint numGroupsX,
+                                           GLuint numGroupsY,
+                                           GLuint numGroupsZ)
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error ContextNULL::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect)
+angle::Result ContextNULL::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect)
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error ContextNULL::memoryBarrier(const gl::Context *context, GLbitfield barriers)
+angle::Result ContextNULL::memoryBarrier(const gl::Context *context, GLbitfield barriers)
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error ContextNULL::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers)
+angle::Result ContextNULL::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers)
 {
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 void ContextNULL::handleError(GLenum errorCode,
diff --git a/src/libANGLE/renderer/null/ContextNULL.h b/src/libANGLE/renderer/null/ContextNULL.h
index 734dcae..d3b6eea 100644
--- a/src/libANGLE/renderer/null/ContextNULL.h
+++ b/src/libANGLE/renderer/null/ContextNULL.h
@@ -36,48 +36,48 @@
     ContextNULL(const gl::ContextState &state, AllocationTrackerNULL *allocationTracker);
     ~ContextNULL() override;
 
-    gl::Error initialize() override;
+    angle::Result initialize() override;
 
     // Flush and finish.
-    gl::Error flush(const gl::Context *context) override;
-    gl::Error finish(const gl::Context *context) override;
+    angle::Result flush(const gl::Context *context) override;
+    angle::Result finish(const gl::Context *context) override;
 
     // Drawing methods.
     angle::Result drawArrays(const gl::Context *context,
                              gl::PrimitiveMode mode,
                              GLint first,
                              GLsizei count) override;
-    gl::Error drawArraysInstanced(const gl::Context *context,
-                                  gl::PrimitiveMode mode,
-                                  GLint first,
-                                  GLsizei count,
-                                  GLsizei instanceCount) override;
+    angle::Result drawArraysInstanced(const gl::Context *context,
+                                      gl::PrimitiveMode mode,
+                                      GLint first,
+                                      GLsizei count,
+                                      GLsizei instanceCount) override;
 
-    gl::Error drawElements(const gl::Context *context,
-                           gl::PrimitiveMode mode,
-                           GLsizei count,
-                           GLenum type,
-                           const void *indices) override;
-    gl::Error drawElementsInstanced(const gl::Context *context,
+    angle::Result drawElements(const gl::Context *context,
+                               gl::PrimitiveMode mode,
+                               GLsizei count,
+                               GLenum type,
+                               const void *indices) override;
+    angle::Result drawElementsInstanced(const gl::Context *context,
+                                        gl::PrimitiveMode mode,
+                                        GLsizei count,
+                                        GLenum type,
+                                        const void *indices,
+                                        GLsizei instances) override;
+    angle::Result drawRangeElements(const gl::Context *context,
                                     gl::PrimitiveMode mode,
+                                    GLuint start,
+                                    GLuint end,
                                     GLsizei count,
                                     GLenum type,
-                                    const void *indices,
-                                    GLsizei instances) override;
-    gl::Error drawRangeElements(const gl::Context *context,
-                                gl::PrimitiveMode mode,
-                                GLuint start,
-                                GLuint end,
-                                GLsizei count,
-                                GLenum type,
-                                const void *indices) override;
-    gl::Error drawArraysIndirect(const gl::Context *context,
-                                 gl::PrimitiveMode mode,
-                                 const void *indirect) override;
-    gl::Error drawElementsIndirect(const gl::Context *context,
-                                   gl::PrimitiveMode mode,
-                                   GLenum type,
-                                   const void *indirect) override;
+                                    const void *indices) override;
+    angle::Result drawArraysIndirect(const gl::Context *context,
+                                     gl::PrimitiveMode mode,
+                                     const void *indirect) override;
+    angle::Result drawElementsIndirect(const gl::Context *context,
+                                       gl::PrimitiveMode mode,
+                                       GLenum type,
+                                       const void *indirect) override;
 
     // CHROMIUM_path_rendering path drawing methods.
     void stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask) override;
@@ -151,7 +151,7 @@
     GLint64 getTimestamp() override;
 
     // Context switching
-    gl::Error onMakeCurrent(const gl::Context *context) override;
+    angle::Result onMakeCurrent(const gl::Context *context) override;
 
     // Native capabilities, unmodified by gl::Context.
     gl::Caps getNativeCaps() const override;
@@ -196,14 +196,14 @@
 
     std::vector<PathImpl *> createPaths(GLsizei range) override;
 
-    gl::Error dispatchCompute(const gl::Context *context,
-                              GLuint numGroupsX,
-                              GLuint numGroupsY,
-                              GLuint numGroupsZ) override;
-    gl::Error dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
+    angle::Result dispatchCompute(const gl::Context *context,
+                                  GLuint numGroupsX,
+                                  GLuint numGroupsY,
+                                  GLuint numGroupsZ) override;
+    angle::Result dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
 
-    gl::Error memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
-    gl::Error memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
+    angle::Result memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
+    angle::Result memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
 
     void handleError(GLenum errorCode,
                      const char *message,
diff --git a/src/libANGLE/renderer/vulkan/ContextVk.cpp b/src/libANGLE/renderer/vulkan/ContextVk.cpp
index b7a67f6..db2f0c2 100644
--- a/src/libANGLE/renderer/vulkan/ContextVk.cpp
+++ b/src/libANGLE/renderer/vulkan/ContextVk.cpp
@@ -186,7 +186,7 @@
     return mIncompleteTextures.getIncompleteTexture(context, type, nullptr, textureOut);
 }
 
-gl::Error ContextVk::initialize()
+angle::Result ContextVk::initialize()
 {
     // Note that this may reserve more sets than strictly necessary for a particular layout.
     ANGLE_TRY(mDynamicDescriptorPools[kUniformsDescriptorSetIndex].init(
@@ -219,15 +219,15 @@
         buffer.init(1, mRenderer);
     }
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error ContextVk::flush(const gl::Context *context)
+angle::Result ContextVk::flush(const gl::Context *context)
 {
     return mRenderer->flush(this);
 }
 
-gl::Error ContextVk::finish(const gl::Context *context)
+angle::Result ContextVk::finish(const gl::Context *context)
 {
     return mRenderer->finish(this);
 }
@@ -484,21 +484,21 @@
     return angle::Result::Continue();
 }
 
-gl::Error ContextVk::drawArraysInstanced(const gl::Context *context,
-                                         gl::PrimitiveMode mode,
-                                         GLint first,
-                                         GLsizei count,
-                                         GLsizei instanceCount)
+angle::Result ContextVk::drawArraysInstanced(const gl::Context *context,
+                                             gl::PrimitiveMode mode,
+                                             GLint first,
+                                             GLsizei count,
+                                             GLsizei instanceCount)
 {
-    UNIMPLEMENTED();
-    return gl::InternalError();
+    ANGLE_VK_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
-gl::Error ContextVk::drawElements(const gl::Context *context,
-                                  gl::PrimitiveMode mode,
-                                  GLsizei count,
-                                  GLenum type,
-                                  const void *indices)
+angle::Result ContextVk::drawElements(const gl::Context *context,
+                                      gl::PrimitiveMode mode,
+                                      GLsizei count,
+                                      GLenum type,
+                                      const void *indices)
 {
     const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>();
 
@@ -514,29 +514,30 @@
         commandBuffer->drawIndexed(count, 1, 0, 0, 0);
     }
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error ContextVk::drawElementsInstanced(const gl::Context *context,
+angle::Result ContextVk::drawElementsInstanced(const gl::Context *context,
+                                               gl::PrimitiveMode mode,
+                                               GLsizei count,
+                                               GLenum type,
+                                               const void *indices,
+                                               GLsizei instances)
+{
+    ANGLE_VK_UNREACHABLE(this);
+    return angle::Result::Stop();
+}
+
+angle::Result ContextVk::drawRangeElements(const gl::Context *context,
                                            gl::PrimitiveMode mode,
+                                           GLuint start,
+                                           GLuint end,
                                            GLsizei count,
                                            GLenum type,
-                                           const void *indices,
-                                           GLsizei instances)
+                                           const void *indices)
 {
-    UNIMPLEMENTED();
-    return gl::InternalError();
-}
-
-gl::Error ContextVk::drawRangeElements(const gl::Context *context,
-                                       gl::PrimitiveMode mode,
-                                       GLuint start,
-                                       GLuint end,
-                                       GLsizei count,
-                                       GLenum type,
-                                       const void *indices)
-{
-    return gl::NoError();
+    ANGLE_VK_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
 VkDevice ContextVk::getDevice() const
@@ -544,22 +545,21 @@
     return mRenderer->getDevice();
 }
 
-gl::Error ContextVk::drawArraysIndirect(const gl::Context *context,
-                                        gl::PrimitiveMode mode,
-                                        const void *indirect)
+angle::Result ContextVk::drawArraysIndirect(const gl::Context *context,
+                                            gl::PrimitiveMode mode,
+                                            const void *indirect)
 {
-    UNIMPLEMENTED();
-    return gl::InternalError() << "DrawArraysIndirect hasn't been implemented for vulkan backend.";
+    ANGLE_VK_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
-gl::Error ContextVk::drawElementsIndirect(const gl::Context *context,
-                                          gl::PrimitiveMode mode,
-                                          GLenum type,
-                                          const void *indirect)
+angle::Result ContextVk::drawElementsIndirect(const gl::Context *context,
+                                              gl::PrimitiveMode mode,
+                                              GLenum type,
+                                              const void *indirect)
 {
-    UNIMPLEMENTED();
-    return gl::InternalError()
-           << "DrawElementsIndirect hasn't been implemented for vulkan backend.";
+    ANGLE_VK_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
 GLenum ContextVk::getResetStatus()
@@ -903,7 +903,7 @@
     return GLint64();
 }
 
-gl::Error ContextVk::onMakeCurrent(const gl::Context *context)
+angle::Result ContextVk::onMakeCurrent(const gl::Context *context)
 {
     // Flip viewports if FeaturesVk::flipViewportY is enabled and the user did not request that the
     // surface is flipped.
@@ -916,7 +916,7 @@
     updateFlipViewportDrawFramebuffer(glState);
     updateFlipViewportReadFramebuffer(glState);
     invalidateDriverUniforms();
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 void ContextVk::updateFlipViewportDrawFramebuffer(const gl::State &glState)
@@ -1052,31 +1052,31 @@
     mDirtyBits.set(DIRTY_BIT_DESCRIPTOR_SETS);
 }
 
-gl::Error ContextVk::dispatchCompute(const gl::Context *context,
-                                     GLuint numGroupsX,
-                                     GLuint numGroupsY,
-                                     GLuint numGroupsZ)
+angle::Result ContextVk::dispatchCompute(const gl::Context *context,
+                                         GLuint numGroupsX,
+                                         GLuint numGroupsY,
+                                         GLuint numGroupsZ)
 {
-    UNIMPLEMENTED();
-    return gl::InternalError();
+    ANGLE_VK_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
-gl::Error ContextVk::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect)
+angle::Result ContextVk::dispatchComputeIndirect(const gl::Context *context, GLintptr indirect)
 {
-    UNIMPLEMENTED();
-    return gl::InternalError();
+    ANGLE_VK_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
-gl::Error ContextVk::memoryBarrier(const gl::Context *context, GLbitfield barriers)
+angle::Result ContextVk::memoryBarrier(const gl::Context *context, GLbitfield barriers)
 {
-    UNIMPLEMENTED();
-    return gl::InternalError();
+    ANGLE_VK_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
-gl::Error ContextVk::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers)
+angle::Result ContextVk::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers)
 {
-    UNIMPLEMENTED();
-    return gl::InternalError();
+    ANGLE_VK_UNREACHABLE(this);
+    return angle::Result::Stop();
 }
 
 vk::DynamicDescriptorPool *ContextVk::getDynamicDescriptorPool(uint32_t descriptorSetIndex)
diff --git a/src/libANGLE/renderer/vulkan/ContextVk.h b/src/libANGLE/renderer/vulkan/ContextVk.h
index ff717e3..167a088 100644
--- a/src/libANGLE/renderer/vulkan/ContextVk.h
+++ b/src/libANGLE/renderer/vulkan/ContextVk.h
@@ -27,50 +27,50 @@
     ContextVk(const gl::ContextState &state, RendererVk *renderer);
     ~ContextVk() override;
 
-    gl::Error initialize() override;
+    angle::Result initialize() override;
 
     void onDestroy(const gl::Context *context) override;
 
     // Flush and finish.
-    gl::Error flush(const gl::Context *context) override;
-    gl::Error finish(const gl::Context *context) override;
+    angle::Result flush(const gl::Context *context) override;
+    angle::Result finish(const gl::Context *context) override;
 
     // Drawing methods.
     angle::Result drawArrays(const gl::Context *context,
                              gl::PrimitiveMode mode,
                              GLint first,
                              GLsizei count) override;
-    gl::Error drawArraysInstanced(const gl::Context *context,
-                                  gl::PrimitiveMode mode,
-                                  GLint first,
-                                  GLsizei count,
-                                  GLsizei instanceCount) override;
+    angle::Result drawArraysInstanced(const gl::Context *context,
+                                      gl::PrimitiveMode mode,
+                                      GLint first,
+                                      GLsizei count,
+                                      GLsizei instanceCount) override;
 
-    gl::Error drawElements(const gl::Context *context,
-                           gl::PrimitiveMode mode,
-                           GLsizei count,
-                           GLenum type,
-                           const void *indices) override;
-    gl::Error drawElementsInstanced(const gl::Context *context,
+    angle::Result drawElements(const gl::Context *context,
+                               gl::PrimitiveMode mode,
+                               GLsizei count,
+                               GLenum type,
+                               const void *indices) override;
+    angle::Result drawElementsInstanced(const gl::Context *context,
+                                        gl::PrimitiveMode mode,
+                                        GLsizei count,
+                                        GLenum type,
+                                        const void *indices,
+                                        GLsizei instances) override;
+    angle::Result drawRangeElements(const gl::Context *context,
                                     gl::PrimitiveMode mode,
+                                    GLuint start,
+                                    GLuint end,
                                     GLsizei count,
                                     GLenum type,
-                                    const void *indices,
-                                    GLsizei instances) override;
-    gl::Error drawRangeElements(const gl::Context *context,
-                                gl::PrimitiveMode mode,
-                                GLuint start,
-                                GLuint end,
-                                GLsizei count,
-                                GLenum type,
-                                const void *indices) override;
-    gl::Error drawArraysIndirect(const gl::Context *context,
-                                 gl::PrimitiveMode mode,
-                                 const void *indirect) override;
-    gl::Error drawElementsIndirect(const gl::Context *context,
-                                   gl::PrimitiveMode mode,
-                                   GLenum type,
-                                   const void *indirect) override;
+                                    const void *indices) override;
+    angle::Result drawArraysIndirect(const gl::Context *context,
+                                     gl::PrimitiveMode mode,
+                                     const void *indirect) override;
+    angle::Result drawElementsIndirect(const gl::Context *context,
+                                       gl::PrimitiveMode mode,
+                                       GLenum type,
+                                       const void *indirect) override;
 
     // Device loss
     GLenum getResetStatus() override;
@@ -101,7 +101,7 @@
     GLint64 getTimestamp() override;
 
     // Context switching
-    gl::Error onMakeCurrent(const gl::Context *context) override;
+    angle::Result onMakeCurrent(const gl::Context *context) override;
 
     // Native capabilities, unmodified by gl::Context.
     gl::Caps getNativeCaps() const override;
@@ -147,14 +147,14 @@
     // Path object creation
     std::vector<PathImpl *> createPaths(GLsizei) override;
 
-    gl::Error dispatchCompute(const gl::Context *context,
-                              GLuint numGroupsX,
-                              GLuint numGroupsY,
-                              GLuint numGroupsZ) override;
-    gl::Error dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
+    angle::Result dispatchCompute(const gl::Context *context,
+                                  GLuint numGroupsX,
+                                  GLuint numGroupsY,
+                                  GLuint numGroupsZ) override;
+    angle::Result dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
 
-    gl::Error memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
-    gl::Error memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
+    angle::Result memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
+    angle::Result memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
 
     VkDevice getDevice() const;
     const FeaturesVk &getFeatures() const;
diff --git a/src/libANGLE/renderer/vulkan/vk_utils.h b/src/libANGLE/renderer/vulkan/vk_utils.h
index 7d39dc7..fa4f31a 100644
--- a/src/libANGLE/renderer/vulkan/vk_utils.h
+++ b/src/libANGLE/renderer/vulkan/vk_utils.h
@@ -913,4 +913,8 @@
 #define ANGLE_VK_TRY_RETURN_ALLOW_TIMEOUT(context, command) \
     ANGLE_VK_TRY_RETURN_ALLOW_OTHER(context, command, VK_TIMEOUT)
 
+#define ANGLE_VK_UNREACHABLE(context) \
+    UNREACHABLE();                    \
+    ANGLE_VK_CHECK(context, false, VK_ERROR_FEATURE_NOT_PRESENT)
+
 #endif  // LIBANGLE_RENDERER_VULKAN_VK_UTILS_H_