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
...@@ -2319,9 +2319,9 @@ constexpr const TVariable *p0N2B[2] = {&BuiltInVariable::kVar_pt0N, &BuiltInVa ...@@ -2319,9 +2319,9 @@ constexpr const TVariable *p0N2B[2] = {&BuiltInVariable::kVar_pt0N, &BuiltInVa
constexpr const TVariable *p0N3B[2] = {&BuiltInVariable::kVar_pt0N, &BuiltInVariable::kVar_pt3B}; constexpr const TVariable *p0N3B[2] = {&BuiltInVariable::kVar_pt0N, &BuiltInVariable::kVar_pt3B};
constexpr const TVariable *p0O1C0C[3] = {&BuiltInVariable::kVar_pt0O, &BuiltInVariable::kVar_pt1C, constexpr const TVariable *p0O1C0C[3] = {&BuiltInVariable::kVar_pt0O, &BuiltInVariable::kVar_pt1C,
&BuiltInVariable::kVar_pt0C}; &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}; &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, constexpr const TVariable *p0Q1B0B1C[4] = {&BuiltInVariable::kVar_pt0Q, &BuiltInVariable::kVar_pt1B,
&BuiltInVariable::kVar_pt0B, &BuiltInVariable::kVar_pt0B,
&BuiltInVariable::kVar_pt1C}; &BuiltInVariable::kVar_pt1C};
...@@ -2534,11 +2534,11 @@ constexpr const TVariable *p0e2B0B1C[4] = {&BuiltInVariable::kVar_pt0e, &BuiltIn ...@@ -2534,11 +2534,11 @@ constexpr const TVariable *p0e2B0B1C[4] = {&BuiltInVariable::kVar_pt0e, &BuiltIn
constexpr const TVariable *p0e3B1B1B1C[5] = { constexpr const TVariable *p0e3B1B1B1C[5] = {
&BuiltInVariable::kVar_pt0e, &BuiltInVariable::kVar_pt3B, &BuiltInVariable::kVar_pt1B, &BuiltInVariable::kVar_pt0e, &BuiltInVariable::kVar_pt3B, &BuiltInVariable::kVar_pt1B,
&BuiltInVariable::kVar_pt1B, &BuiltInVariable::kVar_pt1C}; &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}; &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}; &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}; &BuiltInVariable::kVar_pt3D};
constexpr const TVariable *p0i2C3B[3] = {&BuiltInVariable::kVar_pt0i, &BuiltInVariable::kVar_pt2C, constexpr const TVariable *p0i2C3B[3] = {&BuiltInVariable::kVar_pt0i, &BuiltInVariable::kVar_pt2C,
&BuiltInVariable::kVar_pt3B}; &BuiltInVariable::kVar_pt3B};
...@@ -2552,11 +2552,11 @@ constexpr const TVariable *p0m2C3C[3] = {&BuiltInVariable::kVar_pt0m, &BuiltInV ...@@ -2552,11 +2552,11 @@ constexpr const TVariable *p0m2C3C[3] = {&BuiltInVariable::kVar_pt0m, &BuiltInV
&BuiltInVariable::kVar_pt3C}; &BuiltInVariable::kVar_pt3C};
constexpr const TVariable *p0n2C3D[3] = {&BuiltInVariable::kVar_pt0n, &BuiltInVariable::kVar_pt2C, constexpr const TVariable *p0n2C3D[3] = {&BuiltInVariable::kVar_pt0n, &BuiltInVariable::kVar_pt2C,
&BuiltInVariable::kVar_pt3D}; &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}; &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}; &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}; &BuiltInVariable::kVar_pt3D};
constexpr const TVariable *p1B0B0B[3] = {&BuiltInVariable::kVar_pt1B, &BuiltInVariable::kVar_pt0B, constexpr const TVariable *p1B0B0B[3] = {&BuiltInVariable::kVar_pt1B, &BuiltInVariable::kVar_pt0B,
&BuiltInVariable::kVar_pt0B}; &BuiltInVariable::kVar_pt0B};
......
...@@ -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,47 +274,47 @@ class Framebuffer final : public angle::ObserverInterface, ...@@ -274,47 +274,47 @@ 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,
GLenum filter); GLenum filter);
bool isDefault() const; bool isDefault() const;
enum DirtyBitType : size_t enum DirtyBitType : size_t
...@@ -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,58 +33,58 @@ class FramebufferImpl : angle::NonCopyable ...@@ -33,58 +33,58 @@ 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,
GLint stencil) = 0; GLint stencil) = 0;
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,
GLenum filter) = 0; GLenum filter) = 0;
virtual bool checkStatus(const gl::Context *context) const = 0; virtual bool checkStatus(const gl::Context *context) const = 0;
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;
const gl::FramebufferState &getState() const { return mState; } const gl::FramebufferState &getState() const { return mState; }
......
...@@ -23,30 +23,30 @@ class MockFramebufferImpl : public rx::FramebufferImpl ...@@ -23,30 +23,30 @@ 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,
GLenum)); GLenum));
MOCK_CONST_METHOD1(checkStatus, bool(const gl::Context *)); MOCK_CONST_METHOD1(checkStatus, bool(const gl::Context *));
......
...@@ -101,16 +101,16 @@ FramebufferD3D::~FramebufferD3D() ...@@ -101,16 +101,16 @@ 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)
{ {
// glClearBufferfv can be called to clear the color buffer or depth buffer // glClearBufferfv can be called to clear the color buffer or depth buffer
ClearParameters clearParams = GetClearParameters(context->getGLState(), 0); ClearParameters clearParams = GetClearParameters(context->getGLState(), 0);
...@@ -134,10 +134,10 @@ gl::Error FramebufferD3D::clearBufferfv(const gl::Context *context, ...@@ -134,10 +134,10 @@ 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)
{ {
// glClearBufferuiv can only be called to clear a color buffer // glClearBufferuiv can only be called to clear a color buffer
ClearParameters clearParams = GetClearParameters(context->getGLState(), 0); ClearParameters clearParams = GetClearParameters(context->getGLState(), 0);
...@@ -151,10 +151,10 @@ gl::Error FramebufferD3D::clearBufferuiv(const gl::Context *context, ...@@ -151,10 +151,10 @@ 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)
{ {
// glClearBufferiv can be called to clear the color buffer or stencil buffer // glClearBufferiv can be called to clear the color buffer or stencil buffer
ClearParameters clearParams = GetClearParameters(context->getGLState(), 0); ClearParameters clearParams = GetClearParameters(context->getGLState(), 0);
...@@ -178,11 +178,11 @@ gl::Error FramebufferD3D::clearBufferiv(const gl::Context *context, ...@@ -178,11 +178,11 @@ 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,
GLint stencil) GLint stencil)
{ {
// glClearBufferfi can only be called to clear a depth stencil buffer // glClearBufferfi can only be called to clear a depth stencil buffer
ClearParameters clearParams = GetClearParameters(context->getGLState(), 0); ClearParameters clearParams = GetClearParameters(context->getGLState(), 0);
...@@ -240,20 +240,20 @@ GLenum FramebufferD3D::getImplementationColorReadType(const gl::Context *context ...@@ -240,20 +240,20 @@ 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)
{ {
// 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,24 +264,24 @@ gl::Error FramebufferD3D::readPixels(const gl::Context *context, ...@@ -264,24 +264,24 @@ 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,
GLenum filter) GLenum filter)
{ {
const auto &glState = context->getGLState(); const auto &glState = context->getGLState();
const gl::Framebuffer *sourceFramebuffer = glState.getReadFramebuffer(); const gl::Framebuffer *sourceFramebuffer = glState.getReadFramebuffer();
...@@ -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,38 +62,38 @@ class FramebufferD3D : public FramebufferImpl ...@@ -62,38 +62,38 @@ 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,
GLint stencil) override; GLint stencil) override;
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;
bool checkStatus(const gl::Context *context) const override; bool checkStatus(const gl::Context *context) const override;
......
...@@ -113,16 +113,16 @@ angle::Result Framebuffer11::clearImpl(const gl::Context *context, ...@@ -113,16 +113,16 @@ 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)
{ {
return invalidateBase(context, count, attachments, true); return invalidateBase(context, count, attachments, true);
} }
...@@ -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,16 +397,16 @@ angle::Result Framebuffer11::syncState(const gl::Context *context, ...@@ -397,16 +397,16 @@ 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
{ {
const gl::FramebufferAttachment *attachment = mState.getFirstNonNullAttachment(); const gl::FramebufferAttachment *attachment = mState.getFirstNonNullAttachment();
ASSERT(attachment); ASSERT(attachment);
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,14 +24,16 @@ class Framebuffer11 : public FramebufferD3D ...@@ -24,14 +24,16 @@ 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; angle::Result invalidate(const gl::Context *context,
gl::Error invalidateSub(const gl::Context *context, size_t count,
size_t count, const GLenum *attachments) override;
const GLenum *attachments, angle::Result invalidateSub(const gl::Context *context,
const gl::Rectangle &area) override; size_t count,
const GLenum *attachments,
const gl::Rectangle &area) override;
// Invalidate the cached swizzles of all bound texture attachments. // Invalidate the cached swizzles of all bound texture attachments.
angle::Result markAttachmentsDirty(const gl::Context *context) const; angle::Result markAttachmentsDirty(const gl::Context *context) const;
...@@ -50,9 +52,9 @@ class Framebuffer11 : public FramebufferD3D ...@@ -50,9 +52,9 @@ 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;
private: private:
angle::Result clearImpl(const gl::Context *context, angle::Result clearImpl(const gl::Context *context,
......
...@@ -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,18 +23,20 @@ class Framebuffer9 : public FramebufferD3D ...@@ -23,18 +23,20 @@ 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; angle::Result invalidate(const gl::Context *context,
gl::Error invalidateSub(const gl::Context *context, size_t count,
size_t count, const GLenum *attachments) override;
const GLenum *attachments, angle::Result invalidateSub(const gl::Context *context,
const gl::Rectangle &area) override; size_t count,
const GLenum *attachments,
gl::Error getSamplePosition(const gl::Context *context, const gl::Rectangle &area) override;
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, angle::Result syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits) override; const gl::Framebuffer::DirtyBits &dirtyBits) override;
......
...@@ -28,52 +28,54 @@ class FramebufferGL : public FramebufferImpl ...@@ -28,52 +28,54 @@ 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; angle::Result invalidate(const gl::Context *context,
gl::Error invalidateSub(const gl::Context *context, size_t count,
size_t count, const GLenum *attachments) override;
const GLenum *attachments, angle::Result invalidateSub(const gl::Context *context,
const gl::Rectangle &area) override; size_t count,
const GLenum *attachments,
gl::Error clear(const gl::Context *context, GLbitfield mask) override; const gl::Rectangle &area) override;
gl::Error clearBufferfv(const gl::Context *context,
GLenum buffer, angle::Result clear(const gl::Context *context, GLbitfield mask) override;
GLint drawbuffer, angle::Result clearBufferfv(const gl::Context *context,
const GLfloat *values) override; GLenum buffer,
gl::Error clearBufferuiv(const gl::Context *context, GLint drawbuffer,
GLenum buffer, const GLfloat *values) override;
GLint drawbuffer, angle::Result clearBufferuiv(const gl::Context *context,
const GLuint *values) override; GLenum buffer,
gl::Error clearBufferiv(const gl::Context *context, GLint drawbuffer,
GLenum buffer, const GLuint *values) override;
GLint drawbuffer, angle::Result clearBufferiv(const gl::Context *context,
const GLint *values) override; GLenum buffer,
gl::Error clearBufferfi(const gl::Context *context, GLint drawbuffer,
GLenum buffer, const GLint *values) override;
GLint drawbuffer, angle::Result clearBufferfi(const gl::Context *context,
GLfloat depth, GLenum buffer,
GLint stencil) override; GLint drawbuffer,
GLfloat depth,
GLint stencil) override;
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;
bool checkStatus(const gl::Context *context) const override; bool checkStatus(const gl::Context *context) 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,11 +112,11 @@ GLenum FramebufferNULL::getImplementationColorReadType(const gl::Context *contex ...@@ -112,11 +112,11 @@ 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,
void *ptrOrOffset) void *ptrOrOffset)
{ {
const gl::PixelPackState &packState = context->getGLState().getPackState(); const gl::PixelPackState &packState = context->getGLState().getPackState();
gl::Buffer *packBuffer = context->getGLState().getTargetBuffer(gl::BufferBinding::PixelPack); gl::Buffer *packBuffer = context->getGLState().getTargetBuffer(gl::BufferBinding::PixelPack);
...@@ -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,56 +21,58 @@ class FramebufferNULL : public FramebufferImpl ...@@ -21,56 +21,58 @@ 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; angle::Result invalidate(const gl::Context *context,
gl::Error invalidateSub(const gl::Context *context, size_t count,
size_t count, const GLenum *attachments) override;
const GLenum *attachments, angle::Result invalidateSub(const gl::Context *context,
const gl::Rectangle &area) override; size_t count,
const GLenum *attachments,
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,
GLint stencil) override; GLint stencil) override;
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;
bool checkStatus(const gl::Context *context) const override; bool checkStatus(const gl::Context *context) const override;
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;
}; };
} // namespace rx } // namespace rx
......
...@@ -38,56 +38,58 @@ class FramebufferVk : public FramebufferImpl ...@@ -38,56 +38,58 @@ 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; angle::Result invalidate(const gl::Context *context,
gl::Error invalidateSub(const gl::Context *context, size_t count,
size_t count, const GLenum *attachments) override;
const GLenum *attachments, angle::Result invalidateSub(const gl::Context *context,
const gl::Rectangle &area) override; size_t count,
const GLenum *attachments,
gl::Error clear(const gl::Context *context, GLbitfield mask) override; const gl::Rectangle &area) override;
gl::Error clearBufferfv(const gl::Context *context,
GLenum buffer, angle::Result clear(const gl::Context *context, GLbitfield mask) override;
GLint drawbuffer, angle::Result clearBufferfv(const gl::Context *context,
const GLfloat *values) override; GLenum buffer,
gl::Error clearBufferuiv(const gl::Context *context, GLint drawbuffer,
GLenum buffer, const GLfloat *values) override;
GLint drawbuffer, angle::Result clearBufferuiv(const gl::Context *context,
const GLuint *values) override; GLenum buffer,
gl::Error clearBufferiv(const gl::Context *context, GLint drawbuffer,
GLenum buffer, const GLuint *values) override;
GLint drawbuffer, angle::Result clearBufferiv(const gl::Context *context,
const GLint *values) override; GLenum buffer,
gl::Error clearBufferfi(const gl::Context *context, GLint drawbuffer,
GLenum buffer, const GLint *values) override;
GLint drawbuffer, angle::Result clearBufferfi(const gl::Context *context,
GLfloat depth, GLenum buffer,
GLint stencil) override; GLint drawbuffer,
GLfloat depth,
GLint stencil) override;
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;
bool checkStatus(const gl::Context *context) const override; bool checkStatus(const gl::Context *context) const override;
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;
const vk::RenderPassDesc &getRenderPassDesc(); const vk::RenderPassDesc &getRenderPassDesc();
......
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