Rebase against 1d1487105d4d3a9133f0846d32363a0432812d0c.

This commit is contained in:
Sebastian Lackner 2015-10-07 22:20:45 +02:00
parent b1d20ea747
commit fdf5bad886
10 changed files with 347 additions and 348 deletions

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "6b9a87c7a801e1776444ac96c555fbad80d34115"
echo "1d1487105d4d3a9133f0846d32363a0432812d0c"
}
# Show version information

View File

@ -1,4 +1,4 @@
From b8718b23cf22dcdb8cfde0bb64101c7243ae44b5 Mon Sep 17 00:00:00 2001
From 135ba97173a0bcb252d48cedc42e90fa02b8f123 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 14:22:24 +0200
Subject: wined3d: Merge get_pitch functions.
@ -12,7 +12,7 @@ Subject: wined3d: Merge get_pitch functions.
5 files changed, 70 insertions(+), 71 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 1891165..86441d1 100644
index 1891165..0968cd2 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -414,3 +414,34 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
@ -51,7 +51,7 @@ index 1891165..86441d1 100644
+ TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch);
+}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index e9e0620..f6be430 100644
index 676987a..8e6494f 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -364,6 +364,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
@ -110,7 +110,7 @@ index e9e0620..f6be430 100644
}
HeapFree(GetProcessHeap(), 0, mem);
@@ -1559,7 +1561,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1566,7 +1568,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
UINT update_w, update_h;
UINT dst_w, dst_h;
RECT r, dst_rect;
@ -119,7 +119,7 @@ index e9e0620..f6be430 100644
POINT p;
TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n",
@@ -1647,10 +1649,10 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1654,10 +1656,10 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE);
surface_get_memory(src_surface, &data, src_surface->locations);
@ -132,7 +132,7 @@ index e9e0620..f6be430 100644
context_release(context);
@@ -1933,21 +1935,10 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface)
@@ -1908,21 +1910,10 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface)
DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
{
@ -158,7 +158,7 @@ index e9e0620..f6be430 100644
}
HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y)
@@ -2109,20 +2100,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -2084,20 +2075,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY;
valid_location = WINED3D_LOCATION_USER_MEMORY;
}
@ -184,7 +184,7 @@ index e9e0620..f6be430 100644
}
/* The format might be changed to a format that needs conversion.
@@ -2742,7 +2734,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2717,7 +2709,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH)
map_desc->row_pitch = surface->resource.width * format->byte_count;
else
@ -192,8 +192,8 @@ index e9e0620..f6be430 100644
+ wined3d_resource_get_pitch(&surface->resource, &map_desc->row_pitch, &map_desc->slice_pitch);
map_desc->slice_pitch = 0;
if (!rect)
@@ -2869,6 +2861,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
if (!box)
@@ -2844,6 +2836,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
int i;
BOOL srcIsUpsideDown;
struct wined3d_bo_address data;
@ -201,7 +201,7 @@ index e9e0620..f6be430 100644
surface_get_memory(surface, &data, dst_location);
@@ -2905,8 +2898,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2880,8 +2873,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
}
/* Setup pixel store pack state -- to glReadPixels into the correct place */
@ -212,7 +212,7 @@ index e9e0620..f6be430 100644
checkGLcall("glPixelStorei");
gl_info->gl_ops.gl.p_glReadPixels(0, 0,
@@ -2923,8 +2916,6 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2898,8 +2891,6 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
{
/* glReadPixels returns the image upside down, and there is no way to prevent this.
* Flip the lines in software. */
@ -221,7 +221,7 @@ index e9e0620..f6be430 100644
if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch)))
goto error;
@@ -4120,7 +4111,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4018,7 +4009,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
const struct wined3d_color_key_conversion *conversion;
struct wined3d_texture *texture = surface->container;
struct wined3d_context *context;
@ -230,7 +230,7 @@ index e9e0620..f6be430 100644
struct wined3d_bo_address data;
struct wined3d_format format;
POINT dst_point = {0, 0};
@@ -4208,7 +4199,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4106,7 +4097,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
wined3d_texture_bind_and_dirtify(texture, context, srgb);
width = surface->resource.width;
@ -239,7 +239,7 @@ index e9e0620..f6be430 100644
format = *texture->resource.format;
if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE)))
@@ -4246,9 +4237,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4144,9 +4135,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
context_release(context);
return E_OUTOFMEMORY;
}
@ -251,7 +251,7 @@ index e9e0620..f6be430 100644
data.addr = mem;
}
else if (conversion)
@@ -4268,14 +4259,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4166,14 +4157,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
if (texture->swapchain && texture->swapchain->palette)
palette = texture->swapchain->palette;
@ -270,7 +270,7 @@ index e9e0620..f6be430 100644
context_release(context);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index b369809..3485ac2 100644
index fdce24d..63f0de3 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1242,7 +1242,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso
@ -283,7 +283,7 @@ index b369809..3485ac2 100644
FIXME("Ignoring row/slice pitch (%u/%u).\n", data->row_pitch, data->slice_pitch);
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 424938a..b672d4a 100644
index 2daa55e..f528ea1 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -40,30 +40,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume)
@ -326,7 +326,7 @@ index 424938a..b672d4a 100644
converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth);
format->convert(data->addr, converted_mem, src_row_pitch, src_slice_pitch,
@@ -643,7 +619,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
@@ -631,7 +607,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
}
else
{
@ -336,10 +336,10 @@ index 424938a..b672d4a 100644
if (!box)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 919e818..7c26e44 100644
index 596addc..90094e0 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2164,6 +2164,7 @@ struct wined3d_resource
@@ -2165,6 +2165,7 @@ struct wined3d_resource
UINT size;
DWORD priority;
void *heap_memory;
@ -347,7 +347,7 @@ index 919e818..7c26e44 100644
struct list resource_list_entry;
void *parent;
@@ -2191,6 +2192,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
@@ -2192,6 +2193,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
@ -356,7 +356,7 @@ index 919e818..7c26e44 100644
GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
@@ -2328,7 +2331,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN
@@ -2329,7 +2332,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN
HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc,
unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN;
void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN;
@ -364,7 +364,7 @@ index 919e818..7c26e44 100644
void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context,
BOOL srgb_mode) DECLSPEC_HIDDEN;
void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN;
@@ -2378,7 +2380,6 @@ struct wined3d_surface
@@ -2379,7 +2381,6 @@ struct wined3d_surface
DWORD flags;
@ -373,5 +373,5 @@ index 919e818..7c26e44 100644
UINT pow2Height;
--
2.5.1
2.6.0

