From ea9f20929207ee007b421a350af3c4e0af6c942c Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 20 Feb 2015 01:56:07 +0100 Subject: [PATCH] Rebase against upstream changes, remove patch for IDirectPlayVoiceClient::GetCompressionTypes (accepted upstream). --- README.md | 2 +- debian/changelog | 2 + ...-tests-Add-GetCompressionTypes-tests.patch | 221 ------------ ...GetCompressionTypes-into-a-semi-stub.patch | 133 ------- .../dpvoice-GetCompressionTypes/definition | 1 - patches/patchinstall.sh | 21 -- ...01-wined3d-Merge-get_pitch-functions.patch | 51 +-- ...-update_texture-calls-through-the-CS.patch | 34 +- ...ck-the-src-volume-in-device_update_v.patch | 13 +- .../wined3d-CSMT_Main/9999-IfDefined.patch | 335 +++++++++--------- 10 files changed, 226 insertions(+), 587 deletions(-) delete mode 100644 patches/dpvoice-GetCompressionTypes/0001-dpvoice-tests-Add-GetCompressionTypes-tests.patch delete mode 100644 patches/dpvoice-GetCompressionTypes/0002-dpvoice-Turn-GetCompressionTypes-into-a-semi-stub.patch delete mode 100644 patches/dpvoice-GetCompressionTypes/definition diff --git a/README.md b/README.md index 717ad1b2..e30e5449 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ Included bug fixes and improvements * Implement an Arial replacement font ([Wine Bug #32323](https://bugs.winehq.org/show_bug.cgi?id=32323)) * Implement exclusive mode in PulseAudio backend ([Wine Bug #37042](https://bugs.winehq.org/show_bug.cgi?id=37042)) * Implement ntoskrnl driver testing framework. -* Implement semi-stub for IDirectPlayVoiceClient::GetCompressionTypes ([Wine Bug #29238](https://bugs.winehq.org/show_bug.cgi?id=29238)) +* ~~Implement semi-stub for IDirectPlayVoiceClient::GetCompressionTypes~~ ([Wine Bug #29238](https://bugs.winehq.org/show_bug.cgi?id=29238)) * Implement stub for ntoskrnl.IoGetAttachedDeviceReference * Implement stub for ntoskrnl.KeDelayExecutionThread. * Implement stubs for ntoskrnl.Ex{Acquire,Release}FastMutexUnsafe diff --git a/debian/changelog b/debian/changelog index 876c94b7..369d4758 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,8 @@ wine-staging (1.7.37) UNRELEASED; urgency=low * Added patch to improve stubs for AEV_{Get,Set}Mute. * Removed patches for UTF7 support (accepted upstream). * Removed patches for SIO_ADDRESS_LIST_CHANGE ioctl (accepted upstream). + * Removed patch for IApplicationAssociationRegistration::QueryCurrentDefault (accepted upstream). + * Removed patch for IDirectPlayVoiceClient::GetCompressionTypes (accepted upstream). -- Sebastian Lackner Sun, 08 Feb 2015 20:29:38 +0100 wine-staging (1.7.36) unstable; urgency=low diff --git a/patches/dpvoice-GetCompressionTypes/0001-dpvoice-tests-Add-GetCompressionTypes-tests.patch b/patches/dpvoice-GetCompressionTypes/0001-dpvoice-tests-Add-GetCompressionTypes-tests.patch deleted file mode 100644 index 66a68428..00000000 --- a/patches/dpvoice-GetCompressionTypes/0001-dpvoice-tests-Add-GetCompressionTypes-tests.patch +++ /dev/null @@ -1,221 +0,0 @@ -From 2ffd5a6a1a61b8a3f9a6747a5cb23676d3092c3d Mon Sep 17 00:00:00 2001 -From: Alex Henrie -Date: Fri, 16 Jan 2015 00:44:23 -0700 -Subject: dpvoice/tests: Add GetCompressionTypes tests. - ---- - dlls/dpvoice/tests/voice.c | 190 ++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 188 insertions(+), 2 deletions(-) - -diff --git a/dlls/dpvoice/tests/voice.c b/dlls/dpvoice/tests/voice.c -index 8048280..8d1d879 100644 ---- a/dlls/dpvoice/tests/voice.c -+++ b/dlls/dpvoice/tests/voice.c -@@ -343,6 +343,179 @@ static void create_voicetest(void) - } - } - -+static void test_GetCompressionTypes(HRESULT (WINAPI *GetCompressionTypes)(void*,void*,DWORD*,DWORD*,DWORD), -+ void *iface, const char *name) -+{ -+ DVCOMPRESSIONINFO data[32]; -+ HRESULT ret; -+ DWORD data_size, num_elements, i, j; -+ WCHAR *string_loc; -+ BOOL found_pcm; -+ -+ /* some variables are initialized to 99 just to check that they are not overwritten with 0 */ -+ static struct -+ { -+ /* inputs */ -+ DWORD data_size; -+ DWORD num_elements; -+ DWORD flags; -+ /* expected output */ -+ HRESULT ret; -+ /* test flags */ -+ enum -+ { -+ NULL_DATA = 1, -+ NULL_DATA_SIZE = 2, -+ NULL_NUM_ELEMENTS = 4, -+ SHARED_VARIABLE = 8 -+ } -+ test_flags; -+ } -+ tests[] = -+ { -+ /* tests NULL data with an insufficient data_size */ -+ { 10, 0, 0, DVERR_BUFFERTOOSMALL, NULL_DATA }, -+ -+ /* tests NULL data with an ample data_size */ -+ { sizeof(data) - 1, 0, 0, DVERR_INVALIDPOINTER, NULL_DATA }, -+ -+ /* tests NULL data_size */ -+ { 0, 99, 0, DVERR_INVALIDPOINTER, NULL_DATA_SIZE }, -+ -+ /* tests NULL num_elements */ -+ { 99, 0, 0, DVERR_INVALIDPOINTER, NULL_NUM_ELEMENTS }, -+ -+ /* tests NULL everything */ -+ { 99, 99, 0, DVERR_INVALIDPOINTER, NULL_DATA | NULL_DATA_SIZE | NULL_NUM_ELEMENTS }, -+ -+ /* tests passing the same pointer for data_size and num_elements */ -+ { 10, 0, 0, DVERR_BUFFERTOOSMALL, SHARED_VARIABLE }, -+ -+ /* tests passing the same pointer but with an ample data_size */ -+ { sizeof(data) - 1, 0, 0, DVERR_BUFFERTOOSMALL, SHARED_VARIABLE }, -+ -+ /* tests flags!=0 */ -+ { 99, 99, 1, DVERR_INVALIDFLAGS }, -+ -+ /* tests data_size=0 */ -+ { 0, 0, 0, DVERR_BUFFERTOOSMALL }, -+ -+ /* tests data_size=1 */ -+ { 1, 0, 0, DVERR_BUFFERTOOSMALL }, -+ -+ /* tests data_size = sizeof(DVCOMPRESSIONINFO) */ -+ { sizeof(DVCOMPRESSIONINFO), 0, 0, DVERR_BUFFERTOOSMALL }, -+ -+ /* tests data_size = returned data_size - 1 */ -+ { 0 /* initialized later */, 0, 0, DVERR_BUFFERTOOSMALL }, -+ -+ /* tests data_size = returned data_size */ -+ { 0 /* initialized later */, 0, 0, DV_OK }, -+ -+ /* tests data_size = returned data_size + 1 */ -+ { 0 /* initialized later */, 0, 0, DV_OK } -+ }; -+ -+ if(GetCompressionTypes(iface, NULL, NULL, NULL, 0) == E_NOTIMPL) -+ { -+ skip("%s: GetCompressionTypes not implemented\n", name); -+ return; -+ } -+ -+ data_size = 0; -+ ret = GetCompressionTypes(iface, NULL, &data_size, &num_elements, 0); -+ ok(ret == DVERR_BUFFERTOOSMALL, -+ "%s: expected ret=%x, got ret=%x\n", name, DVERR_BUFFERTOOSMALL, ret); -+ ok(data_size > sizeof(DVCOMPRESSIONINFO) && data_size < sizeof(data) - 1, -+ "%s: expected data_size between %u and %u, got data_size=%u\n", -+ name, (DWORD)sizeof(DVCOMPRESSIONINFO), (DWORD)sizeof(data) - 1, data_size); -+ tests[sizeof(tests) / sizeof(tests[0]) - 3].data_size = data_size - 1; -+ tests[sizeof(tests) / sizeof(tests[0]) - 2].data_size = data_size; -+ tests[sizeof(tests) / sizeof(tests[0]) - 1].data_size = data_size + 1; -+ -+ for(i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) -+ { -+ memset(data, 0x23, sizeof(data)); -+ -+ data_size = tests[i].data_size; -+ num_elements = tests[i].num_elements; -+ -+ ret = GetCompressionTypes( -+ iface, -+ tests[i].test_flags & NULL_DATA ? NULL : data, -+ tests[i].test_flags & NULL_DATA_SIZE ? NULL : &data_size, -+ tests[i].test_flags & NULL_NUM_ELEMENTS ? NULL : -+ tests[i].test_flags & SHARED_VARIABLE ? &data_size : &num_elements, -+ tests[i].flags -+ ); -+ -+ ok(ret == tests[i].ret, -+ "%s: tests[%u]: expected ret=%x got ret=%x\n", name, i, tests[i].ret, ret); -+ -+ if(ret == DV_OK || ret == DVERR_BUFFERTOOSMALL || tests[i].test_flags == NULL_DATA) -+ { -+ ok(data_size > sizeof(DVCOMPRESSIONINFO) && data_size < sizeof(data) - 1, -+ "%s: tests[%u]: expected data_size between %u and %u, got data_size=%u\n", -+ name, i, (DWORD)sizeof(DVCOMPRESSIONINFO), (DWORD)sizeof(data) - 1, data_size); -+ if(!(tests[i].test_flags & SHARED_VARIABLE)) -+ ok(num_elements > 0 && num_elements < data_size / sizeof(DVCOMPRESSIONINFO) + 1, -+ "%s: tests[%u]: expected num_elements between 0 and %u, got num_elements=%u\n", -+ name, i, data_size / (DWORD)sizeof(DVCOMPRESSIONINFO) + 1, num_elements); -+ } -+ else -+ { -+ ok(data_size == tests[i].data_size, -+ "%s: tests[%u]: expected data_size=%u, got data_size=%u\n", -+ name, i, tests[i].data_size, data_size); -+ ok(num_elements == tests[i].num_elements, -+ "%s: tests[%u]: expected num_elements=%u, got num_elements=%u\n", -+ name, i, tests[i].num_elements, num_elements); -+ } -+ -+ if(ret == DV_OK) -+ { -+ string_loc = (WCHAR *)(data + num_elements); -+ found_pcm = FALSE; -+ for(j = 0; j < num_elements; j++) -+ { -+ if(memcmp(&data[j].guidType, &DPVCTGUID_NONE, sizeof(GUID)) == 0) -+ { -+ ok(data[j].dwMaxBitsPerSecond == 64000, -+ "%s: tests[%u]: data[%u]: expected dwMaxBitsPerSecond=64000, got dwMaxBitsPerSecond=%u\n", -+ name, i, j, data[j].dwMaxBitsPerSecond); -+ found_pcm = TRUE; -+ } -+ ok(data[j].dwSize == 80, -+ "%s: tests[%u]: data[%u]: expected dwSize=80, got dwSize=%u\n", -+ name, i, j, data[j].dwSize); -+ ok(data[j].lpszName == string_loc, -+ "%s: tests[%u]: data[%u]: expected lpszName=%p, got lpszName=%p\n", -+ name, i, j, string_loc, data[j].lpszName); -+ ok(!data[j].lpszDescription, -+ "%s: tests[%u]: data[%u]: expected lpszDescription=NULL, got lpszDescription=%s\n", -+ name, i, j, wine_dbgstr_w(data[j].lpszDescription)); -+ ok(!data[j].dwFlags, -+ "%s: tests[%u]: data[%u]: expected dwFlags=0, got dwFlags=%u\n", -+ name, i, j, data[j].dwFlags); -+ string_loc += lstrlenW(data[j].lpszName) + 1; -+ } -+ ok((char *)string_loc == (char *)data + data_size, -+ "%s: tests[%u]: expected string_loc=%p, got string_loc=%p\n", -+ name, i, (char *)data + data_size, string_loc); -+ ok(*(char *)string_loc == 0x23, -+ "%s: tests[%u]: expected *(char*)string_loc=0x23, got *(char *)string_loc=0x%x\n", -+ name, i, *(char *)string_loc); -+ ok(found_pcm, "%s: tests[%u]: MS-PCM codec not found\n", name, i); -+ } -+ else -+ { -+ ok(*(char *)data == 0x23, -+ "%s: tests[%u]: expected *(char*)data=0x23, got *(char *)data=0x%x\n", -+ name, i, *(char *)data); -+ } -+ } -+} -+ - START_TEST(voice) - { - HRESULT hr; -@@ -354,9 +527,22 @@ START_TEST(voice) - - create_voicetest(); - -- if(test_init_dpvoice_server() && test_init_dpvoice_client()) -+ if(test_init_dpvoice_server()) -+ { -+ test_GetCompressionTypes((void *)vserver->lpVtbl->GetCompressionTypes, vserver, "server"); -+ } -+ else -+ { -+ skip("server failed to initialize\n"); -+ } -+ -+ if(test_init_dpvoice_client()) -+ { -+ test_GetCompressionTypes((void *)vclient->lpVtbl->GetCompressionTypes, vclient, "client"); -+ } -+ else - { -- /* TODO */ -+ skip("client failed to initialize\n"); - } - - test_cleanup_dpvoice(); --- -2.2.1 - diff --git a/patches/dpvoice-GetCompressionTypes/0002-dpvoice-Turn-GetCompressionTypes-into-a-semi-stub.patch b/patches/dpvoice-GetCompressionTypes/0002-dpvoice-Turn-GetCompressionTypes-into-a-semi-stub.patch deleted file mode 100644 index 85ac3d6e..00000000 --- a/patches/dpvoice-GetCompressionTypes/0002-dpvoice-Turn-GetCompressionTypes-into-a-semi-stub.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 25a2c26cb36b59d5d820707e8d5a6313d6a3636d Mon Sep 17 00:00:00 2001 -From: Alex Henrie -Date: Fri, 16 Jan 2015 00:44:24 -0700 -Subject: dpvoice: Turn GetCompressionTypes into a semi-stub. - -Star Trek Armada II needs GetCompressionTypes to return at least one -value, see https://bugs.winehq.org/show_bug.cgi?id=29238 - -MS-PCM is guaranteed to be present on Windows XP, and it's already -implemented in Wine, so advertising this codec shouldn't cause any -trouble. ---- - dlls/dpvoice/client.c | 5 +++-- - dlls/dpvoice/dvoice_private.h | 1 + - dlls/dpvoice/server.c | 43 +++++++++++++++++++++++++++++++++++++++++-- - dlls/dpvoice/tests/voice.c | 6 ------ - 4 files changed, 45 insertions(+), 10 deletions(-) - -diff --git a/dlls/dpvoice/client.c b/dlls/dpvoice/client.c -index 29b5336..bdae160 100644 ---- a/dlls/dpvoice/client.c -+++ b/dlls/dpvoice/client.c -@@ -32,6 +32,7 @@ - #include "wine/debug.h" - - #include "dvoice.h" -+#include "dvoice_private.h" - - WINE_DEFAULT_DEBUG_CHANNEL(dpvoice); - -@@ -149,8 +150,8 @@ static HRESULT WINAPI dpvclient_GetCompressionTypes(IDirectPlayVoiceClient *ifac - DWORD *pdwDataSize, DWORD *pdwNumElements, DWORD dwFlags) - { - IDirectPlayVoiceClientImpl *This = impl_from_IDirectPlayVoiceClient(iface); -- FIXME("%p %p %p %p %d\n", This, pData, pdwDataSize, pdwNumElements, dwFlags); -- return E_NOTIMPL; -+ FIXME("%p %p %p %p %d semi-stub\n", This, pData, pdwDataSize, pdwNumElements, dwFlags); -+ return DPVOICE_GetCompressionTypes(pData, pdwDataSize, pdwNumElements, dwFlags); - } - - static HRESULT WINAPI dpvclient_SetTransmitTargets(IDirectPlayVoiceClient *iface, PDVID pdvIDTargets, -diff --git a/dlls/dpvoice/dvoice_private.h b/dlls/dpvoice/dvoice_private.h -index 5b0e57d..ededeab 100644 ---- a/dlls/dpvoice/dvoice_private.h -+++ b/dlls/dpvoice/dvoice_private.h -@@ -23,5 +23,6 @@ - extern HRESULT DPVOICE_CreateDirectPlayVoiceClient(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj) DECLSPEC_HIDDEN; - extern HRESULT DPVOICE_CreateDirectPlayVoiceServer(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj) DECLSPEC_HIDDEN; - extern HRESULT DPVOICE_CreateDirectPlayVoiceTest(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj) DECLSPEC_HIDDEN; -+extern HRESULT DPVOICE_GetCompressionTypes(DVCOMPRESSIONINFO *pData, DWORD *pdwDataSize, DWORD *pdwNumElements, DWORD dwFlags) DECLSPEC_HIDDEN; - - #endif -diff --git a/dlls/dpvoice/server.c b/dlls/dpvoice/server.c -index e9291e2..80ef199 100644 ---- a/dlls/dpvoice/server.c -+++ b/dlls/dpvoice/server.c -@@ -41,6 +41,45 @@ typedef struct IDirectPlayVoiceServerImpl - LONG ref; - } IDirectPlayVoiceServerImpl; - -+HRESULT DPVOICE_GetCompressionTypes(DVCOMPRESSIONINFO *pData, DWORD *pdwDataSize, DWORD *pdwNumElements, DWORD dwFlags) -+{ -+ static const DVCOMPRESSIONINFO pcm_type = -+ {80, {0x8de12fd4,0x7cb3,0x48ce,{0xa7,0xe8,0x9c,0x47,0xa2,0x2e,0x8a,0xc5}}, NULL, NULL, 0, 64000}; -+ static const WCHAR pcm_name[] = -+ {'M','S','-','P','C','M',' ','6','4',' ','k','b','i','t','/','s',0}; -+ -+ HRESULT ret; -+ LPWSTR string_loc; -+ -+ if (!pdwDataSize || !pdwNumElements) -+ return DVERR_INVALIDPOINTER; -+ -+ if (dwFlags) -+ return DVERR_INVALIDFLAGS; -+ -+ *pdwNumElements = 1; -+ -+ if (*pdwDataSize < sizeof(pcm_type) + sizeof(pcm_name)) -+ { -+ ret = DVERR_BUFFERTOOSMALL; -+ } -+ else if (!pData) -+ { -+ ret = DVERR_INVALIDPOINTER; -+ } -+ else -+ { -+ string_loc = (LPWSTR)((char*)pData + sizeof(pcm_type)); -+ memcpy(pData, &pcm_type, sizeof(pcm_type)); -+ memcpy(string_loc, pcm_name, sizeof(pcm_name)); -+ pData->lpszName = string_loc; -+ ret = DV_OK; -+ } -+ -+ *pdwDataSize = sizeof(pcm_type) + sizeof(pcm_name); -+ return ret; -+} -+ - static inline IDirectPlayVoiceServerImpl *impl_from_IDirectPlayVoiceServer(IDirectPlayVoiceServer *iface) - { - return CONTAINING_RECORD(iface, IDirectPlayVoiceServerImpl, IDirectPlayVoiceServer_iface); -@@ -130,8 +169,8 @@ static HRESULT WINAPI dpvserver_GetCompressionTypes(IDirectPlayVoiceServer *ifac - DWORD *pdwNumElements, DWORD dwFlags) - { - IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface); -- FIXME("%p %p %p %p %d\n", This, pData, pdwDataSize, pdwNumElements, dwFlags); -- return E_NOTIMPL; -+ FIXME("%p %p %p %p %d semi-stub\n", This, pData, pdwDataSize, pdwNumElements, dwFlags); -+ return DPVOICE_GetCompressionTypes(pData, pdwDataSize, pdwNumElements, dwFlags); - } - - static HRESULT WINAPI dpvserver_SetTransmitTargets(IDirectPlayVoiceServer *iface, DVID dvSource, PDVID pdvIDTargets, -diff --git a/dlls/dpvoice/tests/voice.c b/dlls/dpvoice/tests/voice.c -index e42fb7b..ad84b3f 100644 ---- a/dlls/dpvoice/tests/voice.c -+++ b/dlls/dpvoice/tests/voice.c -@@ -416,12 +416,6 @@ static void test_GetCompressionTypes(HRESULT (WINAPI *GetCompressionTypes)(void* - { 0 /* initialized later */, 0, 0, DV_OK } - }; - -- if(GetCompressionTypes(iface, NULL, NULL, NULL, 0) == E_NOTIMPL) -- { -- skip("%s: GetCompressionTypes not implemented\n", name); -- return; -- } -- - data_size = 0; - ret = GetCompressionTypes(iface, NULL, &data_size, &num_elements, 0); - ok(ret == DVERR_BUFFERTOOSMALL, --- -2.2.1 - diff --git a/patches/dpvoice-GetCompressionTypes/definition b/patches/dpvoice-GetCompressionTypes/definition deleted file mode 100644 index 9c7bd7dc..00000000 --- a/patches/dpvoice-GetCompressionTypes/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [29238] Implement semi-stub for IDirectPlayVoiceClient::GetCompressionTypes diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 1c55991a..8c3a26bf 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -84,7 +84,6 @@ patch_enable_all () enable_dbghelp_Debug_Symbols="$1" enable_ddraw_d3d_execute_buffer="$1" enable_dinput_Events="$1" - enable_dpvoice_GetCompressionTypes="$1" enable_dsound_Fast_Mixer="$1" enable_dxgi_GetDesc="$1" enable_fonts_Missing_Fonts="$1" @@ -281,9 +280,6 @@ patch_enable () dinput-Events) enable_dinput_Events="$2" ;; - dpvoice-GetCompressionTypes) - enable_dpvoice_GetCompressionTypes="$2" - ;; dsound-Fast_Mixer) enable_dsound_Fast_Mixer="$2" ;; @@ -1445,23 +1441,6 @@ if test "$enable_dinput_Events" -eq 1; then ) >> "$patchlist" fi -# Patchset dpvoice-GetCompressionTypes -# | -# | This patchset fixes the following Wine bugs: -# | * [#29238] Implement semi-stub for IDirectPlayVoiceClient::GetCompressionTypes -# | -# | Modified files: -# | * dlls/dpvoice/client.c, dlls/dpvoice/dvoice_private.h, dlls/dpvoice/server.c, dlls/dpvoice/tests/voice.c -# | -if test "$enable_dpvoice_GetCompressionTypes" -eq 1; then - patch_apply dpvoice-GetCompressionTypes/0001-dpvoice-tests-Add-GetCompressionTypes-tests.patch - patch_apply dpvoice-GetCompressionTypes/0002-dpvoice-Turn-GetCompressionTypes-into-a-semi-stub.patch - ( - echo '+ { "Alex Henrie", "dpvoice/tests: Add GetCompressionTypes tests.", 1 },'; - echo '+ { "Alex Henrie", "dpvoice: Turn GetCompressionTypes into a semi-stub.", 1 },'; - ) >> "$patchlist" -fi - # Patchset dsound-Fast_Mixer # | # | This patchset fixes the following Wine bugs: 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 fd8c1aaa..6e1b5584 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,18 +1,18 @@ -From 031999169c1d5006c62e4b4d722c361d57d5ed09 Mon Sep 17 00:00:00 2001 +From a7a0d0aca8b7d4b1972f237a19b5caf212a74fd3 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. --- dlls/ddraw/surface.c | 12 +++++-- - dlls/wined3d/resource.c | 31 +++++++++++++++++ - dlls/wined3d/surface.c | 75 +++++++++++++++++------------------------- + dlls/wined3d/resource.c | 31 ++++++++++++++++ + dlls/wined3d/surface.c | 81 ++++++++++++++++++------------------------ dlls/wined3d/texture.c | 2 +- - dlls/wined3d/volume.c | 28 ++-------------- + dlls/wined3d/volume.c | 28 ++------------- dlls/wined3d/wined3d.spec | 2 +- dlls/wined3d/wined3d_private.h | 3 +- include/wine/wined3d.h | 3 +- - 8 files changed, 78 insertions(+), 78 deletions(-) + 8 files changed, 81 insertions(+), 81 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index a387d12..9a8d94f 100644 @@ -97,7 +97,7 @@ index 205f074..3375c0f 100644 + TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); +} diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 677f876..8fa36e4 100644 +index 9ba5906..dbbc826 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -363,6 +363,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) @@ -204,7 +204,7 @@ index 677f876..8fa36e4 100644 HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y) { LONG w, h; -@@ -2182,12 +2165,13 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -2182,20 +2165,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; valid_location = WINED3D_LOCATION_USER_MEMORY; } @@ -215,13 +215,24 @@ index 677f876..8fa36e4 100644 surface->resource.multisample_type = texture_resource->multisample_type; surface->resource.multisample_quality = texture_resource->multisample_quality; - if (surface->pitch) -- surface->resource.size = height * surface->pitch; + if (surface->resource.custom_row_pitch) + { +- surface->resource.size = height * surface->pitch; + surface->resource.size = height * surface->resource.custom_row_pitch; + } else - surface->resource.size = wined3d_format_calculate_size(texture_resource->format, - texture_resource->device->surface_alignment, width, height, 1); -@@ -2808,7 +2792,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + { + /* User memory surfaces don't have the regular surface alignment. */ +- surface->resource.size = wined3d_format_calculate_size(texture_resource->format, +- 1, width, height, 1); +- surface->pitch = wined3d_format_calculate_pitch(texture_resource->format, width); ++ surface->resource.size = wined3d_format_calculate_size(texture_resource->format, 1, width, height, 1); ++ surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width); ++ surface->resource.custom_slice_pitch = surface->resource.custom_row_pitch * surface->resource.height; /* FIXME */ + } + + /* The format might be changed to a format that needs conversion. +@@ -2814,7 +2798,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 +241,7 @@ index 677f876..8fa36e4 100644 map_desc->slice_pitch = 0; if (!rect) -@@ -2935,6 +2919,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2941,6 +2925,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc int i; BOOL srcIsUpsideDown; struct wined3d_bo_address data; @@ -238,7 +249,7 @@ index 677f876..8fa36e4 100644 surface_get_memory(surface, &data, dst_location); -@@ -2971,8 +2956,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2977,8 +2962,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc } /* Setup pixel store pack state -- to glReadPixels into the correct place */ @@ -249,7 +260,7 @@ index 677f876..8fa36e4 100644 checkGLcall("glPixelStorei"); gl_info->gl_ops.gl.p_glReadPixels(0, 0, -@@ -2989,7 +2974,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2995,7 +2980,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. */ @@ -260,7 +271,7 @@ index 677f876..8fa36e4 100644 if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) goto error; -@@ -4220,7 +4207,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4226,7 +4213,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; @@ -269,7 +280,7 @@ index 677f876..8fa36e4 100644 struct wined3d_bo_address data; struct wined3d_format format; POINT dst_point = {0, 0}; -@@ -4308,7 +4295,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4314,7 +4301,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, wined3d_texture_bind_and_dirtify(texture, context, srgb); width = surface->resource.width; @@ -278,7 +289,7 @@ index 677f876..8fa36e4 100644 format = *texture->resource.format; if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) -@@ -4347,9 +4334,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4353,9 +4340,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, context_release(context); return E_OUTOFMEMORY; } @@ -290,7 +301,7 @@ index 677f876..8fa36e4 100644 data.addr = mem; } else if (conversion) -@@ -4369,14 +4356,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4375,14 +4362,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } if (texture->swapchain && texture->swapchain->palette) palette = texture->swapchain->palette; @@ -309,10 +320,10 @@ index 677f876..8fa36e4 100644 context_release(context); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 675ca9e..b5f64ba 100644 +index 6b2e266..de433f6 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -1266,7 +1266,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso +@@ -1279,7 +1279,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso struct wined3d_const_bo_address addr; unsigned int row_pitch, slice_pitch; diff --git a/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch b/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch index 7fd06525..9ec1056e 100644 --- a/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch @@ -1,4 +1,4 @@ -From 1cc8df787d882d4c0a32c7c2f423c9935db5cf64 Mon Sep 17 00:00:00 2001 +From 063ea3bd542ec568905d8788bf37e2a281be0c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 1 Aug 2013 00:33:48 +0200 Subject: wined3d: Send update_texture calls through the CS @@ -10,7 +10,7 @@ Subject: wined3d: Send update_texture calls through the CS 3 files changed, 97 insertions(+), 74 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 4834dd4..aeba50f 100644 +index 62124a7..b41e364 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -72,6 +72,7 @@ enum wined3d_cs_op @@ -34,7 +34,7 @@ index 4834dd4..aeba50f 100644 static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -1888,6 +1895,31 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa +@@ -1891,6 +1898,31 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa cs->ops->submit(cs, sizeof(*op)); } @@ -66,7 +66,7 @@ index 4834dd4..aeba50f 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -1938,6 +1970,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -1941,6 +1973,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, @@ -75,10 +75,10 @@ index 4834dd4..aeba50f 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index cbb1466..5333f23 100644 +index 22ef49b..eb426ff 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3398,16 +3398,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3416,16 +3416,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device } /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ @@ -98,7 +98,7 @@ index cbb1466..5333f23 100644 if (src_volume->resource.format != dst_volume->resource.format) { -@@ -3425,8 +3424,6 @@ static HRESULT device_update_volume(struct wined3d_device *device, +@@ -3443,8 +3442,6 @@ static HRESULT device_update_volume(struct wined3d_device *device, if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY))) return hr; @@ -106,8 +106,8 @@ index cbb1466..5333f23 100644 - /* Only a prepare, since we're uploading the entire volume. */ wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); - -@@ -3435,68 +3432,21 @@ static HRESULT device_update_volume(struct wined3d_device *device, + wined3d_texture_bind(dst_volume->container, context, FALSE); +@@ -3454,68 +3451,21 @@ static HRESULT device_update_volume(struct wined3d_device *device, wined3d_volume_upload_data(dst_volume, context, &data); wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -182,7 +182,7 @@ index cbb1466..5333f23 100644 /* Update every surface level of the texture. */ switch (type) -@@ -3510,12 +3460,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3529,12 +3479,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, { src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); @@ -196,7 +196,7 @@ index cbb1466..5333f23 100644 } break; } -@@ -3529,12 +3474,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3548,12 +3493,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, { src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); @@ -210,7 +210,7 @@ index cbb1466..5333f23 100644 } break; } -@@ -3543,13 +3483,14 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3562,13 +3502,14 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, { for (i = 0; i < level_count; ++i) { @@ -227,7 +227,7 @@ index cbb1466..5333f23 100644 } } break; -@@ -3557,9 +3498,54 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3576,9 +3517,54 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, default: FIXME("Unsupported texture type %#x.\n", type); @@ -284,10 +284,10 @@ index cbb1466..5333f23 100644 } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index a1518dd..656469a 100644 +index 849f233..9c4cb9b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2074,6 +2074,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource +@@ -2095,6 +2095,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; @@ -296,7 +296,7 @@ index a1518dd..656469a 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2673,6 +2675,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac +@@ -2678,6 +2680,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -306,5 +306,5 @@ index a1518dd..656469a 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.3.0 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 ecc95eab..0ff594bd 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 c2397e25c4bce8e65cddb924047ee0fff1c7a397 Mon Sep 17 00:00:00 2001 +From 53122dd7633e0cd0d3c28240eec8f491c36e3da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 29 Aug 2013 22:25:14 +0200 Subject: wined3d: Don't lock the src volume in device_update_volume @@ -13,10 +13,10 @@ FIXME: Maybe merge this with the previous patch or change their order. 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 5333f23..4a54025 100644 +index eb426ff..75a47a1 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3398,12 +3398,10 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3416,12 +3416,10 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device } /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ @@ -31,7 +31,7 @@ index 5333f23..4a54025 100644 TRACE("src_volume %p, dst_volume %p.\n", src_volume, dst_volume); -@@ -3411,30 +3409,21 @@ static HRESULT device_update_volume(struct wined3d_context *context, +@@ -3429,31 +3427,22 @@ static HRESULT device_update_volume(struct wined3d_context *context, if (src_volume->resource.format != dst_volume->resource.format) { FIXME("Source and destination formats do not match.\n"); @@ -52,6 +52,7 @@ index 5333f23..4a54025 100644 - /* Only a prepare, since we're uploading the entire volume. */ wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); + wined3d_texture_bind(dst_volume->container, context, FALSE); - - data.buffer_object = 0; - data.addr = src.data; @@ -66,7 +67,7 @@ index 5333f23..4a54025 100644 } /* Context activation is done by the caller */ -@@ -3483,15 +3472,9 @@ void device_exec_update_texture(struct wined3d_context *context, struct wined3d_ +@@ -3502,15 +3491,9 @@ void device_exec_update_texture(struct wined3d_context *context, struct wined3d_ { for (i = 0; i < level_count; ++i) { @@ -84,5 +85,5 @@ index 5333f23..4a54025 100644 break; } -- -2.2.1 +2.3.0 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 28768a47..7d69495c 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -3761,7 +3761,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c static void device_update_volume(struct wined3d_context *context, struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) { -@@ -3421,6 +3727,100 @@ +@@ -3422,6 +3728,101 @@ /* Make sure that the destination texture is loaded. */ wined3d_texture_load(dst_texture, context, FALSE); @@ -3797,6 +3797,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c + + /* Only a prepare, since we're uploading the entire volume. */ + wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); ++ wined3d_texture_bind(dst_volume->container, context, FALSE); + + data.buffer_object = 0; + data.addr = src.data; @@ -3862,7 +3863,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Update every surface level of the texture. */ switch (type) -@@ -3434,7 +3834,16 @@ +@@ -3435,7 +3836,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)); @@ -3879,7 +3880,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } break; } -@@ -3448,7 +3857,16 @@ +@@ -3449,7 +3859,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)); @@ -3896,7 +3897,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } break; } -@@ -3457,6 +3875,7 @@ +@@ -3458,6 +3877,7 @@ { for (i = 0; i < level_count; ++i) { @@ -3904,7 +3905,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c 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))); -@@ -3513,6 +3932,24 @@ +@@ -3514,6 +3934,24 @@ } wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); @@ -3929,7 +3930,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -3575,8 +4012,13 @@ +@@ -3576,8 +4014,13 @@ if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -3943,7 +3944,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -3673,6 +4115,7 @@ +@@ -3674,6 +4117,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, struct wined3d_surface *dst_surface, const POINT *dst_point) { @@ -3951,7 +3952,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; -@@ -3680,6 +4123,7 @@ +@@ -3681,6 +4125,7 @@ RECT r, dst_rect; POINT p; @@ -3959,7 +3960,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)); -@@ -3691,6 +4135,7 @@ +@@ -3692,6 +4137,7 @@ return WINED3DERR_INVALIDCALL; } @@ -3967,7 +3968,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"); -@@ -3753,6 +4198,9 @@ +@@ -3754,6 +4200,9 @@ wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point); return WINED3D_OK; @@ -3977,7 +3978,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } void CDECL wined3d_device_copy_resource(struct wined3d_device *device, -@@ -3854,8 +4302,14 @@ +@@ -3855,8 +4304,14 @@ rect = &r; } @@ -3992,7 +3993,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, -@@ -3869,6 +4323,7 @@ +@@ -3870,6 +4325,7 @@ return NULL; } @@ -4000,7 +4001,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return device->state.fb.render_targets[view_idx]; } -@@ -3884,6 +4339,22 @@ +@@ -3885,6 +4341,22 @@ { struct wined3d_rendertarget_view *prev; struct wined3d_fb_state *fb = &device->state.fb; @@ -4023,7 +4024,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); -@@ -3923,6 +4394,7 @@ +@@ -3924,6 +4396,7 @@ } @@ -4031,7 +4032,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; -@@ -3930,6 +4402,15 @@ +@@ -3931,6 +4404,15 @@ if (view) wined3d_rendertarget_view_incref(view); fb->render_targets[view_idx] = view; @@ -4047,7 +4048,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. */ -@@ -3941,6 +4422,7 @@ +@@ -3942,6 +4424,7 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -4055,7 +4056,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; -@@ -3965,6 +4447,79 @@ +@@ -3966,6 +4449,79 @@ { TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n", device, x_hotspot, y_hotspot, cursor_image); @@ -4135,7 +4136,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (cursor_image) { -@@ -4000,8 +4555,16 @@ +@@ -4001,8 +4557,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. */ @@ -4152,7 +4153,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; -@@ -4101,6 +4664,12 @@ +@@ -4102,6 +4666,12 @@ else SetCursor(NULL); } @@ -4165,7 +4166,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return oldVisible; } -@@ -4111,8 +4680,10 @@ +@@ -4112,8 +4682,10 @@ TRACE("device %p.\n", device); @@ -4176,7 +4177,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); -@@ -4120,6 +4691,7 @@ +@@ -4121,6 +4693,7 @@ if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) { TRACE("Evicting %p.\n", resource); @@ -4184,7 +4185,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_evict_resource(device->cs, resource); } } -@@ -4140,6 +4712,37 @@ +@@ -4141,6 +4714,37 @@ gl_info = context->gl_info; wine_rb_clear(&device->samplers, device_free_sampler, NULL); @@ -4222,7 +4223,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->depth_blt_texture) { -@@ -4160,6 +4763,7 @@ +@@ -4161,6 +4765,7 @@ HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -4230,7 +4231,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c swapchain->num_contexts = 0; } -@@ -4179,6 +4783,14 @@ +@@ -4180,6 +4785,14 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { @@ -4245,7 +4246,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, -@@ -4195,6 +4807,7 @@ +@@ -4196,6 +4809,7 @@ return hr; } @@ -4253,7 +4254,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)) { -@@ -4205,6 +4818,34 @@ +@@ -4206,6 +4820,34 @@ } wined3d_cs_emit_create_dummy_textures(device->cs); @@ -4288,7 +4289,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4224,8 +4865,10 @@ +@@ -4225,8 +4867,10 @@ unsigned int i; TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback); @@ -4299,7 +4300,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { -@@ -4241,9 +4884,21 @@ +@@ -4242,9 +4886,21 @@ wined3d_texture_decref(device->logo_texture); device->logo_texture = NULL; } @@ -4321,7 +4322,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4252,6 +4907,7 @@ +@@ -4253,6 +4909,7 @@ } wined3d_device_set_depth_stencil_view(device, NULL); @@ -4329,7 +4330,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (reset_state) { state_unbind_resources(&device->state); -@@ -4261,6 +4917,12 @@ +@@ -4262,6 +4919,12 @@ { wined3d_surface_decref(device->cs->onscreen_depth_stencil); device->cs->onscreen_depth_stencil = NULL; @@ -4342,7 +4343,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4273,6 +4935,7 @@ +@@ -4274,6 +4937,7 @@ } } @@ -4350,7 +4351,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 -@@ -4294,6 +4957,7 @@ +@@ -4295,6 +4959,7 @@ } device->cs->ops->finish(device->cs); @@ -4358,7 +4359,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. * -@@ -4429,6 +5093,13 @@ +@@ -4430,6 +5095,13 @@ } } @@ -4372,7 +4373,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; -@@ -4466,6 +5137,13 @@ +@@ -4467,6 +5139,13 @@ wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); } @@ -4386,7 +4387,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))) -@@ -4548,12 +5226,20 @@ +@@ -4549,12 +5228,20 @@ } wined3d_cs_emit_reset_state(device->cs); state_cleanup(&device->state); @@ -4407,7 +4408,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; -@@ -4562,6 +5248,7 @@ +@@ -4563,6 +5250,7 @@ } else if (device->back_buffer_view) { @@ -4415,7 +4416,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); -@@ -4577,6 +5264,24 @@ +@@ -4578,6 +5266,24 @@ state->scissor_rect.left = 0; state->scissor_rect.right = swapchain->desc.backbuffer_width; state->scissor_rect.bottom = swapchain->desc.backbuffer_height; @@ -4440,7 +4441,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4655,6 +5360,10 @@ +@@ -4656,6 +5362,10 @@ TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); @@ -4451,7 +4452,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c switch (type) { case WINED3D_RTYPE_SURFACE: -@@ -4665,6 +5374,7 @@ +@@ -4666,6 +5376,7 @@ for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -4459,7 +4460,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); -@@ -4676,6 +5386,19 @@ +@@ -4677,6 +5388,19 @@ { ERR("Surface %p is still in use as depth/stencil buffer.\n", surface); device->state.fb.depth_stencil = NULL; @@ -4479,7 +4480,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } } break; -@@ -4838,7 +5561,11 @@ +@@ -4839,7 +5563,11 @@ device->blitter = adapter->blitter; @@ -4491,7 +4492,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); -@@ -4937,6 +5664,7 @@ +@@ -4938,6 +5666,7 @@ else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -4499,7 +4500,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, -@@ -4990,3 +5718,4 @@ +@@ -4991,3 +5720,4 @@ wined3d_device_destroy_bo(device, context, bo); } @@ -5907,7 +5908,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (color_key) { switch (flags & ~WINED3D_CKEY_COLORSPACE) -@@ -687,10 +719,14 @@ +@@ -700,10 +732,14 @@ } if (device->d3d_initialized) @@ -5922,7 +5923,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c texture->resource.format = format; texture->resource.multisample_type = multisample_type; -@@ -798,6 +834,7 @@ +@@ -811,6 +847,7 @@ static void texture2d_sub_resource_load(struct wined3d_resource *sub_resource, struct wined3d_context *context, BOOL srgb) { @@ -5930,7 +5931,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c surface_load(surface_from_resource(sub_resource), context, srgb); } -@@ -812,6 +849,19 @@ +@@ -825,6 +862,19 @@ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); context_release(context); wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); @@ -5950,7 +5951,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource) -@@ -823,12 +873,25 @@ +@@ -836,12 +886,25 @@ static void texture2d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) { @@ -5976,7 +5977,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, -@@ -907,6 +970,7 @@ +@@ -920,6 +983,7 @@ if (gl_info->supported[APPLE_CLIENT_STORAGE]) { @@ -5984,7 +5985,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (surface->flags & (SFLAG_NONPOW2) || texture->flags & WINED3D_TEXTURE_CONVERTED) { -@@ -915,12 +979,26 @@ +@@ -928,12 +992,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 */ @@ -6011,7 +6012,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c surface->flags |= SFLAG_CLIENT; mem = surface->resource.heap_memory; -@@ -990,6 +1068,7 @@ +@@ -1003,6 +1081,7 @@ wined3d_texture_unload_gl_texture(texture); } @@ -6019,7 +6020,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"); -@@ -1009,6 +1088,13 @@ +@@ -1022,6 +1101,13 @@ wined3d_texture_unload, wined3d_texture_load_location_invalidated, wined3d_texture_load_location, @@ -6033,7 +6034,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, -@@ -1025,6 +1111,7 @@ +@@ -1038,6 +1124,7 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6041,7 +6042,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1033,6 +1120,14 @@ +@@ -1046,6 +1133,14 @@ { WARN("(%p) : Tried to create not supported cube texture.\n", texture); HeapFree(GetProcessHeap(), 0, texture); @@ -6056,7 +6057,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1042,6 +1137,7 @@ +@@ -1055,6 +1150,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); @@ -6064,7 +6065,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1050,6 +1146,14 @@ +@@ -1063,6 +1159,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6079,7 +6080,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1070,7 +1174,9 @@ +@@ -1083,7 +1187,9 @@ else { WARN("Attempted to create a NPOT cube texture (edge length %u) without GL support.\n", desc->width); @@ -6089,7 +6090,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1080,7 +1186,9 @@ +@@ -1093,7 +1199,9 @@ surface_flags, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x\n", hr); @@ -6099,7 +6100,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1143,7 +1251,9 @@ +@@ -1156,7 +1264,9 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6109,7 +6110,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1174,7 +1284,9 @@ +@@ -1187,7 +1297,9 @@ else { WARN("Attempted to create a mipmapped NPOT texture without unconditional NPOT support.\n"); @@ -6119,7 +6120,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1187,6 +1299,7 @@ +@@ -1200,6 +1312,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n"); @@ -6127,7 +6128,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1195,6 +1308,14 @@ +@@ -1208,6 +1321,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6142,7 +6143,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1203,7 +1324,9 @@ +@@ -1216,7 +1337,9 @@ surface_flags, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6152,7 +6153,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1295,12 +1418,25 @@ +@@ -1308,12 +1431,25 @@ static void texture3d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) { @@ -6178,7 +6179,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, -@@ -1335,7 +1471,11 @@ +@@ -1348,7 +1484,11 @@ void *mem = NULL; if (gl_info->supported[APPLE_CLIENT_STORAGE] && !format->convert @@ -6190,7 +6191,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); -@@ -1382,6 +1522,7 @@ +@@ -1395,6 +1535,7 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6198,7 +6199,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1390,6 +1531,14 @@ +@@ -1403,6 +1544,14 @@ { WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture); HeapFree(GetProcessHeap(), 0, texture); @@ -6213,7 +6214,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1399,6 +1548,7 @@ +@@ -1412,6 +1561,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); @@ -6221,7 +6222,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1407,6 +1557,14 @@ +@@ -1420,6 +1570,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6236,7 +6237,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1434,7 +1592,9 @@ +@@ -1447,7 +1605,9 @@ { WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n", desc->width, desc->height, desc->depth); @@ -6246,7 +6247,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1444,7 +1604,9 @@ +@@ -1457,7 +1617,9 @@ 0, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6256,7 +6257,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1521,6 +1683,9 @@ +@@ -1534,6 +1696,9 @@ if (FAILED(hr)) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -7035,7 +7036,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; valid_location = WINED3D_LOCATION_USER_MEMORY; -@@ -2044,11 +2473,19 @@ +@@ -2050,11 +2479,19 @@ if (!valid_location) { @@ -7055,7 +7056,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -2407,6 +2844,7 @@ +@@ -2413,6 +2850,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) { @@ -7063,7 +7064,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void *dst_data = NULL, *src_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const struct d3dfmt_converter_desc *conv; -@@ -2415,6 +2853,13 @@ +@@ -2421,6 +2859,13 @@ struct wined3d_surface *dst; struct wined3d_context *context = NULL; struct wined3d_device *device = source->resource.device; @@ -7077,7 +7078,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conv = find_converter(source->resource.format->id, to_fmt); if (!conv) -@@ -2438,6 +2883,7 @@ +@@ -2444,6 +2889,7 @@ } dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); @@ -7085,7 +7086,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_get_pitch(&source->resource, &src_row_pitch, &src_slice_pitch); wined3d_resource_get_pitch(&ret->resource, &dst_row_pitch, &dst_slice_pitch); -@@ -2478,6 +2924,32 @@ +@@ -2484,6 +2930,32 @@ if (context) context_release(context); return NULL; @@ -7118,7 +7119,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height, -@@ -2545,6 +3017,7 @@ +@@ -2551,6 +3023,7 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -7126,7 +7127,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p.\n", surface); -@@ -2562,6 +3035,39 @@ +@@ -2568,6 +3041,39 @@ { struct wined3d_box box; const struct wined3d_format *format = surface->resource.format; @@ -7166,7 +7167,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((format->flags & WINED3DFMT_FLAG_BLOCKS) && rect && !surface_check_block_align(surface, rect)) -@@ -2573,6 +3079,13 @@ +@@ -2579,6 +3085,13 @@ return WINED3DERR_INVALIDCALL; } @@ -7180,7 +7181,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Performance optimization: Count how often a surface is mapped, if it is * mapped regularly do not throw away the system memory copy. This avoids * the need to download the surface from OpenGL all the time. The surface -@@ -2588,6 +3101,7 @@ +@@ -2594,6 +3107,7 @@ } } @@ -7188,7 +7189,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (rect) { surface->lockedRect = *rect; -@@ -2652,22 +3166,121 @@ +@@ -2658,22 +3172,121 @@ WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->resource.format->id)); return WINED3DERR_INVALIDCALL; } @@ -7323,7 +7324,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) -@@ -2693,6 +3306,35 @@ +@@ -2699,6 +3312,35 @@ if (context) context_release(context); } @@ -7359,7 +7360,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -@@ -2712,6 +3354,7 @@ +@@ -2718,6 +3360,7 @@ surface->resource.map_count--; surface->flags &= ~SFLAG_DCINUSE; @@ -7367,7 +7368,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); return WINED3D_OK; -@@ -2724,6 +3367,31 @@ +@@ -2730,6 +3373,31 @@ const struct wined3d_gl_info *gl_info; struct wined3d_context *context; struct wined3d_surface *restore_rt; @@ -7399,7 +7400,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BYTE *mem; BYTE *row, *top, *bottom; int i; -@@ -2731,6 +3399,7 @@ +@@ -2737,6 +3405,7 @@ struct wined3d_bo_address data; UINT row_pitch, slice_pitch; @@ -7407,7 +7408,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_get_memory(&surface->resource, dst_location, &data); /* Context_release does not restore the original context in case of -@@ -2748,6 +3417,11 @@ +@@ -2754,6 +3423,11 @@ context = context_acquire(device, surface); } @@ -7419,7 +7420,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context_apply_blit_state(context, device); gl_info = context->gl_info; -@@ -2836,12 +3510,16 @@ +@@ -2842,12 +3516,16 @@ checkGLcall("glBindBuffer"); } @@ -7436,7 +7437,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Read the framebuffer contents into a texture. Note that this function -@@ -2901,6 +3579,85 @@ +@@ -2907,6 +3585,85 @@ } } @@ -7522,7 +7523,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Does a direct frame buffer -> texture copy. Stretching is done with single * pixel copy calls. */ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, -@@ -3007,8 +3764,13 @@ +@@ -3013,8 +3770,13 @@ /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ @@ -7536,7 +7537,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Uses the hardware to stretch and flip the image */ -@@ -3076,7 +3838,11 @@ +@@ -3082,7 +3844,11 @@ checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -7548,7 +7549,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3273,6 +4039,7 @@ +@@ -3279,6 +4045,7 @@ checkGLcall("glDeleteTextures(1, &backup)"); } @@ -7556,7 +7557,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering) -@@ -3284,6 +4051,17 @@ +@@ -3290,6 +4057,17 @@ * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -7574,7 +7575,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3314,6 +4092,7 @@ +@@ -3320,6 +4098,7 @@ rect->bottom = drawable_height - rect->bottom; } @@ -7582,7 +7583,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Context activation is done by the caller. */ static void surface_blt_to_drawable(const struct wined3d_device *device, struct wined3d_context *old_ctx, -@@ -3348,6 +4127,26 @@ +@@ -3354,6 +4133,26 @@ /* Make sure the surface is up-to-date. This should probably use * wined3d_resource_load_location() and worry about the destination * surface too, unless we're overwriting it completely. */ @@ -7609,7 +7610,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_load(src_surface->container, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -3390,6 +4189,7 @@ +@@ -3396,6 +4195,7 @@ /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -7617,7 +7618,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering -@@ -3403,6 +4203,14 @@ +@@ -3409,6 +4209,14 @@ context = context_acquire(device, restore_rt); context_release(context); } @@ -7632,7 +7633,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) -@@ -3426,9 +4234,15 @@ +@@ -3432,9 +4240,15 @@ enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -7648,7 +7649,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, blt_fx %p, filter %s.\n", dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), -@@ -3553,7 +4367,9 @@ +@@ -3559,7 +4373,9 @@ /* Blit from offscreen surface to render target */ struct wined3d_color_key old_blt_key = src_surface->container->src_blt_color_key; DWORD old_color_key_flags = src_surface->container->color_key_flags; @@ -7658,7 +7659,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); -@@ -3587,6 +4403,7 @@ +@@ -3593,6 +4409,7 @@ wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, NULL); } @@ -7666,7 +7667,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(device, dst_surface); surface_blt_to_drawable(device, context, filter, flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_ALPHATEST), -@@ -3599,6 +4416,18 @@ +@@ -3605,6 +4422,18 @@ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); @@ -7685,7 +7686,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -3673,6 +4502,7 @@ +@@ -3679,6 +4508,7 @@ { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -7693,7 +7694,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) || (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB))) -@@ -3681,6 +4511,15 @@ +@@ -3687,6 +4517,15 @@ surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; surface->resource.locations = location; @@ -7709,7 +7710,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Context activation is done by the caller. */ -@@ -3695,7 +4534,11 @@ +@@ -3701,7 +4540,11 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -7721,7 +7722,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { w = surface->ds_current_size.cx; h = surface->ds_current_size.cy; -@@ -3721,7 +4564,11 @@ +@@ -3727,7 +4570,11 @@ return; } @@ -7733,7 +7734,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Surface was discarded, no need copy data.\n"); switch (location) -@@ -3738,6 +4585,7 @@ +@@ -3744,6 +4591,7 @@ default: FIXME("Unhandled location %#x\n", location); } @@ -7741,7 +7742,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED; surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; -@@ -3749,6 +4597,19 @@ +@@ -3755,6 +4603,19 @@ { FIXME("No up to date depth stencil location.\n"); surface->resource.locations |= location; @@ -7761,7 +7762,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; return; -@@ -3813,9 +4674,13 @@ +@@ -3819,9 +4680,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7775,7 +7776,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else if (location == WINED3D_LOCATION_DRAWABLE) -@@ -3831,9 +4696,13 @@ +@@ -3837,9 +4702,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7789,7 +7790,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else -@@ -3841,6 +4710,7 @@ +@@ -3847,6 +4716,7 @@ ERR("Invalid location (%#x) specified.\n", location); } @@ -7797,7 +7798,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; -@@ -3886,6 +4756,135 @@ +@@ -3892,6 +4762,135 @@ TRACE("Surface was discarded, nothing to do.\n"); return WINED3D_OK; } @@ -7933,7 +7934,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && wined3d_resource_is_offscreen(&surface->container->resource)) -@@ -3895,6 +4894,7 @@ +@@ -3901,6 +4900,7 @@ } surface_get_rect(surface, NULL, &r); @@ -7941,7 +7942,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -3963,6 +4963,66 @@ +@@ -3969,6 +4969,66 @@ RECT rect = {0, 0, surface->resource.width, surface->resource.height}; surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, @@ -8008,7 +8009,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c &rect, surface, dst_location, &rect); return WINED3D_OK; -@@ -3972,6 +5032,7 @@ +@@ -3978,6 +5038,7 @@ if (srgb) { @@ -8016,7 +8017,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) == WINED3D_LOCATION_TEXTURE_RGB) { -@@ -4000,6 +5061,39 @@ +@@ -4006,6 +5067,39 @@ wined3d_resource_prepare_system_memory(&surface->resource); wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); } @@ -8056,7 +8057,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_prepare_texture(texture, context, srgb); wined3d_texture_bind_and_dirtify(texture, context, srgb); -@@ -4014,7 +5108,11 @@ +@@ -4020,7 +5114,11 @@ /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ @@ -8068,7 +8069,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -4023,6 +5121,7 @@ +@@ -4029,6 +5127,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -8076,7 +8077,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_prepare_map_memory(&surface->resource, context); wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_free_bo(&surface->resource); -@@ -4030,6 +5129,14 @@ +@@ -4036,6 +5135,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -8091,7 +8092,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -4076,6 +5183,7 @@ +@@ -4082,6 +5189,7 @@ wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); @@ -8099,7 +8100,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HeapFree(GetProcessHeap(), 0, mem); return WINED3D_OK; -@@ -4099,6 +5207,31 @@ +@@ -4105,6 +5213,31 @@ struct wined3d_context *context, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); @@ -8131,7 +8132,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4106,6 +5239,7 @@ +@@ -4112,6 +5245,7 @@ if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -8139,7 +8140,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) { surface_load_ds_location(surface, context, location); -@@ -4125,11 +5259,53 @@ +@@ -4131,11 +5265,53 @@ } } @@ -8195,7 +8196,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -4138,6 +5314,7 @@ +@@ -4144,6 +5320,7 @@ case WINED3D_LOCATION_USER_MEMORY: case WINED3D_LOCATION_SYSMEM: case WINED3D_LOCATION_BUFFER: @@ -8203,7 +8204,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_load_sysmem(surface, context, location); break; -@@ -4155,6 +5332,24 @@ +@@ -4161,6 +5338,24 @@ if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) return; @@ -8228,7 +8229,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -4162,12 +5357,21 @@ +@@ -4168,12 +5363,21 @@ break; } @@ -8250,7 +8251,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; } -@@ -4261,6 +5465,7 @@ +@@ -4267,6 +5471,7 @@ const RECT *dst_rect, const struct wined3d_color *color) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8258,7 +8259,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_rendertarget_view view, *view_ptr = &view; struct wined3d_fb_state fb = {&view_ptr, NULL, 1}; struct wined3d_texture *texture = dst_surface->container; -@@ -4281,6 +5486,21 @@ +@@ -4287,6 +5492,21 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); @@ -8280,7 +8281,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4289,6 +5509,7 @@ +@@ -4295,6 +5515,7 @@ const RECT *dst_rect, float depth) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8288,7 +8289,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_rendertarget_view view; struct wined3d_fb_state fb = {NULL, &view}; struct wined3d_texture *texture = dst_surface->container; -@@ -4304,6 +5525,20 @@ +@@ -4310,6 +5531,20 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); @@ -8309,7 +8310,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4461,6 +5696,7 @@ +@@ -4467,6 +5702,7 @@ int bpp, srcheight, srcwidth, dstheight, dstwidth, width; const struct wined3d_format *src_format, *dst_format; struct wined3d_texture *src_texture = NULL; @@ -8317,7 +8318,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void *src_data = NULL, *dst_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const BYTE *sbase = NULL; -@@ -4491,6 +5727,23 @@ +@@ -4497,6 +5733,23 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -8341,7 +8342,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = dst_surface->resource.format; dst_format = src_format; } -@@ -4499,12 +5752,14 @@ +@@ -4505,12 +5758,14 @@ dst_format = dst_surface->resource.format; if (src_surface) { @@ -8356,7 +8357,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (dst_surface->resource.format->id != src_surface->resource.format->id) { if (!(src_texture = surface_convert_format(src_surface, dst_format->id))) -@@ -4515,9 +5770,13 @@ +@@ -4521,9 +5776,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -8370,7 +8371,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = src_surface->resource.format; } else -@@ -4525,8 +5784,12 @@ +@@ -4531,8 +5790,12 @@ src_format = dst_format; } @@ -8383,7 +8384,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_surface->resource.format->byte_count; -@@ -4537,12 +5800,24 @@ +@@ -4543,12 +5806,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -8408,7 +8409,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_format->flags & dst_format->flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4577,7 +5852,11 @@ +@@ -4583,7 +5858,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -8420,7 +8421,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format, flags, fx); goto release; } -@@ -4585,7 +5864,11 @@ +@@ -4591,7 +5870,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -8432,7 +8433,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c flags &= ~WINEDDBLT_COLORFILL; } -@@ -4599,12 +5882,21 @@ +@@ -4605,12 +5888,21 @@ switch (fx->dwROP) { case BLACKNESS: @@ -8454,7 +8455,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; case SRCCOPY: /* Well, we do that below? */ break; -@@ -4655,6 +5947,7 @@ +@@ -4661,6 +5953,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -8462,7 +8463,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4668,6 +5961,21 @@ +@@ -4674,6 +5967,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -8484,7 +8485,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c memcpy(dbuf, sbuf, width); } } -@@ -4677,8 +5985,13 @@ +@@ -4683,8 +5991,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -8498,7 +8499,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4687,9 +6000,15 @@ +@@ -4693,9 +6006,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8514,7 +8515,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4699,6 +6018,7 @@ +@@ -4705,6 +6024,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8522,7 +8523,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf = sbase + (sy >> 16) * src_row_pitch; if ((sy >> 16) == (last_sy >> 16)) -@@ -4706,6 +6026,15 @@ +@@ -4712,6 +6032,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -8538,7 +8539,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4752,6 +6081,7 @@ +@@ -4758,6 +6087,7 @@ } #undef STRETCH_ROW } @@ -8546,7 +8547,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dbuf += dst_row_pitch; last_sy = sy; } -@@ -4760,6 +6090,16 @@ +@@ -4766,6 +6096,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -8563,7 +8564,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff; DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff; if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE)) -@@ -4809,7 +6149,11 @@ +@@ -4815,7 +6155,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -8575,7 +8576,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4886,6 +6230,7 @@ +@@ -4892,6 +6236,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -8583,7 +8584,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4907,6 +6252,29 @@ +@@ -4913,6 +6258,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -8613,7 +8614,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c switch (bpp) { -@@ -4925,7 +6293,11 @@ +@@ -4931,7 +6299,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8625,7 +8626,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4956,10 +6328,12 @@ +@@ -4962,10 +6334,12 @@ } } @@ -8638,7 +8639,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4967,6 +6341,7 @@ +@@ -4973,6 +6347,7 @@ } release: @@ -8646,7 +8647,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (dst_data) { wined3d_resource_release_map_ptr(&dst_surface->resource, context); -@@ -4985,6 +6360,14 @@ +@@ -4991,6 +6366,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -8661,7 +8662,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -5019,6 +6402,7 @@ +@@ -5025,6 +6408,7 @@ cpu_blit_depth_fill, }; @@ -8669,7 +8670,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) -@@ -5026,6 +6410,16 @@ +@@ -5032,6 +6416,16 @@ struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_device *device = dst_surface->resource.device; DWORD src_ds_flags, dst_ds_flags; @@ -8686,7 +8687,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -5034,6 +6428,106 @@ +@@ -5040,6 +6434,106 @@ | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -8793,7 +8794,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5076,8 +6570,13 @@ +@@ -5082,8 +6576,13 @@ } scale = src_surface @@ -8807,7 +8808,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; dst_ds_flags = dst_surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); -@@ -5095,6 +6594,7 @@ +@@ -5101,6 +6600,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -8815,7 +8816,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) -@@ -5113,6 +6613,32 @@ +@@ -5119,6 +6619,32 @@ * implement those in the CPU blitter at the moment. */ if ((dst_surface->resource.locations & dst_surface->resource.map_binding) && (!src_surface || (src_surface->resource.locations & src_surface->resource.map_binding))) @@ -8848,7 +8849,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5131,6 +6657,7 @@ +@@ -5137,6 +6663,7 @@ if (!surface_convert_color_to_float(dst_surface, fx->u5.dwFillColor, &color)) goto fallback; @@ -8856,7 +8857,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) return; } -@@ -5141,6 +6668,18 @@ +@@ -5147,6 +6674,18 @@ /* Upload */ if ((src_surface->resource.locations & WINED3D_LOCATION_SYSMEM) && !(dst_surface->resource.locations & WINED3D_LOCATION_SYSMEM)) @@ -8875,7 +8876,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing upload because of scaling.\n"); -@@ -5148,6 +6687,7 @@ +@@ -5154,6 +6693,7 @@ TRACE("Not doing upload because of format conversion.\n"); else { @@ -8883,7 +8884,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c POINT dst_point = {dst_rect->left, dst_rect->top}; if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect))) -@@ -5160,6 +6700,15 @@ +@@ -5166,6 +6706,15 @@ context_release(context); } return; @@ -8899,7 +8900,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -5184,6 +6733,7 @@ +@@ -5190,6 +6739,7 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -8907,7 +8908,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; } -@@ -5380,6 +6930,50 @@ +@@ -5386,6 +6936,50 @@ wined3d_surface_location_invalidated, wined3d_surface_load_location, }; @@ -8958,7 +8959,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) -@@ -5447,7 +7041,11 @@ +@@ -5453,7 +7047,11 @@ } surface->container = container; @@ -8970,7 +8971,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5479,9 +7077,14 @@ +@@ -5485,9 +7083,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -8985,7 +8986,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } return hr; -@@ -5508,7 +7111,11 @@ +@@ -5514,7 +7117,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr);