diff --git a/debian/changelog b/debian/changelog index d377036c..84fd3355 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ wine-staging (1.7.35) UNRELEASED; urgency=low * Add support for patchinstall.sh parameters '--no-patchlist' and '--no-autoconf'. * Add support for Gentoo epatch backend to patchinstall.sh. + * Synchronize CSMT patchset with https://github.com/stefand/wine. * Added patch to implement support for DDS file format in D3DXSaveTextureToFileInMemory. * Added patch to avoid appending duplicate NULL character when importing keys with regedit. * Removed patch to set last error on success in WSARecv (accepted upstream). diff --git a/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch b/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch index 6903dd3c..d55d100b 100644 --- a/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch +++ b/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch @@ -1,4 +1,4 @@ -From 366b6fe7fb45ebe1010417aedfa3dfab9cd6360b Mon Sep 17 00:00:00 2001 +From baf99f4a2a809d820805212096d4fc9deb30fe68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 19 Sep 2013 14:22:24 +0200 Subject: wined3d: Merge get_pitch functions. @@ -10,9 +10,9 @@ Subject: wined3d: Merge get_pitch functions. dlls/wined3d/texture.c | 2 +- dlls/wined3d/volume.c | 28 ++--------------- dlls/wined3d/wined3d.spec | 2 +- - dlls/wined3d/wined3d_private.h | 2 +- + dlls/wined3d/wined3d_private.h | 3 +- include/wine/wined3d.h | 3 +- - 8 files changed, 75 insertions(+), 75 deletions(-) + 8 files changed, 75 insertions(+), 76 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index a387d12..9a8d94f 100644 @@ -97,7 +97,7 @@ index 0ab55dc..8032a4c 100644 + TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); +} diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index fb27c8a..3ffec05 100644 +index d7d2b8d..d48a2df 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -364,6 +364,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) @@ -221,7 +221,7 @@ index fb27c8a..3ffec05 100644 else surface->resource.size = wined3d_format_calculate_size(texture_resource->format, texture_resource->device->surface_alignment, width, height, 1); -@@ -2681,7 +2665,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2834,7 +2818,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) map_desc->row_pitch = surface->resource.width * format->byte_count; else @@ -230,7 +230,7 @@ index fb27c8a..3ffec05 100644 map_desc->slice_pitch = 0; if (!rect) -@@ -2861,7 +2845,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -3014,7 +2998,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc { /* glReadPixels returns the image upside down, and there is no way to prevent this. * Flip the lines in software. */ @@ -241,7 +241,7 @@ index fb27c8a..3ffec05 100644 if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) goto error; -@@ -4093,7 +4079,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4246,7 +4232,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, const struct wined3d_color_key_conversion *conversion; struct wined3d_texture *texture = surface->container; struct wined3d_context *context; @@ -250,7 +250,7 @@ index fb27c8a..3ffec05 100644 struct wined3d_bo_address data; struct wined3d_format format; POINT dst_point = {0, 0}; -@@ -4188,7 +4174,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4341,7 +4327,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, else surface->flags &= ~SFLAG_GLCKEY; width = surface->resource.width; @@ -259,7 +259,7 @@ index fb27c8a..3ffec05 100644 format = *texture->resource.format; if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) -@@ -4227,9 +4213,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4380,9 +4366,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, context_release(context); return E_OUTOFMEMORY; } @@ -271,7 +271,7 @@ index fb27c8a..3ffec05 100644 data.addr = mem; } else if (conversion) -@@ -4249,14 +4235,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4402,14 +4388,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } if (texture->swapchain && texture->swapchain->palette) palette = texture->swapchain->palette; @@ -290,7 +290,7 @@ index fb27c8a..3ffec05 100644 context_release(context); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index d33bad1..0a8a550 100644 +index d33bad1..1f06f39 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1340,7 +1340,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso @@ -298,7 +298,7 @@ index d33bad1..0a8a550 100644 unsigned int row_pitch, slice_pitch; - wined3d_volume_get_pitch(volume, &row_pitch, &slice_pitch); -+ wined3d_resource_get_pitch(&volume->resource, &row_pitch, &slice_pitch); ++ wined3d_resource_get_pitch(sub_resource, &row_pitch, &slice_pitch); if (row_pitch != data->row_pitch || slice_pitch != data->slice_pitch) FIXME("Ignoring row/slice pitch (%u/%u).\n", data->row_pitch, data->slice_pitch); @@ -356,7 +356,7 @@ index b5ab862..87b6ab6 100644 if (!box) diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec -index 7a77003..95885c7 100644 +index 9ce4981..c2dda2c 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -181,6 +181,7 @@ @@ -376,7 +376,7 @@ index 7a77003..95885c7 100644 @ cdecl wined3d_surface_get_resource(ptr) @ cdecl wined3d_surface_getdc(ptr ptr) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 047946b..d3af1c0 100644 +index 6ebb210..bfb7bcb 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2091,6 +2091,7 @@ struct wined3d_resource @@ -387,7 +387,15 @@ index 047946b..d3af1c0 100644 struct list resource_list_entry; void *parent; -@@ -2314,7 +2315,6 @@ struct wined3d_surface +@@ -2264,7 +2265,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN + HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, + unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; + void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; +-void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch) DECLSPEC_HIDDEN; + void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, + BOOL srgb_mode) DECLSPEC_HIDDEN; + void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; +@@ -2314,7 +2314,6 @@ struct wined3d_surface DWORD flags; @@ -396,7 +404,7 @@ index 047946b..d3af1c0 100644 UINT pow2Height; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h -index 6e06388..cd8fd28 100644 +index 92e8169..49b8d25 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2418,6 +2418,8 @@ static inline HRESULT wined3d_private_store_set_private_data(struct wined3d_priv @@ -417,5 +425,5 @@ index 6e06388..cd8fd28 100644 struct wined3d_surface *render_target); struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface); -- -1.9.1 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch b/patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch index 2b51b38b..0a3129b9 100644 --- a/patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch +++ b/patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch @@ -1,43 +1,42 @@ -From 8f5ecefe9fba62e68e71b8931b94a658e4b32602 Mon Sep 17 00:00:00 2001 +From e872730f9d2dbdb4220860cc6ee5588860971223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 3 Oct 2013 12:34:13 +0200 Subject: wined3d: Move validate_location to resource.c. --- dlls/wined3d/resource.c | 7 +++++++ - dlls/wined3d/texture.c | 2 +- + dlls/wined3d/texture.c | 4 +--- dlls/wined3d/volume.c | 19 ++++++------------- - dlls/wined3d/wined3d_private.h | 2 +- - 4 files changed, 15 insertions(+), 15 deletions(-) + dlls/wined3d/wined3d_private.h | 1 + + 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 7594a0d..dd80490 100644 +index 8032a4c..2731f27 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -335,6 +335,13 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) - resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB; - } +@@ -362,3 +362,10 @@ void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, U + TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); + } ++ +void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) +{ + TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location)); + resource->locations |= location; + TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); +} -+ - void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, - UINT *slice_pitch) - { diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 1ff27bc..315a8d0 100644 +index 9fe7d25..92f7744 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -1333,7 +1333,7 @@ static void texture3d_sub_resource_validate_location(struct wined3d_resource *su - { - struct wined3d_volume *volume = volume_from_resource(sub_resource); +@@ -1331,9 +1331,7 @@ static void texture3d_sub_resource_invalidate_location(struct wined3d_resource * + static void texture3d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) + { +- struct wined3d_volume *volume = volume_from_resource(sub_resource); +- - wined3d_volume_validate_location(volume, location); -+ wined3d_resource_validate_location(&volume->resource, location); ++ wined3d_resource_validate_location(sub_resource, location); } static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_resource, @@ -114,7 +113,7 @@ index 62eb5ed..e1fa454 100644 else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM)) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 004969d..edbc066 100644 +index a431453..f47c2fb 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2125,6 +2125,7 @@ GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; @@ -125,14 +124,6 @@ index 004969d..edbc066 100644 /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -@@ -2270,7 +2271,6 @@ void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pit - void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, - BOOL srgb_mode) DECLSPEC_HIDDEN; - void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; --void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; - void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, - const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; - -- -1.9.1 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch b/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch index 971958f9..06411a14 100644 --- a/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch +++ b/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch @@ -1,4 +1,4 @@ -From 988e5a90aab7988d0b301c438c101d9c0a04f699 Mon Sep 17 00:00:00 2001 +From 1a7049fa8831453c9a041085a93413b05adc9e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 4 Jan 2014 00:53:47 +0100 Subject: wined3d: Remove surface_validate_location. @@ -8,12 +8,12 @@ Subject: wined3d: Remove surface_validate_location. dlls/wined3d/device.c | 2 +- dlls/wined3d/surface.c | 29 +++++++++++------------------ dlls/wined3d/swapchain.c | 12 ++++++------ - dlls/wined3d/texture.c | 2 +- + dlls/wined3d/texture.c | 4 +--- dlls/wined3d/wined3d_private.h | 1 - - 6 files changed, 20 insertions(+), 28 deletions(-) + 6 files changed, 20 insertions(+), 30 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index c1b3b6d..08f92cb 100644 +index b85f41e..93ecb99 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -7686,7 +7686,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter, @@ -39,7 +39,7 @@ index 4ac9c3e..99f4e96 100644 } } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 93c93bc..d2bbd44 100644 +index afe3c57..909d405 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1224,7 +1224,7 @@ static void surface_unload(struct wined3d_resource *resource) @@ -69,7 +69,7 @@ index 93c93bc..d2bbd44 100644 return WINED3D_OK; } -@@ -2790,7 +2790,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2799,7 +2799,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, { TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n", wined3d_debug_location(surface->resource.map_binding)); @@ -78,7 +78,7 @@ index 93c93bc..d2bbd44 100644 } else { -@@ -3345,7 +3345,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc +@@ -3354,7 +3354,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ @@ -87,7 +87,7 @@ index 93c93bc..d2bbd44 100644 surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); } -@@ -3619,7 +3619,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3628,7 +3628,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ @@ -96,7 +96,7 @@ index 93c93bc..d2bbd44 100644 surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); } -@@ -3932,7 +3932,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE +@@ -3941,7 +3941,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE wined3d_texture_set_color_key(src_surface->container, WINEDDCKEY_SRCBLT, (old_color_key_flags & WINEDDSD_CKSRCBLT) ? &old_blt_key : NULL); @@ -105,7 +105,7 @@ index 93c93bc..d2bbd44 100644 surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); return WINED3D_OK; -@@ -4177,13 +4177,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4186,13 +4186,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } @@ -119,7 +119,7 @@ index 93c93bc..d2bbd44 100644 void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) { TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4579,7 +4572,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4588,7 +4581,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte break; } @@ -128,7 +128,7 @@ index 93c93bc..d2bbd44 100644 if (location != WINED3D_LOCATION_SYSMEM && (surface->resource.locations & WINED3D_LOCATION_SYSMEM)) surface_evict_sysmem(surface); -@@ -5674,7 +5667,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5683,7 +5676,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); context_release(context); @@ -137,7 +137,7 @@ index 93c93bc..d2bbd44 100644 surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); return WINED3D_OK; -@@ -5771,7 +5764,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text +@@ -5780,7 +5773,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text } surface->container = container; @@ -146,7 +146,7 @@ index 93c93bc..d2bbd44 100644 list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5803,7 +5796,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text +@@ -5812,7 +5805,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -202,20 +202,22 @@ index 601d3ad..bdb4b67 100644 } diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 315a8d0..5bcbd12 100644 +index 92f7744..6692118 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -876,7 +876,7 @@ static void texture2d_sub_resource_validate_location(struct wined3d_resource *su - { - struct wined3d_surface *surface = surface_from_resource(sub_resource); +@@ -874,9 +874,7 @@ static void texture2d_sub_resource_invalidate_location(struct wined3d_resource * + static void texture2d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) + { +- struct wined3d_surface *surface = surface_from_resource(sub_resource); +- - surface_validate_location(surface, location); -+ wined3d_resource_validate_location(&surface->resource, location); ++ wined3d_resource_validate_location(sub_resource, location); } static void texture2d_sub_resource_upload_data(struct wined3d_resource *sub_resource, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 8203200..1a5cc7b 100644 +index 9186720..3e13ae8 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2383,7 +2383,6 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, diff --git a/patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch b/patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch index 9a9373cb..82931c59 100644 --- a/patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch +++ b/patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch @@ -1,4 +1,4 @@ -From e91b559bcccc65140b04128ad41db21413065cf9 Mon Sep 17 00:00:00 2001 +From 025d8d22909fa65d7315f97042cc12efa5809657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 3 Oct 2013 12:36:46 +0200 Subject: wined3d: Move invalidate_location to resource.c. @@ -8,8 +8,8 @@ Subject: wined3d: Move invalidate_location to resource.c. dlls/wined3d/resource.c | 7 +++++++ dlls/wined3d/texture.c | 4 +--- dlls/wined3d/volume.c | 21 +++++++-------------- - dlls/wined3d/wined3d_private.h | 2 +- - 5 files changed, 17 insertions(+), 19 deletions(-) + dlls/wined3d/wined3d_private.h | 3 +-- + 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 99f4e96..bde37b1 100644 @@ -25,28 +25,25 @@ index 99f4e96..bde37b1 100644 context_release(context); diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index dd80490..534cf80 100644 +index 2731f27..89865ef 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -342,6 +342,13 @@ void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD +@@ -369,3 +369,10 @@ void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD + resource->locations |= location; TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); } - ++ +void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) +{ + TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location)); + resource->locations &= ~location; + TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); +} -+ - void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, - UINT *slice_pitch) - { diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 5bcbd12..0113efc 100644 +index 6692118..522ffd6 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -1324,9 +1324,7 @@ static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource +@@ -1322,9 +1322,7 @@ static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource static void texture3d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) { @@ -137,7 +134,7 @@ index e1fa454..722f92e 100644 volume->resource.map_count++; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 1a5cc7b..232e956 100644 +index 3e13ae8..fd82ec3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2126,6 +2126,7 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_H @@ -148,14 +145,15 @@ index 1a5cc7b..232e956 100644 /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -@@ -2270,7 +2271,6 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; - void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch) DECLSPEC_HIDDEN; +@@ -2269,8 +2270,6 @@ HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wi + void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode) DECLSPEC_HIDDEN; -void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; +-void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; -- -1.9.1 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0014-wined3d-Invalidate-containers-via-callback.patch b/patches/wined3d-CSMT_Main/0014-wined3d-Invalidate-containers-via-callback.patch index 19fb1a2f..73a1bbb3 100644 --- a/patches/wined3d-CSMT_Main/0014-wined3d-Invalidate-containers-via-callback.patch +++ b/patches/wined3d-CSMT_Main/0014-wined3d-Invalidate-containers-via-callback.patch @@ -1,4 +1,4 @@ -From 39c0dd79f403ac4aac1cf660e207b0ed2703e81b Mon Sep 17 00:00:00 2001 +From 28ac147348a282c737e546db1c83c213060915a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 17 Nov 2013 18:44:48 +0100 Subject: wined3d: Invalidate containers via callback. @@ -35,20 +35,18 @@ index 989026f..d9bc820 100644 static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 1ec27d3..9d2db2b 100644 +index 89865ef..a63eab8 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -344,6 +344,8 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO +@@ -375,4 +375,6 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location)); resource->locations &= ~location; TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); + + resource->resource_ops->resource_location_invalidated(resource, location); } - - void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index b56796e..6c2698a 100644 +index 909d405..1a57219 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1273,11 +1273,17 @@ static void surface_unload(struct wined3d_resource *resource) @@ -70,10 +68,10 @@ index b56796e..6c2698a 100644 static const struct wined3d_surface_ops surface_ops = diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index f003fa2..c42e475 100644 +index 522ffd6..f2bba1a 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -986,11 +986,17 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) +@@ -1036,11 +1036,17 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) wined3d_texture_unload_gl_texture(texture); } @@ -92,10 +90,10 @@ index f003fa2..c42e475 100644 static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 3b742d2..6921b87 100644 +index 722f92e..2cc0baf 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -631,10 +631,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -632,10 +632,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, } if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) @@ -106,7 +104,7 @@ index 3b742d2..6921b87 100644 volume->resource.map_count++; -@@ -688,11 +685,20 @@ static ULONG volume_resource_decref(struct wined3d_resource *resource) +@@ -689,11 +686,20 @@ static ULONG volume_resource_decref(struct wined3d_resource *resource) return wined3d_volume_decref(volume_from_resource(resource)); } @@ -128,10 +126,10 @@ index 3b742d2..6921b87 100644 static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index fd28fa5..60d1b56 100644 +index fd82ec3..acee894 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2057,6 +2057,7 @@ struct wined3d_resource_ops +@@ -2068,6 +2068,7 @@ struct wined3d_resource_ops ULONG (*resource_incref)(struct wined3d_resource *resource); ULONG (*resource_decref)(struct wined3d_resource *resource); void (*resource_unload)(struct wined3d_resource *resource); @@ -140,5 +138,5 @@ index fd28fa5..60d1b56 100644 struct wined3d_resource -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch b/patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch index 57bd4218..58a4781b 100644 --- a/patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch +++ b/patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch @@ -1,4 +1,4 @@ -From 647e3b2622558e3a8350bb3521fdbd3119b92d95 Mon Sep 17 00:00:00 2001 +From 2ccc91e1322be4c1cffed1dd28c04e42466955f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 3 Oct 2013 12:47:01 +0200 Subject: wined3d: Move load_location into the resource. @@ -41,13 +41,14 @@ index d9bc820..2e44f0f 100644 static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 9d2db2b..63f8584 100644 +index a63eab8..7f283f5 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -348,6 +348,56 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO +@@ -378,3 +378,53 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO + resource->resource_ops->resource_location_invalidated(resource, location); } - ++ +DWORD wined3d_resource_access_from_location(DWORD location) +{ + switch (location) @@ -97,12 +98,8 @@ index 9d2db2b..63f8584 100644 + + resource->resource_ops->resource_load_location(resource, context, location); +} -+ - void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, - UINT *slice_pitch) - { diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index c689880..de57d25 100644 +index 738941e..73e74a6 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1281,12 +1281,20 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour @@ -126,7 +123,7 @@ index c689880..de57d25 100644 }; static const struct wined3d_surface_ops surface_ops = -@@ -4041,7 +4049,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4195,7 +4203,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } @@ -135,7 +132,7 @@ index c689880..de57d25 100644 { switch (location) { -@@ -4380,7 +4388,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4535,7 +4543,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte if (WARN_ON(d3d_surface)) { @@ -145,10 +142,10 @@ index c689880..de57d25 100644 WARN("Operation requires %#x access, but surface only has %#x.\n", required_access, surface->resource.access_flags); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 941d935..ea9eacc 100644 +index 6d82ce6..fc0f6d6 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -989,12 +989,20 @@ static void wined3d_texture_load_location_invalidated(struct wined3d_resource *r +@@ -1039,12 +1039,20 @@ static void wined3d_texture_load_location_invalidated(struct wined3d_resource *r ERR("Should not be called on textures.\n"); } @@ -170,10 +167,10 @@ index 941d935..ea9eacc 100644 static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 6921b87..c93a1ef 100644 +index 2cc0baf..3c51bdf 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -136,27 +136,6 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) +@@ -137,27 +137,6 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); } @@ -201,7 +198,7 @@ index 6921b87..c93a1ef 100644 /* Context activation is done by the caller. */ static void wined3d_volume_srgb_transfer(struct wined3d_volume *volume, struct wined3d_context *context, BOOL dest_is_srgb) -@@ -196,21 +175,17 @@ static BOOL wined3d_volume_can_evict(const struct wined3d_volume *volume) +@@ -197,21 +176,17 @@ static BOOL wined3d_volume_can_evict(const struct wined3d_volume *volume) return TRUE; } @@ -227,7 +224,7 @@ index 6921b87..c93a1ef 100644 if ((volume->resource.access_flags & required_access) != required_access) { ERR("Operation requires %#x access, but volume only has %#x.\n", -@@ -332,7 +307,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -333,7 +308,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode) { wined3d_texture_prepare_texture(volume->container, context, srgb_mode); @@ -236,7 +233,7 @@ index 6921b87..c93a1ef 100644 srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); } -@@ -391,7 +366,7 @@ static void volume_unload(struct wined3d_resource *resource) +@@ -392,7 +367,7 @@ static void volume_unload(struct wined3d_resource *resource) if (volume_prepare_system_memory(volume)) { context = context_acquire(device, NULL); @@ -245,7 +242,7 @@ index 6921b87..c93a1ef 100644 context_release(context); wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_SYSMEM); } -@@ -546,7 +521,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -547,7 +522,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, if (flags & WINED3D_MAP_DISCARD) wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER); else @@ -254,7 +251,7 @@ index 6921b87..c93a1ef 100644 GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo)); -@@ -584,7 +559,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -585,7 +560,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM)) { context = context_acquire(device, NULL); @@ -263,7 +260,7 @@ index 6921b87..c93a1ef 100644 context_release(context); } base_memory = volume->resource.heap_memory; -@@ -699,6 +674,7 @@ static const struct wined3d_resource_ops volume_resource_ops = +@@ -700,6 +675,7 @@ static const struct wined3d_resource_ops volume_resource_ops = volume_resource_decref, volume_unload, wined3d_volume_location_invalidated, @@ -272,10 +269,10 @@ index 6921b87..c93a1ef 100644 static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 52280a7..b1e4cb6 100644 +index b533108..4db209a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2058,6 +2058,8 @@ struct wined3d_resource_ops +@@ -2069,6 +2069,8 @@ struct wined3d_resource_ops ULONG (*resource_decref)(struct wined3d_resource *resource); void (*resource_unload)(struct wined3d_resource *resource); void (*resource_location_invalidated)(struct wined3d_resource *resource, DWORD location); @@ -284,7 +281,7 @@ index 52280a7..b1e4cb6 100644 }; struct wined3d_resource -@@ -2108,15 +2110,18 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -2119,15 +2121,18 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN; void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -305,5 +302,5 @@ index 52280a7..b1e4cb6 100644 /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch b/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch index d87c9b0a..b27565f8 100644 --- a/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch +++ b/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch @@ -1,4 +1,4 @@ -From 437cae1236351d1ce2d0a6e5a2179de17932390b Mon Sep 17 00:00:00 2001 +From f6dd61b4db19ba22e8e8f7d9d6bcf92e4419dc0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 16 Jan 2014 22:07:17 +0100 Subject: wined3d: Move volume PBO infrastructure into the resource. @@ -10,10 +10,10 @@ Subject: wined3d: Move volume PBO infrastructure into the resource. 3 files changed, 82 insertions(+), 79 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 6cbf120..ef7a52a 100644 +index 7f283f5..c1ec97b 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -295,7 +295,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) +@@ -292,7 +292,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) return ret; } @@ -22,10 +22,11 @@ index 6cbf120..ef7a52a 100644 { if (d3d_flags & WINED3D_MAP_READONLY) return GL_READ_ONLY_ARB; -@@ -401,6 +401,68 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, +@@ -428,3 +428,65 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, + resource->resource_ops->resource_load_location(resource, context, location); } - ++ +BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, + const struct wined3d_context *context, DWORD flags) +{ @@ -87,10 +88,6 @@ index 6cbf120..ef7a52a 100644 + return; + } +} -+ - void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, - UINT *slice_pitch) - { diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c index 2e92dd7..c538e08 100644 --- a/dlls/wined3d/volume.c @@ -270,17 +267,17 @@ index 2e92dd7..c538e08 100644 volume->resource.map_count--; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 342b900..ff2f205 100644 +index 4934dc8..8cce2d9 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2094,6 +2094,7 @@ struct wined3d_resource - UINT size; +@@ -2095,6 +2095,7 @@ struct wined3d_resource DWORD priority; void *heap_memory, *user_memory, *bitmap_data; -+ GLuint buffer_object; UINT custom_row_pitch, custom_slice_pitch; ++ GLuint buffer_object; struct list resource_list_entry; DWORD locations; + @@ -2124,12 +2125,15 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -307,5 +304,5 @@ index 342b900..ff2f205 100644 static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) -- -1.9.1 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch b/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch index 3dbde2bf..f56d814f 100644 --- a/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch +++ b/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch @@ -1,4 +1,4 @@ -From a95bca19bbfd77bc151a29981e4cdd5c759f8821 Mon Sep 17 00:00:00 2001 +From bd0eabcb62d243fc8ff0dd5fbe200caf9b1db1e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 18 Sep 2013 22:49:34 +0200 Subject: wined3d: Move buffer creation into the resource. @@ -8,17 +8,17 @@ Before doing that, surfaces and buffers have to be migrated to the new location scheme. Otherwise the unimplemented buffer_load_location and surface_load_location will write a lot of ERRs. --- - dlls/wined3d/resource.c | 66 ++++++++++++++++++++++++++++++++++++ + dlls/wined3d/resource.c | 66 ++++++++++++++++++++++++++++++++++++++++++ dlls/wined3d/texture.c | 2 +- - dlls/wined3d/volume.c | 76 ++---------------------------------------- + dlls/wined3d/volume.c | 63 ++-------------------------------------- dlls/wined3d/wined3d_private.h | 4 ++- - 4 files changed, 72 insertions(+), 76 deletions(-) + 4 files changed, 72 insertions(+), 63 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index b3c87ba..369ea52 100644 +index ea146d1..1760969 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -145,6 +145,18 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -142,6 +142,18 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * return WINED3D_OK; } @@ -37,7 +37,7 @@ index b3c87ba..369ea52 100644 void resource_cleanup(struct wined3d_resource *resource) { const struct wined3d *d3d = resource->device->wined3d; -@@ -157,6 +169,9 @@ void resource_cleanup(struct wined3d_resource *resource) +@@ -154,6 +166,9 @@ void resource_cleanup(struct wined3d_resource *resource) adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); } @@ -47,7 +47,7 @@ index b3c87ba..369ea52 100644 wined3d_resource_free_sysmem(resource); device_resource_released(resource->device, resource); -@@ -167,6 +182,9 @@ void resource_unload(struct wined3d_resource *resource) +@@ -164,6 +179,9 @@ void resource_unload(struct wined3d_resource *resource) if (resource->map_count) ERR("Resource %p is being unloaded while mapped.\n", resource); @@ -57,10 +57,11 @@ index b3c87ba..369ea52 100644 context_resource_unloaded(resource->device, resource, resource->type); } -@@ -471,6 +489,54 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -498,3 +516,51 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, + return; } } - ++ +/* Context activation is done by the caller. */ +static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, const struct wined3d_context *context) +{ @@ -108,15 +109,11 @@ index b3c87ba..369ea52 100644 + return FALSE; + } +} -+ - void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, - UINT *slice_pitch) - { diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 35010b0..91e8b72 100644 +index 066219d..9981703 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -1378,7 +1378,7 @@ static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wi +@@ -1374,7 +1374,7 @@ static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wi void *mem = NULL; if (gl_info->supported[APPLE_CLIENT_STORAGE] && !format->convert @@ -126,30 +123,10 @@ index 35010b0..91e8b72 100644 TRACE("Enabling GL_UNPACK_CLIENT_STORAGE_APPLE for volume %p\n", volume); gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index c538e08..4842170 100644 +index c538e08..af2fbd1 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -27,19 +27,6 @@ - WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); - WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); - --BOOL volume_prepare_system_memory(struct wined3d_volume *volume) --{ -- if (volume->resource.heap_memory) -- return TRUE; -- -- if (!wined3d_resource_allocate_sysmem(&volume->resource)) -- { -- ERR("Failed to allocate system memory.\n"); -- return FALSE; -- } -- return TRUE; --} -- - /* Context activation is done by the caller. */ - void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, - const struct wined3d_const_bo_address *data) -@@ -312,42 +299,10 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * +@@ -312,42 +312,10 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); } @@ -192,7 +169,7 @@ index c538e08..4842170 100644 resource_cleanup(&volume->resource); volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); HeapFree(GetProcessHeap(), 0, volume); -@@ -364,7 +319,7 @@ static void volume_unload(struct wined3d_resource *resource) +@@ -364,7 +332,7 @@ static void volume_unload(struct wined3d_resource *resource) TRACE("texture %p.\n", resource); @@ -201,7 +178,7 @@ index c538e08..4842170 100644 { context = context_acquire(device, NULL); wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM); -@@ -378,15 +333,6 @@ static void volume_unload(struct wined3d_resource *resource) +@@ -378,15 +346,6 @@ static void volume_unload(struct wined3d_resource *resource) wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); } @@ -217,7 +194,7 @@ index c538e08..4842170 100644 /* The texture name is managed by the container. */ volume->flags &= ~WINED3D_VFLAG_CLIENT_STORAGE; -@@ -476,24 +422,6 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol +@@ -476,24 +435,6 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol return TRUE; } @@ -242,7 +219,7 @@ index c538e08..4842170 100644 HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { -@@ -531,7 +459,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -531,7 +472,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags); context = context_acquire(device, NULL); @@ -252,7 +229,7 @@ index c538e08..4842170 100644 WARN("Out of memory.\n"); map_desc->data = NULL; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index a924009..26d2d5d 100644 +index 7efecd4..4605542 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2132,6 +2132,9 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO @@ -274,5 +251,5 @@ index a924009..26d2d5d 100644 unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; -- -1.9.1 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0033-wined3d-Move-check_block_align-to-resource.c.patch b/patches/wined3d-CSMT_Main/0033-wined3d-Move-check_block_align-to-resource.c.patch index bc9d33b7..67998b69 100644 --- a/patches/wined3d-CSMT_Main/0033-wined3d-Move-check_block_align-to-resource.c.patch +++ b/patches/wined3d-CSMT_Main/0033-wined3d-Move-check_block_align-to-resource.c.patch @@ -1,4 +1,4 @@ -From 56c5228fce24415412c59b16744c1eab1fb6e038 Mon Sep 17 00:00:00 2001 +From ba90a0acc5f192214213ee08fe82285e89700f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 19 Sep 2013 14:55:00 +0200 Subject: wined3d: Move check_block_align to resource.c @@ -11,12 +11,12 @@ Subject: wined3d: Move check_block_align to resource.c 4 files changed, 43 insertions(+), 45 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 94c06ac..947fe8d 100644 +index 8a1d8a1..d559fe8 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -606,3 +606,31 @@ void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, U - - TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); +@@ -606,3 +606,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru + return FALSE; + } } + +BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, @@ -47,10 +47,10 @@ index 94c06ac..947fe8d 100644 + return TRUE; +} diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 50d7e74..6fa2576 100644 +index 44e3f72..527017a 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -1531,23 +1531,18 @@ static void surface_upload_data(struct wined3d_surface *surface, const struct wi +@@ -1531,23 +1531,18 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w static BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) { @@ -86,10 +86,10 @@ index 50d7e74..6fa2576 100644 HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 9ad7d75..c11c98c 100644 +index d77fc21..7808ed5 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -361,34 +361,6 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum +@@ -375,34 +375,6 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum return &volume->resource; } @@ -124,7 +124,7 @@ index 9ad7d75..c11c98c 100644 static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume, const struct wined3d_box *box) { -@@ -438,7 +410,8 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -452,7 +424,8 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, WARN("Map box is invalid.\n"); return WINED3DERR_INVALIDCALL; } @@ -135,10 +135,10 @@ index 9ad7d75..c11c98c 100644 WARN("Map box is misaligned for %ux%u blocks.\n", format->block_width, format->block_height); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index d69a581..35f2445 100644 +index e7fd8ad..e32d650 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2113,6 +2113,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -2124,6 +2124,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -148,5 +148,5 @@ index d69a581..35f2445 100644 BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch index 42ee165d..d56c6d4c 100644 --- a/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch +++ b/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch @@ -1,4 +1,4 @@ -From d8d04cd60fafff413cb9f04efe1e5807eebf95b5 Mon Sep 17 00:00:00 2001 +From 3b80eec8bd2af7858157bdd2b821f7946023081f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 29 Apr 2013 18:49:53 +0200 Subject: wined3d: Send blits through the command stream. @@ -108,10 +108,10 @@ index 949bd6b..dcaedfd 100644 { struct wined3d_cs_block *block; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index e2cc4c2..8536927 100644 +index 6e8e2f5..8a833d5 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -5083,14 +5083,13 @@ const struct blit_shader cpu_blit = { +@@ -5092,14 +5092,13 @@ const struct blit_shader cpu_blit = { cpu_blit_depth_fill, }; @@ -128,7 +128,7 @@ index e2cc4c2..8536927 100644 BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -5099,111 +5098,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5108,111 +5107,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -240,7 +240,7 @@ index e2cc4c2..8536927 100644 if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5246,8 +5140,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5255,8 +5149,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC } scale = src_surface @@ -251,7 +251,7 @@ index e2cc4c2..8536927 100644 convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; dst_ds_flags = dst_surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); -@@ -5265,22 +5159,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5274,22 +5168,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -279,7 +279,7 @@ index e2cc4c2..8536927 100644 } } else -@@ -5307,8 +5195,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5316,8 +5204,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC if (!surface_convert_color_to_float(dst_surface, fx->u5.dwFillColor, &color)) goto fallback; @@ -290,7 +290,7 @@ index e2cc4c2..8536927 100644 } else { -@@ -5324,9 +5212,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5333,9 +5221,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC TRACE("Not doing upload because of format conversion.\n"); else { @@ -302,7 +302,7 @@ index e2cc4c2..8536927 100644 { if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) { -@@ -5335,7 +5223,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5344,7 +5232,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC dst_surface->container->resource.draw_binding); context_release(context); } @@ -311,7 +311,7 @@ index e2cc4c2..8536927 100644 } } } -@@ -5360,51 +5248,192 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5369,51 +5257,192 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -518,20 +518,20 @@ index e2cc4c2..8536927 100644 static const struct wined3d_resource_ops surface_resource_ops = diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 3c04b1b..6889bd8 100644 +index 041feb3..342577c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2424,6 +2424,9 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w - GLenum target, unsigned int level, unsigned int layer, DWORD flags, - struct wined3d_surface **surface) DECLSPEC_HIDDEN; - void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; -+void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, -+ struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, -+ const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +@@ -2426,6 +2426,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; -@@ -2571,6 +2574,7 @@ struct wined3d_cs ++void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, ++ struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, ++ const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; + + void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, + const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +@@ -2570,6 +2573,7 @@ struct wined3d_cs struct wined3d_device *device; struct wined3d_state state; HANDLE thread; @@ -539,7 +539,7 @@ index 3c04b1b..6889bd8 100644 DWORD tls_idx; struct wined3d_surface *onscreen_depth_stencil; -@@ -2647,6 +2651,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, +@@ -2646,6 +2650,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN; @@ -551,5 +551,5 @@ index 3c04b1b..6889bd8 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -1.9.1 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch b/patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch index b2f2086d..26174b0c 100644 --- a/patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch +++ b/patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch @@ -1,4 +1,4 @@ -From 69549fe872a05e2bfb752d583f7342cf52dd6228 Mon Sep 17 00:00:00 2001 +From 4189bd1a023b867ae97450130cbff011128b87fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 20 Aug 2014 14:14:23 +0200 Subject: wined3d: Put update_surface checks back in place @@ -96,7 +96,7 @@ index 5242028..a4d1c53 100644 { FIXME("Waiting for cs.\n"); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 8536927..01bee3e 100644 +index 8a833d5..7c47055 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1420,7 +1420,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w @@ -109,17 +109,17 @@ index 8536927..01bee3e 100644 struct wined3d_box box; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 6889bd8..c3b1c28 100644 +index 342577c..5eec3c6 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2427,6 +2427,7 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; +@@ -2429,6 +2429,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; - void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, - const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, - BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; + + void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, + const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -- -1.9.1 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch b/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch index 6519d932..ecc95eab 100644 --- a/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch +++ b/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch @@ -1,4 +1,4 @@ -From 25b2ad076f6f9725353b5b7413ee062c68a89d6f Mon Sep 17 00:00:00 2001 +From c2397e25c4bce8e65cddb924047ee0fff1c7a397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 29 Aug 2013 22:25:14 +0200 Subject: wined3d: Don't lock the src volume in device_update_volume @@ -9,15 +9,19 @@ assumption of the work queue. FIXME: Maybe merge this with the previous patch or change their order. --- - dlls/wined3d/device.c | 17 ++++------------- - 1 file changed, 4 insertions(+), 13 deletions(-) + dlls/wined3d/device.c | 31 +++++++------------------------ + 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 5333f23..b2e3db7 100644 +index 5333f23..4a54025 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3401,9 +3401,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device - static HRESULT device_update_volume(struct wined3d_context *context, +@@ -3398,12 +3398,10 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device + } + + /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ +-static HRESULT device_update_volume(struct wined3d_context *context, ++static void device_update_volume(struct wined3d_context *context, struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) { - struct wined3d_const_bo_address data; @@ -27,8 +31,20 @@ index 5333f23..b2e3db7 100644 TRACE("src_volume %p, dst_volume %p.\n", src_volume, dst_volume); -@@ -3421,20 +3419,13 @@ static HRESULT device_update_volume(struct wined3d_context *context, - return WINED3DERR_INVALIDCALL; +@@ -3411,30 +3409,21 @@ static HRESULT device_update_volume(struct wined3d_context *context, + if (src_volume->resource.format != dst_volume->resource.format) + { + FIXME("Source and destination formats do not match.\n"); +- return WINED3DERR_INVALIDCALL; ++ return; + } + if (src_volume->resource.width != dst_volume->resource.width + || src_volume->resource.height != dst_volume->resource.height + || src_volume->resource.depth != dst_volume->resource.depth) + { + FIXME("Source and destination sizes do not match.\n"); +- return WINED3DERR_INVALIDCALL; ++ return; } - if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY))) @@ -43,14 +59,30 @@ index 5333f23..b2e3db7 100644 + wined3d_resource_get_memory(&src_volume->resource, src_volume->resource.map_binding, &data); + wined3d_volume_upload_data(dst_volume, context, wined3d_const_bo_address(&data)); wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); - +- - hr = wined3d_volume_unmap(src_volume); - - return hr; -+ return WINED3D_OK; } /* Context activation is done by the caller */ +@@ -3483,15 +3472,9 @@ void device_exec_update_texture(struct wined3d_context *context, struct wined3d_ + { + for (i = 0; i < level_count; ++i) + { +- HRESULT hr; +- hr = device_update_volume(context, ++ device_update_volume(context, + volume_from_resource(wined3d_texture_get_sub_resource(src_texture, i)), + volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i))); +- if (FAILED(hr)) +- { +- WARN("Failed to update volume, hr %#x.\n", hr); +- return; +- } + } + break; + } -- 2.2.1 diff --git a/patches/wined3d-CSMT_Main/0103-wined3d-Introduce-resource-fencing.patch b/patches/wined3d-CSMT_Main/0103-wined3d-Introduce-resource-fencing.patch index 7d33fe1e..6386712f 100644 --- a/patches/wined3d-CSMT_Main/0103-wined3d-Introduce-resource-fencing.patch +++ b/patches/wined3d-CSMT_Main/0103-wined3d-Introduce-resource-fencing.patch @@ -1,4 +1,4 @@ -From 7c8966629ab3faabae68c46d1cf63e3d42c89c99 Mon Sep 17 00:00:00 2001 +From cba6a35d48886d00959d29d4fef9115a46143589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 20 Aug 2014 18:01:36 +0200 Subject: wined3d: Introduce resource fencing. @@ -61,18 +61,18 @@ index 11aa133..1197eef 100644 } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index a2bee4d..b4e5679 100644 +index 570f5e3..10d0789 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2118,6 +2118,7 @@ struct wined3d_resource - UINT custom_row_pitch, custom_slice_pitch; +@@ -2129,6 +2129,7 @@ struct wined3d_resource + GLuint buffer_object; struct list resource_list_entry; DWORD locations; + LONG access_fence; void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2171,6 +2172,21 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) DECLSPEC +@@ -2182,6 +2183,21 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) DECLSPEC void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; @@ -95,5 +95,5 @@ index a2bee4d..b4e5679 100644 #define RESOURCE_ALIGNMENT 16 -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch b/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch index 447b6dda..ebf98574 100644 --- a/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch +++ b/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch @@ -1,4 +1,4 @@ -From a9c5139b4af3710105931fb127431ac153b48062 Mon Sep 17 00:00:00 2001 +From 7690fa9323a0c910cb788ae09f474657d298acf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 30 Aug 2013 17:00:35 +0200 Subject: wined3d: Wrap GL BOs in a structure @@ -14,10 +14,10 @@ them for DISCARD maps. 5 files changed, 86 insertions(+), 28 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index c9723ea..c57bd77 100644 +index 6a5fc5a..bd53a1f 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -4990,3 +4990,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -4981,3 +4981,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -75,10 +75,10 @@ index c9723ea..c57bd77 100644 + wined3d_device_destroy_bo(device, context, bo); +} diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index f84b3ee..885075e 100644 +index 788c8e6..ba4b85b 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -148,12 +148,10 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -145,12 +145,10 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * void wined3d_resource_free_bo(struct wined3d_resource *resource) { struct wined3d_context *context = context_acquire(resource->device, NULL); @@ -94,7 +94,7 @@ index f84b3ee..885075e 100644 context_release(context); } -@@ -169,7 +167,7 @@ void resource_cleanup(struct wined3d_resource *resource) +@@ -166,7 +164,7 @@ void resource_cleanup(struct wined3d_resource *resource) adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); } @@ -103,7 +103,7 @@ index f84b3ee..885075e 100644 wined3d_resource_free_bo(resource); wined3d_resource_free_sysmem(resource); -@@ -182,7 +180,7 @@ void resource_unload(struct wined3d_resource *resource) +@@ -179,7 +177,7 @@ void resource_unload(struct wined3d_resource *resource) if (resource->map_count) ERR("Resource %p is being unloaded while mapped.\n", resource); @@ -112,7 +112,7 @@ index f84b3ee..885075e 100644 wined3d_resource_free_bo(resource); context_resource_unloaded(resource->device, -@@ -400,7 +398,7 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, +@@ -428,7 +426,7 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, { if (location & WINED3D_LOCATION_BUFFER) { @@ -121,7 +121,7 @@ index f84b3ee..885075e 100644 data->addr = NULL; return; } -@@ -509,7 +507,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, +@@ -537,7 +535,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; @@ -130,7 +130,7 @@ index f84b3ee..885075e 100644 if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) { -@@ -552,7 +550,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -580,7 +578,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; @@ -139,7 +139,7 @@ index f84b3ee..885075e 100644 GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)); GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); checkGLcall("Unmap GL buffer"); -@@ -570,20 +568,14 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -598,20 +596,14 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, } /* Context activation is done by the caller. */ @@ -166,7 +166,7 @@ index f84b3ee..885075e 100644 BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 7a65abc..8881490 100644 +index d093744..4d8dd01 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -48,7 +48,7 @@ static void surface_cleanup(struct wined3d_surface *surface) @@ -178,7 +178,7 @@ index 7a65abc..8881490 100644 || surface->rb_resolved || !list_empty(&surface->renderbuffers)) { struct wined3d_renderbuffer_entry *entry, *entry2; -@@ -2660,7 +2660,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2669,7 +2669,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) } if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM @@ -187,7 +187,7 @@ index 7a65abc..8881490 100644 surface->resource.map_binding = WINED3D_LOCATION_DIB; } -@@ -4025,7 +4025,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4034,7 +4034,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ @@ -197,10 +197,10 @@ index 7a65abc..8881490 100644 TRACE("Removing the pbo attached to surface %p.\n", surface); diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 6532ab5..9d6583d 100644 +index 53d73e3..7b040f0 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -203,7 +203,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -216,7 +216,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, } else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) { @@ -209,7 +209,7 @@ index 6532ab5..9d6583d 100644 wined3d_volume_upload_data(volume, context, &data); } else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) -@@ -252,12 +252,12 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -265,12 +265,12 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, break; case WINED3D_LOCATION_BUFFER: @@ -225,7 +225,7 @@ index 6532ab5..9d6583d 100644 if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index e2e5423..b1ec269 100644 +index 4a99939..ff64215 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1971,6 +1971,14 @@ struct wined3d_state @@ -255,15 +255,15 @@ index e2e5423..b1ec269 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2125,7 +2138,7 @@ struct wined3d_resource - UINT size; +@@ -2126,7 +2139,7 @@ struct wined3d_resource DWORD priority; void *heap_memory, *user_memory, *bitmap_data; + UINT custom_row_pitch, custom_slice_pitch; - GLuint buffer_object; + struct wined3d_gl_bo *buffer; - UINT custom_row_pitch, custom_slice_pitch; struct list resource_list_entry; DWORD locations; + LONG access_fence; -- -1.9.1 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch b/patches/wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch index 47d04901..eca61c64 100644 --- a/patches/wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch +++ b/patches/wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch @@ -1,4 +1,4 @@ -From 71bd4bdb1014498b5877d04834bf58413220c408 Mon Sep 17 00:00:00 2001 +From 4a9d09e89a1ae33ae766eec2af1a1c07276b7a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 30 Aug 2013 17:06:29 +0200 Subject: wined3d: Separate resource map and draw buffers @@ -9,7 +9,7 @@ Subject: wined3d: Separate resource map and draw buffers 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 4fc4ce9..65e8f55 100644 +index ba4b85b..83f3b30 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -146,8 +146,12 @@ void wined3d_resource_free_bo(struct wined3d_resource *resource) @@ -25,7 +25,7 @@ index 4fc4ce9..65e8f55 100644 context_release(context); } -@@ -504,7 +508,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, +@@ -535,7 +539,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; @@ -34,7 +34,7 @@ index 4fc4ce9..65e8f55 100644 if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) { -@@ -547,7 +551,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -578,7 +582,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; @@ -43,7 +43,7 @@ index 4fc4ce9..65e8f55 100644 GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)); GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); checkGLcall("Unmap GL buffer"); -@@ -572,6 +576,7 @@ static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struc +@@ -603,6 +607,7 @@ static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struc resource->buffer = wined3d_device_get_bo(resource->device, resource->size, GL_STREAM_DRAW_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, context); @@ -52,18 +52,18 @@ index 4fc4ce9..65e8f55 100644 } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 8477d0c..eb84cbc 100644 +index ff64215..374dbc2 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2127,7 +2127,7 @@ struct wined3d_resource - UINT size; +@@ -2139,7 +2139,7 @@ struct wined3d_resource DWORD priority; void *heap_memory, *user_memory, *bitmap_data; + UINT custom_row_pitch, custom_slice_pitch; - struct wined3d_gl_bo *buffer; + struct wined3d_gl_bo *buffer, *map_buffer; - UINT custom_row_pitch, custom_slice_pitch; struct list resource_list_entry; DWORD locations; + LONG access_fence; -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch b/patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch index fe1a38ea..316cf703 100644 --- a/patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch +++ b/patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch @@ -1,4 +1,4 @@ -From 2483911906a4adfe52afe00f061cd473a2b7ec5b Mon Sep 17 00:00:00 2001 +From 8494f0465c33b7d735d4a4dbeb2c5b9ea3ce9430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 27 Sep 2013 19:24:21 +0200 Subject: wined3d: Implement DISCARD resource maps with heap memory. @@ -61,7 +61,7 @@ index d86aa59..9307246 100644 cs->ops->submit(cs, sizeof(*op)); } diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 8d9757c..ef0b213 100644 +index 5e62915..ebb9ff3 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -119,6 +119,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * @@ -89,7 +89,7 @@ index 8d9757c..ef0b213 100644 return TRUE; } -@@ -528,7 +530,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, +@@ -559,7 +561,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, return ptr; case WINED3D_LOCATION_SYSMEM: @@ -98,7 +98,7 @@ index 8d9757c..ef0b213 100644 case WINED3D_LOCATION_DIB: return resource->bitmap_data; -@@ -590,6 +592,7 @@ BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) +@@ -621,6 +623,7 @@ BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) ERR("Failed to allocate system memory.\n"); return FALSE; } @@ -175,7 +175,7 @@ index 8d9757c..ef0b213 100644 wined3d_resource_invalidate_location(resource, ~resource->map_binding); } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 7c532f0..73160ff 100644 +index 4d8dd01..03f49a8 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -487,6 +487,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) @@ -186,7 +186,7 @@ index 7c532f0..73160ff 100644 wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); } -@@ -1996,6 +1997,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -1997,6 +1998,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, surface->resource.locations = 0; wined3d_resource_free_sysmem(&surface->resource); @@ -194,7 +194,7 @@ index 7c532f0..73160ff 100644 width = texture_resource->width; height = texture_resource->height; -@@ -5334,6 +5336,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text +@@ -5489,6 +5491,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -203,10 +203,10 @@ index 7c532f0..73160ff 100644 wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); } diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 467169f..34b72d1 100644 +index 7b040f0..829cb8a 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -120,6 +120,7 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume, +@@ -134,6 +134,7 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume, static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) { wined3d_resource_free_sysmem(&volume->resource); @@ -214,7 +214,7 @@ index 467169f..34b72d1 100644 wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); } -@@ -502,6 +503,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture +@@ -516,6 +517,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture { wined3d_resource_free_sysmem(&volume->resource); volume->resource.map_binding = WINED3D_LOCATION_BUFFER; @@ -223,19 +223,19 @@ index 467169f..34b72d1 100644 volume->container = container; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 15d63e2..270162f 100644 +index abf3ca2..ac4aeb3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2126,7 +2126,7 @@ struct wined3d_resource +@@ -2137,7 +2137,7 @@ struct wined3d_resource UINT depth; UINT size; DWORD priority; - void *heap_memory, *user_memory, *bitmap_data; + void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; - struct wined3d_gl_bo *buffer, *map_buffer; UINT custom_row_pitch, custom_slice_pitch; + struct wined3d_gl_bo *buffer, *map_buffer; struct list resource_list_entry; -@@ -2160,7 +2160,7 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; +@@ -2171,7 +2171,7 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_changed(struct wined3d_resource *resource, @@ -244,7 +244,7 @@ index 15d63e2..270162f 100644 BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, const struct wined3d_box *box) DECLSPEC_HIDDEN; void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -@@ -2678,7 +2678,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf +@@ -2695,7 +2695,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, @@ -254,5 +254,5 @@ index 15d63e2..270162f 100644 DWORD flags) DECLSPEC_HIDDEN; void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch b/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch index ad31b0b8..351a5404 100644 --- a/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch +++ b/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch @@ -1,4 +1,4 @@ -From 4cd3608532db258e1b970b68b696437e273cddde Mon Sep 17 00:00:00 2001 +From 91a76b0dd0c52b3745dd0ecd1dfc79acad7ccba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 6 Oct 2013 16:12:24 +0200 Subject: wined3d: Clean up surfaces through the cs. @@ -70,7 +70,7 @@ index 9cba57b..7675214 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 89c4c59..65bffab 100644 +index ac5f6bb..fcd7d63 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -36,20 +36,10 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); @@ -135,7 +135,7 @@ index 89c4c59..65bffab 100644 } void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, -@@ -5470,8 +5467,6 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text +@@ -5479,8 +5476,6 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text { ERR("Private setup failed, hr %#x.\n", hr); surface_cleanup(surface); @@ -144,7 +144,7 @@ index 89c4c59..65bffab 100644 return hr; } -@@ -5514,7 +5509,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w +@@ -5523,7 +5518,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr); @@ -154,18 +154,18 @@ index 89c4c59..65bffab 100644 } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 8537000..5b1a286 100644 +index d201a5c..c28554f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2470,6 +2470,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ +@@ -2472,6 +2472,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; +void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; - void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, - const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, - BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; -@@ -2730,6 +2731,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, + + void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, + const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +@@ -2729,6 +2730,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; @@ -174,5 +174,5 @@ index 8537000..5b1a286 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -1.9.1 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch b/patches/wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch index 85d939a4..2e417fc7 100644 --- a/patches/wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch +++ b/patches/wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch @@ -1,4 +1,4 @@ -From a08ec4508ae2f63e2545b51a6b177e672c7dbdaf Mon Sep 17 00:00:00 2001 +From eeb143600d8ab2c4ea0c43a14e1a7035d9dcf9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 16 Mar 2014 14:13:42 +0100 Subject: wined3d: Send getdc and releasedc through the command stream. @@ -104,10 +104,10 @@ index b152a0d..44930c1 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 0221ebd..b6bb67e 100644 +index b1ae752..9aa26e3 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -2613,48 +2613,23 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2622,48 +2622,23 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, return wined3d_resource_map(&surface->resource, map_desc, rect ? &box : NULL, flags); } @@ -159,7 +159,7 @@ index 0221ebd..b6bb67e 100644 } if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM -@@ -2667,35 +2642,40 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2676,35 +2651,40 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) if (context) context_release(context); @@ -220,7 +220,7 @@ index 0221ebd..b6bb67e 100644 && surface->resource.map_binding != WINED3D_LOCATION_DIB)) { /* The game Salammbo modifies the surface contents without mapping the surface between -@@ -2716,6 +2696,26 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) +@@ -2725,6 +2705,26 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) if (context) context_release(context); } @@ -248,19 +248,19 @@ index 0221ebd..b6bb67e 100644 return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 3f491e0..19596f3 100644 +index 9e548bb..24c1ce8 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2474,6 +2474,8 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ +@@ -2475,6 +2475,8 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; +void wined3d_surface_getdc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; +void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; - void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, - const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, - BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; -@@ -2746,6 +2748,8 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, + + void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, + const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +@@ -2744,6 +2746,8 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -270,5 +270,5 @@ index 3f491e0..19596f3 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -1.9.1 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 7850acbf..65df14da 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -476,29 +476,7 @@ diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -27,6 +27,21 @@ - WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); - WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); - -+#if !defined(STAGING_CSMT) -+BOOL volume_prepare_system_memory(struct wined3d_volume *volume) -+{ -+ if (volume->resource.heap_memory) -+ return TRUE; -+ -+ if (!wined3d_resource_allocate_sysmem(&volume->resource)) -+ { -+ ERR("Failed to allocate system memory.\n"); -+ return FALSE; -+ } -+ return TRUE; -+} -+ -+#endif /* STAGING_CSMT */ - /* Context activation is done by the caller. */ - void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, - const struct wined3d_const_bo_address *data) -@@ -86,6 +101,22 @@ +@@ -99,6 +99,22 @@ HeapFree(GetProcessHeap(), 0, converted_mem); } @@ -521,7 +499,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c /* Context activation is done by the caller. */ static void wined3d_volume_download_data(struct wined3d_volume *volume, const struct wined3d_context *context, const struct wined3d_bo_address *data) -@@ -121,8 +152,33 @@ +@@ -134,8 +150,33 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) { wined3d_resource_free_sysmem(&volume->resource); @@ -555,7 +533,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } /* Context activation is done by the caller. */ -@@ -164,6 +220,7 @@ +@@ -177,6 +218,7 @@ return TRUE; } @@ -563,7 +541,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c /* Context activation is done by the caller. */ static void wined3d_volume_load_location(struct wined3d_resource *resource, -@@ -174,6 +231,22 @@ +@@ -187,6 +229,22 @@ TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location), wined3d_debug_location(volume->resource.locations)); @@ -586,7 +564,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if ((volume->resource.access_flags & required_access) != required_access) { -@@ -192,6 +265,7 @@ +@@ -205,6 +263,7 @@ && !(volume->container->flags & WINED3D_TEXTURE_SRGB_ALLOCATED))) ERR("Trying to load (s)RGB texture without prior allocation.\n"); @@ -594,7 +572,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) { TRACE("Volume previously discarded, nothing to do.\n"); -@@ -221,6 +295,37 @@ +@@ -234,6 +293,37 @@ return; } wined3d_resource_validate_location(&volume->resource, location); @@ -632,7 +610,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (wined3d_volume_can_evict(volume)) wined3d_volume_evict_sysmem(volume); -@@ -231,11 +336,24 @@ +@@ -244,11 +334,24 @@ if (!volume->resource.heap_memory) ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n"); @@ -657,7 +635,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -246,6 +364,7 @@ +@@ -259,6 +362,7 @@ else { FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n", @@ -665,7 +643,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_debug_location(volume->resource.locations)); return; } -@@ -261,6 +380,28 @@ +@@ -274,6 +378,28 @@ struct wined3d_bo_address data = {volume->resource.buffer->name, NULL}; if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) @@ -694,7 +672,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -270,6 +411,7 @@ +@@ -283,6 +409,7 @@ else { FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n", @@ -702,7 +680,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_debug_location(volume->resource.locations)); return; } -@@ -279,6 +421,17 @@ +@@ -292,6 +419,17 @@ default: FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location), wined3d_debug_location(volume->resource.locations)); @@ -720,7 +698,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } } -@@ -286,6 +439,7 @@ +@@ -299,6 +437,7 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode) { wined3d_texture_prepare_texture(volume->container, context, srgb_mode); @@ -728,7 +706,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_resource_load_location(&volume->resource, context, srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); } -@@ -298,6 +452,51 @@ +@@ -311,6 +450,51 @@ resource_cleanup(&volume->resource); volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); wined3d_cs_emit_volume_cleanup(device->cs, volume); @@ -780,7 +758,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } static void volume_unload(struct wined3d_resource *resource) -@@ -311,6 +510,7 @@ +@@ -324,6 +508,7 @@ TRACE("texture %p.\n", resource); @@ -788,7 +766,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (wined3d_resource_prepare_system_memory(&volume->resource)) { context = context_acquire(device, NULL); -@@ -323,6 +523,29 @@ +@@ -336,6 +521,29 @@ ERR("Out of memory when unloading volume %p.\n", volume); wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); @@ -818,7 +796,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } /* The texture name is managed by the container. */ -@@ -338,11 +561,13 @@ +@@ -351,11 +559,13 @@ return wined3d_texture_incref(volume->container); } @@ -832,7 +810,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c ULONG CDECL wined3d_volume_decref(struct wined3d_volume *volume) { TRACE("Forwarding to container %p.\n", volume->container); -@@ -369,6 +594,36 @@ +@@ -382,6 +592,36 @@ return &volume->resource; } @@ -869,7 +847,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume, const struct wined3d_box *box) { -@@ -394,6 +649,7 @@ +@@ -407,6 +647,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { @@ -877,7 +855,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c HRESULT hr; const struct wined3d_format *format = volume->resource.format; -@@ -421,6 +677,147 @@ +@@ -434,6 +675,147 @@ return hr; return hr; @@ -1025,7 +1003,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resource *resource) -@@ -430,6 +827,7 @@ +@@ -443,6 +825,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) { @@ -1033,7 +1011,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c HRESULT hr; if (volume->resource.unmap_dirtify) -@@ -439,6 +837,33 @@ +@@ -452,6 +835,33 @@ if (hr == WINEDDERR_NOTLOCKED) return WINED3DERR_INVALIDCALL; return hr; @@ -1067,7 +1045,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } static ULONG volume_resource_incref(struct wined3d_resource *resource) -@@ -451,6 +876,7 @@ +@@ -464,6 +874,7 @@ return wined3d_volume_decref(volume_from_resource(resource)); } @@ -1075,7 +1053,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c static void wined3d_volume_location_invalidated(struct wined3d_resource *resource, DWORD location) { struct wined3d_volume *volume = volume_from_resource(resource); -@@ -466,6 +892,13 @@ +@@ -479,6 +890,13 @@ volume_unload, wined3d_volume_location_invalidated, wined3d_volume_load_location, @@ -1089,7 +1067,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c }; static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, -@@ -502,7 +935,11 @@ +@@ -515,7 +933,11 @@ } volume->texture_level = level; @@ -1101,7 +1079,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC && gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] -@@ -510,7 +947,9 @@ +@@ -523,7 +945,9 @@ { wined3d_resource_free_sysmem(&volume->resource); volume->resource.map_binding = WINED3D_LOCATION_BUFFER; @@ -1947,8 +1925,8 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h DWORD priority; +#if defined(STAGING_CSMT) void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; - struct wined3d_gl_bo *buffer, *map_buffer; UINT custom_row_pitch, custom_slice_pitch; + struct wined3d_gl_bo *buffer, *map_buffer; @@ -2146,6 +2234,11 @@ DWORD locations; LONG access_fence; @@ -2020,7 +1998,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; -@@ -2366,6 +2479,24 @@ +@@ -2365,6 +2478,23 @@ struct wined3d_surface_dib { HBITMAP DIBsection; @@ -2029,7 +2007,6 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, + unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; +void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; -+void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch) DECLSPEC_HIDDEN; +void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, + BOOL srgb_mode) DECLSPEC_HIDDEN; +void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; @@ -2045,7 +2022,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT bitmap_size; }; -@@ -2391,7 +2522,11 @@ +@@ -2390,7 +2520,11 @@ struct wined3d_surface_ops { HRESULT (*surface_private_setup)(struct wined3d_surface *surface); @@ -2057,7 +2034,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_surface -@@ -2399,12 +2534,25 @@ +@@ -2398,12 +2532,25 @@ struct wined3d_resource resource; const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; @@ -2083,7 +2060,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h GLuint rb_multisample; GLuint rb_resolved; GLenum texture_target; -@@ -2450,10 +2598,19 @@ +@@ -2449,10 +2596,19 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN; void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; @@ -2103,7 +2080,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; -@@ -2465,6 +2622,7 @@ +@@ -2464,6 +2620,7 @@ const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN; HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN; @@ -2111,7 +2088,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; -@@ -2483,6 +2641,21 @@ +@@ -2482,6 +2639,21 @@ void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; void surface_flip(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN; @@ -2133,7 +2110,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Surface flags: */ #define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */ -@@ -2525,8 +2698,10 @@ +@@ -2524,8 +2696,10 @@ BOOL half_float_conv_needed; }; @@ -2144,7 +2121,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_saved_states { DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; -@@ -2594,6 +2769,7 @@ +@@ -2593,6 +2767,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2152,7 +2129,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -2644,6 +2820,32 @@ +@@ -2643,6 +2818,32 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; @@ -2185,7 +2162,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; -@@ -2691,6 +2893,7 @@ +@@ -2690,6 +2891,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; @@ -2193,7 +2170,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, -@@ -2750,6 +2953,7 @@ +@@ -2749,6 +2951,7 @@ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -2201,7 +2178,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -@@ -2764,8 +2968,12 @@ +@@ -2763,8 +2966,12 @@ struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -2214,7 +2191,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_query -@@ -2779,12 +2987,16 @@ +@@ -2778,12 +2985,16 @@ enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -2231,7 +2208,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other * fixed function semantics as D3DCOLOR or FLOAT16 */ -@@ -2811,7 +3023,9 @@ +@@ -2810,7 +3021,9 @@ GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -2241,7 +2218,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -2836,11 +3050,15 @@ +@@ -2835,11 +3048,15 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2257,7 +2234,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -2878,8 +3096,10 @@ +@@ -2877,8 +3094,10 @@ return surface_from_resource(resource); } @@ -2268,7 +2245,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_shader_resource_view { LONG refcount; -@@ -2892,8 +3112,12 @@ +@@ -2891,8 +3110,12 @@ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, @@ -2281,7 +2258,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_swapchain -@@ -2933,8 +3157,10 @@ +@@ -2932,8 +3155,10 @@ HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -2292,7 +2269,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /***************************************************************************** * Utility function prototypes -@@ -3153,7 +3379,9 @@ +@@ -3152,7 +3377,9 @@ void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_shader_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN; BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN; @@ -3765,13 +3742,13 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ +#if defined(STAGING_CSMT) - static HRESULT device_update_volume(struct wined3d_context *context, + static void device_update_volume(struct wined3d_context *context, struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) { -@@ -3374,6 +3678,18 @@ +@@ -3405,6 +3709,100 @@ - TRACE("src_volume %p, dst_volume %p.\n", - src_volume, dst_volume); + /* Make sure that the destination texture is loaded. */ + wined3d_texture_load(dst_texture, context, FALSE); +#else /* STAGING_CSMT */ +static HRESULT device_update_volume(struct wined3d_device *device, + struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) @@ -3783,23 +3760,20 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c + + TRACE("device %p, src_volume %p, dst_volume %p.\n", + device, src_volume, dst_volume); -+#endif /* STAGING_CSMT */ - - if (src_volume->resource.format != dst_volume->resource.format) - { -@@ -3388,6 +3704,7 @@ - return WINED3DERR_INVALIDCALL; - } - -+#if defined(STAGING_CSMT) - /* Only a prepare, since we're uploading the entire volume. */ - wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); - wined3d_resource_get_memory(&src_volume->resource, src_volume->resource.map_binding, &data); -@@ -3407,6 +3724,76 @@ - - /* Make sure that the destination texture is loaded. */ - wined3d_texture_load(dst_texture, context, FALSE); -+#else /* STAGING_CSMT */ ++ ++ if (src_volume->resource.format != dst_volume->resource.format) ++ { ++ FIXME("Source and destination formats do not match.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ if (src_volume->resource.width != dst_volume->resource.width ++ || src_volume->resource.height != dst_volume->resource.height ++ || src_volume->resource.depth != dst_volume->resource.depth) ++ { ++ FIXME("Source and destination sizes do not match.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ + if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY))) + return hr; + @@ -3872,7 +3846,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Update every surface level of the texture. */ switch (type) -@@ -3420,7 +3807,16 @@ +@@ -3418,7 +3816,16 @@ { src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); @@ -3889,7 +3863,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } break; } -@@ -3434,7 +3830,16 @@ +@@ -3432,7 +3839,16 @@ { src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); @@ -3906,18 +3880,18 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } break; } -@@ -3443,6 +3848,7 @@ +@@ -3441,6 +3857,7 @@ { for (i = 0; i < level_count; ++i) { +#if defined(STAGING_CSMT) - HRESULT hr; - hr = device_update_volume(context, + device_update_volume(context, volume_from_resource(wined3d_texture_get_sub_resource(src_texture, i)), -@@ -3451,6 +3857,15 @@ - { - WARN("Failed to update volume, hr %#x.\n", hr); - return; + volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i))); +@@ -3497,6 +3914,24 @@ + } + + wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); +#else /* STAGING_CSMT */ + hr = device_update_volume(device, + volume_from_resource(wined3d_texture_get_sub_resource(src_texture, i)), @@ -3926,30 +3900,20 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c + { + WARN("Failed to update volume, hr %#x.\n", hr); + return hr; -+#endif /* STAGING_CSMT */ - } - } - break; -@@ -3458,6 +3873,7 @@ - - default: - FIXME("Unsupported texture type %#x.\n", type); -+#if defined(STAGING_CSMT) - return; - } - } -@@ -3505,6 +3921,10 @@ - } - - wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); -+#else /* STAGING_CSMT */ ++ } ++ } ++ break; ++ } ++ ++ default: ++ FIXME("Unsupported texture type %#x.\n", type); + return WINED3DERR_INVALIDCALL; + } +#endif /* STAGING_CSMT */ return WINED3D_OK; } -@@ -3567,8 +3987,13 @@ +@@ -3559,8 +3994,13 @@ if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -3963,7 +3927,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -3665,6 +4090,7 @@ +@@ -3657,6 +4097,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, struct wined3d_surface *dst_surface, const POINT *dst_point) { @@ -3971,7 +3935,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c const struct wined3d_format *src_format = src_surface->resource.format; const struct wined3d_format *dst_format = dst_surface->resource.format; UINT update_w, update_h; -@@ -3672,6 +4098,7 @@ +@@ -3664,6 +4105,7 @@ RECT r, dst_rect; POINT p; @@ -3979,7 +3943,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n", device, src_surface, wine_dbgstr_rect(src_rect), dst_surface, wine_dbgstr_point(dst_point)); -@@ -3683,6 +4110,7 @@ +@@ -3675,6 +4117,7 @@ return WINED3DERR_INVALIDCALL; } @@ -3987,7 +3951,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (src_format->id != dst_format->id) { WARN("Source and destination surfaces should have the same format.\n"); -@@ -3745,6 +4173,9 @@ +@@ -3737,6 +4180,9 @@ wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point); return WINED3D_OK; @@ -3997,7 +3961,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } void CDECL wined3d_device_copy_resource(struct wined3d_device *device, -@@ -3846,8 +4277,14 @@ +@@ -3838,8 +4284,14 @@ rect = &r; } @@ -4012,7 +3976,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, -@@ -3861,6 +4298,7 @@ +@@ -3853,6 +4305,7 @@ return NULL; } @@ -4020,7 +3984,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return device->state.fb.render_targets[view_idx]; } -@@ -3876,6 +4314,22 @@ +@@ -3868,6 +4321,22 @@ { struct wined3d_rendertarget_view *prev; struct wined3d_fb_state *fb = &device->state.fb; @@ -4043,7 +4007,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n", device, view_idx, view, set_viewport); -@@ -3915,6 +4369,7 @@ +@@ -3907,6 +4376,7 @@ } @@ -4051,7 +4015,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c prev = fb->render_targets[view_idx]; if (view == prev) return WINED3D_OK; -@@ -3922,6 +4377,15 @@ +@@ -3914,6 +4384,15 @@ if (view) wined3d_rendertarget_view_incref(view); fb->render_targets[view_idx] = view; @@ -4067,7 +4031,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view); /* Release after the assignment, to prevent device_resource_released() * from seeing the surface as still in use. */ -@@ -3933,6 +4397,7 @@ +@@ -3925,6 +4404,7 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -4075,7 +4039,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_fb_state *fb = &device->state.fb; struct wined3d_rendertarget_view *prev; -@@ -3957,6 +4422,79 @@ +@@ -3949,6 +4429,79 @@ { TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n", device, x_hotspot, y_hotspot, cursor_image); @@ -4155,7 +4119,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (cursor_image) { -@@ -3992,8 +4530,16 @@ +@@ -3984,8 +4537,16 @@ * release it after setting the cursor image. Windows doesn't * addref the set surface, so we can't do this either without * creating circular refcount dependencies. */ @@ -4172,7 +4136,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->cursorWidth = cursor_image->resource.width; device->cursorHeight = cursor_image->resource.height; -@@ -4093,6 +4639,12 @@ +@@ -4085,6 +4646,12 @@ else SetCursor(NULL); } @@ -4185,7 +4149,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return oldVisible; } -@@ -4103,8 +4655,10 @@ +@@ -4095,8 +4662,10 @@ TRACE("device %p.\n", device); @@ -4196,7 +4160,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) { TRACE("Checking resource %p for eviction.\n", resource); -@@ -4112,6 +4666,7 @@ +@@ -4104,6 +4673,7 @@ if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) { TRACE("Evicting %p.\n", resource); @@ -4204,7 +4168,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_evict_resource(device->cs, resource); } } -@@ -4130,6 +4685,37 @@ +@@ -4122,6 +4692,37 @@ context = context_acquire(device, NULL); gl_info = context->gl_info; @@ -4242,7 +4206,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->depth_blt_texture) { -@@ -4150,6 +4736,7 @@ +@@ -4142,6 +4743,7 @@ HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -4250,7 +4214,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c swapchain->num_contexts = 0; } -@@ -4169,6 +4756,14 @@ +@@ -4161,6 +4763,14 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { @@ -4265,7 +4229,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HRESULT hr; if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4185,6 +4780,7 @@ +@@ -4177,6 +4787,7 @@ return hr; } @@ -4273,7 +4237,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); if (FAILED(hr)) { -@@ -4195,6 +4791,34 @@ +@@ -4187,6 +4798,34 @@ } wined3d_cs_emit_create_dummy_textures(device->cs); @@ -4308,7 +4272,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4214,8 +4838,10 @@ +@@ -4206,8 +4845,10 @@ unsigned int i; TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback); @@ -4319,7 +4283,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { -@@ -4231,9 +4857,21 @@ +@@ -4223,9 +4864,21 @@ wined3d_texture_decref(device->logo_texture); device->logo_texture = NULL; } @@ -4341,7 +4305,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4242,6 +4880,7 @@ +@@ -4234,6 +4887,7 @@ } wined3d_device_set_depth_stencil_view(device, NULL); @@ -4349,7 +4313,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (reset_state) { state_unbind_resources(&device->state); -@@ -4251,6 +4890,12 @@ +@@ -4243,6 +4897,12 @@ { wined3d_surface_decref(device->cs->onscreen_depth_stencil); device->cs->onscreen_depth_stencil = NULL; @@ -4362,7 +4326,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4263,6 +4908,7 @@ +@@ -4255,6 +4915,7 @@ } } @@ -4370,7 +4334,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Free implicit resources and wait for the command stream before modifying * swapchain parameters. After modifying the swapchain parameters a new GL * context may be acquired by the worker thread. This causes problems in the -@@ -4284,6 +4930,7 @@ +@@ -4276,6 +4937,7 @@ } device->cs->ops->finish(device->cs); @@ -4378,7 +4342,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Is it necessary to recreate the gl context? Actually every setting can be changed * on an existing gl context, so there's no real need for recreation. * -@@ -4419,6 +5066,13 @@ +@@ -4411,6 +5073,13 @@ } } @@ -4392,7 +4356,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (swapchain->desc.enable_auto_depth_stencil) { struct wined3d_resource_desc surface_desc; -@@ -4456,6 +5110,13 @@ +@@ -4448,6 +5117,13 @@ wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); } @@ -4406,7 +4370,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface( surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)), NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) -@@ -4536,12 +5197,20 @@ +@@ -4528,12 +5204,20 @@ } wined3d_cs_emit_reset_state(device->cs); state_cleanup(&device->state); @@ -4427,7 +4391,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize device state, hr %#x.\n", hr); device->update_state = &device->state; -@@ -4550,6 +5219,7 @@ +@@ -4542,6 +5226,7 @@ } else if (device->back_buffer_view) { @@ -4435,7 +4399,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_state *state = &device->state; wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE); -@@ -4565,6 +5235,24 @@ +@@ -4557,6 +5242,24 @@ state->scissor_rect.left = 0; state->scissor_rect.right = swapchain->desc.backbuffer_width; state->scissor_rect.bottom = swapchain->desc.backbuffer_height; @@ -4460,7 +4424,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4643,6 +5331,10 @@ +@@ -4635,6 +5338,10 @@ TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); @@ -4471,7 +4435,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c switch (type) { case WINED3D_RTYPE_SURFACE: -@@ -4653,6 +5345,7 @@ +@@ -4645,6 +5352,7 @@ for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -4479,7 +4443,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface) { ERR("Surface %p is still in use as render target %u.\n", surface, i); -@@ -4664,6 +5357,19 @@ +@@ -4656,6 +5364,19 @@ { ERR("Surface %p is still in use as depth/stencil buffer.\n", surface); device->state.fb.depth_stencil = NULL; @@ -4499,7 +4463,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } } break; -@@ -4804,7 +5510,11 @@ +@@ -4796,7 +5517,11 @@ device->blitter = adapter->blitter; @@ -4511,7 +4475,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); -@@ -4892,6 +5602,7 @@ +@@ -4884,6 +5609,7 @@ else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -4519,7 +4483,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, -@@ -4945,3 +5656,4 @@ +@@ -4937,3 +5663,4 @@ wined3d_device_destroy_bo(device, context, bo); } @@ -5967,7 +5931,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource) -@@ -891,6 +941,7 @@ +@@ -891,12 +941,25 @@ static void texture2d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) { @@ -5975,10 +5939,9 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c wined3d_resource_invalidate_location(sub_resource, location); } -@@ -899,6 +950,18 @@ - struct wined3d_surface *surface = surface_from_resource(sub_resource); - - wined3d_resource_validate_location(&surface->resource, location); + static void texture2d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) + { + wined3d_resource_validate_location(sub_resource, location); +#else /* STAGING_CSMT */ + struct wined3d_surface *surface = surface_from_resource(sub_resource); + @@ -5994,7 +5957,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } static void texture2d_sub_resource_upload_data(struct wined3d_resource *sub_resource, -@@ -977,6 +1040,7 @@ +@@ -975,6 +1038,7 @@ if (gl_info->supported[APPLE_CLIENT_STORAGE]) { @@ -6002,7 +5965,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (surface->flags & (SFLAG_NONPOW2) || texture->flags & WINED3D_TEXTURE_CONVERTED) { -@@ -985,12 +1049,26 @@ +@@ -983,12 +1047,26 @@ * WINED3D_TEXTURE_CONVERTED: The conversion destination memory is freed after loading the surface * heap_memory == NULL: Not defined in the extension. Seems to disable client storage effectively */ @@ -6029,7 +5992,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c surface->flags |= SFLAG_CLIENT; mem = surface->resource.heap_memory; -@@ -1060,6 +1138,7 @@ +@@ -1058,6 +1136,7 @@ wined3d_texture_unload_gl_texture(texture); } @@ -6037,7 +6000,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c static void wined3d_texture_load_location_invalidated(struct wined3d_resource *resource, DWORD location) { ERR("Should not be called on textures.\n"); -@@ -1079,6 +1158,13 @@ +@@ -1077,6 +1156,13 @@ wined3d_texture_unload, wined3d_texture_load_location_invalidated, wined3d_texture_load_location, @@ -6051,7 +6014,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c }; static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, -@@ -1095,6 +1181,7 @@ +@@ -1093,6 +1179,7 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6059,7 +6022,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1103,6 +1190,14 @@ +@@ -1101,6 +1188,14 @@ { WARN("(%p) : Tried to create not supported cube texture.\n", texture); HeapFree(GetProcessHeap(), 0, texture); @@ -6074,7 +6037,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1112,6 +1207,7 @@ +@@ -1110,6 +1205,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); @@ -6082,7 +6045,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1120,6 +1216,14 @@ +@@ -1118,6 +1214,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6097,7 +6060,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1140,7 +1244,9 @@ +@@ -1138,7 +1242,9 @@ else { WARN("Attempted to create a NPOT cube texture (edge length %u) without GL support.\n", desc->width); @@ -6107,7 +6070,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1150,7 +1256,9 @@ +@@ -1148,7 +1254,9 @@ surface_flags, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x\n", hr); @@ -6117,7 +6080,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1213,7 +1321,9 @@ +@@ -1211,7 +1319,9 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6127,7 +6090,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1244,7 +1354,9 @@ +@@ -1242,7 +1352,9 @@ else { WARN("Attempted to create a mipmapped NPOT texture without unconditional NPOT support.\n"); @@ -6137,7 +6100,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1257,6 +1369,7 @@ +@@ -1255,6 +1367,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n"); @@ -6145,7 +6108,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1265,6 +1378,14 @@ +@@ -1263,6 +1376,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6160,7 +6123,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1273,7 +1394,9 @@ +@@ -1271,7 +1392,9 @@ surface_flags, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6170,7 +6133,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1371,6 +1494,7 @@ +@@ -1369,12 +1492,25 @@ static void texture3d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) { @@ -6178,10 +6141,9 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c wined3d_resource_invalidate_location(sub_resource, location); } -@@ -1379,6 +1503,18 @@ - struct wined3d_volume *volume = volume_from_resource(sub_resource); - - wined3d_resource_validate_location(&volume->resource, location); + static void texture3d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) + { + wined3d_resource_validate_location(sub_resource, location); +#else /* STAGING_CSMT */ + struct wined3d_volume *volume = volume_from_resource(sub_resource); + @@ -6197,7 +6159,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_resource, -@@ -1413,7 +1549,11 @@ +@@ -1409,7 +1545,11 @@ void *mem = NULL; if (gl_info->supported[APPLE_CLIENT_STORAGE] && !format->convert @@ -6209,7 +6171,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c { TRACE("Enabling GL_UNPACK_CLIENT_STORAGE_APPLE for volume %p\n", volume); gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); -@@ -1460,6 +1600,7 @@ +@@ -1456,6 +1596,7 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6217,7 +6179,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1468,6 +1609,14 @@ +@@ -1464,6 +1605,14 @@ { WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture); HeapFree(GetProcessHeap(), 0, texture); @@ -6232,7 +6194,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1477,6 +1626,7 @@ +@@ -1473,6 +1622,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); @@ -6240,7 +6202,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1485,6 +1635,14 @@ +@@ -1481,6 +1631,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6255,7 +6217,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1512,7 +1670,9 @@ +@@ -1508,7 +1666,9 @@ { WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n", desc->width, desc->height, desc->depth); @@ -6265,7 +6227,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1522,7 +1682,9 @@ +@@ -1518,7 +1678,9 @@ 0, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6275,7 +6237,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1599,6 +1761,9 @@ +@@ -1595,6 +1757,9 @@ if (FAILED(hr)) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -9645,31 +9607,15 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c { if (d3d_flags & WINED3D_MAP_READONLY) return GL_READ_ONLY_ARB; -@@ -361,6 +379,7 @@ - resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB; - } - -+#if defined(STAGING_CSMT) - void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) - { - TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location)); -@@ -632,6 +651,7 @@ - } - } - -+#endif /* STAGING_CSMT */ - void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, - UINT *slice_pitch) - { -@@ -662,6 +682,7 @@ +@@ -391,6 +409,7 @@ TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); } +#if defined(STAGING_CSMT) - BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, - const struct wined3d_box *box) -@@ -937,3 +958,4 @@ + void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) + { +@@ -937,3 +956,4 @@ wined3d_resource_invalidate_location(resource, ~resource->map_binding); }