diff --git a/patches/Pipelight/0003-wined3d-allow-changing-strict-drawing-through-an-exp.patch b/patches/Pipelight/0003-wined3d-allow-changing-strict-drawing-through-an-exp.patch index 19770d37..7949f83f 100644 --- a/patches/Pipelight/0003-wined3d-allow-changing-strict-drawing-through-an-exp.patch +++ b/patches/Pipelight/0003-wined3d-allow-changing-strict-drawing-through-an-exp.patch @@ -1,4 +1,4 @@ -From 8794d625750d35293adecbedc32cc02257817b05 Mon Sep 17 00:00:00 2001 +From 4be2da4492530a2704a8135dc2f65781c968f625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sun, 20 Jul 2014 22:22:14 +0200 Subject: wined3d: allow changing strict drawing through an exported function @@ -9,23 +9,23 @@ Subject: wined3d: allow changing strict drawing through an exported function 2 files changed, 7 insertions(+) diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec -index 7a77003..5519a48 100644 +index cd8174c..34afb71 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec -@@ -219,6 +219,8 @@ +@@ -222,6 +222,8 @@ @ cdecl wined3d_stateblock_decref(ptr) @ cdecl wined3d_stateblock_incref(ptr) +@ cdecl wined3d_strictdrawing_set(long) + @ cdecl wined3d_surface_blt(ptr ptr ptr ptr long ptr long) - @ cdecl wined3d_surface_decref(ptr) @ cdecl wined3d_surface_from_resource(ptr) + @ cdecl wined3d_surface_get_overlay_position(ptr ptr ptr) diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c -index 758ba43..7ccd3a1 100644 +index 0543d97..78cc3a2 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c -@@ -505,6 +505,11 @@ void wined3d_unregister_window(HWND window) +@@ -515,6 +515,11 @@ void wined3d_unregister_window(HWND window) wined3d_wndproc_mutex_unlock(); } @@ -38,5 +38,5 @@ index 758ba43..7ccd3a1 100644 BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved) { -- -2.1.3 +2.7.0 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 964fd98a..dd1bb3a1 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "ed268bbf9183392e21e771f64bd91c19316f8361" + echo "a96abff8082d3c6ac7f1acb57727656a94a6bde9" } # Show version information diff --git a/patches/wined3d-CSMT_Main/0030-wined3d-Use-resource-facilities-to-destroy-PBOs.patch b/patches/wined3d-CSMT_Main/0030-wined3d-Use-resource-facilities-to-destroy-PBOs.patch index dc6616e3..e56af67b 100644 --- a/patches/wined3d-CSMT_Main/0030-wined3d-Use-resource-facilities-to-destroy-PBOs.patch +++ b/patches/wined3d-CSMT_Main/0030-wined3d-Use-resource-facilities-to-destroy-PBOs.patch @@ -1,4 +1,4 @@ -From 42b6ba4bb832d0191cda985e2701c61626c103b6 Mon Sep 17 00:00:00 2001 +From 1ad9f7310d40524027fbb81d998bf8eb1a5dd067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 16:49:21 +0100 Subject: wined3d: Use resource facilities to destroy PBOs. @@ -10,10 +10,10 @@ Subject: wined3d: Use resource facilities to destroy PBOs. 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 882491c..e10ba41 100644 +index 2ad66de..362da3d 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -223,7 +223,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -233,7 +233,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * return WINED3D_OK; } @@ -23,10 +23,10 @@ index 882491c..e10ba41 100644 struct wined3d_context *context = context_acquire(resource->device, NULL); const struct wined3d_gl_info *gl_info = context->gl_info; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 273da13..8ae36af 100644 +index 91f1229..83c5ad4 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -958,16 +958,6 @@ static HRESULT wined3d_surface_depth_blt(struct wined3d_surface *src_surface, DW +@@ -939,16 +939,6 @@ static HRESULT wined3d_surface_depth_blt(struct wined3d_surface *src_surface, DW return WINED3D_OK; } @@ -42,8 +42,8 @@ index 273da13..8ae36af 100644 - static ULONG surface_resource_incref(struct wined3d_resource *resource) { - return wined3d_surface_incref(surface_from_resource(resource)); -@@ -1013,10 +1003,6 @@ static void surface_unload(struct wined3d_resource *resource) + struct wined3d_surface *surface = surface_from_resource(resource); +@@ -996,10 +986,6 @@ static void surface_unload(struct wined3d_resource *resource) wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); } @@ -54,7 +54,7 @@ index 273da13..8ae36af 100644 /* Destroy fbo render buffers. This is needed for implicit render targets, for * all application-created targets the application has to release the surface * before calling _Reset -@@ -3949,7 +3935,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3918,7 +3904,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, wined3d_resource_prepare_map_memory(&surface->resource, context); wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); @@ -65,10 +65,10 @@ index 273da13..8ae36af 100644 wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 4fd8b62..50fc36b 100644 +index 8864b3b..9813d84 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2216,6 +2216,7 @@ DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; +@@ -2261,6 +2261,7 @@ DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, const struct wined3d_box *box) DECLSPEC_HIDDEN; @@ -77,5 +77,5 @@ index 4fd8b62..50fc36b 100644 BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; -- -2.6.1 +2.7.0 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 2c4b9548..4319d5e9 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -5379,8 +5379,8 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +#endif /* STAGING_CSMT */ static ULONG surface_resource_incref(struct wined3d_resource *resource) { - return wined3d_surface_incref(surface_from_resource(resource)); -@@ -979,6 +1227,7 @@ + struct wined3d_surface *surface = surface_from_resource(resource); +@@ -987,6 +1235,7 @@ if (resource->pool == WINED3D_POOL_DEFAULT) { @@ -5388,7 +5388,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Default pool resources are supposed to be destroyed before Reset is called. * Implicit resources stay however. So this means we have an implicit render target * or depth stencil. The content may be destroyed, but we still have to tear down -@@ -992,6 +1241,40 @@ +@@ -1000,6 +1249,40 @@ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); } @@ -5429,7 +5429,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Destroy fbo render buffers. This is needed for implicit render targets, for * all application-created targets the application has to release the surface -@@ -1035,6 +1318,7 @@ +@@ -1043,6 +1326,7 @@ return WINED3DERR_INVALIDCALL; } @@ -5437,7 +5437,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); -@@ -1050,6 +1334,21 @@ +@@ -1058,6 +1342,21 @@ { surface_private_setup, surface_frontbuffer_updated, @@ -5459,7 +5459,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c }; /***************************************************************************** -@@ -1093,6 +1392,7 @@ +@@ -1101,6 +1400,7 @@ return WINED3D_OK; } @@ -5467,7 +5467,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static void gdi_surface_frontbuffer_updated(struct wined3d_surface *surface) { x11_copy_to_screen(surface->container->swapchain, &surface->lockedRect); -@@ -1102,6 +1402,23 @@ +@@ -1110,6 +1410,23 @@ { gdi_surface_private_setup, gdi_surface_frontbuffer_updated, @@ -5491,7 +5491,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c }; /* This call just downloads data, the caller is responsible for binding the -@@ -1120,7 +1437,11 @@ +@@ -1128,7 +1445,11 @@ return; } @@ -5503,7 +5503,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface->container->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) { -@@ -1148,6 +1469,7 @@ +@@ -1156,6 +1477,7 @@ void *mem; GLenum gl_format = format->glFormat; GLenum gl_type = format->glType; @@ -5511,7 +5511,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c UINT src_pitch = 0; UINT dst_row_pitch, dst_slice_pitch; -@@ -1156,6 +1478,16 @@ +@@ -1164,6 +1486,16 @@ unsigned char alignment = surface->resource.device->surface_alignment; src_pitch = format->byte_count * surface->pow2Width; wined3d_resource_get_pitch(&surface->resource, &dst_row_pitch, &dst_slice_pitch); @@ -5528,7 +5528,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1); mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * surface->pow2Height); } -@@ -1242,12 +1574,21 @@ +@@ -1250,12 +1582,21 @@ * won't be released, and doesn't have to be re-read. */ src_data = mem; dst_data = data.addr; @@ -5550,7 +5550,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HeapFree(GetProcessHeap(), 0, mem); -@@ -1371,6 +1712,7 @@ +@@ -1379,6 +1720,7 @@ static BOOL surface_check_block_align(struct wined3d_surface *surface, const struct wined3d_box *box) { @@ -5558,7 +5558,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((box->left >= box->right) || (box->top >= box->bottom) || (box->right > surface->resource.width) -@@ -1381,6 +1723,34 @@ +@@ -1389,6 +1731,34 @@ } BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect) @@ -5593,7 +5593,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { struct wined3d_box box = {rect->left, rect->top, rect->right, rect->bottom, 0, 1}; -@@ -1399,7 +1769,11 @@ +@@ -1407,7 +1777,11 @@ UINT update_w, update_h; UINT dst_w, dst_h; RECT r, dst_rect; @@ -5605,7 +5605,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c POINT p; TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n", -@@ -1470,11 +1844,17 @@ +@@ -1478,11 +1852,17 @@ return WINED3DERR_INVALIDCALL; } @@ -5623,7 +5623,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(dst_surface->resource.device, NULL); gl_info = context->gl_info; -@@ -1485,6 +1865,7 @@ +@@ -1493,6 +1873,7 @@ if (update_w == dst_w && update_h == dst_h) wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); else @@ -5631,7 +5631,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); -@@ -1498,6 +1879,21 @@ +@@ -1506,6 +1887,21 @@ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -5653,7 +5653,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -1611,6 +2007,7 @@ +@@ -1619,6 +2015,7 @@ if (surface->resource.pool == WINED3D_POOL_SCRATCH) ERR("Not supported on scratch surfaces.\n"); @@ -5661,7 +5661,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"); -@@ -1619,6 +2016,16 @@ +@@ -1627,6 +2024,16 @@ TRACE("Reloading because surface is dirty.\n"); wined3d_resource_load_location(&surface->resource, context, location); @@ -5678,7 +5678,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_evict_sysmem(surface); } -@@ -1701,6 +2108,7 @@ +@@ -1695,6 +2102,7 @@ void CDECL wined3d_surface_preload(struct wined3d_surface *surface) { @@ -5686,7 +5686,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); -@@ -1711,6 +2119,17 @@ +@@ -1705,6 +2113,17 @@ } wined3d_cs_emit_surface_preload(device->cs, surface); @@ -5704,7 +5704,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) -@@ -1729,10 +2148,28 @@ +@@ -1723,10 +2142,28 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface) { @@ -5733,7 +5733,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y) -@@ -1857,6 +2294,7 @@ +@@ -1851,6 +2288,7 @@ { DeleteDC(surface->hDC); DeleteObject(surface->dib.DIBsection); @@ -5741,7 +5741,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; -@@ -1865,6 +2303,15 @@ +@@ -1859,6 +2297,15 @@ surface->resource.locations = 0; wined3d_resource_free_sysmem(&surface->resource); surface->resource.map_heap_memory = NULL; @@ -5757,7 +5757,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c width = texture_resource->width; height = texture_resource->height; -@@ -1890,6 +2337,7 @@ +@@ -1884,6 +2331,7 @@ else surface->flags &= ~SFLAG_NONPOW2; @@ -5765,7 +5765,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((surface->resource.user_memory = mem)) { surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; -@@ -1910,6 +2358,27 @@ +@@ -1904,6 +2352,27 @@ surface->resource.size = wined3d_format_calculate_size(texture_resource->format, 1, width, height, 1); surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width); @@ -5793,7 +5793,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* The format might be changed to a format that needs conversion. -@@ -1932,11 +2401,19 @@ +@@ -1926,11 +2395,19 @@ if (!valid_location) { @@ -5813,7 +5813,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -2295,6 +2772,7 @@ +@@ -2289,6 +2766,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) { @@ -5821,7 +5821,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; -@@ -2303,6 +2781,13 @@ +@@ -2297,6 +2775,13 @@ struct wined3d_surface *dst; struct wined3d_context *context = NULL; struct wined3d_device *device = source->resource.device; @@ -5835,7 +5835,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conv = find_converter(source->resource.format->id, to_fmt); if (!conv) -@@ -2327,6 +2812,7 @@ +@@ -2321,6 +2806,7 @@ } dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); @@ -5843,7 +5843,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); -@@ -2367,6 +2853,32 @@ +@@ -2361,6 +2847,32 @@ if (context) context_release(context); return NULL; @@ -5876,7 +5876,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, -@@ -2434,6 +2946,7 @@ +@@ -2428,6 +2940,7 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -5884,7 +5884,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p.\n", surface); -@@ -2444,6 +2957,20 @@ +@@ -2438,6 +2951,20 @@ memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); return hr; @@ -5905,7 +5905,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, -@@ -2451,10 +2978,25 @@ +@@ -2445,10 +2972,25 @@ { const struct wined3d_format *format = surface->resource.format; unsigned int fmt_flags = surface->container->resource.format_flags; @@ -5934,7 +5934,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c WARN("Map rect %p is misaligned for %ux%u blocks.\n", box, format->block_width, format->block_height); -@@ -2462,6 +3004,13 @@ +@@ -2456,6 +2998,13 @@ return WINED3DERR_INVALIDCALL; } @@ -5948,7 +5948,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 -@@ -2477,6 +3026,7 @@ +@@ -2471,6 +3020,7 @@ } } @@ -5956,7 +5956,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (box) { surface->lockedRect.left = box->left; -@@ -2500,6 +3050,120 @@ +@@ -2494,6 +3044,120 @@ HRESULT hr; struct wined3d_device *device = surface->resource.device; struct wined3d_context *context = NULL; @@ -6077,7 +6077,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (device->d3d_initialized) context = context_acquire(surface->resource.device, NULL); -@@ -2511,6 +3175,7 @@ +@@ -2505,6 +3169,7 @@ { if (context) context_release(context); @@ -6085,7 +6085,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; } if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY -@@ -2558,6 +3223,50 @@ +@@ -2552,6 +3217,50 @@ void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) { if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM @@ -6136,7 +6136,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c && surface->resource.map_binding != WINED3D_LOCATION_DIB)) { /* The game Salammbo modifies the surface contents without mapping the surface between -@@ -2573,6 +3282,7 @@ +@@ -2567,6 +3276,7 @@ if (device->d3d_initialized) context = context_acquire(device, NULL); @@ -6144,7 +6144,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); if (context) -@@ -2598,6 +3308,13 @@ +@@ -2592,6 +3302,13 @@ surface->flags &= ~SFLAG_DCINUSE; wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); @@ -6158,7 +6158,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -2614,9 +3331,14 @@ +@@ -2608,9 +3325,14 @@ int i; BOOL srcIsUpsideDown; struct wined3d_bo_address data; @@ -6173,7 +6173,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface != old_ctx->current_rt) { -@@ -2656,8 +3378,13 @@ +@@ -2650,8 +3372,13 @@ } /* Setup pixel store pack state -- to glReadPixels into the correct place */ @@ -6187,7 +6187,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c checkGLcall("glPixelStorei"); gl_info->gl_ops.gl.p_glReadPixels(0, 0, -@@ -2674,6 +3401,10 @@ +@@ -2668,6 +3395,10 @@ { /* glReadPixels returns the image upside down, and there is no way to prevent this. * Flip the lines in software. */ @@ -6198,7 +6198,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) goto error; -@@ -2918,8 +3649,13 @@ +@@ -2912,8 +3643,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. */ @@ -6212,7 +6212,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Uses the hardware to stretch and flip the image */ -@@ -2987,7 +3723,11 @@ +@@ -2981,7 +3717,11 @@ checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -6224,7 +6224,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 -@@ -3184,6 +3924,7 @@ +@@ -3178,6 +3918,7 @@ checkGLcall("glDeleteTextures(1, &backup)"); } @@ -6232,7 +6232,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) -@@ -3195,6 +3936,17 @@ +@@ -3189,6 +3930,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); @@ -6250,7 +6250,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3249,9 +4001,15 @@ +@@ -3243,9 +3995,15 @@ gl_info = context->gl_info; @@ -6266,7 +6266,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 */ -@@ -3294,9 +4052,13 @@ +@@ -3288,9 +4046,13 @@ /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -6280,7 +6280,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c || (dst_surface->container->swapchain && dst_surface->container->swapchain->front_buffer == dst_surface->container)) gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ -@@ -3326,8 +4088,13 @@ +@@ -3320,8 +4082,13 @@ enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -6294,7 +6294,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), -@@ -3518,6 +4285,7 @@ +@@ -3512,6 +4279,7 @@ { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -6302,7 +6302,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))) -@@ -3526,6 +4294,15 @@ +@@ -3520,6 +4288,15 @@ surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; surface->resource.locations = location; @@ -6318,7 +6318,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Context activation is done by the caller. */ -@@ -3540,7 +4317,11 @@ +@@ -3534,7 +4311,11 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -6330,7 +6330,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; -@@ -3567,6 +4348,7 @@ +@@ -3561,6 +4342,7 @@ } wined3d_surface_prepare(surface, context, location); @@ -6338,7 +6338,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface->resource.locations & WINED3D_LOCATION_DISCARDED) { TRACE("Surface was discarded, no need copy data.\n"); -@@ -3581,6 +4363,22 @@ +@@ -3575,6 +4357,22 @@ { FIXME("No up to date depth stencil location.\n"); surface->resource.locations |= location; @@ -6361,7 +6361,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; -@@ -3644,9 +4442,13 @@ +@@ -3638,9 +4436,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -6375,7 +6375,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) -@@ -3662,9 +4464,13 @@ +@@ -3656,9 +4458,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -6389,7 +6389,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 -@@ -3672,6 +4478,7 @@ +@@ -3666,6 +4472,7 @@ ERR("Invalid location (%#x) specified.\n", location); } @@ -6397,7 +6397,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; -@@ -3704,6 +4511,124 @@ +@@ -3698,6 +4505,124 @@ FIXME("Can't load surface %p with location flags %s into sysmem.\n", surface, wined3d_debug_location(surface->resource.locations)); @@ -6522,7 +6522,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Context activation is done by the caller. */ -@@ -3712,12 +4637,14 @@ +@@ -3706,12 +4631,14 @@ { RECT r; @@ -6537,7 +6537,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)) { -@@ -3726,7 +4653,11 @@ +@@ -3720,7 +4647,11 @@ } surface_get_rect(surface, NULL, &r); @@ -6549,7 +6549,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -3741,6 +4672,7 @@ +@@ -3735,6 +4666,7 @@ struct wined3d_device *device = surface->resource.device; const struct wined3d_color_key_conversion *conversion; struct wined3d_texture *texture = surface->container; @@ -6557,7 +6557,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c UINT width, src_row_pitch, src_slice_pitch, dst_pitch; struct wined3d_bo_address data; struct wined3d_format format; -@@ -3767,6 +4699,24 @@ +@@ -3761,6 +4693,24 @@ } if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) @@ -6582,7 +6582,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c && (surface->container->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, -@@ -3782,6 +4732,7 @@ +@@ -3776,6 +4726,7 @@ return WINED3D_OK; } @@ -6590,7 +6590,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) && (!srgb || (surface->container->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)) && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, -@@ -3789,6 +4740,15 @@ +@@ -3783,6 +4734,15 @@ NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) { DWORD src_location = surface->resource.locations & WINED3D_LOCATION_RB_RESOLVED ? @@ -6606,7 +6606,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c 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}; -@@ -3803,6 +4763,7 @@ +@@ -3797,6 +4757,7 @@ if (srgb) { @@ -6614,7 +6614,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) { -@@ -3837,6 +4798,42 @@ +@@ -3831,6 +4792,42 @@ width = surface->resource.width; wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch); @@ -6657,7 +6657,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c format = *texture->resource.format; if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) -@@ -3845,7 +4842,11 @@ +@@ -3839,7 +4836,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. */ @@ -6669,7 +6669,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3854,6 +4855,7 @@ +@@ -3848,6 +4849,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -6677,7 +6677,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); -@@ -3861,6 +4863,14 @@ +@@ -3855,6 +4857,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -6692,7 +6692,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. */ -@@ -3875,9 +4885,15 @@ +@@ -3869,9 +4879,15 @@ context_release(context); return E_OUTOFMEMORY; } @@ -6708,7 +6708,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c data.addr = mem; } else if (conversion) -@@ -3897,6 +4913,7 @@ +@@ -3891,6 +4907,7 @@ } if (texture->swapchain && texture->swapchain->palette) palette = texture->swapchain->palette; @@ -6716,7 +6716,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conversion->convert(data.addr, src_row_pitch, mem, dst_pitch, width, height, palette, &texture->async.gl_color_key); src_row_pitch = dst_pitch; -@@ -3905,6 +4922,16 @@ +@@ -3899,6 +4916,16 @@ wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); @@ -6733,7 +6733,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HeapFree(GetProcessHeap(), 0, mem); -@@ -3918,11 +4945,19 @@ +@@ -3912,11 +4939,19 @@ const RECT rect = {0, 0, surface->resource.width, surface->resource.height}; DWORD src_location; @@ -6753,7 +6753,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_location = WINED3D_LOCATION_TEXTURE_SRGB; else /* surface_blt_fbo will load the source location if necessary. */ src_location = WINED3D_LOCATION_TEXTURE_RGB; -@@ -3931,11 +4966,17 @@ +@@ -3925,11 +4960,17 @@ surface, src_location, &rect, surface, dst_location, &rect); } @@ -6771,7 +6771,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)); -@@ -3943,6 +4984,7 @@ +@@ -3937,6 +4978,7 @@ if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -6779,7 +6779,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); -@@ -3966,6 +5008,45 @@ +@@ -3960,6 +5002,45 @@ { ERR("Surface %p does not have any up to date location.\n", surface); return; @@ -6825,7 +6825,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -3979,7 +5060,11 @@ +@@ -3973,7 +5054,11 @@ case WINED3D_LOCATION_DRAWABLE: if (FAILED(hr = surface_load_drawable(surface, context))) @@ -6837,7 +6837,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; case WINED3D_LOCATION_RB_RESOLVED: -@@ -3991,7 +5076,11 @@ +@@ -3985,7 +5070,11 @@ case WINED3D_LOCATION_TEXTURE_SRGB: if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) @@ -6849,7 +6849,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -3999,12 +5088,21 @@ +@@ -3993,12 +5082,21 @@ break; } @@ -6871,7 +6871,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; } -@@ -4113,6 +5211,7 @@ +@@ -4107,6 +5205,7 @@ const RECT *dst_rect, const struct wined3d_color *color) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -6879,7 +6879,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; -@@ -4133,6 +5232,21 @@ +@@ -4127,6 +5226,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); @@ -6901,7 +6901,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4141,6 +5255,7 @@ +@@ -4135,6 +5249,7 @@ const RECT *dst_rect, float depth) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -6909,7 +6909,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; -@@ -4156,6 +5271,20 @@ +@@ -4150,6 +5265,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); @@ -6930,7 +6930,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4192,8 +5321,13 @@ +@@ -4186,8 +5315,13 @@ wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); @@ -6944,7 +6944,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } const struct blit_shader ffp_blit = { -@@ -4349,6 +5483,7 @@ +@@ -4343,6 +5477,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) { @@ -6952,7 +6952,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c int bpp, srcheight, srcwidth, dstheight, dstwidth, width; const struct wined3d_format *src_format, *dst_format; unsigned int src_fmt_flags, dst_fmt_flags; -@@ -4383,6 +5518,28 @@ +@@ -4377,6 +5512,28 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -6981,7 +6981,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = dst_surface->resource.format; dst_format = src_format; dst_fmt_flags = dst_surface->container->resource.format_flags; -@@ -4394,12 +5551,14 @@ +@@ -4388,12 +5545,14 @@ dst_fmt_flags = dst_surface->container->resource.format_flags; if (src_surface) { @@ -6996,7 +6996,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))) -@@ -4410,9 +5569,13 @@ +@@ -4404,9 +5563,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -7010,7 +7010,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = src_surface->resource.format; src_fmt_flags = src_surface->container->resource.format_flags; } -@@ -4422,8 +5585,12 @@ +@@ -4416,8 +5579,12 @@ src_fmt_flags = dst_fmt_flags; } @@ -7023,7 +7023,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_surface->resource.format->byte_count; -@@ -4434,12 +5601,24 @@ +@@ -4428,12 +5595,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -7048,7 +7048,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4474,7 +5653,11 @@ +@@ -4468,7 +5647,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -7060,7 +7060,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format, flags, fx); goto release; } -@@ -4482,7 +5665,11 @@ +@@ -4476,7 +5659,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -7072,7 +7072,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c flags &= ~WINEDDBLT_COLORFILL; } -@@ -4532,6 +5719,7 @@ +@@ -4526,6 +5713,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -7080,7 +7080,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4545,6 +5733,21 @@ +@@ -4539,6 +5727,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -7102,7 +7102,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c memcpy(dbuf, sbuf, width); } } -@@ -4554,8 +5757,13 @@ +@@ -4548,8 +5751,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -7116,7 +7116,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4564,9 +5772,15 @@ +@@ -4558,9 +5766,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -7132,7 +7132,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4576,6 +5790,7 @@ +@@ -4570,6 +5784,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -7140,7 +7140,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)) -@@ -4583,6 +5798,15 @@ +@@ -4577,6 +5792,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -7156,7 +7156,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4629,6 +5853,7 @@ +@@ -4623,6 +5847,7 @@ } #undef STRETCH_ROW } @@ -7164,7 +7164,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dbuf += dst_row_pitch; last_sy = sy; } -@@ -4637,6 +5862,16 @@ +@@ -4631,6 +5856,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -7181,7 +7181,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)) -@@ -4686,7 +5921,11 @@ +@@ -4680,7 +5915,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -7193,7 +7193,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4763,6 +6002,7 @@ +@@ -4757,6 +5996,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -7201,7 +7201,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4784,6 +6024,29 @@ +@@ -4778,6 +6018,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -7231,7 +7231,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c switch (bpp) { -@@ -4802,7 +6065,11 @@ +@@ -4796,7 +6059,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -7243,7 +7243,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4833,10 +6100,12 @@ +@@ -4827,10 +6094,12 @@ } } @@ -7256,7 +7256,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4844,6 +6113,7 @@ +@@ -4838,6 +6107,7 @@ } release: @@ -7264,7 +7264,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); -@@ -4862,6 +6132,14 @@ +@@ -4856,6 +6126,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -7279,7 +7279,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -4906,7 +6184,11 @@ +@@ -4900,7 +6178,11 @@ cpu_blit_blit_surface, }; @@ -7291,7 +7291,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) { -@@ -4924,6 +6206,98 @@ +@@ -4918,6 +6200,98 @@ | WINEDDBLT_DONOTWAIT | WINEDDBLT_ALPHATEST; @@ -7390,7 +7390,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -4987,6 +6361,7 @@ +@@ -4981,6 +6355,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -7398,7 +7398,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))) -@@ -4997,6 +6372,24 @@ +@@ -4991,6 +6366,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; @@ -7423,7 +7423,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -5005,8 +6398,13 @@ +@@ -4999,8 +6392,13 @@ /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ @@ -7437,7 +7437,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5028,7 +6426,11 @@ +@@ -5022,7 +6420,11 @@ goto fallback; if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) @@ -7449,7 +7449,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -5050,8 +6452,13 @@ +@@ -5044,8 +6446,13 @@ { blit_op = WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST; } @@ -7463,7 +7463,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { /* Upload */ if (scale) -@@ -5067,11 +6474,18 @@ +@@ -5061,11 +6468,18 @@ if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) { struct wined3d_context *context = context_acquire(device, dst_surface); @@ -7482,7 +7482,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -5095,7 +6509,11 @@ +@@ -5089,7 +6503,11 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -7494,7 +7494,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } if (fbo_blit_supported(&device->adapter->gl_info, blit_op, -@@ -5111,10 +6529,17 @@ +@@ -5105,10 +6523,17 @@ dst_surface, dst_surface->container->resource.draw_binding, dst_rect); context_release(context); @@ -7512,7 +7512,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op, -@@ -5124,6 +6549,7 @@ +@@ -5118,6 +6543,7 @@ { blitter->blit_surface(device, blit_op, filter, src_surface, src_rect, dst_surface, dst_rect, color_key); @@ -7520,7 +7520,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; } } -@@ -5289,6 +6715,21 @@ +@@ -5283,6 +6709,21 @@ wined3d_surface_location_invalidated, wined3d_surface_load_location, }; @@ -7542,7 +7542,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) -@@ -5350,7 +6791,11 @@ +@@ -5344,7 +6785,11 @@ } surface->container = container; @@ -7554,7 +7554,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5382,9 +6827,14 @@ +@@ -5376,9 +6821,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -7569,7 +7569,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } return hr; -@@ -5411,7 +6861,11 @@ +@@ -5405,7 +6855,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr); @@ -8268,7 +8268,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1544,6 +1672,9 @@ +@@ -1533,6 +1661,9 @@ if (FAILED(hr)) { WARN("Failed to initialize texture, returning %#x.\n", hr);