Matteo Bruni : wined3d: Avoid redundant glDrawBuffer() calls.

Alexandre Julliard julliard at winehq.org
Wed Apr 10 14:16:15 CDT 2013


Module: wine
Branch: master
Commit: 075fa6547c0edf2b1b2c1cabae7731fdc1308cc2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=075fa6547c0edf2b1b2c1cabae7731fdc1308cc2

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Wed Apr 10 01:35:42 2013 +0200

wined3d: Avoid redundant glDrawBuffer() calls.

---

 dlls/wined3d/context.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 90038ca..516e8c2 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1897,13 +1897,16 @@ static void context_apply_draw_buffers(struct wined3d_context *context, DWORD rt
 void context_set_draw_buffer(struct wined3d_context *context, GLenum buffer)
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
+    DWORD *current_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask;
+    DWORD new_mask = context_generate_rt_mask(buffer);
+
+    if (new_mask == *current_mask)
+        return;
 
     gl_info->gl_ops.gl.p_glDrawBuffer(buffer);
     checkGLcall("glDrawBuffer()");
-    if (context->current_fbo)
-        context->current_fbo->rt_mask = context_generate_rt_mask(buffer);
-    else
-        context->draw_buffers_mask = context_generate_rt_mask(buffer);
+
+    *current_mask = new_mask;
 }
 
 /* Context activation is done by the caller. */




More information about the wine-cvs mailing list