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)
}
}
// 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();
}
......
......@@ -34,49 +34,49 @@ class ContextImpl : public GLImplFactory
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 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 drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode,
GLint first,
GLsizei count,
GLsizei instanceCount) = 0;
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;
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;
const void *indices) = 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 @@ class ContextImpl : public GLImplFactory
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 @@ class ContextImpl : public GLImplFactory
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(); }
......
......@@ -88,9 +88,9 @@ bool DrawCallHasStreamingElementArray(const gl::Context *context, GLenum srcType
}
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 @@ gl::Error ReadbackIndirectBuffer(const gl::Context *context,
ASSERT(bufferData);
*bufferPtrOut = reinterpret_cast<const IndirectBufferT *>(bufferData + offset);
return gl::NoError();
return angle::Result::Continue();
}
} // anonymous namespace
......@@ -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)
......@@ -230,12 +230,12 @@ std::vector<PathImpl *> Context11::createPaths(GLsizei)
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 @@ angle::Result Context11::drawArrays(const gl::Context *context,
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 @@ gl::Error Context11::drawArraysInstanced(const gl::Context *context,
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,12 @@ gl::Error Context11::drawElements(const gl::Context *context,
return mRenderer->drawElements(context, drawCallParams);
}
gl::Error Context11::drawElementsInstanced(const gl::Context *context,
gl::PrimitiveMode mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances)
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());
......@@ -288,13 +288,13 @@ gl::Error Context11::drawElementsInstanced(const gl::Context *context,
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)
angle::Result 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());
......@@ -302,9 +302,9 @@ gl::Error Context11::drawRangeElements(const gl::Context *context,
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::drawArraysIndirect(const gl::Context *context,
}
}
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 @@ gl::Error Context11::drawElementsIndirect(const gl::Context *context,
// 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 @@ GLint64 Context11::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 gl::NoError();
return mRenderer->getStateManager()->onMakeCurrent(context);
}
gl::Caps Context11::getNativeCaps() const
......@@ -474,15 +473,15 @@ const gl::Limitations &Context11::getNativeLimitations() const
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 @@ angle::Result Context11::prepareForDrawCall(const gl::Context *context,
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,
......
......@@ -24,7 +24,7 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer
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 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer
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;
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 drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode,
GLint first,
GLsizei count,
GLsizei instanceCount) override;
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 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer
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 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer
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);
......
......@@ -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)
......@@ -136,12 +136,12 @@ std::vector<PathImpl *> Context9::createPaths(GLsizei)
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 @@ angle::Result Context9::drawArrays(const gl::Context *context,
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 @@ GLint64 Context9::getTimestamp()
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 @@ const gl::Limitations &Context9::getNativeLimitations() const
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,
......
......@@ -22,7 +22,7 @@ class Context9 : public ContextD3D
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 @@ class Context9 : public ContextD3D
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;
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 drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode,
GLint first,
GLsizei count,
GLsizei instanceCount) override;
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 @@ class Context9 : public ContextD3D
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 @@ class Context9 : public ContextD3D
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; }
......
......@@ -41,9 +41,9 @@ ContextGL::~ContextGL()
{
}
gl::Error ContextGL::initialize()
angle::Result ContextGL::initialize()
{
return gl::NoError();
return angle::Result::Continue();
}
CompilerImpl *ContextGL::createCompiler()
......@@ -160,12 +160,12 @@ std::vector<PathImpl *> ContextGL::createPaths(GLsizei range)
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 @@ angle::Result ContextGL::drawArrays(const gl::Context *context,
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 @@ GLint64 ContextGL::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
ANGLE_TRY(mRenderer->getStateManager()->onMakeCurrent(context));
return gl::NoError();
return mRenderer->getStateManager()->onMakeCurrent(context);
}
gl::Caps ContextGL::getNativeCaps() const
......@@ -441,24 +440,24 @@ ClearMultiviewGL *ContextGL::getMultiviewClearer() const
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);
}
......
......@@ -32,7 +32,7 @@ class ContextGL : public ContextImpl
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 @@ class ContextGL : public ContextImpl
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;
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 drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode,
GLint first,
GLsizei count,
GLsizei instanceCount) override;
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 @@ class ContextGL : public ContextImpl
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 @@ class ContextGL : public ContextImpl
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,
......
......@@ -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,
......@@ -129,58 +129,58 @@ angle::Result ContextNULL::drawArrays(const gl::Context *context,
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,
gl::PrimitiveMode mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances)
angle::Result ContextNULL::drawElementsInstanced(const gl::Context *context,
gl::PrimitiveMode mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances)
{
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::drawRangeElements(const gl::Context *context,
gl::PrimitiveMode mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const void *indices)
{
return gl::NoError();
return angle::Result::Continue();
}
gl::Error ContextNULL::drawArraysIndirect(const gl::Context *context,
gl::PrimitiveMode mode,
const void *indirect)
angle::Result ContextNULL::drawArraysIndirect(const gl::Context *context,
gl::PrimitiveMode mode,
const void *indirect)
{
return gl::NoError();
return angle::Result::Continue();
}
gl::Error ContextNULL::drawElementsIndirect(const gl::Context *context,
gl::PrimitiveMode mode,
GLenum type,
const void *indirect)
angle::Result 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 @@ GLint64 ContextNULL::getTimestamp()
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 @@ std::vector<PathImpl *> ContextNULL::createPaths(GLsizei range)
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,
......
......@@ -36,48 +36,48 @@ class ContextNULL : public ContextImpl
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;
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 drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode,
GLint first,
GLsizei count,
GLsizei instanceCount) override;
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 @@ class ContextNULL : public ContextImpl
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 @@ class ContextNULL : public ContextImpl
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,
......
......@@ -186,7 +186,7 @@ gl::Error ContextVk::getIncompleteTexture(const gl::Context *context,
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 @@ gl::Error ContextVk::initialize()
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 @@ angle::Result ContextVk::drawArrays(const gl::Context *context,
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 @@ gl::Error ContextVk::drawElements(const gl::Context *context,
commandBuffer->drawIndexed(count, 1, 0, 0, 0);
}
return gl::NoError();
return angle::Result::Continue();
}
gl::Error ContextVk::drawElementsInstanced(const gl::Context *context,
gl::PrimitiveMode mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances)
angle::Result ContextVk::drawElementsInstanced(const gl::Context *context,
gl::PrimitiveMode mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances)
{
UNIMPLEMENTED();
return gl::InternalError();
ANGLE_VK_UNREACHABLE(this);
return angle::Result::Stop();
}
gl::Error ContextVk::drawRangeElements(const gl::Context *context,
gl::PrimitiveMode mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const void *indices)
angle::Result 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 @@ VkDevice ContextVk::getDevice() const
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 @@ GLint64 ContextVk::getTimestamp()
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 @@ gl::Error ContextVk::onMakeCurrent(const gl::Context *context)
updateFlipViewportDrawFramebuffer(glState);
updateFlipViewportReadFramebuffer(glState);
invalidateDriverUniforms();
return gl::NoError();
return angle::Result::Continue();
}
void ContextVk::updateFlipViewportDrawFramebuffer(const gl::State &glState)
......@@ -1052,31 +1052,31 @@ void ContextVk::invalidateDriverUniforms()
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)
......
......@@ -27,50 +27,50 @@ class ContextVk : public ContextImpl, public vk::Context
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;
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 drawArraysInstanced(const gl::Context *context,
gl::PrimitiveMode mode,
GLint first,
GLsizei count,
GLsizei instanceCount) override;
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 @@ class ContextVk : public ContextImpl, public vk::Context
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 @@ class ContextVk : public ContextImpl, public vk::Context
// 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;
......
......@@ -913,4 +913,8 @@ VkColorComponentFlags GetColorComponentFlags(bool red, bool green, bool blue, bo
#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_
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