Use angle::Result in front-end (Part 3)
Handles the gl::Framebuffer class and its implementation.
Bug: angleproject:2491
Change-Id: I3b9c0609e9277264ccdb370596500562df3b7d15
Reviewed-on: https://chromium-review.googlesource.com/c/1280743
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/SymbolTable_autogen.cpp b/src/compiler/translator/SymbolTable_autogen.cpp
index 046ed87..0a03cf0 100644
--- a/src/compiler/translator/SymbolTable_autogen.cpp
+++ b/src/compiler/translator/SymbolTable_autogen.cpp
@@ -2319,9 +2319,9 @@
constexpr const TVariable *p0N3B[2] = {&BuiltInVariable::kVar_pt0N, &BuiltInVariable::kVar_pt3B};
constexpr const TVariable *p0O1C0C[3] = {&BuiltInVariable::kVar_pt0O, &BuiltInVariable::kVar_pt1C,
&BuiltInVariable::kVar_pt0C};
-constexpr const TVariable *p0P2C0C[3] = {&BuiltInVariable::kVar_pt0P, &BuiltInVariable::kVar_pt2C,
+constexpr const TVariable *p0P2C0C[3] = {&BuiltInVariable::kVar_pt0P, &BuiltInVariable::kVar_pt2C,
&BuiltInVariable::kVar_pt0C};
-constexpr const TVariable *p0Q0C[2] = {&BuiltInVariable::kVar_pt0Q, &BuiltInVariable::kVar_pt0C};
+constexpr const TVariable *p0Q0C[2] = {&BuiltInVariable::kVar_pt0Q, &BuiltInVariable::kVar_pt0C};
constexpr const TVariable *p0Q1B0B1C[4] = {&BuiltInVariable::kVar_pt0Q, &BuiltInVariable::kVar_pt1B,
&BuiltInVariable::kVar_pt0B,
&BuiltInVariable::kVar_pt1C};
@@ -2534,11 +2534,11 @@
constexpr const TVariable *p0e3B1B1B1C[5] = {
&BuiltInVariable::kVar_pt0e, &BuiltInVariable::kVar_pt3B, &BuiltInVariable::kVar_pt1B,
&BuiltInVariable::kVar_pt1B, &BuiltInVariable::kVar_pt1C};
-constexpr const TVariable *p0f1C3B[3] = {&BuiltInVariable::kVar_pt0f, &BuiltInVariable::kVar_pt1C,
+constexpr const TVariable *p0f1C3B[3] = {&BuiltInVariable::kVar_pt0f, &BuiltInVariable::kVar_pt1C,
&BuiltInVariable::kVar_pt3B};
-constexpr const TVariable *p0g1C3C[3] = {&BuiltInVariable::kVar_pt0g, &BuiltInVariable::kVar_pt1C,
+constexpr const TVariable *p0g1C3C[3] = {&BuiltInVariable::kVar_pt0g, &BuiltInVariable::kVar_pt1C,
&BuiltInVariable::kVar_pt3C};
-constexpr const TVariable *p0h1C3D[3] = {&BuiltInVariable::kVar_pt0h, &BuiltInVariable::kVar_pt1C,
+constexpr const TVariable *p0h1C3D[3] = {&BuiltInVariable::kVar_pt0h, &BuiltInVariable::kVar_pt1C,
&BuiltInVariable::kVar_pt3D};
constexpr const TVariable *p0i2C3B[3] = {&BuiltInVariable::kVar_pt0i, &BuiltInVariable::kVar_pt2C,
&BuiltInVariable::kVar_pt3B};
@@ -2552,11 +2552,11 @@
&BuiltInVariable::kVar_pt3C};
constexpr const TVariable *p0n2C3D[3] = {&BuiltInVariable::kVar_pt0n, &BuiltInVariable::kVar_pt2C,
&BuiltInVariable::kVar_pt3D};
-constexpr const TVariable *p0o2C3B[3] = {&BuiltInVariable::kVar_pt0o, &BuiltInVariable::kVar_pt2C,
+constexpr const TVariable *p0o2C3B[3] = {&BuiltInVariable::kVar_pt0o, &BuiltInVariable::kVar_pt2C,
&BuiltInVariable::kVar_pt3B};
-constexpr const TVariable *p0p2C3C[3] = {&BuiltInVariable::kVar_pt0p, &BuiltInVariable::kVar_pt2C,
+constexpr const TVariable *p0p2C3C[3] = {&BuiltInVariable::kVar_pt0p, &BuiltInVariable::kVar_pt2C,
&BuiltInVariable::kVar_pt3C};
-constexpr const TVariable *p0q2C3D[3] = {&BuiltInVariable::kVar_pt0q, &BuiltInVariable::kVar_pt2C,
+constexpr const TVariable *p0q2C3D[3] = {&BuiltInVariable::kVar_pt0q, &BuiltInVariable::kVar_pt2C,
&BuiltInVariable::kVar_pt3D};
constexpr const TVariable *p1B0B0B[3] = {&BuiltInVariable::kVar_pt1B, &BuiltInVariable::kVar_pt0B,
&BuiltInVariable::kVar_pt0B};
diff --git a/src/libANGLE/Framebuffer.cpp b/src/libANGLE/Framebuffer.cpp
index 7c6c609..48249f3 100644
--- a/src/libANGLE/Framebuffer.cpp
+++ b/src/libANGLE/Framebuffer.cpp
@@ -1271,7 +1271,7 @@
return GL_FRAMEBUFFER_COMPLETE;
}
-Error Framebuffer::discard(const Context *context, size_t count, const GLenum *attachments)
+angle::Result Framebuffer::discard(const Context *context, size_t count, const GLenum *attachments)
{
// Back-ends might make the contents of the FBO undefined. In WebGL 2.0, invalidate operations
// can be no-ops, so we should probably do that to ensure consistency.
@@ -1280,7 +1280,9 @@
return mImpl->discard(context, count, attachments);
}
-Error Framebuffer::invalidate(const Context *context, size_t count, const GLenum *attachments)
+angle::Result Framebuffer::invalidate(const Context *context,
+ size_t count,
+ const GLenum *attachments)
{
// Back-ends might make the contents of the FBO undefined. In WebGL 2.0, invalidate operations
// can be no-ops, so we should probably do that to ensure consistency.
@@ -1330,10 +1332,10 @@
return false;
}
-Error Framebuffer::invalidateSub(const Context *context,
- size_t count,
- const GLenum *attachments,
- const Rectangle &area)
+angle::Result Framebuffer::invalidateSub(const Context *context,
+ size_t count,
+ const GLenum *attachments,
+ const Rectangle &area)
{
// Back-ends might make the contents of the FBO undefined. In WebGL 2.0, invalidate operations
// can be no-ops, so we should probably do that to ensure consistency.
@@ -1342,103 +1344,104 @@
return mImpl->invalidateSub(context, count, attachments, area);
}
-Error Framebuffer::clear(const Context *context, GLbitfield mask)
+angle::Result Framebuffer::clear(const Context *context, GLbitfield mask)
{
const auto &glState = context->getGLState();
if (glState.isRasterizerDiscardEnabled())
{
- return NoError();
+ return angle::Result::Continue();
}
ANGLE_TRY(mImpl->clear(context, mask));
- return NoError();
+ return angle::Result::Continue();
}
-Error Framebuffer::clearBufferfv(const Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLfloat *values)
+angle::Result Framebuffer::clearBufferfv(const Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLfloat *values)
{
if (context->getGLState().isRasterizerDiscardEnabled() ||
IsClearBufferMaskedOut(context, buffer))
{
- return NoError();
+ return angle::Result::Continue();
}
ANGLE_TRY(mImpl->clearBufferfv(context, buffer, drawbuffer, values));
- return NoError();
+ return angle::Result::Continue();
}
-Error Framebuffer::clearBufferuiv(const Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLuint *values)
+angle::Result Framebuffer::clearBufferuiv(const Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLuint *values)
{
if (context->getGLState().isRasterizerDiscardEnabled() ||
IsClearBufferMaskedOut(context, buffer))
{
- return NoError();
+ return angle::Result::Continue();
}
ANGLE_TRY(mImpl->clearBufferuiv(context, buffer, drawbuffer, values));
- return NoError();
+ return angle::Result::Continue();
}
-Error Framebuffer::clearBufferiv(const Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLint *values)
+angle::Result Framebuffer::clearBufferiv(const Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLint *values)
{
if (context->getGLState().isRasterizerDiscardEnabled() ||
IsClearBufferMaskedOut(context, buffer))
{
- return NoError();
+ return angle::Result::Continue();
}
ANGLE_TRY(mImpl->clearBufferiv(context, buffer, drawbuffer, values));
- return NoError();
+ return angle::Result::Continue();
}
-Error Framebuffer::clearBufferfi(const Context *context,
- GLenum buffer,
- GLint drawbuffer,
- GLfloat depth,
- GLint stencil)
+angle::Result Framebuffer::clearBufferfi(const Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ GLfloat depth,
+ GLint stencil)
{
if (context->getGLState().isRasterizerDiscardEnabled() ||
IsClearBufferMaskedOut(context, buffer))
{
- return NoError();
+ return angle::Result::Continue();
}
ANGLE_TRY(mImpl->clearBufferfi(context, buffer, drawbuffer, depth, stencil));
- return NoError();
+ return angle::Result::Continue();
}
-Error Framebuffer::getImplementationColorReadFormat(const Context *context, GLenum *formatOut)
+angle::Result Framebuffer::getImplementationColorReadFormat(const Context *context,
+ GLenum *formatOut)
{
ANGLE_TRY(syncState(context));
*formatOut = mImpl->getImplementationColorReadFormat(context);
- return NoError();
+ return angle::Result::Continue();
}
-Error Framebuffer::getImplementationColorReadType(const Context *context, GLenum *typeOut)
+angle::Result Framebuffer::getImplementationColorReadType(const Context *context, GLenum *typeOut)
{
ANGLE_TRY(syncState(context));
*typeOut = mImpl->getImplementationColorReadType(context);
- return NoError();
+ return angle::Result::Continue();
}
-Error Framebuffer::readPixels(const Context *context,
- const Rectangle &area,
- GLenum format,
- GLenum type,
- void *pixels)
+angle::Result Framebuffer::readPixels(const Context *context,
+ const Rectangle &area,
+ GLenum format,
+ GLenum type,
+ void *pixels)
{
ANGLE_TRY(ensureReadAttachmentInitialized(context, GL_COLOR_BUFFER_BIT));
ANGLE_TRY(mImpl->readPixels(context, area, format, type, pixels));
@@ -1449,14 +1452,14 @@
unpackBuffer->onPixelPack(context);
}
- return NoError();
+ return angle::Result::Continue();
}
-Error Framebuffer::blit(const Context *context,
- const Rectangle &sourceArea,
- const Rectangle &destArea,
- GLbitfield mask,
- GLenum filter)
+angle::Result Framebuffer::blit(const Context *context,
+ const Rectangle &sourceArea,
+ const Rectangle &destArea,
+ GLbitfield mask,
+ GLenum filter)
{
GLbitfield blitMask = mask;
@@ -1479,7 +1482,7 @@
if (!blitMask)
{
- return NoError();
+ return angle::Result::Continue();
}
auto *sourceFBO = context->getGLState().getReadFramebuffer();
@@ -1518,10 +1521,12 @@
return 0;
}
-Error Framebuffer::getSamplePosition(const Context *context, size_t index, GLfloat *xy) const
+angle::Result Framebuffer::getSamplePosition(const Context *context,
+ size_t index,
+ GLfloat *xy) const
{
ANGLE_TRY(mImpl->getSamplePosition(context, index, xy));
- return NoError();
+ return angle::Result::Continue();
}
bool Framebuffer::hasValidDepthStencil() const
@@ -2010,12 +2015,13 @@
mState.getMultiviewLayout() == GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE;
}
-Error Framebuffer::ensureClearAttachmentsInitialized(const Context *context, GLbitfield mask)
+angle::Result Framebuffer::ensureClearAttachmentsInitialized(const Context *context,
+ GLbitfield mask)
{
const auto &glState = context->getGLState();
if (!context->isRobustResourceInitEnabled() || glState.isRasterizerDiscardEnabled())
{
- return NoError();
+ return angle::Result::Continue();
}
const BlendState &blend = glState.getBlendState();
@@ -2027,7 +2033,7 @@
if (!color && !depth && !stencil)
{
- return NoError();
+ return angle::Result::Continue();
}
if (partialClearNeedsInit(context, color, depth, stencil))
@@ -2040,18 +2046,18 @@
// the clear.
markDrawAttachmentsInitialized(color, depth, stencil);
- return NoError();
+ return angle::Result::Continue();
}
-Error Framebuffer::ensureClearBufferAttachmentsInitialized(const Context *context,
- GLenum buffer,
- GLint drawbuffer)
+angle::Result Framebuffer::ensureClearBufferAttachmentsInitialized(const Context *context,
+ GLenum buffer,
+ GLint drawbuffer)
{
if (!context->isRobustResourceInitEnabled() ||
context->getGLState().isRasterizerDiscardEnabled() ||
IsClearBufferMaskedOut(context, buffer))
{
- return NoError();
+ return angle::Result::Continue();
}
if (partialBufferClearNeedsInit(context, buffer))
@@ -2064,7 +2070,7 @@
// the clear.
markBufferInitialized(buffer, drawbuffer);
- return NoError();
+ return angle::Result::Continue();
}
angle::Result Framebuffer::ensureDrawAttachmentsInitialized(const Context *context)
@@ -2095,11 +2101,12 @@
return angle::Result::Continue();
}
-Error Framebuffer::ensureReadAttachmentInitialized(const Context *context, GLbitfield blitMask)
+angle::Result Framebuffer::ensureReadAttachmentInitialized(const Context *context,
+ GLbitfield blitMask)
{
if (!context->isRobustResourceInitEnabled() || mState.mResourceNeedsInit.none())
{
- return NoError();
+ return angle::Result::Continue();
}
if ((blitMask & GL_COLOR_BUFFER_BIT) != 0 && mState.mReadBufferState != GL_NONE)
@@ -2130,7 +2137,7 @@
}
}
- return NoError();
+ return angle::Result::Continue();
}
void Framebuffer::markDrawAttachmentsInitialized(bool color, bool depth, bool stencil)
@@ -2217,15 +2224,15 @@
return mState.getDimensions();
}
-Error Framebuffer::ensureBufferInitialized(const Context *context,
- GLenum bufferType,
- GLint bufferIndex)
+angle::Result Framebuffer::ensureBufferInitialized(const Context *context,
+ GLenum bufferType,
+ GLint bufferIndex)
{
ASSERT(context->isRobustResourceInitEnabled());
if (mState.mResourceNeedsInit.none())
{
- return NoError();
+ return angle::Result::Continue();
}
switch (bufferType)
@@ -2277,7 +2284,7 @@
break;
}
- return NoError();
+ return angle::Result::Continue();
}
bool Framebuffer::partialBufferClearNeedsInit(const Context *context, GLenum bufferType)
diff --git a/src/libANGLE/Framebuffer.h b/src/libANGLE/Framebuffer.h
index 6f38917..e07bfbc 100644
--- a/src/libANGLE/Framebuffer.h
+++ b/src/libANGLE/Framebuffer.h
@@ -235,7 +235,7 @@
// This method calls checkStatus.
int getSamples(const Context *context);
- Error getSamplePosition(const Context *context, size_t index, GLfloat *xy) const;
+ angle::Result getSamplePosition(const Context *context, size_t index, GLfloat *xy) const;
GLint getDefaultWidth() const;
GLint getDefaultHeight() const;
@@ -274,47 +274,47 @@
bool hasValidDepthStencil() const;
- Error discard(const Context *context, size_t count, const GLenum *attachments);
- Error invalidate(const Context *context, size_t count, const GLenum *attachments);
- Error invalidateSub(const Context *context,
- size_t count,
- const GLenum *attachments,
- const Rectangle &area);
+ angle::Result discard(const Context *context, size_t count, const GLenum *attachments);
+ angle::Result invalidate(const Context *context, size_t count, const GLenum *attachments);
+ angle::Result invalidateSub(const Context *context,
+ size_t count,
+ const GLenum *attachments,
+ const Rectangle &area);
- Error clear(const Context *context, GLbitfield mask);
- Error clearBufferfv(const Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLfloat *values);
- Error clearBufferuiv(const Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLuint *values);
- Error clearBufferiv(const Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLint *values);
- Error clearBufferfi(const Context *context,
- GLenum buffer,
- GLint drawbuffer,
- GLfloat depth,
- GLint stencil);
+ angle::Result clear(const Context *context, GLbitfield mask);
+ angle::Result clearBufferfv(const Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLfloat *values);
+ angle::Result clearBufferuiv(const Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLuint *values);
+ angle::Result clearBufferiv(const Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLint *values);
+ angle::Result clearBufferfi(const Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ GLfloat depth,
+ GLint stencil);
// These two methods call syncState() internally.
- Error getImplementationColorReadFormat(const Context *context, GLenum *formatOut);
- Error getImplementationColorReadType(const Context *context, GLenum *typeOut);
+ angle::Result getImplementationColorReadFormat(const Context *context, GLenum *formatOut);
+ angle::Result getImplementationColorReadType(const Context *context, GLenum *typeOut);
- Error readPixels(const Context *context,
- const Rectangle &area,
- GLenum format,
- GLenum type,
- void *pixels);
+ angle::Result readPixels(const Context *context,
+ const Rectangle &area,
+ GLenum format,
+ GLenum type,
+ void *pixels);
- Error blit(const Context *context,
- const Rectangle &sourceArea,
- const Rectangle &destArea,
- GLbitfield mask,
- GLenum filter);
+ angle::Result blit(const Context *context,
+ const Rectangle &sourceArea,
+ const Rectangle &destArea,
+ GLbitfield mask,
+ GLenum filter);
bool isDefault() const;
enum DirtyBitType : size_t
@@ -350,12 +350,12 @@
GLint copyTextureLevel,
GLint copyTextureLayer) const;
- Error ensureClearAttachmentsInitialized(const Context *context, GLbitfield mask);
- Error ensureClearBufferAttachmentsInitialized(const Context *context,
- GLenum buffer,
- GLint drawbuffer);
+ angle::Result ensureClearAttachmentsInitialized(const Context *context, GLbitfield mask);
+ angle::Result ensureClearBufferAttachmentsInitialized(const Context *context,
+ GLenum buffer,
+ GLint drawbuffer);
angle::Result ensureDrawAttachmentsInitialized(const Context *context);
- Error ensureReadAttachmentInitialized(const Context *context, GLbitfield blitMask);
+ angle::Result ensureReadAttachmentInitialized(const Context *context, GLbitfield blitMask);
Box getDimensions() const;
private:
@@ -404,7 +404,9 @@
void markDrawAttachmentsInitialized(bool color, bool depth, bool stencil);
void markBufferInitialized(GLenum bufferType, GLint bufferIndex);
- Error ensureBufferInitialized(const Context *context, GLenum bufferType, GLint bufferIndex);
+ angle::Result ensureBufferInitialized(const Context *context,
+ GLenum bufferType,
+ GLint bufferIndex);
// Checks that we have a partially masked clear:
// * some color channels are masked out
diff --git a/src/libANGLE/renderer/FramebufferImpl.h b/src/libANGLE/renderer/FramebufferImpl.h
index 756b596..04c5821 100644
--- a/src/libANGLE/renderer/FramebufferImpl.h
+++ b/src/libANGLE/renderer/FramebufferImpl.h
@@ -33,58 +33,58 @@
virtual ~FramebufferImpl() {}
virtual void destroy(const gl::Context *context) {}
- virtual gl::Error discard(const gl::Context *context,
- size_t count,
- const GLenum *attachments) = 0;
- virtual gl::Error invalidate(const gl::Context *context,
- size_t count,
- const GLenum *attachments) = 0;
- virtual gl::Error invalidateSub(const gl::Context *context,
- size_t count,
- const GLenum *attachments,
- const gl::Rectangle &area) = 0;
+ virtual angle::Result discard(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments) = 0;
+ virtual angle::Result invalidate(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments) = 0;
+ virtual angle::Result invalidateSub(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments,
+ const gl::Rectangle &area) = 0;
- virtual gl::Error clear(const gl::Context *context, GLbitfield mask) = 0;
- virtual gl::Error clearBufferfv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLfloat *values) = 0;
- virtual gl::Error clearBufferuiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLuint *values) = 0;
- virtual gl::Error clearBufferiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLint *values) = 0;
- virtual gl::Error clearBufferfi(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- GLfloat depth,
- GLint stencil) = 0;
+ virtual angle::Result clear(const gl::Context *context, GLbitfield mask) = 0;
+ virtual angle::Result clearBufferfv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLfloat *values) = 0;
+ virtual angle::Result clearBufferuiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLuint *values) = 0;
+ virtual angle::Result clearBufferiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLint *values) = 0;
+ virtual angle::Result clearBufferfi(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ GLfloat depth,
+ GLint stencil) = 0;
virtual GLenum getImplementationColorReadFormat(const gl::Context *context) const = 0;
virtual GLenum getImplementationColorReadType(const gl::Context *context) const = 0;
- virtual gl::Error readPixels(const gl::Context *context,
- const gl::Rectangle &area,
- GLenum format,
- GLenum type,
- void *pixels) = 0;
+ virtual angle::Result readPixels(const gl::Context *context,
+ const gl::Rectangle &area,
+ GLenum format,
+ GLenum type,
+ void *pixels) = 0;
- virtual gl::Error blit(const gl::Context *context,
- const gl::Rectangle &sourceArea,
- const gl::Rectangle &destArea,
- GLbitfield mask,
- GLenum filter) = 0;
+ virtual angle::Result blit(const gl::Context *context,
+ const gl::Rectangle &sourceArea,
+ const gl::Rectangle &destArea,
+ GLbitfield mask,
+ GLenum filter) = 0;
virtual bool checkStatus(const gl::Context *context) const = 0;
virtual angle::Result syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits) = 0;
- virtual gl::Error getSamplePosition(const gl::Context *context,
- size_t index,
- GLfloat *xy) const = 0;
+ virtual angle::Result getSamplePosition(const gl::Context *context,
+ size_t index,
+ GLfloat *xy) const = 0;
const gl::FramebufferState &getState() const { return mState; }
diff --git a/src/libANGLE/renderer/FramebufferImpl_mock.h b/src/libANGLE/renderer/FramebufferImpl_mock.h
index 93ff876..8d841e7 100644
--- a/src/libANGLE/renderer/FramebufferImpl_mock.h
+++ b/src/libANGLE/renderer/FramebufferImpl_mock.h
@@ -23,30 +23,30 @@
MockFramebufferImpl() : rx::FramebufferImpl(gl::FramebufferState()) {}
virtual ~MockFramebufferImpl() { destructor(); }
- MOCK_METHOD3(discard, gl::Error(const gl::Context *, size_t, const GLenum *));
- MOCK_METHOD3(invalidate, gl::Error(const gl::Context *, size_t, const GLenum *));
+ MOCK_METHOD3(discard, angle::Result(const gl::Context *, size_t, const GLenum *));
+ MOCK_METHOD3(invalidate, angle::Result(const gl::Context *, size_t, const GLenum *));
MOCK_METHOD4(invalidateSub,
- gl::Error(const gl::Context *, size_t, const GLenum *, const gl::Rectangle &));
+ angle::Result(const gl::Context *, size_t, const GLenum *, const gl::Rectangle &));
- MOCK_METHOD2(clear, gl::Error(const gl::Context *, GLbitfield));
- MOCK_METHOD4(clearBufferfv, gl::Error(const gl::Context *, GLenum, GLint, const GLfloat *));
- MOCK_METHOD4(clearBufferuiv, gl::Error(const gl::Context *, GLenum, GLint, const GLuint *));
- MOCK_METHOD4(clearBufferiv, gl::Error(const gl::Context *, GLenum, GLint, const GLint *));
- MOCK_METHOD5(clearBufferfi, gl::Error(const gl::Context *, GLenum, GLint, GLfloat, GLint));
+ MOCK_METHOD2(clear, angle::Result(const gl::Context *, GLbitfield));
+ MOCK_METHOD4(clearBufferfv, angle::Result(const gl::Context *, GLenum, GLint, const GLfloat *));
+ MOCK_METHOD4(clearBufferuiv, angle::Result(const gl::Context *, GLenum, GLint, const GLuint *));
+ MOCK_METHOD4(clearBufferiv, angle::Result(const gl::Context *, GLenum, GLint, const GLint *));
+ MOCK_METHOD5(clearBufferfi, angle::Result(const gl::Context *, GLenum, GLint, GLfloat, GLint));
MOCK_CONST_METHOD1(getImplementationColorReadFormat, GLenum(const gl::Context *));
MOCK_CONST_METHOD1(getImplementationColorReadType, GLenum(const gl::Context *));
MOCK_METHOD5(readPixels,
- gl::Error(const gl::Context *, const gl::Rectangle &, GLenum, GLenum, void *));
+ angle::Result(const gl::Context *, const gl::Rectangle &, GLenum, GLenum, void *));
- MOCK_CONST_METHOD3(getSamplePosition, gl::Error(const gl::Context *, size_t, GLfloat *));
+ MOCK_CONST_METHOD3(getSamplePosition, angle::Result(const gl::Context *, size_t, GLfloat *));
MOCK_METHOD5(blit,
- gl::Error(const gl::Context *,
- const gl::Rectangle &,
- const gl::Rectangle &,
- GLbitfield,
- GLenum));
+ angle::Result(const gl::Context *,
+ const gl::Rectangle &,
+ const gl::Rectangle &,
+ GLbitfield,
+ GLenum));
MOCK_CONST_METHOD1(checkStatus, bool(const gl::Context *));
diff --git a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
index ba09d2e..32caca6 100644
--- a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
+++ b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
@@ -101,16 +101,16 @@
{
}
-gl::Error FramebufferD3D::clear(const gl::Context *context, GLbitfield mask)
+angle::Result FramebufferD3D::clear(const gl::Context *context, GLbitfield mask)
{
ClearParameters clearParams = GetClearParameters(context->getGLState(), mask);
return clearImpl(context, clearParams);
}
-gl::Error FramebufferD3D::clearBufferfv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLfloat *values)
+angle::Result FramebufferD3D::clearBufferfv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLfloat *values)
{
// glClearBufferfv can be called to clear the color buffer or depth buffer
ClearParameters clearParams = GetClearParameters(context->getGLState(), 0);
@@ -134,10 +134,10 @@
return clearImpl(context, clearParams);
}
-gl::Error FramebufferD3D::clearBufferuiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLuint *values)
+angle::Result FramebufferD3D::clearBufferuiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLuint *values)
{
// glClearBufferuiv can only be called to clear a color buffer
ClearParameters clearParams = GetClearParameters(context->getGLState(), 0);
@@ -151,10 +151,10 @@
return clearImpl(context, clearParams);
}
-gl::Error FramebufferD3D::clearBufferiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLint *values)
+angle::Result FramebufferD3D::clearBufferiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLint *values)
{
// glClearBufferiv can be called to clear the color buffer or stencil buffer
ClearParameters clearParams = GetClearParameters(context->getGLState(), 0);
@@ -178,11 +178,11 @@
return clearImpl(context, clearParams);
}
-gl::Error FramebufferD3D::clearBufferfi(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- GLfloat depth,
- GLint stencil)
+angle::Result FramebufferD3D::clearBufferfi(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ GLfloat depth,
+ GLint stencil)
{
// glClearBufferfi can only be called to clear a depth stencil buffer
ClearParameters clearParams = GetClearParameters(context->getGLState(), 0);
@@ -240,20 +240,20 @@
return implementationFormatInfo.getReadPixelsType(context->getClientVersion());
}
-gl::Error FramebufferD3D::readPixels(const gl::Context *context,
- const gl::Rectangle &origArea,
- GLenum format,
- GLenum type,
- void *pixels)
+angle::Result FramebufferD3D::readPixels(const gl::Context *context,
+ const gl::Rectangle &area,
+ GLenum format,
+ GLenum type,
+ void *pixels)
{
// Clip read area to framebuffer.
const gl::Extents fbSize = getState().getReadAttachment()->getSize();
const gl::Rectangle fbRect(0, 0, fbSize.width, fbSize.height);
- gl::Rectangle area;
- if (!ClipRectangle(origArea, fbRect, &area))
+ gl::Rectangle clippedArea;
+ if (!ClipRectangle(area, fbRect, &clippedArea))
{
// nothing to read
- return gl::NoError();
+ return angle::Result::Continue();
}
const gl::PixelPackState &packState = context->getGLState().getPackState();
@@ -264,24 +264,24 @@
GLuint outputPitch = 0;
ANGLE_CHECK_HR_MATH(contextD3D,
- sizedFormatInfo.computeRowPitch(type, origArea.width, packState.alignment,
+ sizedFormatInfo.computeRowPitch(type, area.width, packState.alignment,
packState.rowLength, &outputPitch));
GLuint outputSkipBytes = 0;
ANGLE_CHECK_HR_MATH(contextD3D, sizedFormatInfo.computeSkipBytes(
type, outputPitch, 0, packState, false, &outputSkipBytes));
- outputSkipBytes +=
- (area.x - origArea.x) * sizedFormatInfo.pixelBytes + (area.y - origArea.y) * outputPitch;
+ outputSkipBytes += (clippedArea.x - area.x) * sizedFormatInfo.pixelBytes +
+ (clippedArea.y - area.y) * outputPitch;
- return readPixelsImpl(context, area, format, type, outputPitch, packState,
+ return readPixelsImpl(context, clippedArea, format, type, outputPitch, packState,
static_cast<uint8_t *>(pixels) + outputSkipBytes);
}
-gl::Error FramebufferD3D::blit(const gl::Context *context,
- const gl::Rectangle &sourceArea,
- const gl::Rectangle &destArea,
- GLbitfield mask,
- GLenum filter)
+angle::Result FramebufferD3D::blit(const gl::Context *context,
+ const gl::Rectangle &sourceArea,
+ const gl::Rectangle &destArea,
+ GLbitfield mask,
+ GLenum filter)
{
const auto &glState = context->getGLState();
const gl::Framebuffer *sourceFramebuffer = glState.getReadFramebuffer();
@@ -290,7 +290,7 @@
(mask & GL_DEPTH_BUFFER_BIT) != 0, (mask & GL_STENCIL_BUFFER_BIT) != 0,
filter, sourceFramebuffer));
- return gl::NoError();
+ return angle::Result::Continue();
}
bool FramebufferD3D::checkStatus(const gl::Context *context) const
diff --git a/src/libANGLE/renderer/d3d/FramebufferD3D.h b/src/libANGLE/renderer/d3d/FramebufferD3D.h
index dc67700..d7ad1d3 100644
--- a/src/libANGLE/renderer/d3d/FramebufferD3D.h
+++ b/src/libANGLE/renderer/d3d/FramebufferD3D.h
@@ -62,38 +62,38 @@
FramebufferD3D(const gl::FramebufferState &data, RendererD3D *renderer);
~FramebufferD3D() override;
- gl::Error clear(const gl::Context *context, GLbitfield mask) override;
- gl::Error clearBufferfv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLfloat *values) override;
- gl::Error clearBufferuiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLuint *values) override;
- gl::Error clearBufferiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLint *values) override;
- gl::Error clearBufferfi(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- GLfloat depth,
- GLint stencil) override;
+ angle::Result clear(const gl::Context *context, GLbitfield mask) override;
+ angle::Result clearBufferfv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLfloat *values) override;
+ angle::Result clearBufferuiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLuint *values) override;
+ angle::Result clearBufferiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLint *values) override;
+ angle::Result clearBufferfi(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ GLfloat depth,
+ GLint stencil) override;
GLenum getImplementationColorReadFormat(const gl::Context *context) const override;
GLenum getImplementationColorReadType(const gl::Context *context) const override;
- gl::Error readPixels(const gl::Context *context,
- const gl::Rectangle &area,
- GLenum format,
- GLenum type,
- void *pixels) override;
+ angle::Result readPixels(const gl::Context *context,
+ const gl::Rectangle &area,
+ GLenum format,
+ GLenum type,
+ void *pixels) override;
- gl::Error blit(const gl::Context *context,
- const gl::Rectangle &sourceArea,
- const gl::Rectangle &destArea,
- GLbitfield mask,
- GLenum filter) override;
+ angle::Result blit(const gl::Context *context,
+ const gl::Rectangle &sourceArea,
+ const gl::Rectangle &destArea,
+ GLbitfield mask,
+ GLenum filter) override;
bool checkStatus(const gl::Context *context) const override;
diff --git a/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp b/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
index 9f8dc64..d6ce2d2 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
@@ -113,16 +113,16 @@
return angle::Result::Continue();
}
-gl::Error Framebuffer11::invalidate(const gl::Context *context,
- size_t count,
- const GLenum *attachments)
+angle::Result Framebuffer11::invalidate(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments)
{
return invalidateBase(context, count, attachments, false);
}
-gl::Error Framebuffer11::discard(const gl::Context *context,
- size_t count,
- const GLenum *attachments)
+angle::Result Framebuffer11::discard(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments)
{
return invalidateBase(context, count, attachments, true);
}
@@ -219,13 +219,13 @@
return angle::Result::Continue();
}
-gl::Error Framebuffer11::invalidateSub(const gl::Context *context,
- size_t,
- const GLenum *,
- const gl::Rectangle &)
+angle::Result Framebuffer11::invalidateSub(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments,
+ const gl::Rectangle &area)
{
// A no-op implementation conforms to the spec, so don't call UNIMPLEMENTED()
- return gl::NoError();
+ return angle::Result::Continue();
}
angle::Result Framebuffer11::invalidateAttachment(const gl::Context *context,
@@ -397,16 +397,16 @@
return angle::Result::Continue();
}
-gl::Error Framebuffer11::getSamplePosition(const gl::Context *context,
- size_t index,
- GLfloat *xy) const
+angle::Result Framebuffer11::getSamplePosition(const gl::Context *context,
+ size_t index,
+ GLfloat *xy) const
{
const gl::FramebufferAttachment *attachment = mState.getFirstNonNullAttachment();
ASSERT(attachment);
GLsizei sampleCount = attachment->getSamples();
d3d11_gl::GetSamplePosition(sampleCount, index, xy);
- return gl::NoError();
+ return angle::Result::Continue();
}
RenderTarget11 *Framebuffer11::getFirstRenderTarget() const
diff --git a/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h b/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h
index caf1691..dcd8531 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h
+++ b/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h
@@ -24,14 +24,16 @@
Framebuffer11(const gl::FramebufferState &data, Renderer11 *renderer);
~Framebuffer11() override;
- gl::Error discard(const gl::Context *context, size_t count, const GLenum *attachments) override;
- gl::Error invalidate(const gl::Context *context,
- size_t count,
- const GLenum *attachments) override;
- gl::Error invalidateSub(const gl::Context *context,
- size_t count,
- const GLenum *attachments,
- const gl::Rectangle &area) override;
+ angle::Result discard(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments) override;
+ angle::Result invalidate(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments) override;
+ angle::Result invalidateSub(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments,
+ const gl::Rectangle &area) override;
// Invalidate the cached swizzles of all bound texture attachments.
angle::Result markAttachmentsDirty(const gl::Context *context) const;
@@ -50,9 +52,9 @@
RenderTarget11 *getFirstRenderTarget() const;
- gl::Error getSamplePosition(const gl::Context *context,
- size_t index,
- GLfloat *xy) const override;
+ angle::Result getSamplePosition(const gl::Context *context,
+ size_t index,
+ GLfloat *xy) const override;
private:
angle::Result clearImpl(const gl::Context *context,
diff --git a/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.cpp b/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.cpp
index 4205812..1e17090 100644
--- a/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.cpp
@@ -34,28 +34,29 @@
{
}
-gl::Error Framebuffer9::discard(const gl::Context *context, size_t, const GLenum *)
+angle::Result Framebuffer9::discard(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments)
{
- // Extension not implemented in D3D9 renderer
- UNREACHABLE();
- return gl::NoError();
+ ANGLE_HR_UNREACHABLE(GetImplAs<Context9>(context));
+ return angle::Result::Stop();
}
-gl::Error Framebuffer9::invalidate(const gl::Context *context, size_t, const GLenum *)
+angle::Result Framebuffer9::invalidate(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments)
{
- // Shouldn't ever reach here in D3D9
- UNREACHABLE();
- return gl::NoError();
+ ANGLE_HR_UNREACHABLE(GetImplAs<Context9>(context));
+ return angle::Result::Stop();
}
-gl::Error Framebuffer9::invalidateSub(const gl::Context *context,
- size_t,
- const GLenum *,
- const gl::Rectangle &)
+angle::Result Framebuffer9::invalidateSub(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments,
+ const gl::Rectangle &area)
{
- // Shouldn't ever reach here in D3D9
- UNREACHABLE();
- return gl::NoError();
+ ANGLE_HR_UNREACHABLE(GetImplAs<Context9>(context));
+ return angle::Result::Stop();
}
angle::Result Framebuffer9::clearImpl(const gl::Context *context,
@@ -390,12 +391,12 @@
return d3dFormatInfo.info().glInternalFormat;
}
-gl::Error Framebuffer9::getSamplePosition(const gl::Context *context,
- size_t index,
- GLfloat *xy) const
+angle::Result Framebuffer9::getSamplePosition(const gl::Context *context,
+ size_t index,
+ GLfloat *xy) const
{
- UNREACHABLE();
- return gl::InternalError() << "getSamplePosition is unsupported to d3d9.";
+ ANGLE_HR_UNREACHABLE(GetImplAs<Context9>(context));
+ return angle::Result::Stop();
}
angle::Result Framebuffer9::syncState(const gl::Context *context,
diff --git a/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.h b/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.h
index dbdedea..261db3b 100644
--- a/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.h
+++ b/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.h
@@ -23,18 +23,20 @@
Framebuffer9(const gl::FramebufferState &data, Renderer9 *renderer);
~Framebuffer9() override;
- gl::Error discard(const gl::Context *context, size_t count, const GLenum *attachments) override;
- gl::Error invalidate(const gl::Context *context,
- size_t count,
- const GLenum *attachments) override;
- gl::Error invalidateSub(const gl::Context *context,
- size_t count,
- const GLenum *attachments,
- const gl::Rectangle &area) override;
+ angle::Result discard(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments) override;
+ angle::Result invalidate(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments) override;
+ angle::Result invalidateSub(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments,
+ const gl::Rectangle &area) override;
- gl::Error getSamplePosition(const gl::Context *context,
- size_t index,
- GLfloat *xy) const override;
+ angle::Result getSamplePosition(const gl::Context *context,
+ size_t index,
+ GLfloat *xy) const override;
angle::Result syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits) override;
diff --git a/src/libANGLE/renderer/gl/FramebufferGL.cpp b/src/libANGLE/renderer/gl/FramebufferGL.cpp
index c3b1913..a5a64cd 100644
--- a/src/libANGLE/renderer/gl/FramebufferGL.cpp
+++ b/src/libANGLE/renderer/gl/FramebufferGL.cpp
@@ -210,13 +210,17 @@
mFramebufferID = 0;
}
-Error FramebufferGL::discard(const gl::Context *context, size_t count, const GLenum *attachments)
+angle::Result FramebufferGL::discard(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments)
{
// glInvalidateFramebuffer accepts the same enums as glDiscardFramebufferEXT
return invalidate(context, count, attachments);
}
-Error FramebufferGL::invalidate(const gl::Context *context, size_t count, const GLenum *attachments)
+angle::Result FramebufferGL::invalidate(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments)
{
const GLenum *finalAttachmentsPtr = attachments;
@@ -243,13 +247,13 @@
finalAttachmentsPtr);
}
- return gl::NoError();
+ return angle::Result::Continue();
}
-Error FramebufferGL::invalidateSub(const gl::Context *context,
- size_t count,
- const GLenum *attachments,
- const gl::Rectangle &area)
+angle::Result FramebufferGL::invalidateSub(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments,
+ const gl::Rectangle &area)
{
const GLenum *finalAttachmentsPtr = attachments;
@@ -273,10 +277,10 @@
area.height);
}
- return gl::NoError();
+ return angle::Result::Continue();
}
-Error FramebufferGL::clear(const gl::Context *context, GLbitfield mask)
+angle::Result FramebufferGL::clear(const gl::Context *context, GLbitfield mask)
{
const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context);
@@ -296,13 +300,13 @@
GL_NONE, 0, nullptr, 0.0f, 0);
}
- return gl::NoError();
+ return angle::Result::Continue();
}
-Error FramebufferGL::clearBufferfv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLfloat *values)
+angle::Result FramebufferGL::clearBufferfv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLfloat *values)
{
const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context);
@@ -323,13 +327,13 @@
reinterpret_cast<const uint8_t *>(values), 0.0f, 0);
}
- return gl::NoError();
+ return angle::Result::Continue();
}
-Error FramebufferGL::clearBufferuiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLuint *values)
+angle::Result FramebufferGL::clearBufferuiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLuint *values)
{
const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context);
@@ -350,13 +354,13 @@
reinterpret_cast<const uint8_t *>(values), 0.0f, 0);
}
- return gl::NoError();
+ return angle::Result::Continue();
}
-Error FramebufferGL::clearBufferiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLint *values)
+angle::Result FramebufferGL::clearBufferiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLint *values)
{
const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context);
@@ -377,14 +381,14 @@
reinterpret_cast<const uint8_t *>(values), 0.0f, 0);
}
- return gl::NoError();
+ return angle::Result::Continue();
}
-Error FramebufferGL::clearBufferfi(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- GLfloat depth,
- GLint stencil)
+angle::Result FramebufferGL::clearBufferfi(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ GLfloat depth,
+ GLint stencil)
{
const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context);
@@ -405,7 +409,7 @@
nullptr, depth, stencil);
}
- return gl::NoError();
+ return angle::Result::Continue();
}
GLenum FramebufferGL::getImplementationColorReadFormat(const gl::Context *context) const
@@ -422,11 +426,11 @@
return format.info->getReadPixelsType(context->getClientVersion());
}
-Error FramebufferGL::readPixels(const gl::Context *context,
- const gl::Rectangle &origArea,
- GLenum format,
- GLenum type,
- void *ptrOrOffset)
+angle::Result FramebufferGL::readPixels(const gl::Context *context,
+ const gl::Rectangle &area,
+ GLenum format,
+ GLenum type,
+ void *pixels)
{
ContextGL *contextGL = GetImplAs<ContextGL>(context);
const FunctionsGL *functions = GetFunctionsGL(context);
@@ -436,11 +440,11 @@
// Clip read area to framebuffer.
const gl::Extents fbSize = getState().getReadAttachment()->getSize();
const gl::Rectangle fbRect(0, 0, fbSize.width, fbSize.height);
- gl::Rectangle area;
- if (!ClipRectangle(origArea, fbRect, &area))
+ gl::Rectangle clippedArea;
+ if (!ClipRectangle(area, fbRect, &clippedArea))
{
// nothing to read
- return gl::NoError();
+ return angle::Result::Continue();
}
PixelPackState packState = context->getGLState().getPackState();
@@ -456,11 +460,11 @@
bool useOverlappingRowsWorkaround = workarounds.packOverlappingRowsSeparatelyPackBuffer &&
packBuffer && packState.rowLength != 0 &&
- packState.rowLength < area.width;
+ packState.rowLength < clippedArea.width;
- GLubyte *pixels = static_cast<GLubyte *>(ptrOrOffset);
- int leftClip = area.x - origArea.x;
- int topClip = area.y - origArea.y;
+ GLubyte *outPtr = static_cast<GLubyte *>(pixels);
+ int leftClip = clippedArea.x - area.x;
+ int topClip = clippedArea.y - area.y;
if (leftClip || topClip)
{
// Adjust destination to match portion clipped off left and/or top.
@@ -468,16 +472,16 @@
GLuint rowBytes = 0;
ANGLE_CHECK_GL_MATH(contextGL,
- glFormat.computeRowPitch(readType, origArea.width, packState.alignment,
+ glFormat.computeRowPitch(readType, area.width, packState.alignment,
packState.rowLength, &rowBytes));
- pixels += leftClip * glFormat.pixelBytes + topClip * rowBytes;
+ outPtr += leftClip * glFormat.pixelBytes + topClip * rowBytes;
}
- if (packState.rowLength == 0 && area.width != origArea.width)
+ if (packState.rowLength == 0 && clippedArea.width != area.width)
{
// No rowLength was specified so it will derive from read width, but clipping changed the
// read width. Use the original width so we fill the user's buffer as they intended.
- packState.rowLength = origArea.width;
+ packState.rowLength = area.width;
}
// We want to use rowLength, but that might not be supported.
@@ -486,26 +490,26 @@
if (cannotSetDesiredRowLength || useOverlappingRowsWorkaround)
{
- return readPixelsRowByRow(context, area, readFormat, readType, packState, pixels);
+ return readPixelsRowByRow(context, clippedArea, readFormat, readType, packState, outPtr);
}
bool useLastRowPaddingWorkaround = false;
if (workarounds.packLastRowSeparatelyForPaddingInclusion)
{
ANGLE_TRY(ShouldApplyLastRowPaddingWorkaround(
- contextGL, gl::Extents(area.width, area.height, 1), packState, packBuffer, readFormat,
- readType, false, pixels, &useLastRowPaddingWorkaround));
+ contextGL, gl::Extents(clippedArea.width, clippedArea.height, 1), packState, packBuffer,
+ readFormat, readType, false, outPtr, &useLastRowPaddingWorkaround));
}
- return readPixelsAllAtOnce(context, area, readFormat, readType, packState, pixels,
+ return readPixelsAllAtOnce(context, clippedArea, readFormat, readType, packState, outPtr,
useLastRowPaddingWorkaround);
}
-Error FramebufferGL::blit(const gl::Context *context,
- const gl::Rectangle &sourceArea,
- const gl::Rectangle &destArea,
- GLbitfield mask,
- GLenum filter)
+angle::Result FramebufferGL::blit(const gl::Context *context,
+ const gl::Rectangle &sourceArea,
+ const gl::Rectangle &destArea,
+ GLbitfield mask,
+ GLenum filter)
{
const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context);
@@ -579,7 +583,7 @@
if (blitMask == 0)
{
- return gl::NoError();
+ return angle::Result::Continue();
}
const FramebufferGL *sourceFramebufferGL = GetImplAs<FramebufferGL>(sourceFramebuffer);
@@ -590,19 +594,19 @@
destArea.x, destArea.y, destArea.x1(), destArea.y1(), blitMask,
filter);
- return gl::NoError();
+ return angle::Result::Continue();
}
-gl::Error FramebufferGL::getSamplePosition(const gl::Context *context,
- size_t index,
- GLfloat *xy) const
+angle::Result FramebufferGL::getSamplePosition(const gl::Context *context,
+ size_t index,
+ GLfloat *xy) const
{
const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context);
stateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
functions->getMultisamplefv(GL_SAMPLE_POSITION, static_cast<GLuint>(index), xy);
- return gl::NoError();
+ return angle::Result::Continue();
}
bool FramebufferGL::checkStatus(const gl::Context *context) const
diff --git a/src/libANGLE/renderer/gl/FramebufferGL.h b/src/libANGLE/renderer/gl/FramebufferGL.h
index cdab829..c6cc286 100644
--- a/src/libANGLE/renderer/gl/FramebufferGL.h
+++ b/src/libANGLE/renderer/gl/FramebufferGL.h
@@ -28,52 +28,54 @@
void destroy(const gl::Context *context) override;
- gl::Error discard(const gl::Context *context, size_t count, const GLenum *attachments) override;
- gl::Error invalidate(const gl::Context *context,
- size_t count,
- const GLenum *attachments) override;
- gl::Error invalidateSub(const gl::Context *context,
- size_t count,
- const GLenum *attachments,
- const gl::Rectangle &area) override;
+ angle::Result discard(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments) override;
+ angle::Result invalidate(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments) override;
+ angle::Result invalidateSub(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments,
+ const gl::Rectangle &area) override;
- gl::Error clear(const gl::Context *context, GLbitfield mask) override;
- gl::Error clearBufferfv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLfloat *values) override;
- gl::Error clearBufferuiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLuint *values) override;
- gl::Error clearBufferiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLint *values) override;
- gl::Error clearBufferfi(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- GLfloat depth,
- GLint stencil) override;
+ angle::Result clear(const gl::Context *context, GLbitfield mask) override;
+ angle::Result clearBufferfv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLfloat *values) override;
+ angle::Result clearBufferuiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLuint *values) override;
+ angle::Result clearBufferiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLint *values) override;
+ angle::Result clearBufferfi(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ GLfloat depth,
+ GLint stencil) override;
GLenum getImplementationColorReadFormat(const gl::Context *context) const override;
GLenum getImplementationColorReadType(const gl::Context *context) const override;
- gl::Error readPixels(const gl::Context *context,
- const gl::Rectangle &area,
- GLenum format,
- GLenum type,
- void *pixels) override;
+ angle::Result readPixels(const gl::Context *context,
+ const gl::Rectangle &area,
+ GLenum format,
+ GLenum type,
+ void *pixels) override;
- gl::Error blit(const gl::Context *context,
- const gl::Rectangle &sourceArea,
- const gl::Rectangle &destArea,
- GLbitfield mask,
- GLenum filter) override;
+ angle::Result blit(const gl::Context *context,
+ const gl::Rectangle &sourceArea,
+ const gl::Rectangle &destArea,
+ GLbitfield mask,
+ GLenum filter) override;
- gl::Error getSamplePosition(const gl::Context *context,
- size_t index,
- GLfloat *xy) const override;
+ angle::Result getSamplePosition(const gl::Context *context,
+ size_t index,
+ GLfloat *xy) const override;
bool checkStatus(const gl::Context *context) const override;
diff --git a/src/libANGLE/renderer/null/FramebufferNULL.cpp b/src/libANGLE/renderer/null/FramebufferNULL.cpp
index f6eeeaa..e88c63d 100644
--- a/src/libANGLE/renderer/null/FramebufferNULL.cpp
+++ b/src/libANGLE/renderer/null/FramebufferNULL.cpp
@@ -26,64 +26,64 @@
{
}
-gl::Error FramebufferNULL::discard(const gl::Context *context,
- size_t count,
- const GLenum *attachments)
+angle::Result FramebufferNULL::discard(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments)
{
- return gl::NoError();
+ return angle::Result::Continue();
}
-gl::Error FramebufferNULL::invalidate(const gl::Context *context,
- size_t count,
- const GLenum *attachments)
+angle::Result FramebufferNULL::invalidate(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments)
{
- return gl::NoError();
+ return angle::Result::Continue();
}
-gl::Error FramebufferNULL::invalidateSub(const gl::Context *context,
- size_t count,
- const GLenum *attachments,
- const gl::Rectangle &area)
+angle::Result FramebufferNULL::invalidateSub(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments,
+ const gl::Rectangle &area)
{
- return gl::NoError();
+ return angle::Result::Continue();
}
-gl::Error FramebufferNULL::clear(const gl::Context *context, GLbitfield mask)
+angle::Result FramebufferNULL::clear(const gl::Context *context, GLbitfield mask)
{
- return gl::NoError();
+ return angle::Result::Continue();
}
-gl::Error FramebufferNULL::clearBufferfv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLfloat *values)
+angle::Result FramebufferNULL::clearBufferfv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLfloat *values)
{
- return gl::NoError();
+ return angle::Result::Continue();
}
-gl::Error FramebufferNULL::clearBufferuiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLuint *values)
+angle::Result FramebufferNULL::clearBufferuiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLuint *values)
{
- return gl::NoError();
+ return angle::Result::Continue();
}
-gl::Error FramebufferNULL::clearBufferiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLint *values)
+angle::Result FramebufferNULL::clearBufferiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLint *values)
{
- return gl::NoError();
+ return angle::Result::Continue();
}
-gl::Error FramebufferNULL::clearBufferfi(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- GLfloat depth,
- GLint stencil)
+angle::Result FramebufferNULL::clearBufferfi(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ GLfloat depth,
+ GLint stencil)
{
- return gl::NoError();
+ return angle::Result::Continue();
}
GLenum FramebufferNULL::getImplementationColorReadFormat(const gl::Context *context) const
@@ -112,11 +112,11 @@
return format.info->getReadPixelsType(context->getClientVersion());
}
-gl::Error FramebufferNULL::readPixels(const gl::Context *context,
- const gl::Rectangle &origArea,
- GLenum format,
- GLenum type,
- void *ptrOrOffset)
+angle::Result FramebufferNULL::readPixels(const gl::Context *context,
+ const gl::Rectangle &origArea,
+ GLenum format,
+ GLenum type,
+ void *ptrOrOffset)
{
const gl::PixelPackState &packState = context->getGLState().getPackState();
gl::Buffer *packBuffer = context->getGLState().getTargetBuffer(gl::BufferBinding::PixelPack);
@@ -141,7 +141,7 @@
if (!ClipRectangle(origArea, fbRect, &area))
{
// nothing to read
- return gl::NoError();
+ return angle::Result::Continue();
}
// Compute size of unclipped rows and initial skip
@@ -171,16 +171,16 @@
pixels += rowBytes;
}
- return gl::NoError();
+ return angle::Result::Continue();
}
-gl::Error FramebufferNULL::blit(const gl::Context *context,
- const gl::Rectangle &sourceArea,
- const gl::Rectangle &destArea,
- GLbitfield mask,
- GLenum filter)
+angle::Result FramebufferNULL::blit(const gl::Context *context,
+ const gl::Rectangle &sourceArea,
+ const gl::Rectangle &destArea,
+ GLbitfield mask,
+ GLenum filter)
{
- return gl::NoError();
+ return angle::Result::Continue();
}
bool FramebufferNULL::checkStatus(const gl::Context *context) const
@@ -194,11 +194,11 @@
return angle::Result::Continue();
}
-gl::Error FramebufferNULL::getSamplePosition(const gl::Context *context,
- size_t index,
- GLfloat *xy) const
+angle::Result FramebufferNULL::getSamplePosition(const gl::Context *context,
+ size_t index,
+ GLfloat *xy) const
{
- return gl::NoError();
+ return angle::Result::Continue();
}
} // namespace rx
diff --git a/src/libANGLE/renderer/null/FramebufferNULL.h b/src/libANGLE/renderer/null/FramebufferNULL.h
index 3975739..41f1650 100644
--- a/src/libANGLE/renderer/null/FramebufferNULL.h
+++ b/src/libANGLE/renderer/null/FramebufferNULL.h
@@ -21,56 +21,58 @@
FramebufferNULL(const gl::FramebufferState &state);
~FramebufferNULL() override;
- gl::Error discard(const gl::Context *context, size_t count, const GLenum *attachments) override;
- gl::Error invalidate(const gl::Context *context,
- size_t count,
- const GLenum *attachments) override;
- gl::Error invalidateSub(const gl::Context *context,
- size_t count,
- const GLenum *attachments,
- const gl::Rectangle &area) override;
+ angle::Result discard(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments) override;
+ angle::Result invalidate(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments) override;
+ angle::Result invalidateSub(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments,
+ const gl::Rectangle &area) override;
- gl::Error clear(const gl::Context *context, GLbitfield mask) override;
- gl::Error clearBufferfv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLfloat *values) override;
- gl::Error clearBufferuiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLuint *values) override;
- gl::Error clearBufferiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLint *values) override;
- gl::Error clearBufferfi(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- GLfloat depth,
- GLint stencil) override;
+ angle::Result clear(const gl::Context *context, GLbitfield mask) override;
+ angle::Result clearBufferfv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLfloat *values) override;
+ angle::Result clearBufferuiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLuint *values) override;
+ angle::Result clearBufferiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLint *values) override;
+ angle::Result clearBufferfi(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ GLfloat depth,
+ GLint stencil) override;
GLenum getImplementationColorReadFormat(const gl::Context *context) const override;
GLenum getImplementationColorReadType(const gl::Context *context) const override;
- gl::Error readPixels(const gl::Context *context,
- const gl::Rectangle &area,
- GLenum format,
- GLenum type,
- void *pixels) override;
+ angle::Result readPixels(const gl::Context *context,
+ const gl::Rectangle &area,
+ GLenum format,
+ GLenum type,
+ void *pixels) override;
- gl::Error blit(const gl::Context *context,
- const gl::Rectangle &sourceArea,
- const gl::Rectangle &destArea,
- GLbitfield mask,
- GLenum filter) override;
+ angle::Result blit(const gl::Context *context,
+ const gl::Rectangle &sourceArea,
+ const gl::Rectangle &destArea,
+ GLbitfield mask,
+ GLenum filter) override;
bool checkStatus(const gl::Context *context) const override;
angle::Result syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits) override;
- gl::Error getSamplePosition(const gl::Context *context,
- size_t index,
- GLfloat *xy) const override;
+ angle::Result getSamplePosition(const gl::Context *context,
+ size_t index,
+ GLfloat *xy) const override;
};
} // namespace rx
diff --git a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
index 4417ca1..8e91a53 100644
--- a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
+++ b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
@@ -142,32 +142,32 @@
mBlitPixelBuffer.destroy(contextVk->getDevice());
}
-gl::Error FramebufferVk::discard(const gl::Context *context,
- size_t count,
- const GLenum *attachments)
+angle::Result FramebufferVk::discard(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments)
{
- UNIMPLEMENTED();
- return gl::InternalError();
+ ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
+ return angle::Result::Stop();
}
-gl::Error FramebufferVk::invalidate(const gl::Context *context,
- size_t count,
- const GLenum *attachments)
+angle::Result FramebufferVk::invalidate(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments)
{
- UNIMPLEMENTED();
- return gl::InternalError();
+ ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
+ return angle::Result::Stop();
}
-gl::Error FramebufferVk::invalidateSub(const gl::Context *context,
- size_t count,
- const GLenum *attachments,
- const gl::Rectangle &area)
+angle::Result FramebufferVk::invalidateSub(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments,
+ const gl::Rectangle &area)
{
- UNIMPLEMENTED();
- return gl::InternalError();
+ ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
+ return angle::Result::Stop();
}
-gl::Error FramebufferVk::clear(const gl::Context *context, GLbitfield mask)
+angle::Result FramebufferVk::clear(const gl::Context *context, GLbitfield mask)
{
ContextVk *contextVk = vk::GetImpl(context);
@@ -207,7 +207,7 @@
// TODO(jmadill): Masked stencil clear. http://anglebug.com/2540
ANGLE_TRY(clearWithClearAttachments(contextVk, false, clearDepth, clearStencil));
}
- return gl::NoError();
+ return angle::Result::Continue();
}
// If we clear the depth OR the stencil but not both, and we have a packed depth stencil
@@ -226,7 +226,7 @@
// Masked stencil clears are currently not implemented.
// TODO(jmadill): Masked stencil clear. http://anglebug.com/2540
ANGLE_TRY(clearWithClearAttachments(contextVk, clearColor, clearDepth, clearStencil));
- return gl::NoError();
+ return angle::Result::Continue();
}
// Standard Depth/stencil clear without scissor.
@@ -247,7 +247,7 @@
if (!clearColor)
{
- return gl::NoError();
+ return angle::Result::Continue();
}
const auto *attachment = mState.getFirstNonNullAttachment();
@@ -283,44 +283,44 @@
colorRenderTarget->getLayerIndex(), 1, commandBuffer);
}
- return gl::NoError();
+ return angle::Result::Continue();
}
-gl::Error FramebufferVk::clearBufferfv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLfloat *values)
+angle::Result FramebufferVk::clearBufferfv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLfloat *values)
{
- UNIMPLEMENTED();
- return gl::InternalError();
+ ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
+ return angle::Result::Stop();
}
-gl::Error FramebufferVk::clearBufferuiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLuint *values)
+angle::Result FramebufferVk::clearBufferuiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLuint *values)
{
- UNIMPLEMENTED();
- return gl::InternalError();
+ ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
+ return angle::Result::Stop();
}
-gl::Error FramebufferVk::clearBufferiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLint *values)
+angle::Result FramebufferVk::clearBufferiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLint *values)
{
- UNIMPLEMENTED();
- return gl::InternalError();
+ ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
+ return angle::Result::Stop();
}
-gl::Error FramebufferVk::clearBufferfi(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- GLfloat depth,
- GLint stencil)
+angle::Result FramebufferVk::clearBufferfi(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ GLfloat depth,
+ GLint stencil)
{
- UNIMPLEMENTED();
- return gl::InternalError();
+ ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
+ return angle::Result::Stop();
}
GLenum FramebufferVk::getImplementationColorReadFormat(const gl::Context *context) const
@@ -333,11 +333,11 @@
return GetReadAttachmentInfo(context, mRenderTargetCache.getColorRead(mState)).type;
}
-gl::Error FramebufferVk::readPixels(const gl::Context *context,
- const gl::Rectangle &area,
- GLenum format,
- GLenum type,
- void *pixels)
+angle::Result FramebufferVk::readPixels(const gl::Context *context,
+ const gl::Rectangle &area,
+ GLenum format,
+ GLenum type,
+ void *pixels)
{
// Clip read area to framebuffer.
const gl::Extents &fbSize = getState().getReadAttachment()->getSize();
@@ -349,7 +349,7 @@
if (!ClipRectangle(area, fbRect, &clippedArea))
{
// nothing to read
- return gl::NoError();
+ return angle::Result::Continue();
}
gl::Rectangle flippedArea = clippedArea;
if (contextVk->isViewportFlipEnabledForReadFBO())
@@ -386,7 +386,7 @@
getColorReadRenderTarget(),
static_cast<uint8_t *>(pixels) + outputSkipBytes));
mReadPixelBuffer.releaseRetainedBuffers(renderer);
- return gl::NoError();
+ return angle::Result::Continue();
}
RenderTargetVk *FramebufferVk::getDepthStencilRenderTarget() const
@@ -497,11 +497,11 @@
return angle::Result::Continue();
}
-gl::Error FramebufferVk::blit(const gl::Context *context,
- const gl::Rectangle &sourceArea,
- const gl::Rectangle &destArea,
- GLbitfield mask,
- GLenum filter)
+angle::Result FramebufferVk::blit(const gl::Context *context,
+ const gl::Rectangle &sourceArea,
+ const gl::Rectangle &destArea,
+ GLbitfield mask,
+ GLenum filter)
{
ContextVk *contextVk = vk::GetImpl(context);
RendererVk *renderer = contextVk->getRenderer();
@@ -524,12 +524,12 @@
const gl::Rectangle scissorRect = glState.getScissor();
if (!ClipRectangle(sourceArea, scissorRect, &readRect))
{
- return gl::NoError();
+ return angle::Result::Continue();
}
if (!ClipRectangle(destArea, scissorRect, &drawRect))
{
- return gl::NoError();
+ return angle::Result::Continue();
}
}
@@ -542,7 +542,7 @@
gl::Rectangle readRenderTargetRect;
if (!ClipToRenderTarget(readRect, readRenderTarget, &readRenderTargetRect))
{
- return gl::NoError();
+ return angle::Result::Continue();
}
for (size_t colorAttachment : mState.getEnabledDrawBuffers())
@@ -555,7 +555,7 @@
gl::Rectangle drawRenderTargetRect;
if (!ClipToRenderTarget(drawRect, drawRenderTarget, &drawRenderTargetRect))
{
- return gl::NoError();
+ return angle::Result::Continue();
}
ANGLE_TRY(blitWithCommand(contextVk, readRenderTargetRect, drawRenderTargetRect,
@@ -572,7 +572,7 @@
gl::Rectangle readRenderTargetRect;
if (!ClipToRenderTarget(readRect, readRenderTarget, &readRenderTargetRect))
{
- return gl::NoError();
+ return angle::Result::Continue();
}
RenderTargetVk *drawRenderTarget = mRenderTargetCache.getDepthStencil();
@@ -581,7 +581,7 @@
gl::Rectangle drawRenderTargetRect;
if (!ClipToRenderTarget(drawRect, drawRenderTarget, &drawRenderTargetRect))
{
- return gl::NoError();
+ return angle::Result::Continue();
}
ASSERT(readRenderTargetRect == drawRenderTargetRect);
@@ -619,7 +619,7 @@
}
}
- return gl::NoError();
+ return angle::Result::Continue();
}
angle::Result FramebufferVk::blitWithCommand(ContextVk *contextVk,
@@ -1064,12 +1064,12 @@
return angle::Result::Continue();
}
-gl::Error FramebufferVk::getSamplePosition(const gl::Context *context,
- size_t index,
- GLfloat *xy) const
+angle::Result FramebufferVk::getSamplePosition(const gl::Context *context,
+ size_t index,
+ GLfloat *xy) const
{
- UNIMPLEMENTED();
- return gl::InternalError() << "getSamplePosition is unimplemented.";
+ ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
+ return angle::Result::Stop();
}
angle::Result FramebufferVk::getCommandBufferForDraw(ContextVk *contextVk,
diff --git a/src/libANGLE/renderer/vulkan/FramebufferVk.h b/src/libANGLE/renderer/vulkan/FramebufferVk.h
index 627fb21..ca0fbdc 100644
--- a/src/libANGLE/renderer/vulkan/FramebufferVk.h
+++ b/src/libANGLE/renderer/vulkan/FramebufferVk.h
@@ -38,56 +38,58 @@
~FramebufferVk() override;
void destroy(const gl::Context *context) override;
- gl::Error discard(const gl::Context *context, size_t count, const GLenum *attachments) override;
- gl::Error invalidate(const gl::Context *context,
- size_t count,
- const GLenum *attachments) override;
- gl::Error invalidateSub(const gl::Context *context,
- size_t count,
- const GLenum *attachments,
- const gl::Rectangle &area) override;
+ angle::Result discard(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments) override;
+ angle::Result invalidate(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments) override;
+ angle::Result invalidateSub(const gl::Context *context,
+ size_t count,
+ const GLenum *attachments,
+ const gl::Rectangle &area) override;
- gl::Error clear(const gl::Context *context, GLbitfield mask) override;
- gl::Error clearBufferfv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLfloat *values) override;
- gl::Error clearBufferuiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLuint *values) override;
- gl::Error clearBufferiv(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- const GLint *values) override;
- gl::Error clearBufferfi(const gl::Context *context,
- GLenum buffer,
- GLint drawbuffer,
- GLfloat depth,
- GLint stencil) override;
+ angle::Result clear(const gl::Context *context, GLbitfield mask) override;
+ angle::Result clearBufferfv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLfloat *values) override;
+ angle::Result clearBufferuiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLuint *values) override;
+ angle::Result clearBufferiv(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ const GLint *values) override;
+ angle::Result clearBufferfi(const gl::Context *context,
+ GLenum buffer,
+ GLint drawbuffer,
+ GLfloat depth,
+ GLint stencil) override;
GLenum getImplementationColorReadFormat(const gl::Context *context) const override;
GLenum getImplementationColorReadType(const gl::Context *context) const override;
- gl::Error readPixels(const gl::Context *context,
- const gl::Rectangle &area,
- GLenum format,
- GLenum type,
- void *pixels) override;
+ angle::Result readPixels(const gl::Context *context,
+ const gl::Rectangle &area,
+ GLenum format,
+ GLenum type,
+ void *pixels) override;
- gl::Error blit(const gl::Context *context,
- const gl::Rectangle &sourceArea,
- const gl::Rectangle &destArea,
- GLbitfield mask,
- GLenum filter) override;
+ angle::Result blit(const gl::Context *context,
+ const gl::Rectangle &sourceArea,
+ const gl::Rectangle &destArea,
+ GLbitfield mask,
+ GLenum filter) override;
bool checkStatus(const gl::Context *context) const override;
angle::Result syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits) override;
- gl::Error getSamplePosition(const gl::Context *context,
- size_t index,
- GLfloat *xy) const override;
+ angle::Result getSamplePosition(const gl::Context *context,
+ size_t index,
+ GLfloat *xy) const override;
RenderTargetVk *getDepthStencilRenderTarget() const;
const vk::RenderPassDesc &getRenderPassDesc();