[PATCH 1/5] wined3d: Move draw buffer setup code out of context_apply_fbo_entry().

Henri Verbeet hverbeet at codeweavers.com
Tue May 4 13:39:49 CDT 2010


---
 dlls/wined3d/context.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 4db678d..bc0f88d 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -403,7 +403,6 @@ static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context)
 static void context_apply_fbo_entry(struct wined3d_context *context, struct fbo_entry *entry)
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
-    IWineD3DDeviceImpl *device = context->swapchain->device;
     unsigned int i;
 
     context_bind_fbo(context, GL_FRAMEBUFFER, &entry->id);
@@ -436,14 +435,6 @@ static void context_apply_fbo_entry(struct wined3d_context *context, struct fbo_
         if (entry->depth_stencil)
             context_apply_attachment_filter_states(entry->depth_stencil);
     }
-
-    for (i = 0; i < gl_info->limits.buffers; ++i)
-    {
-        if (device->render_targets[i])
-            device->draw_buffers[i] = GL_COLOR_ATTACHMENT0 + i;
-        else
-            device->draw_buffers[i] = GL_NONE;
-    }
 }
 
 /* GL locking is done by the caller */
@@ -1883,6 +1874,16 @@ static void context_apply_draw_buffer(struct wined3d_context *context, BOOL blit
         {
             if (!blit)
             {
+                unsigned int i;
+
+                for (i = 0; i < gl_info->limits.buffers; ++i)
+                {
+                    if (device->render_targets[i])
+                        device->draw_buffers[i] = GL_COLOR_ATTACHMENT0 + i;
+                    else
+                        device->draw_buffers[i] = GL_NONE;
+                }
+
                 if (gl_info->supported[ARB_DRAW_BUFFERS])
                 {
                     GL_EXTCALL(glDrawBuffersARB(gl_info->limits.buffers, device->draw_buffers));
-- 
1.6.4.4




More information about the wine-patches mailing list