From e0c083d32b61b7a5bee9371bcf8a1b03964303a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Apr 2013 14:40:47 +0200
Subject: wined3d: Shadow device->offscreenBuffer in the context

Meh. Should probably go into the adapter, or non-fbo ORM should just die
TODO 2: See what this is actually used for.
---
 dlls/wined3d/context.c         | 2 ++
 dlls/wined3d/device.c          | 1 +
 dlls/wined3d/wined3d_private.h | 2 ++
 3 files changed, 5 insertions(+)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 7ba4086..fc66ff1 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1453,6 +1453,8 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
     ret->current_fb.rt_size = gl_info->limits.buffers;
     if (!ret->current_fb.render_targets)
         goto out;
+    if (device->context_count)
+        ret->offscreenBuffer = device->contexts[0]->offscreenBuffer;
 
     /* Initialize the texture unit mapping to a 1:1 mapping */
     for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 98c0717..ee8b418 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -948,6 +948,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
             }
         }
     }
+    device->contexts[0]->offscreenBuffer = device->offscreenBuffer;
 
     TRACE("All defaults now set up, leaving 3D init.\n");
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ba0ce26..a16909c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1232,6 +1232,8 @@ struct wined3d_context
     GLfloat                 fog_coord_value;
     GLfloat                 color[4], fogstart, fogend, fogcolor[4];
     GLuint                  dummy_arbfp_prog;
+
+    GLenum                  offscreenBuffer;
 };
 
 typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id);
-- 
2.1.3

