From e9bb99ec93ceea28a14d24670befe50f46c21e30 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 27 Jan 2016 20:46:52 +0100 Subject: [PATCH] Rebase against ad11f38db92b425e8df84dc4f7ea58366b73e32a. --- patches/patchinstall.sh | 2 +- ...ned3d-Remove-software-cursor-support.patch | 6 +- .../wined3d-CSMT_Main/9999-IfDefined.patch | 192 +++++++++--------- 3 files changed, 100 insertions(+), 100 deletions(-) diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 56b70bac..a7d139f2 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "dafaae77308be415e024739f227fea64ae85d6d2" + echo "ad11f38db92b425e8df84dc4f7ea58366b73e32a" } # Show version information diff --git a/patches/wined3d-CSMT_Main/0135-wined3d-Remove-software-cursor-support.patch b/patches/wined3d-CSMT_Main/0135-wined3d-Remove-software-cursor-support.patch index 392f0bda..dbe2c7e5 100644 --- a/patches/wined3d-CSMT_Main/0135-wined3d-Remove-software-cursor-support.patch +++ b/patches/wined3d-CSMT_Main/0135-wined3d-Remove-software-cursor-support.patch @@ -1,4 +1,4 @@ -From a97224e11fa08e644eba80e0d8a805405cb82a8c Mon Sep 17 00:00:00 2001 +From 5630b5ff775157526358b39aa01da3d3d3ed2a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 3 Oct 2013 19:23:24 +0200 Subject: wined3d: Remove software cursor support. @@ -14,7 +14,7 @@ FIXME: Make sure wined3d_device_show_cursor returns the correct value if a softw 3 files changed, 94 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index b8408eb..28e6f8c 100644 +index 7b7d5c9..d521cca 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1119,8 +1119,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) @@ -60,7 +60,7 @@ index b8408eb..28e6f8c 100644 - desc.depth = 1; - desc.size = 0; - -- hr = wined3d_texture_create(device, &desc, 1, WINED3D_SURFACE_MAPPABLE, +- hr = wined3d_texture_create(device, &desc, 1, WINED3D_TEXTURE_CREATE_MAPPABLE, - &data, NULL, &wined3d_null_parent_ops, &texture); - wined3d_surface_unmap(cursor_image); - if (FAILED(hr)) diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index fe0c31d3..610e2aa3 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -3317,7 +3317,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c + desc.depth = 1; + desc.size = 0; + -+ hr = wined3d_texture_create(device, &desc, 1, WINED3D_SURFACE_MAPPABLE, ++ hr = wined3d_texture_create(device, &desc, 1, WINED3D_TEXTURE_CREATE_MAPPABLE, + &data, NULL, &wined3d_null_parent_ops, &texture); + wined3d_surface_unmap(cursor_image); + if (FAILED(hr)) @@ -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) -@@ -2326,6 +2811,7 @@ +@@ -2327,6 +2812,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); -@@ -2366,6 +2852,32 @@ +@@ -2367,6 +2853,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, -@@ -2433,6 +2945,7 @@ +@@ -2434,6 +2946,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); -@@ -2443,6 +2956,20 @@ +@@ -2444,6 +2957,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, -@@ -2450,10 +2977,25 @@ +@@ -2451,10 +2978,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); -@@ -2461,6 +3003,13 @@ +@@ -2462,6 +3004,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 -@@ -2476,6 +3025,7 @@ +@@ -2477,6 +3026,7 @@ } } @@ -5956,7 +5956,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (box) { surface->lockedRect.left = box->left; -@@ -2499,6 +3049,120 @@ +@@ -2500,6 +3050,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); -@@ -2510,6 +3174,7 @@ +@@ -2511,6 +3175,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 -@@ -2557,6 +3222,50 @@ +@@ -2558,6 +3223,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 -@@ -2572,6 +3281,7 @@ +@@ -2573,6 +3282,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) -@@ -2597,6 +3307,13 @@ +@@ -2598,6 +3308,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; } -@@ -2613,9 +3330,14 @@ +@@ -2614,9 +3331,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) { -@@ -2655,8 +3377,13 @@ +@@ -2656,8 +3378,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, -@@ -2673,6 +3400,10 @@ +@@ -2674,6 +3401,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; -@@ -2899,8 +3630,13 @@ +@@ -2900,8 +3631,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 */ -@@ -2968,7 +3704,11 @@ +@@ -2969,7 +3705,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 -@@ -3165,6 +3905,7 @@ +@@ -3166,6 +3906,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) -@@ -3176,6 +3917,17 @@ +@@ -3177,6 +3918,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 -@@ -3230,9 +3982,15 @@ +@@ -3231,9 +3983,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 */ -@@ -3275,9 +4033,13 @@ +@@ -3276,9 +4034,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. */ -@@ -3307,8 +4069,13 @@ +@@ -3308,8 +4070,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), -@@ -3499,6 +4266,7 @@ +@@ -3500,6 +4267,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))) -@@ -3507,6 +4275,15 @@ +@@ -3508,6 +4276,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. */ -@@ -3521,7 +4298,11 @@ +@@ -3522,7 +4299,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; -@@ -3548,6 +4329,7 @@ +@@ -3549,6 +4330,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"); -@@ -3562,6 +4344,22 @@ +@@ -3563,6 +4345,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; -@@ -3625,9 +4423,13 @@ +@@ -3626,9 +4424,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) -@@ -3643,9 +4445,13 @@ +@@ -3644,9 +4446,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 -@@ -3653,6 +4459,7 @@ +@@ -3654,6 +4460,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; -@@ -3685,6 +4492,124 @@ +@@ -3686,6 +4493,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. */ -@@ -3693,12 +4618,14 @@ +@@ -3694,12 +4619,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)) { -@@ -3707,7 +4634,11 @@ +@@ -3708,7 +4635,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); -@@ -3722,6 +4653,7 @@ +@@ -3723,6 +4654,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; -@@ -3748,6 +4680,24 @@ +@@ -3749,6 +4681,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, -@@ -3763,6 +4713,7 @@ +@@ -3764,6 +4714,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, -@@ -3770,6 +4721,15 @@ +@@ -3771,6 +4722,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}; -@@ -3784,6 +4744,7 @@ +@@ -3785,6 +4745,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) { -@@ -3818,15 +4779,55 @@ +@@ -3819,15 +4780,55 @@ width = surface->resource.width; wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch); @@ -6679,7 +6679,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3835,6 +4836,7 @@ +@@ -3836,6 +4837,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -6687,7 +6687,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); -@@ -3842,6 +4844,14 @@ +@@ -3843,6 +4845,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -6702,7 +6702,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. */ -@@ -3856,9 +4866,15 @@ +@@ -3857,9 +4867,15 @@ context_release(context); return E_OUTOFMEMORY; } @@ -6718,7 +6718,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c data.addr = mem; } else if (conversion) -@@ -3878,6 +4894,7 @@ +@@ -3879,6 +4895,7 @@ } if (texture->swapchain && texture->swapchain->palette) palette = texture->swapchain->palette; @@ -6726,7 +6726,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; -@@ -3886,6 +4903,16 @@ +@@ -3887,6 +4904,16 @@ wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); @@ -6743,7 +6743,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HeapFree(GetProcessHeap(), 0, mem); -@@ -3899,11 +4926,19 @@ +@@ -3900,11 +4927,19 @@ const RECT rect = {0, 0, surface->resource.width, surface->resource.height}; DWORD src_location; @@ -6763,7 +6763,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; -@@ -3912,11 +4947,17 @@ +@@ -3913,11 +4948,17 @@ surface, src_location, &rect, surface, dst_location, &rect); } @@ -6781,7 +6781,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)); -@@ -3924,6 +4965,7 @@ +@@ -3925,6 +4966,7 @@ if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -6789,7 +6789,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); -@@ -3947,6 +4989,45 @@ +@@ -3948,6 +4990,45 @@ { ERR("Surface %p does not have any up to date location.\n", surface); return; @@ -6835,7 +6835,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -3960,7 +5041,11 @@ +@@ -3961,7 +5042,11 @@ case WINED3D_LOCATION_DRAWABLE: if (FAILED(hr = surface_load_drawable(surface, context))) @@ -6847,7 +6847,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; case WINED3D_LOCATION_RB_RESOLVED: -@@ -3972,7 +5057,11 @@ +@@ -3973,7 +5058,11 @@ case WINED3D_LOCATION_TEXTURE_SRGB: if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) @@ -6859,7 +6859,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -3980,12 +5069,21 @@ +@@ -3981,12 +5070,21 @@ break; } @@ -6881,7 +6881,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; } -@@ -4094,6 +5192,7 @@ +@@ -4095,6 +5193,7 @@ const RECT *dst_rect, const struct wined3d_color *color) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -6889,7 +6889,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; -@@ -4114,6 +5213,21 @@ +@@ -4115,6 +5214,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); @@ -6911,7 +6911,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4122,6 +5236,7 @@ +@@ -4123,6 +5237,7 @@ const RECT *dst_rect, float depth) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -6919,7 +6919,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; -@@ -4137,6 +5252,20 @@ +@@ -4138,6 +5253,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); @@ -6940,7 +6940,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4173,8 +5302,13 @@ +@@ -4174,8 +5303,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); @@ -6954,7 +6954,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } const struct blit_shader ffp_blit = { -@@ -4330,6 +5464,7 @@ +@@ -4331,6 +5465,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) { @@ -6962,7 +6962,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; -@@ -4364,6 +5499,28 @@ +@@ -4365,6 +5500,28 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -6991,7 +6991,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; -@@ -4375,12 +5532,14 @@ +@@ -4376,12 +5533,14 @@ dst_fmt_flags = dst_surface->container->resource.format_flags; if (src_surface) { @@ -7006,7 +7006,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))) -@@ -4391,9 +5550,13 @@ +@@ -4392,9 +5551,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -7020,7 +7020,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; } -@@ -4403,8 +5566,12 @@ +@@ -4404,8 +5567,12 @@ src_fmt_flags = dst_fmt_flags; } @@ -7033,7 +7033,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_surface->resource.format->byte_count; -@@ -4415,12 +5582,24 @@ +@@ -4416,12 +5583,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -7058,7 +7058,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4455,7 +5634,11 @@ +@@ -4456,7 +5635,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -7070,7 +7070,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format, flags, fx); goto release; } -@@ -4463,7 +5646,11 @@ +@@ -4464,7 +5647,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -7082,7 +7082,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c flags &= ~WINEDDBLT_COLORFILL; } -@@ -4513,6 +5700,7 @@ +@@ -4514,6 +5701,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -7090,7 +7090,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4526,6 +5714,21 @@ +@@ -4527,6 +5715,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -7112,7 +7112,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c memcpy(dbuf, sbuf, width); } } -@@ -4535,8 +5738,13 @@ +@@ -4536,8 +5739,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -7126,7 +7126,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4545,9 +5753,15 @@ +@@ -4546,9 +5754,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -7142,7 +7142,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4557,6 +5771,7 @@ +@@ -4558,6 +5772,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -7150,7 +7150,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)) -@@ -4564,6 +5779,15 @@ +@@ -4565,6 +5780,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -7166,7 +7166,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4610,6 +5834,7 @@ +@@ -4611,6 +5835,7 @@ } #undef STRETCH_ROW } @@ -7174,7 +7174,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dbuf += dst_row_pitch; last_sy = sy; } -@@ -4618,6 +5843,16 @@ +@@ -4619,6 +5844,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -7191,7 +7191,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)) -@@ -4667,7 +5902,11 @@ +@@ -4668,7 +5903,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -7203,7 +7203,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4744,6 +5983,7 @@ +@@ -4745,6 +5984,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -7211,7 +7211,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4765,6 +6005,29 @@ +@@ -4766,6 +6006,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -7241,7 +7241,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c switch (bpp) { -@@ -4783,7 +6046,11 @@ +@@ -4784,7 +6047,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -7253,7 +7253,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4814,10 +6081,12 @@ +@@ -4815,10 +6082,12 @@ } } @@ -7266,7 +7266,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4825,6 +6094,7 @@ +@@ -4826,6 +6095,7 @@ } release: @@ -7274,7 +7274,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); -@@ -4843,6 +6113,14 @@ +@@ -4844,6 +6114,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -7289,7 +7289,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -4887,6 +6165,7 @@ +@@ -4888,6 +6166,7 @@ cpu_blit_blit_surface, }; @@ -7297,7 +7297,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) -@@ -4894,6 +6173,16 @@ +@@ -4895,6 +6174,16 @@ struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_device *device = dst_surface->resource.device; DWORD src_ds_flags, dst_ds_flags; @@ -7314,7 +7314,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -4905,6 +6194,106 @@ +@@ -4906,6 +6195,106 @@ | WINEDDBLT_DONOTWAIT | WINEDDBLT_ALPHATEST; @@ -7421,7 +7421,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -4947,8 +6336,13 @@ +@@ -4948,8 +6337,13 @@ } scale = src_surface @@ -7435,7 +7435,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->container->resource.format_flags -@@ -4968,6 +6362,7 @@ +@@ -4969,6 +6363,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -7443,7 +7443,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))) -@@ -4978,6 +6373,24 @@ +@@ -4979,6 +6374,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; @@ -7468,7 +7468,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -4986,8 +6399,13 @@ +@@ -4987,8 +6400,13 @@ /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ @@ -7482,7 +7482,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5008,8 +6426,13 @@ +@@ -5009,8 +6427,13 @@ palette, fx->u5.dwFillColor, &color)) goto fallback; @@ -7496,7 +7496,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -5031,8 +6454,13 @@ +@@ -5032,8 +6455,13 @@ { blit_op = WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST; } @@ -7510,7 +7510,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { /* Upload */ if (scale) -@@ -5041,6 +6469,7 @@ +@@ -5042,6 +6470,7 @@ TRACE("Not doing upload because of format conversion.\n"); else { @@ -7518,7 +7518,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))) -@@ -5053,6 +6482,19 @@ +@@ -5054,6 +6483,19 @@ context_release(context); } return; @@ -7538,7 +7538,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -5076,6 +6518,7 @@ +@@ -5077,6 +6519,7 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -7546,7 +7546,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; } -@@ -5284,6 +6727,54 @@ +@@ -5285,6 +6728,54 @@ wined3d_surface_location_invalidated, wined3d_surface_load_location, }; @@ -7601,7 +7601,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) -@@ -5345,7 +6836,11 @@ +@@ -5346,7 +6837,11 @@ } surface->container = container; @@ -7613,7 +7613,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5377,9 +6872,14 @@ +@@ -5378,9 +6873,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -7628,7 +7628,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } return hr; -@@ -5406,7 +6906,11 @@ +@@ -5407,7 +6907,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr);