Rebase against c2dc6f3ef26fb18e7766956ef0a8cbadccc364d6.

This commit is contained in:
Sebastian Lackner
2015-10-13 19:14:09 +02:00
parent e3ea1eef0d
commit 317fa9382c
179 changed files with 672 additions and 784 deletions

View File

@@ -1,79 +0,0 @@
From d802d551603f20fde872cf45d43064426bea4434 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 19:10:18 +0100
Subject: wined3d: Pass a context to surface_load_sysmem.
---
dlls/wined3d/surface.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index d9b1846..3877139 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4010,9 +4010,12 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
memcpy(dst.addr, src.addr, size);
}
+/* Context activation is done by the caller. */
static void surface_load_sysmem(struct wined3d_surface *surface,
- const struct wined3d_gl_info *gl_info, DWORD dst_location)
+ struct wined3d_context *context, DWORD dst_location)
{
+ const struct wined3d_gl_info *gl_info = context->gl_info;
+
if (surface->locations & surface_simple_locations)
{
surface_copy_simple_location(surface, dst_location);
@@ -4025,18 +4028,10 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
/* Download the surface to system memory. */
if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
{
- struct wined3d_device *device = surface->resource.device;
- struct wined3d_context *context;
-
- /* TODO: Use already acquired context when possible. */
- context = context_acquire(device, NULL);
-
wined3d_texture_bind_and_dirtify(surface->container, context,
!(surface->locations & WINED3D_LOCATION_TEXTURE_RGB));
surface_download_data(surface, gl_info, dst_location);
- context_release(context);
-
return;
}
@@ -4266,6 +4261,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
struct wined3d_device *device = surface->resource.device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
HRESULT hr;
+ struct wined3d_context *context = NULL;
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@@ -4274,7 +4270,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
if (location == WINED3D_LOCATION_TEXTURE_RGB
&& surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
{
- struct wined3d_context *context = context_acquire(device, NULL);
+ context = context_acquire(device, NULL);
surface_load_ds_location(surface, context, location);
context_release(context);
return WINED3D_OK;
@@ -4320,7 +4316,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
case WINED3D_LOCATION_USER_MEMORY:
case WINED3D_LOCATION_SYSMEM:
case WINED3D_LOCATION_BUFFER:
- surface_load_sysmem(surface, gl_info, location);
+ if (device->d3d_initialized)
+ context = context_acquire(device, NULL);
+ surface_load_sysmem(surface, context, location);
+ if (context)
+ context_release(context);
break;
case WINED3D_LOCATION_DRAWABLE:
--
2.1.3

Some files were not shown because too many files have changed in this diff Show More