Commit 4f6592fa by Jamie Madill Committed by Commit Bot

Remove gl::Error.

Removes several TODOs. Only egl::Error remains. Also slightly decreases binary size. Bug: angleproject:2491 Change-Id: I3a9d1c22eb0884ca9e37362463fddd0083faf826 Reviewed-on: https://chromium-review.googlesource.com/c/1337462 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent fdbdb2b2
...@@ -250,10 +250,6 @@ std::string ToString(const T &value) ...@@ -250,10 +250,6 @@ std::string ToString(const T &value)
#define GL_RGB10_A2_SSCALED_ANGLEX 0x6AEC #define GL_RGB10_A2_SSCALED_ANGLEX 0x6AEC
#define GL_RGB10_A2_USCALED_ANGLEX 0x6AED #define GL_RGB10_A2_USCALED_ANGLEX 0x6AED
// This internal enum is used to filter internal errors that are already handled.
// TODO(jmadill): Remove this when refactor is done. http://anglebug.com/2491
#define GL_INTERNAL_ERROR_ANGLEX 0x6AEE
#define ANGLE_CHECK_GL_ALLOC(context, result) \ #define ANGLE_CHECK_GL_ALLOC(context, result) \
ANGLE_CHECK(context, result, "Failed to allocate host memory", GL_OUT_OF_MEMORY) ANGLE_CHECK(context, result, "Failed to allocate host memory", GL_OUT_OF_MEMORY)
......
...@@ -70,8 +70,6 @@ class ErrorSet : angle::NonCopyable ...@@ -70,8 +70,6 @@ class ErrorSet : angle::NonCopyable
explicit ErrorSet(Context *context); explicit ErrorSet(Context *context);
~ErrorSet(); ~ErrorSet();
// TODO(jmadill): Remove const. http://anglebug.com/2491
void handleError(const Error &error) const;
bool empty() const; bool empty() const;
GLenum popError(); GLenum popError();
...@@ -85,9 +83,7 @@ class ErrorSet : angle::NonCopyable ...@@ -85,9 +83,7 @@ class ErrorSet : angle::NonCopyable
private: private:
Context *mContext; Context *mContext;
std::set<GLenum> mErrors;
// TODO(jmadill): Remove mutable. http://anglebug.com/2491
mutable std::set<GLenum> mErrors;
}; };
// Helper class for managing cache variables and state changes. // Helper class for managing cache variables and state changes.
...@@ -1597,9 +1593,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl ...@@ -1597,9 +1593,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
int getFragDataIndex(GLuint program, const char *name); int getFragDataIndex(GLuint program, const char *name);
int getProgramResourceLocationIndex(GLuint program, GLenum programInterface, const char *name); int getProgramResourceLocationIndex(GLuint program, GLenum programInterface, const char *name);
// Consumes the error. // Consumes an error.
// TODO(jmadill): Remove const. http://anglebug.com/2491
void handleError(const Error &error) const;
void handleError(GLenum errorCode, void handleError(GLenum errorCode,
const char *message, const char *message,
const char *file, const char *file,
......
...@@ -24,54 +24,6 @@ std::unique_ptr<std::string> EmplaceErrorString(std::string &&message) ...@@ -24,54 +24,6 @@ std::unique_ptr<std::string> EmplaceErrorString(std::string &&message)
} }
} // anonymous namespace } // anonymous namespace
namespace gl
{
Error::Error(GLenum errorCode, std::string &&message)
: mCode(errorCode), mID(errorCode), mMessage(EmplaceErrorString(std::move(message)))
{}
Error::Error(GLenum errorCode, GLuint id, std::string &&message)
: mCode(errorCode), mID(id), mMessage(EmplaceErrorString(std::move(message)))
{}
void Error::createMessageString() const
{
if (!mMessage)
{
mMessage.reset(new std::string(GetGenericErrorMessage(mCode)));
}
}
const std::string &Error::getMessage() const
{
createMessageString();
return *mMessage;
}
bool Error::operator==(const Error &other) const
{
if (mCode != other.mCode)
return false;
// TODO(jmadill): Compare extended error codes instead of strings.
if ((!mMessage || !other.mMessage) && (!mMessage != !other.mMessage))
return false;
return (*mMessage == *other.mMessage);
}
bool Error::operator!=(const Error &other) const
{
return !(*this == other);
}
std::ostream &operator<<(std::ostream &os, const Error &err)
{
return gl::FmtHex(os, err.getCode());
}
} // namespace gl
namespace egl namespace egl
{ {
...@@ -101,21 +53,15 @@ std::ostream &operator<<(std::ostream &os, const Error &err) ...@@ -101,21 +53,15 @@ std::ostream &operator<<(std::ostream &os, const Error &err)
{ {
return gl::FmtHex(os, err.getCode()); return gl::FmtHex(os, err.getCode());
} }
} // namespace egl } // namespace egl
// angle::Result Implementation.
namespace angle namespace angle
{ {
Result::operator gl::Error() const egl::Error angle::Result::toEGL() const
{ {
if (mValue == Value::Continue) if (mValue == Value::Continue)
{ return egl::NoError();
return gl::NoError();
} return egl::Error(EGL_BAD_ACCESS);
else
{
return gl::Error(GL_INTERNAL_ERROR_ANGLEX);
}
} }
} // namespace angle } // namespace angle
...@@ -48,62 +48,6 @@ namespace egl ...@@ -48,62 +48,6 @@ namespace egl
class Error; class Error;
} // namespace egl } // namespace egl
namespace gl
{
class ANGLE_NO_DISCARD Error final
{
public:
explicit inline Error(GLenum errorCode);
Error(GLenum errorCode, std::string &&message);
Error(GLenum errorCode, GLuint id, std::string &&message);
inline Error(const Error &other);
inline Error(Error &&other);
inline ~Error() = default;
// automatic error type conversion
inline Error(egl::Error eglErr);
inline Error &operator=(const Error &other);
inline Error &operator=(Error &&other);
inline GLenum getCode() const;
inline GLuint getID() const;
inline bool isError() const;
const std::string &getMessage() const;
// Useful for mocking and testing
bool operator==(const Error &other) const;
bool operator!=(const Error &other) const;
static inline Error NoError();
private:
void createMessageString() const;
friend std::ostream &operator<<(std::ostream &os, const Error &err);
friend class egl::Error;
GLenum mCode;
GLuint mID;
mutable std::unique_ptr<std::string> mMessage;
};
namespace priv
{
template <GLenum EnumT>
using ErrorStream = angle::ErrorStreamBase<Error, GLenum, GL_NO_ERROR, GLenum, EnumT>;
} // namespace priv
inline Error NoError()
{
return Error::NoError();
}
} // namespace gl
namespace egl namespace egl
{ {
...@@ -117,10 +61,6 @@ class ANGLE_NO_DISCARD Error final ...@@ -117,10 +61,6 @@ class ANGLE_NO_DISCARD Error final
inline Error(Error &&other); inline Error(Error &&other);
inline ~Error() = default; inline ~Error() = default;
// automatic error type conversion
inline Error(gl::Error &&glErr);
inline Error(const gl::Error &glErr);
inline Error &operator=(const Error &other); inline Error &operator=(const Error &other);
inline Error &operator=(Error &&other); inline Error &operator=(Error &&other);
...@@ -136,7 +76,6 @@ class ANGLE_NO_DISCARD Error final ...@@ -136,7 +76,6 @@ class ANGLE_NO_DISCARD Error final
void createMessageString() const; void createMessageString() const;
friend std::ostream &operator<<(std::ostream &os, const Error &err); friend std::ostream &operator<<(std::ostream &os, const Error &err);
friend class gl::Error;
EGLint mCode; EGLint mCode;
EGLint mID; EGLint mID;
...@@ -232,13 +171,13 @@ class ANGLE_NO_DISCARD Result ...@@ -232,13 +171,13 @@ class ANGLE_NO_DISCARD Result
static Result Continue() { return Result(Value::Continue); } static Result Continue() { return Result(Value::Continue); }
static Result Incomplete() { return Result(Value::Incomplete); } static Result Incomplete() { return Result(Value::Incomplete); }
// TODO(jmadill): Remove when refactor is complete. http://anglebug.com/2491
operator gl::Error() const;
bool operator==(Result other) const { return mValue == other.mValue; } bool operator==(Result other) const { return mValue == other.mValue; }
bool operator!=(Result other) const { return mValue != other.mValue; } bool operator!=(Result other) const { return mValue != other.mValue; }
// TODO(jmadill): Remove when refactor is complete. http://anglebug.com/2491
egl::Error toEGL() const;
private: private:
enum class Value enum class Value
{ {
......
...@@ -10,94 +10,6 @@ ...@@ -10,94 +10,6 @@
#include <cstdarg> #include <cstdarg>
namespace gl
{
Error::Error(GLenum errorCode)
: mCode(errorCode),
mID(errorCode)
{
}
Error::Error(const Error &other)
: mCode(other.mCode),
mID(other.mID)
{
if (other.mMessage)
{
createMessageString();
*mMessage = *(other.mMessage);
}
}
Error::Error(Error &&other)
: mCode(other.mCode),
mID(other.mID),
mMessage(std::move(other.mMessage))
{
}
// automatic error type conversion
Error::Error(egl::Error eglErr)
: mCode(GL_INVALID_OPERATION),
mID(0),
mMessage(std::move(eglErr.mMessage))
{
}
Error &Error::operator=(const Error &other)
{
mCode = other.mCode;
mID = other.mID;
if (other.mMessage)
{
createMessageString();
*mMessage = *(other.mMessage);
}
else
{
mMessage.release();
}
return *this;
}
Error &Error::operator=(Error &&other)
{
if (this != &other)
{
mCode = other.mCode;
mID = other.mID;
mMessage = std::move(other.mMessage);
}
return *this;
}
GLenum Error::getCode() const
{
return mCode;
}
GLuint Error::getID() const
{
return mID;
}
bool Error::isError() const
{
return (mCode != GL_NO_ERROR);
}
// static
Error Error::NoError()
{
return Error(GL_NO_ERROR);
}
} // namespace gl
namespace egl namespace egl
{ {
...@@ -125,21 +37,6 @@ Error::Error(Error &&other) ...@@ -125,21 +37,6 @@ Error::Error(Error &&other)
{ {
} }
// automatic error type conversion
Error::Error(gl::Error &&glErr)
: mCode(EGL_BAD_ACCESS),
mID(0),
mMessage(std::move(glErr.mMessage))
{
}
Error::Error(const gl::Error &glErr)
: mCode(EGL_BAD_ACCESS),
mID(0),
mMessage(glErr.mMessage.get())
{
}
Error &Error::operator=(const Error &other) Error &Error::operator=(const Error &other)
{ {
mCode = other.mCode; mCode = other.mCode;
......
...@@ -34,7 +34,7 @@ void GLES1Renderer::onDestroy(Context *context, State *state) ...@@ -34,7 +34,7 @@ void GLES1Renderer::onDestroy(Context *context, State *state)
{ {
if (mRendererProgramInitialized) if (mRendererProgramInitialized)
{ {
context->handleError(state->setProgram(context, 0)); (void)state->setProgram(context, 0);
mShaderPrograms->deleteProgram(context, mProgramState.program); mShaderPrograms->deleteProgram(context, mProgramState.program);
mShaderPrograms->release(context); mShaderPrograms->release(context);
......
...@@ -31,17 +31,17 @@ Path::~Path() ...@@ -31,17 +31,17 @@ Path::~Path()
delete mPath; delete mPath;
} }
Error Path::setCommands(GLsizei numCommands, angle::Result Path::setCommands(GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
GLenum coordType, GLenum coordType,
const void *coords) const void *coords)
{ {
ANGLE_TRY(mPath->setCommands(numCommands, commands, numCoords, coordType, coords)); ANGLE_TRY(mPath->setCommands(numCommands, commands, numCoords, coordType, coords));
mHasData = true; mHasData = true;
return NoError(); return angle::Result::Continue();
} }
void Path::setStrokeWidth(GLfloat width) void Path::setStrokeWidth(GLfloat width)
......
...@@ -29,11 +29,11 @@ class Path final : angle::NonCopyable ...@@ -29,11 +29,11 @@ class Path final : angle::NonCopyable
~Path(); ~Path();
Error setCommands(GLsizei numCommands, angle::Result setCommands(GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
GLenum coordType, GLenum coordType,
const void *coords); const void *coords);
void setStrokeWidth(GLfloat width); void setStrokeWidth(GLfloat width);
void setStrokeBound(GLfloat bound); void setStrokeBound(GLfloat bound);
......
...@@ -53,7 +53,7 @@ class RefCountObject : angle::NonCopyable ...@@ -53,7 +53,7 @@ class RefCountObject : angle::NonCopyable
mutable size_t mRefCount; mutable size_t mRefCount;
}; };
template <class ObjectType, typename ContextT, typename ErrorT> template <class ObjectType, typename ContextT, typename ErrorT = angle::Result>
class BindingPointer class BindingPointer
{ {
public: public:
...@@ -133,7 +133,7 @@ class Context; ...@@ -133,7 +133,7 @@ class Context;
template <class ObjectType> template <class ObjectType>
class BindingPointer; class BindingPointer;
using RefCountObjectNoID = angle::RefCountObject<Context, Error>; using RefCountObjectNoID = angle::RefCountObject<Context, angle::Result>;
class RefCountObject : public gl::RefCountObjectNoID class RefCountObject : public gl::RefCountObjectNoID
{ {
...@@ -150,16 +150,15 @@ class RefCountObject : public gl::RefCountObjectNoID ...@@ -150,16 +150,15 @@ class RefCountObject : public gl::RefCountObjectNoID
}; };
template <class ObjectType> template <class ObjectType>
class BindingPointer : public angle::BindingPointer<ObjectType, Context, Error> class BindingPointer : public angle::BindingPointer<ObjectType, Context>
{ {
public: public:
using ContextType = typename angle::BindingPointer<ObjectType, Context, Error>::ContextType; using ContextType = typename angle::BindingPointer<ObjectType, Context>::ContextType;
using ErrorType = typename angle::BindingPointer<ObjectType, Context, Error>::ErrorType; using ErrorType = typename angle::BindingPointer<ObjectType, Context>::ErrorType;
BindingPointer() {} BindingPointer() {}
BindingPointer(ObjectType *object) : angle::BindingPointer<ObjectType, Context, Error>(object) BindingPointer(ObjectType *object) : angle::BindingPointer<ObjectType, Context>(object) {}
{}
GLuint id() const GLuint id() const
{ {
......
...@@ -203,8 +203,11 @@ Error Stream::consumerAcquire(const gl::Context *context) ...@@ -203,8 +203,11 @@ Error Stream::consumerAcquire(const gl::Context *context)
{ {
if (mPlanes[i].texture != nullptr) if (mPlanes[i].texture != nullptr)
{ {
ANGLE_TRY(gl::Error(mPlanes[i].texture->acquireImageFromStream( ANGLE_TRY(mPlanes[i]
context, mProducerImplementation->getGLFrameDescription(i)))); .texture
->acquireImageFromStream(
context, mProducerImplementation->getGLFrameDescription(i))
.toEGL());
} }
} }
...@@ -224,7 +227,7 @@ Error Stream::consumerRelease(const gl::Context *context) ...@@ -224,7 +227,7 @@ Error Stream::consumerRelease(const gl::Context *context)
{ {
if (mPlanes[i].texture != nullptr) if (mPlanes[i].texture != nullptr)
{ {
ANGLE_TRY(gl::Error(mPlanes[i].texture->releaseImageFromStream(context))); ANGLE_TRY(mPlanes[i].texture->releaseImageFromStream(context).toEGL());
} }
} }
......
...@@ -397,13 +397,12 @@ EGLint Surface::getHeight() const ...@@ -397,13 +397,12 @@ EGLint Surface::getHeight() const
return mFixedSize ? static_cast<EGLint>(mFixedHeight) : mImplementation->getHeight(); return mFixedSize ? static_cast<EGLint>(mFixedHeight) : mImplementation->getHeight();
} }
Error Surface::bindTexImage(const gl::Context *context, gl::Texture *texture, EGLint buffer) Error Surface::bindTexImage(gl::Context *context, gl::Texture *texture, EGLint buffer)
{ {
ASSERT(!mTexture); ASSERT(!mTexture);
ANGLE_TRY(mImplementation->bindTexImage(context, texture, buffer)); ANGLE_TRY(mImplementation->bindTexImage(context, texture, buffer));
auto glErr = texture->bindTexImageFromSurface(context, this); if (texture->bindTexImageFromSurface(context, this) == angle::Result::Stop())
if (glErr.isError())
{ {
return Error(EGL_BAD_SURFACE); return Error(EGL_BAD_SURFACE);
} }
......
...@@ -76,7 +76,7 @@ class Surface : public LabeledObject, public gl::FramebufferAttachmentObject ...@@ -76,7 +76,7 @@ class Surface : public LabeledObject, public gl::FramebufferAttachmentObject
EGLint height); EGLint height);
Error setPresentationTime(EGLnsecsANDROID time); Error setPresentationTime(EGLnsecsANDROID time);
Error querySurfacePointerANGLE(EGLint attribute, void **value); Error querySurfacePointerANGLE(EGLint attribute, void **value);
Error bindTexImage(const gl::Context *context, gl::Texture *texture, EGLint buffer); Error bindTexImage(gl::Context *context, gl::Texture *texture, EGLint buffer);
Error releaseTexImage(const gl::Context *context, EGLint buffer); Error releaseTexImage(const gl::Context *context, EGLint buffer);
Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc); Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc);
......
...@@ -970,7 +970,7 @@ void Texture::signalDirty(const Context *context, InitState initState) ...@@ -970,7 +970,7 @@ void Texture::signalDirty(const Context *context, InitState initState)
invalidateCompletenessCache(); invalidateCompletenessCache();
} }
angle::Result Texture::setImage(const Context *context, angle::Result Texture::setImage(Context *context,
const PixelUnpackState &unpackState, const PixelUnpackState &unpackState,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
...@@ -1001,7 +1001,7 @@ angle::Result Texture::setImage(const Context *context, ...@@ -1001,7 +1001,7 @@ angle::Result Texture::setImage(const Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
angle::Result Texture::setSubImage(const Context *context, angle::Result Texture::setSubImage(Context *context,
const PixelUnpackState &unpackState, const PixelUnpackState &unpackState,
Buffer *unpackBuffer, Buffer *unpackBuffer,
TextureTarget target, TextureTarget target,
...@@ -1025,7 +1025,7 @@ angle::Result Texture::setSubImage(const Context *context, ...@@ -1025,7 +1025,7 @@ angle::Result Texture::setSubImage(const Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
angle::Result Texture::setCompressedImage(const Context *context, angle::Result Texture::setCompressedImage(Context *context,
const PixelUnpackState &unpackState, const PixelUnpackState &unpackState,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
...@@ -1071,7 +1071,7 @@ angle::Result Texture::setCompressedSubImage(const Context *context, ...@@ -1071,7 +1071,7 @@ angle::Result Texture::setCompressedSubImage(const Context *context,
pixels); pixels);
} }
angle::Result Texture::copyImage(const Context *context, angle::Result Texture::copyImage(Context *context,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
const Rectangle &sourceArea, const Rectangle &sourceArea,
...@@ -1110,7 +1110,7 @@ angle::Result Texture::copyImage(const Context *context, ...@@ -1110,7 +1110,7 @@ angle::Result Texture::copyImage(const Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
angle::Result Texture::copySubImage(const Context *context, angle::Result Texture::copySubImage(Context *context,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
const Offset &destOffset, const Offset &destOffset,
...@@ -1133,7 +1133,7 @@ angle::Result Texture::copySubImage(const Context *context, ...@@ -1133,7 +1133,7 @@ angle::Result Texture::copySubImage(const Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
angle::Result Texture::copyTexture(const Context *context, angle::Result Texture::copyTexture(Context *context,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
GLenum internalFormat, GLenum internalFormat,
...@@ -1198,7 +1198,7 @@ angle::Result Texture::copySubTexture(const Context *context, ...@@ -1198,7 +1198,7 @@ angle::Result Texture::copySubTexture(const Context *context,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source); unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source);
} }
angle::Result Texture::copyCompressedTexture(const Context *context, const Texture *source) angle::Result Texture::copyCompressedTexture(Context *context, const Texture *source)
{ {
// Release from previous calls to eglBindTexImage, to avoid calling the Impl after // Release from previous calls to eglBindTexImage, to avoid calling the Impl after
ANGLE_TRY(releaseTexImageInternal(context)); ANGLE_TRY(releaseTexImageInternal(context));
...@@ -1214,7 +1214,7 @@ angle::Result Texture::copyCompressedTexture(const Context *context, const Textu ...@@ -1214,7 +1214,7 @@ angle::Result Texture::copyCompressedTexture(const Context *context, const Textu
return angle::Result::Continue(); return angle::Result::Continue();
} }
angle::Result Texture::setStorage(const Context *context, angle::Result Texture::setStorage(Context *context,
TextureType type, TextureType type,
GLsizei levels, GLsizei levels,
GLenum internalFormat, GLenum internalFormat,
...@@ -1246,7 +1246,7 @@ angle::Result Texture::setStorage(const Context *context, ...@@ -1246,7 +1246,7 @@ angle::Result Texture::setStorage(const Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
angle::Result Texture::setStorageMultisample(const Context *context, angle::Result Texture::setStorageMultisample(Context *context,
TextureType type, TextureType type,
GLsizei samples, GLsizei samples,
GLint internalFormat, GLint internalFormat,
...@@ -1273,7 +1273,7 @@ angle::Result Texture::setStorageMultisample(const Context *context, ...@@ -1273,7 +1273,7 @@ angle::Result Texture::setStorageMultisample(const Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
angle::Result Texture::generateMipmap(const Context *context) angle::Result Texture::generateMipmap(Context *context)
{ {
// Release from previous calls to eglBindTexImage, to avoid calling the Impl after // Release from previous calls to eglBindTexImage, to avoid calling the Impl after
ANGLE_TRY(releaseTexImageInternal(context)); ANGLE_TRY(releaseTexImageInternal(context));
...@@ -1329,7 +1329,7 @@ angle::Result Texture::generateMipmap(const Context *context) ...@@ -1329,7 +1329,7 @@ angle::Result Texture::generateMipmap(const Context *context)
return angle::Result::Continue(); return angle::Result::Continue();
} }
angle::Result Texture::bindTexImageFromSurface(const Context *context, egl::Surface *surface) angle::Result Texture::bindTexImageFromSurface(Context *context, egl::Surface *surface)
{ {
ASSERT(surface); ASSERT(surface);
...@@ -1406,7 +1406,7 @@ angle::Result Texture::releaseImageFromStream(const Context *context) ...@@ -1406,7 +1406,7 @@ angle::Result Texture::releaseImageFromStream(const Context *context)
return angle::Result::Continue(); return angle::Result::Continue();
} }
angle::Result Texture::releaseTexImageInternal(const Context *context) angle::Result Texture::releaseTexImageInternal(Context *context)
{ {
if (mBoundSurface) if (mBoundSurface)
{ {
...@@ -1415,7 +1415,8 @@ angle::Result Texture::releaseTexImageInternal(const Context *context) ...@@ -1415,7 +1415,8 @@ angle::Result Texture::releaseTexImageInternal(const Context *context)
// TODO(jmadill): Remove this once refactor is complete. http://anglebug.com/2491 // TODO(jmadill): Remove this once refactor is complete. http://anglebug.com/2491
if (eglErr.isError()) if (eglErr.isError())
{ {
context->handleError(Error(eglErr)); context->handleError(GL_INVALID_OPERATION, "Error releasing tex image from texture",
__FILE__, ANGLE_FUNCTION, __LINE__);
} }
// Then, call the same method as from the surface // Then, call the same method as from the surface
...@@ -1424,7 +1425,7 @@ angle::Result Texture::releaseTexImageInternal(const Context *context) ...@@ -1424,7 +1425,7 @@ angle::Result Texture::releaseTexImageInternal(const Context *context)
return angle::Result::Continue(); return angle::Result::Continue();
} }
angle::Result Texture::setEGLImageTarget(const Context *context, angle::Result Texture::setEGLImageTarget(Context *context,
TextureType type, TextureType type,
egl::Image *imageTarget) egl::Image *imageTarget)
{ {
...@@ -1716,7 +1717,7 @@ angle::Result Texture::ensureSubImageInitialized(const Context *context, ...@@ -1716,7 +1717,7 @@ angle::Result Texture::ensureSubImageInitialized(const Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
angle::Result Texture::handleMipmapGenerationHint(const Context *context, int level) angle::Result Texture::handleMipmapGenerationHint(Context *context, int level)
{ {
if (getGenerateMipmapHint() == GL_TRUE && level == 0) if (getGenerateMipmapHint() == GL_TRUE && level == 0)
......
...@@ -283,7 +283,7 @@ class Texture final : public RefCountObject, ...@@ -283,7 +283,7 @@ class Texture final : public RefCountObject,
bool isMipmapComplete() const; bool isMipmapComplete() const;
angle::Result setImage(const Context *context, angle::Result setImage(Context *context,
const PixelUnpackState &unpackState, const PixelUnpackState &unpackState,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
...@@ -292,7 +292,7 @@ class Texture final : public RefCountObject, ...@@ -292,7 +292,7 @@ class Texture final : public RefCountObject,
GLenum format, GLenum format,
GLenum type, GLenum type,
const uint8_t *pixels); const uint8_t *pixels);
angle::Result setSubImage(const Context *context, angle::Result setSubImage(Context *context,
const PixelUnpackState &unpackState, const PixelUnpackState &unpackState,
Buffer *unpackBuffer, Buffer *unpackBuffer,
TextureTarget target, TextureTarget target,
...@@ -302,7 +302,7 @@ class Texture final : public RefCountObject, ...@@ -302,7 +302,7 @@ class Texture final : public RefCountObject,
GLenum type, GLenum type,
const uint8_t *pixels); const uint8_t *pixels);
angle::Result setCompressedImage(const Context *context, angle::Result setCompressedImage(Context *context,
const PixelUnpackState &unpackState, const PixelUnpackState &unpackState,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
...@@ -319,20 +319,20 @@ class Texture final : public RefCountObject, ...@@ -319,20 +319,20 @@ class Texture final : public RefCountObject,
size_t imageSize, size_t imageSize,
const uint8_t *pixels); const uint8_t *pixels);
angle::Result copyImage(const Context *context, angle::Result copyImage(Context *context,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
const Rectangle &sourceArea, const Rectangle &sourceArea,
GLenum internalFormat, GLenum internalFormat,
Framebuffer *source); Framebuffer *source);
angle::Result copySubImage(const Context *context, angle::Result copySubImage(Context *context,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
const Offset &destOffset, const Offset &destOffset,
const Rectangle &sourceArea, const Rectangle &sourceArea,
Framebuffer *source); Framebuffer *source);
angle::Result copyTexture(const Context *context, angle::Result copyTexture(Context *context,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
GLenum internalFormat, GLenum internalFormat,
...@@ -352,26 +352,24 @@ class Texture final : public RefCountObject, ...@@ -352,26 +352,24 @@ class Texture final : public RefCountObject,
bool unpackPremultiplyAlpha, bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
Texture *source); Texture *source);
angle::Result copyCompressedTexture(const Context *context, const Texture *source); angle::Result copyCompressedTexture(Context *context, const Texture *source);
angle::Result setStorage(const Context *context, angle::Result setStorage(Context *context,
TextureType type, TextureType type,
GLsizei levels, GLsizei levels,
GLenum internalFormat, GLenum internalFormat,
const Extents &size); const Extents &size);
angle::Result setStorageMultisample(const Context *context, angle::Result setStorageMultisample(Context *context,
TextureType type, TextureType type,
GLsizei samples, GLsizei samples,
GLint internalformat, GLint internalformat,
const Extents &size, const Extents &size,
bool fixedSampleLocations); bool fixedSampleLocations);
angle::Result setEGLImageTarget(const Context *context, angle::Result setEGLImageTarget(Context *context, TextureType type, egl::Image *imageTarget);
TextureType type,
egl::Image *imageTarget);
angle::Result generateMipmap(const Context *context); angle::Result generateMipmap(Context *context);
egl::Surface *getBoundSurface() const; egl::Surface *getBoundSurface() const;
egl::Stream *getBoundStream() const; egl::Stream *getBoundStream() const;
...@@ -461,7 +459,7 @@ class Texture final : public RefCountObject, ...@@ -461,7 +459,7 @@ class Texture final : public RefCountObject,
// ANGLE-only method, used internally // ANGLE-only method, used internally
friend class egl::Surface; friend class egl::Surface;
angle::Result bindTexImageFromSurface(const Context *context, egl::Surface *surface); angle::Result bindTexImageFromSurface(Context *context, egl::Surface *surface);
angle::Result releaseTexImageFromSurface(const Context *context); angle::Result releaseTexImageFromSurface(const Context *context);
// ANGLE-only methods, used internally // ANGLE-only methods, used internally
...@@ -473,14 +471,14 @@ class Texture final : public RefCountObject, ...@@ -473,14 +471,14 @@ class Texture final : public RefCountObject,
angle::Result releaseImageFromStream(const Context *context); angle::Result releaseImageFromStream(const Context *context);
void invalidateCompletenessCache() const; void invalidateCompletenessCache() const;
angle::Result releaseTexImageInternal(const Context *context); angle::Result releaseTexImageInternal(Context *context);
angle::Result ensureSubImageInitialized(const Context *context, angle::Result ensureSubImageInitialized(const Context *context,
TextureTarget target, TextureTarget target,
size_t level, size_t level,
const gl::Box &area); const gl::Box &area);
angle::Result handleMipmapGenerationHint(const Context *context, int level); angle::Result handleMipmapGenerationHint(Context *context, int level);
TextureState mState; TextureState mState;
DirtyBits mDirtyBits; DirtyBits mDirtyBits;
......
...@@ -358,7 +358,7 @@ void SetTexParameterBase(Context *context, Texture *texture, GLenum pname, const ...@@ -358,7 +358,7 @@ void SetTexParameterBase(Context *context, Texture *texture, GLenum pname, const
break; break;
case GL_TEXTURE_BASE_LEVEL: case GL_TEXTURE_BASE_LEVEL:
{ {
context->handleError(texture->setBaseLevel( (void)(texture->setBaseLevel(
context, clampCast<GLuint>(CastQueryValueTo<GLint>(pname, params[0])))); context, clampCast<GLuint>(CastQueryValueTo<GLint>(pname, params[0]))));
break; break;
} }
...@@ -1485,12 +1485,12 @@ void QueryFramebufferParameteriv(const Framebuffer *framebuffer, GLenum pname, G ...@@ -1485,12 +1485,12 @@ void QueryFramebufferParameteriv(const Framebuffer *framebuffer, GLenum pname, G
} }
} }
Error QuerySynciv(const Context *context, angle::Result QuerySynciv(const Context *context,
const Sync *sync, const Sync *sync,
GLenum pname, GLenum pname,
GLsizei bufSize, GLsizei bufSize,
GLsizei *length, GLsizei *length,
GLint *values) GLint *values)
{ {
ASSERT(sync); ASSERT(sync);
...@@ -1501,7 +1501,7 @@ Error QuerySynciv(const Context *context, ...@@ -1501,7 +1501,7 @@ Error QuerySynciv(const Context *context,
{ {
*length = 0; *length = 0;
} }
return NoError(); return angle::Result::Continue();
} }
switch (pname) switch (pname)
...@@ -1529,7 +1529,7 @@ Error QuerySynciv(const Context *context, ...@@ -1529,7 +1529,7 @@ Error QuerySynciv(const Context *context,
*length = 1; *length = 1;
} }
return NoError(); return angle::Result::Continue();
} }
void SetTexParameterf(Context *context, Texture *texture, GLenum pname, GLfloat param) void SetTexParameterf(Context *context, Texture *texture, GLenum pname, GLfloat param)
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "angle_gl.h" #include "angle_gl.h"
#include "common/PackedEnums.h" #include "common/PackedEnums.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Error.h"
#include <EGL/egl.h> #include <EGL/egl.h>
...@@ -19,7 +20,6 @@ namespace gl ...@@ -19,7 +20,6 @@ namespace gl
{ {
class Buffer; class Buffer;
class Context; class Context;
class Error;
class Sync; class Sync;
class Framebuffer; class Framebuffer;
class GLES1State; class GLES1State;
...@@ -104,12 +104,12 @@ void QueryInternalFormativ(const TextureCaps &format, GLenum pname, GLsizei bufS ...@@ -104,12 +104,12 @@ void QueryInternalFormativ(const TextureCaps &format, GLenum pname, GLsizei bufS
void QueryFramebufferParameteriv(const Framebuffer *framebuffer, GLenum pname, GLint *params); void QueryFramebufferParameteriv(const Framebuffer *framebuffer, GLenum pname, GLint *params);
Error QuerySynciv(const Context *context, angle::Result QuerySynciv(const Context *context,
const Sync *sync, const Sync *sync,
GLenum pname, GLenum pname,
GLsizei bufSize, GLsizei bufSize,
GLsizei *length, GLsizei *length,
GLint *values); GLint *values);
void SetTexParameterf(Context *context, Texture *texture, GLenum pname, GLfloat param); void SetTexParameterf(Context *context, Texture *texture, GLenum pname, GLfloat param);
void SetTexParameterfv(Context *context, Texture *texture, GLenum pname, const GLfloat *params); void SetTexParameterfv(Context *context, Texture *texture, GLenum pname, const GLfloat *params);
......
...@@ -127,9 +127,7 @@ void ContextImpl::handleError(GLenum errorCode, ...@@ -127,9 +127,7 @@ void ContextImpl::handleError(GLenum errorCode,
unsigned int line) unsigned int line)
{ {
std::stringstream errorStream; std::stringstream errorStream;
errorStream << "Internal error: " << gl::FmtHex(errorCode) << ", in " << file << ", " errorStream << "Internal error: " << gl::FmtHex(errorCode) << ": " << message;
<< function << ":" << line << ". " << message; mErrors->handleError(errorCode, errorStream.str().c_str(), file, function, line);
mErrors->handleError(gl::Error(errorCode, errorCode, errorStream.str()));
} }
} // namespace rx } // namespace rx
...@@ -625,9 +625,8 @@ void Context11::handleResult(HRESULT hr, ...@@ -625,9 +625,8 @@ void Context11::handleResult(HRESULT hr,
GLenum glErrorCode = DefaultGLErrorCode(hr); GLenum glErrorCode = DefaultGLErrorCode(hr);
std::stringstream errorStream; std::stringstream errorStream;
errorStream << "Internal D3D11 error: " << gl::FmtHR(hr) << ", in " << file << ", " << function errorStream << "Internal D3D11 error: " << gl::FmtHR(hr) << ": " << message;
<< ":" << line << ". " << message;
mErrors->handleError(gl::Error(glErrorCode, glErrorCode, errorStream.str())); mErrors->handleError(glErrorCode, errorStream.str().c_str(), file, function, line);
} }
} // namespace rx } // namespace rx
...@@ -349,9 +349,8 @@ void Context9::handleResult(HRESULT hr, ...@@ -349,9 +349,8 @@ void Context9::handleResult(HRESULT hr,
GLenum glErrorCode = DefaultGLErrorCode(hr); GLenum glErrorCode = DefaultGLErrorCode(hr);
std::stringstream errorStream; std::stringstream errorStream;
errorStream << "Internal D3D9 error: " << gl::FmtHR(hr) << ", in " << file << ", " << function errorStream << "Internal D3D9 error: " << gl::FmtHR(hr) << ": " << message;
<< ":" << line << ". " << message;
mErrors->handleError(gl::Error(glErrorCode, glErrorCode, errorStream.str())); mErrors->handleError(glErrorCode, errorStream.str().c_str(), file, function, line);
} }
} // namespace rx } // namespace rx
...@@ -145,7 +145,7 @@ static void INTERNAL_GL_APIENTRY LogGLDebugMessage(GLenum source, ...@@ -145,7 +145,7 @@ static void INTERNAL_GL_APIENTRY LogGLDebugMessage(GLenum source,
ERR() << std::endl ERR() << std::endl
<< "\tSource: " << sourceText << std::endl << "\tSource: " << sourceText << std::endl
<< "\tType: " << typeText << std::endl << "\tType: " << typeText << std::endl
<< "\tID: " << gl::Error(id) << std::endl << "\tID: " << gl::FmtHex(id) << std::endl
<< "\tSeverity: " << severityText << std::endl << "\tSeverity: " << severityText << std::endl
<< "\tMessage: " << message; << "\tMessage: " << message;
} }
...@@ -158,7 +158,7 @@ static void INTERNAL_GL_APIENTRY LogGLDebugMessage(GLenum source, ...@@ -158,7 +158,7 @@ static void INTERNAL_GL_APIENTRY LogGLDebugMessage(GLenum source,
WARN() << std::endl WARN() << std::endl
<< "\tSource: " << sourceText << std::endl << "\tSource: " << sourceText << std::endl
<< "\tType: " << typeText << std::endl << "\tType: " << typeText << std::endl
<< "\tID: " << gl::Error(id) << std::endl << "\tID: " << gl::FmtHex(id) << std::endl
<< "\tSeverity: " << severityText << std::endl << "\tSeverity: " << severityText << std::endl
<< "\tMessage: " << message; << "\tMessage: " << message;
} }
......
...@@ -419,9 +419,7 @@ void ContextNULL::handleError(GLenum errorCode, ...@@ -419,9 +419,7 @@ void ContextNULL::handleError(GLenum errorCode,
unsigned int line) unsigned int line)
{ {
std::stringstream errorStream; std::stringstream errorStream;
errorStream << "Internal OpenGL error: " << gl::FmtHex(errorCode) << ", in " << file << ", " errorStream << "Internal NULL back-end error: " << message << ".";
<< function << ":" << line << ". " << message; mErrors->handleError(errorCode, errorStream.str().c_str(), file, function, line);
mErrors->handleError(gl::Error(errorCode, errorCode, errorStream.str()));
} }
} // namespace rx } // namespace rx
...@@ -431,20 +431,24 @@ angle::Result IncompleteTextureSet::getIncompleteTexture( ...@@ -431,20 +431,24 @@ angle::Result IncompleteTextureSet::getIncompleteTexture(
gl::Texture *tex = new gl::Texture(implFactory, std::numeric_limits<GLuint>::max(), createType); gl::Texture *tex = new gl::Texture(implFactory, std::numeric_limits<GLuint>::max(), createType);
angle::UniqueObjectPointer<gl::Texture, gl::Context> t(tex, context); angle::UniqueObjectPointer<gl::Texture, gl::Context> t(tex, context);
// This is a bit of a kludge but is necessary to consume the error.
gl::Context *mutableContext = const_cast<gl::Context *>(context);
if (createType == gl::TextureType::_2DMultisample) if (createType == gl::TextureType::_2DMultisample)
{ {
ANGLE_TRY(t->setStorageMultisample(context, createType, 1, GL_RGBA8, colorSize, true)); ANGLE_TRY(
t->setStorageMultisample(mutableContext, createType, 1, GL_RGBA8, colorSize, true));
} }
else else
{ {
ANGLE_TRY(t->setStorage(context, createType, 1, GL_RGBA8, colorSize)); ANGLE_TRY(t->setStorage(mutableContext, createType, 1, GL_RGBA8, colorSize));
} }
if (type == gl::TextureType::CubeMap) if (type == gl::TextureType::CubeMap)
{ {
for (gl::TextureTarget face : gl::AllCubeFaceTextureTargets()) for (gl::TextureTarget face : gl::AllCubeFaceTextureTargets())
{ {
ANGLE_TRY(t->setSubImage(context, unpack, nullptr, face, 0, area, GL_RGBA, ANGLE_TRY(t->setSubImage(mutableContext, unpack, nullptr, face, 0, area, GL_RGBA,
GL_UNSIGNED_BYTE, color)); GL_UNSIGNED_BYTE, color));
} }
} }
...@@ -455,7 +459,7 @@ angle::Result IncompleteTextureSet::getIncompleteTexture( ...@@ -455,7 +459,7 @@ angle::Result IncompleteTextureSet::getIncompleteTexture(
} }
else else
{ {
ANGLE_TRY(t->setSubImage(context, unpack, nullptr, ANGLE_TRY(t->setSubImage(mutableContext, unpack, nullptr,
gl::NonCubeTextureTypeToTarget(createType), 0, area, GL_RGBA, gl::NonCubeTextureTypeToTarget(createType), 0, area, GL_RGBA,
GL_UNSIGNED_BYTE, color)); GL_UNSIGNED_BYTE, color));
} }
......
...@@ -1217,13 +1217,17 @@ angle::Result ContextVk::handleDirtyDriverUniforms(const gl::Context *context, ...@@ -1217,13 +1217,17 @@ angle::Result ContextVk::handleDirtyDriverUniforms(const gl::Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
void ContextVk::handleError(VkResult errorCode, const char *file, unsigned int line) void ContextVk::handleError(VkResult errorCode,
const char *file,
const char *function,
unsigned int line)
{ {
ASSERT(errorCode != VK_SUCCESS);
GLenum glErrorCode = DefaultGLErrorCode(errorCode); GLenum glErrorCode = DefaultGLErrorCode(errorCode);
std::stringstream errorStream; std::stringstream errorStream;
errorStream << "Internal Vulkan error: " << VulkanResultString(errorCode) << ", in " << file errorStream << "Internal Vulkan error: " << VulkanResultString(errorCode) << ".";
<< ", line " << line << ".";
if (errorCode == VK_ERROR_DEVICE_LOST) if (errorCode == VK_ERROR_DEVICE_LOST)
{ {
...@@ -1231,7 +1235,7 @@ void ContextVk::handleError(VkResult errorCode, const char *file, unsigned int l ...@@ -1231,7 +1235,7 @@ void ContextVk::handleError(VkResult errorCode, const char *file, unsigned int l
mRenderer->notifyDeviceLost(); mRenderer->notifyDeviceLost();
} }
mErrors->handleError(gl::Error(glErrorCode, glErrorCode, errorStream.str())); mErrors->handleError(glErrorCode, errorStream.str().c_str(), file, function, line);
} }
angle::Result ContextVk::updateActiveTextures(const gl::Context *context) angle::Result ContextVk::updateActiveTextures(const gl::Context *context)
......
...@@ -179,7 +179,10 @@ class ContextVk : public ContextImpl, public vk::Context ...@@ -179,7 +179,10 @@ class ContextVk : public ContextImpl, public vk::Context
gl::Texture **textureOut); gl::Texture **textureOut);
void updateColorMask(const gl::BlendState &blendState); void updateColorMask(const gl::BlendState &blendState);
void handleError(VkResult errorCode, const char *file, unsigned int line) override; void handleError(VkResult errorCode,
const char *file,
const char *function,
unsigned int line) override;
const gl::ActiveTextureArray<TextureVk *> &getActiveTextures() const; const gl::ActiveTextureArray<TextureVk *> &getActiveTextures() const;
void setIndexBufferDirty() { mDirtyBits.set(DIRTY_BIT_INDEX_BUFFER); } void setIndexBufferDirty() { mDirtyBits.set(DIRTY_BIT_INDEX_BUFFER); }
......
...@@ -186,11 +186,16 @@ bool DisplayVk::getScratchBuffer(size_t requstedSizeBytes, ...@@ -186,11 +186,16 @@ bool DisplayVk::getScratchBuffer(size_t requstedSizeBytes,
return mScratchBuffer.get(requstedSizeBytes, scratchBufferOut); return mScratchBuffer.get(requstedSizeBytes, scratchBufferOut);
} }
void DisplayVk::handleError(VkResult result, const char *file, unsigned int line) void DisplayVk::handleError(VkResult result,
const char *file,
const char *function,
unsigned int line)
{ {
ASSERT(result != VK_SUCCESS);
std::stringstream errorStream; std::stringstream errorStream;
errorStream << "Internal Vulkan error: " << VulkanResultString(result) << ", in " << file errorStream << "Internal Vulkan error: " << VulkanResultString(result) << ", in " << file
<< ", line " << line << "."; << ", " << function << ":" << line << ".";
mStoredErrorString = errorStream.str(); mStoredErrorString = errorStream.str();
if (result == VK_ERROR_DEVICE_LOST) if (result == VK_ERROR_DEVICE_LOST)
......
...@@ -79,7 +79,10 @@ class DisplayVk : public DisplayImpl, public vk::Context ...@@ -79,7 +79,10 @@ class DisplayVk : public DisplayImpl, public vk::Context
angle::MemoryBuffer **scratchBufferOut) const; angle::MemoryBuffer **scratchBufferOut) const;
angle::ScratchBuffer *getScratchBuffer() const { return &mScratchBuffer; } angle::ScratchBuffer *getScratchBuffer() const { return &mScratchBuffer; }
void handleError(VkResult result, const char *file, unsigned int line) override; void handleError(VkResult result,
const char *file,
const char *function,
unsigned int line) override;
// TODO(jmadill): Remove this once refactor is done. http://anglebug.com/2491 // TODO(jmadill): Remove this once refactor is done. http://anglebug.com/2491
egl::Error getEGLError(EGLint errorCode); egl::Error getEGLError(EGLint errorCode);
......
...@@ -1118,7 +1118,7 @@ angle::Result MemoryProperties::findCompatibleMemoryIndex( ...@@ -1118,7 +1118,7 @@ angle::Result MemoryProperties::findCompatibleMemoryIndex(
} }
// TODO(jmadill): Add error message to error. // TODO(jmadill): Add error message to error.
context->handleError(VK_ERROR_INCOMPATIBLE_DRIVER, __FILE__, __LINE__); context->handleError(VK_ERROR_INCOMPATIBLE_DRIVER, __FILE__, ANGLE_FUNCTION, __LINE__);
return angle::Result::Stop(); return angle::Result::Stop();
} }
......
...@@ -101,7 +101,10 @@ class Context : angle::NonCopyable ...@@ -101,7 +101,10 @@ class Context : angle::NonCopyable
Context(RendererVk *renderer); Context(RendererVk *renderer);
virtual ~Context(); virtual ~Context();
virtual void handleError(VkResult result, const char *file, unsigned int line) = 0; virtual void handleError(VkResult result,
const char *file,
const char *function,
unsigned int line) = 0;
VkDevice getDevice() const; VkDevice getDevice() const;
RendererVk *getRenderer() const { return mRenderer; } RendererVk *getRenderer() const { return mRenderer; }
...@@ -894,15 +897,15 @@ void GetScissor(const gl::State &glState, ...@@ -894,15 +897,15 @@ void GetScissor(const gl::State &glState,
} // namespace rx } // namespace rx
#define ANGLE_VK_TRY(context, command) \ #define ANGLE_VK_TRY(context, command) \
do \ do \
{ \ { \
auto ANGLE_LOCAL_VAR = command; \ auto ANGLE_LOCAL_VAR = command; \
if (ANGLE_UNLIKELY(ANGLE_LOCAL_VAR != VK_SUCCESS)) \ if (ANGLE_UNLIKELY(ANGLE_LOCAL_VAR != VK_SUCCESS)) \
{ \ { \
context->handleError(ANGLE_LOCAL_VAR, __FILE__, __LINE__); \ context->handleError(ANGLE_LOCAL_VAR, __FILE__, ANGLE_FUNCTION, __LINE__); \
return angle::Result::Stop(); \ return angle::Result::Stop(); \
} \ } \
} while (0) } while (0)
#define ANGLE_VK_CHECK(context, test, error) ANGLE_VK_TRY(context, test ? VK_SUCCESS : error) #define ANGLE_VK_CHECK(context, test, error) ANGLE_VK_TRY(context, test ? VK_SUCCESS : error)
......
...@@ -592,7 +592,7 @@ bool ValidateES3TexStorage3DParameters(Context *context, ...@@ -592,7 +592,7 @@ bool ValidateES3TexStorage3DParameters(Context *context,
// Utility macro for handling implementation methods inside Validation. // Utility macro for handling implementation methods inside Validation.
#define ANGLE_HANDLE_VALIDATION_ERR(X) \ #define ANGLE_HANDLE_VALIDATION_ERR(X) \
context->handleError(X); \ (void)(X); \
return false; return false;
#define ANGLE_VALIDATION_TRY(EXPR) ANGLE_TRY_TEMPLATE(EXPR, ANGLE_HANDLE_VALIDATION_ERR); #define ANGLE_VALIDATION_TRY(EXPR) ANGLE_TRY_TEMPLATE(EXPR, ANGLE_HANDLE_VALIDATION_ERR);
......
...@@ -25,20 +25,20 @@ class ResultPerfTest : public ANGLEPerfTest ...@@ -25,20 +25,20 @@ class ResultPerfTest : public ANGLEPerfTest
ResultPerfTest::ResultPerfTest() : ANGLEPerfTest("ResultPerf", "_run", kIterationsPerStep) {} ResultPerfTest::ResultPerfTest() : ANGLEPerfTest("ResultPerf", "_run", kIterationsPerStep) {}
ANGLE_NOINLINE gl::Error ExternalCall() ANGLE_NOINLINE angle::Result ExternalCall()
{ {
if (gThing != 0) if (gThing != 0)
{ {
printf("Something very slow"); printf("Something very slow");
return gl::Error(GL_INVALID_OPERATION); return angle::Result::Stop();
} }
else else
{ {
return gl::NoError(); return angle::Result::Continue();
} }
} }
gl::Error CallReturningResult(int depth) angle::Result CallReturningResult(int depth)
{ {
ANGLE_TRY(ExternalCall()); ANGLE_TRY(ExternalCall());
ANGLE_TRY(ExternalCall()); ANGLE_TRY(ExternalCall());
......
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