Commit 9f4ab98d by Jamie Madill Committed by Commit Bot

Return angle::Result from more label functions.

This is necessary for the new Vulkan implementation. Bug: angleproject:4029 Change-Id: I07ef54145252ff102c74179361436587bb330fc7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2055553Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 3a3e7d4d
...@@ -2444,7 +2444,7 @@ void Context::finish() ...@@ -2444,7 +2444,7 @@ void Context::finish()
void Context::insertEventMarker(GLsizei length, const char *marker) void Context::insertEventMarker(GLsizei length, const char *marker)
{ {
ASSERT(mImplementation); ASSERT(mImplementation);
mImplementation->insertEventMarker(length, marker); ANGLE_CONTEXT_TRY(mImplementation->insertEventMarker(length, marker));
} }
void Context::pushGroupMarker(GLsizei length, const char *marker) void Context::pushGroupMarker(GLsizei length, const char *marker)
...@@ -2455,18 +2455,18 @@ void Context::pushGroupMarker(GLsizei length, const char *marker) ...@@ -2455,18 +2455,18 @@ void Context::pushGroupMarker(GLsizei length, const char *marker)
{ {
// From the EXT_debug_marker spec, // From the EXT_debug_marker spec,
// "If <marker> is null then an empty string is pushed on the stack." // "If <marker> is null then an empty string is pushed on the stack."
mImplementation->pushGroupMarker(length, ""); ANGLE_CONTEXT_TRY(mImplementation->pushGroupMarker(length, ""));
} }
else else
{ {
mImplementation->pushGroupMarker(length, marker); ANGLE_CONTEXT_TRY(mImplementation->pushGroupMarker(length, marker));
} }
} }
void Context::popGroupMarker() void Context::popGroupMarker()
{ {
ASSERT(mImplementation); ASSERT(mImplementation);
mImplementation->popGroupMarker(); ANGLE_CONTEXT_TRY(mImplementation->popGroupMarker());
} }
void Context::bindUniformLocation(ShaderProgramID program, GLint location, const GLchar *name) void Context::bindUniformLocation(ShaderProgramID program, GLint location, const GLchar *name)
......
...@@ -169,9 +169,9 @@ class ContextImpl : public GLImplFactory ...@@ -169,9 +169,9 @@ class ContextImpl : public GLImplFactory
virtual std::string getRendererDescription() const = 0; virtual std::string getRendererDescription() const = 0;
// EXT_debug_marker // EXT_debug_marker
virtual void insertEventMarker(GLsizei length, const char *marker) = 0; virtual angle::Result insertEventMarker(GLsizei length, const char *marker) = 0;
virtual void pushGroupMarker(GLsizei length, const char *marker) = 0; virtual angle::Result pushGroupMarker(GLsizei length, const char *marker) = 0;
virtual void popGroupMarker() = 0; virtual angle::Result popGroupMarker() = 0;
// KHR_debug // KHR_debug
virtual angle::Result pushDebugGroup(const gl::Context *context, virtual angle::Result pushDebugGroup(const gl::Context *context,
......
...@@ -490,18 +490,20 @@ std::string Context11::getRendererDescription() const ...@@ -490,18 +490,20 @@ std::string Context11::getRendererDescription() const
return mRenderer->getRendererDescription(); return mRenderer->getRendererDescription();
} }
void Context11::insertEventMarker(GLsizei length, const char *marker) angle::Result Context11::insertEventMarker(GLsizei length, const char *marker)
{ {
mRenderer->getAnnotator()->setMarker(marker); mRenderer->getAnnotator()->setMarker(marker);
return angle::Result::Continue;
} }
void Context11::pushGroupMarker(GLsizei length, const char *marker) angle::Result Context11::pushGroupMarker(GLsizei length, const char *marker)
{ {
mRenderer->getAnnotator()->beginEvent(marker, marker); mRenderer->getAnnotator()->beginEvent(marker, marker);
mMarkerStack.push(std::string(marker)); mMarkerStack.push(std::string(marker));
return angle::Result::Continue;
} }
void Context11::popGroupMarker() angle::Result Context11::popGroupMarker()
{ {
const char *marker = nullptr; const char *marker = nullptr;
if (!mMarkerStack.empty()) if (!mMarkerStack.empty())
...@@ -510,6 +512,7 @@ void Context11::popGroupMarker() ...@@ -510,6 +512,7 @@ void Context11::popGroupMarker()
mMarkerStack.pop(); mMarkerStack.pop();
mRenderer->getAnnotator()->endEvent(marker); mRenderer->getAnnotator()->endEvent(marker);
} }
return angle::Result::Continue;
} }
angle::Result Context11::pushDebugGroup(const gl::Context *context, angle::Result Context11::pushDebugGroup(const gl::Context *context,
...@@ -518,15 +521,13 @@ angle::Result Context11::pushDebugGroup(const gl::Context *context, ...@@ -518,15 +521,13 @@ angle::Result Context11::pushDebugGroup(const gl::Context *context,
const std::string &message) const std::string &message)
{ {
// Fall through to the EXT_debug_marker functions // Fall through to the EXT_debug_marker functions
pushGroupMarker(static_cast<GLsizei>(message.size()), message.c_str()); return pushGroupMarker(static_cast<GLsizei>(message.size()), message.c_str());
return angle::Result::Continue;
} }
angle::Result Context11::popDebugGroup(const gl::Context *context) angle::Result Context11::popDebugGroup(const gl::Context *context)
{ {
// Fall through to the EXT_debug_marker functions // Fall through to the EXT_debug_marker functions
popGroupMarker(); return popGroupMarker();
return angle::Result::Continue;
} }
angle::Result Context11::syncState(const gl::Context *context, angle::Result Context11::syncState(const gl::Context *context,
......
...@@ -158,9 +158,9 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer ...@@ -158,9 +158,9 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer
std::string getRendererDescription() const override; std::string getRendererDescription() const override;
// EXT_debug_marker // EXT_debug_marker
void insertEventMarker(GLsizei length, const char *marker) override; angle::Result insertEventMarker(GLsizei length, const char *marker) override;
void pushGroupMarker(GLsizei length, const char *marker) override; angle::Result pushGroupMarker(GLsizei length, const char *marker) override;
void popGroupMarker() override; angle::Result popGroupMarker() override;
// KHR_debug // KHR_debug
angle::Result pushDebugGroup(const gl::Context *context, angle::Result pushDebugGroup(const gl::Context *context,
......
...@@ -303,18 +303,20 @@ std::string Context9::getRendererDescription() const ...@@ -303,18 +303,20 @@ std::string Context9::getRendererDescription() const
return mRenderer->getRendererDescription(); return mRenderer->getRendererDescription();
} }
void Context9::insertEventMarker(GLsizei length, const char *marker) angle::Result Context9::insertEventMarker(GLsizei length, const char *marker)
{ {
mRenderer->getAnnotator()->setMarker(marker); mRenderer->getAnnotator()->setMarker(marker);
return angle::Result::Continue;
} }
void Context9::pushGroupMarker(GLsizei length, const char *marker) angle::Result Context9::pushGroupMarker(GLsizei length, const char *marker)
{ {
mRenderer->getAnnotator()->beginEvent(marker, marker); mRenderer->getAnnotator()->beginEvent(marker, marker);
mMarkerStack.push(std::string(marker)); mMarkerStack.push(std::string(marker));
return angle::Result::Continue;
} }
void Context9::popGroupMarker() angle::Result Context9::popGroupMarker()
{ {
const char *marker = nullptr; const char *marker = nullptr;
if (!mMarkerStack.empty()) if (!mMarkerStack.empty())
...@@ -323,6 +325,7 @@ void Context9::popGroupMarker() ...@@ -323,6 +325,7 @@ void Context9::popGroupMarker()
mMarkerStack.pop(); mMarkerStack.pop();
mRenderer->getAnnotator()->endEvent(marker); mRenderer->getAnnotator()->endEvent(marker);
} }
return angle::Result::Continue;
} }
angle::Result Context9::pushDebugGroup(const gl::Context *context, angle::Result Context9::pushDebugGroup(const gl::Context *context,
...@@ -331,15 +334,13 @@ angle::Result Context9::pushDebugGroup(const gl::Context *context, ...@@ -331,15 +334,13 @@ angle::Result Context9::pushDebugGroup(const gl::Context *context,
const std::string &message) const std::string &message)
{ {
// Fall through to the EXT_debug_marker functions // Fall through to the EXT_debug_marker functions
pushGroupMarker(static_cast<GLsizei>(message.size()), message.c_str()); return pushGroupMarker(static_cast<GLsizei>(message.size()), message.c_str());
return angle::Result::Continue;
} }
angle::Result Context9::popDebugGroup(const gl::Context *context) angle::Result Context9::popDebugGroup(const gl::Context *context)
{ {
// Fall through to the EXT_debug_marker functions // Fall through to the EXT_debug_marker functions
popGroupMarker(); return popGroupMarker();
return angle::Result::Continue;
} }
angle::Result Context9::syncState(const gl::Context *context, angle::Result Context9::syncState(const gl::Context *context,
......
...@@ -157,9 +157,9 @@ class Context9 : public ContextD3D ...@@ -157,9 +157,9 @@ class Context9 : public ContextD3D
std::string getRendererDescription() const override; std::string getRendererDescription() const override;
// EXT_debug_marker // EXT_debug_marker
void insertEventMarker(GLsizei length, const char *marker) override; angle::Result insertEventMarker(GLsizei length, const char *marker) override;
void pushGroupMarker(GLsizei length, const char *marker) override; angle::Result pushGroupMarker(GLsizei length, const char *marker) override;
void popGroupMarker() override; angle::Result popGroupMarker() override;
// KHR_debug // KHR_debug
angle::Result pushDebugGroup(const gl::Context *context, angle::Result pushDebugGroup(const gl::Context *context,
......
...@@ -774,19 +774,22 @@ std::string ContextGL::getRendererDescription() const ...@@ -774,19 +774,22 @@ std::string ContextGL::getRendererDescription() const
return mRenderer->getRendererDescription(); return mRenderer->getRendererDescription();
} }
void ContextGL::insertEventMarker(GLsizei length, const char *marker) angle::Result ContextGL::insertEventMarker(GLsizei length, const char *marker)
{ {
mRenderer->insertEventMarker(length, marker); mRenderer->insertEventMarker(length, marker);
return angle::Result::Continue;
} }
void ContextGL::pushGroupMarker(GLsizei length, const char *marker) angle::Result ContextGL::pushGroupMarker(GLsizei length, const char *marker)
{ {
mRenderer->pushGroupMarker(length, marker); mRenderer->pushGroupMarker(length, marker);
return angle::Result::Continue;
} }
void ContextGL::popGroupMarker() angle::Result ContextGL::popGroupMarker()
{ {
mRenderer->popGroupMarker(); mRenderer->popGroupMarker();
return angle::Result::Continue;
} }
angle::Result ContextGL::pushDebugGroup(const gl::Context *context, angle::Result ContextGL::pushDebugGroup(const gl::Context *context,
......
...@@ -216,9 +216,9 @@ class ContextGL : public ContextImpl ...@@ -216,9 +216,9 @@ class ContextGL : public ContextImpl
std::string getRendererDescription() const override; std::string getRendererDescription() const override;
// EXT_debug_marker // EXT_debug_marker
void insertEventMarker(GLsizei length, const char *marker) override; angle::Result insertEventMarker(GLsizei length, const char *marker) override;
void pushGroupMarker(GLsizei length, const char *marker) override; angle::Result pushGroupMarker(GLsizei length, const char *marker) override;
void popGroupMarker() override; angle::Result popGroupMarker() override;
// KHR_debug // KHR_debug
angle::Result pushDebugGroup(const gl::Context *context, angle::Result pushDebugGroup(const gl::Context *context,
......
...@@ -122,9 +122,9 @@ class ContextMtl : public ContextImpl, public mtl::Context ...@@ -122,9 +122,9 @@ class ContextMtl : public ContextImpl, public mtl::Context
std::string getRendererDescription() const override; std::string getRendererDescription() const override;
// EXT_debug_marker // EXT_debug_marker
void insertEventMarker(GLsizei length, const char *marker) override; angle::Result insertEventMarker(GLsizei length, const char *marker) override;
void pushGroupMarker(GLsizei length, const char *marker) override; angle::Result pushGroupMarker(GLsizei length, const char *marker) override;
void popGroupMarker() override; angle::Result popGroupMarker() override;
// KHR_debug // KHR_debug
angle::Result pushDebugGroup(const gl::Context *context, angle::Result pushDebugGroup(const gl::Context *context,
......
...@@ -483,11 +483,19 @@ std::string ContextMtl::getRendererDescription() const ...@@ -483,11 +483,19 @@ std::string ContextMtl::getRendererDescription() const
} }
// EXT_debug_marker // EXT_debug_marker
void ContextMtl::insertEventMarker(GLsizei length, const char *marker) {} angle::Result ContextMtl::insertEventMarker(GLsizei length, const char *marker)
void ContextMtl::pushGroupMarker(GLsizei length, const char *marker) {}
void ContextMtl::popGroupMarker()
{ {
// TODO(hqle return angle::Result::Continue;
}
angle::Result ContextMtl::pushGroupMarker(GLsizei length, const char *marker)
{
return angle::Result::Continue;
}
angle::Result ContextMtl::popGroupMarker()
{
return angle::Result::Continue;
} }
// KHR_debug // KHR_debug
......
...@@ -318,11 +318,20 @@ std::string ContextNULL::getRendererDescription() const ...@@ -318,11 +318,20 @@ std::string ContextNULL::getRendererDescription() const
return "NULL"; return "NULL";
} }
void ContextNULL::insertEventMarker(GLsizei length, const char *marker) {} angle::Result ContextNULL::insertEventMarker(GLsizei length, const char *marker)
{
return angle::Result::Continue;
}
void ContextNULL::pushGroupMarker(GLsizei length, const char *marker) {} angle::Result ContextNULL::pushGroupMarker(GLsizei length, const char *marker)
{
return angle::Result::Continue;
}
void ContextNULL::popGroupMarker() {} angle::Result ContextNULL::popGroupMarker()
{
return angle::Result::Continue;
}
angle::Result ContextNULL::pushDebugGroup(const gl::Context *context, angle::Result ContextNULL::pushDebugGroup(const gl::Context *context,
GLenum source, GLenum source,
......
...@@ -170,9 +170,9 @@ class ContextNULL : public ContextImpl ...@@ -170,9 +170,9 @@ class ContextNULL : public ContextImpl
std::string getRendererDescription() const override; std::string getRendererDescription() const override;
// EXT_debug_marker // EXT_debug_marker
void insertEventMarker(GLsizei length, const char *marker) override; angle::Result insertEventMarker(GLsizei length, const char *marker) override;
void pushGroupMarker(GLsizei length, const char *marker) override; angle::Result pushGroupMarker(GLsizei length, const char *marker) override;
void popGroupMarker() override; angle::Result popGroupMarker() override;
// KHR_debug // KHR_debug
angle::Result pushDebugGroup(const gl::Context *context, angle::Result pushDebugGroup(const gl::Context *context,
......
...@@ -2303,7 +2303,7 @@ std::string ContextVk::getRendererDescription() const ...@@ -2303,7 +2303,7 @@ std::string ContextVk::getRendererDescription() const
return mRenderer->getRendererDescription(); return mRenderer->getRendererDescription();
} }
void ContextVk::insertEventMarker(GLsizei length, const char *marker) angle::Result ContextVk::insertEventMarker(GLsizei length, const char *marker)
{ {
if (commandGraphEnabled()) if (commandGraphEnabled())
{ {
...@@ -2315,9 +2315,11 @@ void ContextVk::insertEventMarker(GLsizei length, const char *marker) ...@@ -2315,9 +2315,11 @@ void ContextVk::insertEventMarker(GLsizei length, const char *marker)
// TODO(jmadill): http://anglebug.com/4029 // TODO(jmadill): http://anglebug.com/4029
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
return angle::Result::Continue;
} }
void ContextVk::pushGroupMarker(GLsizei length, const char *marker) angle::Result ContextVk::pushGroupMarker(GLsizei length, const char *marker)
{ {
if (commandGraphEnabled()) if (commandGraphEnabled())
{ {
...@@ -2329,9 +2331,11 @@ void ContextVk::pushGroupMarker(GLsizei length, const char *marker) ...@@ -2329,9 +2331,11 @@ void ContextVk::pushGroupMarker(GLsizei length, const char *marker)
// TODO(jmadill): http://anglebug.com/4029 // TODO(jmadill): http://anglebug.com/4029
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
return angle::Result::Continue;
} }
void ContextVk::popGroupMarker() angle::Result ContextVk::popGroupMarker()
{ {
if (commandGraphEnabled()) if (commandGraphEnabled())
{ {
...@@ -2342,6 +2346,8 @@ void ContextVk::popGroupMarker() ...@@ -2342,6 +2346,8 @@ void ContextVk::popGroupMarker()
// TODO(jmadill): http://anglebug.com/4029 // TODO(jmadill): http://anglebug.com/4029
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
return angle::Result::Continue;
} }
angle::Result ContextVk::pushDebugGroup(const gl::Context *context, angle::Result ContextVk::pushDebugGroup(const gl::Context *context,
......
...@@ -329,9 +329,9 @@ class ContextVk : public ContextImpl, public vk::Context, public vk::RenderPassO ...@@ -329,9 +329,9 @@ class ContextVk : public ContextImpl, public vk::Context, public vk::RenderPassO
std::string getRendererDescription() const override; std::string getRendererDescription() const override;
// EXT_debug_marker // EXT_debug_marker
void insertEventMarker(GLsizei length, const char *marker) override; angle::Result insertEventMarker(GLsizei length, const char *marker) override;
void pushGroupMarker(GLsizei length, const char *marker) override; angle::Result pushGroupMarker(GLsizei length, const char *marker) override;
void popGroupMarker() override; angle::Result popGroupMarker() override;
// KHR_debug // KHR_debug
angle::Result pushDebugGroup(const gl::Context *context, angle::Result pushDebugGroup(const gl::Context *context,
......
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