Commit 040c4db3 by jbauman@chromium.org

Cache currently-bound draw buffer.

Avoids a hash table lookup BUG= TEST=webgl conformance tests Review URL: http://codereview.appspot.com/5261042 git-svn-id: https://angleproject.googlecode.com/svn/trunk@794 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 54f59ef8
#define MAJOR_VERSION 0
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 793
#define BUILD_REVISION 794
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -976,7 +976,7 @@ Framebuffer *Context::getReadFramebuffer()
Framebuffer *Context::getDrawFramebuffer()
{
return getFramebuffer(mState.drawFramebuffer);
return mBoundDrawFramebuffer;
}
void Context::bindArrayBuffer(unsigned int buffer)
......@@ -1025,6 +1025,8 @@ void Context::bindDrawFramebuffer(GLuint framebuffer)
}
mState.drawFramebuffer = framebuffer;
mBoundDrawFramebuffer = getFramebuffer(framebuffer);
}
void Context::bindRenderbuffer(GLuint renderbuffer)
......@@ -1062,6 +1064,10 @@ void Context::setFramebufferZero(Framebuffer *buffer)
{
delete mFramebufferMap[0];
mFramebufferMap[0] = buffer;
if (mState.drawFramebuffer == 0)
{
mBoundDrawFramebuffer = buffer;
}
}
void Context::setRenderbufferStorage(RenderbufferStorage *renderbuffer)
......
......@@ -546,6 +546,7 @@ class Context
D3DSURFACE_DESC mRenderTargetDesc;
bool mDxUniformsDirty;
Program *mCachedCurrentProgram;
Framebuffer *mBoundDrawFramebuffer;
bool mSupportsShaderModel3;
bool mSupportsVertexTexture;
......
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