View File

@ -1,4 +1,4 @@
From 68ee5f83114581754be6462ea029dfeea654206e Mon Sep 17 00:00:00 2001
From 0c74d61fdaa16fbb70f443f6863d864024b8e615 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 21 Jan 2014 13:30:59 +0100
Subject: wined3d: Use resource buffer mapping facilities in surfaces.
@ -9,10 +9,10 @@ Subject: wined3d: Use resource buffer mapping facilities in surfaces.
2 files changed, 23 insertions(+), 63 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 01bde00..41b222f 100644
index 5f0a98e..dda77f0 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -535,6 +535,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource,
@@ -544,6 +544,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource,
case WINED3D_LOCATION_SYSMEM:
return resource->heap_memory;
@ -25,7 +25,7 @@ index 01bde00..41b222f 100644
default:
ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding));
return NULL;
@@ -557,6 +563,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource,
@@ -566,6 +572,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource,
return;
case WINED3D_LOCATION_SYSMEM:
@ -35,7 +35,7 @@ index 01bde00..41b222f 100644
default:
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index e85a68b..ee49f29 100644
index 62f74bd..583fa59 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -716,36 +716,10 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
@ -75,7 +75,7 @@ index e85a68b..ee49f29 100644
if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB))
{
TRACE("Not dirtified, nothing to do.\n");
@@ -2661,6 +2635,8 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso
@@ -2623,6 +2597,8 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso
HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface)
{
@ -84,7 +84,7 @@ index e85a68b..ee49f29 100644
TRACE("surface %p.\n", surface);
if (!surface->resource.map_count)
@@ -2670,6 +2646,12 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface)
@@ -2632,6 +2608,12 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface)
}
--surface->resource.map_count;
@ -97,7 +97,7 @@ index e85a68b..ee49f29 100644
surface->surface_ops->surface_unmap(surface);
return WINED3D_OK;
@@ -2681,8 +2663,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2643,8 +2625,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
const struct wined3d_format *format = surface->resource.format;
unsigned int fmt_flags = surface->container->resource.format_flags;
struct wined3d_device *device = surface->resource.device;
@ -106,8 +106,8 @@ index e85a68b..ee49f29 100644
+ struct wined3d_context *context = NULL;
BYTE *base_memory;
TRACE("surface %p, map_desc %p, rect %s, flags %#x.\n",
@@ -2724,6 +2705,9 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
TRACE("surface %p, map_desc %p, box %p, flags %#x.\n",
@@ -2686,6 +2667,9 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
}
}
@ -117,7 +117,7 @@ index e85a68b..ee49f29 100644
surface_prepare_map_memory(surface);
if (flags & WINED3D_MAP_DISCARD)
{
@@ -2733,51 +2717,19 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2695,51 +2679,19 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
}
else
{
@ -173,5 +173,5 @@ index e85a68b..ee49f29 100644
if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH)
map_desc->row_pitch = surface->resource.width * format->byte_count;
--
2.4.2
2.6.0

