Rebase against 31e0755ea664e02f05a1e500a19fb5f584c1c1cc.

This commit is contained in:
Sebastian Lackner
2015-10-16 20:12:47 +02:00
parent 458dd1fbce
commit 188b345d2e
175 changed files with 405 additions and 579 deletions

View File

@@ -1,4 +1,4 @@
From 135ba97173a0bcb252d48cedc42e90fa02b8f123 Mon Sep 17 00:00:00 2001
From 458932be247371abe50300b9d39acba5efa17e26 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.
@@ -51,7 +51,7 @@ index 1891165..0968cd2 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 676987a..8e6494f 100644
index a092a9c..9749b77 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)
@@ -76,7 +76,7 @@ index 676987a..8e6494f 100644
b_info->bmiHeader.biPlanes = 1;
b_info->bmiHeader.biBitCount = format->byte_count * 8;
@@ -1305,14 +1307,14 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
@@ -1314,14 +1316,14 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
void *mem;
GLenum gl_format = format->glFormat;
GLenum gl_type = format->glType;
@@ -94,7 +94,7 @@ index 676987a..8e6494f 100644
src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1);
mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * surface->pow2Height);
}
@@ -1399,12 +1401,12 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
@@ -1408,12 +1410,12 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
* won't be released, and doesn't have to be re-read. */
src_data = mem;
dst_data = data.addr;
@@ -110,7 +110,7 @@ index 676987a..8e6494f 100644
}
HeapFree(GetProcessHeap(), 0, mem);
@@ -1566,7 +1568,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1575,7 +1577,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 676987a..8e6494f 100644
POINT p;
TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n",
@@ -1654,10 +1656,10 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1663,10 +1665,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 676987a..8e6494f 100644
context_release(context);
@@ -1908,21 +1910,10 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface)
@@ -1917,21 +1919,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 676987a..8e6494f 100644
}
HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y)
@@ -2084,20 +2075,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -2093,20 +2084,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 676987a..8e6494f 100644
}
/* The format might be changed to a format that needs conversion.
@@ -2717,7 +2709,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2726,7 +2718,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
@@ -193,7 +193,7 @@ index 676987a..8e6494f 100644
map_desc->slice_pitch = 0;
if (!box)
@@ -2844,6 +2836,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2855,6 +2847,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
int i;
BOOL srcIsUpsideDown;
struct wined3d_bo_address data;
@@ -201,7 +201,7 @@ index 676987a..8e6494f 100644
surface_get_memory(surface, &data, dst_location);
@@ -2880,8 +2873,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2896,8 +2889,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
}
/* Setup pixel store pack state -- to glReadPixels into the correct place */
@@ -212,7 +212,7 @@ index 676987a..8e6494f 100644
checkGLcall("glPixelStorei");
gl_info->gl_ops.gl.p_glReadPixels(0, 0,
@@ -2898,8 +2891,6 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2914,8 +2907,6 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
{
/* glReadPixels returns the image upside down, and there is no way to prevent this.
* Flip the lines in software. */
@@ -221,16 +221,16 @@ index 676987a..8e6494f 100644
if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch)))
goto error;
@@ -4018,7 +4009,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4041,7 +4032,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
struct wined3d_device *device = surface->resource.device;
const struct wined3d_color_key_conversion *conversion;
struct wined3d_texture *texture = surface->container;
struct wined3d_context *context;
- UINT width, src_pitch, dst_pitch;
+ UINT width, src_row_pitch, src_slice_pitch, dst_pitch;
struct wined3d_bo_address data;
struct wined3d_format format;
POINT dst_point = {0, 0};
@@ -4106,7 +4097,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4126,7 +4117,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 676987a..8e6494f 100644
format = *texture->resource.format;
if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE)))
@@ -4144,9 +4135,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4164,9 +4155,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
context_release(context);
return E_OUTOFMEMORY;
}
@@ -251,7 +251,7 @@ index 676987a..8e6494f 100644
data.addr = mem;
}
else if (conversion)
@@ -4166,14 +4157,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4186,14 +4177,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
if (texture->swapchain && texture->swapchain->palette)
palette = texture->swapchain->palette;
@@ -267,13 +267,13 @@ index 676987a..8e6494f 100644
- src_pitch, &dst_point, srgb, wined3d_const_bo_address(&data));
+ src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data));
context_release(context);
HeapFree(GetProcessHeap(), 0, mem);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index fdce24d..63f0de3 100644
index d5f9591..5232053 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
@@ -1255,7 +1255,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso
struct wined3d_const_bo_address addr;
unsigned int row_pitch, slice_pitch;
@@ -283,7 +283,7 @@ index fdce24d..63f0de3 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 2daa55e..f528ea1 100644
index 41264e8..afb9e76 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 2daa55e..f528ea1 100644
converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth);
format->convert(data->addr, converted_mem, src_row_pitch, src_slice_pitch,
@@ -631,7 +607,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
@@ -610,7 +586,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
}
else
{
@@ -336,10 +336,10 @@ index 2daa55e..f528ea1 100644
if (!box)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 596addc..90094e0 100644
index 8aa2537..ee14dd1 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2165,6 +2165,7 @@ struct wined3d_resource
@@ -2175,6 +2175,7 @@ struct wined3d_resource
UINT size;
DWORD priority;
void *heap_memory;
@@ -347,7 +347,7 @@ index 596addc..90094e0 100644
struct list resource_list_entry;
void *parent;
@@ -2192,6 +2193,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
@@ -2202,6 +2203,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 596addc..90094e0 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;
@@ -2329,7 +2332,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN
@@ -2342,7 +2345,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 596addc..90094e0 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;
@@ -2379,7 +2381,6 @@ struct wined3d_surface
@@ -2395,7 +2397,6 @@ struct wined3d_surface
DWORD flags;
@@ -373,5 +373,5 @@ index 596addc..90094e0 100644
UINT pow2Height;
--
2.6.0
2.6.1

View File

@@ -1,49 +0,0 @@
From f3cecdde174e3fc350ca4a35771183695b6777de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 19:50:47 +0100
Subject: wined3d: Pass a context to surface_multisample_resolve.
---
dlls/wined3d/surface.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index a2f8112..ee6cfdd 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4314,19 +4314,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
return WINED3D_OK;
}
-static void surface_multisample_resolve(struct wined3d_surface *surface)
+/* Context activation is done by the caller. */
+static void surface_multisample_resolve(struct wined3d_surface *surface, struct wined3d_context *context)
{
- struct wined3d_context *context;
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE))
ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n",
surface);
- context = context_acquire(surface->resource.device, NULL);
surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT,
surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect);
- context_release(context);
}
HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
@@ -4405,7 +4403,9 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
break;
case WINED3D_LOCATION_RB_RESOLVED:
- surface_multisample_resolve(surface);
+ context = context_acquire(device, NULL);
+ surface_multisample_resolve(surface, context);
+ context_release(context);
break;
case WINED3D_LOCATION_TEXTURE_RGB:
--
2.1.3

