Commit 666818ea by Jamie Madill Committed by Commit Bot

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

Refactors the gl::Texture class and a few related methods. Also reduces binary size by up to 4k. Bug: angleproject:2491 Change-Id: Ib9a69d7f507b0dce35abb17b90532f812bf43214 Reviewed-on: https://chromium-review.googlesource.com/c/1291845 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent f3acb8c1
...@@ -108,10 +108,10 @@ std::vector<gl::Path *> GatherPaths(gl::PathManager &resourceManager, ...@@ -108,10 +108,10 @@ std::vector<gl::Path *> GatherPaths(gl::PathManager &resourceManager,
} }
template <typename T> template <typename T>
gl::Error GetQueryObjectParameter(const gl::Context *context, angle::Result GetQueryObjectParameter(const gl::Context *context,
gl::Query *query, gl::Query *query,
GLenum pname, GLenum pname,
T *params) T *params)
{ {
ASSERT(query != nullptr); ASSERT(query != nullptr);
...@@ -122,16 +122,13 @@ gl::Error GetQueryObjectParameter(const gl::Context *context, ...@@ -122,16 +122,13 @@ gl::Error GetQueryObjectParameter(const gl::Context *context,
case GL_QUERY_RESULT_AVAILABLE_EXT: case GL_QUERY_RESULT_AVAILABLE_EXT:
{ {
bool available; bool available;
gl::Error error = query->isResultAvailable(context, &available); ANGLE_TRY(query->isResultAvailable(context, &available));
if (!error.isError()) *params = gl::CastFromStateValue<T>(pname, static_cast<GLuint>(available));
{ return angle::Result::Continue();
*params = gl::CastFromStateValue<T>(pname, static_cast<GLuint>(available));
}
return error;
} }
default: default:
UNREACHABLE(); UNREACHABLE();
return gl::InternalError() << "Unreachable Error"; return angle::Result::Stop();
} }
} }
......
...@@ -62,7 +62,6 @@ class ANGLE_NO_DISCARD Error final ...@@ -62,7 +62,6 @@ class ANGLE_NO_DISCARD Error final
inline ~Error() = default; inline ~Error() = default;
// automatic error type conversion // automatic error type conversion
inline Error(egl::Error &&eglErr);
inline Error(egl::Error eglErr); inline Error(egl::Error eglErr);
inline Error &operator=(const Error &other); inline Error &operator=(const Error &other);
......
...@@ -38,13 +38,6 @@ Error::Error(Error &&other) ...@@ -38,13 +38,6 @@ Error::Error(Error &&other)
} }
// automatic error type conversion // automatic error type conversion
Error::Error(egl::Error &&eglErr)
: mCode(GL_INVALID_OPERATION),
mID(0),
mMessage(std::move(eglErr.mMessage))
{
}
Error::Error(egl::Error eglErr) Error::Error(egl::Error eglErr)
: mCode(GL_INVALID_OPERATION), : mCode(GL_INVALID_OPERATION),
mID(0), mID(0),
......
...@@ -72,7 +72,7 @@ void ImageSibling::setTargetImage(const gl::Context *context, egl::Image *imageT ...@@ -72,7 +72,7 @@ void ImageSibling::setTargetImage(const gl::Context *context, egl::Image *imageT
imageTarget->addTargetSibling(this); imageTarget->addTargetSibling(this);
} }
gl::Error ImageSibling::orphanImages(const gl::Context *context) angle::Result ImageSibling::orphanImages(const gl::Context *context)
{ {
if (mTargetOf.get() != nullptr) if (mTargetOf.get() != nullptr)
{ {
...@@ -91,7 +91,7 @@ gl::Error ImageSibling::orphanImages(const gl::Context *context) ...@@ -91,7 +91,7 @@ gl::Error ImageSibling::orphanImages(const gl::Context *context)
mSourcesOf.clear(); mSourcesOf.clear();
} }
return gl::NoError(); return angle::Result::Continue();
} }
void ImageSibling::addImageSource(egl::Image *imageSource) void ImageSibling::addImageSource(egl::Image *imageSource)
...@@ -273,7 +273,7 @@ void Image::addTargetSibling(ImageSibling *sibling) ...@@ -273,7 +273,7 @@ void Image::addTargetSibling(ImageSibling *sibling)
mState.targets.insert(sibling); mState.targets.insert(sibling);
} }
gl::Error Image::orphanSibling(const gl::Context *context, ImageSibling *sibling) angle::Result Image::orphanSibling(const gl::Context *context, ImageSibling *sibling)
{ {
ASSERT(sibling != nullptr); ASSERT(sibling != nullptr);
...@@ -296,7 +296,7 @@ gl::Error Image::orphanSibling(const gl::Context *context, ImageSibling *sibling ...@@ -296,7 +296,7 @@ gl::Error Image::orphanSibling(const gl::Context *context, ImageSibling *sibling
mState.targets.erase(sibling); mState.targets.erase(sibling);
} }
return gl::NoError(); return angle::Result::Continue();
} }
const gl::Format &Image::getFormat() const const gl::Format &Image::getFormat() const
......
...@@ -53,7 +53,7 @@ class ImageSibling : public gl::FramebufferAttachmentObject ...@@ -53,7 +53,7 @@ class ImageSibling : public gl::FramebufferAttachmentObject
void setTargetImage(const gl::Context *context, egl::Image *imageTarget); void setTargetImage(const gl::Context *context, egl::Image *imageTarget);
// Orphan all EGL image sources and targets // Orphan all EGL image sources and targets
gl::Error orphanImages(const gl::Context *context); angle::Result orphanImages(const gl::Context *context);
private: private:
friend class Image; friend class Image;
...@@ -158,7 +158,7 @@ class Image final : public RefCountObject, public LabeledObject ...@@ -158,7 +158,7 @@ class Image final : public RefCountObject, public LabeledObject
// Called from ImageSibling only to notify the image that a sibling (source or target) has // Called from ImageSibling only to notify the image that a sibling (source or target) has
// been respecified and state tracking should be updated. // been respecified and state tracking should be updated.
gl::Error orphanSibling(const gl::Context *context, ImageSibling *sibling); angle::Result orphanSibling(const gl::Context *context, ImageSibling *sibling);
ImageState mState; ImageState mState;
rx::ImageImpl *mImplementation; rx::ImageImpl *mImplementation;
......
...@@ -76,7 +76,7 @@ Renderbuffer::Renderbuffer(rx::GLImplFactory *implFactory, GLuint id) ...@@ -76,7 +76,7 @@ Renderbuffer::Renderbuffer(rx::GLImplFactory *implFactory, GLuint id)
void Renderbuffer::onDestroy(const Context *context) void Renderbuffer::onDestroy(const Context *context)
{ {
ANGLE_SWALLOW_ERR(orphanImages(context)); (void)(orphanImages(context));
if (mImplementation) if (mImplementation)
{ {
...@@ -103,7 +103,7 @@ angle::Result Renderbuffer::setStorage(const Context *context, ...@@ -103,7 +103,7 @@ angle::Result Renderbuffer::setStorage(const Context *context,
size_t width, size_t width,
size_t height) size_t height)
{ {
ANGLE_TRY_HANDLE(context, orphanImages(context)); ANGLE_TRY(orphanImages(context));
ANGLE_TRY(mImplementation->setStorage(context, internalformat, width, height)); ANGLE_TRY(mImplementation->setStorage(context, internalformat, width, height));
mState.update(static_cast<GLsizei>(width), static_cast<GLsizei>(height), Format(internalformat), mState.update(static_cast<GLsizei>(width), static_cast<GLsizei>(height), Format(internalformat),
...@@ -119,7 +119,7 @@ angle::Result Renderbuffer::setStorageMultisample(const Context *context, ...@@ -119,7 +119,7 @@ angle::Result Renderbuffer::setStorageMultisample(const Context *context,
size_t width, size_t width,
size_t height) size_t height)
{ {
ANGLE_TRY_HANDLE(context, orphanImages(context)); ANGLE_TRY(orphanImages(context));
ANGLE_TRY( ANGLE_TRY(
mImplementation->setStorageMultisample(context, samples, internalformat, width, height)); mImplementation->setStorageMultisample(context, samples, internalformat, width, height));
...@@ -132,7 +132,7 @@ angle::Result Renderbuffer::setStorageMultisample(const Context *context, ...@@ -132,7 +132,7 @@ angle::Result Renderbuffer::setStorageMultisample(const Context *context,
angle::Result Renderbuffer::setStorageEGLImageTarget(const Context *context, egl::Image *image) angle::Result Renderbuffer::setStorageEGLImageTarget(const Context *context, egl::Image *image)
{ {
ANGLE_TRY_HANDLE(context, orphanImages(context)); ANGLE_TRY(orphanImages(context));
ANGLE_TRY(mImplementation->setStorageEGLImageTarget(context, image)); ANGLE_TRY(mImplementation->setStorageEGLImageTarget(context, image));
setTargetImage(context, image); setTargetImage(context, image);
......
...@@ -203,8 +203,8 @@ Error Stream::consumerAcquire(const gl::Context *context) ...@@ -203,8 +203,8 @@ Error Stream::consumerAcquire(const gl::Context *context)
{ {
if (mPlanes[i].texture != nullptr) if (mPlanes[i].texture != nullptr)
{ {
ANGLE_TRY(mPlanes[i].texture->acquireImageFromStream( ANGLE_TRY(gl::Error(mPlanes[i].texture->acquireImageFromStream(
context, mProducerImplementation->getGLFrameDescription(i))); context, mProducerImplementation->getGLFrameDescription(i))));
} }
} }
...@@ -224,7 +224,7 @@ Error Stream::consumerRelease(const gl::Context *context) ...@@ -224,7 +224,7 @@ Error Stream::consumerRelease(const gl::Context *context)
{ {
if (mPlanes[i].texture != nullptr) if (mPlanes[i].texture != nullptr)
{ {
ANGLE_TRY(mPlanes[i].texture->releaseImageFromStream(context)); ANGLE_TRY(gl::Error(mPlanes[i].texture->releaseImageFromStream(context)));
} }
} }
......
...@@ -47,7 +47,7 @@ class ImageImpl : angle::NonCopyable ...@@ -47,7 +47,7 @@ class ImageImpl : angle::NonCopyable
virtual ~ImageImpl() {} virtual ~ImageImpl() {}
virtual egl::Error initialize(const egl::Display *display) = 0; virtual egl::Error initialize(const egl::Display *display) = 0;
virtual gl::Error orphan(const gl::Context *context, egl::ImageSibling *sibling) = 0; virtual angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) = 0;
protected: protected:
const egl::ImageState &mState; const egl::ImageState &mState;
......
...@@ -21,7 +21,7 @@ class MockImageImpl : public ImageImpl ...@@ -21,7 +21,7 @@ class MockImageImpl : public ImageImpl
MockImageImpl(const egl::ImageState &state) : ImageImpl(state) {} MockImageImpl(const egl::ImageState &state) : ImageImpl(state) {}
virtual ~MockImageImpl() { destructor(); } virtual ~MockImageImpl() { destructor(); }
MOCK_METHOD1(initialize, egl::Error(const egl::Display *)); MOCK_METHOD1(initialize, egl::Error(const egl::Display *));
MOCK_METHOD2(orphan, gl::Error(const gl::Context *, egl::ImageSibling *)); MOCK_METHOD2(orphan, angle::Result(const gl::Context *, egl::ImageSibling *));
MOCK_METHOD0(destructor, void()); MOCK_METHOD0(destructor, void());
}; };
} // namespace rx } // namespace rx
......
...@@ -22,11 +22,11 @@ class PathImpl : angle::NonCopyable ...@@ -22,11 +22,11 @@ class PathImpl : angle::NonCopyable
public: public:
virtual ~PathImpl() {} virtual ~PathImpl() {}
virtual gl::Error setCommands(GLsizei numCommands, virtual angle::Result setCommands(GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
GLenum coordType, GLenum coordType,
const void *coords) = 0; const void *coords) = 0;
virtual void setPathParameter(GLenum pname, GLfloat value) = 0; virtual void setPathParameter(GLenum pname, GLfloat value) = 0;
}; };
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
namespace rx namespace rx
{ {
TextureImpl::TextureImpl(const gl::TextureState &state) : mState(state) TextureImpl::TextureImpl(const gl::TextureState &state) : mState(state)
{ {
} }
...@@ -19,73 +18,72 @@ TextureImpl::~TextureImpl() ...@@ -19,73 +18,72 @@ TextureImpl::~TextureImpl()
{ {
} }
gl::Error TextureImpl::onDestroy(const gl::Context *context) void TextureImpl::onDestroy(const gl::Context *context)
{ {
return gl::NoError();
} }
gl::Error TextureImpl::copyTexture(const gl::Context *context, angle::Result TextureImpl::copyTexture(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
GLenum type, GLenum type,
size_t sourceLevel, size_t sourceLevel,
bool unpackFlipY, bool unpackFlipY,
bool unpackPremultiplyAlpha, bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
const gl::Texture *source) const gl::Texture *source)
{ {
UNREACHABLE(); UNREACHABLE();
return gl::InternalError() << "CHROMIUM_copy_texture exposed but not implemented."; return angle::Result::Stop();
} }
gl::Error TextureImpl::copySubTexture(const gl::Context *context, angle::Result TextureImpl::copySubTexture(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Offset &destOffset, const gl::Offset &destOffset,
size_t sourceLevel, size_t sourceLevel,
const gl::Box &sourceBox, const gl::Box &sourceBox,
bool unpackFlipY, bool unpackFlipY,
bool unpackPremultiplyAlpha, bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
const gl::Texture *source) const gl::Texture *source)
{ {
UNREACHABLE(); UNREACHABLE();
return gl::InternalError() << "CHROMIUM_copy_texture exposed but not implemented."; return angle::Result::Stop();
} }
gl::Error TextureImpl::copyCompressedTexture(const gl::Context *context, const gl::Texture *source) angle::Result TextureImpl::copyCompressedTexture(const gl::Context *context,
const gl::Texture *source)
{ {
UNREACHABLE(); UNREACHABLE();
return gl::InternalError() << "CHROMIUM_copy_compressed_texture exposed but not implemented."; return angle::Result::Stop();
} }
gl::Error TextureImpl::copy3DTexture(const gl::Context *context, angle::Result TextureImpl::copy3DTexture(const gl::Context *context,
gl::TextureTarget target, gl::TextureTarget target,
GLenum internalFormat, GLenum internalFormat,
GLenum type, GLenum type,
size_t sourceLevel, size_t sourceLevel,
size_t destLevel, size_t destLevel,
bool unpackFlipY, bool unpackFlipY,
bool unpackPremultiplyAlpha, bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
const gl::Texture *source) const gl::Texture *source)
{ {
UNREACHABLE(); UNREACHABLE();
return gl::InternalError() << "ANGLE_copy_texture_3d exposed but not implemented."; return angle::Result::Stop();
} }
gl::Error TextureImpl::copy3DSubTexture(const gl::Context *context, angle::Result TextureImpl::copy3DSubTexture(const gl::Context *context,
const gl::TextureTarget target, const gl::TextureTarget target,
const gl::Offset &destOffset, const gl::Offset &destOffset,
size_t sourceLevel, size_t sourceLevel,
size_t destLevel, size_t destLevel,
const gl::Box &srcBox, const gl::Box &srcBox,
bool unpackFlipY, bool unpackFlipY,
bool unpackPremultiplyAlpha, bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
const gl::Texture *source) const gl::Texture *source)
{ {
UNREACHABLE(); UNREACHABLE();
return gl::InternalError() << "ANGLE_copy_texture_3d exposed but not implemented."; return angle::Result::Stop();
} }
} // namespace rx } // namespace rx
...@@ -22,84 +22,86 @@ class MockTextureImpl : public TextureImpl ...@@ -22,84 +22,86 @@ class MockTextureImpl : public TextureImpl
MockTextureImpl() : TextureImpl(mMockState), mMockState(gl::TextureType::_2D) {} MockTextureImpl() : TextureImpl(mMockState), mMockState(gl::TextureType::_2D) {}
virtual ~MockTextureImpl() { destructor(); } virtual ~MockTextureImpl() { destructor(); }
MOCK_METHOD8(setImage, MOCK_METHOD8(setImage,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
GLenum, GLenum,
const gl::Extents &, const gl::Extents &,
GLenum, GLenum,
GLenum, GLenum,
const gl::PixelUnpackState &, const gl::PixelUnpackState &,
const uint8_t *)); const uint8_t *));
MOCK_METHOD8(setSubImage, MOCK_METHOD8(setSubImage,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
const gl::Box &, const gl::Box &,
GLenum, GLenum,
GLenum, GLenum,
const gl::PixelUnpackState &, const gl::PixelUnpackState &,
gl::Buffer *, gl::Buffer *,
const uint8_t *)); const uint8_t *));
MOCK_METHOD7(setCompressedImage, MOCK_METHOD7(setCompressedImage,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
GLenum, GLenum,
const gl::Extents &, const gl::Extents &,
const gl::PixelUnpackState &, const gl::PixelUnpackState &,
size_t, size_t,
const uint8_t *)); const uint8_t *));
MOCK_METHOD7(setCompressedSubImage, MOCK_METHOD7(setCompressedSubImage,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
const gl::Box &, const gl::Box &,
GLenum, GLenum,
const gl::PixelUnpackState &, const gl::PixelUnpackState &,
size_t, size_t,
const uint8_t *)); const uint8_t *));
MOCK_METHOD5(copyImage, MOCK_METHOD5(copyImage,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
const gl::Rectangle &, const gl::Rectangle &,
GLenum, GLenum,
gl::Framebuffer *)); gl::Framebuffer *));
MOCK_METHOD5(copySubImage, MOCK_METHOD5(copySubImage,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
const gl::Offset &, const gl::Offset &,
const gl::Rectangle &, const gl::Rectangle &,
gl::Framebuffer *)); gl::Framebuffer *));
MOCK_METHOD9(copyTexture, MOCK_METHOD9(copyTexture,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
GLenum, GLenum,
GLenum, GLenum,
size_t, size_t,
bool, bool,
bool, bool,
bool, bool,
const gl::Texture *)); const gl::Texture *));
MOCK_METHOD9(copySubTexture, MOCK_METHOD9(copySubTexture,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
const gl::Offset &, const gl::Offset &,
size_t, size_t,
const gl::Box &, const gl::Box &,
bool, bool,
bool, bool,
bool, bool,
const gl::Texture *)); const gl::Texture *));
MOCK_METHOD2(copyCompressedTexture, gl::Error(const gl::Context *, const gl::Texture *source)); MOCK_METHOD2(copyCompressedTexture,
angle::Result(const gl::Context *, const gl::Texture *source));
MOCK_METHOD5( MOCK_METHOD5(
setStorage, setStorage,
gl::Error(const gl::Context *, gl::TextureType, size_t, GLenum, const gl::Extents &)); angle::Result(const gl::Context *, gl::TextureType, size_t, GLenum, const gl::Extents &));
MOCK_METHOD4(setImageExternal, MOCK_METHOD4(setImageExternal,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
gl::TextureType, gl::TextureType,
egl::Stream *, egl::Stream *,
const egl::Stream::GLTextureDescription &)); const egl::Stream::GLTextureDescription &));
MOCK_METHOD3(setEGLImageTarget, gl::Error(const gl::Context *, gl::TextureType, egl::Image *)); MOCK_METHOD3(setEGLImageTarget,
MOCK_METHOD1(generateMipmap, gl::Error(const gl::Context *)); angle::Result(const gl::Context *, gl::TextureType, egl::Image *));
MOCK_METHOD2(bindTexImage, gl::Error(const gl::Context *, egl::Surface *)); MOCK_METHOD1(generateMipmap, angle::Result(const gl::Context *));
MOCK_METHOD1(releaseTexImage, gl::Error(const gl::Context *)); MOCK_METHOD2(bindTexImage, angle::Result(const gl::Context *, egl::Surface *));
MOCK_METHOD1(releaseTexImage, angle::Result(const gl::Context *));
MOCK_METHOD4(getAttachmentRenderTarget, MOCK_METHOD4(getAttachmentRenderTarget,
angle::Result(const gl::Context *, angle::Result(const gl::Context *,
...@@ -107,11 +109,15 @@ class MockTextureImpl : public TextureImpl ...@@ -107,11 +109,15 @@ class MockTextureImpl : public TextureImpl
const gl::ImageIndex &, const gl::ImageIndex &,
FramebufferAttachmentRenderTarget **)); FramebufferAttachmentRenderTarget **));
MOCK_METHOD6( MOCK_METHOD6(setStorageMultisample,
setStorageMultisample, angle::Result(const gl::Context *,
gl::Error(const gl::Context *, gl::TextureType, GLsizei, GLint, const gl::Extents &, bool)); gl::TextureType,
GLsizei,
GLint,
const gl::Extents &,
bool));
MOCK_METHOD2(setBaseLevel, gl::Error(const gl::Context *, GLuint)); MOCK_METHOD2(setBaseLevel, angle::Result(const gl::Context *, GLuint));
MOCK_METHOD2(syncState, angle::Result(const gl::Context *, const gl::Texture::DirtyBits &)); MOCK_METHOD2(syncState, angle::Result(const gl::Context *, const gl::Texture::DirtyBits &));
......
...@@ -43,14 +43,14 @@ egl::Error EGLImageD3D::initialize(const egl::Display *display) ...@@ -43,14 +43,14 @@ egl::Error EGLImageD3D::initialize(const egl::Display *display)
return egl::NoError(); return egl::NoError();
} }
gl::Error EGLImageD3D::orphan(const gl::Context *context, egl::ImageSibling *sibling) angle::Result EGLImageD3D::orphan(const gl::Context *context, egl::ImageSibling *sibling)
{ {
if (sibling == mState.source) if (sibling == mState.source)
{ {
ANGLE_TRY(copyToLocalRendertarget(context)); ANGLE_TRY(copyToLocalRendertarget(context));
} }
return gl::NoError(); return angle::Result::Continue();
} }
angle::Result EGLImageD3D::getRenderTarget(const gl::Context *context, angle::Result EGLImageD3D::getRenderTarget(const gl::Context *context,
...@@ -71,7 +71,7 @@ angle::Result EGLImageD3D::getRenderTarget(const gl::Context *context, ...@@ -71,7 +71,7 @@ angle::Result EGLImageD3D::getRenderTarget(const gl::Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error EGLImageD3D::copyToLocalRendertarget(const gl::Context *context) angle::Result EGLImageD3D::copyToLocalRendertarget(const gl::Context *context)
{ {
ASSERT(mState.source != nullptr); ASSERT(mState.source != nullptr);
ASSERT(mRenderTarget == nullptr); ASSERT(mRenderTarget == nullptr);
......
...@@ -40,12 +40,12 @@ class EGLImageD3D final : public ImageImpl ...@@ -40,12 +40,12 @@ class EGLImageD3D final : public ImageImpl
egl::Error initialize(const egl::Display *display) override; egl::Error initialize(const egl::Display *display) override;
gl::Error orphan(const gl::Context *context, egl::ImageSibling *sibling) override; angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) override;
angle::Result getRenderTarget(const gl::Context *context, RenderTargetD3D **outRT) const; angle::Result getRenderTarget(const gl::Context *context, RenderTargetD3D **outRT) const;
private: private:
gl::Error copyToLocalRendertarget(const gl::Context *context); angle::Result copyToLocalRendertarget(const gl::Context *context);
RendererD3D *mRenderer; RendererD3D *mRenderer;
RenderTargetD3D *mRenderTarget; RenderTargetD3D *mRenderTarget;
......
...@@ -204,8 +204,8 @@ GLenum FramebufferD3D::getImplementationColorReadFormat(const gl::Context *conte ...@@ -204,8 +204,8 @@ GLenum FramebufferD3D::getImplementationColorReadFormat(const gl::Context *conte
} }
RenderTargetD3D *attachmentRenderTarget = nullptr; RenderTargetD3D *attachmentRenderTarget = nullptr;
gl::Error error = readAttachment->getRenderTarget(context, &attachmentRenderTarget); angle::Result error = readAttachment->getRenderTarget(context, &attachmentRenderTarget);
if (error.isError()) if (error != angle::Result::Continue())
{ {
return GL_NONE; return GL_NONE;
} }
...@@ -227,8 +227,8 @@ GLenum FramebufferD3D::getImplementationColorReadType(const gl::Context *context ...@@ -227,8 +227,8 @@ GLenum FramebufferD3D::getImplementationColorReadType(const gl::Context *context
} }
RenderTargetD3D *attachmentRenderTarget = nullptr; RenderTargetD3D *attachmentRenderTarget = nullptr;
gl::Error error = readAttachment->getRenderTarget(context, &attachmentRenderTarget); angle::Result error = readAttachment->getRenderTarget(context, &attachmentRenderTarget);
if (error.isError()) if (error != angle::Result::Continue())
{ {
return GL_NONE; return GL_NONE;
} }
......
...@@ -603,8 +603,8 @@ angle::Result Context11::getIncompleteTexture(const gl::Context *context, ...@@ -603,8 +603,8 @@ angle::Result Context11::getIncompleteTexture(const gl::Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error Context11::initializeMultisampleTextureToBlack(const gl::Context *context, angle::Result Context11::initializeMultisampleTextureToBlack(const gl::Context *context,
gl::Texture *glTexture) gl::Texture *glTexture)
{ {
ASSERT(glTexture->getType() == gl::TextureType::_2DMultisample); ASSERT(glTexture->getType() == gl::TextureType::_2DMultisample);
TextureD3D *textureD3D = GetImplAs<TextureD3D>(glTexture); TextureD3D *textureD3D = GetImplAs<TextureD3D>(glTexture);
......
...@@ -158,8 +158,8 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer ...@@ -158,8 +158,8 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer
gl::TextureType type, gl::TextureType type,
gl::Texture **textureOut); gl::Texture **textureOut);
gl::Error initializeMultisampleTextureToBlack(const gl::Context *context, angle::Result initializeMultisampleTextureToBlack(const gl::Context *context,
gl::Texture *glTexture) override; gl::Texture *glTexture) override;
void handleResult(HRESULT hr, void handleResult(HRESULT hr,
const char *message, const char *message,
......
...@@ -26,13 +26,13 @@ class ImageGL : public ImageImpl ...@@ -26,13 +26,13 @@ class ImageGL : public ImageImpl
// TextureGL does not have access to all the parameters needed to implement // TextureGL does not have access to all the parameters needed to implement
// glEGLImageTargetTexture2DOES or glEGLImageTargetRenderbufferStorageOES. This allows the Image // glEGLImageTargetTexture2DOES or glEGLImageTargetRenderbufferStorageOES. This allows the Image
// to implement these functions because it holds the native EGLimage or emulated object. // to implement these functions because it holds the native EGLimage or emulated object.
virtual gl::Error setTexture2D(const gl::Context *context, virtual angle::Result setTexture2D(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
TextureGL *texture, TextureGL *texture,
GLenum *outInternalFormat) = 0; GLenum *outInternalFormat) = 0;
virtual gl::Error setRenderbufferStorage(const gl::Context *context, virtual angle::Result setRenderbufferStorage(const gl::Context *context,
RenderbufferGL *renderbuffer, RenderbufferGL *renderbuffer,
GLenum *outInternalFormat) = 0; GLenum *outInternalFormat) = 0;
}; };
} // namespace rx } // namespace rx
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
namespace rx namespace rx
{ {
PathGL::PathGL(const FunctionsGL *functions, GLuint path) : mFunctions(functions), mPathID(path) PathGL::PathGL(const FunctionsGL *functions, GLuint path) : mFunctions(functions), mPathID(path)
{ {
} }
...@@ -20,19 +19,18 @@ PathGL::~PathGL() ...@@ -20,19 +19,18 @@ PathGL::~PathGL()
{ {
} }
gl::Error PathGL::setCommands(GLsizei numCommands, angle::Result PathGL::setCommands(GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
GLenum coordType, GLenum coordType,
const void *coords) const void *coords)
{ {
mFunctions->pathCommandsNV(mPathID, numCommands, commands, numCoords, coordType, coords); mFunctions->pathCommandsNV(mPathID, numCommands, commands, numCoords, coordType, coords);
return gl::NoError(); return angle::Result::Continue();
} }
void PathGL::setPathParameter(GLenum pname, GLfloat value) void PathGL::setPathParameter(GLenum pname, GLfloat value)
{ {
mFunctions->pathParameterfNV(mPathID, pname, value); mFunctions->pathParameterfNV(mPathID, pname, value);
} }
} // namespace rx
} // rx
...@@ -23,11 +23,11 @@ class PathGL : public PathImpl ...@@ -23,11 +23,11 @@ class PathGL : public PathImpl
PathGL(const FunctionsGL *functions, GLuint path); PathGL(const FunctionsGL *functions, GLuint path);
~PathGL() override; ~PathGL() override;
gl::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) override; const void *coords) override;
void setPathParameter(GLenum pname, GLfloat value) override; void setPathParameter(GLenum pname, GLfloat value) override;
......
...@@ -98,16 +98,16 @@ egl::Error ImageEGL::initialize(const egl::Display *display) ...@@ -98,16 +98,16 @@ egl::Error ImageEGL::initialize(const egl::Display *display)
return egl::NoError(); return egl::NoError();
} }
gl::Error ImageEGL::orphan(const gl::Context *context, egl::ImageSibling *sibling) angle::Result ImageEGL::orphan(const gl::Context *context, egl::ImageSibling *sibling)
{ {
// Nothing to do, the native EGLImage will orphan automatically. // Nothing to do, the native EGLImage will orphan automatically.
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error ImageEGL::setTexture2D(const gl::Context *context, angle::Result ImageEGL::setTexture2D(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
TextureGL *texture, TextureGL *texture,
GLenum *outInternalFormat) GLenum *outInternalFormat)
{ {
const FunctionsGL *functionsGL = GetFunctionsGL(context); const FunctionsGL *functionsGL = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context); StateManagerGL *stateManager = GetStateManagerGL(context);
...@@ -119,12 +119,12 @@ gl::Error ImageEGL::setTexture2D(const gl::Context *context, ...@@ -119,12 +119,12 @@ gl::Error ImageEGL::setTexture2D(const gl::Context *context,
functionsGL->eGLImageTargetTexture2DOES(ToGLenum(type), mImage); functionsGL->eGLImageTargetTexture2DOES(ToGLenum(type), mImage);
*outInternalFormat = mNativeInternalFormat; *outInternalFormat = mNativeInternalFormat;
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error ImageEGL::setRenderbufferStorage(const gl::Context *context, angle::Result ImageEGL::setRenderbufferStorage(const gl::Context *context,
RenderbufferGL *renderbuffer, RenderbufferGL *renderbuffer,
GLenum *outInternalFormat) GLenum *outInternalFormat)
{ {
const FunctionsGL *functionsGL = GetFunctionsGL(context); const FunctionsGL *functionsGL = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context); StateManagerGL *stateManager = GetStateManagerGL(context);
...@@ -136,7 +136,7 @@ gl::Error ImageEGL::setRenderbufferStorage(const gl::Context *context, ...@@ -136,7 +136,7 @@ gl::Error ImageEGL::setRenderbufferStorage(const gl::Context *context,
functionsGL->eGLImageTargetRenderbufferStorageOES(GL_RENDERBUFFER, mImage); functionsGL->eGLImageTargetRenderbufferStorageOES(GL_RENDERBUFFER, mImage);
*outInternalFormat = mNativeInternalFormat; *outInternalFormat = mNativeInternalFormat;
return gl::NoError(); return angle::Result::Continue();
} }
} // namespace rx } // namespace rx
...@@ -33,15 +33,15 @@ class ImageEGL final : public ImageGL ...@@ -33,15 +33,15 @@ class ImageEGL final : public ImageGL
egl::Error initialize(const egl::Display *display) override; egl::Error initialize(const egl::Display *display) override;
gl::Error orphan(const gl::Context *context, egl::ImageSibling *sibling) override; angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) override;
gl::Error setTexture2D(const gl::Context *context, angle::Result setTexture2D(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
TextureGL *texture, TextureGL *texture,
GLenum *outInternalFormat) override; GLenum *outInternalFormat) override;
gl::Error setRenderbufferStorage(const gl::Context *context, angle::Result setRenderbufferStorage(const gl::Context *context,
RenderbufferGL *renderbuffer, RenderbufferGL *renderbuffer,
GLenum *outInternalFormat) override; GLenum *outInternalFormat) override;
private: private:
const FunctionsEGL *mEGL; const FunctionsEGL *mEGL;
......
...@@ -27,9 +27,9 @@ egl::Error ImageNULL::initialize(const egl::Display *display) ...@@ -27,9 +27,9 @@ egl::Error ImageNULL::initialize(const egl::Display *display)
return egl::NoError(); return egl::NoError();
} }
gl::Error ImageNULL::orphan(const gl::Context *context, egl::ImageSibling *sibling) angle::Result ImageNULL::orphan(const gl::Context *context, egl::ImageSibling *sibling)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
} // namespace rx } // namespace rx
...@@ -22,7 +22,7 @@ class ImageNULL : public ImageImpl ...@@ -22,7 +22,7 @@ class ImageNULL : public ImageImpl
~ImageNULL() override; ~ImageNULL() override;
egl::Error initialize(const egl::Display *display) override; egl::Error initialize(const egl::Display *display) override;
gl::Error orphan(const gl::Context *context, egl::ImageSibling *sibling) override; angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) override;
}; };
} // namespace rx } // namespace rx
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
namespace rx namespace rx
{ {
PathNULL::PathNULL() : PathImpl() PathNULL::PathNULL() : PathImpl()
{ {
} }
...@@ -22,19 +21,16 @@ PathNULL::~PathNULL() ...@@ -22,19 +21,16 @@ PathNULL::~PathNULL()
{ {
} }
gl::Error PathNULL::setCommands(GLsizei numCommands, angle::Result PathNULL::setCommands(GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
GLenum coordType, GLenum coordType,
const void *coords) const void *coords)
{ {
UNIMPLEMENTED(); return angle::Result::Continue();
return gl::InternalError();
} }
void PathNULL::setPathParameter(GLenum pname, GLfloat value) void PathNULL::setPathParameter(GLenum pname, GLfloat value)
{ {
UNIMPLEMENTED();
} }
} // namespace rx } // namespace rx
...@@ -21,11 +21,11 @@ class PathNULL : public PathImpl ...@@ -21,11 +21,11 @@ class PathNULL : public PathImpl
PathNULL(); PathNULL();
~PathNULL() override; ~PathNULL() override;
gl::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) override; const void *coords) override;
void setPathParameter(GLenum pname, GLfloat value) override; void setPathParameter(GLenum pname, GLfloat value) override;
}; };
......
...@@ -22,114 +22,114 @@ TextureNULL::~TextureNULL() ...@@ -22,114 +22,114 @@ TextureNULL::~TextureNULL()
{ {
} }
gl::Error TextureNULL::setImage(const gl::Context *context, angle::Result TextureNULL::setImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size, const gl::Extents &size,
GLenum format, GLenum format,
GLenum type, GLenum type,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
const uint8_t *pixels) const uint8_t *pixels)
{ {
// TODO(geofflang): Read all incoming pixel data (maybe hash it?) to make sure we don't read out // TODO(geofflang): Read all incoming pixel data (maybe hash it?) to make sure we don't read out
// of bounds due to validation bugs. // of bounds due to validation bugs.
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setSubImage(const gl::Context *context, angle::Result TextureNULL::setSubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Box &area, const gl::Box &area,
GLenum format, GLenum format,
GLenum type, GLenum type,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
gl::Buffer *unpackBuffer, gl::Buffer *unpackBuffer,
const uint8_t *pixels) const uint8_t *pixels)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setCompressedImage(const gl::Context *context, angle::Result TextureNULL::setCompressedImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size, const gl::Extents &size,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
size_t imageSize, size_t imageSize,
const uint8_t *pixels) const uint8_t *pixels)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setCompressedSubImage(const gl::Context *context, angle::Result TextureNULL::setCompressedSubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Box &area, const gl::Box &area,
GLenum format, GLenum format,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
size_t imageSize, size_t imageSize,
const uint8_t *pixels) const uint8_t *pixels)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::copyImage(const gl::Context *context, angle::Result TextureNULL::copyImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
GLenum internalFormat, GLenum internalFormat,
gl::Framebuffer *source) gl::Framebuffer *source)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::copySubImage(const gl::Context *context, angle::Result TextureNULL::copySubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Offset &destOffset, const gl::Offset &destOffset,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
gl::Framebuffer *source) gl::Framebuffer *source)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setStorage(const gl::Context *context, angle::Result TextureNULL::setStorage(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
size_t levels, size_t levels,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size) const gl::Extents &size)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setEGLImageTarget(const gl::Context *context, angle::Result TextureNULL::setEGLImageTarget(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
egl::Image *image) egl::Image *image)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setImageExternal(const gl::Context *context, angle::Result TextureNULL::setImageExternal(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
egl::Stream *stream, egl::Stream *stream,
const egl::Stream::GLTextureDescription &desc) const egl::Stream::GLTextureDescription &desc)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::generateMipmap(const gl::Context *context) angle::Result TextureNULL::generateMipmap(const gl::Context *context)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setBaseLevel(const gl::Context *context, GLuint baseLevel) angle::Result TextureNULL::setBaseLevel(const gl::Context *context, GLuint baseLevel)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::bindTexImage(const gl::Context *context, egl::Surface *surface) angle::Result TextureNULL::bindTexImage(const gl::Context *context, egl::Surface *surface)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::releaseTexImage(const gl::Context *context) angle::Result TextureNULL::releaseTexImage(const gl::Context *context)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
angle::Result TextureNULL::syncState(const gl::Context *context, angle::Result TextureNULL::syncState(const gl::Context *context,
...@@ -138,14 +138,14 @@ angle::Result TextureNULL::syncState(const gl::Context *context, ...@@ -138,14 +138,14 @@ angle::Result TextureNULL::syncState(const gl::Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setStorageMultisample(const gl::Context *context, angle::Result TextureNULL::setStorageMultisample(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
GLsizei samples, GLsizei samples,
GLint internalformat, GLint internalformat,
const gl::Extents &size, const gl::Extents &size,
bool fixedSampleLocations) bool fixedSampleLocations)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
angle::Result TextureNULL::initializeContents(const gl::Context *context, angle::Result TextureNULL::initializeContents(const gl::Context *context,
......
...@@ -21,80 +21,80 @@ class TextureNULL : public TextureImpl ...@@ -21,80 +21,80 @@ class TextureNULL : public TextureImpl
TextureNULL(const gl::TextureState &state); TextureNULL(const gl::TextureState &state);
~TextureNULL() override; ~TextureNULL() override;
gl::Error setImage(const gl::Context *context, angle::Result setImage(const gl::Context *context,
const gl::ImageIndex &index,
GLenum internalFormat,
const gl::Extents &size,
GLenum format,
GLenum type,
const gl::PixelUnpackState &unpack,
const uint8_t *pixels) override;
gl::Error setSubImage(const gl::Context *context,
const gl::ImageIndex &index,
const gl::Box &area,
GLenum format,
GLenum type,
const gl::PixelUnpackState &unpack,
gl::Buffer *unpackBuffer,
const uint8_t *pixels) override;
gl::Error setCompressedImage(const gl::Context *context,
const gl::ImageIndex &index,
GLenum internalFormat,
const gl::Extents &size,
const gl::PixelUnpackState &unpack,
size_t imageSize,
const uint8_t *pixels) override;
gl::Error setCompressedSubImage(const gl::Context *context,
const gl::ImageIndex &index,
const gl::Box &area,
GLenum format,
const gl::PixelUnpackState &unpack,
size_t imageSize,
const uint8_t *pixels) override;
gl::Error copyImage(const gl::Context *context,
const gl::ImageIndex &index,
const gl::Rectangle &sourceArea,
GLenum internalFormat,
gl::Framebuffer *source) override;
gl::Error copySubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Offset &destOffset, GLenum internalFormat,
const gl::Rectangle &sourceArea, const gl::Extents &size,
gl::Framebuffer *source) override; GLenum format,
GLenum type,
gl::Error setStorage(const gl::Context *context, const gl::PixelUnpackState &unpack,
gl::TextureType type, const uint8_t *pixels) override;
size_t levels, angle::Result setSubImage(const gl::Context *context,
GLenum internalFormat, const gl::ImageIndex &index,
const gl::Extents &size) override; const gl::Box &area,
GLenum format,
gl::Error setEGLImageTarget(const gl::Context *context, GLenum type,
gl::TextureType type, const gl::PixelUnpackState &unpack,
egl::Image *image) override; gl::Buffer *unpackBuffer,
const uint8_t *pixels) override;
angle::Result setCompressedImage(const gl::Context *context,
const gl::ImageIndex &index,
GLenum internalFormat,
const gl::Extents &size,
const gl::PixelUnpackState &unpack,
size_t imageSize,
const uint8_t *pixels) override;
angle::Result setCompressedSubImage(const gl::Context *context,
const gl::ImageIndex &index,
const gl::Box &area,
GLenum format,
const gl::PixelUnpackState &unpack,
size_t imageSize,
const uint8_t *pixels) override;
angle::Result copyImage(const gl::Context *context,
const gl::ImageIndex &index,
const gl::Rectangle &sourceArea,
GLenum internalFormat,
gl::Framebuffer *source) override;
angle::Result copySubImage(const gl::Context *context,
const gl::ImageIndex &index,
const gl::Offset &destOffset,
const gl::Rectangle &sourceArea,
gl::Framebuffer *source) override;
angle::Result setStorage(const gl::Context *context,
gl::TextureType type,
size_t levels,
GLenum internalFormat,
const gl::Extents &size) override;
angle::Result setEGLImageTarget(const gl::Context *context,
gl::TextureType type,
egl::Image *image) override;
gl::Error setImageExternal(const gl::Context *context, angle::Result setImageExternal(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
egl::Stream *stream, egl::Stream *stream,
const egl::Stream::GLTextureDescription &desc) override; const egl::Stream::GLTextureDescription &desc) override;
gl::Error generateMipmap(const gl::Context *context) override; angle::Result generateMipmap(const gl::Context *context) override;
gl::Error setBaseLevel(const gl::Context *context, GLuint baseLevel) override; angle::Result setBaseLevel(const gl::Context *context, GLuint baseLevel) override;
gl::Error bindTexImage(const gl::Context *context, egl::Surface *surface) override; angle::Result bindTexImage(const gl::Context *context, egl::Surface *surface) override;
gl::Error releaseTexImage(const gl::Context *context) override; angle::Result releaseTexImage(const gl::Context *context) override;
angle::Result syncState(const gl::Context *context, angle::Result syncState(const gl::Context *context,
const gl::Texture::DirtyBits &dirtyBits) override; const gl::Texture::DirtyBits &dirtyBits) override;
gl::Error setStorageMultisample(const gl::Context *context, angle::Result setStorageMultisample(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
GLsizei samples, GLsizei samples,
GLint internalformat, GLint internalformat,
const gl::Extents &size, const gl::Extents &size,
bool fixedSampleLocations) override; bool fixedSampleLocations) override;
angle::Result initializeContents(const gl::Context *context, angle::Result initializeContents(const gl::Context *context,
const gl::ImageIndex &imageIndex) override; const gl::ImageIndex &imageIndex) override;
......
...@@ -413,7 +413,7 @@ void IncompleteTextureSet::onDestroy(const gl::Context *context) ...@@ -413,7 +413,7 @@ void IncompleteTextureSet::onDestroy(const gl::Context *context)
} }
} }
gl::Error IncompleteTextureSet::getIncompleteTexture( angle::Result IncompleteTextureSet::getIncompleteTexture(
const gl::Context *context, const gl::Context *context,
gl::TextureType type, gl::TextureType type,
MultisampleTextureInitializer *multisampleInitializer, MultisampleTextureInitializer *multisampleInitializer,
...@@ -422,7 +422,7 @@ gl::Error IncompleteTextureSet::getIncompleteTexture( ...@@ -422,7 +422,7 @@ gl::Error IncompleteTextureSet::getIncompleteTexture(
*textureOut = mIncompleteTextures[type].get(); *textureOut = mIncompleteTextures[type].get();
if (*textureOut != nullptr) if (*textureOut != nullptr)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
ContextImpl *implFactory = context->getImplementation(); ContextImpl *implFactory = context->getImplementation();
...@@ -472,7 +472,7 @@ gl::Error IncompleteTextureSet::getIncompleteTexture( ...@@ -472,7 +472,7 @@ gl::Error IncompleteTextureSet::getIncompleteTexture(
mIncompleteTextures[type].set(context, t.release()); mIncompleteTextures[type].set(context, t.release());
*textureOut = mIncompleteTextures[type].get(); *textureOut = mIncompleteTextures[type].get();
return gl::NoError(); return angle::Result::Continue();
} }
#define ANGLE_INSTANTIATE_SET_UNIFORM_MATRIX_FUNC(cols, rows) \ #define ANGLE_INSTANTIATE_SET_UNIFORM_MATRIX_FUNC(cols, rows) \
......
...@@ -236,8 +236,8 @@ class MultisampleTextureInitializer ...@@ -236,8 +236,8 @@ class MultisampleTextureInitializer
{ {
public: public:
virtual ~MultisampleTextureInitializer() {} virtual ~MultisampleTextureInitializer() {}
virtual gl::Error initializeMultisampleTextureToBlack(const gl::Context *context, virtual angle::Result initializeMultisampleTextureToBlack(const gl::Context *context,
gl::Texture *glTexture) = 0; gl::Texture *glTexture) = 0;
}; };
class IncompleteTextureSet final : angle::NonCopyable class IncompleteTextureSet final : angle::NonCopyable
...@@ -248,10 +248,10 @@ class IncompleteTextureSet final : angle::NonCopyable ...@@ -248,10 +248,10 @@ class IncompleteTextureSet final : angle::NonCopyable
void onDestroy(const gl::Context *context); void onDestroy(const gl::Context *context);
gl::Error getIncompleteTexture(const gl::Context *context, angle::Result getIncompleteTexture(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
MultisampleTextureInitializer *multisampleInitializer, MultisampleTextureInitializer *multisampleInitializer,
gl::Texture **textureOut); gl::Texture **textureOut);
private: private:
gl::TextureMap mIncompleteTextures; gl::TextureMap mIncompleteTextures;
......
...@@ -178,9 +178,9 @@ void ContextVk::onDestroy(const gl::Context *context) ...@@ -178,9 +178,9 @@ void ContextVk::onDestroy(const gl::Context *context)
} }
} }
gl::Error ContextVk::getIncompleteTexture(const gl::Context *context, angle::Result ContextVk::getIncompleteTexture(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
gl::Texture **textureOut) gl::Texture **textureOut)
{ {
// At some point, we'll need to support multisample and we'll pass "this" instead of nullptr // At some point, we'll need to support multisample and we'll pass "this" instead of nullptr
// and implement the necessary interface. // and implement the necessary interface.
...@@ -1259,7 +1259,7 @@ angle::Result ContextVk::updateActiveTextures(const gl::Context *context) ...@@ -1259,7 +1259,7 @@ angle::Result ContextVk::updateActiveTextures(const gl::Context *context)
// Null textures represent incomplete textures. // Null textures represent incomplete textures.
if (texture == nullptr) if (texture == nullptr)
{ {
ANGLE_TRY_HANDLE(context, getIncompleteTexture(context, textureType, &texture)); ANGLE_TRY(getIncompleteTexture(context, textureType, &texture));
} }
mActiveTextures[textureUnit] = vk::GetImpl(texture); mActiveTextures[textureUnit] = vk::GetImpl(texture);
......
...@@ -174,9 +174,9 @@ class ContextVk : public ContextImpl, public vk::Context ...@@ -174,9 +174,9 @@ class ContextVk : public ContextImpl, public vk::Context
const VkClearValue &getClearDepthStencilValue() const; const VkClearValue &getClearDepthStencilValue() const;
VkColorComponentFlags getClearColorMask() const; VkColorComponentFlags getClearColorMask() const;
const VkRect2D &getScissor() const { return mScissor; } const VkRect2D &getScissor() const { return mScissor; }
gl::Error getIncompleteTexture(const gl::Context *context, angle::Result getIncompleteTexture(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
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, unsigned int line) override;
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
#include "libANGLE/renderer/vulkan/ImageVk.h" #include "libANGLE/renderer/vulkan/ImageVk.h"
#include "common/debug.h" #include "common/debug.h"
#include "libANGLE/Context.h"
#include "libANGLE/renderer/vulkan/ContextVk.h"
#include "libANGLE/renderer/vulkan/vk_utils.h"
namespace rx namespace rx
{ {
...@@ -28,10 +31,9 @@ egl::Error ImageVk::initialize(const egl::Display *display) ...@@ -28,10 +31,9 @@ egl::Error ImageVk::initialize(const egl::Display *display)
return egl::EglBadAccess(); return egl::EglBadAccess();
} }
gl::Error ImageVk::orphan(const gl::Context *context, egl::ImageSibling *sibling) angle::Result ImageVk::orphan(const gl::Context *context, egl::ImageSibling *sibling)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
return gl::InternalError(); return angle::Result::Stop();
} }
} // namespace rx } // namespace rx
...@@ -22,7 +22,7 @@ class ImageVk : public ImageImpl ...@@ -22,7 +22,7 @@ class ImageVk : public ImageImpl
~ImageVk() override; ~ImageVk() override;
egl::Error initialize(const egl::Display *display) override; egl::Error initialize(const egl::Display *display) override;
gl::Error orphan(const gl::Context *context, egl::ImageSibling *sibling) override; angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) override;
}; };
} // namespace rx } // namespace rx
......
...@@ -37,9 +37,9 @@ class D3D11EmulatedIndexedBufferTest : public ANGLETest ...@@ -37,9 +37,9 @@ class D3D11EmulatedIndexedBufferTest : public ANGLETest
mSourceBuffer = new rx::Buffer11(mBufferState, mRenderer); mSourceBuffer = new rx::Buffer11(mBufferState, mRenderer);
GLfloat testData[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f }; GLfloat testData[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f };
gl::Error error = mSourceBuffer->setData(nullptr, gl::BufferBinding::Array, testData, angle::Result error = mSourceBuffer->setData(nullptr, gl::BufferBinding::Array, testData,
sizeof(testData), gl::BufferUsage::StaticDraw); sizeof(testData), gl::BufferUsage::StaticDraw);
ASSERT_FALSE(error.isError()); ASSERT_EQ(angle::Result::Continue(), error);
mTranslatedAttribute.baseOffset = 0; mTranslatedAttribute.baseOffset = 0;
mTranslatedAttribute.usesFirstVertexOffset = false; mTranslatedAttribute.usesFirstVertexOffset = false;
...@@ -112,9 +112,9 @@ class D3D11EmulatedIndexedBufferTest : public ANGLETest ...@@ -112,9 +112,9 @@ class D3D11EmulatedIndexedBufferTest : public ANGLETest
void emulateAndCompare(rx::SourceIndexData *srcData) void emulateAndCompare(rx::SourceIndexData *srcData)
{ {
ID3D11Buffer *emulatedBuffer = nullptr; ID3D11Buffer *emulatedBuffer = nullptr;
gl::Error error = mSourceBuffer->getEmulatedIndexedBuffer( angle::Result error = mSourceBuffer->getEmulatedIndexedBuffer(
mContext, srcData, mTranslatedAttribute, 0, &emulatedBuffer); mContext, srcData, mTranslatedAttribute, 0, &emulatedBuffer);
ASSERT_FALSE(error.isError()); ASSERT_EQ(angle::Result::Continue(), error);
ASSERT_TRUE(emulatedBuffer != nullptr); ASSERT_TRUE(emulatedBuffer != nullptr);
compareContents(emulatedBuffer); compareContents(emulatedBuffer);
} }
...@@ -180,8 +180,8 @@ TEST_P(D3D11EmulatedIndexedBufferTest, TestSourceBufferRemainsUntouchedAfterExpa ...@@ -180,8 +180,8 @@ TEST_P(D3D11EmulatedIndexedBufferTest, TestSourceBufferRemainsUntouchedAfterExpa
const uint8_t *sourceBufferMem = nullptr; const uint8_t *sourceBufferMem = nullptr;
const uint8_t *cleanBufferMem = nullptr; const uint8_t *cleanBufferMem = nullptr;
gl::Error error = mSourceBuffer->getData(mContext, &sourceBufferMem); angle::Result error = mSourceBuffer->getData(mContext, &sourceBufferMem);
ASSERT_FALSE(error.isError()); ASSERT_EQ(angle::Result::Continue(), error);
error = cleanSourceBuffer->getData(mContext, &cleanBufferMem); error = cleanSourceBuffer->getData(mContext, &cleanBufferMem);
ASSERT_FALSE(error.isError()); ASSERT_FALSE(error.isError());
......
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