Commit 64b7c4ff by Jamie Madill Committed by Commit Bot

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/1280743Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 32643cea
...@@ -235,7 +235,7 @@ class Framebuffer final : public angle::ObserverInterface, ...@@ -235,7 +235,7 @@ class Framebuffer final : public angle::ObserverInterface,
// This method calls checkStatus. // This method calls checkStatus.
int getSamples(const Context *context); 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 getDefaultWidth() const;
GLint getDefaultHeight() const; GLint getDefaultHeight() const;
...@@ -274,43 +274,43 @@ class Framebuffer final : public angle::ObserverInterface, ...@@ -274,43 +274,43 @@ class Framebuffer final : public angle::ObserverInterface,
bool hasValidDepthStencil() const; bool hasValidDepthStencil() const;
Error discard(const Context *context, size_t count, const GLenum *attachments); angle::Result discard(const Context *context, size_t count, const GLenum *attachments);
Error invalidate(const Context *context, size_t count, const GLenum *attachments); angle::Result invalidate(const Context *context, size_t count, const GLenum *attachments);
Error invalidateSub(const Context *context, angle::Result invalidateSub(const Context *context,
size_t count, size_t count,
const GLenum *attachments, const GLenum *attachments,
const Rectangle &area); const Rectangle &area);
Error clear(const Context *context, GLbitfield mask); angle::Result clear(const Context *context, GLbitfield mask);
Error clearBufferfv(const Context *context, angle::Result clearBufferfv(const Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLfloat *values); const GLfloat *values);
Error clearBufferuiv(const Context *context, angle::Result clearBufferuiv(const Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLuint *values); const GLuint *values);
Error clearBufferiv(const Context *context, angle::Result clearBufferiv(const Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLint *values); const GLint *values);
Error clearBufferfi(const Context *context, angle::Result clearBufferfi(const Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
GLfloat depth, GLfloat depth,
GLint stencil); GLint stencil);
// These two methods call syncState() internally. // These two methods call syncState() internally.
Error getImplementationColorReadFormat(const Context *context, GLenum *formatOut); angle::Result getImplementationColorReadFormat(const Context *context, GLenum *formatOut);
Error getImplementationColorReadType(const Context *context, GLenum *typeOut); angle::Result getImplementationColorReadType(const Context *context, GLenum *typeOut);
Error readPixels(const Context *context, angle::Result readPixels(const Context *context,
const Rectangle &area, const Rectangle &area,
GLenum format, GLenum format,
GLenum type, GLenum type,
void *pixels); void *pixels);
Error blit(const Context *context, angle::Result blit(const Context *context,
const Rectangle &sourceArea, const Rectangle &sourceArea,
const Rectangle &destArea, const Rectangle &destArea,
GLbitfield mask, GLbitfield mask,
...@@ -350,12 +350,12 @@ class Framebuffer final : public angle::ObserverInterface, ...@@ -350,12 +350,12 @@ class Framebuffer final : public angle::ObserverInterface,
GLint copyTextureLevel, GLint copyTextureLevel,
GLint copyTextureLayer) const; GLint copyTextureLayer) const;
Error ensureClearAttachmentsInitialized(const Context *context, GLbitfield mask); angle::Result ensureClearAttachmentsInitialized(const Context *context, GLbitfield mask);
Error ensureClearBufferAttachmentsInitialized(const Context *context, angle::Result ensureClearBufferAttachmentsInitialized(const Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer); GLint drawbuffer);
angle::Result ensureDrawAttachmentsInitialized(const Context *context); angle::Result ensureDrawAttachmentsInitialized(const Context *context);
Error ensureReadAttachmentInitialized(const Context *context, GLbitfield blitMask); angle::Result ensureReadAttachmentInitialized(const Context *context, GLbitfield blitMask);
Box getDimensions() const; Box getDimensions() const;
private: private:
...@@ -404,7 +404,9 @@ class Framebuffer final : public angle::ObserverInterface, ...@@ -404,7 +404,9 @@ class Framebuffer final : public angle::ObserverInterface,
void markDrawAttachmentsInitialized(bool color, bool depth, bool stencil); void markDrawAttachmentsInitialized(bool color, bool depth, bool stencil);
void markBufferInitialized(GLenum bufferType, GLint bufferIndex); 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: // Checks that we have a partially masked clear:
// * some color channels are masked out // * some color channels are masked out
......
...@@ -33,31 +33,31 @@ class FramebufferImpl : angle::NonCopyable ...@@ -33,31 +33,31 @@ class FramebufferImpl : angle::NonCopyable
virtual ~FramebufferImpl() {} virtual ~FramebufferImpl() {}
virtual void destroy(const gl::Context *context) {} virtual void destroy(const gl::Context *context) {}
virtual gl::Error discard(const gl::Context *context, virtual angle::Result discard(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments) = 0; const GLenum *attachments) = 0;
virtual gl::Error invalidate(const gl::Context *context, virtual angle::Result invalidate(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments) = 0; const GLenum *attachments) = 0;
virtual gl::Error invalidateSub(const gl::Context *context, virtual angle::Result invalidateSub(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments, const GLenum *attachments,
const gl::Rectangle &area) = 0; const gl::Rectangle &area) = 0;
virtual gl::Error clear(const gl::Context *context, GLbitfield mask) = 0; virtual angle::Result clear(const gl::Context *context, GLbitfield mask) = 0;
virtual gl::Error clearBufferfv(const gl::Context *context, virtual angle::Result clearBufferfv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLfloat *values) = 0; const GLfloat *values) = 0;
virtual gl::Error clearBufferuiv(const gl::Context *context, virtual angle::Result clearBufferuiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLuint *values) = 0; const GLuint *values) = 0;
virtual gl::Error clearBufferiv(const gl::Context *context, virtual angle::Result clearBufferiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLint *values) = 0; const GLint *values) = 0;
virtual gl::Error clearBufferfi(const gl::Context *context, virtual angle::Result clearBufferfi(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
GLfloat depth, GLfloat depth,
...@@ -65,13 +65,13 @@ class FramebufferImpl : angle::NonCopyable ...@@ -65,13 +65,13 @@ class FramebufferImpl : angle::NonCopyable
virtual GLenum getImplementationColorReadFormat(const gl::Context *context) const = 0; virtual GLenum getImplementationColorReadFormat(const gl::Context *context) const = 0;
virtual GLenum getImplementationColorReadType(const gl::Context *context) const = 0; virtual GLenum getImplementationColorReadType(const gl::Context *context) const = 0;
virtual gl::Error readPixels(const gl::Context *context, virtual angle::Result readPixels(const gl::Context *context,
const gl::Rectangle &area, const gl::Rectangle &area,
GLenum format, GLenum format,
GLenum type, GLenum type,
void *pixels) = 0; void *pixels) = 0;
virtual gl::Error blit(const gl::Context *context, virtual angle::Result blit(const gl::Context *context,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
const gl::Rectangle &destArea, const gl::Rectangle &destArea,
GLbitfield mask, GLbitfield mask,
...@@ -82,7 +82,7 @@ class FramebufferImpl : angle::NonCopyable ...@@ -82,7 +82,7 @@ class FramebufferImpl : angle::NonCopyable
virtual angle::Result syncState(const gl::Context *context, virtual angle::Result syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits) = 0; const gl::Framebuffer::DirtyBits &dirtyBits) = 0;
virtual gl::Error getSamplePosition(const gl::Context *context, virtual angle::Result getSamplePosition(const gl::Context *context,
size_t index, size_t index,
GLfloat *xy) const = 0; GLfloat *xy) const = 0;
......
...@@ -23,26 +23,26 @@ class MockFramebufferImpl : public rx::FramebufferImpl ...@@ -23,26 +23,26 @@ class MockFramebufferImpl : public rx::FramebufferImpl
MockFramebufferImpl() : rx::FramebufferImpl(gl::FramebufferState()) {} MockFramebufferImpl() : rx::FramebufferImpl(gl::FramebufferState()) {}
virtual ~MockFramebufferImpl() { destructor(); } virtual ~MockFramebufferImpl() { destructor(); }
MOCK_METHOD3(discard, gl::Error(const gl::Context *, size_t, const GLenum *)); MOCK_METHOD3(discard, angle::Result(const gl::Context *, size_t, const GLenum *));
MOCK_METHOD3(invalidate, gl::Error(const gl::Context *, size_t, const GLenum *)); MOCK_METHOD3(invalidate, angle::Result(const gl::Context *, size_t, const GLenum *));
MOCK_METHOD4(invalidateSub, 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_METHOD2(clear, angle::Result(const gl::Context *, GLbitfield));
MOCK_METHOD4(clearBufferfv, gl::Error(const gl::Context *, GLenum, GLint, const GLfloat *)); MOCK_METHOD4(clearBufferfv, angle::Result(const gl::Context *, GLenum, GLint, const GLfloat *));
MOCK_METHOD4(clearBufferuiv, gl::Error(const gl::Context *, GLenum, GLint, const GLuint *)); MOCK_METHOD4(clearBufferuiv, angle::Result(const gl::Context *, GLenum, GLint, const GLuint *));
MOCK_METHOD4(clearBufferiv, gl::Error(const gl::Context *, GLenum, GLint, const GLint *)); MOCK_METHOD4(clearBufferiv, angle::Result(const gl::Context *, GLenum, GLint, const GLint *));
MOCK_METHOD5(clearBufferfi, gl::Error(const gl::Context *, GLenum, GLint, GLfloat, GLint)); MOCK_METHOD5(clearBufferfi, angle::Result(const gl::Context *, GLenum, GLint, GLfloat, GLint));
MOCK_CONST_METHOD1(getImplementationColorReadFormat, GLenum(const gl::Context *)); MOCK_CONST_METHOD1(getImplementationColorReadFormat, GLenum(const gl::Context *));
MOCK_CONST_METHOD1(getImplementationColorReadType, GLenum(const gl::Context *)); MOCK_CONST_METHOD1(getImplementationColorReadType, GLenum(const gl::Context *));
MOCK_METHOD5(readPixels, 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, MOCK_METHOD5(blit,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::Rectangle &, const gl::Rectangle &,
const gl::Rectangle &, const gl::Rectangle &,
GLbitfield, GLbitfield,
......
...@@ -101,13 +101,13 @@ FramebufferD3D::~FramebufferD3D() ...@@ -101,13 +101,13 @@ FramebufferD3D::~FramebufferD3D()
{ {
} }
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); ClearParameters clearParams = GetClearParameters(context->getGLState(), mask);
return clearImpl(context, clearParams); return clearImpl(context, clearParams);
} }
gl::Error FramebufferD3D::clearBufferfv(const gl::Context *context, angle::Result FramebufferD3D::clearBufferfv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLfloat *values) const GLfloat *values)
...@@ -134,7 +134,7 @@ gl::Error FramebufferD3D::clearBufferfv(const gl::Context *context, ...@@ -134,7 +134,7 @@ gl::Error FramebufferD3D::clearBufferfv(const gl::Context *context,
return clearImpl(context, clearParams); return clearImpl(context, clearParams);
} }
gl::Error FramebufferD3D::clearBufferuiv(const gl::Context *context, angle::Result FramebufferD3D::clearBufferuiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLuint *values) const GLuint *values)
...@@ -151,7 +151,7 @@ gl::Error FramebufferD3D::clearBufferuiv(const gl::Context *context, ...@@ -151,7 +151,7 @@ gl::Error FramebufferD3D::clearBufferuiv(const gl::Context *context,
return clearImpl(context, clearParams); return clearImpl(context, clearParams);
} }
gl::Error FramebufferD3D::clearBufferiv(const gl::Context *context, angle::Result FramebufferD3D::clearBufferiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLint *values) const GLint *values)
...@@ -178,7 +178,7 @@ gl::Error FramebufferD3D::clearBufferiv(const gl::Context *context, ...@@ -178,7 +178,7 @@ gl::Error FramebufferD3D::clearBufferiv(const gl::Context *context,
return clearImpl(context, clearParams); return clearImpl(context, clearParams);
} }
gl::Error FramebufferD3D::clearBufferfi(const gl::Context *context, angle::Result FramebufferD3D::clearBufferfi(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
GLfloat depth, GLfloat depth,
...@@ -240,8 +240,8 @@ GLenum FramebufferD3D::getImplementationColorReadType(const gl::Context *context ...@@ -240,8 +240,8 @@ GLenum FramebufferD3D::getImplementationColorReadType(const gl::Context *context
return implementationFormatInfo.getReadPixelsType(context->getClientVersion()); return implementationFormatInfo.getReadPixelsType(context->getClientVersion());
} }
gl::Error FramebufferD3D::readPixels(const gl::Context *context, angle::Result FramebufferD3D::readPixels(const gl::Context *context,
const gl::Rectangle &origArea, const gl::Rectangle &area,
GLenum format, GLenum format,
GLenum type, GLenum type,
void *pixels) void *pixels)
...@@ -249,11 +249,11 @@ gl::Error FramebufferD3D::readPixels(const gl::Context *context, ...@@ -249,11 +249,11 @@ gl::Error FramebufferD3D::readPixels(const gl::Context *context,
// Clip read area to framebuffer. // Clip read area to framebuffer.
const gl::Extents fbSize = getState().getReadAttachment()->getSize(); const gl::Extents fbSize = getState().getReadAttachment()->getSize();
const gl::Rectangle fbRect(0, 0, fbSize.width, fbSize.height); const gl::Rectangle fbRect(0, 0, fbSize.width, fbSize.height);
gl::Rectangle area; gl::Rectangle clippedArea;
if (!ClipRectangle(origArea, fbRect, &area)) if (!ClipRectangle(area, fbRect, &clippedArea))
{ {
// nothing to read // nothing to read
return gl::NoError(); return angle::Result::Continue();
} }
const gl::PixelPackState &packState = context->getGLState().getPackState(); const gl::PixelPackState &packState = context->getGLState().getPackState();
...@@ -264,20 +264,20 @@ gl::Error FramebufferD3D::readPixels(const gl::Context *context, ...@@ -264,20 +264,20 @@ gl::Error FramebufferD3D::readPixels(const gl::Context *context,
GLuint outputPitch = 0; GLuint outputPitch = 0;
ANGLE_CHECK_HR_MATH(contextD3D, ANGLE_CHECK_HR_MATH(contextD3D,
sizedFormatInfo.computeRowPitch(type, origArea.width, packState.alignment, sizedFormatInfo.computeRowPitch(type, area.width, packState.alignment,
packState.rowLength, &outputPitch)); packState.rowLength, &outputPitch));
GLuint outputSkipBytes = 0; GLuint outputSkipBytes = 0;
ANGLE_CHECK_HR_MATH(contextD3D, sizedFormatInfo.computeSkipBytes( ANGLE_CHECK_HR_MATH(contextD3D, sizedFormatInfo.computeSkipBytes(
type, outputPitch, 0, packState, false, &outputSkipBytes)); type, outputPitch, 0, packState, false, &outputSkipBytes));
outputSkipBytes += outputSkipBytes += (clippedArea.x - area.x) * sizedFormatInfo.pixelBytes +
(area.x - origArea.x) * sizedFormatInfo.pixelBytes + (area.y - origArea.y) * outputPitch; (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); static_cast<uint8_t *>(pixels) + outputSkipBytes);
} }
gl::Error FramebufferD3D::blit(const gl::Context *context, angle::Result FramebufferD3D::blit(const gl::Context *context,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
const gl::Rectangle &destArea, const gl::Rectangle &destArea,
GLbitfield mask, GLbitfield mask,
...@@ -290,7 +290,7 @@ gl::Error FramebufferD3D::blit(const gl::Context *context, ...@@ -290,7 +290,7 @@ gl::Error FramebufferD3D::blit(const gl::Context *context,
(mask & GL_DEPTH_BUFFER_BIT) != 0, (mask & GL_STENCIL_BUFFER_BIT) != 0, (mask & GL_DEPTH_BUFFER_BIT) != 0, (mask & GL_STENCIL_BUFFER_BIT) != 0,
filter, sourceFramebuffer)); filter, sourceFramebuffer));
return gl::NoError(); return angle::Result::Continue();
} }
bool FramebufferD3D::checkStatus(const gl::Context *context) const bool FramebufferD3D::checkStatus(const gl::Context *context) const
......
...@@ -62,20 +62,20 @@ class FramebufferD3D : public FramebufferImpl ...@@ -62,20 +62,20 @@ class FramebufferD3D : public FramebufferImpl
FramebufferD3D(const gl::FramebufferState &data, RendererD3D *renderer); FramebufferD3D(const gl::FramebufferState &data, RendererD3D *renderer);
~FramebufferD3D() override; ~FramebufferD3D() override;
gl::Error clear(const gl::Context *context, GLbitfield mask) override; angle::Result clear(const gl::Context *context, GLbitfield mask) override;
gl::Error clearBufferfv(const gl::Context *context, angle::Result clearBufferfv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLfloat *values) override; const GLfloat *values) override;
gl::Error clearBufferuiv(const gl::Context *context, angle::Result clearBufferuiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLuint *values) override; const GLuint *values) override;
gl::Error clearBufferiv(const gl::Context *context, angle::Result clearBufferiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLint *values) override; const GLint *values) override;
gl::Error clearBufferfi(const gl::Context *context, angle::Result clearBufferfi(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
GLfloat depth, GLfloat depth,
...@@ -83,13 +83,13 @@ class FramebufferD3D : public FramebufferImpl ...@@ -83,13 +83,13 @@ class FramebufferD3D : public FramebufferImpl
GLenum getImplementationColorReadFormat(const gl::Context *context) const override; GLenum getImplementationColorReadFormat(const gl::Context *context) const override;
GLenum getImplementationColorReadType(const gl::Context *context) const override; GLenum getImplementationColorReadType(const gl::Context *context) const override;
gl::Error readPixels(const gl::Context *context, angle::Result readPixels(const gl::Context *context,
const gl::Rectangle &area, const gl::Rectangle &area,
GLenum format, GLenum format,
GLenum type, GLenum type,
void *pixels) override; void *pixels) override;
gl::Error blit(const gl::Context *context, angle::Result blit(const gl::Context *context,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
const gl::Rectangle &destArea, const gl::Rectangle &destArea,
GLbitfield mask, GLbitfield mask,
......
...@@ -113,14 +113,14 @@ angle::Result Framebuffer11::clearImpl(const gl::Context *context, ...@@ -113,14 +113,14 @@ angle::Result Framebuffer11::clearImpl(const gl::Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error Framebuffer11::invalidate(const gl::Context *context, angle::Result Framebuffer11::invalidate(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments) const GLenum *attachments)
{ {
return invalidateBase(context, count, attachments, false); return invalidateBase(context, count, attachments, false);
} }
gl::Error Framebuffer11::discard(const gl::Context *context, angle::Result Framebuffer11::discard(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments) const GLenum *attachments)
{ {
...@@ -219,13 +219,13 @@ angle::Result Framebuffer11::invalidateBase(const gl::Context *context, ...@@ -219,13 +219,13 @@ angle::Result Framebuffer11::invalidateBase(const gl::Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error Framebuffer11::invalidateSub(const gl::Context *context, angle::Result Framebuffer11::invalidateSub(const gl::Context *context,
size_t, size_t count,
const GLenum *, const GLenum *attachments,
const gl::Rectangle &) const gl::Rectangle &area)
{ {
// A no-op implementation conforms to the spec, so don't call UNIMPLEMENTED() // 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, angle::Result Framebuffer11::invalidateAttachment(const gl::Context *context,
...@@ -397,7 +397,7 @@ angle::Result Framebuffer11::syncState(const gl::Context *context, ...@@ -397,7 +397,7 @@ angle::Result Framebuffer11::syncState(const gl::Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error Framebuffer11::getSamplePosition(const gl::Context *context, angle::Result Framebuffer11::getSamplePosition(const gl::Context *context,
size_t index, size_t index,
GLfloat *xy) const GLfloat *xy) const
{ {
...@@ -406,7 +406,7 @@ gl::Error Framebuffer11::getSamplePosition(const gl::Context *context, ...@@ -406,7 +406,7 @@ gl::Error Framebuffer11::getSamplePosition(const gl::Context *context,
GLsizei sampleCount = attachment->getSamples(); GLsizei sampleCount = attachment->getSamples();
d3d11_gl::GetSamplePosition(sampleCount, index, xy); d3d11_gl::GetSamplePosition(sampleCount, index, xy);
return gl::NoError(); return angle::Result::Continue();
} }
RenderTarget11 *Framebuffer11::getFirstRenderTarget() const RenderTarget11 *Framebuffer11::getFirstRenderTarget() const
......
...@@ -24,11 +24,13 @@ class Framebuffer11 : public FramebufferD3D ...@@ -24,11 +24,13 @@ class Framebuffer11 : public FramebufferD3D
Framebuffer11(const gl::FramebufferState &data, Renderer11 *renderer); Framebuffer11(const gl::FramebufferState &data, Renderer11 *renderer);
~Framebuffer11() override; ~Framebuffer11() override;
gl::Error discard(const gl::Context *context, size_t count, const GLenum *attachments) override; angle::Result discard(const gl::Context *context,
gl::Error invalidate(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments) override; const GLenum *attachments) override;
gl::Error invalidateSub(const gl::Context *context, angle::Result invalidate(const gl::Context *context,
size_t count,
const GLenum *attachments) override;
angle::Result invalidateSub(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments, const GLenum *attachments,
const gl::Rectangle &area) override; const gl::Rectangle &area) override;
...@@ -50,7 +52,7 @@ class Framebuffer11 : public FramebufferD3D ...@@ -50,7 +52,7 @@ class Framebuffer11 : public FramebufferD3D
RenderTarget11 *getFirstRenderTarget() const; RenderTarget11 *getFirstRenderTarget() const;
gl::Error getSamplePosition(const gl::Context *context, angle::Result getSamplePosition(const gl::Context *context,
size_t index, size_t index,
GLfloat *xy) const override; GLfloat *xy) const override;
......
...@@ -34,28 +34,29 @@ Framebuffer9::~Framebuffer9() ...@@ -34,28 +34,29 @@ Framebuffer9::~Framebuffer9()
{ {
} }
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 ANGLE_HR_UNREACHABLE(GetImplAs<Context9>(context));
UNREACHABLE(); return angle::Result::Stop();
return gl::NoError();
} }
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 ANGLE_HR_UNREACHABLE(GetImplAs<Context9>(context));
UNREACHABLE(); return angle::Result::Stop();
return gl::NoError();
} }
gl::Error Framebuffer9::invalidateSub(const gl::Context *context, angle::Result Framebuffer9::invalidateSub(const gl::Context *context,
size_t, size_t count,
const GLenum *, const GLenum *attachments,
const gl::Rectangle &) const gl::Rectangle &area)
{ {
// Shouldn't ever reach here in D3D9 ANGLE_HR_UNREACHABLE(GetImplAs<Context9>(context));
UNREACHABLE(); return angle::Result::Stop();
return gl::NoError();
} }
angle::Result Framebuffer9::clearImpl(const gl::Context *context, angle::Result Framebuffer9::clearImpl(const gl::Context *context,
...@@ -390,12 +391,12 @@ GLenum Framebuffer9::getRenderTargetImplementationFormat(RenderTargetD3D *render ...@@ -390,12 +391,12 @@ GLenum Framebuffer9::getRenderTargetImplementationFormat(RenderTargetD3D *render
return d3dFormatInfo.info().glInternalFormat; return d3dFormatInfo.info().glInternalFormat;
} }
gl::Error Framebuffer9::getSamplePosition(const gl::Context *context, angle::Result Framebuffer9::getSamplePosition(const gl::Context *context,
size_t index, size_t index,
GLfloat *xy) const GLfloat *xy) const
{ {
UNREACHABLE(); ANGLE_HR_UNREACHABLE(GetImplAs<Context9>(context));
return gl::InternalError() << "getSamplePosition is unsupported to d3d9."; return angle::Result::Stop();
} }
angle::Result Framebuffer9::syncState(const gl::Context *context, angle::Result Framebuffer9::syncState(const gl::Context *context,
......
...@@ -23,16 +23,18 @@ class Framebuffer9 : public FramebufferD3D ...@@ -23,16 +23,18 @@ class Framebuffer9 : public FramebufferD3D
Framebuffer9(const gl::FramebufferState &data, Renderer9 *renderer); Framebuffer9(const gl::FramebufferState &data, Renderer9 *renderer);
~Framebuffer9() override; ~Framebuffer9() override;
gl::Error discard(const gl::Context *context, size_t count, const GLenum *attachments) override; angle::Result discard(const gl::Context *context,
gl::Error invalidate(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments) override; const GLenum *attachments) override;
gl::Error invalidateSub(const gl::Context *context, angle::Result invalidate(const gl::Context *context,
size_t count,
const GLenum *attachments) override;
angle::Result invalidateSub(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments, const GLenum *attachments,
const gl::Rectangle &area) override; const gl::Rectangle &area) override;
gl::Error getSamplePosition(const gl::Context *context, angle::Result getSamplePosition(const gl::Context *context,
size_t index, size_t index,
GLfloat *xy) const override; GLfloat *xy) const override;
......
...@@ -28,29 +28,31 @@ class FramebufferGL : public FramebufferImpl ...@@ -28,29 +28,31 @@ class FramebufferGL : public FramebufferImpl
void destroy(const gl::Context *context) override; void destroy(const gl::Context *context) override;
gl::Error discard(const gl::Context *context, size_t count, const GLenum *attachments) override; angle::Result discard(const gl::Context *context,
gl::Error invalidate(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments) override; const GLenum *attachments) override;
gl::Error invalidateSub(const gl::Context *context, angle::Result invalidate(const gl::Context *context,
size_t count,
const GLenum *attachments) override;
angle::Result invalidateSub(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments, const GLenum *attachments,
const gl::Rectangle &area) override; const gl::Rectangle &area) override;
gl::Error clear(const gl::Context *context, GLbitfield mask) override; angle::Result clear(const gl::Context *context, GLbitfield mask) override;
gl::Error clearBufferfv(const gl::Context *context, angle::Result clearBufferfv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLfloat *values) override; const GLfloat *values) override;
gl::Error clearBufferuiv(const gl::Context *context, angle::Result clearBufferuiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLuint *values) override; const GLuint *values) override;
gl::Error clearBufferiv(const gl::Context *context, angle::Result clearBufferiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLint *values) override; const GLint *values) override;
gl::Error clearBufferfi(const gl::Context *context, angle::Result clearBufferfi(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
GLfloat depth, GLfloat depth,
...@@ -59,19 +61,19 @@ class FramebufferGL : public FramebufferImpl ...@@ -59,19 +61,19 @@ class FramebufferGL : public FramebufferImpl
GLenum getImplementationColorReadFormat(const gl::Context *context) const override; GLenum getImplementationColorReadFormat(const gl::Context *context) const override;
GLenum getImplementationColorReadType(const gl::Context *context) const override; GLenum getImplementationColorReadType(const gl::Context *context) const override;
gl::Error readPixels(const gl::Context *context, angle::Result readPixels(const gl::Context *context,
const gl::Rectangle &area, const gl::Rectangle &area,
GLenum format, GLenum format,
GLenum type, GLenum type,
void *pixels) override; void *pixels) override;
gl::Error blit(const gl::Context *context, angle::Result blit(const gl::Context *context,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
const gl::Rectangle &destArea, const gl::Rectangle &destArea,
GLbitfield mask, GLbitfield mask,
GLenum filter) override; GLenum filter) override;
gl::Error getSamplePosition(const gl::Context *context, angle::Result getSamplePosition(const gl::Context *context,
size_t index, size_t index,
GLfloat *xy) const override; GLfloat *xy) const override;
......
...@@ -26,64 +26,64 @@ FramebufferNULL::~FramebufferNULL() ...@@ -26,64 +26,64 @@ FramebufferNULL::~FramebufferNULL()
{ {
} }
gl::Error FramebufferNULL::discard(const gl::Context *context, angle::Result FramebufferNULL::discard(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments) const GLenum *attachments)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error FramebufferNULL::invalidate(const gl::Context *context, angle::Result FramebufferNULL::invalidate(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments) const GLenum *attachments)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error FramebufferNULL::invalidateSub(const gl::Context *context, angle::Result FramebufferNULL::invalidateSub(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments, const GLenum *attachments,
const gl::Rectangle &area) 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, angle::Result FramebufferNULL::clearBufferfv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLfloat *values) const GLfloat *values)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error FramebufferNULL::clearBufferuiv(const gl::Context *context, angle::Result FramebufferNULL::clearBufferuiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLuint *values) const GLuint *values)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error FramebufferNULL::clearBufferiv(const gl::Context *context, angle::Result FramebufferNULL::clearBufferiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLint *values) const GLint *values)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error FramebufferNULL::clearBufferfi(const gl::Context *context, angle::Result FramebufferNULL::clearBufferfi(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
GLfloat depth, GLfloat depth,
GLint stencil) GLint stencil)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
GLenum FramebufferNULL::getImplementationColorReadFormat(const gl::Context *context) const GLenum FramebufferNULL::getImplementationColorReadFormat(const gl::Context *context) const
...@@ -112,7 +112,7 @@ GLenum FramebufferNULL::getImplementationColorReadType(const gl::Context *contex ...@@ -112,7 +112,7 @@ GLenum FramebufferNULL::getImplementationColorReadType(const gl::Context *contex
return format.info->getReadPixelsType(context->getClientVersion()); return format.info->getReadPixelsType(context->getClientVersion());
} }
gl::Error FramebufferNULL::readPixels(const gl::Context *context, angle::Result FramebufferNULL::readPixels(const gl::Context *context,
const gl::Rectangle &origArea, const gl::Rectangle &origArea,
GLenum format, GLenum format,
GLenum type, GLenum type,
...@@ -141,7 +141,7 @@ gl::Error FramebufferNULL::readPixels(const gl::Context *context, ...@@ -141,7 +141,7 @@ gl::Error FramebufferNULL::readPixels(const gl::Context *context,
if (!ClipRectangle(origArea, fbRect, &area)) if (!ClipRectangle(origArea, fbRect, &area))
{ {
// nothing to read // nothing to read
return gl::NoError(); return angle::Result::Continue();
} }
// Compute size of unclipped rows and initial skip // Compute size of unclipped rows and initial skip
...@@ -171,16 +171,16 @@ gl::Error FramebufferNULL::readPixels(const gl::Context *context, ...@@ -171,16 +171,16 @@ gl::Error FramebufferNULL::readPixels(const gl::Context *context,
pixels += rowBytes; pixels += rowBytes;
} }
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error FramebufferNULL::blit(const gl::Context *context, angle::Result FramebufferNULL::blit(const gl::Context *context,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
const gl::Rectangle &destArea, const gl::Rectangle &destArea,
GLbitfield mask, GLbitfield mask,
GLenum filter) GLenum filter)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
bool FramebufferNULL::checkStatus(const gl::Context *context) const bool FramebufferNULL::checkStatus(const gl::Context *context) const
...@@ -194,11 +194,11 @@ angle::Result FramebufferNULL::syncState(const gl::Context *context, ...@@ -194,11 +194,11 @@ angle::Result FramebufferNULL::syncState(const gl::Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error FramebufferNULL::getSamplePosition(const gl::Context *context, angle::Result FramebufferNULL::getSamplePosition(const gl::Context *context,
size_t index, size_t index,
GLfloat *xy) const GLfloat *xy) const
{ {
return gl::NoError(); return angle::Result::Continue();
} }
} // namespace rx } // namespace rx
...@@ -21,29 +21,31 @@ class FramebufferNULL : public FramebufferImpl ...@@ -21,29 +21,31 @@ class FramebufferNULL : public FramebufferImpl
FramebufferNULL(const gl::FramebufferState &state); FramebufferNULL(const gl::FramebufferState &state);
~FramebufferNULL() override; ~FramebufferNULL() override;
gl::Error discard(const gl::Context *context, size_t count, const GLenum *attachments) override; angle::Result discard(const gl::Context *context,
gl::Error invalidate(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments) override; const GLenum *attachments) override;
gl::Error invalidateSub(const gl::Context *context, angle::Result invalidate(const gl::Context *context,
size_t count,
const GLenum *attachments) override;
angle::Result invalidateSub(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments, const GLenum *attachments,
const gl::Rectangle &area) override; const gl::Rectangle &area) override;
gl::Error clear(const gl::Context *context, GLbitfield mask) override; angle::Result clear(const gl::Context *context, GLbitfield mask) override;
gl::Error clearBufferfv(const gl::Context *context, angle::Result clearBufferfv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLfloat *values) override; const GLfloat *values) override;
gl::Error clearBufferuiv(const gl::Context *context, angle::Result clearBufferuiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLuint *values) override; const GLuint *values) override;
gl::Error clearBufferiv(const gl::Context *context, angle::Result clearBufferiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLint *values) override; const GLint *values) override;
gl::Error clearBufferfi(const gl::Context *context, angle::Result clearBufferfi(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
GLfloat depth, GLfloat depth,
...@@ -51,13 +53,13 @@ class FramebufferNULL : public FramebufferImpl ...@@ -51,13 +53,13 @@ class FramebufferNULL : public FramebufferImpl
GLenum getImplementationColorReadFormat(const gl::Context *context) const override; GLenum getImplementationColorReadFormat(const gl::Context *context) const override;
GLenum getImplementationColorReadType(const gl::Context *context) const override; GLenum getImplementationColorReadType(const gl::Context *context) const override;
gl::Error readPixels(const gl::Context *context, angle::Result readPixels(const gl::Context *context,
const gl::Rectangle &area, const gl::Rectangle &area,
GLenum format, GLenum format,
GLenum type, GLenum type,
void *pixels) override; void *pixels) override;
gl::Error blit(const gl::Context *context, angle::Result blit(const gl::Context *context,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
const gl::Rectangle &destArea, const gl::Rectangle &destArea,
GLbitfield mask, GLbitfield mask,
...@@ -68,7 +70,7 @@ class FramebufferNULL : public FramebufferImpl ...@@ -68,7 +70,7 @@ class FramebufferNULL : public FramebufferImpl
angle::Result syncState(const gl::Context *context, angle::Result syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits) override; const gl::Framebuffer::DirtyBits &dirtyBits) override;
gl::Error getSamplePosition(const gl::Context *context, angle::Result getSamplePosition(const gl::Context *context,
size_t index, size_t index,
GLfloat *xy) const override; GLfloat *xy) const override;
}; };
......
...@@ -142,32 +142,32 @@ void FramebufferVk::destroy(const gl::Context *context) ...@@ -142,32 +142,32 @@ void FramebufferVk::destroy(const gl::Context *context)
mBlitPixelBuffer.destroy(contextVk->getDevice()); mBlitPixelBuffer.destroy(contextVk->getDevice());
} }
gl::Error FramebufferVk::discard(const gl::Context *context, angle::Result FramebufferVk::discard(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments) const GLenum *attachments)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
return gl::InternalError(); return angle::Result::Stop();
} }
gl::Error FramebufferVk::invalidate(const gl::Context *context, angle::Result FramebufferVk::invalidate(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments) const GLenum *attachments)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
return gl::InternalError(); return angle::Result::Stop();
} }
gl::Error FramebufferVk::invalidateSub(const gl::Context *context, angle::Result FramebufferVk::invalidateSub(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments, const GLenum *attachments,
const gl::Rectangle &area) const gl::Rectangle &area)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
return gl::InternalError(); 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); ContextVk *contextVk = vk::GetImpl(context);
...@@ -207,7 +207,7 @@ gl::Error FramebufferVk::clear(const gl::Context *context, GLbitfield mask) ...@@ -207,7 +207,7 @@ gl::Error FramebufferVk::clear(const gl::Context *context, GLbitfield mask)
// TODO(jmadill): Masked stencil clear. http://anglebug.com/2540 // TODO(jmadill): Masked stencil clear. http://anglebug.com/2540
ANGLE_TRY(clearWithClearAttachments(contextVk, false, clearDepth, clearStencil)); 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 // If we clear the depth OR the stencil but not both, and we have a packed depth stencil
...@@ -226,7 +226,7 @@ gl::Error FramebufferVk::clear(const gl::Context *context, GLbitfield mask) ...@@ -226,7 +226,7 @@ gl::Error FramebufferVk::clear(const gl::Context *context, GLbitfield mask)
// Masked stencil clears are currently not implemented. // Masked stencil clears are currently not implemented.
// TODO(jmadill): Masked stencil clear. http://anglebug.com/2540 // TODO(jmadill): Masked stencil clear. http://anglebug.com/2540
ANGLE_TRY(clearWithClearAttachments(contextVk, clearColor, clearDepth, clearStencil)); ANGLE_TRY(clearWithClearAttachments(contextVk, clearColor, clearDepth, clearStencil));
return gl::NoError(); return angle::Result::Continue();
} }
// Standard Depth/stencil clear without scissor. // Standard Depth/stencil clear without scissor.
...@@ -247,7 +247,7 @@ gl::Error FramebufferVk::clear(const gl::Context *context, GLbitfield mask) ...@@ -247,7 +247,7 @@ gl::Error FramebufferVk::clear(const gl::Context *context, GLbitfield mask)
if (!clearColor) if (!clearColor)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
const auto *attachment = mState.getFirstNonNullAttachment(); const auto *attachment = mState.getFirstNonNullAttachment();
...@@ -283,44 +283,44 @@ gl::Error FramebufferVk::clear(const gl::Context *context, GLbitfield mask) ...@@ -283,44 +283,44 @@ gl::Error FramebufferVk::clear(const gl::Context *context, GLbitfield mask)
colorRenderTarget->getLayerIndex(), 1, commandBuffer); colorRenderTarget->getLayerIndex(), 1, commandBuffer);
} }
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error FramebufferVk::clearBufferfv(const gl::Context *context, angle::Result FramebufferVk::clearBufferfv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLfloat *values) const GLfloat *values)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
return gl::InternalError(); return angle::Result::Stop();
} }
gl::Error FramebufferVk::clearBufferuiv(const gl::Context *context, angle::Result FramebufferVk::clearBufferuiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLuint *values) const GLuint *values)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
return gl::InternalError(); return angle::Result::Stop();
} }
gl::Error FramebufferVk::clearBufferiv(const gl::Context *context, angle::Result FramebufferVk::clearBufferiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLint *values) const GLint *values)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
return gl::InternalError(); return angle::Result::Stop();
} }
gl::Error FramebufferVk::clearBufferfi(const gl::Context *context, angle::Result FramebufferVk::clearBufferfi(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
GLfloat depth, GLfloat depth,
GLint stencil) GLint stencil)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
return gl::InternalError(); return angle::Result::Stop();
} }
GLenum FramebufferVk::getImplementationColorReadFormat(const gl::Context *context) const GLenum FramebufferVk::getImplementationColorReadFormat(const gl::Context *context) const
...@@ -333,7 +333,7 @@ GLenum FramebufferVk::getImplementationColorReadType(const gl::Context *context) ...@@ -333,7 +333,7 @@ GLenum FramebufferVk::getImplementationColorReadType(const gl::Context *context)
return GetReadAttachmentInfo(context, mRenderTargetCache.getColorRead(mState)).type; return GetReadAttachmentInfo(context, mRenderTargetCache.getColorRead(mState)).type;
} }
gl::Error FramebufferVk::readPixels(const gl::Context *context, angle::Result FramebufferVk::readPixels(const gl::Context *context,
const gl::Rectangle &area, const gl::Rectangle &area,
GLenum format, GLenum format,
GLenum type, GLenum type,
...@@ -349,7 +349,7 @@ gl::Error FramebufferVk::readPixels(const gl::Context *context, ...@@ -349,7 +349,7 @@ gl::Error FramebufferVk::readPixels(const gl::Context *context,
if (!ClipRectangle(area, fbRect, &clippedArea)) if (!ClipRectangle(area, fbRect, &clippedArea))
{ {
// nothing to read // nothing to read
return gl::NoError(); return angle::Result::Continue();
} }
gl::Rectangle flippedArea = clippedArea; gl::Rectangle flippedArea = clippedArea;
if (contextVk->isViewportFlipEnabledForReadFBO()) if (contextVk->isViewportFlipEnabledForReadFBO())
...@@ -386,7 +386,7 @@ gl::Error FramebufferVk::readPixels(const gl::Context *context, ...@@ -386,7 +386,7 @@ gl::Error FramebufferVk::readPixels(const gl::Context *context,
getColorReadRenderTarget(), getColorReadRenderTarget(),
static_cast<uint8_t *>(pixels) + outputSkipBytes)); static_cast<uint8_t *>(pixels) + outputSkipBytes));
mReadPixelBuffer.releaseRetainedBuffers(renderer); mReadPixelBuffer.releaseRetainedBuffers(renderer);
return gl::NoError(); return angle::Result::Continue();
} }
RenderTargetVk *FramebufferVk::getDepthStencilRenderTarget() const RenderTargetVk *FramebufferVk::getDepthStencilRenderTarget() const
...@@ -497,7 +497,7 @@ angle::Result FramebufferVk::blitWithReadback(ContextVk *contextVk, ...@@ -497,7 +497,7 @@ angle::Result FramebufferVk::blitWithReadback(ContextVk *contextVk,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error FramebufferVk::blit(const gl::Context *context, angle::Result FramebufferVk::blit(const gl::Context *context,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
const gl::Rectangle &destArea, const gl::Rectangle &destArea,
GLbitfield mask, GLbitfield mask,
...@@ -524,12 +524,12 @@ gl::Error FramebufferVk::blit(const gl::Context *context, ...@@ -524,12 +524,12 @@ gl::Error FramebufferVk::blit(const gl::Context *context,
const gl::Rectangle scissorRect = glState.getScissor(); const gl::Rectangle scissorRect = glState.getScissor();
if (!ClipRectangle(sourceArea, scissorRect, &readRect)) if (!ClipRectangle(sourceArea, scissorRect, &readRect))
{ {
return gl::NoError(); return angle::Result::Continue();
} }
if (!ClipRectangle(destArea, scissorRect, &drawRect)) if (!ClipRectangle(destArea, scissorRect, &drawRect))
{ {
return gl::NoError(); return angle::Result::Continue();
} }
} }
...@@ -542,7 +542,7 @@ gl::Error FramebufferVk::blit(const gl::Context *context, ...@@ -542,7 +542,7 @@ gl::Error FramebufferVk::blit(const gl::Context *context,
gl::Rectangle readRenderTargetRect; gl::Rectangle readRenderTargetRect;
if (!ClipToRenderTarget(readRect, readRenderTarget, &readRenderTargetRect)) if (!ClipToRenderTarget(readRect, readRenderTarget, &readRenderTargetRect))
{ {
return gl::NoError(); return angle::Result::Continue();
} }
for (size_t colorAttachment : mState.getEnabledDrawBuffers()) for (size_t colorAttachment : mState.getEnabledDrawBuffers())
...@@ -555,7 +555,7 @@ gl::Error FramebufferVk::blit(const gl::Context *context, ...@@ -555,7 +555,7 @@ gl::Error FramebufferVk::blit(const gl::Context *context,
gl::Rectangle drawRenderTargetRect; gl::Rectangle drawRenderTargetRect;
if (!ClipToRenderTarget(drawRect, drawRenderTarget, &drawRenderTargetRect)) if (!ClipToRenderTarget(drawRect, drawRenderTarget, &drawRenderTargetRect))
{ {
return gl::NoError(); return angle::Result::Continue();
} }
ANGLE_TRY(blitWithCommand(contextVk, readRenderTargetRect, drawRenderTargetRect, ANGLE_TRY(blitWithCommand(contextVk, readRenderTargetRect, drawRenderTargetRect,
...@@ -572,7 +572,7 @@ gl::Error FramebufferVk::blit(const gl::Context *context, ...@@ -572,7 +572,7 @@ gl::Error FramebufferVk::blit(const gl::Context *context,
gl::Rectangle readRenderTargetRect; gl::Rectangle readRenderTargetRect;
if (!ClipToRenderTarget(readRect, readRenderTarget, &readRenderTargetRect)) if (!ClipToRenderTarget(readRect, readRenderTarget, &readRenderTargetRect))
{ {
return gl::NoError(); return angle::Result::Continue();
} }
RenderTargetVk *drawRenderTarget = mRenderTargetCache.getDepthStencil(); RenderTargetVk *drawRenderTarget = mRenderTargetCache.getDepthStencil();
...@@ -581,7 +581,7 @@ gl::Error FramebufferVk::blit(const gl::Context *context, ...@@ -581,7 +581,7 @@ gl::Error FramebufferVk::blit(const gl::Context *context,
gl::Rectangle drawRenderTargetRect; gl::Rectangle drawRenderTargetRect;
if (!ClipToRenderTarget(drawRect, drawRenderTarget, &drawRenderTargetRect)) if (!ClipToRenderTarget(drawRect, drawRenderTarget, &drawRenderTargetRect))
{ {
return gl::NoError(); return angle::Result::Continue();
} }
ASSERT(readRenderTargetRect == drawRenderTargetRect); ASSERT(readRenderTargetRect == drawRenderTargetRect);
...@@ -619,7 +619,7 @@ gl::Error FramebufferVk::blit(const gl::Context *context, ...@@ -619,7 +619,7 @@ gl::Error FramebufferVk::blit(const gl::Context *context,
} }
} }
return gl::NoError(); return angle::Result::Continue();
} }
angle::Result FramebufferVk::blitWithCommand(ContextVk *contextVk, angle::Result FramebufferVk::blitWithCommand(ContextVk *contextVk,
...@@ -1064,12 +1064,12 @@ angle::Result FramebufferVk::clearWithDraw(ContextVk *contextVk, ...@@ -1064,12 +1064,12 @@ angle::Result FramebufferVk::clearWithDraw(ContextVk *contextVk,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error FramebufferVk::getSamplePosition(const gl::Context *context, angle::Result FramebufferVk::getSamplePosition(const gl::Context *context,
size_t index, size_t index,
GLfloat *xy) const GLfloat *xy) const
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
return gl::InternalError() << "getSamplePosition is unimplemented."; return angle::Result::Stop();
} }
angle::Result FramebufferVk::getCommandBufferForDraw(ContextVk *contextVk, angle::Result FramebufferVk::getCommandBufferForDraw(ContextVk *contextVk,
......
...@@ -38,29 +38,31 @@ class FramebufferVk : public FramebufferImpl ...@@ -38,29 +38,31 @@ class FramebufferVk : public FramebufferImpl
~FramebufferVk() override; ~FramebufferVk() override;
void destroy(const gl::Context *context) override; void destroy(const gl::Context *context) override;
gl::Error discard(const gl::Context *context, size_t count, const GLenum *attachments) override; angle::Result discard(const gl::Context *context,
gl::Error invalidate(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments) override; const GLenum *attachments) override;
gl::Error invalidateSub(const gl::Context *context, angle::Result invalidate(const gl::Context *context,
size_t count,
const GLenum *attachments) override;
angle::Result invalidateSub(const gl::Context *context,
size_t count, size_t count,
const GLenum *attachments, const GLenum *attachments,
const gl::Rectangle &area) override; const gl::Rectangle &area) override;
gl::Error clear(const gl::Context *context, GLbitfield mask) override; angle::Result clear(const gl::Context *context, GLbitfield mask) override;
gl::Error clearBufferfv(const gl::Context *context, angle::Result clearBufferfv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLfloat *values) override; const GLfloat *values) override;
gl::Error clearBufferuiv(const gl::Context *context, angle::Result clearBufferuiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLuint *values) override; const GLuint *values) override;
gl::Error clearBufferiv(const gl::Context *context, angle::Result clearBufferiv(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
const GLint *values) override; const GLint *values) override;
gl::Error clearBufferfi(const gl::Context *context, angle::Result clearBufferfi(const gl::Context *context,
GLenum buffer, GLenum buffer,
GLint drawbuffer, GLint drawbuffer,
GLfloat depth, GLfloat depth,
...@@ -68,13 +70,13 @@ class FramebufferVk : public FramebufferImpl ...@@ -68,13 +70,13 @@ class FramebufferVk : public FramebufferImpl
GLenum getImplementationColorReadFormat(const gl::Context *context) const override; GLenum getImplementationColorReadFormat(const gl::Context *context) const override;
GLenum getImplementationColorReadType(const gl::Context *context) const override; GLenum getImplementationColorReadType(const gl::Context *context) const override;
gl::Error readPixels(const gl::Context *context, angle::Result readPixels(const gl::Context *context,
const gl::Rectangle &area, const gl::Rectangle &area,
GLenum format, GLenum format,
GLenum type, GLenum type,
void *pixels) override; void *pixels) override;
gl::Error blit(const gl::Context *context, angle::Result blit(const gl::Context *context,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
const gl::Rectangle &destArea, const gl::Rectangle &destArea,
GLbitfield mask, GLbitfield mask,
...@@ -85,7 +87,7 @@ class FramebufferVk : public FramebufferImpl ...@@ -85,7 +87,7 @@ class FramebufferVk : public FramebufferImpl
angle::Result syncState(const gl::Context *context, angle::Result syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits) override; const gl::Framebuffer::DirtyBits &dirtyBits) override;
gl::Error getSamplePosition(const gl::Context *context, angle::Result getSamplePosition(const gl::Context *context,
size_t index, size_t index,
GLfloat *xy) const override; GLfloat *xy) const override;
RenderTargetVk *getDepthStencilRenderTarget() const; RenderTargetVk *getDepthStencilRenderTarget() const;
......
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