View File

@@ -1,100 +0,0 @@
From 4e063e06ce5bf0e641ce3f307c6cbfc891a227d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 19:52:56 +0100
Subject: wined3d: Pass a context to surface_load_texture.
---
dlls/wined3d/surface.c | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 92fe15c..6c291ad 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4275,13 +4275,13 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
}
static HRESULT surface_load_texture(struct wined3d_surface *surface,
- const struct wined3d_gl_info *gl_info, BOOL srgb)
+ struct wined3d_context *context, BOOL srgb)
{
+ const struct wined3d_gl_info *gl_info = context->gl_info;
RECT src_rect = {0, 0, surface->resource.width, surface->resource.height};
struct wined3d_device *device = surface->resource.device;
const struct wined3d_color_key_conversion *conversion;
struct wined3d_texture *texture = surface->container;
- struct wined3d_context *context;
UINT width, src_row_pitch, src_slice_pitch, dst_pitch;
struct wined3d_bo_address data;
struct wined3d_format format;
@@ -4303,8 +4303,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format))
{
- context = context_acquire(device, NULL);
-
if (srgb)
surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB,
&src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect);
@@ -4312,8 +4310,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB,
&src_rect, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect);
- context_release(context);
-
return WINED3D_OK;
}
@@ -4328,10 +4324,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
- context = context_acquire(device, NULL);
surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location,
&rect, surface, dst_location, &rect);
- context_release(context);
return WINED3D_OK;
}
@@ -4369,9 +4363,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_load_location(surface, WINED3D_LOCATION_SYSMEM);
}
- /* TODO: Use already acquired context when possible. */
- context = context_acquire(device, NULL);
-
wined3d_texture_prepare_texture(texture, context, srgb);
wined3d_texture_bind_and_dirtify(texture, context, srgb);
@@ -4453,8 +4444,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
wined3d_surface_upload_data(surface, gl_info, &format, &src_rect,
src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data));
- context_release(context);
-
HeapFree(GetProcessHeap(), 0, mem);
return WINED3D_OK;
@@ -4476,7 +4465,6 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
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;
@@ -4556,7 +4544,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
case WINED3D_LOCATION_TEXTURE_RGB:
case WINED3D_LOCATION_TEXTURE_SRGB:
- if (FAILED(hr = surface_load_texture(surface, gl_info, location == WINED3D_LOCATION_TEXTURE_SRGB)))
+ context = context_acquire(device, NULL);
+ hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
+ context_release(context);
+ if (FAILED(hr))
return hr;
break;
--
1.9.1

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