mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 11:26:10 +00:00
wined3d: Avoid redundant FBO binds.
Apparently this is an expensive operation for certain drivers, even if the binding doesn't actually change.
This commit is contained in:
parent
710f6f8456
commit
a80247f58b
2 changed files with 26 additions and 0 deletions
|
@ -64,6 +64,30 @@ void context_bind_fbo(struct WineD3DContext *context, GLenum target, GLuint *fbo
|
|||
f = *fbo;
|
||||
}
|
||||
|
||||
switch (target)
|
||||
{
|
||||
case GL_READ_FRAMEBUFFER_EXT:
|
||||
if (context->fbo_read_binding == f) return;
|
||||
context->fbo_read_binding = f;
|
||||
break;
|
||||
|
||||
case GL_DRAW_FRAMEBUFFER_EXT:
|
||||
if (context->fbo_draw_binding == f) return;
|
||||
context->fbo_draw_binding = f;
|
||||
break;
|
||||
|
||||
case GL_FRAMEBUFFER_EXT:
|
||||
if (context->fbo_read_binding == f
|
||||
&& context->fbo_draw_binding == f) return;
|
||||
context->fbo_read_binding = f;
|
||||
context->fbo_draw_binding = f;
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME("Unhandled target %#x.\n", target);
|
||||
break;
|
||||
}
|
||||
|
||||
GL_EXTCALL(glBindFramebufferEXT(target, f));
|
||||
checkGLcall("glBindFramebuffer()");
|
||||
}
|
||||
|
|
|
@ -1242,6 +1242,8 @@ struct WineD3DContext
|
|||
struct fbo_entry *current_fbo;
|
||||
GLuint src_fbo;
|
||||
GLuint dst_fbo;
|
||||
GLuint fbo_read_binding;
|
||||
GLuint fbo_draw_binding;
|
||||
|
||||
/* Extension emulation */
|
||||
GLint gl_fog_source;
|
||||
|
|
Loading…
Reference in a new issue