View File

@ -1,14 +1,14 @@
From 5b260f3eff9c924a8e6cc0b9496c2639dc52e9af Mon Sep 17 00:00:00 2001
From a5a66abc3cc3c7fd5f0a5602baf11f45e6ddfe86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 14:55:00 +0200
Subject: wined3d: Move check_block_align to resource.c
---
dlls/wined3d/resource.c | 28 ++++++++++++++++++++++++++++
dlls/wined3d/surface.c | 27 +++++++++++----------------
dlls/wined3d/surface.c | 18 +-----------------
dlls/wined3d/volume.c | 30 +-----------------------------
dlls/wined3d/wined3d_private.h | 2 ++
4 files changed, 42 insertions(+), 45 deletions(-)
4 files changed, 32 insertions(+), 46 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 40267e7..c8bbf3d 100644
@ -47,19 +47,18 @@ index 40267e7..c8bbf3d 100644
+ return TRUE;
+}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index a47f1fa..a728e7d 100644
index 469790e..4e17620 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1477,23 +1477,18 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
@@ -1477,23 +1477,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
static BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect)
static BOOL surface_check_block_align(struct wined3d_surface *surface, const struct wined3d_box *box)
{
- UINT width_mask, height_mask;
+ struct wined3d_box box;
- if (!rect->left && !rect->top
- && rect->right == surface->resource.width
- && rect->bottom == surface->resource.height)
-
- if (!box->left && !box->top
- && box->right == surface->resource.width
- && box->bottom == surface->resource.height)
- return TRUE;
-
- /* This assumes power of two block sizes, but NPOT block sizes would be
@ -67,29 +66,20 @@ index a47f1fa..a728e7d 100644
- width_mask = surface->resource.format->block_width - 1;
- height_mask = surface->resource.format->block_height - 1;
-
- if (!(rect->left & width_mask) && !(rect->top & height_mask)
- && !(rect->right & width_mask) && !(rect->bottom & height_mask))
- if (!(box->left & width_mask) && !(box->top & height_mask)
- && !(box->right & width_mask) && !(box->bottom & height_mask))
- return TRUE;
-
- return FALSE;
+ if (!rect)
+ return wined3d_resource_check_block_align(&surface->resource, NULL);
+
+ box.left = rect->left;
+ box.top = rect->top;
+ box.front = 0;
+ box.right = rect->right;
+ box.bottom = rect->bottom;
+ box.back = 1;
+ return wined3d_resource_check_block_align(&surface->resource, &box);
+ return wined3d_resource_check_block_align(&surface->resource, box);
}
HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point,
static BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect)
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 4faa22d..b902b18 100644
index dc687eb..55e12ed 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -379,34 +379,6 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum
@@ -367,34 +367,6 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum
return &volume->resource;
}
@ -124,7 +114,7 @@ index 4faa22d..b902b18 100644
static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume,
const struct wined3d_box *box)
{
@@ -457,7 +429,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
@@ -445,7 +417,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
WARN("Map box is invalid.\n");
return WINED3DERR_INVALIDCALL;
}
@ -134,10 +124,10 @@ index 4faa22d..b902b18 100644
WARN("Map box is misaligned for %ux%u blocks.\n",
format->block_width, format->block_height);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ff07e53..9dab51b 100644
index 9c0dfd4..2cde14c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2197,6 +2197,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
@@ -2198,6 +2198,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN;
BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
@ -147,5 +137,5 @@ index ff07e53..9dab51b 100644
BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource,
const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN;
--
2.5.1
2.6.0

View File

@ -1,19 +1,19 @@
From 72f318318de11be998fbbf707dadeb204d51c899 Mon Sep 17 00:00:00 2001
From 3e4b3bec2fbb475be058afeb846adebf3af1d575 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 18:00:23 +0200
Subject: wined3d: Use resource_map for surface_map.
---
dlls/wined3d/resource.c | 2 +-
dlls/wined3d/surface.c | 102 +++++++-----------------------------------------
dlls/wined3d/volume.c | 7 +++-
3 files changed, 22 insertions(+), 89 deletions(-)
dlls/wined3d/resource.c | 2 +-
dlls/wined3d/surface.c | 99 ++++++-------------------------------------------
dlls/wined3d/volume.c | 7 +++-
3 files changed, 18 insertions(+), 90 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index ba18baa..e5644ce 100644
index e5af445..9c40d42 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -858,7 +858,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource)
@@ -867,7 +867,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource)
if (!resource->map_count)
{
WARN("Trying to unlock an unlocked resource %p.\n", resource);
@ -23,10 +23,10 @@ index ba18baa..e5644ce 100644
if (device->d3d_initialized)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index f117013..a331e37 100644
index 37f9b40..1d77682 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2476,47 +2476,26 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso
@@ -2427,28 +2427,18 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso
HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface)
{
@ -60,17 +60,16 @@ index f117013..a331e37 100644
}
HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
struct wined3d_map_desc *map_desc, const RECT *rect, DWORD flags)
@@ -2456,18 +2446,6 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
{
+ struct wined3d_box box;
const struct wined3d_format *format = surface->resource.format;
unsigned int fmt_flags = surface->container->resource.format_flags;
- struct wined3d_device *device = surface->resource.device;
- struct wined3d_context *context = NULL;
- BYTE *base_memory;
-
- TRACE("surface %p, map_desc %p, rect %s, flags %#x.\n",
- surface, map_desc, wine_dbgstr_rect(rect), flags);
- TRACE("surface %p, map_desc %p, box %p, flags %#x.\n",
- surface, map_desc, box, flags);
-
- if (surface->resource.map_count)
- {
@ -78,9 +77,9 @@ index f117013..a331e37 100644
- return WINED3DERR_INVALIDCALL;
- }
if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && rect
&& !surface_check_block_align(surface, rect))
@@ -2528,11 +2507,6 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box
&& !surface_check_block_align(surface, box))
@@ -2479,11 +2457,6 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
return WINED3DERR_INVALIDCALL;
}
@ -92,7 +91,7 @@ index f117013..a331e37 100644
/* Performance optimization: Count how often a surface is mapped, if it is
* mapped regularly do not throw away the system memory copy. This avoids
* the need to download the surface from OpenGL all the time. The surface
@@ -2548,72 +2522,26 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2499,72 +2472,22 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
}
}
@ -107,19 +106,16 @@ index f117013..a331e37 100644
- wined3d_resource_validate_location(&surface->resource, surface->resource.map_binding);
- }
- else
+ if (rect)
+ if (box)
{
- if (surface->resource.usage & WINED3DUSAGE_DYNAMIC)
- WARN_(d3d_perf)("Mapping a dynamic surface without WINED3D_MAP_DISCARD.\n");
+ surface->lockedRect = *rect;
-
- wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
+ box.left = rect->left;
+ box.top = rect->top;
+ box.front = 0;
+ box.right = rect->right;
+ box.bottom = rect->bottom;
+ box.back = 1;
+ surface->lockedRect.left = box->left;
+ surface->lockedRect.top = box->top;
+ surface->lockedRect.right = box->right;
+ surface->lockedRect.bottom = box->bottom;
}
-
- if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
@ -136,7 +132,7 @@ index f117013..a331e37 100644
- wined3d_resource_get_pitch(&surface->resource, &map_desc->row_pitch, &map_desc->slice_pitch);
- map_desc->slice_pitch = 0;
-
- if (!rect)
- if (!box)
{
- map_desc->data = base_memory;
surface->lockedRect.left = 0;
@ -151,34 +147,34 @@ index f117013..a331e37 100644
- /* Compressed textures are block based, so calculate the offset of
- * the block that contains the top-left pixel of the locked rectangle. */
- map_desc->data = base_memory
- + ((rect->top / format->block_height) * map_desc->row_pitch)
- + ((rect->left / format->block_width) * format->block_byte_count);
- + ((box->top / format->block_height) * map_desc->row_pitch)
- + ((box->left / format->block_width) * format->block_byte_count);
- }
- else
- {
- map_desc->data = base_memory
- + (map_desc->row_pitch * rect->top)
- + (rect->left * format->byte_count);
- + (map_desc->row_pitch * box->top)
- + (box->left * format->byte_count);
- }
- surface->lockedRect.left = rect->left;
- surface->lockedRect.top = rect->top;
- surface->lockedRect.right = rect->right;
- surface->lockedRect.bottom = rect->bottom;
- surface->lockedRect.left = box->left;
- surface->lockedRect.top = box->top;
- surface->lockedRect.right = box->right;
- surface->lockedRect.bottom = box->bottom;
- }
-
- TRACE("Locked rect %s.\n", wine_dbgstr_rect(&surface->lockedRect));
- TRACE("Returning memory %p, pitch %u.\n", map_desc->data, map_desc->row_pitch);
- return WINED3D_OK;
+ return wined3d_resource_map(&surface->resource, map_desc, rect ? &box : NULL, flags);
+ return wined3d_resource_map(&surface->resource, map_desc, box, flags);
}
HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index dd49d01..01ee33c 100644
index 966ff6c..1d98275 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -441,7 +441,12 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour
@@ -428,7 +428,12 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour
HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
{
@ -193,5 +189,5 @@ index dd49d01..01ee33c 100644
static ULONG volume_resource_incref(struct wined3d_resource *resource)
--
2.4.2
2.6.0

View File

@ -1,17 +1,22 @@
From 9d0010d5add477e39747ac3e458d16b5b1fa101f Mon Sep 17 00:00:00 2001
From 74de56cff82b598bb71d556767bcd1c53dcb16e2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 24 Sep 2013 00:31:39 +0200
Subject: wined3d: Don't call the public map function in surface_cpu_blt.
---
dlls/wined3d/surface.c | 107 +++++++++++++++++++++++++++++++++----------------
1 file changed, 72 insertions(+), 35 deletions(-)
dlls/wined3d/surface.c | 108 ++++++++++++++++++++++++++++++++-----------------
1 file changed, 72 insertions(+), 36 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ff83f29..df8aea6 100644
index 5c30f78..a32ce1d 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4428,21 +4428,36 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4306,26 +4306,40 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter)
{
- const struct wined3d_box dst_box = {dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, 0, 1};
int bpp, srcheight, srcwidth, dstheight, dstwidth, width;
const struct wined3d_format *src_format, *dst_format;
unsigned int src_fmt_flags, dst_fmt_flags;
struct wined3d_texture *src_texture = NULL;
@ -51,7 +56,7 @@ index ff83f29..df8aea6 100644
src_format = dst_surface->resource.format;
dst_format = src_format;
dst_fmt_flags = dst_surface->container->resource.format_flags;
@@ -4454,6 +4469,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4337,6 +4351,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
dst_fmt_flags = dst_surface->container->resource.format_flags;
if (src_surface)
{
@ -64,7 +69,7 @@ index ff83f29..df8aea6 100644
if (dst_surface->resource.format->id != src_surface->resource.format->id)
{
if (!(src_texture = surface_convert_format(src_surface, dst_format->id)))
@@ -4464,7 +4485,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4347,7 +4367,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
}
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0));
}
@ -75,17 +80,17 @@ index ff83f29..df8aea6 100644
src_format = src_surface->resource.format;
src_fmt_flags = src_surface->container->resource.format_flags;
}
@@ -4474,7 +4497,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4357,7 +4379,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
src_fmt_flags = dst_fmt_flags;
}
- wined3d_surface_map(dst_surface, &dst_map, dst_rect, 0);
- wined3d_surface_map(dst_surface, &dst_map, &dst_box, 0);
+ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch);
+ dst_data = wined3d_resource_get_map_ptr(&dst_surface->resource, context, 0);
}
bpp = dst_surface->resource.format->byte_count;
@@ -4485,15 +4509,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4368,15 +4391,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
width = (dst_rect->right - dst_rect->left) * bpp;
if (src_surface)
@ -106,7 +111,7 @@ index ff83f29..df8aea6 100644
if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS)
{
@@ -4528,7 +4549,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4411,7 +4431,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
}
hr = surface_cpu_blt_compressed(sbase, dbuf,
@ -115,7 +120,7 @@ index ff83f29..df8aea6 100644
src_format, flags, fx);
goto release;
}
@@ -4536,7 +4557,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4419,7 +4439,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
/* First, all the 'source-less' blits */
if (flags & WINEDDBLT_COLORFILL)
{
@ -124,7 +129,7 @@ index ff83f29..df8aea6 100644
flags &= ~WINEDDBLT_COLORFILL;
}
@@ -4585,19 +4606,19 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4468,19 +4488,19 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
for (y = 0; y < dstheight; ++y)
{
memcpy(dbuf, sbuf, width);
@ -150,7 +155,7 @@ index ff83f29..df8aea6 100644
memcpy(dbuf, sbuf, width);
}
}
@@ -4607,8 +4628,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4490,8 +4510,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
for (y = 0; y < dstheight; ++y)
{
memmove(dbuf, sbuf, width);
@ -161,7 +166,7 @@ index ff83f29..df8aea6 100644
}
}
}
@@ -4617,9 +4638,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4500,9 +4520,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
/* Stretching in y direction only. */
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
@ -173,7 +178,7 @@ index ff83f29..df8aea6 100644
}
}
}
@@ -4629,13 +4650,13 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4512,13 +4532,13 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
int last_sy = -1;
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
@ -189,7 +194,7 @@ index ff83f29..df8aea6 100644
}
else
{
@@ -4682,14 +4703,14 @@ do { \
@@ -4565,14 +4585,14 @@ do { \
}
#undef STRETCH_ROW
}
@ -206,7 +211,7 @@ index ff83f29..df8aea6 100644
DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff;
DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff;
if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE))
@@ -4739,7 +4760,7 @@ do { \
@@ -4622,7 +4642,7 @@ do { \
LONG tmpxy;
dTopLeft = dbuf;
dTopRight = dbuf + ((dstwidth - 1) * bpp);
@ -215,7 +220,7 @@ index ff83f29..df8aea6 100644
dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp);
if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY)
@@ -4822,7 +4843,7 @@ do { \
@@ -4705,7 +4725,7 @@ do { \
type *d = (type *)dbuf, *dx, tmp; \
for (y = sy = 0; y < dstheight; ++y, sy += yinc) \
{ \
@ -224,7 +229,7 @@ index ff83f29..df8aea6 100644
dx = d; \
for (x = sx = 0; x < dstwidth; ++x, sx += xinc) \
{ \
@@ -4855,7 +4876,7 @@ do { \
@@ -4738,7 +4758,7 @@ do { \
BYTE *d = dbuf, *dx;
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
@ -233,7 +238,7 @@ index ff83f29..df8aea6 100644
dx = d;
for (x = sx = 0; x < dstwidth; ++x, sx+= xinc)
{
@@ -4886,6 +4907,10 @@ do { \
@@ -4769,6 +4789,10 @@ do { \
}
}
@ -244,7 +249,7 @@ index ff83f29..df8aea6 100644
error:
if (flags && FIXME_ON(d3d_surface))
{
@@ -4893,12 +4918,24 @@ error:
@@ -4776,12 +4800,24 @@ error:
}
release:
@ -273,5 +278,5 @@ index ff83f29..df8aea6 100644
return hr;
}
--
2.4.2
2.6.0

View File

@ -1,4 +1,4 @@
From 6e1f3fcac566581cd786a66405633ed4a674793d Mon Sep 17 00:00:00 2001
From 843b306004f731e36e9d9d9336228cd2c06f9128 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 20 Aug 2014 14:14:23 +0200
Subject: wined3d: Put update_surface checks back in place
@ -12,7 +12,7 @@ yet because blits depend on them.
3 files changed, 70 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index b95dfde..f0b2849 100644
index 819e6de..e804afe 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3773,6 +3773,13 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device,
@ -80,7 +80,7 @@ index b95dfde..f0b2849 100644
+ }
+
+ if ((src_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS)
+ && !surface_check_block_align(src_surface, src_rect))
+ && !surface_check_block_align_rect(src_surface, src_rect))
+ {
+ WARN("Source rectangle not block-aligned.\n");
+ return WINED3DERR_INVALIDCALL;
@ -88,7 +88,7 @@ index b95dfde..f0b2849 100644
+
+ SetRect(&dst_rect, dst_point->x, dst_point->y, dst_point->x + update_w, dst_point->y + update_h);
+ if ((dst_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS)
+ && !surface_check_block_align(dst_surface, &dst_rect))
+ && !surface_check_block_align_rect(dst_surface, &dst_rect))
+ {
+ WARN("Destination rectangle not block-aligned.\n");
+ return WINED3DERR_INVALIDCALL;
@ -98,30 +98,30 @@ index b95dfde..f0b2849 100644
{
FIXME("Waiting for cs.\n");
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 8cec730..1376d97 100644
index 2d98a93..5a2b14e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1366,7 +1366,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
}
@@ -1371,7 +1371,7 @@ static BOOL surface_check_block_align(struct wined3d_surface *surface, const str
return wined3d_resource_check_block_align(&surface->resource, box);
}
-static BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect)
+BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect)
-static BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect)
+BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect)
{
struct wined3d_box box;
struct wined3d_box box = {rect->left, rect->top, rect->right, rect->bottom, 0, 1};
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 77317a5..e09927b6 100644
index 73da744..99212de 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2494,6 +2494,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_in,
struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags,
const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
+BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN;
+BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN;
void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
--
2.5.1
2.6.0

View File

@ -1,4 +1,4 @@
From 91a76b0dd0c52b3745dd0ecd1dfc79acad7ccba7 Mon Sep 17 00:00:00 2001
From 0fd12af6067cbe8aa8800098a602d808978d14ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 6 Oct 2013 16:12:24 +0200
Subject: wined3d: Clean up surfaces through the cs.
@ -10,10 +10,10 @@ Subject: wined3d: Clean up surfaces through the cs.
3 files changed, 46 insertions(+), 21 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 9cba57b..7675214 100644
index 18b556d..91b76f5 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -85,6 +85,7 @@ enum wined3d_cs_op
@@ -86,6 +86,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_RESOURCE_CLEANUP,
WINED3D_CS_OP_BUFFER_CLEANUP,
WINED3D_CS_OP_VOLUME_CLEANUP,
@ -21,7 +21,7 @@ index 9cba57b..7675214 100644
WINED3D_CS_OP_STOP,
};
@@ -498,6 +499,12 @@ struct wined3d_cs_volume_cleanup
@@ -508,6 +509,12 @@ struct wined3d_cs_volume_cleanup
struct wined3d_volume *volume;
};
@ -34,7 +34,7 @@ index 9cba57b..7675214 100644
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -2419,6 +2426,26 @@ void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume
@@ -2533,6 +2540,26 @@ void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume
cs->ops->submit(cs, sizeof(*op));
}
@ -61,7 +61,7 @@ index 9cba57b..7675214 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2482,6 +2509,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2597,6 +2624,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup,
/* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup,
/* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup,
@ -70,7 +70,7 @@ index 9cba57b..7675214 100644
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ac5f6bb..fcd7d63 100644
index c607072..e0164f1 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -36,20 +36,10 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d);
@ -135,7 +135,7 @@ index ac5f6bb..fcd7d63 100644
}
void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context,
@@ -5479,8 +5476,6 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
@@ -5360,8 +5357,6 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
{
ERR("Private setup failed, hr %#x.\n", hr);
surface_cleanup(surface);
@ -144,7 +144,7 @@ index ac5f6bb..fcd7d63 100644
return hr;
}
@@ -5523,7 +5518,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w
@@ -5404,7 +5399,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w
if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags)))
{
WARN("Failed to initialize surface, returning %#x.\n", hr);
@ -154,18 +154,18 @@ index ac5f6bb..fcd7d63 100644
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d201a5c..c28554f 100644
index 96102af..cbc3fa9 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2472,6 +2472,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_
@@ -2537,6 +2537,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_
struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags,
const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN;
BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN;
+void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
@@ -2729,6 +2730,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs,
@@ -2800,6 +2801,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs,
struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN;
@ -174,5 +174,5 @@ index d201a5c..c28554f 100644
/* Direct3D terminology with little modifications. We do not have an issued state
* because only the driver knows about it, but we have a created state because d3d
--
2.2.1
2.6.0

View File

@ -1,4 +1,4 @@
From e11740d5e132ca4e8cb70eadeb1e157b6719458f Mon Sep 17 00:00:00 2001
From 660da782e4f462082b582638dab578af11c65b5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 16 Mar 2014 14:13:42 +0100
Subject: wined3d: Send getdc and releasedc through the command stream.
@ -104,11 +104,11 @@ index 56e5e1c..63040f6 100644
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index cbd37c1..4a69622 100644
index f35f56e..3d42543 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2538,48 +2538,23 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
return wined3d_resource_map(&surface->resource, map_desc, rect ? &box : NULL, flags);
@@ -2497,48 +2497,23 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
return wined3d_resource_map(&surface->resource, map_desc, box, flags);
}
-HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
@ -159,7 +159,7 @@ index cbd37c1..4a69622 100644
}
if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY
|| surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM
@@ -2592,35 +2567,40 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
@@ -2551,35 +2526,40 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
if (context)
context_release(context);
@ -220,7 +220,7 @@ index cbd37c1..4a69622 100644
&& surface->resource.map_binding != WINED3D_LOCATION_DIB))
{
/* The game Salammbo modifies the surface contents without mapping the surface between
@@ -2641,6 +2621,26 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
@@ -2600,6 +2580,26 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
if (context)
context_release(context);
}
@ -248,12 +248,12 @@ index cbd37c1..4a69622 100644
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c3c7cbb..b5484e0 100644
index 7307746..d68bb48 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2539,6 +2539,8 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_
@@ -2540,6 +2540,8 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_
const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN;
BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN;
void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
+void wined3d_surface_getdc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
+void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
@ -270,5 +270,5 @@ index c3c7cbb..b5484e0 100644
/* Direct3D terminology with little modifications. We do not have an issued state
* because only the driver knows about it, but we have a created state because d3d
--
2.5.1
2.6.0

File diff suppressed because it is too large Load Diff