Removed patch for stub of ntdll.WinSqmIsOptedIn (fixed upstream).

This commit is contained in:
Sebastian Lackner
2015-04-22 23:35:24 +02:00
parent d92acf00eb
commit a139cd10bd
25 changed files with 535 additions and 588 deletions

View File

@@ -1,4 +1,4 @@
From ef006d30c46de0526e6710ff23b11449cb2efe0a Mon Sep 17 00:00:00 2001
From fc87bc1d66c8ba3a0880d2feafa0462cb1058bcf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 20:19:24 +0100
Subject: wined3d: Pass a context to surface_load_location.
@@ -14,7 +14,7 @@ Subject: wined3d: Pass a context to surface_load_location.
7 files changed, 107 insertions(+), 77 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 1d7cf9c..ac4c7cb 100644
index 0334d1c..cb3a435 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2208,7 +2208,7 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing,
@@ -36,7 +36,7 @@ index 1d7cf9c..ac4c7cb 100644
swapchain_update_draw_bindings(swapchain);
context_set_render_offscreen(context, TRUE);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 5f44a1a..725897f 100644
index 4954d00..657e099 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -300,6 +300,15 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
@@ -120,10 +120,10 @@ index c0654a6..913ada5 100644
{
/* Note that this depends on the context_acquire() call above to set
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ff66881..e7b139b 100644
index 22726f2..2cc217e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -752,7 +752,16 @@ static void surface_unmap(struct wined3d_surface *surface)
@@ -753,7 +753,16 @@ static void surface_unmap(struct wined3d_surface *surface)
}
if (surface->container->swapchain && surface->container->swapchain->front_buffer == surface->container)
@@ -138,10 +138,10 @@ index ff66881..e7b139b 100644
+ if (context)
+ context_release(context);
+ }
else if (surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))
else if (surface->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))
FIXME("Depth / stencil buffer locking is not implemented.\n");
}
@@ -805,12 +814,6 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
@@ -806,12 +815,6 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
if (src_mask & WINED3DFMT_FLAG_STENCIL)
gl_mask |= GL_STENCIL_BUFFER_BIT;
@@ -154,7 +154,7 @@ index ff66881..e7b139b 100644
context = context_acquire(device, NULL);
if (!context->valid)
{
@@ -819,6 +822,12 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
@@ -820,6 +823,12 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
return;
}
@@ -167,7 +167,7 @@ index ff66881..e7b139b 100644
gl_info = context->gl_info;
context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, NULL, src_surface, src_location);
@@ -906,9 +915,9 @@ static void surface_blt_fbo(const struct wined3d_device *device,
@@ -907,9 +916,9 @@ static void surface_blt_fbo(const struct wined3d_device *device,
* surface isn't required if the entire surface is overwritten. (And is
* in fact harmful if we're being called by surface_load_location() with
* the purpose of loading the destination surface.) */
@@ -179,7 +179,7 @@ index ff66881..e7b139b 100644
if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface;
else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface;
@@ -1142,6 +1151,9 @@ static void surface_unload(struct wined3d_resource *resource)
@@ -1143,6 +1152,9 @@ static void surface_unload(struct wined3d_resource *resource)
TRACE("surface %p.\n", surface);
@@ -189,7 +189,7 @@ index ff66881..e7b139b 100644
if (resource->pool == WINED3D_POOL_DEFAULT)
{
/* Default pool resources are supposed to be destroyed before Reset is called.
@@ -1167,13 +1179,10 @@ static void surface_unload(struct wined3d_resource *resource)
@@ -1168,13 +1180,10 @@ static void surface_unload(struct wined3d_resource *resource)
else
{
surface_prepare_map_memory(surface);
@@ -204,7 +204,7 @@ index ff66881..e7b139b 100644
/* Destroy PBOs, but load them into real sysmem before */
if (surface->pbo)
surface_remove_pbo(surface, gl_info);
@@ -1657,7 +1666,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1661,7 +1670,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
if (update_w == dst_w && update_h == dst_h)
wined3d_texture_prepare_texture(dst_surface->container, context, FALSE);
else
@@ -213,7 +213,7 @@ index ff66881..e7b139b 100644
wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE);
surface_get_memory(src_surface, &data, src_surface->locations);
@@ -1773,7 +1782,8 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface)
@@ -1777,7 +1786,8 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface)
return GL_BACK;
}
@@ -223,7 +223,7 @@ index ff66881..e7b139b 100644
{
DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
@@ -1789,7 +1799,7 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb)
@@ -1793,7 +1803,7 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb)
}
TRACE("Reloading because surface is dirty.\n");
@@ -232,7 +232,7 @@ index ff66881..e7b139b 100644
surface_evict_sysmem(surface);
}
@@ -2715,10 +2725,16 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2720,10 +2730,16 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
}
else
{
@@ -250,7 +250,7 @@ index ff66881..e7b139b 100644
}
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
@@ -2800,6 +2816,8 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2805,6 +2821,8 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
{
HRESULT hr;
@@ -259,7 +259,7 @@ index ff66881..e7b139b 100644
TRACE("surface %p, dc %p.\n", surface, dc);
@@ -2811,26 +2829,36 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
@@ -2816,26 +2834,36 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
if (surface->resource.map_count)
return WINED3DERR_INVALIDCALL;
@@ -299,7 +299,7 @@ index ff66881..e7b139b 100644
surface->flags |= SFLAG_DCINUSE;
surface->resource.map_count++;
@@ -2868,8 +2896,16 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
@@ -2873,8 +2901,16 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
* copied back to the DIB in the next getdc call.
*
* The same consideration applies to user memory surfaces. */
@@ -317,7 +317,7 @@ index ff66881..e7b139b 100644
}
return WINED3D_OK;
@@ -4110,7 +4146,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
@@ -4115,7 +4151,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
}
if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED))
@@ -326,7 +326,7 @@ index ff66881..e7b139b 100644
/* Download the surface to system memory. */
if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
@@ -4146,7 +4182,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
@@ -4151,7 +4187,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
}
surface_get_rect(surface, NULL, &r);
@@ -335,7 +335,7 @@ index ff66881..e7b139b 100644
surface_blt_to_drawable(surface->resource.device, context,
WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r);
@@ -4219,7 +4255,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4224,7 +4260,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
/* Performance warning... */
FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface);
surface_prepare_map_memory(surface);
@@ -344,7 +344,7 @@ index ff66881..e7b139b 100644
}
}
else
@@ -4230,7 +4266,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4235,7 +4271,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
/* Performance warning... */
FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface);
surface_prepare_map_memory(surface);
@@ -353,7 +353,7 @@ index ff66881..e7b139b 100644
}
}
@@ -4239,7 +4275,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4244,7 +4280,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
/* Lets hope we get it from somewhere... */
surface_prepare_system_memory(surface);
@@ -362,7 +362,7 @@ index ff66881..e7b139b 100644
}
wined3d_texture_prepare_texture(texture, context, srgb);
@@ -4265,7 +4301,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4270,7 +4306,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface->resource.map_binding = WINED3D_LOCATION_SYSMEM;
surface_prepare_map_memory(surface);
@@ -371,7 +371,7 @@ index ff66881..e7b139b 100644
surface_remove_pbo(surface, gl_info);
}
@@ -4333,11 +4369,10 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
@@ -4338,11 +4374,10 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect);
}
@@ -385,7 +385,7 @@ index ff66881..e7b139b 100644
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@@ -4346,9 +4381,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
@@ -4351,9 +4386,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))
{
@@ -395,7 +395,7 @@ index ff66881..e7b139b 100644
return WINED3D_OK;
}
else if (location & surface->locations
@@ -4392,33 +4425,22 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
@@ -4397,33 +4430,22 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
case WINED3D_LOCATION_USER_MEMORY:
case WINED3D_LOCATION_SYSMEM:
case WINED3D_LOCATION_BUFFER:
@@ -432,7 +432,7 @@ index ff66881..e7b139b 100644
return hr;
break;
@@ -5529,7 +5551,11 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5540,7 +5562,11 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, &src_rect)))
{
if (!wined3d_resource_is_offscreen(&dst_surface->container->resource))
@@ -485,7 +485,7 @@ index 146f5d6..4f4d4df 100644
src_dc = front->hDC;
window = swapchain->win_handle;
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 5e68257..1afff66 100644
index 4425ecb..dbb0392 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -766,16 +766,19 @@ static void wined3d_texture_upload_data(struct wined3d_texture *texture, const s
@@ -511,10 +511,10 @@ index 5e68257..1afff66 100644
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 2656399..51487aa 100644
index 1a7cade..e7ec65e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2384,11 +2384,12 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HID
@@ -2385,11 +2385,12 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HID
void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context,
unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN;

View File

@@ -1,4 +1,4 @@
From 64dddc414faf640169e109bf57c62489bfb3a65d Mon Sep 17 00:00:00 2001
From 77640d30bc5d0699ffc7bf76051c6f786feb56f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 21 Jan 2014 12:22:30 +0100
Subject: wined3d: Move surface locations into the resource.
@@ -13,10 +13,10 @@ Subject: wined3d: Move surface locations into the resource.
6 files changed, 56 insertions(+), 56 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 797c204..2ad6917 100644
index 96d2f74..2d4aadc 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7884,7 +7884,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
@@ -7779,7 +7779,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
/* Now load the surface */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
@@ -26,7 +26,7 @@ index 797c204..2ad6917 100644
&& !wined3d_resource_is_offscreen(&src_surface->container->resource))
{
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 725897f..9e03017 100644
index 657e099..9f4ab69 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -236,7 +236,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
@@ -61,10 +61,10 @@ index 913ada5..567550e 100644
else
SetRectEmpty(&current_rect);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 0335497..fcca398 100644
index bb41de5..5fdda96 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -555,7 +555,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
@@ -556,7 +556,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
if (!wined3d_resource_allocate_sysmem(&surface->resource))
ERR("Failed to allocate system memory.\n");
@@ -73,7 +73,7 @@ index 0335497..fcca398 100644
ERR("Surface without system memory has WINED3D_LOCATION_SYSMEM set.\n");
}
@@ -705,7 +705,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
@@ -706,7 +706,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
}
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
@@ -82,7 +82,7 @@ index 0335497..fcca398 100644
if (surface_use_pbo(surface))
surface->resource.map_binding = WINED3D_LOCATION_BUFFER;
@@ -745,7 +745,7 @@ static void surface_unmap(struct wined3d_surface *surface)
@@ -746,7 +746,7 @@ static void surface_unmap(struct wined3d_surface *surface)
ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding));
}
@@ -91,7 +91,7 @@ index 0335497..fcca398 100644
{
TRACE("Not dirtified, nothing to do.\n");
return;
@@ -1669,7 +1669,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1673,7 +1673,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE);
@@ -100,7 +100,7 @@ index 0335497..fcca398 100644
wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch);
wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect,
@@ -1792,7 +1792,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
@@ -1796,7 +1796,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
if (surface->resource.pool == WINED3D_POOL_SCRATCH)
ERR("Not supported on scratch surfaces.\n");
@@ -109,7 +109,7 @@ index 0335497..fcca398 100644
{
TRACE("surface is already in texture\n");
return;
@@ -2103,7 +2103,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -2107,7 +2107,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
create_dib = TRUE;
}
@@ -118,7 +118,7 @@ index 0335497..fcca398 100644
wined3d_resource_free_sysmem(&surface->resource);
width = texture_resource->width;
@@ -3168,9 +3168,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
@@ -3173,9 +3173,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
back->flags = front->flags;
front->flags = tmp_flags;
@@ -131,7 +131,7 @@ index 0335497..fcca398 100644
}
}
@@ -3349,7 +3349,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -3354,7 +3354,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
checkGLcall("glEnable(texture_target)");
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
@@ -140,7 +140,7 @@ index 0335497..fcca398 100644
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -3887,13 +3887,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
@@ -3892,13 +3892,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
{
TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h);
@@ -158,7 +158,7 @@ index 0335497..fcca398 100644
}
/* Context activation is done by the caller. */
@@ -3908,7 +3909,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3913,7 +3914,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
/* TODO: Make this work for modes other than FBO */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return;
@@ -167,7 +167,7 @@ index 0335497..fcca398 100644
{
w = surface->ds_current_size.cx;
h = surface->ds_current_size.cy;
@@ -3934,7 +3935,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3939,7 +3940,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
return;
}
@@ -176,7 +176,7 @@ index 0335497..fcca398 100644
{
TRACE("Surface was discarded, no need copy data.\n");
switch (location)
@@ -3951,17 +3952,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3956,17 +3957,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
default:
FIXME("Unhandled location %#x\n", location);
}
@@ -198,7 +198,7 @@ index 0335497..fcca398 100644
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
return;
@@ -4050,7 +4051,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -4055,7 +4056,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
ERR("Invalid location (%#x) specified.\n", location);
}
@@ -207,7 +207,7 @@ index 0335497..fcca398 100644
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
}
@@ -4059,7 +4060,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location)
@@ -4064,7 +4065,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location)
{
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@@ -216,7 +216,7 @@ index 0335497..fcca398 100644
}
void surface_invalidate_location(struct wined3d_surface *surface, DWORD location)
@@ -4068,9 +4069,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location
@@ -4073,9 +4074,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location
if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
wined3d_texture_set_dirty(surface->container);
@@ -228,7 +228,7 @@ index 0335497..fcca398 100644
ERR("Surface %p does not have any up to date location.\n", surface);
}
@@ -4106,7 +4107,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
@@ -4111,7 +4112,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
UINT size = surface->resource.size;
surface_get_memory(surface, &dst, location);
@@ -237,7 +237,7 @@ index 0335497..fcca398 100644
if (dst.buffer_object)
{
@@ -4139,33 +4140,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
@@ -4144,33 +4145,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
{
const struct wined3d_gl_info *gl_info = context->gl_info;
@@ -277,7 +277,7 @@ index 0335497..fcca398 100644
}
/* Context activation is done by the caller. */
@@ -4205,14 +4206,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4210,14 +4211,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
&& wined3d_resource_is_offscreen(&texture->resource)
@@ -291,16 +291,16 @@ index 0335497..fcca398 100644
- if (surface->locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB)
+ if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB)
&& (surface->resource.format->flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)
&& (surface->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)
&& fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
@@ -4228,13 +4229,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4233,13 +4234,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
return WINED3D_OK;
}
- if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)
+ if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)
&& (!srgb || (surface->resource.format->flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB))
&& (!srgb || (surface->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB))
&& fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format))
@@ -310,7 +310,7 @@ index 0335497..fcca398 100644
WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE;
DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
@@ -4249,7 +4250,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4254,7 +4255,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if (srgb)
{
@@ -319,7 +319,7 @@ index 0335497..fcca398 100644
== WINED3D_LOCATION_TEXTURE_RGB)
{
/* Performance warning... */
@@ -4260,7 +4261,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4265,7 +4266,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
else
{
@@ -328,7 +328,7 @@ index 0335497..fcca398 100644
== WINED3D_LOCATION_TEXTURE_SRGB)
{
/* Performance warning... */
@@ -4270,7 +4271,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4275,7 +4276,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
}
@@ -337,7 +337,7 @@ index 0335497..fcca398 100644
{
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
/* Lets hope we get it from somewhere... */
@@ -4305,7 +4306,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4310,7 +4311,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_remove_pbo(surface, gl_info);
}
@@ -346,7 +346,7 @@ index 0335497..fcca398 100644
if (format.convert)
{
/* This code is entered for texture formats which need a fixup. */
@@ -4361,7 +4362,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
@@ -4366,7 +4367,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
{
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
@@ -355,7 +355,7 @@ index 0335497..fcca398 100644
ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n",
surface);
@@ -4379,12 +4380,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4384,12 +4385,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
{
if (location == WINED3D_LOCATION_TEXTURE_RGB
@@ -370,7 +370,7 @@ index 0335497..fcca398 100644
&& surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE)
{
/* Already up to date, nothing to do. */
@@ -4393,12 +4394,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4398,12 +4399,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
else
{
FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n",
@@ -385,7 +385,7 @@ index 0335497..fcca398 100644
{
TRACE("Location already up to date.\n");
return;
@@ -4412,7 +4413,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4417,7 +4418,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
required_access, surface->resource.access_flags);
}
@@ -394,7 +394,7 @@ index 0335497..fcca398 100644
{
ERR("Surface %p does not have any up to date location.\n", surface);
surface->flags |= SFLAG_LOST;
@@ -4451,7 +4452,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4456,7 +4457,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
surface_validate_location(surface, location);
@@ -403,7 +403,7 @@ index 0335497..fcca398 100644
surface_evict_sysmem(surface);
return;
@@ -5495,8 +5496,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5506,8 +5507,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
/* In principle this would apply to depth blits as well, but we don't
* implement those in the CPU blitter at the moment. */
@@ -414,7 +414,7 @@ index 0335497..fcca398 100644
{
if (scale)
TRACE("Not doing sysmem blit because of scaling.\n");
@@ -5536,8 +5537,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5547,8 +5548,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
color_key = &src_surface->container->async.src_blt_color_key;
blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY;
}
@@ -441,10 +441,10 @@ index 4f4d4df..e702d61 100644
/* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying
* Doesn't work with render_to_fbo because we're not flipping
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c6ac183..e1bc35d 100644
index 46d5e65..f74eddf 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2333,7 +2333,6 @@ struct wined3d_surface
@@ -2334,7 +2334,6 @@ struct wined3d_surface
const struct wined3d_surface_ops *surface_ops;
struct wined3d_texture *container;
void *user_memory;

View File

@@ -1,4 +1,4 @@
From d93611cca0ee39d60a221d4c2422ba183a2a88ef Mon Sep 17 00:00:00 2001
From cebc544748ed5c4f41f39ff600b5768d7aa86505 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 18 Sep 2013 22:30:57 +0200
Subject: wined3d: Introduce helper functions for mapping volumes.
@@ -8,10 +8,10 @@ Subject: wined3d: Introduce helper functions for mapping volumes.
1 file changed, 96 insertions(+), 61 deletions(-)
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index e2c9d4a..ad37cce 100644
index a1fce20..5a4e939 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -476,12 +476,67 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol
@@ -480,12 +480,67 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol
return TRUE;
}
@@ -79,8 +79,8 @@ index e2c9d4a..ad37cce 100644
- const struct wined3d_gl_info *gl_info;
BYTE *base_memory;
const struct wined3d_format *format = volume->resource.format;
@@ -513,58 +568,22 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
const unsigned int fmt_flags = volume->resource.format_flags;
@@ -518,58 +573,22 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags);
@@ -150,7 +150,7 @@ index e2c9d4a..ad37cce 100644
TRACE("Base memory pointer %p.\n", base_memory);
@@ -622,8 +641,34 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour
@@ -627,8 +646,34 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour
return volume_from_resource(resource);
}
@@ -185,7 +185,7 @@ index e2c9d4a..ad37cce 100644
TRACE("volume %p.\n", volume);
if (!volume->resource.map_count)
@@ -632,19 +677,9 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
@@ -637,19 +682,9 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
return WINED3DERR_INVALIDCALL;
}
@@ -209,5 +209,5 @@ index e2c9d4a..ad37cce 100644
volume->resource.map_count--;
--
2.2.1
2.3.5

View File

@@ -1,4 +1,4 @@
From 7e3863693c9694e35f3ae8e72011939fffe63690 Mon Sep 17 00:00:00 2001
From 92eadfba3a70866690a3993fc67252ab29736524 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 c907424..358a29e 100644
index 4c90dee..df6af90 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -461,6 +461,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource,
@@ -473,6 +473,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 c907424..358a29e 100644
default:
ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding));
return NULL;
@@ -483,6 +489,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource,
@@ -495,6 +501,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource,
return;
case WINED3D_LOCATION_SYSMEM:
@@ -35,7 +35,7 @@ index c907424..358a29e 100644
default:
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index e534a9f..d720d26 100644
index c12b404..77d7890 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 e534a9f..d720d26 100644
if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB))
{
TRACE("Not dirtified, nothing to do.\n");
@@ -2733,6 +2707,8 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso
@@ -2659,6 +2633,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 e534a9f..d720d26 100644
TRACE("surface %p.\n", surface);
if (!surface->resource.map_count)
@@ -2742,6 +2718,12 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface)
@@ -2668,6 +2644,12 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface)
}
--surface->resource.map_count;
@@ -97,9 +97,9 @@ index e534a9f..d720d26 100644
surface->surface_ops->surface_unmap(surface);
return WINED3D_OK;
@@ -2752,8 +2734,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
{
@@ -2679,8 +2661,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
const struct wined3d_format *format = surface->resource.format;
unsigned int fmt_flags = surface->resource.format_flags;
struct wined3d_device *device = surface->resource.device;
- struct wined3d_context *context;
- const struct wined3d_gl_info *gl_info;
@@ -107,7 +107,7 @@ index e534a9f..d720d26 100644
BYTE *base_memory;
TRACE("surface %p, map_desc %p, rect %s, flags %#x.\n",
@@ -2795,6 +2776,9 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2722,6 +2703,9 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
}
}
@@ -117,7 +117,7 @@ index e534a9f..d720d26 100644
surface_prepare_map_memory(surface);
if (flags & WINED3D_MAP_DISCARD)
{
@@ -2804,51 +2788,19 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2731,51 +2715,19 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
}
else
{
@@ -170,8 +170,8 @@ index e534a9f..d720d26 100644
+ if (context)
+ context_release(context);
if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH)
if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH)
map_desc->row_pitch = surface->resource.width * format->byte_count;
--
2.2.1
2.3.5

View File

@@ -1,4 +1,4 @@
From c17af045c56511c51b3c8d8873c10a0df66bee5d Mon Sep 17 00:00:00 2001
From dddaa27583d0479c985c09b2e37f63314fd2d7a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Mon, 16 Sep 2013 22:44:33 +0200
Subject: wined3d: Introduce a function to retrieve resource memory.
@@ -10,10 +10,10 @@ Subject: wined3d: Introduce a function to retrieve resource memory.
3 files changed, 38 insertions(+), 39 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 7d11fa0..9c6cf70 100644
index 4454922..0ef2155 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -432,6 +432,36 @@ DWORD wined3d_resource_access_from_location(DWORD location)
@@ -435,6 +435,36 @@ DWORD wined3d_resource_access_from_location(DWORD location)
}
}
@@ -51,10 +51,10 @@ index 7d11fa0..9c6cf70 100644
void wined3d_resource_load_location(struct wined3d_resource *resource,
struct wined3d_context *context, DWORD location)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 0815cc9..1a6152a 100644
index 4f12b02..66a7bd7 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -478,39 +478,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
@@ -479,39 +479,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
return WINED3D_OK;
}
@@ -94,16 +94,16 @@ index 0815cc9..1a6152a 100644
static void surface_prepare_buffer(struct wined3d_surface *surface)
{
struct wined3d_context *context;
@@ -1271,7 +1238,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
@@ -1272,7 +1239,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
return;
}
- surface_get_memory(surface, &data, dst_location);
+ wined3d_resource_get_memory(&surface->resource, dst_location, &data);
if (format->flags & WINED3DFMT_FLAG_COMPRESSED)
if (surface->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED)
{
@@ -1637,7 +1604,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1641,7 +1608,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE);
@@ -112,7 +112,7 @@ index 0815cc9..1a6152a 100644
wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch);
wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect,
@@ -2871,7 +2838,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
@@ -2876,7 +2843,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
struct wined3d_bo_address data;
UINT row_pitch, slice_pitch;
@@ -121,7 +121,7 @@ index 0815cc9..1a6152a 100644
/* Context_release does not restore the original context in case of
* nested context_acquire calls. Only read_from_framebuffer and
@@ -4010,8 +3977,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
@@ -4015,8 +3982,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
struct wined3d_bo_address dst, src;
UINT size = surface->resource.size;
@@ -132,7 +132,7 @@ index 0815cc9..1a6152a 100644
if (dst.buffer_object)
{
@@ -4223,7 +4190,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4228,7 +4195,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_remove_pbo(surface, gl_info);
}
@@ -142,10 +142,10 @@ index 0815cc9..1a6152a 100644
{
/* This code is entered for texture formats which need a fixup. */
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 1ab7a01..26b64b7 100644
index 12b1efd..c38451e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2157,6 +2157,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE
@@ -2158,6 +2158,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE
void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource,
const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN;

View File

@@ -1,4 +1,4 @@
From e13017df9a84b37e8452e16feebf5c5f06a132a8 Mon Sep 17 00:00:00 2001
From 1c3c1a3c7117915d4aa9bc8a4c533cde76133080 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 13:36:00 +0200
Subject: wined3d: Make surface_ops->unmap specific for front buffers.
@@ -9,7 +9,7 @@ Subject: wined3d: Make surface_ops->unmap specific for front buffers.
2 files changed, 17 insertions(+), 30 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 4815965..50d7e74 100644
index 66a7bd7..178a949 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -681,31 +681,22 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
@@ -43,7 +43,7 @@ index 4815965..50d7e74 100644
- if (context)
- context_release(context);
- }
- else if (surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))
- else if (surface->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))
- FIXME("Depth / stencil buffer locking is not implemented.\n");
+ if (device->d3d_initialized)
+ context = context_acquire(surface->resource.device, NULL);
@@ -53,7 +53,7 @@ index 4815965..50d7e74 100644
}
static BOOL surface_is_full_rect(const struct wined3d_surface *surface, const RECT *r)
@@ -1218,7 +1209,7 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour
@@ -1162,7 +1153,7 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour
static const struct wined3d_surface_ops surface_ops =
{
surface_private_setup,
@@ -62,7 +62,7 @@ index 4815965..50d7e74 100644
};
/*****************************************************************************
@@ -1262,21 +1253,15 @@ static HRESULT gdi_surface_private_setup(struct wined3d_surface *surface)
@@ -1206,21 +1197,15 @@ static HRESULT gdi_surface_private_setup(struct wined3d_surface *surface)
return WINED3D_OK;
}
@@ -87,7 +87,7 @@ index 4815965..50d7e74 100644
};
/* This call just downloads data, the caller is responsible for binding the
@@ -2530,7 +2515,9 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface)
@@ -2610,7 +2595,9 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface)
if (context)
context_release(context);
@@ -99,10 +99,10 @@ index 4815965..50d7e74 100644
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index df2031a..d69a581 100644
index c38451e..96cdac5 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2300,7 +2300,7 @@ struct fbo_entry
@@ -2336,7 +2336,7 @@ struct fbo_entry
struct wined3d_surface_ops
{
HRESULT (*surface_private_setup)(struct wined3d_surface *surface);
@@ -112,5 +112,5 @@ index df2031a..d69a581 100644
struct wined3d_surface
--
2.1.3
2.3.5

View File

@@ -1,4 +1,4 @@
From ba90a0acc5f192214213ee08fe82285e89700f8e Mon Sep 17 00:00:00 2001
From da397c28f35b9220eb4bf258a49b3a778732cd28 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
@@ -11,10 +11,10 @@ Subject: wined3d: Move check_block_align to resource.c
4 files changed, 43 insertions(+), 45 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 8a1d8a1..d559fe8 100644
index 0ef2155..ddcfdad 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -606,3 +606,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru
@@ -618,3 +618,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru
return FALSE;
}
}
@@ -47,10 +47,10 @@ index 8a1d8a1..d559fe8 100644
+ return TRUE;
+}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 44e3f72..527017a 100644
index 178a949..0f58be1 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1531,23 +1531,18 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
@@ -1475,23 +1475,18 @@ 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)
{
@@ -86,10 +86,10 @@ index 44e3f72..527017a 100644
HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point,
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index d77fc21..7808ed5 100644
index 1cfeb04..4d7b349 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -375,34 +375,6 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum
@@ -379,34 +379,6 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum
return &volume->resource;
}
@@ -124,21 +124,21 @@ index d77fc21..7808ed5 100644
static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume,
const struct wined3d_box *box)
{
@@ -452,7 +424,8 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
@@ -457,7 +429,8 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
WARN("Map box is invalid.\n");
return WINED3DERR_INVALIDCALL;
}
- if ((format->flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box))
+ if ((format->flags & WINED3DFMT_FLAG_BLOCKS) &&
- if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box))
+ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) &&
+ !wined3d_resource_check_block_align(&volume->resource, box))
{
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 e7fd8ad..e32d650 100644
index 96cdac5..855375d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2124,6 +2124,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
@@ -2155,6 +2155,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;
@@ -148,5 +148,5 @@ index e7fd8ad..e32d650 100644
BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource,
const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN;
--
2.2.1
2.3.5

View File

@@ -1,4 +1,4 @@
From 9e47e310ee0c12e0793312777a1f170fcbd363f0 Mon Sep 17 00:00:00 2001
From a161dbd1575b744e34b6282b0c7a21cab0668407 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 17:51:38 +0200
Subject: wined3d: Move most of volume_map to resource.c
@@ -13,10 +13,10 @@ boundary check behaviours.
3 files changed, 123 insertions(+), 95 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index d9e2216..2443a9b 100644
index 8903353..b497955 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -682,3 +682,117 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource,
@@ -694,3 +694,117 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource,
return TRUE;
}
@@ -135,10 +135,10 @@ index d9e2216..2443a9b 100644
+ return WINED3D_OK;
+}
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index c11c98c..7e5576b 100644
index 4d7b349..3a85103 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -386,25 +386,15 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol
@@ -404,26 +404,16 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol
HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
{
@@ -147,6 +147,7 @@ index c11c98c..7e5576b 100644
- BYTE *base_memory;
+ HRESULT hr;
const struct wined3d_format *format = volume->resource.format;
const unsigned int fmt_flags = volume->resource.format_flags;
- TRACE("volume %p, map_desc %p, box %p, flags %#x.\n",
- volume, map_desc, box, flags);
@@ -165,7 +166,7 @@ index c11c98c..7e5576b 100644
if (!wined3d_volume_check_box_dimensions(volume, box))
{
WARN("Map box is invalid.\n");
@@ -418,74 +408,11 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
@@ -437,74 +427,11 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
return WINED3DERR_INVALIDCALL;
}
@@ -190,7 +191,7 @@ index c11c98c..7e5576b 100644
-
- TRACE("Base memory pointer %p.\n", base_memory);
-
- if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH)
- if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH)
- {
- map_desc->row_pitch = volume->resource.width * format->byte_count;
- map_desc->slice_pitch = map_desc->row_pitch * volume->resource.height;
@@ -210,7 +211,7 @@ index c11c98c..7e5576b 100644
- TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n",
- box, box->left, box->top, box->right, box->bottom, box->front, box->back);
-
- if ((format->flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS)
- if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS)
- {
- /* Compressed textures are block based, so calculate the offset of
- * the block that contains the top-left pixel of the locked rectangle. */
@@ -244,7 +245,7 @@ index c11c98c..7e5576b 100644
}
struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resource *resource)
@@ -495,23 +422,7 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour
@@ -514,23 +441,7 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour
HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
{
@@ -270,10 +271,10 @@ index c11c98c..7e5576b 100644
static ULONG volume_resource_incref(struct wined3d_resource *resource)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 81c9cfe..43e1c21 100644
index f504555..1d0d644 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2126,12 +2126,15 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO
@@ -2168,12 +2168,15 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_resource_load_location(struct wined3d_resource *resource,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
@@ -290,5 +291,5 @@ index 81c9cfe..43e1c21 100644
void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
--
2.1.3
2.3.5

View File

@@ -1,4 +1,4 @@
From 4f15b07cc64a3d364197a0ac73dd561c7b969183 Mon Sep 17 00:00:00 2001
From a63cedcd66546c8005162c860211ce39e7e4cbcd 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.
@@ -10,10 +10,10 @@ Subject: wined3d: Use resource_map for surface_map.
3 files changed, 22 insertions(+), 89 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 2443a9b..8486dc3 100644
index b497955..12a26d8 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -783,7 +783,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource)
@@ -795,7 +795,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 2443a9b..8486dc3 100644
if (device->d3d_initialized)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 5b2359e..16233d3 100644
index 334335f..cf9c938 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2394,46 +2394,25 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso
@@ -2474,47 +2474,26 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso
HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface)
{
@@ -64,6 +64,7 @@ index 5b2359e..16233d3 100644
{
+ struct wined3d_box box;
const struct wined3d_format *format = surface->resource.format;
unsigned int fmt_flags = surface->resource.format_flags;
- struct wined3d_device *device = surface->resource.device;
- struct wined3d_context *context = NULL;
- BYTE *base_memory;
@@ -77,9 +78,9 @@ index 5b2359e..16233d3 100644
- return WINED3DERR_INVALIDCALL;
- }
if ((format->flags & WINED3DFMT_FLAG_BLOCKS) && rect
if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && rect
&& !surface_check_block_align(surface, rect))
@@ -2445,11 +2424,6 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2526,11 +2505,6 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
return WINED3DERR_INVALIDCALL;
}
@@ -91,7 +92,7 @@ index 5b2359e..16233d3 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
@@ -2465,72 +2439,26 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2546,72 +2520,26 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
}
}
@@ -129,7 +130,7 @@ index 5b2359e..16233d3 100644
- if (context)
- context_release(context);
-
- if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH)
- if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH)
- map_desc->row_pitch = surface->resource.width * format->byte_count;
else
- wined3d_resource_get_pitch(&surface->resource, &map_desc->row_pitch, &map_desc->slice_pitch);
@@ -145,7 +146,7 @@ index 5b2359e..16233d3 100644
}
- else
- {
- if ((format->flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS)
- if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS)
- {
- /* Compressed textures are block based, so calculate the offset of
- * the block that contains the top-left pixel of the locked rectangle. */
@@ -174,10 +175,10 @@ index 5b2359e..16233d3 100644
HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 7e5576b..7ce5331 100644
index 3a85103..a656736 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -422,7 +422,12 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour
@@ -441,7 +441,12 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour
HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
{
@@ -192,5 +193,5 @@ index 7e5576b..7ce5331 100644
static ULONG volume_resource_incref(struct wined3d_resource *resource)
--
2.1.3
2.3.5

View File

@@ -1,4 +1,4 @@
From 10e5f290ec6e90c6a53df8b0e60fe69e6bbee6aa Mon Sep 17 00:00:00 2001
From 341f5f1a37a6da02cd3ed172d9e3c3d2653220b5 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.
@@ -8,12 +8,12 @@ Subject: wined3d: Don't call the public map function in surface_cpu_blt.
1 file changed, 72 insertions(+), 35 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 50faee0..9647c2a 100644
index 08009da..b562f7a 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4489,21 +4489,36 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
int bpp, srcheight, srcwidth, dstheight, dstwidth, width;
@@ -4428,21 +4428,36 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
const struct wined3d_format *src_format, *dst_format;
unsigned int src_fmt_flags, dst_fmt_flags;
struct wined3d_texture *src_texture = NULL;
- struct wined3d_map_desc dst_map, src_map;
+ void *src_data = NULL, *dst_data = NULL;
@@ -50,9 +50,9 @@ index 50faee0..9647c2a 100644
+ src_row_pitch = dst_row_pitch;
src_format = dst_surface->resource.format;
dst_format = src_format;
}
@@ -4512,6 +4527,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
dst_format = dst_surface->resource.format;
dst_fmt_flags = dst_surface->resource.format_flags;
@@ -4454,6 +4469,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
dst_fmt_flags = dst_surface->resource.format_flags;
if (src_surface)
{
+ if (!wined3d_resource_prepare_map_memory(&src_surface->resource, context))
@@ -64,7 +64,7 @@ index 50faee0..9647c2a 100644
if (dst_surface->resource.format->id != src_surface->resource.format->id)
{
if (!(src_texture = surface_convert_format(src_surface, dst_format->id)))
@@ -4522,7 +4543,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4464,7 +4485,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));
}
@@ -73,10 +73,10 @@ index 50faee0..9647c2a 100644
+ wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch);
+ src_data = wined3d_resource_get_map_ptr(&src_surface->resource, context, 0);
src_format = src_surface->resource.format;
src_fmt_flags = src_surface->resource.format_flags;
}
else
@@ -4530,7 +4553,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
src_format = dst_format;
@@ -4474,7 +4497,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);
@@ -85,7 +85,7 @@ index 50faee0..9647c2a 100644
}
bpp = dst_surface->resource.format->byte_count;
@@ -4541,15 +4565,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4485,15 +4509,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
width = (dst_rect->right - dst_rect->left) * bpp;
if (src_surface)
@@ -104,9 +104,9 @@ index 50faee0..9647c2a 100644
+ + ((dst_rect->top / dst_format->block_height) * dst_row_pitch)
+ + ((dst_rect->left / dst_format->block_width) * dst_format->block_byte_count);
if (src_format->flags & dst_format->flags & WINED3DFMT_FLAG_BLOCKS)
if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS)
{
@@ -4584,7 +4605,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4528,7 +4549,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
}
hr = surface_cpu_blt_compressed(sbase, dbuf,
@@ -115,7 +115,7 @@ index 50faee0..9647c2a 100644
src_format, flags, fx);
goto release;
}
@@ -4592,7 +4613,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4536,7 +4557,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 +124,7 @@ index 50faee0..9647c2a 100644
flags &= ~WINEDDBLT_COLORFILL;
}
@@ -4641,19 +4662,19 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4585,19 +4606,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 +150,7 @@ index 50faee0..9647c2a 100644
memcpy(dbuf, sbuf, width);
}
}
@@ -4663,8 +4684,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4607,8 +4628,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 +161,7 @@ index 50faee0..9647c2a 100644
}
}
}
@@ -4673,9 +4694,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4617,9 +4638,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 +173,7 @@ index 50faee0..9647c2a 100644
}
}
}
@@ -4685,13 +4706,13 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
@@ -4629,13 +4650,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 +189,7 @@ index 50faee0..9647c2a 100644
}
else
{
@@ -4738,14 +4759,14 @@ do { \
@@ -4682,14 +4703,14 @@ do { \
}
#undef STRETCH_ROW
}
@@ -206,7 +206,7 @@ index 50faee0..9647c2a 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))
@@ -4795,7 +4816,7 @@ do { \
@@ -4739,7 +4760,7 @@ do { \
LONG tmpxy;
dTopLeft = dbuf;
dTopRight = dbuf + ((dstwidth - 1) * bpp);
@@ -215,7 +215,7 @@ index 50faee0..9647c2a 100644
dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp);
if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY)
@@ -4878,7 +4899,7 @@ do { \
@@ -4822,7 +4843,7 @@ do { \
type *d = (type *)dbuf, *dx, tmp; \
for (y = sy = 0; y < dstheight; ++y, sy += yinc) \
{ \
@@ -224,7 +224,7 @@ index 50faee0..9647c2a 100644
dx = d; \
for (x = sx = 0; x < dstwidth; ++x, sx += xinc) \
{ \
@@ -4911,7 +4932,7 @@ do { \
@@ -4855,7 +4876,7 @@ do { \
BYTE *d = dbuf, *dx;
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
@@ -233,7 +233,7 @@ index 50faee0..9647c2a 100644
dx = d;
for (x = sx = 0; x < dstwidth; ++x, sx+= xinc)
{
@@ -4942,6 +4963,10 @@ do { \
@@ -4886,6 +4907,10 @@ do { \
}
}
@@ -244,7 +244,7 @@ index 50faee0..9647c2a 100644
error:
if (flags && FIXME_ON(d3d_surface))
{
@@ -4949,12 +4974,24 @@ error:
@@ -4893,12 +4918,24 @@ error:
}
release:
@@ -273,5 +273,5 @@ index 50faee0..9647c2a 100644
return hr;
}
--
2.3.2
2.3.5

View File

@@ -1,4 +1,4 @@
From d38b136f82ef53ae256d8989312783f0cba3a437 Mon Sep 17 00:00:00 2001
From f3e0bbee4a69994ffdae5e15c180d65104ed515c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 20 Dec 2012 13:09:17 +0100
Subject: wined3d: Move the framebuffer into wined3d_state
@@ -20,10 +20,10 @@ Subject: wined3d: Move the framebuffer into wined3d_state
13 files changed, 171 insertions(+), 126 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 0d61251..2561afc 100644
index c3878ea..78ecff7 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -706,7 +706,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv,
@@ -707,7 +707,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv,
{
const struct wined3d_shader *pshader = state->shader[WINED3D_SHADER_TYPE_PIXEL];
const struct arb_ps_compiled_shader *gl_shader = priv->compiled_fprog;
@@ -32,7 +32,7 @@ index 0d61251..2561afc 100644
/* Load DirectX 9 float constants for pixel shader */
priv->highest_dirty_ps_const = shader_arb_load_constantsF(pshader, gl_info, GL_FRAGMENT_PROGRAM_ARB,
@@ -4711,7 +4711,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context
@@ -4665,7 +4665,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context
}
else
{
@@ -42,7 +42,7 @@ index 0d61251..2561afc 100644
}
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 5644ea0..bfedf0e 100644
index 103d7eb..8f1860b 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1453,6 +1453,12 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
@@ -129,7 +129,7 @@ index 5644ea0..bfedf0e 100644
WORD map;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index d66850a..639dc4f 100644
index 874129a..22a2de8 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -290,7 +290,7 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@@ -168,7 +168,7 @@ index d66850a..639dc4f 100644
if (!prev != !op->view)
{
@@ -1002,7 +1002,7 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1004,7 +1004,7 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
state_cleanup(&cs->state);
memset(&cs->state, 0, sizeof(cs->state));
@@ -177,7 +177,7 @@ index d66850a..639dc4f 100644
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT)))
ERR("Failed to initialize CS state, hr %#x.\n", hr);
}
@@ -1085,17 +1085,9 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1087,17 +1087,9 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs))))
return NULL;
@@ -196,7 +196,7 @@ index d66850a..639dc4f 100644
HeapFree(GetProcessHeap(), 0, cs);
return NULL;
}
@@ -1116,7 +1108,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1118,7 +1110,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
void wined3d_cs_destroy(struct wined3d_cs *cs)
{
state_cleanup(&cs->state);
@@ -205,7 +205,7 @@ index d66850a..639dc4f 100644
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 5836edf..13a1f0c 100644
index c695c2f..4e83d14 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -860,7 +860,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi
@@ -318,7 +318,7 @@ index 5836edf..13a1f0c 100644
return WINED3D_OK;
@@ -1928,7 +1906,7 @@ static void resolve_depth_buffer(struct wined3d_state *state)
|| !(texture->resource.format->flags & WINED3DFMT_FLAG_DEPTH))
|| !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH))
return;
surface = surface_from_resource(texture->sub_resources[0]);
- if (!(depth_stencil = wined3d_rendertarget_view_get_surface(state->fb->depth_stencil)))
@@ -577,10 +577,10 @@ index f2c2f42..c6a72fc 100644
surface_modify_ds_location(ds, location, ds->ds_current_size.cx, ds->ds_current_size.cy);
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index b1a0f85..d1613cb 100644
index 655bb33..eddf6b5 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1088,7 +1088,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
@@ -1083,7 +1083,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
const struct wined3d_state *state = &shader->device->state;
const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args;
const struct wined3d_gl_info *gl_info = context->gl_info;
@@ -590,7 +590,7 @@ index b1a0f85..d1613cb 100644
const struct wined3d_shader_lconst *lconst;
const char *prefix;
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 0bedf24..70c4635 100644
index d5a90c0..2746ba1 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -2344,7 +2344,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
@@ -603,7 +603,7 @@ index 0bedf24..70c4635 100644
{
static unsigned int warned = 0;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 7efbf3d..ceb1986 100644
index 91f3485..6105283 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -105,7 +105,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_
@@ -788,10 +788,10 @@ index 62b1841..76a80e2 100644
if (FAILED(hr = stateblock_allocate_shader_constants(stateblock)))
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 5d611c8..a053f34 100644
index b562f7a..870c32e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3413,8 +3413,8 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
@@ -3416,8 +3416,8 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
enum wined3d_texture_filter_type filter)
{
struct wined3d_device *device = dst_surface->resource.device;
@@ -837,7 +837,7 @@ index 1686e30..09408e4 100644
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c325a06..e80ceb9 100644
index 1d0d644..7253e54 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1124,6 +1124,36 @@ struct wined3d_timestamp_query
@@ -915,7 +915,7 @@ index c325a06..e80ceb9 100644
struct wined3d_surface *onscreen_depth_stencil;
struct wined3d_rendertarget_view *auto_depth_stencil_view;
@@ -2545,9 +2569,8 @@ struct wined3d_stateblock
@@ -2539,9 +2563,8 @@ struct wined3d_stateblock
void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN;
void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN;
@@ -927,7 +927,7 @@ index c325a06..e80ceb9 100644
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;
struct wined3d_cs_ops
@@ -2560,7 +2583,6 @@ struct wined3d_cs
@@ -2554,7 +2577,6 @@ struct wined3d_cs
{
const struct wined3d_cs_ops *ops;
struct wined3d_device *device;

View File

@@ -1,4 +1,4 @@
From f095c8ad65086b4c17879e878f6387ef2f211e21 Mon Sep 17 00:00:00 2001
From a88c75ba7db54b3c8f834b6534ebc5d4ae4733d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Mon, 29 Apr 2013 18:49:53 +0200
Subject: wined3d: Send blits through the command stream.
@@ -12,7 +12,7 @@ between surface_blt and surface_blt_ugly isn't particularly nice.
3 files changed, 226 insertions(+), 139 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 032c1a2..0e758c8 100644
index 8087812..9531b2f 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -74,6 +74,7 @@ enum wined3d_cs_op
@@ -42,7 +42,7 @@ index 032c1a2..0e758c8 100644
/* FIXME: The list synchronization probably isn't particularly fast. */
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
@@ -1504,6 +1517,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data)
@@ -1506,6 +1519,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data)
struct wined3d_device *device = cs->device;
struct wined3d_context *context;
@@ -52,7 +52,7 @@ index 032c1a2..0e758c8 100644
context = context_acquire(device, NULL);
context->gl_info->gl_ops.gl.p_glFinish();
context_release(context);
@@ -1715,6 +1731,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -1717,6 +1733,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
cs->ops->submit(cs);
}
@@ -91,7 +91,7 @@ index 032c1a2..0e758c8 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
@@ -1755,6 +1803,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1757,6 +1805,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
/* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light,
/* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable,
@@ -99,7 +99,7 @@ index 032c1a2..0e758c8 100644
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
@@ -1829,6 +1878,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param)
@@ -1831,6 +1880,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param)
TRACE("Started.\n");
@@ -108,10 +108,10 @@ index 032c1a2..0e758c8 100644
{
struct wined3d_cs_block *block;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 87f6ef2..747c42a 100644
index a4a659b..329ec45 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4991,14 +4991,13 @@ const struct blit_shader cpu_blit = {
@@ -5000,14 +5000,13 @@ const struct blit_shader cpu_blit = {
cpu_blit_blit_surface,
};
@@ -128,7 +128,7 @@ index 87f6ef2..747c42a 100644
BOOL scale, convert;
static const DWORD simple_blit = WINEDDBLT_ASYNC
@@ -5009,111 +5008,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5018,111 +5017,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
| WINEDDBLT_DEPTHFILL
| WINEDDBLT_DONOTWAIT;
@@ -240,7 +240,7 @@ index 87f6ef2..747c42a 100644
if (!device->d3d_initialized)
{
WARN("D3D not initialized, using fallback.\n");
@@ -5156,8 +5050,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5165,8 +5059,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
}
scale = src_surface
@@ -250,8 +250,8 @@ index 87f6ef2..747c42a 100644
+ || src_rect->bottom - src_rect->top != dst_rect->bottom - dst_rect->top);
convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id;
dst_ds_flags = dst_surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
@@ -5175,22 +5069,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
dst_ds_flags = dst_surface->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
@@ -5184,22 +5078,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
TRACE("Depth fill.\n");
if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth))
@@ -279,7 +279,7 @@ index 87f6ef2..747c42a 100644
}
}
else
@@ -5221,8 +5109,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5230,8 +5118,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
palette, fx->u5.dwFillColor, &color))
goto fallback;
@@ -290,7 +290,7 @@ index 87f6ef2..747c42a 100644
}
else
{
@@ -5250,9 +5138,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5259,9 +5147,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
TRACE("Not doing upload because of format conversion.\n");
else
{
@@ -302,7 +302,7 @@ index 87f6ef2..747c42a 100644
{
if (!wined3d_resource_is_offscreen(&dst_surface->container->resource))
{
@@ -5261,7 +5149,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5270,7 +5158,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
dst_surface->container->resource.draw_binding);
context_release(context);
}
@@ -311,7 +311,7 @@ index 87f6ef2..747c42a 100644
}
}
}
@@ -5285,50 +5173,191 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5294,50 +5182,191 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0);
dst_swapchain->desc.swap_effect = swap_effect;
@@ -517,10 +517,10 @@ index 87f6ef2..747c42a 100644
static const struct wined3d_resource_ops surface_resource_ops =
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 85a7ca1..ee9df98 100644
index 7186b81..a00f5cc 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2452,6 +2452,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
@@ -2446,6 +2446,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info,
const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point,
BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN;
@@ -530,7 +530,7 @@ index 85a7ca1..ee9df98 100644
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;
@@ -2601,6 +2604,7 @@ struct wined3d_cs
@@ -2595,6 +2598,7 @@ struct wined3d_cs
struct wined3d_device *device;
struct wined3d_state state;
HANDLE thread;
@@ -538,7 +538,7 @@ index 85a7ca1..ee9df98 100644
DWORD tls_idx;
struct wined3d_surface *onscreen_depth_stencil;
@@ -2679,6 +2683,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs,
@@ -2673,6 +2677,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs,
GLenum primitive_type) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN;

File diff suppressed because it is too large Load Diff