From 51917ee882deea83eb6a485e37d387967fb8e1c5 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 10 Feb 2016 02:20:14 +0100 Subject: [PATCH] Rebase against b278bb8f5670a123b25d51fd8c927cb4f896a574. --- ...anging-strict-drawing-through-an-exp.patch | 8 +- patches/patchinstall.sh | 2 +- .../wined3d-CSMT_Main/9999-IfDefined.patch | 204 +++++++++--------- 3 files changed, 107 insertions(+), 107 deletions(-) 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 fae39032..c8412cfb 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 fa15751fb4c91885360b81474abf16b5a4b93a99 Mon Sep 17 00:00:00 2001 +From 832df3192f9eea905f6bd12b273735c5ec037249 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,18 +9,18 @@ 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 d31cf9a..dd2def2 100644 +index 5933b48..e3b954d 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec -@@ -222,6 +222,8 @@ +@@ -220,6 +220,8 @@ @ cdecl wined3d_stateblock_decref(ptr) @ cdecl wined3d_stateblock_incref(ptr) +@ cdecl wined3d_strictdrawing_set(long) + - @ cdecl wined3d_surface_get_parent(ptr) @ cdecl wined3d_surface_get_pitch(ptr) + @ cdecl wined3d_swapchain_create(ptr ptr ptr ptr ptr) diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index 0543d97..78cc3a2 100644 --- a/dlls/wined3d/wined3d_main.c diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 3068b6b8..c921cba1 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "195d16c8267fcd5085048b3513571e2fee0eb548" + echo "b278bb8f5670a123b25d51fd8c927cb4f896a574" } # Show version information diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 261f3aed..b1963bfc 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -3642,7 +3642,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } } break; -@@ -4954,7 +5707,11 @@ +@@ -4928,7 +5681,11 @@ device->blitter = adapter->blitter; @@ -3654,7 +3654,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) { ERR("Failed to initialize device state, hr %#x.\n", hr); -@@ -5053,6 +5810,7 @@ +@@ -5027,6 +5784,7 @@ else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -3662,7 +3662,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Context activation is done by the caller */ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, -@@ -5106,3 +5864,4 @@ +@@ -5080,3 +5838,4 @@ wined3d_device_destroy_bo(device, context, bo); } @@ -5672,7 +5672,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_evict_sysmem(surface); } -@@ -1716,6 +2141,7 @@ +@@ -1709,6 +2134,7 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface) { @@ -5680,7 +5680,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c UINT row_pitch, slice_pitch; const struct wined3d_resource *resource = &surface->resource; wined3d_resource_get_pitch(resource, &row_pitch, &slice_pitch); -@@ -1724,6 +2150,26 @@ +@@ -1717,6 +2143,26 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) @@ -5707,7 +5707,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { struct wined3d_resource *texture_resource = &surface->container->resource; unsigned int width, height; -@@ -1735,6 +2181,7 @@ +@@ -1728,6 +2174,7 @@ { DeleteDC(surface->hDC); DeleteObject(surface->dib.DIBsection); @@ -5715,7 +5715,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; -@@ -1743,6 +2190,15 @@ +@@ -1736,6 +2183,15 @@ surface->resource.locations = 0; wined3d_resource_free_sysmem(&surface->resource); surface->resource.map_heap_memory = NULL; @@ -5731,7 +5731,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c width = texture_resource->width; height = texture_resource->height; -@@ -1768,6 +2224,7 @@ +@@ -1761,6 +2217,7 @@ else surface->flags &= ~SFLAG_NONPOW2; @@ -5739,7 +5739,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; -@@ -1788,6 +2245,26 @@ +@@ -1781,6 +2238,26 @@ 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); @@ -5766,7 +5766,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* The format might be changed to a format that needs conversion. -@@ -1810,11 +2287,19 @@ +@@ -1803,11 +2280,19 @@ if (!valid_location) { @@ -5786,7 +5786,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -2173,6 +2658,7 @@ +@@ -2166,6 +2651,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) { @@ -5794,7 +5794,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; -@@ -2181,6 +2667,13 @@ +@@ -2174,6 +2660,13 @@ struct wined3d_surface *dst; struct wined3d_context *context = NULL; struct wined3d_device *device = source->resource.device; @@ -5808,7 +5808,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conv = find_converter(source->resource.format->id, to_fmt); if (!conv) -@@ -2205,6 +2698,7 @@ +@@ -2198,6 +2691,7 @@ } dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); @@ -5816,7 +5816,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); -@@ -2245,6 +2739,32 @@ +@@ -2238,6 +2732,32 @@ if (context) context_release(context); return NULL; @@ -5849,7 +5849,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, -@@ -2307,6 +2827,7 @@ +@@ -2300,6 +2820,7 @@ HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -5857,7 +5857,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p.\n", surface); -@@ -2317,6 +2838,20 @@ +@@ -2310,6 +2831,20 @@ memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); return hr; @@ -5878,7 +5878,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_desc *map_desc, -@@ -2324,6 +2859,21 @@ +@@ -2317,6 +2852,21 @@ { const struct wined3d_format *format = surface->resource.format; unsigned int fmt_flags = surface->container->resource.format_flags; @@ -5900,7 +5900,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box && !surface_check_block_align(surface, box)) -@@ -2335,6 +2885,13 @@ +@@ -2328,6 +2878,13 @@ return WINED3DERR_INVALIDCALL; } @@ -5914,7 +5914,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 -@@ -2350,6 +2907,7 @@ +@@ -2343,6 +2900,7 @@ } } @@ -5922,7 +5922,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (box) { surface->lockedRect.left = box->left; -@@ -2439,6 +2997,119 @@ +@@ -2432,6 +2990,119 @@ DWORD slice_pitch, pitch; wined3d_resource_get_memory(&surface->resource, dst_location, &data); @@ -6042,7 +6042,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface != old_ctx->current_rt) { -@@ -2478,8 +3149,13 @@ +@@ -2471,8 +3142,13 @@ } /* Setup pixel store pack state -- to glReadPixels into the correct place */ @@ -6056,7 +6056,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c checkGLcall("glPixelStorei"); gl_info->gl_ops.gl.p_glReadPixels(0, 0, -@@ -2496,6 +3172,10 @@ +@@ -2489,6 +3165,10 @@ { /* glReadPixels returns the image upside down, and there is no way to prevent this. * Flip the lines in software. */ @@ -6067,7 +6067,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) goto error; -@@ -2740,8 +3420,13 @@ +@@ -2733,8 +3413,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. */ @@ -6081,7 +6081,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Uses the hardware to stretch and flip the image */ -@@ -2809,7 +3494,11 @@ +@@ -2802,7 +3487,11 @@ checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -6093,7 +6093,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 -@@ -3006,6 +3695,7 @@ +@@ -2999,6 +3688,7 @@ checkGLcall("glDeleteTextures(1, &backup)"); } @@ -6101,7 +6101,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) -@@ -3017,6 +3707,17 @@ +@@ -3010,6 +3700,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); @@ -6119,7 +6119,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3071,9 +3772,15 @@ +@@ -3064,9 +3765,15 @@ gl_info = context->gl_info; @@ -6135,7 +6135,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 */ -@@ -3116,9 +3823,13 @@ +@@ -3109,9 +3816,13 @@ /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -6149,7 +6149,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. */ -@@ -3131,8 +3842,13 @@ +@@ -3124,8 +3835,13 @@ { struct wined3d_resource *resource = &s->container->resource; struct wined3d_device *device = resource->device; @@ -6163,7 +6163,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c const struct blit_shader *blitter; HRESULT hr; -@@ -3143,6 +3859,7 @@ +@@ -3136,6 +3852,7 @@ return WINED3DERR_INVALIDCALL; } @@ -6171,7 +6171,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Can't incref / decref the resource here. This is executed inside the worker * thread. Playing with the refcount here makes the worker thread visible to * the client lib. Problems occur when the worker thread happens to hold the -@@ -3159,6 +3876,21 @@ +@@ -3152,6 +3869,21 @@ view.sub_resource_idx = s->texture_layer * texture->level_count + s->texture_level; hr = blitter->color_fill(device, &view, rect, color); @@ -6193,7 +6193,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -3168,8 +3900,13 @@ +@@ -3161,8 +3893,13 @@ enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -6207,7 +6207,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), -@@ -3360,6 +4097,7 @@ +@@ -3353,6 +4090,7 @@ { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -6215,7 +6215,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))) -@@ -3368,6 +4106,15 @@ +@@ -3361,6 +4099,15 @@ surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; surface->resource.locations = location; @@ -6231,7 +6231,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Context activation is done by the caller. */ -@@ -3382,7 +4129,11 @@ +@@ -3375,7 +4122,11 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -6243,7 +6243,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; -@@ -3409,6 +4160,7 @@ +@@ -3402,6 +4153,7 @@ } wined3d_surface_prepare(surface, context, location); @@ -6251,7 +6251,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"); -@@ -3423,6 +4175,22 @@ +@@ -3416,6 +4168,22 @@ { FIXME("No up to date depth stencil location.\n"); surface->resource.locations |= location; @@ -6274,7 +6274,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; -@@ -3486,9 +4254,13 @@ +@@ -3479,9 +4247,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -6288,7 +6288,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) -@@ -3504,9 +4276,13 @@ +@@ -3497,9 +4269,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -6302,7 +6302,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 -@@ -3514,6 +4290,7 @@ +@@ -3507,6 +4283,7 @@ ERR("Invalid location (%#x) specified.\n", location); } @@ -6310,7 +6310,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; -@@ -3546,6 +4323,124 @@ +@@ -3539,6 +4316,124 @@ FIXME("Can't load surface %p with location flags %s into sysmem.\n", surface, wined3d_debug_location(surface->resource.locations)); @@ -6435,7 +6435,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Context activation is done by the caller. */ -@@ -3554,12 +4449,14 @@ +@@ -3547,12 +4442,14 @@ { RECT r; @@ -6450,7 +6450,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)) { -@@ -3568,7 +4465,11 @@ +@@ -3561,7 +4458,11 @@ } surface_get_rect(surface, NULL, &r); @@ -6462,7 +6462,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); -@@ -3583,6 +4484,7 @@ +@@ -3576,6 +4477,7 @@ struct wined3d_device *device = surface->resource.device; const struct wined3d_color_key_conversion *conversion; struct wined3d_texture *texture = surface->container; @@ -6470,7 +6470,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; -@@ -3609,6 +4511,24 @@ +@@ -3602,6 +4504,24 @@ } if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) @@ -6495,7 +6495,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, -@@ -3624,6 +4544,7 @@ +@@ -3617,6 +4537,7 @@ return WINED3D_OK; } @@ -6503,7 +6503,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, -@@ -3631,6 +4552,15 @@ +@@ -3624,6 +4545,15 @@ NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) { DWORD src_location = surface->resource.locations & WINED3D_LOCATION_RB_RESOLVED ? @@ -6519,7 +6519,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}; -@@ -3645,6 +4575,7 @@ +@@ -3638,6 +4568,7 @@ if (srgb) { @@ -6527,7 +6527,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) { -@@ -3679,6 +4610,42 @@ +@@ -3672,6 +4603,42 @@ width = surface->resource.width; wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch); @@ -6570,7 +6570,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))) -@@ -3687,7 +4654,11 @@ +@@ -3680,7 +4647,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. */ @@ -6582,7 +6582,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3696,6 +4667,7 @@ +@@ -3689,6 +4660,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -6590,7 +6590,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); -@@ -3703,6 +4675,14 @@ +@@ -3696,6 +4668,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -6605,7 +6605,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. */ -@@ -3717,9 +4697,15 @@ +@@ -3710,9 +4690,15 @@ context_release(context); return E_OUTOFMEMORY; } @@ -6621,7 +6621,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c data.addr = mem; } else if (conversion) -@@ -3739,6 +4725,7 @@ +@@ -3732,6 +4718,7 @@ } if (texture->swapchain && texture->swapchain->palette) palette = texture->swapchain->palette; @@ -6629,7 +6629,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; -@@ -3747,6 +4734,16 @@ +@@ -3740,6 +4727,16 @@ wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); @@ -6646,7 +6646,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HeapFree(GetProcessHeap(), 0, mem); -@@ -3760,11 +4757,19 @@ +@@ -3753,11 +4750,19 @@ const RECT rect = {0, 0, surface->resource.width, surface->resource.height}; DWORD src_location; @@ -6666,7 +6666,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; -@@ -3773,11 +4778,17 @@ +@@ -3766,11 +4771,17 @@ surface, src_location, &rect, surface, dst_location, &rect); } @@ -6684,7 +6684,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)); -@@ -3785,6 +4796,7 @@ +@@ -3778,6 +4789,7 @@ if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -6692,7 +6692,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); -@@ -3808,6 +4820,45 @@ +@@ -3801,6 +4813,45 @@ { ERR("Surface %p does not have any up to date location.\n", surface); return; @@ -6738,7 +6738,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -3821,7 +4872,11 @@ +@@ -3814,7 +4865,11 @@ case WINED3D_LOCATION_DRAWABLE: if (FAILED(hr = surface_load_drawable(surface, context))) @@ -6750,7 +6750,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; case WINED3D_LOCATION_RB_RESOLVED: -@@ -3833,7 +4888,11 @@ +@@ -3826,7 +4881,11 @@ case WINED3D_LOCATION_TEXTURE_SRGB: if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) @@ -6762,7 +6762,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -3841,12 +4900,21 @@ +@@ -3834,12 +4893,21 @@ break; } @@ -6784,7 +6784,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; } -@@ -3955,7 +5023,11 @@ +@@ -3948,7 +5016,11 @@ const RECT *rect, const struct wined3d_color *color) { const RECT draw_rect = {0, 0, view->width, view->height}; @@ -6796,7 +6796,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c device_clear_render_targets(device, 1, &fb, 1, rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); -@@ -4005,8 +5077,13 @@ +@@ -3998,8 +5070,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); @@ -6810,7 +6810,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } const struct blit_shader ffp_blit = { -@@ -4162,6 +5239,7 @@ +@@ -4155,6 +5232,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) { @@ -6818,7 +6818,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; -@@ -4196,6 +5274,28 @@ +@@ -4189,6 +5267,28 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -6847,7 +6847,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; -@@ -4207,12 +5307,14 @@ +@@ -4200,12 +5300,14 @@ dst_fmt_flags = dst_surface->container->resource.format_flags; if (src_surface) { @@ -6862,7 +6862,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))) -@@ -4223,9 +5325,13 @@ +@@ -4216,9 +5318,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -6876,7 +6876,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; } -@@ -4235,8 +5341,12 @@ +@@ -4228,8 +5334,12 @@ src_fmt_flags = dst_fmt_flags; } @@ -6889,7 +6889,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_surface->resource.format->byte_count; -@@ -4247,12 +5357,24 @@ +@@ -4240,12 +5350,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -6914,7 +6914,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4287,7 +5409,11 @@ +@@ -4280,7 +5402,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -6926,7 +6926,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format, flags, fx); goto release; } -@@ -4295,7 +5421,11 @@ +@@ -4288,7 +5414,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -6938,7 +6938,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c flags &= ~WINEDDBLT_COLORFILL; } -@@ -4345,6 +5475,7 @@ +@@ -4338,6 +5468,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -6946,7 +6946,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4358,6 +5489,21 @@ +@@ -4351,6 +5482,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -6968,7 +6968,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c memcpy(dbuf, sbuf, width); } } -@@ -4367,8 +5513,13 @@ +@@ -4360,8 +5506,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -6982,7 +6982,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4377,9 +5528,15 @@ +@@ -4370,9 +5521,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -6998,7 +6998,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4389,6 +5546,7 @@ +@@ -4382,6 +5539,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -7006,7 +7006,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)) -@@ -4396,6 +5554,15 @@ +@@ -4389,6 +5547,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -7022,7 +7022,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4442,6 +5609,7 @@ +@@ -4435,6 +5602,7 @@ } #undef STRETCH_ROW } @@ -7030,7 +7030,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dbuf += dst_row_pitch; last_sy = sy; } -@@ -4450,6 +5618,16 @@ +@@ -4443,6 +5611,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -7047,7 +7047,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)) -@@ -4499,7 +5677,11 @@ +@@ -4492,7 +5670,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -7059,7 +7059,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4576,6 +5758,7 @@ +@@ -4569,6 +5751,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -7067,7 +7067,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4597,6 +5780,29 @@ +@@ -4590,6 +5773,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -7097,7 +7097,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c switch (bpp) { -@@ -4615,7 +5821,11 @@ +@@ -4608,7 +5814,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -7109,7 +7109,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4646,10 +5856,12 @@ +@@ -4639,10 +5849,12 @@ } } @@ -7122,7 +7122,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4657,6 +5869,7 @@ +@@ -4650,6 +5862,7 @@ } release: @@ -7130,7 +7130,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); -@@ -4675,6 +5888,14 @@ +@@ -4668,6 +5881,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -7145,7 +7145,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -4720,7 +5941,11 @@ +@@ -4713,7 +5934,11 @@ cpu_blit_blit_surface, }; @@ -7157,7 +7157,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) { -@@ -4738,6 +5963,98 @@ +@@ -4731,6 +5956,98 @@ | WINEDDBLT_DONOTWAIT | WINEDDBLT_ALPHATEST; @@ -7256,7 +7256,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -4801,6 +6118,7 @@ +@@ -4794,6 +6111,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -7264,7 +7264,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))) -@@ -4811,6 +6129,24 @@ +@@ -4804,6 +6122,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; @@ -7289,7 +7289,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -4819,8 +6155,13 @@ +@@ -4812,8 +6148,13 @@ /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ @@ -7303,7 +7303,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -4842,7 +6183,11 @@ +@@ -4835,7 +6176,11 @@ goto fallback; if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) @@ -7315,7 +7315,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4864,8 +6209,13 @@ +@@ -4857,8 +6202,13 @@ { blit_op = WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST; } @@ -7329,7 +7329,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { /* Upload */ if (scale) -@@ -4881,11 +6231,18 @@ +@@ -4874,11 +6224,18 @@ if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) { struct wined3d_context *context = context_acquire(device, dst_surface); @@ -7348,7 +7348,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4909,7 +6266,11 @@ +@@ -4902,7 +6259,11 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -7360,7 +7360,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } if (fbo_blit_supported(&device->adapter->gl_info, blit_op, -@@ -4925,10 +6286,17 @@ +@@ -4918,10 +6279,17 @@ dst_surface, dst_surface->container->resource.draw_binding, dst_rect); context_release(context); @@ -7378,7 +7378,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, -@@ -4938,6 +6306,7 @@ +@@ -4931,6 +6299,7 @@ { blitter->blit_surface(device, blit_op, filter, src_surface, src_rect, dst_surface, dst_rect, color_key); @@ -7386,7 +7386,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; } } -@@ -5103,6 +6472,21 @@ +@@ -5096,6 +6465,21 @@ wined3d_surface_location_invalidated, wined3d_surface_load_location, }; @@ -7408,7 +7408,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) -@@ -5164,7 +6548,11 @@ +@@ -5157,7 +6541,11 @@ } surface->container = container; @@ -7420,7 +7420,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5196,9 +6584,14 @@ +@@ -5189,9 +6577,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -7435,7 +7435,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } return hr; -@@ -5225,7 +6618,11 @@ +@@ -5218,7 +6611,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr);