Commit 2d96b9eb by Jamie Madill

Use GL-like methods for InvalidateFramebuffer calls.

This will faciliate the MANGLE implementation. BUG=angle:732 Change-Id: I0e4d569667e03305c9cca8d7c23154c70fb71eeb Reviewed-on: https://chromium-review.googlesource.com/213854Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org>
parent 400a4418
...@@ -2279,29 +2279,6 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1 ...@@ -2279,29 +2279,6 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
} }
} }
void Context::invalidateFrameBuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments,
GLint x, GLint y, GLsizei width, GLsizei height)
{
Framebuffer *framebuffer = NULL;
switch (target)
{
case GL_FRAMEBUFFER:
case GL_DRAW_FRAMEBUFFER:
framebuffer = mState.getDrawFramebuffer();
break;
case GL_READ_FRAMEBUFFER:
framebuffer = mState.getReadFramebuffer();
break;
default:
UNREACHABLE();
}
if (framebuffer && framebuffer->completeness() == GL_FRAMEBUFFER_COMPLETE)
{
framebuffer->invalidate(numAttachments, attachments, x, y, width, height);
}
}
void Context::releaseShaderCompiler() void Context::releaseShaderCompiler()
{ {
mRenderer->releaseShaderCompiler(); mRenderer->releaseShaderCompiler();
......
...@@ -221,9 +221,6 @@ class Context ...@@ -221,9 +221,6 @@ class Context
void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter); GLbitfield mask, GLenum filter);
void invalidateFrameBuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments,
GLint x, GLint y, GLsizei width, GLsizei height);
rx::Renderer *getRenderer() { return mRenderer; } rx::Renderer *getRenderer() { return mRenderer; }
State &getState() { return mState; } State &getState() { return mState; }
......
...@@ -561,7 +561,13 @@ GLenum Framebuffer::completeness() const ...@@ -561,7 +561,13 @@ GLenum Framebuffer::completeness() const
return GL_FRAMEBUFFER_COMPLETE; return GL_FRAMEBUFFER_COMPLETE;
} }
void Framebuffer::invalidate(GLsizei numAttachments, const GLenum* attachments, void Framebuffer::invalidate(const Caps &caps, GLsizei numAttachments, const GLenum *attachments)
{
GLuint maxDimension = caps.maxRenderbufferSize;
invalidateSub(caps, numAttachments, attachments, 0, 0, maxDimension, maxDimension);
}
void Framebuffer::invalidateSub(const Caps &caps, GLsizei numAttachments, const GLenum *attachments,
GLint x, GLint y, GLsizei width, GLsizei height) GLint x, GLint y, GLsizei width, GLsizei height)
{ {
ASSERT(completeness() == GL_FRAMEBUFFER_COMPLETE); ASSERT(completeness() == GL_FRAMEBUFFER_COMPLETE);
...@@ -618,8 +624,6 @@ void Framebuffer::invalidate(GLsizei numAttachments, const GLenum* attachments, ...@@ -618,8 +624,6 @@ void Framebuffer::invalidate(GLsizei numAttachments, const GLenum* attachments,
} }
} }
DefaultFramebuffer::DefaultFramebuffer(rx::Renderer *renderer, Colorbuffer *colorbuffer, DepthStencilbuffer *depthStencil) DefaultFramebuffer::DefaultFramebuffer(rx::Renderer *renderer, Colorbuffer *colorbuffer, DepthStencilbuffer *depthStencil)
: Framebuffer(renderer, 0) : Framebuffer(renderer, 0)
{ {
......
...@@ -26,6 +26,7 @@ class Colorbuffer; ...@@ -26,6 +26,7 @@ class Colorbuffer;
class Depthbuffer; class Depthbuffer;
class Stencilbuffer; class Stencilbuffer;
class DepthStencilbuffer; class DepthStencilbuffer;
struct Caps;
class Framebuffer class Framebuffer
{ {
...@@ -67,7 +68,8 @@ class Framebuffer ...@@ -67,7 +68,8 @@ class Framebuffer
virtual GLenum completeness() const; virtual GLenum completeness() const;
bool hasValidDepthStencil() const; bool hasValidDepthStencil() const;
void invalidate(GLsizei numAttachments, const GLenum* attachments, void invalidate(const Caps &caps, GLsizei numAttachments, const GLenum *attachments);
void invalidateSub(const Caps &caps, GLsizei numAttachments, const GLenum *attachments,
GLint x, GLint y, GLsizei width, GLsizei height); GLint x, GLint y, GLsizei width, GLsizei height);
protected: protected:
......
...@@ -7990,8 +7990,11 @@ void __stdcall glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, co ...@@ -7990,8 +7990,11 @@ void __stdcall glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, co
return; return;
} }
GLuint maxDimension = context->getCaps().maxRenderbufferSize; gl::Framebuffer *framebuffer = context->getState().getTargetFramebuffer(target);
context->invalidateFrameBuffer(target, numAttachments, attachments, 0, 0, maxDimension, maxDimension); if (framebuffer && framebuffer->completeness() == GL_FRAMEBUFFER_COMPLETE)
{
framebuffer->invalidate(context->getCaps(), numAttachments, attachments);
}
} }
} }
...@@ -8015,7 +8018,11 @@ void __stdcall glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, ...@@ -8015,7 +8018,11 @@ void __stdcall glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments,
return; return;
} }
context->invalidateFrameBuffer(target, numAttachments, attachments, x, y, width, height); gl::Framebuffer *framebuffer = context->getState().getTargetFramebuffer(target);
if (framebuffer && framebuffer->completeness() == GL_FRAMEBUFFER_COMPLETE)
{
framebuffer->invalidateSub(context->getCaps(), numAttachments, attachments, x, y, width, height);
}
} }
} }
......
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