Henri Verbeet : wined3d: Explicitly handle 0 rt_count right at the start of context_apply_draw_buffers ().

Alexandre Julliard julliard at winehq.org
Mon Apr 11 13:29:27 CDT 2011


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Fri Apr  8 20:22:49 2011 +0200

wined3d: Explicitly handle 0 rt_count right at the start of context_apply_draw_buffers().

It's trivial, and allows the rest of the code to assume at least 1 render
target is present.

---

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

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 5b5ae5a..64380c8 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1915,7 +1915,14 @@ static struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, IWineD3DSur
 /* Context activation is done by the caller. */
 static void context_apply_draw_buffers(struct wined3d_context *context, UINT rt_count, IWineD3DSurfaceImpl **rts)
 {
-    if (rt_count && !surface_is_offscreen(rts[0]))
+    if (!rt_count)
+    {
+        ENTER_GL();
+        glDrawBuffer(GL_NONE);
+        checkGLcall("glDrawBuffer()");
+        LEAVE_GL();
+    }
+    else if (!surface_is_offscreen(rts[0]))
     {
         ENTER_GL();
         glDrawBuffer(surface_get_gl_buffer(rts[0]));
@@ -1951,7 +1958,7 @@ static void context_apply_draw_buffers(struct wined3d_context *context, UINT rt_
         }
         else
         {
-            glDrawBuffer(rt_count ? rts[0]->resource.device->offscreenBuffer : GL_NONE);
+            glDrawBuffer(rts[0]->resource.device->offscreenBuffer);
             checkGLcall("glDrawBuffer()");
         }
         LEAVE_GL();




More information about the wine-cvs mailing list