diff --git a/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch b/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch index 04017c7a..cd5a4460 100644 --- a/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch +++ b/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch @@ -1,4 +1,4 @@ -From e54e307937b44f9be63d54abfca483070004b924 Mon Sep 17 00:00:00 2001 +From be8e04d375183cbd4dbca29f4ffe6473ef32a7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 19 Sep 2013 14:22:24 +0200 Subject: wined3d: Merge get_pitch functions. @@ -97,7 +97,7 @@ index 205f074..3375c0f 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 a83d46f..00427f9 100644 +index a49f521..5a8b250 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -363,6 +363,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) @@ -166,7 +166,7 @@ index a83d46f..00427f9 100644 TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n", @@ -1641,10 +1643,10 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P - wined3d_texture_bind(dst_surface->container, context, FALSE); + wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); surface_get_memory(src_surface, &data, src_surface->locations); - src_pitch = wined3d_surface_get_pitch(src_surface); @@ -176,9 +176,9 @@ index a83d46f..00427f9 100644 - src_pitch, dst_point, FALSE, wined3d_const_bo_address(&data)); + src_row_pitch, dst_point, FALSE, wined3d_const_bo_address(&data)); - context_invalidate_active_texture(context); + context_release(context); -@@ -1927,25 +1929,6 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface) +@@ -1925,25 +1927,6 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface) return WINED3D_OK; } @@ -204,7 +204,7 @@ index a83d46f..00427f9 100644 HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y) { LONG w, h; -@@ -2126,20 +2109,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -2124,20 +2107,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; valid_location = WINED3D_LOCATION_USER_MEMORY; } @@ -232,7 +232,7 @@ index a83d46f..00427f9 100644 } /* The format might be changed to a format that needs conversion. -@@ -2758,7 +2742,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2756,7 +2740,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) map_desc->row_pitch = surface->resource.width * format->byte_count; else @@ -241,7 +241,7 @@ index a83d46f..00427f9 100644 map_desc->slice_pitch = 0; if (!rect) -@@ -2885,6 +2869,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2883,6 +2867,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc int i; BOOL srcIsUpsideDown; struct wined3d_bo_address data; @@ -249,7 +249,7 @@ index a83d46f..00427f9 100644 surface_get_memory(surface, &data, dst_location); -@@ -2921,8 +2906,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2919,8 +2904,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc } /* Setup pixel store pack state -- to glReadPixels into the correct place */ @@ -260,7 +260,7 @@ index a83d46f..00427f9 100644 checkGLcall("glPixelStorei"); gl_info->gl_ops.gl.p_glReadPixels(0, 0, -@@ -2939,7 +2924,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2937,7 +2922,9 @@ 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. */ @@ -271,7 +271,7 @@ index a83d46f..00427f9 100644 if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) goto error; -@@ -4173,7 +4160,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4118,7 +4105,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; @@ -280,7 +280,7 @@ index a83d46f..00427f9 100644 struct wined3d_bo_address data; struct wined3d_format format; POINT dst_point = {0, 0}; -@@ -4261,7 +4248,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4206,7 +4193,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, wined3d_texture_bind_and_dirtify(texture, context, srgb); width = surface->resource.width; @@ -289,7 +289,7 @@ index a83d46f..00427f9 100644 format = *texture->resource.format; if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) -@@ -4299,9 +4286,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4244,9 +4231,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, context_release(context); return E_OUTOFMEMORY; } @@ -301,7 +301,7 @@ index a83d46f..00427f9 100644 data.addr = mem; } else if (conversion) -@@ -4321,14 +4308,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4266,14 +4253,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } if (texture->swapchain && texture->swapchain->palette) palette = texture->swapchain->palette; @@ -320,7 +320,7 @@ index a83d46f..00427f9 100644 context_release(context); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 34c69d1..be7f0d3 100644 +index 78d1266..5e68257 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1258,7 +1258,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso @@ -333,7 +333,7 @@ index 34c69d1..be7f0d3 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 91325dc..4fbb6b0 100644 +index 357608f..1a5e629 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -40,30 +40,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) @@ -364,10 +364,10 @@ index 91325dc..4fbb6b0 100644 - TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); -} - + /* This call just uploads data, the caller is responsible for binding the + * correct texture. */ /* Context activation is done by the caller. */ - void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, - const struct wined3d_const_bo_address *data) -@@ -93,7 +69,7 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine +@@ -95,7 +71,7 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine dst_row_pitch = width * format->conv_byte_count; dst_slice_pitch = dst_row_pitch * height; @@ -376,7 +376,7 @@ index 91325dc..4fbb6b0 100644 converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth); format->convert(data->addr, converted_mem, src_row_pitch, src_slice_pitch, -@@ -636,7 +612,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -642,7 +618,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, } else { @@ -406,10 +406,10 @@ index bc1129f..fcabd53 100644 @ cdecl wined3d_surface_get_resource(ptr) @ cdecl wined3d_surface_getdc(ptr ptr) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index cdaab07..844c2af 100644 +index 8e58e4b..2656399 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2127,6 +2127,7 @@ struct wined3d_resource +@@ -2121,6 +2121,7 @@ struct wined3d_resource UINT size; DWORD priority; void *heap_memory; @@ -417,7 +417,7 @@ index cdaab07..844c2af 100644 struct list resource_list_entry; void *parent; -@@ -2291,7 +2292,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN +@@ -2285,7 +2286,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; @@ -425,7 +425,7 @@ index cdaab07..844c2af 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; -@@ -2341,7 +2341,6 @@ struct wined3d_surface +@@ -2335,7 +2335,6 @@ struct wined3d_surface DWORD flags; diff --git a/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch b/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch index 5102c79c..16173f4c 100644 --- a/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch +++ b/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch @@ -1,4 +1,4 @@ -From 803a1823ebff0c62c4ba50f561d4968d8ffbd8c1 Mon Sep 17 00:00:00 2001 +From ef006d30c46de0526e6710ff23b11449cb2efe0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 17 Nov 2013 20:19:24 +0100 Subject: wined3d: Pass a context to surface_load_location. @@ -14,10 +14,10 @@ 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 843905a..8c5844a 100644 +index 1d7cf9c..ac4c7cb 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -2201,7 +2201,7 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing, +@@ -2208,7 +2208,7 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing, return TRUE; } @@ -26,7 +26,7 @@ index 843905a..8c5844a 100644 static void context_validate_onscreen_formats(struct wined3d_context *context, const struct wined3d_rendertarget_view *depth_stencil) { -@@ -2217,7 +2217,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, +@@ -2224,7 +2224,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ @@ -36,7 +36,7 @@ index 843905a..8c5844a 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 649f324..c6c43bc 100644 +index 5f44a1a..725897f 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 @@ -77,10 +77,10 @@ index 649f324..c6c43bc 100644 { render_offscreen = context->render_offscreen; diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index 98e7cf4..f7fd9a4 100644 +index c0654a6..913ada5 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c -@@ -608,6 +608,15 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co +@@ -611,6 +611,15 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co if (!index_count) return; @@ -96,7 +96,7 @@ index 98e7cf4..f7fd9a4 100644 if (state->render_states[WINED3D_RS_COLORWRITEENABLE]) { /* Invalidate the back buffer memory so LockRect will read it the next time */ -@@ -616,21 +625,12 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co +@@ -619,21 +628,12 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]); if (target) { @@ -120,7 +120,7 @@ index 98e7cf4..f7fd9a4 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 9efc5a8..30e2a0f 100644 +index ff66881..e7b139b 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -752,7 +752,16 @@ static void surface_unmap(struct wined3d_surface *surface) @@ -179,7 +179,7 @@ index 9efc5a8..30e2a0f 100644 if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface; else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface; -@@ -1198,6 +1207,9 @@ static void surface_unload(struct wined3d_resource *resource) +@@ -1142,6 +1151,9 @@ static void surface_unload(struct wined3d_resource *resource) TRACE("surface %p.\n", surface); @@ -189,7 +189,7 @@ index 9efc5a8..30e2a0f 100644 if (resource->pool == WINED3D_POOL_DEFAULT) { /* Default pool resources are supposed to be destroyed before Reset is called. -@@ -1223,13 +1235,10 @@ static void surface_unload(struct wined3d_resource *resource) +@@ -1167,13 +1179,10 @@ static void surface_unload(struct wined3d_resource *resource) else { surface_prepare_map_memory(surface); @@ -204,16 +204,16 @@ index 9efc5a8..30e2a0f 100644 /* Destroy PBOs, but load them into real sysmem before */ if (surface->pbo) surface_remove_pbo(surface, gl_info); -@@ -1713,7 +1722,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1657,7 +1666,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 - surface_load_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); + surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB); - wined3d_texture_bind(dst_surface->container, context, FALSE); + wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); surface_get_memory(src_surface, &data, src_surface->locations); -@@ -1831,7 +1840,8 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) +@@ -1773,7 +1782,8 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) return GL_BACK; } @@ -223,7 +223,7 @@ index 9efc5a8..30e2a0f 100644 { DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; -@@ -1847,7 +1857,7 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb) +@@ -1789,7 +1799,7 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb) } TRACE("Reloading because surface is dirty.\n"); @@ -232,7 +232,7 @@ index 9efc5a8..30e2a0f 100644 surface_evict_sysmem(surface); } -@@ -2767,10 +2777,16 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2715,10 +2725,16 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, } else { @@ -250,7 +250,7 @@ index 9efc5a8..30e2a0f 100644 } if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) -@@ -2852,6 +2868,8 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2800,6 +2816,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 9efc5a8..30e2a0f 100644 TRACE("surface %p, dc %p.\n", surface, dc); -@@ -2863,26 +2881,36 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2811,26 +2829,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 9efc5a8..30e2a0f 100644 surface->flags |= SFLAG_DCINUSE; surface->resource.map_count++; -@@ -2920,8 +2948,16 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) +@@ -2868,8 +2896,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 9efc5a8..30e2a0f 100644 } return WINED3D_OK; -@@ -4215,7 +4251,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, +@@ -4110,7 +4146,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 9efc5a8..30e2a0f 100644 /* Download the surface to system memory. */ if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -@@ -4251,7 +4287,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, +@@ -4146,7 +4182,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, } surface_get_rect(surface, NULL, &r); @@ -335,7 +335,7 @@ index 9efc5a8..30e2a0f 100644 surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -4324,7 +4360,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4219,7 +4255,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 9efc5a8..30e2a0f 100644 } } else -@@ -4335,7 +4371,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4230,7 +4266,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 9efc5a8..30e2a0f 100644 } } -@@ -4344,7 +4380,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4239,7 +4275,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 9efc5a8..30e2a0f 100644 } wined3d_texture_prepare_texture(texture, context, srgb); -@@ -4370,7 +4406,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4265,7 +4301,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 9efc5a8..30e2a0f 100644 surface_remove_pbo(surface, gl_info); } -@@ -4439,11 +4475,10 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct +@@ -4333,11 +4369,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 9efc5a8..30e2a0f 100644 TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4452,9 +4487,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) +@@ -4346,9 +4381,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 9efc5a8..30e2a0f 100644 return WINED3D_OK; } else if (location & surface->locations -@@ -4498,33 +4531,22 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) +@@ -4392,33 +4425,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 9efc5a8..30e2a0f 100644 return hr; break; -@@ -5582,7 +5604,11 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5529,7 +5551,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)) @@ -446,7 +446,7 @@ index 9efc5a8..30e2a0f 100644 } } diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 887143f..d742b11 100644 +index 146f5d6..4f4d4df 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -309,7 +309,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain, @@ -485,10 +485,10 @@ index 887143f..d742b11 100644 src_dc = front->hDC; window = swapchain->win_handle; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index b5f64ba..a7e6cca 100644 +index 5e68257..1afff66 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -774,16 +774,19 @@ static void wined3d_texture_upload_data(struct wined3d_texture *texture, const s +@@ -766,16 +766,19 @@ static void wined3d_texture_upload_data(struct wined3d_texture *texture, const s static void texture2d_sub_resource_load(struct wined3d_resource *sub_resource, struct wined3d_context *context, BOOL srgb) { @@ -511,10 +511,10 @@ index b5f64ba..a7e6cca 100644 } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 9c5134c..59e3eb2 100644 +index 2656399..51487aa 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2368,11 +2368,12 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HID +@@ -2384,11 +2384,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; @@ -530,5 +530,5 @@ index 9c5134c..59e3eb2 100644 void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; -- -2.3.0 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch b/patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch index 90339fef..1bc810aa 100644 --- a/patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch +++ b/patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch @@ -1,4 +1,4 @@ -From b947c724e3227d812a7e60f1a845b2e5c2d7ec09 Mon Sep 17 00:00:00 2001 +From 81726de3e2c63759ff771038ec1a829758314bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 3 Oct 2013 12:31:24 +0200 Subject: wined3d: Store volume locations in the resource. @@ -9,7 +9,7 @@ Subject: wined3d: Store volume locations in the resource. 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 87b6ab6..62eb5ed 100644 +index 1a5e629..5f5fe8b 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -102,15 +102,15 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine @@ -44,7 +44,7 @@ index 87b6ab6..62eb5ed 100644 { TRACE("Location(s) already up to date.\n"); return; -@@ -243,32 +243,32 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -243,36 +243,36 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, && !(volume->container->flags & WINED3D_TEXTURE_SRGB_ALLOCATED))) ERR("Trying to load (s)RGB texture without prior allocation.\n"); @@ -58,12 +58,16 @@ index 87b6ab6..62eb5ed 100644 + else if (volume->resource.locations & WINED3D_LOCATION_SYSMEM) { struct wined3d_const_bo_address data = {0, volume->resource.heap_memory}; + wined3d_texture_bind_and_dirtify(volume->container, context, + location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_volume_upload_data(volume, context, &data); } - else if (volume->locations & WINED3D_LOCATION_BUFFER) + else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) { struct wined3d_const_bo_address data = {volume->pbo, NULL}; + wined3d_texture_bind_and_dirtify(volume->container, context, + location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_volume_upload_data(volume, context, &data); } - else if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB) @@ -83,7 +87,7 @@ index 87b6ab6..62eb5ed 100644 return; } wined3d_volume_validate_location(volume, location); -@@ -282,16 +282,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -286,16 +286,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, if (!volume->resource.heap_memory) ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n"); @@ -103,7 +107,7 @@ index 87b6ab6..62eb5ed 100644 wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -302,7 +302,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -306,7 +306,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, else { FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n", @@ -112,7 +116,7 @@ index 87b6ab6..62eb5ed 100644 return; } wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); -@@ -312,16 +312,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -316,16 +316,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, if (!volume->pbo) ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); @@ -132,7 +136,7 @@ index 87b6ab6..62eb5ed 100644 wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -331,7 +331,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -335,7 +335,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, else { FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n", @@ -141,7 +145,7 @@ index 87b6ab6..62eb5ed 100644 return; } wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER); -@@ -339,7 +339,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -343,7 +343,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, default: FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location), @@ -150,7 +154,7 @@ index 87b6ab6..62eb5ed 100644 } } -@@ -596,7 +596,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -600,7 +600,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, { wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); } @@ -159,7 +163,7 @@ index 87b6ab6..62eb5ed 100644 { context = context_acquire(device, NULL); wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM); -@@ -744,7 +744,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture +@@ -748,7 +748,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture } volume->texture_level = level; @@ -169,7 +173,7 @@ index 87b6ab6..62eb5ed 100644 if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC && gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 78406a4..004969d 100644 +index 254dfd7..f2d3943 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -5,7 +5,7 @@ @@ -181,7 +185,7 @@ index 78406a4..004969d 100644 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public -@@ -2093,6 +2093,7 @@ struct wined3d_resource +@@ -2123,6 +2123,7 @@ struct wined3d_resource void *heap_memory; UINT custom_row_pitch, custom_slice_pitch; struct list resource_list_entry; @@ -189,7 +193,7 @@ index 78406a4..004969d 100644 void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2250,7 +2251,7 @@ struct wined3d_volume +@@ -2271,7 +2272,7 @@ struct wined3d_volume struct wined3d_resource resource; struct wined3d_texture *container; @@ -199,5 +203,5 @@ index 78406a4..004969d 100644 DWORD download_count; GLuint pbo; -- -1.9.1 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch b/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch index a3ba0233..d27f3f12 100644 --- a/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch +++ b/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch @@ -1,4 +1,4 @@ -From 16f91ae3a1a07a83237878f93bef07f5ff296f60 Mon Sep 17 00:00:00 2001 +From 64dddc414faf640169e109bf57c62489bfb3a65d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 12:22:30 +0100 Subject: wined3d: Move surface locations into the resource. @@ -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 485e4f4..e84405e 100644 +index 725897f..9e03017 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,7 +61,7 @@ index 913ada5..567550e 100644 else SetRectEmpty(¤t_rect); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 0f38da9..8b2fb74 100644 +index 0335497..fcca398 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) @@ -93,14 +93,14 @@ index 0f38da9..8b2fb74 100644 return; @@ -1669,7 +1669,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(dst_surface->container, context, FALSE); + wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); - surface_get_memory(src_surface, &data, src_surface->locations); + surface_get_memory(src_surface, &data, src_surface->resource.locations); 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, -@@ -1794,7 +1794,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte +@@ -1792,7 +1792,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 0f38da9..8b2fb74 100644 { TRACE("surface is already in texture\n"); return; -@@ -2105,7 +2105,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -2103,7 +2103,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, create_dib = TRUE; } @@ -118,7 +118,7 @@ index 0f38da9..8b2fb74 100644 wined3d_resource_free_sysmem(&surface->resource); width = texture_resource->width; -@@ -3170,9 +3170,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) +@@ -3168,9 +3168,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 0f38da9..8b2fb74 100644 } } -@@ -3351,7 +3351,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3349,7 +3349,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 0f38da9..8b2fb74 100644 } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3889,13 +3889,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface, +@@ -3887,13 +3887,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 0f38da9..8b2fb74 100644 } /* Context activation is done by the caller. */ -@@ -3910,7 +3911,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3908,7 +3909,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 0f38da9..8b2fb74 100644 { w = surface->ds_current_size.cx; h = surface->ds_current_size.cy; -@@ -3936,7 +3937,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3934,7 +3935,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co return; } @@ -176,7 +176,7 @@ index 0f38da9..8b2fb74 100644 { TRACE("Surface was discarded, no need copy data.\n"); switch (location) -@@ -3953,17 +3954,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3951,17 +3952,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 0f38da9..8b2fb74 100644 surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; return; -@@ -4052,7 +4053,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4050,7 +4051,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 0f38da9..8b2fb74 100644 surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; } -@@ -4061,7 +4062,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location) +@@ -4059,7 +4060,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 0f38da9..8b2fb74 100644 } void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) -@@ -4070,9 +4071,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location +@@ -4068,9 +4069,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 0f38da9..8b2fb74 100644 ERR("Surface %p does not have any up to date location.\n", surface); } -@@ -4108,7 +4109,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD +@@ -4106,7 +4107,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 0f38da9..8b2fb74 100644 if (dst.buffer_object) { -@@ -4141,33 +4142,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface, +@@ -4139,33 +4140,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 0f38da9..8b2fb74 100644 } /* Context activation is done by the caller. */ -@@ -4207,14 +4208,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4205,14 +4206,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, if (wined3d_settings.offscreen_rendering_mode != ORM_FBO && wined3d_resource_is_offscreen(&texture->resource) @@ -294,7 +294,7 @@ index 0f38da9..8b2fb74 100644 && (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, -@@ -4230,13 +4231,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4228,13 +4229,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, return WINED3D_OK; } @@ -310,7 +310,7 @@ index 0f38da9..8b2fb74 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}; -@@ -4251,7 +4252,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4249,7 +4250,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, if (srgb) { @@ -319,7 +319,7 @@ index 0f38da9..8b2fb74 100644 == WINED3D_LOCATION_TEXTURE_RGB) { /* Performance warning... */ -@@ -4262,7 +4263,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4260,7 +4261,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } else { @@ -328,7 +328,7 @@ index 0f38da9..8b2fb74 100644 == WINED3D_LOCATION_TEXTURE_SRGB) { /* Performance warning... */ -@@ -4272,7 +4273,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4270,7 +4271,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } } @@ -337,7 +337,7 @@ index 0f38da9..8b2fb74 100644 { WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); /* Lets hope we get it from somewhere... */ -@@ -4307,7 +4308,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4305,7 +4306,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, surface_remove_pbo(surface, gl_info); } @@ -346,7 +346,7 @@ index 0f38da9..8b2fb74 100644 if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -4363,7 +4364,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct +@@ -4361,7 +4362,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 0f38da9..8b2fb74 100644 ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n", surface); -@@ -4381,12 +4382,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4379,12 +4380,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 0f38da9..8b2fb74 100644 && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) { /* Already up to date, nothing to do. */ -@@ -4395,12 +4396,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4393,12 +4394,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 0f38da9..8b2fb74 100644 { TRACE("Location already up to date.\n"); return; -@@ -4414,7 +4415,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4412,7 +4413,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte required_access, surface->resource.access_flags); } @@ -394,7 +394,7 @@ index 0f38da9..8b2fb74 100644 { ERR("Surface %p does not have any up to date location.\n", surface); surface->flags |= SFLAG_LOST; -@@ -4453,7 +4454,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4451,7 +4452,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte surface_validate_location(surface, location); @@ -403,7 +403,7 @@ index 0f38da9..8b2fb74 100644 surface_evict_sysmem(surface); return; -@@ -5497,8 +5498,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5495,8 +5496,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 0f38da9..8b2fb74 100644 { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5538,8 +5539,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5536,8 +5537,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 8bb9f21..7b5a04f 100644 +index c6ac183..e1bc35d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2340,7 +2340,6 @@ struct wined3d_surface +@@ -2333,7 +2333,6 @@ struct wined3d_surface const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; void *user_memory; diff --git a/patches/wined3d-CSMT_Main/0018-wined3d-Replace-surface_load_location-with-resource_.patch b/patches/wined3d-CSMT_Main/0018-wined3d-Replace-surface_load_location-with-resource_.patch index 617fe377..027a64ba 100644 --- a/patches/wined3d-CSMT_Main/0018-wined3d-Replace-surface_load_location-with-resource_.patch +++ b/patches/wined3d-CSMT_Main/0018-wined3d-Replace-surface_load_location-with-resource_.patch @@ -1,4 +1,4 @@ -From ac7d5335fde4c1a4cf0822814eaa168c1b701217 Mon Sep 17 00:00:00 2001 +From d934f1879e55a8787562d4cc75ce2bd981f8b585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 17 Nov 2013 20:33:17 +0100 Subject: wined3d: Replace surface_load_location with resource_load_location. @@ -15,10 +15,10 @@ FIXME: Check if this patch is complete enough to make sense. 7 files changed, 43 insertions(+), 86 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 7e4b935..c08e0ce 100644 +index 167ea7d..5644ea0 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -2217,7 +2217,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, +@@ -2224,7 +2224,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ @@ -28,7 +28,7 @@ index 7e4b935..c08e0ce 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 85771ba..22cf4b5 100644 +index 1874a2b..ab874de 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -323,7 +323,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c @@ -41,10 +41,10 @@ index 85771ba..22cf4b5 100644 } diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index c05369e..31f346d 100644 +index 6f226ce..f2c2f42 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c -@@ -625,7 +625,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co +@@ -628,7 +628,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]); if (target) { @@ -54,7 +54,7 @@ index c05369e..31f346d 100644 } } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index edf8b79..2fae26e 100644 +index 1fcbc98..f7171df 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -758,7 +758,7 @@ static void surface_unmap(struct wined3d_surface *surface) @@ -90,7 +90,7 @@ index edf8b79..2fae26e 100644 if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface; else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface; -@@ -1235,7 +1235,7 @@ static void surface_unload(struct wined3d_resource *resource) +@@ -1179,7 +1179,7 @@ static void surface_unload(struct wined3d_resource *resource) else { surface_prepare_map_memory(surface); @@ -99,7 +99,7 @@ index edf8b79..2fae26e 100644 wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); } -@@ -1280,22 +1280,6 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour +@@ -1224,22 +1224,6 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour wined3d_texture_set_dirty(surface->container); } @@ -122,16 +122,16 @@ index edf8b79..2fae26e 100644 static const struct wined3d_surface_ops surface_ops = { surface_private_setup, -@@ -1739,7 +1723,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1683,7 +1667,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 - surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); - wined3d_texture_bind(dst_surface->container, context, FALSE); + wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); surface_get_memory(src_surface, &data, src_surface->resource.locations); -@@ -1874,7 +1858,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte +@@ -1816,7 +1800,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte } TRACE("Reloading because surface is dirty.\n"); @@ -140,7 +140,7 @@ index edf8b79..2fae26e 100644 surface_evict_sysmem(surface); } -@@ -2801,7 +2785,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2749,7 +2733,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, if (surface->resource.device->d3d_initialized) context = context_acquire(surface->resource.device, NULL); @@ -149,7 +149,7 @@ index edf8b79..2fae26e 100644 if (context) context_release(context); } -@@ -2906,7 +2890,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2854,7 +2838,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) { if (surface->flags & SFLAG_CLIENT) { @@ -158,7 +158,7 @@ index edf8b79..2fae26e 100644 surface_release_client_storage(surface); } hr = surface_create_dib_section(surface); -@@ -2922,7 +2906,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2870,7 +2854,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) surface->resource.map_binding = WINED3D_LOCATION_DIB; } @@ -167,7 +167,7 @@ index edf8b79..2fae26e 100644 wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB); if (context) -@@ -2971,7 +2955,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) +@@ -2919,7 +2903,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) if (device->d3d_initialized) context = context_acquire(device, NULL); @@ -176,7 +176,7 @@ index edf8b79..2fae26e 100644 wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); if (context) context_release(context); -@@ -3684,8 +3668,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, +@@ -3634,8 +3618,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, gl_info = context->gl_info; /* Make sure the surface is up-to-date. This should probably use @@ -187,7 +187,7 @@ index edf8b79..2fae26e 100644 wined3d_texture_load(src_surface->container, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -4178,29 +4162,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4073,29 +4057,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } @@ -217,7 +217,7 @@ index edf8b79..2fae26e 100644 static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD location) { struct wined3d_device *device = surface->resource.device; -@@ -4250,7 +4211,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, +@@ -4145,7 +4106,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, } if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) @@ -226,7 +226,7 @@ index edf8b79..2fae26e 100644 /* Download the surface to system memory. */ if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -@@ -4286,7 +4247,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, +@@ -4181,7 +4142,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, } surface_get_rect(surface, NULL, &r); @@ -235,7 +235,7 @@ index edf8b79..2fae26e 100644 surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -4359,7 +4320,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4254,7 +4215,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); @@ -244,7 +244,7 @@ index edf8b79..2fae26e 100644 } } else -@@ -4370,7 +4331,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4265,7 +4226,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); @@ -253,7 +253,7 @@ index edf8b79..2fae26e 100644 } } -@@ -4379,7 +4340,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4274,7 +4235,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); @@ -262,7 +262,7 @@ index edf8b79..2fae26e 100644 } wined3d_texture_prepare_texture(texture, context, srgb); -@@ -4405,7 +4366,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4300,7 +4261,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; surface_prepare_map_memory(surface); @@ -271,7 +271,7 @@ index edf8b79..2fae26e 100644 surface_remove_pbo(surface, gl_info); } -@@ -4474,9 +4435,11 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct +@@ -4368,9 +4329,11 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect); } @@ -285,7 +285,7 @@ index edf8b79..2fae26e 100644 HRESULT hr; TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4503,20 +4466,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4397,20 +4360,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte } } @@ -306,7 +306,7 @@ index edf8b79..2fae26e 100644 if (!surface->resource.locations) { ERR("Surface %p does not have any up to date location.\n", surface); -@@ -5605,7 +5554,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5552,7 +5501,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) { struct wined3d_context *context = context_acquire(device, dst_surface); @@ -316,7 +316,7 @@ index edf8b79..2fae26e 100644 context_release(context); } return WINED3D_OK; -@@ -5680,6 +5630,15 @@ cpu: +@@ -5625,6 +5575,15 @@ cpu: return surface_cpu_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter); } @@ -333,7 +333,7 @@ index edf8b79..2fae26e 100644 const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) { diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 17f1afe..e1a5b8a 100644 +index 6864a4a..15f7708 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -309,7 +309,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain, @@ -372,10 +372,10 @@ index 17f1afe..e1a5b8a 100644 src_dc = front->hDC; window = swapchain->win_handle; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 4111ceb..87944b1 100644 +index 0c64f39..9eb8da1 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -785,7 +785,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub +@@ -777,7 +777,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub surface_prepare_map_memory(surface); context = context_acquire(surface->resource.device, NULL); @@ -385,10 +385,10 @@ index 4111ceb..87944b1 100644 wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 159ba51..f484e18 100644 +index 8e51f16..b8dbde3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2375,8 +2375,6 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte +@@ -2391,8 +2391,6 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN; @@ -398,5 +398,5 @@ index 159ba51..f484e18 100644 void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; -- -2.3.0 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch b/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch index e9db2af1..100081a3 100644 --- a/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch +++ b/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch @@ -1,4 +1,4 @@ -From ba5c51ffdfff3be025ace2dd52218bd845c9d851 Mon Sep 17 00:00:00 2001 +From 4dedb87fa2626251d0c7c0d5f861f8665bfa289b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 16 Jan 2014 22:07:17 +0100 Subject: wined3d: Move volume PBO infrastructure into the resource. @@ -10,10 +10,10 @@ Subject: wined3d: Move volume PBO infrastructure into the resource. 3 files changed, 82 insertions(+), 79 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 7f283f5..c907424 100644 +index 61a829d..1fb2370 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -292,7 +292,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) +@@ -301,7 +301,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) return ret; } @@ -22,7 +22,7 @@ index 7f283f5..c907424 100644 { if (d3d_flags & WINED3D_MAP_READONLY) return GL_READ_ONLY_ARB; -@@ -428,3 +428,65 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, +@@ -437,3 +437,65 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, resource->resource_ops->resource_load_location(resource, context, location); } @@ -89,19 +89,19 @@ index 7f283f5..c907424 100644 + } +} diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index ad37cce..db3a68c 100644 +index 99caab8..5fe223b 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -216,7 +216,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -218,7 +218,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, } else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) { - struct wined3d_const_bo_address data = {volume->pbo, NULL}; + struct wined3d_const_bo_address data = {volume->resource.buffer_object, NULL}; + wined3d_texture_bind_and_dirtify(volume->container, context, + location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_volume_upload_data(volume, context, &data); - } - else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) -@@ -270,7 +270,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -274,7 +274,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, break; case WINED3D_LOCATION_BUFFER: @@ -110,7 +110,7 @@ index ad37cce..db3a68c 100644 ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) -@@ -280,7 +280,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -284,7 +284,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, } else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { @@ -119,7 +119,7 @@ index ad37cce..db3a68c 100644 if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); -@@ -317,16 +317,16 @@ static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct win +@@ -321,16 +321,16 @@ static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct win { const struct wined3d_gl_info *gl_info = context->gl_info; @@ -140,7 +140,7 @@ index ad37cce..db3a68c 100644 } static void wined3d_volume_free_pbo(struct wined3d_volume *volume) -@@ -334,10 +334,10 @@ static void wined3d_volume_free_pbo(struct wined3d_volume *volume) +@@ -338,10 +338,10 @@ static void wined3d_volume_free_pbo(struct wined3d_volume *volume) struct wined3d_context *context = context_acquire(volume->resource.device, NULL); const struct wined3d_gl_info *gl_info = context->gl_info; @@ -154,7 +154,7 @@ index ad37cce..db3a68c 100644 context_release(context); } -@@ -345,7 +345,7 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) +@@ -349,7 +349,7 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) { TRACE("volume %p.\n", volume); @@ -163,7 +163,7 @@ index ad37cce..db3a68c 100644 wined3d_volume_free_pbo(volume); resource_cleanup(&volume->resource); -@@ -378,7 +378,7 @@ static void volume_unload(struct wined3d_resource *resource) +@@ -382,7 +382,7 @@ static void volume_unload(struct wined3d_resource *resource) wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); } @@ -172,7 +172,7 @@ index ad37cce..db3a68c 100644 { /* Should not happen because only dynamic default pool volumes * have a buffer, and those are not evicted by device_evit_managed_resources -@@ -494,44 +494,6 @@ static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, str +@@ -498,44 +498,6 @@ static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, str } } @@ -217,7 +217,7 @@ index ad37cce..db3a68c 100644 HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { -@@ -582,7 +544,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -586,7 +548,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, else wined3d_resource_load_location(&volume->resource, context, volume->resource.map_binding); @@ -226,7 +226,7 @@ index ad37cce..db3a68c 100644 context_release(context); TRACE("Base memory pointer %p.\n", base_memory); -@@ -641,30 +603,6 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour +@@ -645,30 +607,6 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour return volume_from_resource(resource); } @@ -257,7 +257,7 @@ index ad37cce..db3a68c 100644 HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) { struct wined3d_device *device = volume->resource.device; -@@ -678,7 +616,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) +@@ -682,7 +620,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) } context = context_acquire(device, NULL); @@ -267,10 +267,10 @@ index ad37cce..db3a68c 100644 volume->resource.map_count--; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 4934dc8..8cce2d9 100644 +index b8dbde3..460e861 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2095,6 +2095,7 @@ struct wined3d_resource +@@ -2125,6 +2125,7 @@ struct wined3d_resource DWORD priority; void *heap_memory, *user_memory, *bitmap_data; UINT custom_row_pitch, custom_slice_pitch; @@ -278,7 +278,7 @@ index 4934dc8..8cce2d9 100644 struct list resource_list_entry; DWORD locations; -@@ -2124,12 +2125,15 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; +@@ -2154,12 +2155,15 @@ 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; void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -295,7 +295,7 @@ index 4934dc8..8cce2d9 100644 DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; -@@ -2262,7 +2266,6 @@ struct wined3d_volume +@@ -2283,7 +2287,6 @@ struct wined3d_volume DWORD flags; GLint texture_level; DWORD download_count; @@ -304,5 +304,5 @@ index 4934dc8..8cce2d9 100644 static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) -- -2.2.1 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch b/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch index 0658e9ac..02325993 100644 --- a/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch +++ b/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch @@ -1,4 +1,4 @@ -From 66f266e57766def2d64f382ba84e226b931c2a4f Mon Sep 17 00:00:00 2001 +From c17af045c56511c51b3c8d8873c10a0df66bee5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 16 Sep 2013 22:44:33 +0200 Subject: wined3d: Introduce a function to retrieve resource memory. @@ -51,7 +51,7 @@ 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 d4e20767..d0c9518 100644 +index 0815cc9..1a6152a 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) @@ -94,7 +94,7 @@ index d4e20767..d0c9518 100644 static void surface_prepare_buffer(struct wined3d_surface *surface) { struct wined3d_context *context; -@@ -1327,7 +1294,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct +@@ -1271,7 +1238,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct return; } @@ -103,16 +103,16 @@ index d4e20767..d0c9518 100644 if (format->flags & WINED3DFMT_FLAG_COMPRESSED) { -@@ -1693,7 +1660,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1637,7 +1604,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(dst_surface->container, context, FALSE); + wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); - surface_get_memory(src_surface, &data, src_surface->resource.locations); + wined3d_resource_get_memory(&src_surface->resource, src_surface->resource.locations, &data); 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, -@@ -2948,7 +2915,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, +@@ -2871,7 +2838,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 d4e20767..d0c9518 100644 /* Context_release does not restore the original context in case of * nested context_acquire calls. Only read_from_framebuffer and -@@ -4140,8 +4107,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD +@@ -4010,8 +3977,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 d4e20767..d0c9518 100644 if (dst.buffer_object) { -@@ -4360,7 +4327,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4223,7 +4190,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, surface_remove_pbo(surface, gl_info); } @@ -142,10 +142,10 @@ index d4e20767..d0c9518 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 23aa052..9582571 100644 +index 1ab7a01..26b64b7 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2148,6 +2148,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE +@@ -2157,6 +2157,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; @@ -155,5 +155,5 @@ index 23aa052..9582571 100644 void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -- -2.2.2 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch b/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch index 9ec1056e..fca43be4 100644 --- a/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch @@ -1,4 +1,4 @@ -From 063ea3bd542ec568905d8788bf37e2a281be0c8b Mon Sep 17 00:00:00 2001 +From fe282dc2344e43fc6061c8bf6fafb6985472c2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 1 Aug 2013 00:33:48 +0200 Subject: wined3d: Send update_texture calls through the CS @@ -10,10 +10,10 @@ Subject: wined3d: Send update_texture calls through the CS 3 files changed, 97 insertions(+), 74 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 62124a7..b41e364 100644 +index 77ef49b..c63299f 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -72,6 +72,7 @@ enum wined3d_cs_op +@@ -73,6 +73,7 @@ enum wined3d_cs_op WINED3D_CS_OP_UPDATE_SURFACE, WINED3D_CS_OP_TEXTURE_PRELOAD, WINED3D_CS_OP_SURFACE_PRELOAD, @@ -21,7 +21,7 @@ index 62124a7..b41e364 100644 WINED3D_CS_OP_STOP, }; -@@ -403,6 +404,12 @@ struct wined3d_cs_surface_preload +@@ -413,6 +414,12 @@ struct wined3d_cs_surface_preload struct wined3d_surface *surface; }; @@ -34,7 +34,7 @@ index 62124a7..b41e364 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); -@@ -1891,6 +1898,31 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa +@@ -1999,6 +2006,31 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa cs->ops->submit(cs, sizeof(*op)); } @@ -66,7 +66,7 @@ index 62124a7..b41e364 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -1941,6 +1973,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2050,6 +2082,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, @@ -75,10 +75,10 @@ index 62124a7..b41e364 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 22ef49b..eb426ff 100644 +index 0d654b7..03202f7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3416,16 +3416,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3426,16 +3426,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device } /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ @@ -98,7 +98,7 @@ index 22ef49b..eb426ff 100644 if (src_volume->resource.format != dst_volume->resource.format) { -@@ -3443,8 +3442,6 @@ static HRESULT device_update_volume(struct wined3d_device *device, +@@ -3453,8 +3452,6 @@ static HRESULT device_update_volume(struct wined3d_device *device, if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY))) return hr; @@ -106,8 +106,8 @@ index 22ef49b..eb426ff 100644 - /* Only a prepare, since we're uploading the entire volume. */ wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); - wined3d_texture_bind(dst_volume->container, context, FALSE); -@@ -3454,68 +3451,21 @@ static HRESULT device_update_volume(struct wined3d_device *device, + wined3d_texture_bind_and_dirtify(dst_volume->container, context, FALSE); +@@ -3464,68 +3461,21 @@ static HRESULT device_update_volume(struct wined3d_device *device, wined3d_volume_upload_data(dst_volume, context, &data); wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -182,7 +182,7 @@ index 22ef49b..eb426ff 100644 /* Update every surface level of the texture. */ switch (type) -@@ -3529,12 +3479,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3539,12 +3489,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, { src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); @@ -196,7 +196,7 @@ index 22ef49b..eb426ff 100644 } break; } -@@ -3548,12 +3493,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3558,12 +3503,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, { src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); @@ -210,7 +210,7 @@ index 22ef49b..eb426ff 100644 } break; } -@@ -3562,13 +3502,14 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3572,13 +3512,14 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, { for (i = 0; i < level_count; ++i) { @@ -227,7 +227,7 @@ index 22ef49b..eb426ff 100644 } } break; -@@ -3576,9 +3517,54 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3586,9 +3527,54 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, default: FIXME("Unsupported texture type %#x.\n", type); @@ -284,10 +284,10 @@ index 22ef49b..eb426ff 100644 } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 849f233..9c4cb9b 100644 +index f6da464..3f46b1c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2095,6 +2095,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource +@@ -2111,6 +2111,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; @@ -296,7 +296,7 @@ index 849f233..9c4cb9b 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2678,6 +2680,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac +@@ -2698,6 +2700,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -306,5 +306,5 @@ index 849f233..9c4cb9b 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.3.0 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch b/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch index 0ff594bd..0968c54f 100644 --- a/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch +++ b/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch @@ -1,4 +1,4 @@ -From 53122dd7633e0cd0d3c28240eec8f491c36e3da3 Mon Sep 17 00:00:00 2001 +From 18748f98ac34cb03bf13f9179ae7002393b3495e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 29 Aug 2013 22:25:14 +0200 Subject: wined3d: Don't lock the src volume in device_update_volume @@ -13,10 +13,10 @@ FIXME: Maybe merge this with the previous patch or change their order. 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index eb426ff..75a47a1 100644 +index 03202f7..0cfb10e 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3416,12 +3416,10 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3426,12 +3426,10 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device } /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ @@ -31,7 +31,7 @@ index eb426ff..75a47a1 100644 TRACE("src_volume %p, dst_volume %p.\n", src_volume, dst_volume); -@@ -3429,31 +3427,22 @@ static HRESULT device_update_volume(struct wined3d_context *context, +@@ -3439,31 +3437,22 @@ static HRESULT device_update_volume(struct wined3d_context *context, if (src_volume->resource.format != dst_volume->resource.format) { FIXME("Source and destination formats do not match.\n"); @@ -52,7 +52,7 @@ index eb426ff..75a47a1 100644 - /* Only a prepare, since we're uploading the entire volume. */ wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); - wined3d_texture_bind(dst_volume->container, context, FALSE); + wined3d_texture_bind_and_dirtify(dst_volume->container, context, FALSE); - - data.buffer_object = 0; - data.addr = src.data; @@ -67,7 +67,7 @@ index eb426ff..75a47a1 100644 } /* Context activation is done by the caller */ -@@ -3502,15 +3491,9 @@ void device_exec_update_texture(struct wined3d_context *context, struct wined3d_ +@@ -3512,15 +3501,9 @@ void device_exec_update_texture(struct wined3d_context *context, struct wined3d_ { for (i = 0; i < level_count; ++i) { @@ -85,5 +85,5 @@ index eb426ff..75a47a1 100644 break; } -- -2.3.0 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch b/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch index cc25ebb2..95250bff 100644 --- a/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch +++ b/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch @@ -1,4 +1,4 @@ -From 4f37cdd5e369a388229874ba94a0390e809f3aae Mon Sep 17 00:00:00 2001 +From e9a13b9c7f3776005db0f8f32a43241c6c66b5be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 30 Aug 2013 17:00:35 +0200 Subject: wined3d: Wrap GL BOs in a structure @@ -14,10 +14,10 @@ them for DISCARD maps. 5 files changed, 86 insertions(+), 28 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index d051974..3aec1dd 100644 +index 18b1784..039ca85 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -4981,3 +4981,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -5052,3 +5052,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -75,10 +75,10 @@ index d051974..3aec1dd 100644 + wined3d_device_destroy_bo(device, context, bo); +} diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 2dc25bf..8fb95a1 100644 +index 2530ee0..4496c9b 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -145,12 +145,10 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -154,12 +154,10 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * void wined3d_resource_free_bo(struct wined3d_resource *resource) { struct wined3d_context *context = context_acquire(resource->device, NULL); @@ -94,7 +94,7 @@ index 2dc25bf..8fb95a1 100644 context_release(context); } -@@ -166,7 +164,7 @@ void resource_cleanup(struct wined3d_resource *resource) +@@ -175,7 +173,7 @@ void resource_cleanup(struct wined3d_resource *resource) adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); } @@ -103,7 +103,7 @@ index 2dc25bf..8fb95a1 100644 wined3d_resource_free_bo(resource); wined3d_resource_free_sysmem(resource); -@@ -179,7 +177,7 @@ void resource_unload(struct wined3d_resource *resource) +@@ -188,7 +186,7 @@ void resource_unload(struct wined3d_resource *resource) if (resource->map_count) ERR("Resource %p is being unloaded while mapped.\n", resource); @@ -112,7 +112,7 @@ index 2dc25bf..8fb95a1 100644 wined3d_resource_free_bo(resource); context_resource_unloaded(resource->device, -@@ -428,7 +426,7 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, +@@ -437,7 +435,7 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, { if (location & WINED3D_LOCATION_BUFFER) { @@ -121,7 +121,7 @@ index 2dc25bf..8fb95a1 100644 data->addr = NULL; return; } -@@ -537,7 +535,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, +@@ -546,7 +544,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; @@ -130,7 +130,7 @@ index 2dc25bf..8fb95a1 100644 if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) { -@@ -580,7 +578,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -589,7 +587,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; @@ -139,7 +139,7 @@ index 2dc25bf..8fb95a1 100644 GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); checkGLcall("Unmap GL buffer"); -@@ -598,20 +596,14 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -607,20 +605,14 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, } /* Context activation is done by the caller. */ @@ -166,7 +166,7 @@ index 2dc25bf..8fb95a1 100644 BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 1392745..90fa582 100644 +index fc719e7..d1020df 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -48,7 +48,7 @@ static void surface_cleanup(struct wined3d_surface *surface) @@ -178,7 +178,7 @@ index 1392745..90fa582 100644 || surface->rb_resolved || !list_empty(&surface->renderbuffers)) { struct wined3d_renderbuffer_entry *entry, *entry2; -@@ -2669,7 +2669,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2591,7 +2591,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) } if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM @@ -187,7 +187,7 @@ index 1392745..90fa582 100644 surface->resource.map_binding = WINED3D_LOCATION_DIB; } -@@ -4034,7 +4034,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3897,7 +3897,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ @@ -197,19 +197,19 @@ index 1392745..90fa582 100644 TRACE("Removing the pbo attached to surface %p.\n", surface); diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 6b41ca1..28985a4 100644 +index 6fc23f3..f6d2e8f 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -216,7 +216,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -218,7 +218,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, } else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) { - struct wined3d_const_bo_address data = {volume->resource.buffer_object, NULL}; + struct wined3d_const_bo_address data = {volume->resource.buffer->name, NULL}; + wined3d_texture_bind_and_dirtify(volume->container, context, + location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_volume_upload_data(volume, context, &data); - } - else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) -@@ -265,12 +265,12 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -269,12 +269,12 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, break; case WINED3D_LOCATION_BUFFER: @@ -225,10 +225,10 @@ index 6b41ca1..28985a4 100644 if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 4a99939..ff64215 100644 +index b23757b..2f85556 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1971,6 +1971,14 @@ struct wined3d_state +@@ -2007,6 +2007,14 @@ struct wined3d_state DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; }; @@ -243,7 +243,7 @@ index 4a99939..ff64215 100644 #define WINED3D_UNMAPPED_STAGE ~0U /* Multithreaded flag. Removed from the public header to signal that -@@ -2076,6 +2084,11 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) D +@@ -2113,6 +2121,11 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) D void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN; @@ -255,7 +255,7 @@ index 4a99939..ff64215 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2126,7 +2139,7 @@ struct wined3d_resource +@@ -2156,7 +2169,7 @@ struct wined3d_resource DWORD priority; void *heap_memory, *user_memory, *bitmap_data; UINT custom_row_pitch, custom_slice_pitch; @@ -265,5 +265,5 @@ index 4a99939..ff64215 100644 DWORD locations; LONG access_fence; -- -2.2.1 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 8e268879..cc742a60 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -476,7 +476,7 @@ diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -97,6 +97,22 @@ +@@ -99,6 +99,22 @@ HeapFree(GetProcessHeap(), 0, converted_mem); } @@ -499,7 +499,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c /* Context activation is done by the caller. */ static void wined3d_volume_download_data(struct wined3d_volume *volume, const struct wined3d_context *context, const struct wined3d_bo_address *data) -@@ -132,8 +148,33 @@ +@@ -134,8 +150,33 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) { wined3d_resource_free_sysmem(&volume->resource); @@ -533,7 +533,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } /* Context activation is done by the caller. */ -@@ -175,6 +216,7 @@ +@@ -177,6 +218,7 @@ return TRUE; } @@ -541,7 +541,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c /* Context activation is done by the caller. */ static void wined3d_volume_load_location(struct wined3d_resource *resource, -@@ -185,6 +227,22 @@ +@@ -187,6 +229,22 @@ TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location), wined3d_debug_location(volume->resource.locations)); @@ -564,7 +564,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if ((volume->resource.access_flags & required_access) != required_access) { -@@ -203,6 +261,7 @@ +@@ -205,6 +263,7 @@ && !(volume->container->flags & WINED3D_TEXTURE_SRGB_ALLOCATED))) ERR("Trying to load (s)RGB texture without prior allocation.\n"); @@ -572,7 +572,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) { TRACE("Volume previously discarded, nothing to do.\n"); -@@ -232,6 +291,37 @@ +@@ -238,6 +297,41 @@ return; } wined3d_resource_validate_location(&volume->resource, location); @@ -585,11 +585,15 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c + else if (volume->locations & WINED3D_LOCATION_SYSMEM) + { + struct wined3d_const_bo_address data = {0, volume->resource.heap_memory}; ++ wined3d_texture_bind_and_dirtify(volume->container, context, ++ location == WINED3D_LOCATION_TEXTURE_SRGB); + wined3d_volume_upload_data(volume, context, &data); + } + else if (volume->locations & WINED3D_LOCATION_BUFFER) + { + struct wined3d_const_bo_address data = {volume->pbo, NULL}; ++ wined3d_texture_bind_and_dirtify(volume->container, context, ++ location == WINED3D_LOCATION_TEXTURE_SRGB); + wined3d_volume_upload_data(volume, context, &data); + } + else if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB) @@ -610,7 +614,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (wined3d_volume_can_evict(volume)) wined3d_volume_evict_sysmem(volume); -@@ -242,11 +332,24 @@ +@@ -248,11 +342,24 @@ if (!volume->resource.heap_memory) ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n"); @@ -635,7 +639,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -257,6 +360,7 @@ +@@ -263,6 +370,7 @@ else { FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n", @@ -643,7 +647,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_debug_location(volume->resource.locations)); return; } -@@ -272,6 +376,28 @@ +@@ -278,6 +386,28 @@ struct wined3d_bo_address data = {volume->resource.buffer->name, NULL}; if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) @@ -672,7 +676,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -281,6 +407,7 @@ +@@ -287,6 +417,7 @@ else { FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n", @@ -680,7 +684,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_debug_location(volume->resource.locations)); return; } -@@ -290,6 +417,17 @@ +@@ -296,6 +427,17 @@ default: FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location), wined3d_debug_location(volume->resource.locations)); @@ -698,7 +702,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } } -@@ -297,6 +435,7 @@ +@@ -303,6 +445,7 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode) { wined3d_texture_prepare_texture(volume->container, context, srgb_mode); @@ -706,7 +710,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_resource_load_location(&volume->resource, context, srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); } -@@ -309,6 +448,51 @@ +@@ -315,6 +458,51 @@ resource_cleanup(&volume->resource); volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); wined3d_cs_emit_volume_cleanup(device->cs, volume); @@ -758,7 +762,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } static void volume_unload(struct wined3d_resource *resource) -@@ -322,6 +506,7 @@ +@@ -328,6 +516,7 @@ TRACE("texture %p.\n", resource); @@ -766,7 +770,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (wined3d_resource_prepare_system_memory(&volume->resource)) { context = context_acquire(device, NULL); -@@ -334,6 +519,29 @@ +@@ -340,6 +529,29 @@ ERR("Out of memory when unloading volume %p.\n", volume); wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); @@ -796,7 +800,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } /* The texture name is managed by the container. */ -@@ -349,11 +557,13 @@ +@@ -355,11 +567,13 @@ return wined3d_texture_incref(volume->container); } @@ -810,7 +814,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c ULONG CDECL wined3d_volume_decref(struct wined3d_volume *volume) { TRACE("Forwarding to container %p.\n", volume->container); -@@ -380,6 +590,36 @@ +@@ -386,6 +600,36 @@ return &volume->resource; } @@ -847,7 +851,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume, const struct wined3d_box *box) { -@@ -405,6 +645,7 @@ +@@ -411,6 +655,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { @@ -855,7 +859,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c HRESULT hr; const struct wined3d_format *format = volume->resource.format; -@@ -432,6 +673,147 @@ +@@ -438,6 +683,147 @@ return hr; return hr; @@ -1003,7 +1007,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resource *resource) -@@ -441,6 +823,7 @@ +@@ -447,6 +833,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) { @@ -1011,7 +1015,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c HRESULT hr; if (volume->resource.unmap_dirtify) -@@ -450,6 +833,33 @@ +@@ -456,6 +843,33 @@ if (hr == WINEDDERR_NOTLOCKED) return WINED3DERR_INVALIDCALL; return hr; @@ -1045,7 +1049,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } static ULONG volume_resource_incref(struct wined3d_resource *resource) -@@ -462,6 +872,7 @@ +@@ -468,6 +882,7 @@ return wined3d_volume_decref(volume_from_resource(resource)); } @@ -1053,7 +1057,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c static void wined3d_volume_location_invalidated(struct wined3d_resource *resource, DWORD location) { struct wined3d_volume *volume = volume_from_resource(resource); -@@ -477,6 +888,13 @@ +@@ -483,6 +898,13 @@ volume_unload, wined3d_volume_location_invalidated, wined3d_volume_load_location, @@ -1067,7 +1071,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c }; static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, -@@ -513,7 +931,11 @@ +@@ -519,7 +941,11 @@ } volume->texture_level = level; @@ -1079,7 +1083,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC && gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] -@@ -521,7 +943,9 @@ +@@ -527,7 +953,9 @@ { wined3d_resource_free_sysmem(&volume->resource); volume->resource.map_binding = WINED3D_LOCATION_BUFFER; @@ -1921,7 +1925,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2151,9 +2237,11 @@ +@@ -2144,9 +2230,11 @@ ULONG (*resource_incref)(struct wined3d_resource *resource); ULONG (*resource_decref)(struct wined3d_resource *resource); void (*resource_unload)(struct wined3d_resource *resource); @@ -1933,7 +1937,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_resource -@@ -2176,6 +2264,7 @@ +@@ -2169,6 +2257,7 @@ UINT depth; UINT size; DWORD priority; @@ -1941,7 +1945,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; UINT custom_row_pitch, custom_slice_pitch; struct wined3d_gl_bo *buffer, *map_buffer; -@@ -2183,6 +2272,11 @@ +@@ -2176,6 +2265,11 @@ DWORD locations; LONG access_fence; BOOL unmap_dirtify; @@ -1953,7 +1957,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2207,6 +2301,7 @@ +@@ -2200,6 +2294,7 @@ void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN; void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -1961,7 +1965,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_changed(struct wined3d_resource *resource, -@@ -2253,6 +2348,15 @@ +@@ -2246,6 +2341,15 @@ { while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); } @@ -1977,7 +1981,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -@@ -2337,7 +2441,9 @@ +@@ -2330,7 +2434,9 @@ void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture, const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; @@ -1987,7 +1991,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, -@@ -2371,9 +2477,16 @@ +@@ -2364,9 +2470,16 @@ struct wined3d_resource resource; struct wined3d_texture *container; @@ -2004,7 +2008,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) -@@ -2381,6 +2494,7 @@ +@@ -2374,6 +2487,7 @@ return CONTAINING_RECORD(resource, struct wined3d_volume, resource); } @@ -2012,7 +2016,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h 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; -@@ -2393,6 +2507,23 @@ +@@ -2386,6 +2500,23 @@ struct wined3d_surface_dib { HBITMAP DIBsection; @@ -2036,7 +2040,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT bitmap_size; }; -@@ -2418,7 +2549,11 @@ +@@ -2411,7 +2542,11 @@ struct wined3d_surface_ops { HRESULT (*surface_private_setup)(struct wined3d_surface *surface); @@ -2048,7 +2052,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_surface -@@ -2426,12 +2561,25 @@ +@@ -2419,12 +2554,25 @@ struct wined3d_resource resource; const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; @@ -2074,7 +2078,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h GLuint rb_multisample; GLuint rb_resolved; GLenum texture_target; -@@ -2475,10 +2623,19 @@ +@@ -2468,10 +2616,19 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN; void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; @@ -2094,7 +2098,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; -@@ -2490,6 +2647,7 @@ +@@ -2483,6 +2640,7 @@ const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN; HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN; @@ -2102,7 +2106,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; -@@ -2508,6 +2666,21 @@ +@@ -2501,6 +2659,21 @@ 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; void surface_flip(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN; @@ -2124,7 +2128,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Surface flags: */ #define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */ -@@ -2555,8 +2728,10 @@ +@@ -2548,8 +2721,10 @@ BOOL half_float_conv_needed; }; @@ -2135,7 +2139,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_saved_states { DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; -@@ -2624,6 +2799,7 @@ +@@ -2617,6 +2792,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2143,7 +2147,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -2674,6 +2850,32 @@ +@@ -2667,6 +2843,32 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; @@ -2176,7 +2180,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; -@@ -2723,6 +2925,7 @@ +@@ -2716,6 +2918,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; @@ -2184,7 +2188,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, -@@ -2782,6 +2985,7 @@ +@@ -2775,6 +2978,7 @@ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -2192,7 +2196,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* 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 -@@ -2796,8 +3000,12 @@ +@@ -2789,8 +2993,12 @@ struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -2205,7 +2209,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_query -@@ -2811,12 +3019,16 @@ +@@ -2804,12 +3012,16 @@ enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -2222,7 +2226,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other * fixed function semantics as D3DCOLOR or FLOAT16 */ -@@ -2843,7 +3055,9 @@ +@@ -2836,7 +3048,9 @@ GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -2232,7 +2236,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -2868,11 +3082,15 @@ +@@ -2861,11 +3075,15 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2248,7 +2252,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -2910,8 +3128,10 @@ +@@ -2903,8 +3121,10 @@ return surface_from_resource(resource); } @@ -2259,7 +2263,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_shader_resource_view { LONG refcount; -@@ -2924,8 +3144,12 @@ +@@ -2917,8 +3137,12 @@ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, @@ -2272,7 +2276,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_swapchain -@@ -2965,8 +3189,10 @@ +@@ -2958,8 +3182,10 @@ HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -2283,7 +2287,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /***************************************************************************** * Utility function prototypes -@@ -3181,7 +3407,9 @@ +@@ -3174,7 +3400,9 @@ void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_shader_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN; BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN; @@ -3797,7 +3801,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c + + /* Only a prepare, since we're uploading the entire volume. */ + wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); -+ wined3d_texture_bind(dst_volume->container, context, FALSE); ++ wined3d_texture_bind_and_dirtify(dst_volume->container, context, FALSE); + + data.buffer_object = 0; + data.addr = src.data; @@ -7005,19 +7009,19 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c else +#if defined(STAGING_CSMT) wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); - wined3d_texture_bind(dst_surface->container, context, FALSE); + wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); wined3d_resource_get_memory(&src_surface->resource, src_surface->resource.locations, &data); +#else /* STAGING_CSMT */ + surface_load_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_texture_bind(dst_surface->container, context, FALSE); ++ wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); + + surface_get_memory(src_surface, &data, src_surface->locations); +#endif /* STAGING_CSMT */ 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, -@@ -1497,8 +1880,13 @@ +@@ -1495,8 +1878,13 @@ context_release(context); @@ -7031,7 +7035,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -1602,8 +1990,12 @@ +@@ -1600,8 +1988,12 @@ return GL_BACK; } @@ -7044,7 +7048,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; -@@ -1612,6 +2004,7 @@ +@@ -1610,6 +2002,7 @@ if (surface->resource.pool == WINED3D_POOL_SCRATCH) ERR("Not supported on scratch surfaces.\n"); @@ -7052,7 +7056,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface->resource.locations & location) { TRACE("surface is already in texture\n"); -@@ -1620,6 +2013,16 @@ +@@ -1618,6 +2011,16 @@ TRACE("Reloading because surface is dirty.\n"); wined3d_resource_load_location(&surface->resource, context, location); @@ -7069,7 +7073,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_evict_sysmem(surface); } -@@ -1702,6 +2105,7 @@ +@@ -1700,6 +2103,7 @@ void CDECL wined3d_surface_preload(struct wined3d_surface *surface) { @@ -7077,7 +7081,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c const struct wined3d_device *device = surface->resource.device; TRACE("surface %p.\n", surface); -@@ -1712,6 +2116,17 @@ +@@ -1710,6 +2114,17 @@ } wined3d_cs_emit_surface_preload(device->cs, surface); @@ -7095,7 +7099,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) -@@ -1919,6 +2334,7 @@ +@@ -1917,6 +2332,7 @@ { DeleteDC(surface->hDC); DeleteObject(surface->dib.DIBsection); @@ -7103,7 +7107,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.bitmap_data = NULL; surface->flags &= ~SFLAG_DIBSECTION; create_dib = TRUE; -@@ -1927,6 +2343,15 @@ +@@ -1925,6 +2341,15 @@ surface->resource.locations = 0; wined3d_resource_free_sysmem(&surface->resource); surface->resource.map_heap_memory = NULL; @@ -7119,7 +7123,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c width = texture_resource->width; height = texture_resource->height; -@@ -1952,7 +2377,11 @@ +@@ -1950,7 +2375,11 @@ else surface->flags &= ~SFLAG_NONPOW2; @@ -7131,7 +7135,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; valid_location = WINED3D_LOCATION_USER_MEMORY; -@@ -1994,11 +2423,19 @@ +@@ -1992,11 +2421,19 @@ if (!valid_location) { @@ -7151,7 +7155,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -2357,6 +2794,7 @@ +@@ -2355,6 +2792,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) { @@ -7159,7 +7163,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void *dst_data = NULL, *src_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const struct d3dfmt_converter_desc *conv; -@@ -2365,6 +2803,13 @@ +@@ -2363,6 +2801,13 @@ struct wined3d_surface *dst; struct wined3d_context *context = NULL; struct wined3d_device *device = source->resource.device; @@ -7173,7 +7177,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conv = find_converter(source->resource.format->id, to_fmt); if (!conv) -@@ -2388,6 +2833,7 @@ +@@ -2386,6 +2831,7 @@ } dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); @@ -7181,7 +7185,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_get_pitch(&source->resource, &src_row_pitch, &src_slice_pitch); wined3d_resource_get_pitch(&ret->resource, &dst_row_pitch, &dst_slice_pitch); -@@ -2428,6 +2874,32 @@ +@@ -2426,6 +2872,32 @@ if (context) context_release(context); return NULL; @@ -7214,7 +7218,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height, -@@ -2495,6 +2967,7 @@ +@@ -2493,6 +2965,7 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -7222,7 +7226,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p.\n", surface); -@@ -2512,6 +2985,39 @@ +@@ -2510,6 +2983,39 @@ { struct wined3d_box box; const struct wined3d_format *format = surface->resource.format; @@ -7262,7 +7266,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((format->flags & WINED3DFMT_FLAG_BLOCKS) && rect && !surface_check_block_align(surface, rect)) -@@ -2523,6 +3029,13 @@ +@@ -2521,6 +3027,13 @@ return WINED3DERR_INVALIDCALL; } @@ -7276,7 +7280,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* 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 -@@ -2538,6 +3051,7 @@ +@@ -2536,6 +3049,7 @@ } } @@ -7284,7 +7288,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (rect) { surface->lockedRect = *rect; -@@ -2602,22 +3116,121 @@ +@@ -2600,22 +3114,121 @@ WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->resource.format->id)); return WINED3DERR_INVALIDCALL; } @@ -7419,7 +7423,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) -@@ -2643,6 +3256,35 @@ +@@ -2641,6 +3254,35 @@ if (context) context_release(context); } @@ -7455,7 +7459,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -@@ -2662,6 +3304,7 @@ +@@ -2660,6 +3302,7 @@ surface->resource.map_count--; surface->flags &= ~SFLAG_DCINUSE; @@ -7463,7 +7467,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); return WINED3D_OK; -@@ -2674,6 +3317,31 @@ +@@ -2672,6 +3315,31 @@ const struct wined3d_gl_info *gl_info; struct wined3d_context *context; struct wined3d_surface *restore_rt; @@ -7495,7 +7499,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BYTE *mem; BYTE *row, *top, *bottom; int i; -@@ -2681,6 +3349,7 @@ +@@ -2679,6 +3347,7 @@ struct wined3d_bo_address data; UINT row_pitch, slice_pitch; @@ -7503,7 +7507,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_get_memory(&surface->resource, dst_location, &data); /* Context_release does not restore the original context in case of -@@ -2698,6 +3367,11 @@ +@@ -2696,6 +3365,11 @@ context = context_acquire(device, surface); } @@ -7515,7 +7519,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context_apply_blit_state(context, device); gl_info = context->gl_info; -@@ -2786,12 +3460,16 @@ +@@ -2784,12 +3458,16 @@ checkGLcall("glBindBuffer"); } @@ -7532,7 +7536,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Read the framebuffer contents into a texture. Note that this function -@@ -2853,6 +3531,85 @@ +@@ -2851,6 +3529,85 @@ } } @@ -7618,7 +7622,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Does a direct frame buffer -> texture copy. Stretching is done with single * pixel copy calls. */ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, -@@ -2959,8 +3716,13 @@ +@@ -2957,8 +3714,13 @@ /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ @@ -7632,7 +7636,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Uses the hardware to stretch and flip the image */ -@@ -3028,7 +3790,11 @@ +@@ -3026,7 +3788,11 @@ checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -7644,7 +7648,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3225,6 +3991,7 @@ +@@ -3223,6 +3989,7 @@ checkGLcall("glDeleteTextures(1, &backup)"); } @@ -7652,7 +7656,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering) -@@ -3236,6 +4003,17 @@ +@@ -3234,6 +4001,17 @@ * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -7670,7 +7674,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3266,6 +4044,7 @@ +@@ -3264,6 +4042,7 @@ rect->bottom = drawable_height - rect->bottom; } @@ -7678,7 +7682,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Context activation is done by the caller. */ static void surface_blt_to_drawable(const struct wined3d_device *device, struct wined3d_context *old_ctx, -@@ -3300,6 +4079,26 @@ +@@ -3298,6 +4077,26 @@ /* Make sure the surface is up-to-date. This should probably use * wined3d_resource_load_location() and worry about the destination * surface too, unless we're overwriting it completely. */ @@ -7705,7 +7709,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_load(src_surface->container, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -3342,6 +4141,7 @@ +@@ -3340,6 +4139,7 @@ /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -7713,7 +7717,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering -@@ -3355,6 +4155,14 @@ +@@ -3353,6 +4153,14 @@ context = context_acquire(device, restore_rt); context_release(context); } @@ -7728,7 +7732,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) -@@ -3378,8 +4186,13 @@ +@@ -3376,8 +4184,13 @@ enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -7742,7 +7746,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, blt_fx %p, filter %s.\n", dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), -@@ -3570,6 +4383,7 @@ +@@ -3568,6 +4381,7 @@ { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -7750,7 +7754,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) || (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB))) -@@ -3578,6 +4392,15 @@ +@@ -3576,6 +4390,15 @@ surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; surface->resource.locations = location; @@ -7766,7 +7770,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Context activation is done by the caller. */ -@@ -3592,7 +4415,11 @@ +@@ -3590,7 +4413,11 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -7778,7 +7782,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { w = surface->ds_current_size.cx; h = surface->ds_current_size.cy; -@@ -3618,7 +4445,11 @@ +@@ -3616,7 +4443,11 @@ return; } @@ -7790,7 +7794,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Surface was discarded, no need copy data.\n"); switch (location) -@@ -3635,6 +4466,7 @@ +@@ -3633,6 +4464,7 @@ default: FIXME("Unhandled location %#x\n", location); } @@ -7798,7 +7802,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED; surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; -@@ -3646,6 +4478,19 @@ +@@ -3644,6 +4476,19 @@ { FIXME("No up to date depth stencil location.\n"); surface->resource.locations |= location; @@ -7818,7 +7822,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; return; -@@ -3710,9 +4555,13 @@ +@@ -3708,9 +4553,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7832,7 +7836,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else if (location == WINED3D_LOCATION_DRAWABLE) -@@ -3728,9 +4577,13 @@ +@@ -3726,9 +4575,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7846,7 +7850,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else -@@ -3738,6 +4591,7 @@ +@@ -3736,6 +4589,7 @@ ERR("Invalid location (%#x) specified.\n", location); } @@ -7854,7 +7858,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; -@@ -3783,6 +4637,135 @@ +@@ -3781,6 +4635,135 @@ TRACE("Surface was discarded, nothing to do.\n"); return WINED3D_OK; } @@ -7990,7 +7994,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && wined3d_resource_is_offscreen(&surface->container->resource)) -@@ -3792,6 +4775,7 @@ +@@ -3790,6 +4773,7 @@ } surface_get_rect(surface, NULL, &r); @@ -7998,7 +8002,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -3860,6 +4844,66 @@ +@@ -3858,6 +4842,66 @@ RECT rect = {0, 0, surface->resource.width, surface->resource.height}; surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, @@ -8065,7 +8069,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c &rect, surface, dst_location, &rect); return WINED3D_OK; -@@ -3869,6 +4913,7 @@ +@@ -3867,6 +4911,7 @@ if (srgb) { @@ -8073,7 +8077,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) == WINED3D_LOCATION_TEXTURE_RGB) { -@@ -3897,6 +4942,39 @@ +@@ -3895,6 +4940,39 @@ wined3d_resource_prepare_system_memory(&surface->resource); wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); } @@ -8113,7 +8117,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_prepare_texture(texture, context, srgb); wined3d_texture_bind_and_dirtify(texture, context, srgb); -@@ -3911,7 +4989,11 @@ +@@ -3909,7 +4987,11 @@ /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ @@ -8125,7 +8129,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3920,6 +5002,7 @@ +@@ -3918,6 +5000,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -8133,7 +8137,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_prepare_map_memory(&surface->resource, context); wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_free_bo(&surface->resource); -@@ -3927,6 +5010,14 @@ +@@ -3925,6 +5008,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -8148,7 +8152,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -3972,6 +5063,7 @@ +@@ -3970,6 +5061,7 @@ wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); @@ -8156,7 +8160,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HeapFree(GetProcessHeap(), 0, mem); return WINED3D_OK; -@@ -3995,6 +5087,31 @@ +@@ -3993,6 +5085,31 @@ struct wined3d_context *context, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); @@ -8188,7 +8192,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4002,6 +5119,7 @@ +@@ -4000,6 +5117,7 @@ if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -8196,7 +8200,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) { surface_load_ds_location(surface, context, location); -@@ -4011,21 +5129,63 @@ +@@ -4009,21 +5127,63 @@ && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) { /* Already up to date, nothing to do. */ @@ -8265,7 +8269,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -4034,6 +5194,7 @@ +@@ -4032,6 +5192,7 @@ case WINED3D_LOCATION_USER_MEMORY: case WINED3D_LOCATION_SYSMEM: case WINED3D_LOCATION_BUFFER: @@ -8273,7 +8277,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_load_sysmem(surface, context, location); break; -@@ -4051,6 +5212,24 @@ +@@ -4049,6 +5210,24 @@ if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) return; @@ -8298,7 +8302,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -4058,12 +5237,21 @@ +@@ -4056,12 +5235,21 @@ break; } @@ -8320,7 +8324,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; } -@@ -4173,6 +5361,7 @@ +@@ -4171,6 +5359,7 @@ const RECT *dst_rect, const struct wined3d_color *color) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8328,7 +8332,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_rendertarget_view view, *view_ptr = &view; struct wined3d_fb_state fb = {&view_ptr, NULL, 1}; struct wined3d_texture *texture = dst_surface->container; -@@ -4193,6 +5382,21 @@ +@@ -4191,6 +5380,21 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); @@ -8350,7 +8354,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4201,6 +5405,7 @@ +@@ -4199,6 +5403,7 @@ const RECT *dst_rect, float depth) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8358,7 +8362,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_rendertarget_view view; struct wined3d_fb_state fb = {NULL, &view}; struct wined3d_texture *texture = dst_surface->container; -@@ -4216,6 +5421,20 @@ +@@ -4214,6 +5419,20 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); @@ -8379,7 +8383,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4228,6 +5447,7 @@ +@@ -4226,6 +5445,7 @@ /* Blit from offscreen surface to render target */ struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key; DWORD old_color_key_flags = src_surface->container->async.color_key_flags; @@ -8387,7 +8391,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_context *context; TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); -@@ -4245,6 +5465,22 @@ +@@ -4243,6 +5463,22 @@ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); @@ -8410,7 +8414,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } const struct blit_shader ffp_blit = { -@@ -4403,6 +5639,7 @@ +@@ -4401,6 +5637,7 @@ int bpp, srcheight, srcwidth, dstheight, dstwidth, width; const struct wined3d_format *src_format, *dst_format; struct wined3d_texture *src_texture = NULL; @@ -8418,7 +8422,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void *src_data = NULL, *dst_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const BYTE *sbase = NULL; -@@ -4433,6 +5670,23 @@ +@@ -4431,6 +5668,23 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -8442,7 +8446,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = dst_surface->resource.format; dst_format = src_format; } -@@ -4441,12 +5695,14 @@ +@@ -4439,12 +5693,14 @@ dst_format = dst_surface->resource.format; if (src_surface) { @@ -8457,7 +8461,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (dst_surface->resource.format->id != src_surface->resource.format->id) { if (!(src_texture = surface_convert_format(src_surface, dst_format->id))) -@@ -4457,9 +5713,13 @@ +@@ -4455,9 +5711,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -8471,7 +8475,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = src_surface->resource.format; } else -@@ -4467,8 +5727,12 @@ +@@ -4465,8 +5725,12 @@ src_format = dst_format; } @@ -8484,7 +8488,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_surface->resource.format->byte_count; -@@ -4479,12 +5743,24 @@ +@@ -4477,12 +5741,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -8509,7 +8513,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_format->flags & dst_format->flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4519,7 +5795,11 @@ +@@ -4517,7 +5793,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -8521,7 +8525,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format, flags, fx); goto release; } -@@ -4527,7 +5807,11 @@ +@@ -4525,7 +5805,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -8533,7 +8537,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c flags &= ~WINEDDBLT_COLORFILL; } -@@ -4576,6 +5860,7 @@ +@@ -4574,6 +5858,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -8541,7 +8545,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4589,6 +5874,21 @@ +@@ -4587,6 +5872,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -8563,7 +8567,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c memcpy(dbuf, sbuf, width); } } -@@ -4598,8 +5898,13 @@ +@@ -4596,8 +5896,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -8577,7 +8581,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4608,9 +5913,15 @@ +@@ -4606,9 +5911,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8593,7 +8597,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4620,6 +5931,7 @@ +@@ -4618,6 +5929,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8601,7 +8605,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf = sbase + (sy >> 16) * src_row_pitch; if ((sy >> 16) == (last_sy >> 16)) -@@ -4627,6 +5939,15 @@ +@@ -4625,6 +5937,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -8617,7 +8621,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4673,6 +5994,7 @@ +@@ -4671,6 +5992,7 @@ } #undef STRETCH_ROW } @@ -8625,7 +8629,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dbuf += dst_row_pitch; last_sy = sy; } -@@ -4681,6 +6003,16 @@ +@@ -4679,6 +6001,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -8642,7 +8646,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff; DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff; if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE)) -@@ -4730,7 +6062,11 @@ +@@ -4728,7 +6060,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -8654,7 +8658,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4807,6 +6143,7 @@ +@@ -4805,6 +6141,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -8662,7 +8666,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4828,6 +6165,29 @@ +@@ -4826,6 +6163,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -8692,7 +8696,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c switch (bpp) { -@@ -4846,7 +6206,11 @@ +@@ -4844,7 +6204,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8704,7 +8708,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4877,10 +6241,12 @@ +@@ -4875,10 +6239,12 @@ } } @@ -8717,7 +8721,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4888,6 +6254,7 @@ +@@ -4886,6 +6252,7 @@ } release: @@ -8725,7 +8729,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (dst_data) { wined3d_resource_release_map_ptr(&dst_surface->resource, context); -@@ -4906,6 +6273,14 @@ +@@ -4904,6 +6271,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -8740,7 +8744,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -4950,6 +6325,7 @@ +@@ -4948,6 +6323,7 @@ cpu_blit_blit_surface, }; @@ -8748,7 +8752,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) -@@ -4957,6 +6333,16 @@ +@@ -4955,6 +6331,16 @@ struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_device *device = dst_surface->resource.device; DWORD src_ds_flags, dst_ds_flags; @@ -8765,7 +8769,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -4967,6 +6353,106 @@ +@@ -4965,6 +6351,106 @@ | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -8872,7 +8876,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5009,8 +6495,13 @@ +@@ -5007,8 +6493,13 @@ } scale = src_surface @@ -8886,7 +8890,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c 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); -@@ -5028,6 +6519,7 @@ +@@ -5026,6 +6517,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -8894,7 +8898,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) -@@ -5038,6 +6530,24 @@ +@@ -5036,6 +6528,24 @@ if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding, src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect))) return; @@ -8919,7 +8923,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -5046,8 +6556,13 @@ +@@ -5044,8 +6554,13 @@ /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ @@ -8933,7 +8937,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5068,8 +6583,13 @@ +@@ -5066,8 +6581,13 @@ palette, fx->u5.dwFillColor, &color)) goto fallback; @@ -8947,7 +8951,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -5087,8 +6607,13 @@ +@@ -5085,8 +6605,13 @@ color_key = &src_surface->container->async.src_blt_color_key; blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY; } @@ -8961,7 +8965,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { /* Upload */ if (scale) -@@ -5097,6 +6622,7 @@ +@@ -5095,6 +6620,7 @@ TRACE("Not doing upload because of format conversion.\n"); else { @@ -8969,7 +8973,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c POINT dst_point = {dst_rect->left, dst_rect->top}; if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect))) -@@ -5109,6 +6635,15 @@ +@@ -5107,6 +6633,15 @@ context_release(context); } return; @@ -8985,7 +8989,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -5132,6 +6667,7 @@ +@@ -5130,6 +6665,7 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -8993,7 +8997,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; } -@@ -5327,6 +6863,49 @@ +@@ -5325,6 +6861,49 @@ wined3d_surface_location_invalidated, wined3d_surface_load_location, }; @@ -9043,7 +9047,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) -@@ -5394,7 +6973,11 @@ +@@ -5392,7 +6971,11 @@ } surface->container = container; @@ -9055,7 +9059,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5426,9 +7009,14 @@ +@@ -5424,9 +7007,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -9070,7 +9074,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } return hr; -@@ -5455,7 +7043,11 @@ +@@ -5453,7 +7041,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr);