Commit 32643cea by Jamie Madill Committed by Commit Bot

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/1280742Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent bc6f52f3
...@@ -690,8 +690,9 @@ egl::Error Context::makeCurrent(egl::Display *display, egl::Surface *surface) ...@@ -690,8 +690,9 @@ egl::Error Context::makeCurrent(egl::Display *display, egl::Surface *surface)
} }
} }
// Notify the renderer of a context switch // Notify the renderer of a context switch.
ANGLE_TRY(mImplementation->onMakeCurrent(this)); // TODO(jmadill): Fix this error handling. http://anglebug.com/2491
(void)(mImplementation->onMakeCurrent(this));
return egl::NoError(); return egl::NoError();
} }
......
...@@ -34,49 +34,49 @@ class ContextImpl : public GLImplFactory ...@@ -34,49 +34,49 @@ class ContextImpl : public GLImplFactory
virtual void onDestroy(const gl::Context *context) {} virtual void onDestroy(const gl::Context *context) {}
virtual gl::Error initialize() = 0; virtual angle::Result initialize() = 0;
// Flush and finish. // Flush and finish.
virtual gl::Error flush(const gl::Context *context) = 0; virtual angle::Result flush(const gl::Context *context) = 0;
virtual gl::Error finish(const gl::Context *context) = 0; virtual angle::Result finish(const gl::Context *context) = 0;
// Drawing methods. // Drawing methods.
virtual angle::Result drawArrays(const gl::Context *context, virtual angle::Result drawArrays(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count) = 0; GLsizei count) = 0;
virtual gl::Error drawArraysInstanced(const gl::Context *context, virtual angle::Result drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count, GLsizei count,
GLsizei instanceCount) = 0; GLsizei instanceCount) = 0;
virtual gl::Error drawElements(const gl::Context *context, virtual angle::Result drawElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) = 0; const void *indices) = 0;
virtual gl::Error drawElementsInstanced(const gl::Context *context, 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, gl::PrimitiveMode mode,
GLuint start,
GLuint end,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices, const void *indices) = 0;
GLsizei instances) = 0;
virtual gl::Error drawRangeElements(const gl::Context *context, virtual angle::Result drawArraysIndirect(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLuint start, const void *indirect) = 0;
GLuint end, virtual angle::Result drawElementsIndirect(const gl::Context *context,
GLsizei count, gl::PrimitiveMode mode,
GLenum type, GLenum type,
const void *indices) = 0; const void *indirect) = 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;
// CHROMIUM_path_rendering path drawing methods. // CHROMIUM_path_rendering path drawing methods.
virtual void stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask); virtual void stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask);
...@@ -150,7 +150,7 @@ class ContextImpl : public GLImplFactory ...@@ -150,7 +150,7 @@ class ContextImpl : public GLImplFactory
virtual GLint64 getTimestamp() = 0; virtual GLint64 getTimestamp() = 0;
// Context switching // 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. // Native capabilities, unmodified by gl::Context.
virtual gl::Caps getNativeCaps() const = 0; virtual gl::Caps getNativeCaps() const = 0;
...@@ -160,14 +160,16 @@ class ContextImpl : public GLImplFactory ...@@ -160,14 +160,16 @@ class ContextImpl : public GLImplFactory
virtual void applyNativeWorkarounds(gl::Workarounds *workarounds) const {} virtual void applyNativeWorkarounds(gl::Workarounds *workarounds) const {}
virtual gl::Error dispatchCompute(const gl::Context *context, virtual angle::Result dispatchCompute(const gl::Context *context,
GLuint numGroupsX, GLuint numGroupsX,
GLuint numGroupsY, GLuint numGroupsY,
GLuint numGroupsZ) = 0; GLuint numGroupsZ) = 0;
virtual gl::Error dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) = 0; virtual angle::Result dispatchComputeIndirect(const gl::Context *context,
GLintptr indirect) = 0;
virtual gl::Error memoryBarrier(const gl::Context *context, GLbitfield barriers) = 0; virtual angle::Result memoryBarrier(const gl::Context *context, GLbitfield barriers) = 0;
virtual gl::Error memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) = 0; virtual angle::Result memoryBarrierByRegion(const gl::Context *context,
GLbitfield barriers) = 0;
const gl::ContextState &getContextState() { return mState; } const gl::ContextState &getContextState() { return mState; }
int getClientMajorVersion() const { return mState.getClientMajorVersion(); } int getClientMajorVersion() const { return mState.getClientMajorVersion(); }
......
...@@ -88,9 +88,9 @@ bool DrawCallHasStreamingElementArray(const gl::Context *context, GLenum srcType ...@@ -88,9 +88,9 @@ bool DrawCallHasStreamingElementArray(const gl::Context *context, GLenum srcType
} }
template <typename IndirectBufferT> template <typename IndirectBufferT>
gl::Error ReadbackIndirectBuffer(const gl::Context *context, angle::Result ReadbackIndirectBuffer(const gl::Context *context,
const void *indirect, const void *indirect,
const IndirectBufferT **bufferPtrOut) const IndirectBufferT **bufferPtrOut)
{ {
const gl::State &glState = context->getGLState(); const gl::State &glState = context->getGLState();
gl::Buffer *drawIndirectBuffer = glState.getTargetBuffer(gl::BufferBinding::DrawIndirect); gl::Buffer *drawIndirectBuffer = glState.getTargetBuffer(gl::BufferBinding::DrawIndirect);
...@@ -103,7 +103,7 @@ gl::Error ReadbackIndirectBuffer(const gl::Context *context, ...@@ -103,7 +103,7 @@ gl::Error ReadbackIndirectBuffer(const gl::Context *context,
ASSERT(bufferData); ASSERT(bufferData);
*bufferPtrOut = reinterpret_cast<const IndirectBufferT *>(bufferData + offset); *bufferPtrOut = reinterpret_cast<const IndirectBufferT *>(bufferData + offset);
return gl::NoError(); return angle::Result::Continue();
} }
} // anonymous namespace } // anonymous namespace
...@@ -116,9 +116,9 @@ Context11::~Context11() ...@@ -116,9 +116,9 @@ Context11::~Context11()
{ {
} }
gl::Error Context11::initialize() angle::Result Context11::initialize()
{ {
return gl::NoError(); return angle::Result::Continue();
} }
void Context11::onDestroy(const gl::Context *context) void Context11::onDestroy(const gl::Context *context)
...@@ -230,12 +230,12 @@ std::vector<PathImpl *> Context11::createPaths(GLsizei) ...@@ -230,12 +230,12 @@ std::vector<PathImpl *> Context11::createPaths(GLsizei)
return std::vector<PathImpl *>(); return std::vector<PathImpl *>();
} }
gl::Error Context11::flush(const gl::Context *context) angle::Result Context11::flush(const gl::Context *context)
{ {
return mRenderer->flush(this); return mRenderer->flush(this);
} }
gl::Error Context11::finish(const gl::Context *context) angle::Result Context11::finish(const gl::Context *context)
{ {
return mRenderer->finish(this); return mRenderer->finish(this);
} }
...@@ -251,11 +251,11 @@ angle::Result Context11::drawArrays(const gl::Context *context, ...@@ -251,11 +251,11 @@ angle::Result Context11::drawArrays(const gl::Context *context,
return mRenderer->drawArrays(context, drawCallParams); return mRenderer->drawArrays(context, drawCallParams);
} }
gl::Error Context11::drawArraysInstanced(const gl::Context *context, angle::Result Context11::drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count, GLsizei count,
GLsizei instanceCount) GLsizei instanceCount)
{ {
const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>(); const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>();
ASSERT(!drawCallParams.isDrawElements() && !drawCallParams.isDrawIndirect()); ASSERT(!drawCallParams.isDrawElements() && !drawCallParams.isDrawIndirect());
...@@ -263,11 +263,11 @@ gl::Error Context11::drawArraysInstanced(const gl::Context *context, ...@@ -263,11 +263,11 @@ gl::Error Context11::drawArraysInstanced(const gl::Context *context,
return mRenderer->drawArrays(context, drawCallParams); return mRenderer->drawArrays(context, drawCallParams);
} }
gl::Error Context11::drawElements(const gl::Context *context, angle::Result Context11::drawElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) const void *indices)
{ {
const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>(); const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>();
ASSERT(drawCallParams.isDrawElements() && !drawCallParams.isDrawIndirect()); ASSERT(drawCallParams.isDrawElements() && !drawCallParams.isDrawIndirect());
...@@ -275,12 +275,12 @@ gl::Error Context11::drawElements(const gl::Context *context, ...@@ -275,12 +275,12 @@ gl::Error Context11::drawElements(const gl::Context *context,
return mRenderer->drawElements(context, drawCallParams); return mRenderer->drawElements(context, drawCallParams);
} }
gl::Error Context11::drawElementsInstanced(const gl::Context *context, angle::Result Context11::drawElementsInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices, const void *indices,
GLsizei instances) GLsizei instances)
{ {
const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>(); const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>();
ASSERT(drawCallParams.isDrawElements() && !drawCallParams.isDrawIndirect()); ASSERT(drawCallParams.isDrawElements() && !drawCallParams.isDrawIndirect());
...@@ -288,13 +288,13 @@ gl::Error Context11::drawElementsInstanced(const gl::Context *context, ...@@ -288,13 +288,13 @@ gl::Error Context11::drawElementsInstanced(const gl::Context *context,
return mRenderer->drawElements(context, drawCallParams); return mRenderer->drawElements(context, drawCallParams);
} }
gl::Error Context11::drawRangeElements(const gl::Context *context, angle::Result Context11::drawRangeElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLuint start, GLuint start,
GLuint end, GLuint end,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) const void *indices)
{ {
const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>(); const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>();
ASSERT(drawCallParams.isDrawElements() && !drawCallParams.isDrawIndirect()); ASSERT(drawCallParams.isDrawElements() && !drawCallParams.isDrawIndirect());
...@@ -302,9 +302,9 @@ gl::Error Context11::drawRangeElements(const gl::Context *context, ...@@ -302,9 +302,9 @@ gl::Error Context11::drawRangeElements(const gl::Context *context,
return mRenderer->drawElements(context, drawCallParams); return mRenderer->drawElements(context, drawCallParams);
} }
gl::Error Context11::drawArraysIndirect(const gl::Context *context, angle::Result Context11::drawArraysIndirect(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
const void *indirect) const void *indirect)
{ {
if (DrawCallHasStreamingVertexArrays(context, mode)) if (DrawCallHasStreamingVertexArrays(context, mode))
{ {
...@@ -324,10 +324,10 @@ gl::Error Context11::drawArraysIndirect(const gl::Context *context, ...@@ -324,10 +324,10 @@ gl::Error Context11::drawArraysIndirect(const gl::Context *context,
} }
} }
gl::Error Context11::drawElementsIndirect(const gl::Context *context, angle::Result Context11::drawElementsIndirect(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLenum type, GLenum type,
const void *indirect) const void *indirect)
{ {
if (DrawCallHasStreamingVertexArrays(context, mode) || if (DrawCallHasStreamingVertexArrays(context, mode) ||
DrawCallHasStreamingElementArray(context, type)) DrawCallHasStreamingElementArray(context, type))
...@@ -345,7 +345,7 @@ gl::Error Context11::drawElementsIndirect(const gl::Context *context, ...@@ -345,7 +345,7 @@ gl::Error Context11::drawElementsIndirect(const gl::Context *context,
// We must explicitly resolve the index range for the slow-path indirect drawElements to // 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 // make sure we are using the correct 'baseVertex'. This parameter does not exist for the
// direct drawElements. // direct drawElements.
ANGLE_TRY(drawCallParams.ensureIndexRangeResolved(context)); ANGLE_TRY_HANDLE(context, drawCallParams.ensureIndexRangeResolved(context));
ANGLE_TRY(prepareForDrawCall(context, drawCallParams)); ANGLE_TRY(prepareForDrawCall(context, drawCallParams));
return mRenderer->drawElements(context, drawCallParams); return mRenderer->drawElements(context, drawCallParams);
...@@ -427,10 +427,9 @@ GLint64 Context11::getTimestamp() ...@@ -427,10 +427,9 @@ GLint64 Context11::getTimestamp()
return mRenderer->getTimestamp(); 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 mRenderer->getStateManager()->onMakeCurrent(context);
return gl::NoError();
} }
gl::Caps Context11::getNativeCaps() const gl::Caps Context11::getNativeCaps() const
...@@ -474,15 +473,15 @@ const gl::Limitations &Context11::getNativeLimitations() const ...@@ -474,15 +473,15 @@ const gl::Limitations &Context11::getNativeLimitations() const
return mRenderer->getNativeLimitations(); return mRenderer->getNativeLimitations();
} }
gl::Error Context11::dispatchCompute(const gl::Context *context, angle::Result Context11::dispatchCompute(const gl::Context *context,
GLuint numGroupsX, GLuint numGroupsX,
GLuint numGroupsY, GLuint numGroupsY,
GLuint numGroupsZ) GLuint numGroupsZ)
{ {
return mRenderer->dispatchCompute(context, numGroupsX, numGroupsY, 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); return mRenderer->dispatchComputeIndirect(context, indirect);
} }
...@@ -566,14 +565,14 @@ angle::Result Context11::prepareForDrawCall(const gl::Context *context, ...@@ -566,14 +565,14 @@ angle::Result Context11::prepareForDrawCall(const gl::Context *context,
return angle::Result::Continue(); 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, angle::Result Context11::getIncompleteTexture(const gl::Context *context,
......
...@@ -24,7 +24,7 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer ...@@ -24,7 +24,7 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer
Context11(const gl::ContextState &state, Renderer11 *renderer); Context11(const gl::ContextState &state, Renderer11 *renderer);
~Context11() override; ~Context11() override;
gl::Error initialize() override; angle::Result initialize() override;
void onDestroy(const gl::Context *context) override; void onDestroy(const gl::Context *context) override;
// Shader creation // Shader creation
...@@ -66,45 +66,45 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer ...@@ -66,45 +66,45 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer
std::vector<PathImpl *> createPaths(GLsizei) override; std::vector<PathImpl *> createPaths(GLsizei) override;
// Flush and finish. // Flush and finish.
gl::Error flush(const gl::Context *context) override; angle::Result flush(const gl::Context *context) override;
gl::Error finish(const gl::Context *context) override; angle::Result finish(const gl::Context *context) override;
// Drawing methods. // Drawing methods.
angle::Result drawArrays(const gl::Context *context, angle::Result drawArrays(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count) override; GLsizei count) override;
gl::Error drawArraysInstanced(const gl::Context *context, angle::Result drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count, GLsizei count,
GLsizei instanceCount) override; GLsizei instanceCount) override;
gl::Error drawElements(const gl::Context *context, angle::Result drawElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) override; const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context, 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, gl::PrimitiveMode mode,
GLuint start,
GLuint end,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices, const void *indices) override;
GLsizei instances) override; angle::Result drawArraysIndirect(const gl::Context *context,
gl::Error drawRangeElements(const gl::Context *context, gl::PrimitiveMode mode,
gl::PrimitiveMode mode, const void *indirect) override;
GLuint start, angle::Result drawElementsIndirect(const gl::Context *context,
GLuint end, gl::PrimitiveMode mode,
GLsizei count, GLenum type,
GLenum type, const void *indirect) override;
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;
// Device loss // Device loss
GLenum getResetStatus() override; GLenum getResetStatus() override;
...@@ -132,7 +132,7 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer ...@@ -132,7 +132,7 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer
GLint64 getTimestamp() override; GLint64 getTimestamp() override;
// Context switching // Context switching
gl::Error onMakeCurrent(const gl::Context *context) override; angle::Result onMakeCurrent(const gl::Context *context) override;
// Caps queries // Caps queries
gl::Caps getNativeCaps() const override; gl::Caps getNativeCaps() const override;
...@@ -142,14 +142,14 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer ...@@ -142,14 +142,14 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer
Renderer11 *getRenderer() const { return mRenderer; } Renderer11 *getRenderer() const { return mRenderer; }
gl::Error dispatchCompute(const gl::Context *context, angle::Result dispatchCompute(const gl::Context *context,
GLuint numGroupsX, GLuint numGroupsX,
GLuint numGroupsY, GLuint numGroupsY,
GLuint numGroupsZ) override; GLuint numGroupsZ) override;
gl::Error dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override; angle::Result dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
gl::Error memoryBarrier(const gl::Context *context, GLbitfield barriers) override; angle::Result memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
gl::Error memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override; angle::Result memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
angle::Result triggerDrawCallProgramRecompilation(const gl::Context *context, angle::Result triggerDrawCallProgramRecompilation(const gl::Context *context,
gl::PrimitiveMode drawMode); gl::PrimitiveMode drawMode);
......
...@@ -36,9 +36,9 @@ Context9::~Context9() ...@@ -36,9 +36,9 @@ Context9::~Context9()
{ {
} }
gl::Error Context9::initialize() angle::Result Context9::initialize()
{ {
return gl::NoError(); return angle::Result::Continue();
} }
void Context9::onDestroy(const gl::Context *context) void Context9::onDestroy(const gl::Context *context)
...@@ -136,12 +136,12 @@ std::vector<PathImpl *> Context9::createPaths(GLsizei) ...@@ -136,12 +136,12 @@ std::vector<PathImpl *> Context9::createPaths(GLsizei)
return std::vector<PathImpl *>(); return std::vector<PathImpl *>();
} }
gl::Error Context9::flush(const gl::Context *context) angle::Result Context9::flush(const gl::Context *context)
{ {
return mRenderer->flush(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); return mRenderer->finish(context);
} }
...@@ -154,60 +154,60 @@ angle::Result Context9::drawArrays(const gl::Context *context, ...@@ -154,60 +154,60 @@ angle::Result Context9::drawArrays(const gl::Context *context,
return mRenderer->genericDrawArrays(context, mode, first, count, 0); return mRenderer->genericDrawArrays(context, mode, first, count, 0);
} }
gl::Error Context9::drawArraysInstanced(const gl::Context *context, angle::Result Context9::drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count, GLsizei count,
GLsizei instanceCount) GLsizei instanceCount)
{ {
return mRenderer->genericDrawArrays(context, mode, first, count, instanceCount); return mRenderer->genericDrawArrays(context, mode, first, count, instanceCount);
} }
gl::Error Context9::drawElements(const gl::Context *context, angle::Result Context9::drawElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) const void *indices)
{ {
return mRenderer->genericDrawElements(context, mode, count, type, indices, 0); return mRenderer->genericDrawElements(context, mode, count, type, indices, 0);
} }
gl::Error Context9::drawElementsInstanced(const gl::Context *context, angle::Result Context9::drawElementsInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices, const void *indices,
GLsizei instances) GLsizei instances)
{ {
return mRenderer->genericDrawElements(context, mode, count, type, indices, instances); return mRenderer->genericDrawElements(context, mode, count, type, indices, instances);
} }
gl::Error Context9::drawRangeElements(const gl::Context *context, angle::Result Context9::drawRangeElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLuint start, GLuint start,
GLuint end, GLuint end,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) const void *indices)
{ {
return mRenderer->genericDrawElements(context, mode, count, type, indices, 0); return mRenderer->genericDrawElements(context, mode, count, type, indices, 0);
} }
gl::Error Context9::drawArraysIndirect(const gl::Context *context, angle::Result Context9::drawArraysIndirect(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
const void *indirect) const void *indirect)
{ {
UNREACHABLE(); ANGLE_HR_UNREACHABLE(this);
return gl::InternalError() << "D3D9 doesn't support ES 3.1 DrawArraysIndirect API"; return angle::Result::Stop();
} }
gl::Error Context9::drawElementsIndirect(const gl::Context *context, angle::Result Context9::drawElementsIndirect(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLenum type, GLenum type,
const void *indirect) const void *indirect)
{ {
UNREACHABLE(); ANGLE_HR_UNREACHABLE(this);
return gl::InternalError() << "D3D9 doesn't support ES 3.1 DrawElementsIndirect API"; return angle::Result::Stop();
} }
GLenum Context9::getResetStatus() GLenum Context9::getResetStatus()
...@@ -278,7 +278,7 @@ GLint64 Context9::getTimestamp() ...@@ -278,7 +278,7 @@ GLint64 Context9::getTimestamp()
return mRenderer->getTimestamp(); return mRenderer->getTimestamp();
} }
gl::Error Context9::onMakeCurrent(const gl::Context *context) angle::Result Context9::onMakeCurrent(const gl::Context *context)
{ {
return mRenderer->ensureVertexDataManagerInitialized(context); return mRenderer->ensureVertexDataManagerInitialized(context);
} }
...@@ -303,31 +303,31 @@ const gl::Limitations &Context9::getNativeLimitations() const ...@@ -303,31 +303,31 @@ const gl::Limitations &Context9::getNativeLimitations() const
return mRenderer->getNativeLimitations(); return mRenderer->getNativeLimitations();
} }
gl::Error Context9::dispatchCompute(const gl::Context *context, angle::Result Context9::dispatchCompute(const gl::Context *context,
GLuint numGroupsX, GLuint numGroupsX,
GLuint numGroupsY, GLuint numGroupsY,
GLuint numGroupsZ) GLuint numGroupsZ)
{ {
UNREACHABLE(); ANGLE_HR_UNREACHABLE(this);
return gl::InternalError() << "D3D9 doesn't support ES 3.1 DispatchCompute API"; 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(); ANGLE_HR_UNREACHABLE(this);
return gl::InternalError() << "D3D9 doesn't support ES 3.1 dispatchComputeIndirect API"; 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(); ANGLE_HR_UNREACHABLE(this);
return gl::InternalError() << "D3D9 doesn't support ES 3.1 memoryBarrier API"; 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(); ANGLE_HR_UNREACHABLE(this);
return gl::InternalError() << "D3D9 doesn't support ES 3.1 memoryBarrierByRegion API"; return angle::Result::Stop();
} }
angle::Result Context9::getIncompleteTexture(const gl::Context *context, angle::Result Context9::getIncompleteTexture(const gl::Context *context,
......
...@@ -22,7 +22,7 @@ class Context9 : public ContextD3D ...@@ -22,7 +22,7 @@ class Context9 : public ContextD3D
Context9(const gl::ContextState &state, Renderer9 *renderer); Context9(const gl::ContextState &state, Renderer9 *renderer);
~Context9() override; ~Context9() override;
gl::Error initialize() override; angle::Result initialize() override;
void onDestroy(const gl::Context *context) override; void onDestroy(const gl::Context *context) override;
// Shader creation // Shader creation
...@@ -64,45 +64,45 @@ class Context9 : public ContextD3D ...@@ -64,45 +64,45 @@ class Context9 : public ContextD3D
std::vector<PathImpl *> createPaths(GLsizei) override; std::vector<PathImpl *> createPaths(GLsizei) override;
// Flush and finish. // Flush and finish.
gl::Error flush(const gl::Context *context) override; angle::Result flush(const gl::Context *context) override;
gl::Error finish(const gl::Context *context) override; angle::Result finish(const gl::Context *context) override;
// Drawing methods. // Drawing methods.
angle::Result drawArrays(const gl::Context *context, angle::Result drawArrays(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count) override; GLsizei count) override;
gl::Error drawArraysInstanced(const gl::Context *context, angle::Result drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count, GLsizei count,
GLsizei instanceCount) override; GLsizei instanceCount) override;
gl::Error drawElements(const gl::Context *context, angle::Result drawElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) override; const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context, 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, gl::PrimitiveMode mode,
GLuint start,
GLuint end,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices, const void *indices) override;
GLsizei instances) override; angle::Result drawArraysIndirect(const gl::Context *context,
gl::Error drawRangeElements(const gl::Context *context, gl::PrimitiveMode mode,
gl::PrimitiveMode mode, const void *indirect) override;
GLuint start, angle::Result drawElementsIndirect(const gl::Context *context,
GLuint end, gl::PrimitiveMode mode,
GLsizei count, GLenum type,
GLenum type, const void *indirect) override;
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;
// Device loss // Device loss
GLenum getResetStatus() override; GLenum getResetStatus() override;
...@@ -130,7 +130,7 @@ class Context9 : public ContextD3D ...@@ -130,7 +130,7 @@ class Context9 : public ContextD3D
GLint64 getTimestamp() override; GLint64 getTimestamp() override;
// Context switching // Context switching
gl::Error onMakeCurrent(const gl::Context *context) override; angle::Result onMakeCurrent(const gl::Context *context) override;
// Caps queries // Caps queries
gl::Caps getNativeCaps() const override; gl::Caps getNativeCaps() const override;
...@@ -138,14 +138,14 @@ class Context9 : public ContextD3D ...@@ -138,14 +138,14 @@ class Context9 : public ContextD3D
const gl::Extensions &getNativeExtensions() const override; const gl::Extensions &getNativeExtensions() const override;
const gl::Limitations &getNativeLimitations() const override; const gl::Limitations &getNativeLimitations() const override;
gl::Error dispatchCompute(const gl::Context *context, angle::Result dispatchCompute(const gl::Context *context,
GLuint numGroupsX, GLuint numGroupsX,
GLuint numGroupsY, GLuint numGroupsY,
GLuint numGroupsZ) override; GLuint numGroupsZ) override;
gl::Error dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override; angle::Result dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
gl::Error memoryBarrier(const gl::Context *context, GLbitfield barriers) override; angle::Result memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
gl::Error memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override; angle::Result memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
Renderer9 *getRenderer() const { return mRenderer; } Renderer9 *getRenderer() const { return mRenderer; }
......
...@@ -41,9 +41,9 @@ ContextGL::~ContextGL() ...@@ -41,9 +41,9 @@ ContextGL::~ContextGL()
{ {
} }
gl::Error ContextGL::initialize() angle::Result ContextGL::initialize()
{ {
return gl::NoError(); return angle::Result::Continue();
} }
CompilerImpl *ContextGL::createCompiler() CompilerImpl *ContextGL::createCompiler()
...@@ -160,12 +160,12 @@ std::vector<PathImpl *> ContextGL::createPaths(GLsizei range) ...@@ -160,12 +160,12 @@ std::vector<PathImpl *> ContextGL::createPaths(GLsizei range)
return ret; return ret;
} }
gl::Error ContextGL::flush(const gl::Context *context) angle::Result ContextGL::flush(const gl::Context *context)
{ {
return mRenderer->flush(); return mRenderer->flush();
} }
gl::Error ContextGL::finish(const gl::Context *context) angle::Result ContextGL::finish(const gl::Context *context)
{ {
return mRenderer->finish(); return mRenderer->finish();
} }
...@@ -178,56 +178,56 @@ angle::Result ContextGL::drawArrays(const gl::Context *context, ...@@ -178,56 +178,56 @@ angle::Result ContextGL::drawArrays(const gl::Context *context,
return mRenderer->drawArrays(context, mode, first, count); return mRenderer->drawArrays(context, mode, first, count);
} }
gl::Error ContextGL::drawArraysInstanced(const gl::Context *context, angle::Result ContextGL::drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count, GLsizei count,
GLsizei instanceCount) GLsizei instanceCount)
{ {
return mRenderer->drawArraysInstanced(context, mode, first, count, instanceCount); return mRenderer->drawArraysInstanced(context, mode, first, count, instanceCount);
} }
gl::Error ContextGL::drawElements(const gl::Context *context, angle::Result ContextGL::drawElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) const void *indices)
{ {
return mRenderer->drawElements(context, mode, count, type, indices); return mRenderer->drawElements(context, mode, count, type, indices);
} }
gl::Error ContextGL::drawElementsInstanced(const gl::Context *context, angle::Result ContextGL::drawElementsInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices, const void *indices,
GLsizei instances) GLsizei instances)
{ {
return mRenderer->drawElementsInstanced(context, mode, count, type, indices, instances); return mRenderer->drawElementsInstanced(context, mode, count, type, indices, instances);
} }
gl::Error ContextGL::drawRangeElements(const gl::Context *context, angle::Result ContextGL::drawRangeElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLuint start, GLuint start,
GLuint end, GLuint end,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) const void *indices)
{ {
return mRenderer->drawRangeElements(context, mode, start, end, count, type, indices); return mRenderer->drawRangeElements(context, mode, start, end, count, type, indices);
} }
gl::Error ContextGL::drawArraysIndirect(const gl::Context *context, angle::Result ContextGL::drawArraysIndirect(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
const void *indirect) const void *indirect)
{ {
return mRenderer->drawArraysIndirect(context, mode, indirect); return mRenderer->drawArraysIndirect(context, mode, indirect);
} }
gl::Error ContextGL::drawElementsIndirect(const gl::Context *context, angle::Result ContextGL::drawElementsIndirect(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLenum type, GLenum type,
const void *indirect) const void *indirect)
{ {
return mRenderer->drawElementsIndirect(context, mode, type, indirect); return mRenderer->drawElementsIndirect(context, mode, type, indirect);
} }
...@@ -384,11 +384,10 @@ GLint64 ContextGL::getTimestamp() ...@@ -384,11 +384,10 @@ GLint64 ContextGL::getTimestamp()
return mRenderer->getTimestamp(); 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 // Queries need to be paused/resumed on context switches
ANGLE_TRY(mRenderer->getStateManager()->onMakeCurrent(context)); return mRenderer->getStateManager()->onMakeCurrent(context);
return gl::NoError();
} }
gl::Caps ContextGL::getNativeCaps() const gl::Caps ContextGL::getNativeCaps() const
...@@ -441,24 +440,24 @@ ClearMultiviewGL *ContextGL::getMultiviewClearer() const ...@@ -441,24 +440,24 @@ ClearMultiviewGL *ContextGL::getMultiviewClearer() const
return mRenderer->getMultiviewClearer(); return mRenderer->getMultiviewClearer();
} }
gl::Error ContextGL::dispatchCompute(const gl::Context *context, angle::Result ContextGL::dispatchCompute(const gl::Context *context,
GLuint numGroupsX, GLuint numGroupsX,
GLuint numGroupsY, GLuint numGroupsY,
GLuint numGroupsZ) GLuint numGroupsZ)
{ {
return mRenderer->dispatchCompute(context, numGroupsX, numGroupsY, 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); 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); 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); return mRenderer->memoryBarrierByRegion(barriers);
} }
......
...@@ -32,7 +32,7 @@ class ContextGL : public ContextImpl ...@@ -32,7 +32,7 @@ class ContextGL : public ContextImpl
ContextGL(const gl::ContextState &state, const std::shared_ptr<RendererGL> &renderer); ContextGL(const gl::ContextState &state, const std::shared_ptr<RendererGL> &renderer);
~ContextGL() override; ~ContextGL() override;
gl::Error initialize() override; angle::Result initialize() override;
// Shader creation // Shader creation
CompilerImpl *createCompiler() override; CompilerImpl *createCompiler() override;
...@@ -73,45 +73,45 @@ class ContextGL : public ContextImpl ...@@ -73,45 +73,45 @@ class ContextGL : public ContextImpl
std::vector<PathImpl *> createPaths(GLsizei range) override; std::vector<PathImpl *> createPaths(GLsizei range) override;
// Flush and finish. // Flush and finish.
gl::Error flush(const gl::Context *context) override; angle::Result flush(const gl::Context *context) override;
gl::Error finish(const gl::Context *context) override; angle::Result finish(const gl::Context *context) override;
// Drawing methods. // Drawing methods.
angle::Result drawArrays(const gl::Context *context, angle::Result drawArrays(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count) override; GLsizei count) override;
gl::Error drawArraysInstanced(const gl::Context *context, angle::Result drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count, GLsizei count,
GLsizei instanceCount) override; GLsizei instanceCount) override;
gl::Error drawElements(const gl::Context *context, angle::Result drawElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) override; const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context, 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, gl::PrimitiveMode mode,
GLuint start,
GLuint end,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices, const void *indices) override;
GLsizei instances) override; angle::Result drawArraysIndirect(const gl::Context *context,
gl::Error drawRangeElements(const gl::Context *context, gl::PrimitiveMode mode,
gl::PrimitiveMode mode, const void *indirect) override;
GLuint start, angle::Result drawElementsIndirect(const gl::Context *context,
GLuint end, gl::PrimitiveMode mode,
GLsizei count, GLenum type,
GLenum type, const void *indirect) override;
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;
// CHROMIUM_path_rendering implementation // CHROMIUM_path_rendering implementation
void stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask) override; void stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask) override;
...@@ -183,7 +183,7 @@ class ContextGL : public ContextImpl ...@@ -183,7 +183,7 @@ class ContextGL : public ContextImpl
GLint64 getTimestamp() override; GLint64 getTimestamp() override;
// Context switching // Context switching
gl::Error onMakeCurrent(const gl::Context *context) override; angle::Result onMakeCurrent(const gl::Context *context) override;
// Caps queries // Caps queries
gl::Caps getNativeCaps() const override; gl::Caps getNativeCaps() const override;
...@@ -200,14 +200,14 @@ class ContextGL : public ContextImpl ...@@ -200,14 +200,14 @@ class ContextGL : public ContextImpl
BlitGL *getBlitter() const; BlitGL *getBlitter() const;
ClearMultiviewGL *getMultiviewClearer() const; ClearMultiviewGL *getMultiviewClearer() const;
gl::Error dispatchCompute(const gl::Context *context, angle::Result dispatchCompute(const gl::Context *context,
GLuint numGroupsX, GLuint numGroupsX,
GLuint numGroupsY, GLuint numGroupsY,
GLuint numGroupsZ) override; GLuint numGroupsZ) override;
gl::Error dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override; angle::Result dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
gl::Error memoryBarrier(const gl::Context *context, GLbitfield barriers) override; angle::Result memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
gl::Error memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override; angle::Result memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
void handleError(GLenum errorCode, void handleError(GLenum errorCode,
const char *message, const char *message,
......
...@@ -106,19 +106,19 @@ ContextNULL::~ContextNULL() ...@@ -106,19 +106,19 @@ ContextNULL::~ContextNULL()
{ {
} }
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, angle::Result ContextNULL::drawArrays(const gl::Context *context,
...@@ -129,58 +129,58 @@ angle::Result ContextNULL::drawArrays(const gl::Context *context, ...@@ -129,58 +129,58 @@ angle::Result ContextNULL::drawArrays(const gl::Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error ContextNULL::drawArraysInstanced(const gl::Context *context, angle::Result ContextNULL::drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count, GLsizei count,
GLsizei instanceCount) GLsizei instanceCount)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error ContextNULL::drawElements(const gl::Context *context, angle::Result ContextNULL::drawElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) 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, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices, const void *indices,
GLsizei instances) GLsizei instances)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error ContextNULL::drawRangeElements(const gl::Context *context, angle::Result ContextNULL::drawRangeElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLuint start, GLuint start,
GLuint end, GLuint end,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) const void *indices)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error ContextNULL::drawArraysIndirect(const gl::Context *context, angle::Result ContextNULL::drawArraysIndirect(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
const void *indirect) const void *indirect)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error ContextNULL::drawElementsIndirect(const gl::Context *context, angle::Result ContextNULL::drawElementsIndirect(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLenum type, GLenum type,
const void *indirect) const void *indirect)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
void ContextNULL::stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask) void ContextNULL::stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask)
...@@ -313,9 +313,9 @@ GLint64 ContextNULL::getTimestamp() ...@@ -313,9 +313,9 @@ GLint64 ContextNULL::getTimestamp()
return 0; 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 gl::Caps ContextNULL::getNativeCaps() const
...@@ -418,27 +418,27 @@ std::vector<PathImpl *> ContextNULL::createPaths(GLsizei range) ...@@ -418,27 +418,27 @@ std::vector<PathImpl *> ContextNULL::createPaths(GLsizei range)
return result; return result;
} }
gl::Error ContextNULL::dispatchCompute(const gl::Context *context, angle::Result ContextNULL::dispatchCompute(const gl::Context *context,
GLuint numGroupsX, GLuint numGroupsX,
GLuint numGroupsY, GLuint numGroupsY,
GLuint numGroupsZ) 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, void ContextNULL::handleError(GLenum errorCode,
......
...@@ -36,48 +36,48 @@ class ContextNULL : public ContextImpl ...@@ -36,48 +36,48 @@ class ContextNULL : public ContextImpl
ContextNULL(const gl::ContextState &state, AllocationTrackerNULL *allocationTracker); ContextNULL(const gl::ContextState &state, AllocationTrackerNULL *allocationTracker);
~ContextNULL() override; ~ContextNULL() override;
gl::Error initialize() override; angle::Result initialize() override;
// Flush and finish. // Flush and finish.
gl::Error flush(const gl::Context *context) override; angle::Result flush(const gl::Context *context) override;
gl::Error finish(const gl::Context *context) override; angle::Result finish(const gl::Context *context) override;
// Drawing methods. // Drawing methods.
angle::Result drawArrays(const gl::Context *context, angle::Result drawArrays(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count) override; GLsizei count) override;
gl::Error drawArraysInstanced(const gl::Context *context, angle::Result drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count, GLsizei count,
GLsizei instanceCount) override; GLsizei instanceCount) override;
gl::Error drawElements(const gl::Context *context, angle::Result drawElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) override; const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context, 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, gl::PrimitiveMode mode,
GLuint start,
GLuint end,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices, const void *indices) override;
GLsizei instances) override; angle::Result drawArraysIndirect(const gl::Context *context,
gl::Error drawRangeElements(const gl::Context *context, gl::PrimitiveMode mode,
gl::PrimitiveMode mode, const void *indirect) override;
GLuint start, angle::Result drawElementsIndirect(const gl::Context *context,
GLuint end, gl::PrimitiveMode mode,
GLsizei count, GLenum type,
GLenum type, const void *indirect) override;
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;
// CHROMIUM_path_rendering path drawing methods. // CHROMIUM_path_rendering path drawing methods.
void stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask) override; void stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask) override;
...@@ -151,7 +151,7 @@ class ContextNULL : public ContextImpl ...@@ -151,7 +151,7 @@ class ContextNULL : public ContextImpl
GLint64 getTimestamp() override; GLint64 getTimestamp() override;
// Context switching // Context switching
gl::Error onMakeCurrent(const gl::Context *context) override; angle::Result onMakeCurrent(const gl::Context *context) override;
// Native capabilities, unmodified by gl::Context. // Native capabilities, unmodified by gl::Context.
gl::Caps getNativeCaps() const override; gl::Caps getNativeCaps() const override;
...@@ -196,14 +196,14 @@ class ContextNULL : public ContextImpl ...@@ -196,14 +196,14 @@ class ContextNULL : public ContextImpl
std::vector<PathImpl *> createPaths(GLsizei range) override; std::vector<PathImpl *> createPaths(GLsizei range) override;
gl::Error dispatchCompute(const gl::Context *context, angle::Result dispatchCompute(const gl::Context *context,
GLuint numGroupsX, GLuint numGroupsX,
GLuint numGroupsY, GLuint numGroupsY,
GLuint numGroupsZ) override; GLuint numGroupsZ) override;
gl::Error dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override; angle::Result dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
gl::Error memoryBarrier(const gl::Context *context, GLbitfield barriers) override; angle::Result memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
gl::Error memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override; angle::Result memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
void handleError(GLenum errorCode, void handleError(GLenum errorCode,
const char *message, const char *message,
......
...@@ -186,7 +186,7 @@ gl::Error ContextVk::getIncompleteTexture(const gl::Context *context, ...@@ -186,7 +186,7 @@ gl::Error ContextVk::getIncompleteTexture(const gl::Context *context,
return mIncompleteTextures.getIncompleteTexture(context, type, nullptr, textureOut); 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. // Note that this may reserve more sets than strictly necessary for a particular layout.
ANGLE_TRY(mDynamicDescriptorPools[kUniformsDescriptorSetIndex].init( ANGLE_TRY(mDynamicDescriptorPools[kUniformsDescriptorSetIndex].init(
...@@ -219,15 +219,15 @@ gl::Error ContextVk::initialize() ...@@ -219,15 +219,15 @@ gl::Error ContextVk::initialize()
buffer.init(1, mRenderer); 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); return mRenderer->flush(this);
} }
gl::Error ContextVk::finish(const gl::Context *context) angle::Result ContextVk::finish(const gl::Context *context)
{ {
return mRenderer->finish(this); return mRenderer->finish(this);
} }
...@@ -484,21 +484,21 @@ angle::Result ContextVk::drawArrays(const gl::Context *context, ...@@ -484,21 +484,21 @@ angle::Result ContextVk::drawArrays(const gl::Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error ContextVk::drawArraysInstanced(const gl::Context *context, angle::Result ContextVk::drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count, GLsizei count,
GLsizei instanceCount) GLsizei instanceCount)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(this);
return gl::InternalError(); return angle::Result::Stop();
} }
gl::Error ContextVk::drawElements(const gl::Context *context, angle::Result ContextVk::drawElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) const void *indices)
{ {
const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>(); const gl::DrawCallParams &drawCallParams = context->getParams<gl::DrawCallParams>();
...@@ -514,29 +514,30 @@ gl::Error ContextVk::drawElements(const gl::Context *context, ...@@ -514,29 +514,30 @@ gl::Error ContextVk::drawElements(const gl::Context *context,
commandBuffer->drawIndexed(count, 1, 0, 0, 0); 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, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices, const void *indices,
GLsizei instances) GLsizei instances)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(this);
return gl::InternalError(); return angle::Result::Stop();
} }
gl::Error ContextVk::drawRangeElements(const gl::Context *context, angle::Result ContextVk::drawRangeElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLuint start, GLuint start,
GLuint end, GLuint end,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) const void *indices)
{ {
return gl::NoError(); ANGLE_VK_UNREACHABLE(this);
return angle::Result::Stop();
} }
VkDevice ContextVk::getDevice() const VkDevice ContextVk::getDevice() const
...@@ -544,22 +545,21 @@ VkDevice ContextVk::getDevice() const ...@@ -544,22 +545,21 @@ VkDevice ContextVk::getDevice() const
return mRenderer->getDevice(); return mRenderer->getDevice();
} }
gl::Error ContextVk::drawArraysIndirect(const gl::Context *context, angle::Result ContextVk::drawArraysIndirect(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
const void *indirect) const void *indirect)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(this);
return gl::InternalError() << "DrawArraysIndirect hasn't been implemented for vulkan backend."; return angle::Result::Stop();
} }
gl::Error ContextVk::drawElementsIndirect(const gl::Context *context, angle::Result ContextVk::drawElementsIndirect(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLenum type, GLenum type,
const void *indirect) const void *indirect)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(this);
return gl::InternalError() return angle::Result::Stop();
<< "DrawElementsIndirect hasn't been implemented for vulkan backend.";
} }
GLenum ContextVk::getResetStatus() GLenum ContextVk::getResetStatus()
...@@ -903,7 +903,7 @@ GLint64 ContextVk::getTimestamp() ...@@ -903,7 +903,7 @@ GLint64 ContextVk::getTimestamp()
return GLint64(); 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 // Flip viewports if FeaturesVk::flipViewportY is enabled and the user did not request that the
// surface is flipped. // surface is flipped.
...@@ -916,7 +916,7 @@ gl::Error ContextVk::onMakeCurrent(const gl::Context *context) ...@@ -916,7 +916,7 @@ gl::Error ContextVk::onMakeCurrent(const gl::Context *context)
updateFlipViewportDrawFramebuffer(glState); updateFlipViewportDrawFramebuffer(glState);
updateFlipViewportReadFramebuffer(glState); updateFlipViewportReadFramebuffer(glState);
invalidateDriverUniforms(); invalidateDriverUniforms();
return gl::NoError(); return angle::Result::Continue();
} }
void ContextVk::updateFlipViewportDrawFramebuffer(const gl::State &glState) void ContextVk::updateFlipViewportDrawFramebuffer(const gl::State &glState)
...@@ -1052,31 +1052,31 @@ void ContextVk::invalidateDriverUniforms() ...@@ -1052,31 +1052,31 @@ void ContextVk::invalidateDriverUniforms()
mDirtyBits.set(DIRTY_BIT_DESCRIPTOR_SETS); mDirtyBits.set(DIRTY_BIT_DESCRIPTOR_SETS);
} }
gl::Error ContextVk::dispatchCompute(const gl::Context *context, angle::Result ContextVk::dispatchCompute(const gl::Context *context,
GLuint numGroupsX, GLuint numGroupsX,
GLuint numGroupsY, GLuint numGroupsY,
GLuint numGroupsZ) GLuint numGroupsZ)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(this);
return gl::InternalError(); 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(); ANGLE_VK_UNREACHABLE(this);
return gl::InternalError(); 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(); ANGLE_VK_UNREACHABLE(this);
return gl::InternalError(); 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(); ANGLE_VK_UNREACHABLE(this);
return gl::InternalError(); return angle::Result::Stop();
} }
vk::DynamicDescriptorPool *ContextVk::getDynamicDescriptorPool(uint32_t descriptorSetIndex) vk::DynamicDescriptorPool *ContextVk::getDynamicDescriptorPool(uint32_t descriptorSetIndex)
......
...@@ -27,50 +27,50 @@ class ContextVk : public ContextImpl, public vk::Context ...@@ -27,50 +27,50 @@ class ContextVk : public ContextImpl, public vk::Context
ContextVk(const gl::ContextState &state, RendererVk *renderer); ContextVk(const gl::ContextState &state, RendererVk *renderer);
~ContextVk() override; ~ContextVk() override;
gl::Error initialize() override; angle::Result initialize() override;
void onDestroy(const gl::Context *context) override; void onDestroy(const gl::Context *context) override;
// Flush and finish. // Flush and finish.
gl::Error flush(const gl::Context *context) override; angle::Result flush(const gl::Context *context) override;
gl::Error finish(const gl::Context *context) override; angle::Result finish(const gl::Context *context) override;
// Drawing methods. // Drawing methods.
angle::Result drawArrays(const gl::Context *context, angle::Result drawArrays(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count) override; GLsizei count) override;
gl::Error drawArraysInstanced(const gl::Context *context, angle::Result drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint first, GLint first,
GLsizei count, GLsizei count,
GLsizei instanceCount) override; GLsizei instanceCount) override;
gl::Error drawElements(const gl::Context *context, angle::Result drawElements(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices) override; const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context, 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, gl::PrimitiveMode mode,
GLuint start,
GLuint end,
GLsizei count, GLsizei count,
GLenum type, GLenum type,
const void *indices, const void *indices) override;
GLsizei instances) override; angle::Result drawArraysIndirect(const gl::Context *context,
gl::Error drawRangeElements(const gl::Context *context, gl::PrimitiveMode mode,
gl::PrimitiveMode mode, const void *indirect) override;
GLuint start, angle::Result drawElementsIndirect(const gl::Context *context,
GLuint end, gl::PrimitiveMode mode,
GLsizei count, GLenum type,
GLenum type, const void *indirect) override;
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;
// Device loss // Device loss
GLenum getResetStatus() override; GLenum getResetStatus() override;
...@@ -101,7 +101,7 @@ class ContextVk : public ContextImpl, public vk::Context ...@@ -101,7 +101,7 @@ class ContextVk : public ContextImpl, public vk::Context
GLint64 getTimestamp() override; GLint64 getTimestamp() override;
// Context switching // Context switching
gl::Error onMakeCurrent(const gl::Context *context) override; angle::Result onMakeCurrent(const gl::Context *context) override;
// Native capabilities, unmodified by gl::Context. // Native capabilities, unmodified by gl::Context.
gl::Caps getNativeCaps() const override; gl::Caps getNativeCaps() const override;
...@@ -147,14 +147,14 @@ class ContextVk : public ContextImpl, public vk::Context ...@@ -147,14 +147,14 @@ class ContextVk : public ContextImpl, public vk::Context
// Path object creation // Path object creation
std::vector<PathImpl *> createPaths(GLsizei) override; std::vector<PathImpl *> createPaths(GLsizei) override;
gl::Error dispatchCompute(const gl::Context *context, angle::Result dispatchCompute(const gl::Context *context,
GLuint numGroupsX, GLuint numGroupsX,
GLuint numGroupsY, GLuint numGroupsY,
GLuint numGroupsZ) override; GLuint numGroupsZ) override;
gl::Error dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override; angle::Result dispatchComputeIndirect(const gl::Context *context, GLintptr indirect) override;
gl::Error memoryBarrier(const gl::Context *context, GLbitfield barriers) override; angle::Result memoryBarrier(const gl::Context *context, GLbitfield barriers) override;
gl::Error memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override; angle::Result memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) override;
VkDevice getDevice() const; VkDevice getDevice() const;
const FeaturesVk &getFeatures() const; const FeaturesVk &getFeatures() const;
......
...@@ -913,4 +913,8 @@ VkColorComponentFlags GetColorComponentFlags(bool red, bool green, bool blue, bo ...@@ -913,4 +913,8 @@ VkColorComponentFlags GetColorComponentFlags(bool red, bool green, bool blue, bo
#define ANGLE_VK_TRY_RETURN_ALLOW_TIMEOUT(context, command) \ #define ANGLE_VK_TRY_RETURN_ALLOW_TIMEOUT(context, command) \
ANGLE_VK_TRY_RETURN_ALLOW_OTHER(context, command, VK_TIMEOUT) 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_ #endif // LIBANGLE_RENDERER_VULKAN_VK_UTILS_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment