From a139cd10bd17cb5a336b38bf1c0974b53e73d620 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 22 Apr 2015 23:35:24 +0200 Subject: [PATCH] Removed patch for stub of ntdll.WinSqmIsOptedIn (fixed upstream). --- README.md | 2 +- debian/changelog | 1 + ...TpSimpleTryPost-and-basic-threadpool.patch | 8 +- ...ement-TpSetPool-Min-Max-Threads.-v2.patch} | 8 +- ...ement-threadpool-work-item-functions.patch | 12 +- ...ing-threadpool-functions-to-specfile.patch | 8 +- ...ll-Implement-threadpool-wait-objects.patch | 14 +- ...for-WinSqmStartSession-WinSqmEndSess.patch | 83 ++-- ...2-ntdll-Add-stub-for-WinSqmIsOptedIn.patch | 74 ---- patches/ntdll-WinSqm/definition | 1 - patches/patchinstall.sh | 7 +- ...01-wined3d-Merge-get_pitch-functions.patch | 58 +-- ...s-a-context-to-surface_load_location.patch | 62 +-- ...-surface-locations-into-the-resource.patch | 78 ++-- ...e-helper-functions-for-mapping-volum.patch | 16 +- ...urce-buffer-mapping-facilities-in-su.patch | 26 +- ...e-a-function-to-retrieve-resource-me.patch | 26 +- ...face_ops-unmap-specific-for-front-bu.patch | 18 +- ...Move-check_block_align-to-resource.c.patch | 26 +- ...ove-most-of-volume_map-to-resource.c.patch | 25 +- ...d3d-Use-resource_map-for-surface_map.patch | 27 +- ...ll-the-public-map-function-in-surfac.patch | 52 +-- ...e-the-framebuffer-into-wined3d_state.patch | 40 +- ...end-blits-through-the-command-stream.patch | 40 +- .../wined3d-CSMT_Main/9999-IfDefined.patch | 411 +++++++++--------- 25 files changed, 535 insertions(+), 588 deletions(-) rename patches/ntdll-Vista_Threadpool/{0002-ntdll-Implement-TpSetPool-Min-Max-Threads.patch => 0002-ntdll-Implement-TpSetPool-Min-Max-Threads.-v2.patch} (92%) delete mode 100644 patches/ntdll-WinSqm/0002-ntdll-Add-stub-for-WinSqmIsOptedIn.patch diff --git a/README.md b/README.md index e5f60f7e..eb45e858 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ for more details.* * Add stub for D3DXComputeTangentFrameEx ([Wine Bug #31984](https://bugs.winehq.org/show_bug.cgi?id=31984)) * Add stub for D3DXIntersect * Add stub for NtSetLdtEntries/ZwSetLdtEntries ([Wine Bug #26268](https://bugs.winehq.org/show_bug.cgi?id=26268)) -* Add stub for WinSqmIsOptedIn ([Wine Bug #38388](https://bugs.winehq.org/show_bug.cgi?id=38388)) +* ~~Add stub for WinSqmIsOptedIn~~ ([Wine Bug #38388](https://bugs.winehq.org/show_bug.cgi?id=38388)) * Add stub for gdiplus.GdipCreateEffect ([Wine Bug #32163](https://bugs.winehq.org/show_bug.cgi?id=32163)) * Add stub for ntoskrnl.ExAcquireResourceExclusiveLite * Add stub for ntoskrnl.ExDeleteResourceLite diff --git a/debian/changelog b/debian/changelog index 0b93d367..839c7c77 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ wine-staging (1.7.42) UNRELEASED; urgency=low * Removed patch to avoid crash when trying to bind mshtml event scripts to window (fixed upstream). + * Removed patch for stub of ntdll.WinSqmIsOptedIn (fixed upstream). -- Sebastian Lackner Mon, 20 Apr 2015 15:55:51 +0200 wine-staging (1.7.41) unstable; urgency=low diff --git a/patches/ntdll-Vista_Threadpool/0001-ntdll-Implement-TpSimpleTryPost-and-basic-threadpool.patch b/patches/ntdll-Vista_Threadpool/0001-ntdll-Implement-TpSimpleTryPost-and-basic-threadpool.patch index b3f635f6..15d78f2d 100644 --- a/patches/ntdll-Vista_Threadpool/0001-ntdll-Implement-TpSimpleTryPost-and-basic-threadpool.patch +++ b/patches/ntdll-Vista_Threadpool/0001-ntdll-Implement-TpSimpleTryPost-and-basic-threadpool.patch @@ -1,4 +1,4 @@ -From 05e4482c93eec3e57ca2c6d83357c85b240494b2 Mon Sep 17 00:00:00 2001 +From f8c57c8ed3616f53bbed2d794f1e858ea5051f22 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Tue, 24 Feb 2015 05:42:07 +0100 Subject: ntdll: Implement TpSimpleTryPost and basic threadpool infrastructure. @@ -10,7 +10,7 @@ Subject: ntdll: Implement TpSimpleTryPost and basic threadpool infrastructure. 3 files changed, 375 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index c3307b2..d9aafdd 100644 +index 28165ef..cd6b97c 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -968,6 +968,9 @@ @@ -21,8 +21,8 @@ index c3307b2..d9aafdd 100644 +@ stdcall TpReleasePool(ptr) +@ stdcall TpSimpleTryPost(ptr ptr ptr) @ stdcall -ret64 VerSetConditionMask(int64 long long) + @ stdcall WinSqmIsOptedIn() @ stdcall ZwAcceptConnectPort(ptr long ptr long long ptr) NtAcceptConnectPort - @ stdcall ZwAccessCheck(ptr long long ptr ptr ptr ptr ptr) NtAccessCheck diff --git a/dlls/ntdll/tests/threadpool.c b/dlls/ntdll/tests/threadpool.c index 2e31b34..6f164e9 100644 --- a/dlls/ntdll/tests/threadpool.c @@ -444,5 +444,5 @@ index 513c13d..cc5f8e9 100644 + return STATUS_SUCCESS; +} -- -2.3.3 +2.3.5 diff --git a/patches/ntdll-Vista_Threadpool/0002-ntdll-Implement-TpSetPool-Min-Max-Threads.patch b/patches/ntdll-Vista_Threadpool/0002-ntdll-Implement-TpSetPool-Min-Max-Threads.-v2.patch similarity index 92% rename from patches/ntdll-Vista_Threadpool/0002-ntdll-Implement-TpSetPool-Min-Max-Threads.patch rename to patches/ntdll-Vista_Threadpool/0002-ntdll-Implement-TpSetPool-Min-Max-Threads.-v2.patch index cc4d0b34..c7908b68 100644 --- a/patches/ntdll-Vista_Threadpool/0002-ntdll-Implement-TpSetPool-Min-Max-Threads.patch +++ b/patches/ntdll-Vista_Threadpool/0002-ntdll-Implement-TpSetPool-Min-Max-Threads.-v2.patch @@ -1,4 +1,4 @@ -From 0fe9a4e96bdb45ca76e7abf0b73a69d24e1a3ce2 Mon Sep 17 00:00:00 2001 +From c362c574aa6611f80c6965ea66cbfab33e421d0f Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 4 Mar 2015 00:16:20 +0100 Subject: ntdll: Implement TpSetPool[Min|Max]Threads. (v2) @@ -9,7 +9,7 @@ Subject: ntdll: Implement TpSetPool[Min|Max]Threads. (v2) 2 files changed, 37 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index d9aafdd..88d915b 100644 +index cd6b97c..f755286 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -970,6 +970,8 @@ @@ -20,7 +20,7 @@ index d9aafdd..88d915b 100644 +@ stdcall TpSetPoolMinThreads(ptr long) @ stdcall TpSimpleTryPost(ptr ptr ptr) @ stdcall -ret64 VerSetConditionMask(int64 long long) - @ stdcall ZwAcceptConnectPort(ptr long ptr long long ptr) NtAcceptConnectPort + @ stdcall WinSqmIsOptedIn() diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c index cc5f8e9..cb2dcdd 100644 --- a/dlls/ntdll/threadpool.c @@ -68,5 +68,5 @@ index cc5f8e9..cb2dcdd 100644 */ NTSTATUS WINAPI TpSimpleTryPost( PTP_SIMPLE_CALLBACK callback, PVOID userdata, -- -2.3.3 +2.3.5 diff --git a/patches/ntdll-Vista_Threadpool/0005-ntdll-Implement-threadpool-work-item-functions.patch b/patches/ntdll-Vista_Threadpool/0005-ntdll-Implement-threadpool-work-item-functions.patch index 985952c1..35f39d65 100644 --- a/patches/ntdll-Vista_Threadpool/0005-ntdll-Implement-threadpool-work-item-functions.patch +++ b/patches/ntdll-Vista_Threadpool/0005-ntdll-Implement-threadpool-work-item-functions.patch @@ -1,4 +1,4 @@ -From 4814babb31750124d8d2d600a5894634fefe28f7 Mon Sep 17 00:00:00 2001 +From 20e50fe1839e89ef32df751130d5fc7b20ea095a Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 4 Mar 2015 01:30:57 +0100 Subject: ntdll: Implement threadpool work item functions. @@ -9,7 +9,7 @@ Subject: ntdll: Implement threadpool work item functions. 2 files changed, 97 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index 853ca09..96edd67 100644 +index 7c01d43..2180ea9 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -970,12 +970,16 @@ @@ -27,10 +27,10 @@ index 853ca09..96edd67 100644 @ stdcall TpSimpleTryPost(ptr ptr ptr) +@ stdcall TpWaitForWork(ptr long) @ stdcall -ret64 VerSetConditionMask(int64 long long) + @ stdcall WinSqmIsOptedIn() @ stdcall ZwAcceptConnectPort(ptr long ptr long long ptr) NtAcceptConnectPort - @ stdcall ZwAccessCheck(ptr long long ptr ptr ptr ptr ptr) NtAccessCheck diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c -index 10ce6fd..01308d6 100644 +index 9e0efee..e6bb626 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -156,7 +156,8 @@ struct threadpool @@ -153,7 +153,7 @@ index 10ce6fd..01308d6 100644 * TpSetPoolMaxThreads (NTDLL.@) */ VOID WINAPI TpSetPoolMaxThreads( TP_POOL *pool, DWORD maximum ) -@@ -1696,3 +1772,19 @@ NTSTATUS WINAPI TpSimpleTryPost( PTP_SIMPLE_CALLBACK callback, PVOID userdata, +@@ -1698,3 +1774,19 @@ NTSTATUS WINAPI TpSimpleTryPost( PTP_SIMPLE_CALLBACK callback, PVOID userdata, return STATUS_SUCCESS; } @@ -174,5 +174,5 @@ index 10ce6fd..01308d6 100644 + } +} -- -2.3.3 +2.3.5 diff --git a/patches/ntdll-Vista_Threadpool/0014-ntdll-Add-remaining-threadpool-functions-to-specfile.patch b/patches/ntdll-Vista_Threadpool/0014-ntdll-Add-remaining-threadpool-functions-to-specfile.patch index eb8b019f..f4110e6d 100644 --- a/patches/ntdll-Vista_Threadpool/0014-ntdll-Add-remaining-threadpool-functions-to-specfile.patch +++ b/patches/ntdll-Vista_Threadpool/0014-ntdll-Add-remaining-threadpool-functions-to-specfile.patch @@ -1,4 +1,4 @@ -From ac6e2e281ba4f0b6cb9643ed288aaf05fd2710f7 Mon Sep 17 00:00:00 2001 +From 01b8c400e280f1c033878cdc16f902a4c47c82df Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 4 Mar 2015 08:01:00 +0100 Subject: ntdll: Add remaining threadpool functions to specfile. @@ -8,7 +8,7 @@ Subject: ntdll: Add remaining threadpool functions to specfile. 1 file changed, 43 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index 6100a7e..19e63a5 100644 +index c42356c..681c75e 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -968,24 +968,67 @@ @@ -78,7 +78,7 @@ index 6100a7e..19e63a5 100644 +# @ stub TpWaitForWait @ stdcall TpWaitForWork(ptr long) @ stdcall -ret64 VerSetConditionMask(int64 long long) - @ stdcall ZwAcceptConnectPort(ptr long ptr long long ptr) NtAcceptConnectPort + @ stdcall WinSqmIsOptedIn() -- -2.3.3 +2.3.5 diff --git a/patches/ntdll-Vista_Threadpool/0018-ntdll-Implement-threadpool-wait-objects.patch b/patches/ntdll-Vista_Threadpool/0018-ntdll-Implement-threadpool-wait-objects.patch index 0a8687b1..03f9338f 100644 --- a/patches/ntdll-Vista_Threadpool/0018-ntdll-Implement-threadpool-wait-objects.patch +++ b/patches/ntdll-Vista_Threadpool/0018-ntdll-Implement-threadpool-wait-objects.patch @@ -1,4 +1,4 @@ -From 80175d154f0de20f916422684d9ae6708d532743 Mon Sep 17 00:00:00 2001 +From 8e1c71f635b4005958e8f8b3a8b3bd654367f71c Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 4 Mar 2015 13:33:25 +0100 Subject: ntdll: Implement threadpool wait objects. @@ -9,7 +9,7 @@ Subject: ntdll: Implement threadpool wait objects. 2 files changed, 469 insertions(+), 11 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index 7aa8bda..7c15f76 100644 +index 21f39de..9093eb8 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -975,7 +975,7 @@ @@ -47,9 +47,9 @@ index 7aa8bda..7c15f76 100644 +@ stdcall TpWaitForWait(ptr long) @ stdcall TpWaitForWork(ptr long) @ stdcall -ret64 VerSetConditionMask(int64 long long) - @ stdcall ZwAcceptConnectPort(ptr long ptr long long ptr) NtAcceptConnectPort + @ stdcall WinSqmIsOptedIn() diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c -index 493e0af..cda5a12 100644 +index a973409..7df8cb1 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -137,6 +137,7 @@ struct timer_queue @@ -635,7 +635,7 @@ index 493e0af..cda5a12 100644 * TpReleaseWork (NTDLL.@) */ VOID WINAPI TpReleaseWork( TP_WORK *work ) -@@ -2424,6 +2853,20 @@ VOID WINAPI TpSetTimer( TP_TIMER *timer, LARGE_INTEGER *timeout, LONG period, LO +@@ -2426,6 +2855,20 @@ VOID WINAPI TpSetTimer( TP_TIMER *timer, LARGE_INTEGER *timeout, LONG period, LO } /*********************************************************************** @@ -656,7 +656,7 @@ index 493e0af..cda5a12 100644 * TpSimpleTryPost (NTDLL.@) */ NTSTATUS WINAPI TpSimpleTryPost( PTP_SIMPLE_CALLBACK callback, PVOID userdata, -@@ -2464,6 +2907,21 @@ VOID WINAPI TpWaitForTimer( TP_TIMER *timer, BOOL cancel_pending ) +@@ -2466,6 +2909,21 @@ VOID WINAPI TpWaitForTimer( TP_TIMER *timer, BOOL cancel_pending ) } /*********************************************************************** @@ -679,5 +679,5 @@ index 493e0af..cda5a12 100644 */ VOID WINAPI TpWaitForWork( TP_WORK *work, BOOL cancel_pending ) -- -2.3.3 +2.3.5 diff --git a/patches/ntdll-WinSqm/0001-ntdll-Add-stubs-for-WinSqmStartSession-WinSqmEndSess.patch b/patches/ntdll-WinSqm/0001-ntdll-Add-stubs-for-WinSqmStartSession-WinSqmEndSess.patch index 366f1d3b..e325cb1d 100644 --- a/patches/ntdll-WinSqm/0001-ntdll-Add-stubs-for-WinSqmStartSession-WinSqmEndSess.patch +++ b/patches/ntdll-WinSqm/0001-ntdll-Add-stubs-for-WinSqmStartSession-WinSqmEndSess.patch @@ -1,35 +1,33 @@ -From ffb4e21271797190bd8c5b6be3054ac2f693be8b Mon Sep 17 00:00:00 2001 +From ff1be4d15b2114de6b785c164ddc27fd6993c6f8 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 25 Dec 2014 12:36:28 -0700 Subject: ntdll: Add stubs for WinSqmStartSession / WinSqmEndSession. Based on a patch by Detlef Riekenberg. --- + dlls/ntdll/misc.c | 20 +++++++++++++++++++ dlls/ntdll/ntdll.spec | 2 ++ - dlls/ntdll/rtl.c | 18 ++++++++++++++++++ - dlls/ntdll/tests/rtl.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 70 insertions(+) + dlls/ntdll/tests/rtl.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 76 insertions(+) -diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index 51de6e7..44dfc22 100644 ---- a/dlls/ntdll/ntdll.spec -+++ b/dlls/ntdll/ntdll.spec -@@ -970,2 +970,4 @@ - @ stdcall -ret64 VerSetConditionMask(int64 long long) -+@ stdcall WinSqmEndSession(ptr) -+@ stdcall WinSqmStartSession(ptr long long) - @ stdcall ZwAcceptConnectPort(ptr long ptr long long ptr) NtAcceptConnectPort -diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c -index 8f6f386..2e87beb 100644 ---- a/dlls/ntdll/rtl.c -+++ b/dlls/ntdll/rtl.c -@@ -1311,3 +1311,21 @@ BOOL WINAPI RtlSetCurrentTransaction(HANDLE new_transaction) - FIXME("(%p) :stub\n", new_transaction); - return FALSE; +diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c +index 2cfa900..7832d37 100644 +--- a/dlls/ntdll/misc.c ++++ b/dlls/ntdll/misc.c +@@ -27,6 +27,8 @@ + #include + #endif + ++#include "ntstatus.h" ++#define WIN32_NO_STATUS + #include "wine/library.h" + #include "wine/debug.h" + #include "ntdll_misc.h" +@@ -328,6 +330,15 @@ void * __cdecl _lfind( const void *key, const void *base, unsigned int *nmemb, } -+ -+/****************************************************************************** -+ * WinSqmEndSession [NTDLL.@] + + /********************************************************************* ++ * WinSqmEndSession (NTDLL.@) + */ +NTSTATUS WINAPI WinSqmEndSession(PVOID unknown1) +{ @@ -37,37 +35,58 @@ index 8f6f386..2e87beb 100644 + return STATUS_NOT_IMPLEMENTED; +} + -+/****************************************************************************** -+ * WinSqmStartSession [NTDLL.@] ++/********************************************************************* + * WinSqmIsOptedIn (NTDLL.@) + */ + BOOL WINAPI WinSqmIsOptedIn(void) +@@ -335,3 +346,12 @@ BOOL WINAPI WinSqmIsOptedIn(void) + FIXME("() stub\n"); + return FALSE; + } ++ ++/********************************************************************* ++ * WinSqmStartSession (NTDLL.@) + */ +PVOID WINAPI WinSqmStartSession(PVOID unknown1, DWORD unknown2, DWORD unknown3) +{ + FIXME("(%p, 0x%x, 0x%x) stub!\n", unknown1, unknown2, unknown3); + return NULL; +} +diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec +index 28165ef..9225898 100644 +--- a/dlls/ntdll/ntdll.spec ++++ b/dlls/ntdll/ntdll.spec +@@ -971,3 +971,5 @@ + @ stdcall -ret64 VerSetConditionMask(int64 long long) ++@ stdcall WinSqmEndSession(ptr) + @ stdcall WinSqmIsOptedIn() ++@ stdcall WinSqmStartSession(ptr long long) + @ stdcall ZwAcceptConnectPort(ptr long ptr long long ptr) NtAcceptConnectPort diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c -index e8eb04a..1e6c6f8 100644 +index e8eb04a..7b5f07d 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c -@@ -62,6 +62,8 @@ static inline USHORT __my_ushort_swap(USHORT s) +@@ -62,6 +62,9 @@ static inline USHORT __my_ushort_swap(USHORT s) /* Function ptrs for ntdll calls */ static HMODULE hntdll = 0; +static PVOID (WINAPI *pWinSqmStartSession)(PVOID unknown1, DWORD unknown2, DWORD unknown3); ++static BOOL (WINAPI *pWinSqmIsOptedIn)(void); +static NTSTATUS (WINAPI *pWinSqmEndSession)(PVOID unknown1); static SIZE_T (WINAPI *pRtlCompareMemory)(LPCVOID,LPCVOID,SIZE_T); static SIZE_T (WINAPI *pRtlCompareMemoryUlong)(PULONG, SIZE_T, ULONG); static NTSTATUS (WINAPI *pRtlDeleteTimer)(HANDLE, HANDLE, HANDLE); -@@ -109,6 +111,8 @@ static void InitFunctionPtrs(void) +@@ -109,6 +112,9 @@ static void InitFunctionPtrs(void) hntdll = LoadLibraryA("ntdll.dll"); ok(hntdll != 0, "LoadLibrary failed\n"); if (hntdll) { + pWinSqmStartSession = (void *)GetProcAddress(hntdll, "WinSqmStartSession"); ++ pWinSqmIsOptedIn = (void *)GetProcAddress(hntdll, "WinSqmIsOptedIn"); + pWinSqmEndSession = (void *)GetProcAddress(hntdll, "WinSqmEndSession"); pRtlCompareMemory = (void *)GetProcAddress(hntdll, "RtlCompareMemory"); pRtlCompareMemoryUlong = (void *)GetProcAddress(hntdll, "RtlCompareMemoryUlong"); pRtlDeleteTimer = (void *)GetProcAddress(hntdll, "RtlDeleteTimer"); -@@ -149,6 +153,46 @@ static void InitFunctionPtrs(void) +@@ -149,6 +155,48 @@ static void InitFunctionPtrs(void) ok(strlen(src) == 15, "Source must be 16 bytes long!\n"); } @@ -104,6 +123,8 @@ index e8eb04a..1e6c6f8 100644 + + args = 3 - call_stdcall_func3( pWinSqmStartSession, NULL, 0, 0 ) / 4; + ok(args == 3, "WinSqmStartSession expected to take %d arguments instead of 3\n", args); ++ args = 3 - call_stdcall_func3( pWinSqmIsOptedIn, NULL, 0, 0 ) / 4; ++ ok(args == 0, "WinSqmIsOptedIn expected to take %d arguments instead of 0\n", args); + args = 3 - call_stdcall_func3( pWinSqmEndSession, NULL, 0, 0 ) / 4; + ok(args == 1, "WinSqmEndSession expected to take %d arguments instead of 1\n", args); + @@ -114,7 +135,7 @@ index e8eb04a..1e6c6f8 100644 #define COMP(str1,str2,cmplen,len) size = pRtlCompareMemory(str1, str2, cmplen); \ ok(size == len, "Expected %ld, got %ld\n", size, (SIZE_T)len) -@@ -1603,6 +1647,12 @@ START_TEST(rtl) +@@ -1603,6 +1651,12 @@ START_TEST(rtl) { InitFunctionPtrs(); @@ -128,5 +149,5 @@ index e8eb04a..1e6c6f8 100644 test_RtlCompareMemoryUlong(); test_RtlMoveMemory(); -- -1.9.1 +2.3.5 diff --git a/patches/ntdll-WinSqm/0002-ntdll-Add-stub-for-WinSqmIsOptedIn.patch b/patches/ntdll-WinSqm/0002-ntdll-Add-stub-for-WinSqmIsOptedIn.patch deleted file mode 100644 index 51ee31e3..00000000 --- a/patches/ntdll-WinSqm/0002-ntdll-Add-stub-for-WinSqmIsOptedIn.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 335eee22883daada4e4c95c0ac13c64fe92e3d3a Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 18 Apr 2015 15:25:30 +0200 -Subject: ntdll: Add stub for WinSqmIsOptedIn. - -Based on a patch by Stefan Leichter. ---- - dlls/ntdll/ntdll.spec | 1 + - dlls/ntdll/rtl.c | 9 +++++++++ - dlls/ntdll/tests/rtl.c | 4 ++++ - 3 files changed, 14 insertions(+) - -diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index 4053388..9225898 100644 ---- a/dlls/ntdll/ntdll.spec -+++ b/dlls/ntdll/ntdll.spec -@@ -971,4 +971,5 @@ - @ stdcall -ret64 VerSetConditionMask(int64 long long) - @ stdcall WinSqmEndSession(ptr) -+@ stdcall WinSqmIsOptedIn() - @ stdcall WinSqmStartSession(ptr long long) - @ stdcall ZwAcceptConnectPort(ptr long ptr long long ptr) NtAcceptConnectPort -diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c -index 2e87beb..971c964 100644 ---- a/dlls/ntdll/rtl.c -+++ b/dlls/ntdll/rtl.c -@@ -1321,6 +1321,15 @@ NTSTATUS WINAPI WinSqmEndSession(PVOID unknown1) - return STATUS_NOT_IMPLEMENTED; - } - -+/********************************************************************* -+ * WinSqmIsOptedIn [NTDLL.@] -+ */ -+BOOL WINAPI WinSqmIsOptedIn(void) -+{ -+ FIXME("() stub!\n"); -+ return FALSE; -+} -+ - /****************************************************************************** - * WinSqmStartSession [NTDLL.@] - */ -diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c -index 1e6c6f8..7b5f07d 100644 ---- a/dlls/ntdll/tests/rtl.c -+++ b/dlls/ntdll/tests/rtl.c -@@ -63,6 +63,7 @@ static inline USHORT __my_ushort_swap(USHORT s) - /* Function ptrs for ntdll calls */ - static HMODULE hntdll = 0; - static PVOID (WINAPI *pWinSqmStartSession)(PVOID unknown1, DWORD unknown2, DWORD unknown3); -+static BOOL (WINAPI *pWinSqmIsOptedIn)(void); - static NTSTATUS (WINAPI *pWinSqmEndSession)(PVOID unknown1); - static SIZE_T (WINAPI *pRtlCompareMemory)(LPCVOID,LPCVOID,SIZE_T); - static SIZE_T (WINAPI *pRtlCompareMemoryUlong)(PULONG, SIZE_T, ULONG); -@@ -112,6 +113,7 @@ static void InitFunctionPtrs(void) - ok(hntdll != 0, "LoadLibrary failed\n"); - if (hntdll) { - pWinSqmStartSession = (void *)GetProcAddress(hntdll, "WinSqmStartSession"); -+ pWinSqmIsOptedIn = (void *)GetProcAddress(hntdll, "WinSqmIsOptedIn"); - pWinSqmEndSession = (void *)GetProcAddress(hntdll, "WinSqmEndSession"); - pRtlCompareMemory = (void *)GetProcAddress(hntdll, "RtlCompareMemory"); - pRtlCompareMemoryUlong = (void *)GetProcAddress(hntdll, "RtlCompareMemoryUlong"); -@@ -186,6 +188,8 @@ static void test_WinSqm(void) - - args = 3 - call_stdcall_func3( pWinSqmStartSession, NULL, 0, 0 ) / 4; - ok(args == 3, "WinSqmStartSession expected to take %d arguments instead of 3\n", args); -+ args = 3 - call_stdcall_func3( pWinSqmIsOptedIn, NULL, 0, 0 ) / 4; -+ ok(args == 0, "WinSqmIsOptedIn expected to take %d arguments instead of 0\n", args); - args = 3 - call_stdcall_func3( pWinSqmEndSession, NULL, 0, 0 ) / 4; - ok(args == 1, "WinSqmEndSession expected to take %d arguments instead of 1\n", args); - --- -2.3.5 - diff --git a/patches/ntdll-WinSqm/definition b/patches/ntdll-WinSqm/definition index a703e5a9..20d41854 100644 --- a/patches/ntdll-WinSqm/definition +++ b/patches/ntdll-WinSqm/definition @@ -1,2 +1 @@ Fixes: [31971] ntdll is missing WinSqm[Start|End]Session implementation -Fixes: [38388] Add stub for WinSqmIsOptedIn diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index c9feab3c..9ea0919d 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -3452,7 +3452,7 @@ fi # | if test "$enable_ntdll_Vista_Threadpool" -eq 1; then patch_apply ntdll-Vista_Threadpool/0001-ntdll-Implement-TpSimpleTryPost-and-basic-threadpool.patch - patch_apply ntdll-Vista_Threadpool/0002-ntdll-Implement-TpSetPool-Min-Max-Threads.patch + patch_apply ntdll-Vista_Threadpool/0002-ntdll-Implement-TpSetPool-Min-Max-Threads.-v2.patch patch_apply ntdll-Vista_Threadpool/0003-ntdll-Implement-threadpool-cleanup-group-functions.patch patch_apply ntdll-Vista_Threadpool/0004-ntdll-tests-Add-tests-for-TpAllocCleanupGroup-and-re.patch patch_apply ntdll-Vista_Threadpool/0005-ntdll-Implement-threadpool-work-item-functions.patch @@ -3499,17 +3499,14 @@ fi # | # | This patchset fixes the following Wine bugs: # | * [#31971] ntdll is missing WinSqm[Start|End]Session implementation -# | * [#38388] Add stub for WinSqmIsOptedIn # | # | Modified files: -# | * dlls/ntdll/ntdll.spec, dlls/ntdll/rtl.c, dlls/ntdll/tests/rtl.c +# | * dlls/ntdll/misc.c, dlls/ntdll/ntdll.spec, dlls/ntdll/tests/rtl.c # | if test "$enable_ntdll_WinSqm" -eq 1; then patch_apply ntdll-WinSqm/0001-ntdll-Add-stubs-for-WinSqmStartSession-WinSqmEndSess.patch - patch_apply ntdll-WinSqm/0002-ntdll-Add-stub-for-WinSqmIsOptedIn.patch ( echo '+ { "Erich E. Hoover", "ntdll: Add stubs for WinSqmStartSession / WinSqmEndSession.", 1 },'; - echo '+ { "Sebastian Lackner", "ntdll: Add stub for WinSqmIsOptedIn.", 1 },'; ) >> "$patchlist" fi 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 cd5a4460..871286d4 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 be8e04d375183cbd4dbca29f4ffe6473ef32a7ff Mon Sep 17 00:00:00 2001 +From 40fb491c5eb0a781b82bb3a6d489e2ed91b8c3ad 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. @@ -58,10 +58,10 @@ index 0d2d731..27acbed 100644 desc->dwFlags &= ~(DDSD_LPSURFACE | DDSD_LINEARSIZE); } diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 205f074..3375c0f 100644 +index efdb2a8..3d7bdea 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -340,3 +340,34 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) +@@ -343,3 +343,34 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) else resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB; } @@ -97,10 +97,10 @@ 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 a49f521..5a8b250 100644 +index 8f9a1ee..5fb8a3d 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) +@@ -364,6 +364,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) BITMAPINFO *b_info; int extraline = 0; DWORD *masks; @@ -108,7 +108,7 @@ index a49f521..5a8b250 100644 TRACE("surface %p.\n", surface); -@@ -408,10 +409,11 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) +@@ -409,10 +410,11 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) b_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); /* TODO: Is there a nicer way to force a specific alignment? (8 byte for ddraw) */ @@ -122,7 +122,7 @@ index a49f521..5a8b250 100644 b_info->bmiHeader.biPlanes = 1; b_info->bmiHeader.biBitCount = format->byte_count * 8; -@@ -1302,14 +1304,14 @@ static void surface_download_data(struct wined3d_surface *surface, const struct +@@ -1303,14 +1305,14 @@ static void surface_download_data(struct wined3d_surface *surface, const struct void *mem; GLenum gl_format = format->glFormat; GLenum gl_type = format->glType; @@ -140,7 +140,7 @@ index a49f521..5a8b250 100644 src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1); mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * surface->pow2Height); } -@@ -1396,12 +1398,12 @@ static void surface_download_data(struct wined3d_surface *surface, const struct +@@ -1397,12 +1399,12 @@ static void surface_download_data(struct wined3d_surface *surface, const struct * won't be released, and doesn't have to be re-read. */ src_data = mem; dst_data = data.addr; @@ -156,7 +156,7 @@ index a49f521..5a8b250 100644 } HeapFree(GetProcessHeap(), 0, mem); -@@ -1555,7 +1557,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1557,7 +1559,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P UINT update_w, update_h; UINT dst_w, dst_h; RECT r, dst_rect; @@ -165,7 +165,7 @@ index a49f521..5a8b250 100644 POINT p; TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n", -@@ -1641,10 +1643,10 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1645,10 +1647,10 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); surface_get_memory(src_surface, &data, src_surface->locations); @@ -178,7 +178,7 @@ index a49f521..5a8b250 100644 context_release(context); -@@ -1925,25 +1927,6 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface) +@@ -1929,25 +1931,6 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface) return WINED3D_OK; } @@ -204,7 +204,7 @@ index a49f521..5a8b250 100644 HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y) { LONG w, h; -@@ -2124,20 +2107,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -2128,20 +2111,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; valid_location = WINED3D_LOCATION_USER_MEMORY; } @@ -232,8 +232,8 @@ index a49f521..5a8b250 100644 } /* The format might be changed to a format that needs conversion. -@@ -2756,7 +2740,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) +@@ -2761,7 +2745,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) map_desc->row_pitch = surface->resource.width * format->byte_count; else - map_desc->row_pitch = wined3d_surface_get_pitch(surface); @@ -241,7 +241,7 @@ index a49f521..5a8b250 100644 map_desc->slice_pitch = 0; if (!rect) -@@ -2883,6 +2867,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2888,6 +2872,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc int i; BOOL srcIsUpsideDown; struct wined3d_bo_address data; @@ -249,7 +249,7 @@ index a49f521..5a8b250 100644 surface_get_memory(surface, &data, dst_location); -@@ -2919,8 +2904,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2924,8 +2909,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc } /* Setup pixel store pack state -- to glReadPixels into the correct place */ @@ -260,7 +260,7 @@ index a49f521..5a8b250 100644 checkGLcall("glPixelStorei"); gl_info->gl_ops.gl.p_glReadPixels(0, 0, -@@ -2937,7 +2922,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2942,7 +2927,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. */ @@ -271,7 +271,7 @@ index a49f521..5a8b250 100644 if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) goto error; -@@ -4118,7 +4105,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4123,7 +4110,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; @@ -280,7 +280,7 @@ index a49f521..5a8b250 100644 struct wined3d_bo_address data; struct wined3d_format format; POINT dst_point = {0, 0}; -@@ -4206,7 +4193,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4211,7 +4198,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, wined3d_texture_bind_and_dirtify(texture, context, srgb); width = surface->resource.width; @@ -289,7 +289,7 @@ index a49f521..5a8b250 100644 format = *texture->resource.format; if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) -@@ -4244,9 +4231,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4249,9 +4236,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, context_release(context); return E_OUTOFMEMORY; } @@ -301,7 +301,7 @@ index a49f521..5a8b250 100644 data.addr = mem; } else if (conversion) -@@ -4266,14 +4253,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4271,14 +4258,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } if (texture->swapchain && texture->swapchain->palette) palette = texture->swapchain->palette; @@ -320,7 +320,7 @@ index a49f521..5a8b250 100644 context_release(context); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 78d1266..5e68257 100644 +index de92e0e..4425ecb 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1258,7 +1258,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso @@ -333,7 +333,7 @@ index 78d1266..5e68257 100644 FIXME("Ignoring row/slice pitch (%u/%u).\n", data->row_pitch, data->slice_pitch); diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 357608f..1a5e629 100644 +index b83ff26..cd09d50 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -40,30 +40,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) @@ -344,7 +344,7 @@ index 357608f..1a5e629 100644 -{ - const struct wined3d_format *format = volume->resource.format; - -- if (format->flags & WINED3DFMT_FLAG_BLOCKS) +- if (volume->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) - { - /* Since compressed formats are block based, pitch means the amount of - * bytes to the next row of block rather than the next row of pixels. */ @@ -376,7 +376,7 @@ index 357608f..1a5e629 100644 converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth); format->convert(data->addr, converted_mem, src_row_pitch, src_slice_pitch, -@@ -642,7 +618,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -643,7 +619,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, } else { @@ -406,10 +406,10 @@ index bc1129f..fcabd53 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 8e58e4b..2656399 100644 +index 3c23d0c..1a7cade 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2121,6 +2121,7 @@ struct wined3d_resource +@@ -2122,6 +2122,7 @@ struct wined3d_resource UINT size; DWORD priority; void *heap_memory; @@ -417,7 +417,7 @@ index 8e58e4b..2656399 100644 struct list resource_list_entry; void *parent; -@@ -2285,7 +2286,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN +@@ -2286,7 +2287,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; @@ -425,7 +425,7 @@ index 8e58e4b..2656399 100644 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; -@@ -2335,7 +2335,6 @@ struct wined3d_surface +@@ -2336,7 +2336,6 @@ struct wined3d_surface DWORD flags; diff --git a/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch b/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch index 16173f4c..a663fa20 100644 --- a/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch +++ b/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch @@ -1,4 +1,4 @@ -From ef006d30c46de0526e6710ff23b11449cb2efe0a Mon Sep 17 00:00:00 2001 +From fc87bc1d66c8ba3a0880d2feafa0462cb1058bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 17 Nov 2013 20:19:24 +0100 Subject: wined3d: Pass a context to surface_load_location. @@ -14,7 +14,7 @@ Subject: wined3d: Pass a context to surface_load_location. 7 files changed, 107 insertions(+), 77 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 1d7cf9c..ac4c7cb 100644 +index 0334d1c..cb3a435 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2208,7 +2208,7 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing, @@ -36,7 +36,7 @@ index 1d7cf9c..ac4c7cb 100644 swapchain_update_draw_bindings(swapchain); context_set_render_offscreen(context, TRUE); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 5f44a1a..725897f 100644 +index 4954d00..657e099 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -300,6 +300,15 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c @@ -120,10 +120,10 @@ index c0654a6..913ada5 100644 { /* Note that this depends on the context_acquire() call above to set diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index ff66881..e7b139b 100644 +index 22726f2..2cc217e 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -752,7 +752,16 @@ static void surface_unmap(struct wined3d_surface *surface) +@@ -753,7 +753,16 @@ static void surface_unmap(struct wined3d_surface *surface) } if (surface->container->swapchain && surface->container->swapchain->front_buffer == surface->container) @@ -138,10 +138,10 @@ index ff66881..e7b139b 100644 + if (context) + context_release(context); + } - else if (surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) + else if (surface->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) FIXME("Depth / stencil buffer locking is not implemented.\n"); } -@@ -805,12 +814,6 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, +@@ -806,12 +815,6 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, if (src_mask & WINED3DFMT_FLAG_STENCIL) gl_mask |= GL_STENCIL_BUFFER_BIT; @@ -154,7 +154,7 @@ index ff66881..e7b139b 100644 context = context_acquire(device, NULL); if (!context->valid) { -@@ -819,6 +822,12 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, +@@ -820,6 +823,12 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, return; } @@ -167,7 +167,7 @@ index ff66881..e7b139b 100644 gl_info = context->gl_info; context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, NULL, src_surface, src_location); -@@ -906,9 +915,9 @@ static void surface_blt_fbo(const struct wined3d_device *device, +@@ -907,9 +916,9 @@ static void surface_blt_fbo(const struct wined3d_device *device, * surface isn't required if the entire surface is overwritten. (And is * in fact harmful if we're being called by surface_load_location() with * the purpose of loading the destination surface.) */ @@ -179,7 +179,7 @@ index ff66881..e7b139b 100644 if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface; else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface; -@@ -1142,6 +1151,9 @@ static void surface_unload(struct wined3d_resource *resource) +@@ -1143,6 +1152,9 @@ static void surface_unload(struct wined3d_resource *resource) TRACE("surface %p.\n", surface); @@ -189,7 +189,7 @@ index ff66881..e7b139b 100644 if (resource->pool == WINED3D_POOL_DEFAULT) { /* Default pool resources are supposed to be destroyed before Reset is called. -@@ -1167,13 +1179,10 @@ static void surface_unload(struct wined3d_resource *resource) +@@ -1168,13 +1180,10 @@ static void surface_unload(struct wined3d_resource *resource) else { surface_prepare_map_memory(surface); @@ -204,7 +204,7 @@ index ff66881..e7b139b 100644 /* Destroy PBOs, but load them into real sysmem before */ if (surface->pbo) surface_remove_pbo(surface, gl_info); -@@ -1657,7 +1666,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1661,7 +1670,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P if (update_w == dst_w && update_h == dst_h) wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); else @@ -213,7 +213,7 @@ index ff66881..e7b139b 100644 wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); surface_get_memory(src_surface, &data, src_surface->locations); -@@ -1773,7 +1782,8 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) +@@ -1777,7 +1786,8 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) return GL_BACK; } @@ -223,7 +223,7 @@ index ff66881..e7b139b 100644 { DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; -@@ -1789,7 +1799,7 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb) +@@ -1793,7 +1803,7 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb) } TRACE("Reloading because surface is dirty.\n"); @@ -232,7 +232,7 @@ index ff66881..e7b139b 100644 surface_evict_sysmem(surface); } -@@ -2715,10 +2725,16 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2720,10 +2730,16 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, } else { @@ -250,7 +250,7 @@ index ff66881..e7b139b 100644 } if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) -@@ -2800,6 +2816,8 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2805,6 +2821,8 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) { HRESULT hr; @@ -259,7 +259,7 @@ index ff66881..e7b139b 100644 TRACE("surface %p, dc %p.\n", surface, dc); -@@ -2811,26 +2829,36 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2816,26 +2834,36 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) if (surface->resource.map_count) return WINED3DERR_INVALIDCALL; @@ -299,7 +299,7 @@ index ff66881..e7b139b 100644 surface->flags |= SFLAG_DCINUSE; surface->resource.map_count++; -@@ -2868,8 +2896,16 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) +@@ -2873,8 +2901,16 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) * copied back to the DIB in the next getdc call. * * The same consideration applies to user memory surfaces. */ @@ -317,7 +317,7 @@ index ff66881..e7b139b 100644 } return WINED3D_OK; -@@ -4110,7 +4146,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, +@@ -4115,7 +4151,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, } if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) @@ -326,7 +326,7 @@ index ff66881..e7b139b 100644 /* Download the surface to system memory. */ if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -@@ -4146,7 +4182,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, +@@ -4151,7 +4187,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, } surface_get_rect(surface, NULL, &r); @@ -335,7 +335,7 @@ index ff66881..e7b139b 100644 surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -4219,7 +4255,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4224,7 +4260,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, /* Performance warning... */ FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); surface_prepare_map_memory(surface); @@ -344,7 +344,7 @@ index ff66881..e7b139b 100644 } } else -@@ -4230,7 +4266,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4235,7 +4271,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, /* Performance warning... */ FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); surface_prepare_map_memory(surface); @@ -353,7 +353,7 @@ index ff66881..e7b139b 100644 } } -@@ -4239,7 +4275,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4244,7 +4280,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); /* Lets hope we get it from somewhere... */ surface_prepare_system_memory(surface); @@ -362,7 +362,7 @@ index ff66881..e7b139b 100644 } wined3d_texture_prepare_texture(texture, context, srgb); -@@ -4265,7 +4301,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4270,7 +4306,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; surface_prepare_map_memory(surface); @@ -371,7 +371,7 @@ index ff66881..e7b139b 100644 surface_remove_pbo(surface, gl_info); } -@@ -4333,11 +4369,10 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct +@@ -4338,11 +4374,10 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect); } @@ -385,7 +385,7 @@ index ff66881..e7b139b 100644 TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4346,9 +4381,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) +@@ -4351,9 +4386,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) if (location == WINED3D_LOCATION_TEXTURE_RGB && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) { @@ -395,7 +395,7 @@ index ff66881..e7b139b 100644 return WINED3D_OK; } else if (location & surface->locations -@@ -4392,33 +4425,22 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) +@@ -4397,33 +4430,22 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) case WINED3D_LOCATION_USER_MEMORY: case WINED3D_LOCATION_SYSMEM: case WINED3D_LOCATION_BUFFER: @@ -432,7 +432,7 @@ index ff66881..e7b139b 100644 return hr; break; -@@ -5529,7 +5551,11 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5540,7 +5562,11 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, &src_rect))) { if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) @@ -485,7 +485,7 @@ index 146f5d6..4f4d4df 100644 src_dc = front->hDC; window = swapchain->win_handle; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 5e68257..1afff66 100644 +index 4425ecb..dbb0392 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -766,16 +766,19 @@ static void wined3d_texture_upload_data(struct wined3d_texture *texture, const s @@ -511,10 +511,10 @@ index 5e68257..1afff66 100644 } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 2656399..51487aa 100644 +index 1a7cade..e7ec65e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2384,11 +2384,12 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HID +@@ -2385,11 +2385,12 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HID void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch b/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch index d27f3f12..588b71f9 100644 --- a/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch +++ b/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch @@ -1,4 +1,4 @@ -From 64dddc414faf640169e109bf57c62489bfb3a65d Mon Sep 17 00:00:00 2001 +From 77640d30bc5d0699ffc7bf76051c6f786feb56f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 12:22:30 +0100 Subject: wined3d: Move surface locations into the resource. @@ -13,10 +13,10 @@ Subject: wined3d: Move surface locations into the resource. 6 files changed, 56 insertions(+), 56 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index 797c204..2ad6917 100644 +index 96d2f74..2d4aadc 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c -@@ -7884,7 +7884,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter, +@@ -7779,7 +7779,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter, /* Now load the surface */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO @@ -26,7 +26,7 @@ index 797c204..2ad6917 100644 && !wined3d_resource_is_offscreen(&src_surface->container->resource)) { diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 725897f..9e03017 100644 +index 657e099..9f4ab69 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -236,7 +236,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context @@ -61,10 +61,10 @@ index 913ada5..567550e 100644 else SetRectEmpty(¤t_rect); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 0335497..fcca398 100644 +index bb41de5..5fdda96 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -555,7 +555,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface) +@@ -556,7 +556,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface) if (!wined3d_resource_allocate_sysmem(&surface->resource)) ERR("Failed to allocate system memory.\n"); @@ -73,7 +73,7 @@ index 0335497..fcca398 100644 ERR("Surface without system memory has WINED3D_LOCATION_SYSMEM set.\n"); } -@@ -705,7 +705,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) +@@ -706,7 +706,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) } if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) @@ -82,7 +82,7 @@ index 0335497..fcca398 100644 if (surface_use_pbo(surface)) surface->resource.map_binding = WINED3D_LOCATION_BUFFER; -@@ -745,7 +745,7 @@ static void surface_unmap(struct wined3d_surface *surface) +@@ -746,7 +746,7 @@ static void surface_unmap(struct wined3d_surface *surface) ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding)); } @@ -91,7 +91,7 @@ index 0335497..fcca398 100644 { TRACE("Not dirtified, nothing to do.\n"); return; -@@ -1669,7 +1669,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1673,7 +1673,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); @@ -100,7 +100,7 @@ index 0335497..fcca398 100644 wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -@@ -1792,7 +1792,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte +@@ -1796,7 +1796,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte if (surface->resource.pool == WINED3D_POOL_SCRATCH) ERR("Not supported on scratch surfaces.\n"); @@ -109,7 +109,7 @@ index 0335497..fcca398 100644 { TRACE("surface is already in texture\n"); return; -@@ -2103,7 +2103,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -2107,7 +2107,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, create_dib = TRUE; } @@ -118,7 +118,7 @@ index 0335497..fcca398 100644 wined3d_resource_free_sysmem(&surface->resource); width = texture_resource->width; -@@ -3168,9 +3168,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) +@@ -3173,9 +3173,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) back->flags = front->flags; front->flags = tmp_flags; @@ -131,7 +131,7 @@ index 0335497..fcca398 100644 } } -@@ -3349,7 +3349,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3354,7 +3354,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -140,7 +140,7 @@ index 0335497..fcca398 100644 } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3887,13 +3887,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface, +@@ -3892,13 +3892,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface, { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -158,7 +158,7 @@ index 0335497..fcca398 100644 } /* Context activation is done by the caller. */ -@@ -3908,7 +3909,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3913,7 +3914,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -167,7 +167,7 @@ index 0335497..fcca398 100644 { w = surface->ds_current_size.cx; h = surface->ds_current_size.cy; -@@ -3934,7 +3935,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3939,7 +3940,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co return; } @@ -176,7 +176,7 @@ index 0335497..fcca398 100644 { TRACE("Surface was discarded, no need copy data.\n"); switch (location) -@@ -3951,17 +3952,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3956,17 +3957,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co default: FIXME("Unhandled location %#x\n", location); } @@ -198,7 +198,7 @@ index 0335497..fcca398 100644 surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; return; -@@ -4050,7 +4051,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4055,7 +4056,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co ERR("Invalid location (%#x) specified.\n", location); } @@ -207,7 +207,7 @@ index 0335497..fcca398 100644 surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; } -@@ -4059,7 +4060,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location) +@@ -4064,7 +4065,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location) { TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); @@ -216,7 +216,7 @@ index 0335497..fcca398 100644 } void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) -@@ -4068,9 +4069,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location +@@ -4073,9 +4074,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) wined3d_texture_set_dirty(surface->container); @@ -228,7 +228,7 @@ index 0335497..fcca398 100644 ERR("Surface %p does not have any up to date location.\n", surface); } -@@ -4106,7 +4107,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD +@@ -4111,7 +4112,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD UINT size = surface->resource.size; surface_get_memory(surface, &dst, location); @@ -237,7 +237,7 @@ index 0335497..fcca398 100644 if (dst.buffer_object) { -@@ -4139,33 +4140,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface, +@@ -4144,33 +4145,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface, { const struct wined3d_gl_info *gl_info = context->gl_info; @@ -277,7 +277,7 @@ index 0335497..fcca398 100644 } /* Context activation is done by the caller. */ -@@ -4205,14 +4206,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4210,14 +4211,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, if (wined3d_settings.offscreen_rendering_mode != ORM_FBO && wined3d_resource_is_offscreen(&texture->resource) @@ -291,16 +291,16 @@ index 0335497..fcca398 100644 - if (surface->locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) + if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) - && (surface->resource.format->flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB) + && (surface->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB) && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, -@@ -4228,13 +4229,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4233,13 +4234,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, return WINED3D_OK; } - if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) + if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) - && (!srgb || (surface->resource.format->flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)) + && (!srgb || (surface->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)) && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) @@ -310,7 +310,7 @@ index 0335497..fcca398 100644 WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE; DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; RECT rect = {0, 0, surface->resource.width, surface->resource.height}; -@@ -4249,7 +4250,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4254,7 +4255,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, if (srgb) { @@ -319,7 +319,7 @@ index 0335497..fcca398 100644 == WINED3D_LOCATION_TEXTURE_RGB) { /* Performance warning... */ -@@ -4260,7 +4261,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4265,7 +4266,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } else { @@ -328,7 +328,7 @@ index 0335497..fcca398 100644 == WINED3D_LOCATION_TEXTURE_SRGB) { /* Performance warning... */ -@@ -4270,7 +4271,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4275,7 +4276,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } } @@ -337,7 +337,7 @@ index 0335497..fcca398 100644 { WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); /* Lets hope we get it from somewhere... */ -@@ -4305,7 +4306,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4310,7 +4311,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, surface_remove_pbo(surface, gl_info); } @@ -346,7 +346,7 @@ index 0335497..fcca398 100644 if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -4361,7 +4362,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct +@@ -4366,7 +4367,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct { RECT rect = {0, 0, surface->resource.width, surface->resource.height}; @@ -355,7 +355,7 @@ index 0335497..fcca398 100644 ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n", surface); -@@ -4379,12 +4380,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4384,12 +4385,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -370,7 +370,7 @@ index 0335497..fcca398 100644 && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) { /* Already up to date, nothing to do. */ -@@ -4393,12 +4394,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4398,12 +4399,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte else { FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n", @@ -385,7 +385,7 @@ index 0335497..fcca398 100644 { TRACE("Location already up to date.\n"); return; -@@ -4412,7 +4413,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4417,7 +4418,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte required_access, surface->resource.access_flags); } @@ -394,7 +394,7 @@ index 0335497..fcca398 100644 { ERR("Surface %p does not have any up to date location.\n", surface); surface->flags |= SFLAG_LOST; -@@ -4451,7 +4452,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4456,7 +4457,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte surface_validate_location(surface, location); @@ -403,7 +403,7 @@ index 0335497..fcca398 100644 surface_evict_sysmem(surface); return; -@@ -5495,8 +5496,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5506,8 +5507,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ @@ -414,7 +414,7 @@ index 0335497..fcca398 100644 { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5536,8 +5537,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5547,8 +5548,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC color_key = &src_surface->container->async.src_blt_color_key; blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY; } @@ -441,10 +441,10 @@ index 4f4d4df..e702d61 100644 /* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying * Doesn't work with render_to_fbo because we're not flipping diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index c6ac183..e1bc35d 100644 +index 46d5e65..f74eddf 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2333,7 +2333,6 @@ struct wined3d_surface +@@ -2334,7 +2334,6 @@ struct wined3d_surface const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; void *user_memory; diff --git a/patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch b/patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch index a6319a48..37ffb9e3 100644 --- a/patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch +++ b/patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch @@ -1,4 +1,4 @@ -From d93611cca0ee39d60a221d4c2422ba183a2a88ef Mon Sep 17 00:00:00 2001 +From cebc544748ed5c4f41f39ff600b5768d7aa86505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 18 Sep 2013 22:30:57 +0200 Subject: wined3d: Introduce helper functions for mapping volumes. @@ -8,10 +8,10 @@ Subject: wined3d: Introduce helper functions for mapping volumes. 1 file changed, 96 insertions(+), 61 deletions(-) diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index e2c9d4a..ad37cce 100644 +index a1fce20..5a4e939 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -476,12 +476,67 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol +@@ -480,12 +480,67 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol return TRUE; } @@ -79,8 +79,8 @@ index e2c9d4a..ad37cce 100644 - const struct wined3d_gl_info *gl_info; BYTE *base_memory; const struct wined3d_format *format = volume->resource.format; - -@@ -513,58 +568,22 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + const unsigned int fmt_flags = volume->resource.format_flags; +@@ -518,58 +573,22 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags); @@ -150,7 +150,7 @@ index e2c9d4a..ad37cce 100644 TRACE("Base memory pointer %p.\n", base_memory); -@@ -622,8 +641,34 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour +@@ -627,8 +646,34 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour return volume_from_resource(resource); } @@ -185,7 +185,7 @@ index e2c9d4a..ad37cce 100644 TRACE("volume %p.\n", volume); if (!volume->resource.map_count) -@@ -632,19 +677,9 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) +@@ -637,19 +682,9 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) return WINED3DERR_INVALIDCALL; } @@ -209,5 +209,5 @@ index e2c9d4a..ad37cce 100644 volume->resource.map_count--; -- -2.2.1 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch b/patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch index 983a37d5..68524ccc 100644 --- a/patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch +++ b/patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch @@ -1,4 +1,4 @@ -From 7e3863693c9694e35f3ae8e72011939fffe63690 Mon Sep 17 00:00:00 2001 +From 92eadfba3a70866690a3993fc67252ab29736524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 13:30:59 +0100 Subject: wined3d: Use resource buffer mapping facilities in surfaces. @@ -9,10 +9,10 @@ Subject: wined3d: Use resource buffer mapping facilities in surfaces. 2 files changed, 23 insertions(+), 63 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index c907424..358a29e 100644 +index 4c90dee..df6af90 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -461,6 +461,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, +@@ -473,6 +473,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, case WINED3D_LOCATION_SYSMEM: return resource->heap_memory; @@ -25,7 +25,7 @@ index c907424..358a29e 100644 default: ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); return NULL; -@@ -483,6 +489,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -495,6 +501,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, return; case WINED3D_LOCATION_SYSMEM: @@ -35,7 +35,7 @@ index c907424..358a29e 100644 default: diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index e534a9f..d720d26 100644 +index c12b404..77d7890 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -716,36 +716,10 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) @@ -75,7 +75,7 @@ index e534a9f..d720d26 100644 if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)) { TRACE("Not dirtified, nothing to do.\n"); -@@ -2733,6 +2707,8 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso +@@ -2659,6 +2633,8 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -84,7 +84,7 @@ index e534a9f..d720d26 100644 TRACE("surface %p.\n", surface); if (!surface->resource.map_count) -@@ -2742,6 +2718,12 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) +@@ -2668,6 +2644,12 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) } --surface->resource.map_count; @@ -97,9 +97,9 @@ index e534a9f..d720d26 100644 surface->surface_ops->surface_unmap(surface); return WINED3D_OK; -@@ -2752,8 +2734,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - { +@@ -2679,8 +2661,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, const struct wined3d_format *format = surface->resource.format; + unsigned int fmt_flags = surface->resource.format_flags; struct wined3d_device *device = surface->resource.device; - struct wined3d_context *context; - const struct wined3d_gl_info *gl_info; @@ -107,7 +107,7 @@ index e534a9f..d720d26 100644 BYTE *base_memory; TRACE("surface %p, map_desc %p, rect %s, flags %#x.\n", -@@ -2795,6 +2776,9 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2722,6 +2703,9 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, } } @@ -117,7 +117,7 @@ index e534a9f..d720d26 100644 surface_prepare_map_memory(surface); if (flags & WINED3D_MAP_DISCARD) { -@@ -2804,51 +2788,19 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2731,51 +2715,19 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, } else { @@ -170,8 +170,8 @@ index e534a9f..d720d26 100644 + if (context) + context_release(context); - if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) + if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) map_desc->row_pitch = surface->resource.width * format->byte_count; -- -2.2.1 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch b/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch index 02325993..5438b1e3 100644 --- a/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch +++ b/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch @@ -1,4 +1,4 @@ -From c17af045c56511c51b3c8d8873c10a0df66bee5d Mon Sep 17 00:00:00 2001 +From dddaa27583d0479c985c09b2e37f63314fd2d7a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 16 Sep 2013 22:44:33 +0200 Subject: wined3d: Introduce a function to retrieve resource memory. @@ -10,10 +10,10 @@ Subject: wined3d: Introduce a function to retrieve resource memory. 3 files changed, 38 insertions(+), 39 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 7d11fa0..9c6cf70 100644 +index 4454922..0ef2155 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -432,6 +432,36 @@ DWORD wined3d_resource_access_from_location(DWORD location) +@@ -435,6 +435,36 @@ DWORD wined3d_resource_access_from_location(DWORD location) } } @@ -51,10 +51,10 @@ index 7d11fa0..9c6cf70 100644 void wined3d_resource_load_location(struct wined3d_resource *resource, struct wined3d_context *context, DWORD location) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 0815cc9..1a6152a 100644 +index 4f12b02..66a7bd7 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -478,39 +478,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) +@@ -479,39 +479,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) return WINED3D_OK; } @@ -94,16 +94,16 @@ index 0815cc9..1a6152a 100644 static void surface_prepare_buffer(struct wined3d_surface *surface) { struct wined3d_context *context; -@@ -1271,7 +1238,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct +@@ -1272,7 +1239,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct return; } - surface_get_memory(surface, &data, dst_location); + wined3d_resource_get_memory(&surface->resource, dst_location, &data); - if (format->flags & WINED3DFMT_FLAG_COMPRESSED) + if (surface->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) { -@@ -1637,7 +1604,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1641,7 +1608,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); @@ -112,7 +112,7 @@ index 0815cc9..1a6152a 100644 wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -@@ -2871,7 +2838,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, +@@ -2876,7 +2843,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, struct wined3d_bo_address data; UINT row_pitch, slice_pitch; @@ -121,7 +121,7 @@ index 0815cc9..1a6152a 100644 /* Context_release does not restore the original context in case of * nested context_acquire calls. Only read_from_framebuffer and -@@ -4010,8 +3977,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD +@@ -4015,8 +3982,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD struct wined3d_bo_address dst, src; UINT size = surface->resource.size; @@ -132,7 +132,7 @@ index 0815cc9..1a6152a 100644 if (dst.buffer_object) { -@@ -4223,7 +4190,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4228,7 +4195,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, surface_remove_pbo(surface, gl_info); } @@ -142,10 +142,10 @@ index 0815cc9..1a6152a 100644 { /* This code is entered for texture formats which need a fixup. */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 1ab7a01..26b64b7 100644 +index 12b1efd..c38451e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2157,6 +2157,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE +@@ -2158,6 +2158,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/0032-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch b/patches/wined3d-CSMT_Main/0032-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch index 3b7ee2a6..1cd68c6d 100644 --- a/patches/wined3d-CSMT_Main/0032-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch +++ b/patches/wined3d-CSMT_Main/0032-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch @@ -1,4 +1,4 @@ -From e13017df9a84b37e8452e16feebf5c5f06a132a8 Mon Sep 17 00:00:00 2001 +From 1c3c1a3c7117915d4aa9bc8a4c533cde76133080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 19 Sep 2013 13:36:00 +0200 Subject: wined3d: Make surface_ops->unmap specific for front buffers. @@ -9,7 +9,7 @@ Subject: wined3d: Make surface_ops->unmap specific for front buffers. 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 4815965..50d7e74 100644 +index 66a7bd7..178a949 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -681,31 +681,22 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) @@ -43,7 +43,7 @@ index 4815965..50d7e74 100644 - if (context) - context_release(context); - } -- else if (surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) +- else if (surface->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) - FIXME("Depth / stencil buffer locking is not implemented.\n"); + if (device->d3d_initialized) + context = context_acquire(surface->resource.device, NULL); @@ -53,7 +53,7 @@ index 4815965..50d7e74 100644 } static BOOL surface_is_full_rect(const struct wined3d_surface *surface, const RECT *r) -@@ -1218,7 +1209,7 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour +@@ -1162,7 +1153,7 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour static const struct wined3d_surface_ops surface_ops = { surface_private_setup, @@ -62,7 +62,7 @@ index 4815965..50d7e74 100644 }; /***************************************************************************** -@@ -1262,21 +1253,15 @@ static HRESULT gdi_surface_private_setup(struct wined3d_surface *surface) +@@ -1206,21 +1197,15 @@ static HRESULT gdi_surface_private_setup(struct wined3d_surface *surface) return WINED3D_OK; } @@ -87,7 +87,7 @@ index 4815965..50d7e74 100644 }; /* This call just downloads data, the caller is responsible for binding the -@@ -2530,7 +2515,9 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) +@@ -2610,7 +2595,9 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) if (context) context_release(context); @@ -99,10 +99,10 @@ index 4815965..50d7e74 100644 return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index df2031a..d69a581 100644 +index c38451e..96cdac5 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2300,7 +2300,7 @@ struct fbo_entry +@@ -2336,7 +2336,7 @@ struct fbo_entry struct wined3d_surface_ops { HRESULT (*surface_private_setup)(struct wined3d_surface *surface); @@ -112,5 +112,5 @@ index df2031a..d69a581 100644 struct wined3d_surface -- -2.1.3 +2.3.5 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 67998b69..be0a4c65 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 ba90a0acc5f192214213ee08fe82285e89700f8e Mon Sep 17 00:00:00 2001 +From da397c28f35b9220eb4bf258a49b3a778732cd28 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,10 +11,10 @@ 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 8a1d8a1..d559fe8 100644 +index 0ef2155..ddcfdad 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -606,3 +606,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru +@@ -618,3 +618,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru return FALSE; } } @@ -47,10 +47,10 @@ index 8a1d8a1..d559fe8 100644 + return TRUE; +} diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 44e3f72..527017a 100644 +index 178a949..0f58be1 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -1531,23 +1531,18 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w +@@ -1475,23 +1475,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 44e3f72..527017a 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 d77fc21..7808ed5 100644 +index 1cfeb04..4d7b349 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -375,34 +375,6 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum +@@ -379,34 +379,6 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum return &volume->resource; } @@ -124,21 +124,21 @@ index d77fc21..7808ed5 100644 static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume, const struct wined3d_box *box) { -@@ -452,7 +424,8 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -457,7 +429,8 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, WARN("Map box is invalid.\n"); return WINED3DERR_INVALIDCALL; } -- if ((format->flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box)) -+ if ((format->flags & WINED3DFMT_FLAG_BLOCKS) && +- if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box)) ++ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && + !wined3d_resource_check_block_align(&volume->resource, box)) { 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 e7fd8ad..e32d650 100644 +index 96cdac5..855375d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2124,6 +2124,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -2155,6 +2155,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 e7fd8ad..e32d650 100644 BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; -- -2.2.1 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/0038-wined3d-Move-most-of-volume_map-to-resource.c.patch b/patches/wined3d-CSMT_Main/0038-wined3d-Move-most-of-volume_map-to-resource.c.patch index b3678d78..52b74118 100644 --- a/patches/wined3d-CSMT_Main/0038-wined3d-Move-most-of-volume_map-to-resource.c.patch +++ b/patches/wined3d-CSMT_Main/0038-wined3d-Move-most-of-volume_map-to-resource.c.patch @@ -1,4 +1,4 @@ -From 9e47e310ee0c12e0793312777a1f170fcbd363f0 Mon Sep 17 00:00:00 2001 +From a161dbd1575b744e34b6282b0c7a21cab0668407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 19 Sep 2013 17:51:38 +0200 Subject: wined3d: Move most of volume_map to resource.c @@ -13,10 +13,10 @@ boundary check behaviours. 3 files changed, 123 insertions(+), 95 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index d9e2216..2443a9b 100644 +index 8903353..b497955 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -682,3 +682,117 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, +@@ -694,3 +694,117 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, return TRUE; } @@ -135,10 +135,10 @@ index d9e2216..2443a9b 100644 + return WINED3D_OK; +} diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index c11c98c..7e5576b 100644 +index 4d7b349..3a85103 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -386,25 +386,15 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol +@@ -404,26 +404,16 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { @@ -147,6 +147,7 @@ index c11c98c..7e5576b 100644 - BYTE *base_memory; + HRESULT hr; const struct wined3d_format *format = volume->resource.format; + const unsigned int fmt_flags = volume->resource.format_flags; - TRACE("volume %p, map_desc %p, box %p, flags %#x.\n", - volume, map_desc, box, flags); @@ -165,7 +166,7 @@ index c11c98c..7e5576b 100644 if (!wined3d_volume_check_box_dimensions(volume, box)) { WARN("Map box is invalid.\n"); -@@ -418,74 +408,11 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -437,74 +427,11 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, return WINED3DERR_INVALIDCALL; } @@ -190,7 +191,7 @@ index c11c98c..7e5576b 100644 - - TRACE("Base memory pointer %p.\n", base_memory); - -- if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) +- if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) - { - map_desc->row_pitch = volume->resource.width * format->byte_count; - map_desc->slice_pitch = map_desc->row_pitch * volume->resource.height; @@ -210,7 +211,7 @@ index c11c98c..7e5576b 100644 - TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n", - box, box->left, box->top, box->right, box->bottom, box->front, box->back); - -- if ((format->flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) +- if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) - { - /* Compressed textures are block based, so calculate the offset of - * the block that contains the top-left pixel of the locked rectangle. */ @@ -244,7 +245,7 @@ index c11c98c..7e5576b 100644 } struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resource *resource) -@@ -495,23 +422,7 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour +@@ -514,23 +441,7 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) { @@ -270,10 +271,10 @@ index c11c98c..7e5576b 100644 static ULONG volume_resource_incref(struct wined3d_resource *resource) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 81c9cfe..43e1c21 100644 +index f504555..1d0d644 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2126,12 +2126,15 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO +@@ -2168,12 +2168,15 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_load_location(struct wined3d_resource *resource, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; @@ -290,5 +291,5 @@ index 81c9cfe..43e1c21 100644 void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; -- -2.1.3 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/0039-wined3d-Use-resource_map-for-surface_map.patch b/patches/wined3d-CSMT_Main/0039-wined3d-Use-resource_map-for-surface_map.patch index c45c3e33..fef54941 100644 --- a/patches/wined3d-CSMT_Main/0039-wined3d-Use-resource_map-for-surface_map.patch +++ b/patches/wined3d-CSMT_Main/0039-wined3d-Use-resource_map-for-surface_map.patch @@ -1,4 +1,4 @@ -From 4f15b07cc64a3d364197a0ac73dd561c7b969183 Mon Sep 17 00:00:00 2001 +From a63cedcd66546c8005162c860211ce39e7e4cbcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 19 Sep 2013 18:00:23 +0200 Subject: wined3d: Use resource_map for surface_map. @@ -10,10 +10,10 @@ Subject: wined3d: Use resource_map for surface_map. 3 files changed, 22 insertions(+), 89 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 2443a9b..8486dc3 100644 +index b497955..12a26d8 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -783,7 +783,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) +@@ -795,7 +795,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) if (!resource->map_count) { WARN("Trying to unlock an unlocked resource %p.\n", resource); @@ -23,10 +23,10 @@ index 2443a9b..8486dc3 100644 if (device->d3d_initialized) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 5b2359e..16233d3 100644 +index 334335f..cf9c938 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -2394,46 +2394,25 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso +@@ -2474,47 +2474,26 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -64,6 +64,7 @@ index 5b2359e..16233d3 100644 { + struct wined3d_box box; const struct wined3d_format *format = surface->resource.format; + unsigned int fmt_flags = surface->resource.format_flags; - struct wined3d_device *device = surface->resource.device; - struct wined3d_context *context = NULL; - BYTE *base_memory; @@ -77,9 +78,9 @@ index 5b2359e..16233d3 100644 - return WINED3DERR_INVALIDCALL; - } - if ((format->flags & WINED3DFMT_FLAG_BLOCKS) && rect + if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && rect && !surface_check_block_align(surface, rect)) -@@ -2445,11 +2424,6 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2526,11 +2505,6 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, return WINED3DERR_INVALIDCALL; } @@ -91,7 +92,7 @@ index 5b2359e..16233d3 100644 /* 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 -@@ -2465,72 +2439,26 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2546,72 +2520,26 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, } } @@ -129,7 +130,7 @@ index 5b2359e..16233d3 100644 - if (context) - context_release(context); - -- if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) +- if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) - map_desc->row_pitch = surface->resource.width * format->byte_count; else - wined3d_resource_get_pitch(&surface->resource, &map_desc->row_pitch, &map_desc->slice_pitch); @@ -145,7 +146,7 @@ index 5b2359e..16233d3 100644 } - else - { -- if ((format->flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) +- if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) - { - /* Compressed textures are block based, so calculate the offset of - * the block that contains the top-left pixel of the locked rectangle. */ @@ -174,10 +175,10 @@ index 5b2359e..16233d3 100644 HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 7e5576b..7ce5331 100644 +index 3a85103..a656736 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -422,7 +422,12 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour +@@ -441,7 +441,12 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) { @@ -192,5 +193,5 @@ index 7e5576b..7ce5331 100644 static ULONG volume_resource_incref(struct wined3d_resource *resource) -- -2.1.3 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/0042-wined3d-Don-t-call-the-public-map-function-in-surfac.patch b/patches/wined3d-CSMT_Main/0042-wined3d-Don-t-call-the-public-map-function-in-surfac.patch index 34ebf50c..534baa26 100644 --- a/patches/wined3d-CSMT_Main/0042-wined3d-Don-t-call-the-public-map-function-in-surfac.patch +++ b/patches/wined3d-CSMT_Main/0042-wined3d-Don-t-call-the-public-map-function-in-surfac.patch @@ -1,4 +1,4 @@ -From 10e5f290ec6e90c6a53df8b0e60fe69e6bbee6aa Mon Sep 17 00:00:00 2001 +From 341f5f1a37a6da02cd3ed172d9e3c3d2653220b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 24 Sep 2013 00:31:39 +0200 Subject: wined3d: Don't call the public map function in surface_cpu_blt. @@ -8,12 +8,12 @@ Subject: wined3d: Don't call the public map function in surface_cpu_blt. 1 file changed, 72 insertions(+), 35 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 50faee0..9647c2a 100644 +index 08009da..b562f7a 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -4489,21 +4489,36 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - int bpp, srcheight, srcwidth, dstheight, dstwidth, width; +@@ -4428,21 +4428,36 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * const struct wined3d_format *src_format, *dst_format; + unsigned int src_fmt_flags, dst_fmt_flags; struct wined3d_texture *src_texture = NULL; - struct wined3d_map_desc dst_map, src_map; + void *src_data = NULL, *dst_data = NULL; @@ -50,9 +50,9 @@ index 50faee0..9647c2a 100644 + src_row_pitch = dst_row_pitch; src_format = dst_surface->resource.format; dst_format = src_format; - } -@@ -4512,6 +4527,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - dst_format = dst_surface->resource.format; + dst_fmt_flags = dst_surface->resource.format_flags; +@@ -4454,6 +4469,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * + dst_fmt_flags = dst_surface->resource.format_flags; if (src_surface) { + if (!wined3d_resource_prepare_map_memory(&src_surface->resource, context)) @@ -64,7 +64,7 @@ index 50faee0..9647c2a 100644 if (dst_surface->resource.format->id != src_surface->resource.format->id) { if (!(src_texture = surface_convert_format(src_surface, dst_format->id))) -@@ -4522,7 +4543,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * +@@ -4464,7 +4485,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -73,10 +73,10 @@ index 50faee0..9647c2a 100644 + wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); + src_data = wined3d_resource_get_map_ptr(&src_surface->resource, context, 0); src_format = src_surface->resource.format; + src_fmt_flags = src_surface->resource.format_flags; } - else -@@ -4530,7 +4553,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - src_format = dst_format; +@@ -4474,7 +4497,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * + src_fmt_flags = dst_fmt_flags; } - wined3d_surface_map(dst_surface, &dst_map, dst_rect, 0); @@ -85,7 +85,7 @@ index 50faee0..9647c2a 100644 } bpp = dst_surface->resource.format->byte_count; -@@ -4541,15 +4565,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * +@@ -4485,15 +4509,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -104,9 +104,9 @@ index 50faee0..9647c2a 100644 + + ((dst_rect->top / dst_format->block_height) * dst_row_pitch) + + ((dst_rect->left / dst_format->block_width) * dst_format->block_byte_count); - if (src_format->flags & dst_format->flags & WINED3DFMT_FLAG_BLOCKS) + if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4584,7 +4605,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * +@@ -4528,7 +4549,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -115,7 +115,7 @@ index 50faee0..9647c2a 100644 src_format, flags, fx); goto release; } -@@ -4592,7 +4613,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * +@@ -4536,7 +4557,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -124,7 +124,7 @@ index 50faee0..9647c2a 100644 flags &= ~WINEDDBLT_COLORFILL; } -@@ -4641,19 +4662,19 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * +@@ -4585,19 +4606,19 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -150,7 +150,7 @@ index 50faee0..9647c2a 100644 memcpy(dbuf, sbuf, width); } } -@@ -4663,8 +4684,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * +@@ -4607,8 +4628,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -161,7 +161,7 @@ index 50faee0..9647c2a 100644 } } } -@@ -4673,9 +4694,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * +@@ -4617,9 +4638,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -173,7 +173,7 @@ index 50faee0..9647c2a 100644 } } } -@@ -4685,13 +4706,13 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * +@@ -4629,13 +4650,13 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -189,7 +189,7 @@ index 50faee0..9647c2a 100644 } else { -@@ -4738,14 +4759,14 @@ do { \ +@@ -4682,14 +4703,14 @@ do { \ } #undef STRETCH_ROW } @@ -206,7 +206,7 @@ index 50faee0..9647c2a 100644 DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff; DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff; if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE)) -@@ -4795,7 +4816,7 @@ do { \ +@@ -4739,7 +4760,7 @@ do { \ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -215,7 +215,7 @@ index 50faee0..9647c2a 100644 dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4878,7 +4899,7 @@ do { \ +@@ -4822,7 +4843,7 @@ do { \ type *d = (type *)dbuf, *dx, tmp; \ for (y = sy = 0; y < dstheight; ++y, sy += yinc) \ { \ @@ -224,7 +224,7 @@ index 50faee0..9647c2a 100644 dx = d; \ for (x = sx = 0; x < dstwidth; ++x, sx += xinc) \ { \ -@@ -4911,7 +4932,7 @@ do { \ +@@ -4855,7 +4876,7 @@ do { \ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -233,7 +233,7 @@ index 50faee0..9647c2a 100644 dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4942,6 +4963,10 @@ do { \ +@@ -4886,6 +4907,10 @@ do { \ } } @@ -244,7 +244,7 @@ index 50faee0..9647c2a 100644 error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4949,12 +4974,24 @@ error: +@@ -4893,12 +4918,24 @@ error: } release: @@ -273,5 +273,5 @@ index 50faee0..9647c2a 100644 return hr; } -- -2.3.2 +2.3.5 diff --git a/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch b/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch index e1dabb50..25756e86 100644 --- a/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch +++ b/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch @@ -1,4 +1,4 @@ -From d38b136f82ef53ae256d8989312783f0cba3a437 Mon Sep 17 00:00:00 2001 +From f3e0bbee4a69994ffdae5e15c180d65104ed515c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 20 Dec 2012 13:09:17 +0100 Subject: wined3d: Move the framebuffer into wined3d_state @@ -20,10 +20,10 @@ Subject: wined3d: Move the framebuffer into wined3d_state 13 files changed, 171 insertions(+), 126 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index 0d61251..2561afc 100644 +index c3878ea..78ecff7 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c -@@ -706,7 +706,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, +@@ -707,7 +707,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, { const struct wined3d_shader *pshader = state->shader[WINED3D_SHADER_TYPE_PIXEL]; const struct arb_ps_compiled_shader *gl_shader = priv->compiled_fprog; @@ -32,7 +32,7 @@ index 0d61251..2561afc 100644 /* Load DirectX 9 float constants for pixel shader */ priv->highest_dirty_ps_const = shader_arb_load_constantsF(pshader, gl_info, GL_FRAGMENT_PROGRAM_ARB, -@@ -4711,7 +4711,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context +@@ -4665,7 +4665,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context } else { @@ -42,7 +42,7 @@ index 0d61251..2561afc 100644 } diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 5644ea0..bfedf0e 100644 +index 103d7eb..8f1860b 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1453,6 +1453,12 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, @@ -129,7 +129,7 @@ index 5644ea0..bfedf0e 100644 WORD map; diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index d66850a..639dc4f 100644 +index 874129a..22a2de8 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -290,7 +290,7 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) @@ -168,7 +168,7 @@ index d66850a..639dc4f 100644 if (!prev != !op->view) { -@@ -1002,7 +1002,7 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) +@@ -1004,7 +1004,7 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) state_cleanup(&cs->state); memset(&cs->state, 0, sizeof(cs->state)); @@ -177,7 +177,7 @@ index d66850a..639dc4f 100644 WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize CS state, hr %#x.\n", hr); } -@@ -1085,17 +1085,9 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -1087,17 +1087,9 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs)))) return NULL; @@ -196,7 +196,7 @@ index d66850a..639dc4f 100644 HeapFree(GetProcessHeap(), 0, cs); return NULL; } -@@ -1116,7 +1108,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -1118,7 +1110,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) void wined3d_cs_destroy(struct wined3d_cs *cs) { state_cleanup(&cs->state); @@ -205,7 +205,7 @@ index d66850a..639dc4f 100644 HeapFree(GetProcessHeap(), 0, cs); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 5836edf..13a1f0c 100644 +index c695c2f..4e83d14 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -860,7 +860,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi @@ -318,7 +318,7 @@ index 5836edf..13a1f0c 100644 return WINED3D_OK; @@ -1928,7 +1906,7 @@ static void resolve_depth_buffer(struct wined3d_state *state) - || !(texture->resource.format->flags & WINED3DFMT_FLAG_DEPTH)) + || !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; surface = surface_from_resource(texture->sub_resources[0]); - if (!(depth_stencil = wined3d_rendertarget_view_get_surface(state->fb->depth_stencil))) @@ -577,10 +577,10 @@ index f2c2f42..c6a72fc 100644 surface_modify_ds_location(ds, location, ds->ds_current_size.cx, ds->ds_current_size.cy); diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c -index b1a0f85..d1613cb 100644 +index 655bb33..eddf6b5 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c -@@ -1088,7 +1088,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont +@@ -1083,7 +1083,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont const struct wined3d_state *state = &shader->device->state; const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args; const struct wined3d_gl_info *gl_info = context->gl_info; @@ -590,7 +590,7 @@ index b1a0f85..d1613cb 100644 const struct wined3d_shader_lconst *lconst; const char *prefix; diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c -index 0bedf24..70c4635 100644 +index d5a90c0..2746ba1 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -2344,7 +2344,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 @@ -603,7 +603,7 @@ index 0bedf24..70c4635 100644 { static unsigned int warned = 0; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index 7efbf3d..ceb1986 100644 +index 91f3485..6105283 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -105,7 +105,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_ @@ -788,10 +788,10 @@ index 62b1841..76a80e2 100644 if (FAILED(hr = stateblock_allocate_shader_constants(stateblock))) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 5d611c8..a053f34 100644 +index b562f7a..870c32e 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -3413,8 +3413,8 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE +@@ -3416,8 +3416,8 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -837,7 +837,7 @@ index 1686e30..09408e4 100644 const struct wined3d_d3d_info *d3d_info = context->d3d_info; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index c325a06..e80ceb9 100644 +index 1d0d644..7253e54 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1124,6 +1124,36 @@ struct wined3d_timestamp_query @@ -915,7 +915,7 @@ index c325a06..e80ceb9 100644 struct wined3d_surface *onscreen_depth_stencil; struct wined3d_rendertarget_view *auto_depth_stencil_view; -@@ -2545,9 +2569,8 @@ struct wined3d_stateblock +@@ -2539,9 +2563,8 @@ struct wined3d_stateblock void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -927,7 +927,7 @@ index c325a06..e80ceb9 100644 void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; struct wined3d_cs_ops -@@ -2560,7 +2583,6 @@ struct wined3d_cs +@@ -2554,7 +2577,6 @@ struct wined3d_cs { const struct wined3d_cs_ops *ops; struct wined3d_device *device; 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 8f2f3145..06823875 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 f095c8ad65086b4c17879e878f6387ef2f211e21 Mon Sep 17 00:00:00 2001 +From a88c75ba7db54b3c8f834b6534ebc5d4ae4733d9 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. @@ -12,7 +12,7 @@ between surface_blt and surface_blt_ugly isn't particularly nice. 3 files changed, 226 insertions(+), 139 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 032c1a2..0e758c8 100644 +index 8087812..9531b2f 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -74,6 +74,7 @@ enum wined3d_cs_op @@ -42,7 +42,7 @@ index 032c1a2..0e758c8 100644 /* FIXME: The list synchronization probably isn't particularly fast. */ static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) { -@@ -1504,6 +1517,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) +@@ -1506,6 +1519,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) struct wined3d_device *device = cs->device; struct wined3d_context *context; @@ -52,7 +52,7 @@ index 032c1a2..0e758c8 100644 context = context_acquire(device, NULL); context->gl_info->gl_ops.gl.p_glFinish(); context_release(context); -@@ -1715,6 +1731,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab +@@ -1717,6 +1733,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab cs->ops->submit(cs); } @@ -91,7 +91,7 @@ index 032c1a2..0e758c8 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -@@ -1755,6 +1803,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -1757,6 +1805,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, @@ -99,7 +99,7 @@ index 032c1a2..0e758c8 100644 }; static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -@@ -1829,6 +1878,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) +@@ -1831,6 +1880,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) TRACE("Started.\n"); @@ -108,10 +108,10 @@ index 032c1a2..0e758c8 100644 { struct wined3d_cs_block *block; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 87f6ef2..747c42a 100644 +index a4a659b..329ec45 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -4991,14 +4991,13 @@ const struct blit_shader cpu_blit = { +@@ -5000,14 +5000,13 @@ const struct blit_shader cpu_blit = { cpu_blit_blit_surface, }; @@ -128,7 +128,7 @@ index 87f6ef2..747c42a 100644 BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -5009,111 +5008,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5018,111 +5017,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -240,7 +240,7 @@ index 87f6ef2..747c42a 100644 if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5156,8 +5050,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5165,8 +5059,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC } scale = src_surface @@ -250,8 +250,8 @@ index 87f6ef2..747c42a 100644 + || src_rect->bottom - src_rect->top != dst_rect->bottom - dst_rect->top); 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); -@@ -5175,22 +5069,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + dst_ds_flags = dst_surface->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); +@@ -5184,22 +5078,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 87f6ef2..747c42a 100644 } } else -@@ -5221,8 +5109,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5230,8 +5118,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC palette, fx->u5.dwFillColor, &color)) goto fallback; @@ -290,7 +290,7 @@ index 87f6ef2..747c42a 100644 } else { -@@ -5250,9 +5138,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5259,9 +5147,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 87f6ef2..747c42a 100644 { if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) { -@@ -5261,7 +5149,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5270,7 +5158,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 87f6ef2..747c42a 100644 } } } -@@ -5285,50 +5173,191 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5294,50 +5182,191 @@ 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; @@ -517,10 +517,10 @@ index 87f6ef2..747c42a 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 85a7ca1..ee9df98 100644 +index 7186b81..a00f5cc 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2452,6 +2452,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; +@@ -2446,6 +2446,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; @@ -530,7 +530,7 @@ index 85a7ca1..ee9df98 100644 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; -@@ -2601,6 +2604,7 @@ struct wined3d_cs +@@ -2595,6 +2598,7 @@ struct wined3d_cs struct wined3d_device *device; struct wined3d_state state; HANDLE thread; @@ -538,7 +538,7 @@ index 85a7ca1..ee9df98 100644 DWORD tls_idx; struct wined3d_surface *onscreen_depth_stencil; -@@ -2679,6 +2683,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, +@@ -2673,6 +2677,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; diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 87bba561..7cab8823 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -461,7 +461,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c -@@ -5116,7 +5116,11 @@ +@@ -5118,7 +5118,11 @@ fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); add_dirty_rect_test_draw(device); color = getPixelColor(device, 320, 240); @@ -858,8 +858,8 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +#if defined(STAGING_CSMT) HRESULT hr; const struct wined3d_format *format = volume->resource.format; - -@@ -438,6 +683,147 @@ + const unsigned int fmt_flags = volume->resource.format_flags; +@@ -439,6 +684,148 @@ return hr; return hr; @@ -869,6 +869,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c + const struct wined3d_gl_info *gl_info; + BYTE *base_memory; + const struct wined3d_format *format = volume->resource.format; ++ const unsigned int fmt_flags = volume->resource.format_flags; + + TRACE("volume %p, map_desc %p, box %p, flags %#x.\n", + volume, map_desc, box, flags); @@ -889,7 +890,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c + WARN("Map box is invalid.\n"); + return WINED3DERR_INVALIDCALL; + } -+ if ((format->flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box)) ++ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box)) + { + WARN("Map box is misaligned for %ux%u blocks.\n", + format->block_width, format->block_height); @@ -953,7 +954,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c + + TRACE("Base memory pointer %p.\n", base_memory); + -+ if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) ++ if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + { + map_desc->row_pitch = volume->resource.width * format->byte_count; + map_desc->slice_pitch = map_desc->row_pitch * volume->resource.height; @@ -973,7 +974,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c + TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n", + box, box->left, box->top, box->right, box->bottom, box->front, box->back); + -+ if ((format->flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) ++ if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) + { + /* Compressed textures are block based, so calculate the offset of + * the block that contains the top-left pixel of the locked rectangle. */ @@ -1007,7 +1008,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) -@@ -447,6 +833,7 @@ +@@ -448,6 +835,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) { @@ -1015,7 +1016,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c HRESULT hr; if (volume->resource.unmap_dirtify) -@@ -456,6 +843,33 @@ +@@ -457,6 +845,33 @@ if (hr == WINEDDERR_NOTLOCKED) return WINED3DERR_INVALIDCALL; return hr; @@ -1049,7 +1050,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } static ULONG volume_resource_incref(struct wined3d_resource *resource) -@@ -468,6 +882,7 @@ +@@ -469,6 +884,7 @@ return wined3d_volume_decref(volume_from_resource(resource)); } @@ -1057,7 +1058,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); -@@ -483,6 +898,13 @@ +@@ -484,6 +900,13 @@ volume_unload, wined3d_volume_location_invalidated, wined3d_volume_load_location, @@ -1071,7 +1072,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, -@@ -519,7 +941,11 @@ +@@ -520,7 +943,11 @@ } volume->texture_level = level; @@ -1083,7 +1084,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] -@@ -527,7 +953,9 @@ +@@ -528,7 +955,9 @@ { wined3d_resource_free_sysmem(&volume->resource); volume->resource.map_binding = WINED3D_LOCATION_BUFFER; @@ -1547,7 +1548,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } if (state->index_buffer) { -@@ -3207,7 +3300,11 @@ +@@ -3208,7 +3301,11 @@ if (texture->texture_srgb.name) wined3d_texture_load(texture, context, TRUE); wined3d_texture_load(texture, context, FALSE); @@ -1682,7 +1683,7 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c -@@ -16585,7 +16585,11 @@ +@@ -16587,7 +16587,11 @@ fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); add_dirty_rect_test_draw(device); color = getPixelColor(device, 320, 240); @@ -1937,7 +1938,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_resource -@@ -2169,6 +2257,7 @@ +@@ -2170,6 +2258,7 @@ UINT depth; UINT size; DWORD priority; @@ -1945,7 +1946,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; UINT custom_row_pitch, custom_slice_pitch; struct wined3d_gl_bo *buffer, *map_buffer; -@@ -2176,6 +2265,11 @@ +@@ -2177,6 +2266,11 @@ DWORD locations; LONG access_fence; BOOL unmap_dirtify; @@ -1957,7 +1958,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2200,6 +2294,7 @@ +@@ -2201,6 +2295,7 @@ 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; @@ -1965,7 +1966,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h 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, -@@ -2246,6 +2341,15 @@ +@@ -2247,6 +2342,15 @@ { while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); } @@ -1981,7 +1982,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -@@ -2330,7 +2434,9 @@ +@@ -2331,7 +2435,9 @@ void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture, const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; @@ -1991,7 +1992,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, -@@ -2364,9 +2470,16 @@ +@@ -2365,9 +2471,16 @@ struct wined3d_resource resource; struct wined3d_texture *container; @@ -2008,7 +2009,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) -@@ -2374,6 +2487,7 @@ +@@ -2375,6 +2488,7 @@ return CONTAINING_RECORD(resource, struct wined3d_volume, resource); } @@ -2016,7 +2017,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; -@@ -2386,6 +2500,23 @@ +@@ -2387,6 +2501,23 @@ struct wined3d_surface_dib { HBITMAP DIBsection; @@ -2040,7 +2041,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT bitmap_size; }; -@@ -2411,7 +2542,11 @@ +@@ -2412,7 +2543,11 @@ struct wined3d_surface_ops { HRESULT (*surface_private_setup)(struct wined3d_surface *surface); @@ -2052,7 +2053,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_surface -@@ -2419,12 +2554,25 @@ +@@ -2420,12 +2555,25 @@ struct wined3d_resource resource; const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; @@ -2078,7 +2079,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h GLuint rb_multisample; GLuint rb_resolved; GLenum texture_target; -@@ -2468,10 +2616,19 @@ +@@ -2469,10 +2617,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; @@ -2098,7 +2099,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; -@@ -2483,6 +2640,7 @@ +@@ -2484,6 +2641,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; @@ -2106,7 +2107,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; -@@ -2501,6 +2659,21 @@ +@@ -2502,6 +2660,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; @@ -2128,7 +2129,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. */ -@@ -2548,8 +2721,10 @@ +@@ -2549,8 +2722,10 @@ BOOL half_float_conv_needed; }; @@ -2139,7 +2140,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]; -@@ -2617,6 +2792,7 @@ +@@ -2618,6 +2793,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2147,7 +2148,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; -@@ -2667,6 +2843,32 @@ +@@ -2668,6 +2844,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; @@ -2180,7 +2181,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; -@@ -2716,6 +2918,7 @@ +@@ -2717,6 +2919,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; @@ -2188,7 +2189,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, -@@ -2775,6 +2978,7 @@ +@@ -2776,6 +2979,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; @@ -2196,7 +2197,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 -@@ -2789,8 +2993,12 @@ +@@ -2790,8 +2994,12 @@ struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -2209,7 +2210,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_query -@@ -2804,12 +3012,16 @@ +@@ -2805,12 +3013,16 @@ enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -2226,7 +2227,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 */ -@@ -2836,7 +3048,9 @@ +@@ -2837,7 +3049,9 @@ GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -2236,7 +2237,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -2861,11 +3075,15 @@ +@@ -2862,11 +3076,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; @@ -2252,7 +2253,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -2903,8 +3121,10 @@ +@@ -2904,8 +3122,10 @@ return surface_from_resource(resource); } @@ -2263,7 +2264,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_shader_resource_view { LONG refcount; -@@ -2917,8 +3137,12 @@ +@@ -2918,8 +3138,12 @@ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, @@ -2276,7 +2277,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_swapchain -@@ -2958,8 +3182,10 @@ +@@ -2959,8 +3183,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; @@ -2287,7 +2288,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /***************************************************************************** * Utility function prototypes -@@ -3174,7 +3400,9 @@ +@@ -3175,7 +3401,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; @@ -3501,7 +3502,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device) @@ -1850,7 +2064,11 @@ - || !(texture->resource.format->flags & WINED3DFMT_FLAG_DEPTH)) + || !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; surface = surface_from_resource(texture->sub_resources[0]); +#if defined(STAGING_CSMT) @@ -4696,7 +4697,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_cs_set_consts_f { enum wined3d_cs_op opcode; -@@ -2760,190 +2820,961 @@ +@@ -2762,190 +2822,963 @@ /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, /* WINED3D_CS_OP_SKIP */ wined3d_cs_exec_skip, /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, @@ -5252,13 +5253,15 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + { + const struct wined3d_format *new_format = op->texture->resource.format; + const struct wined3d_format *old_format = prev ? prev->resource.format : NULL; ++ unsigned int old_fmt_flags = prev ? prev->resource.format_flags : 0; ++ unsigned int new_fmt_flags = op->texture->resource.format_flags; + + if (InterlockedIncrement(&op->texture->resource.bind_count) == 1) + op->texture->sampler = op->stage; + + if (!prev || op->texture->target != prev->target + || !is_same_fixup(new_format->color_fixup, old_format->color_fixup) -+ || (new_format->flags & WINED3DFMT_FLAG_SHADOW) != (old_format->flags & WINED3DFMT_FLAG_SHADOW)) ++ || (new_fmt_flags & WINED3DFMT_FLAG_SHADOW) != (old_fmt_flags & WINED3DFMT_FLAG_SHADOW)) + device_invalidate_state(cs->device, STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL)); + + if (!prev && op->stage < d3d_info->limits.ffp_blend_stages) @@ -5811,7 +5814,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } static const struct wined3d_cs_ops wined3d_cs_mt_ops = -@@ -3171,5 +4002,80 @@ +@@ -3173,5 +4006,80 @@ ERR("Closing event failed.\n"); } @@ -6458,7 +6461,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, -@@ -463,7 +503,11 @@ +@@ -464,7 +504,11 @@ TRACE("Creating a DIB section with size %dx%dx%d, size=%d.\n", b_info->bmiHeader.biWidth, b_info->bmiHeader.biHeight, b_info->bmiHeader.biBitCount, b_info->bmiHeader.biSizeImage); @@ -6470,7 +6473,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!surface->dib.DIBsection) { -@@ -472,7 +516,11 @@ +@@ -473,7 +517,11 @@ return HRESULT_FROM_WIN32(GetLastError()); } @@ -6482,7 +6485,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->dib.bitmap_size = b_info->bmiHeader.biSizeImage; HeapFree(GetProcessHeap(), 0, b_info); -@@ -486,6 +534,116 @@ +@@ -487,6 +535,116 @@ return WINED3D_OK; } @@ -6599,7 +6602,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static void surface_evict_sysmem(struct wined3d_surface *surface) { /* In some conditions the surface memory must not be freed: -@@ -498,8 +656,34 @@ +@@ -499,8 +657,34 @@ return; wined3d_resource_free_sysmem(&surface->resource); @@ -6634,7 +6637,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static BOOL surface_use_pbo(const struct wined3d_surface *surface) -@@ -584,7 +768,11 @@ +@@ -585,7 +769,11 @@ } if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) @@ -6646,7 +6649,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface_use_pbo(surface)) surface->resource.map_binding = WINED3D_LOCATION_BUFFER; -@@ -592,6 +780,7 @@ +@@ -593,6 +781,7 @@ return WINED3D_OK; } @@ -6654,7 +6657,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static void surface_frontbuffer_updated(struct wined3d_surface *surface) { struct wined3d_context *context = NULL; -@@ -608,6 +797,50 @@ +@@ -609,6 +798,50 @@ wined3d_resource_load_location(&surface->resource, context, surface->container->resource.draw_binding); if (context) context_release(context); @@ -6699,13 +6702,13 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + + if (surface->container->swapchain && surface->container->swapchain->front_buffer == surface->container) + surface_load_location(surface, surface->container->resource.draw_binding); -+ else if (surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) ++ else if (surface->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) + FIXME("Depth / stencil buffer locking is not implemented.\n"); +#endif /* STAGING_CSMT */ } static BOOL surface_is_full_rect(const struct wined3d_surface *surface, const RECT *r) -@@ -658,6 +891,14 @@ +@@ -659,6 +892,14 @@ if (src_mask & WINED3DFMT_FLAG_STENCIL) gl_mask |= GL_STENCIL_BUFFER_BIT; @@ -6720,7 +6723,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(device, NULL); if (!context->valid) { -@@ -666,12 +907,14 @@ +@@ -667,12 +908,14 @@ return; } @@ -6735,7 +6738,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info = context->gl_info; context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, NULL, src_surface, src_location); -@@ -711,6 +954,7 @@ +@@ -712,6 +955,7 @@ context_release(context); } @@ -6743,7 +6746,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Blit between surface locations. Onscreen on different swapchains is not supported. * Depth / stencil is not supported. Context activation is done by the caller. */ static void surface_blt_fbo(const struct wined3d_device *device, -@@ -721,6 +965,16 @@ +@@ -722,6 +966,16 @@ const struct wined3d_gl_info *gl_info; struct wined3d_context *context; struct wined3d_surface *required_rt, *restore_rt; @@ -6760,7 +6763,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c RECT src_rect, dst_rect; GLenum gl_filter; GLenum buffer; -@@ -759,6 +1013,7 @@ +@@ -760,6 +1014,7 @@ * surface isn't required if the entire surface is overwritten. (And is * in fact harmful if we're being called by surface_load_location() with * the purpose of loading the destination surface.) */ @@ -6768,7 +6771,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_load_location(&src_surface->resource, old_ctx, src_location); if (!surface_is_full_rect(dst_surface, &dst_rect)) wined3d_resource_load_location(&dst_surface->resource, old_ctx, dst_location); -@@ -777,6 +1032,15 @@ +@@ -778,6 +1033,15 @@ restore_rt = NULL; context = old_ctx; } @@ -6784,7 +6787,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!context->valid) { -@@ -839,12 +1103,16 @@ +@@ -840,12 +1104,16 @@ && dst_surface->container->swapchain->front_buffer == dst_surface->container)) gl_info->gl_ops.gl.p_glFlush(); @@ -6801,7 +6804,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined3d_blit_op blit_op, -@@ -965,6 +1233,18 @@ +@@ -966,6 +1234,18 @@ return wined3d_surface_blt(surface, NULL, render_target, NULL, 0, NULL, WINED3D_TEXF_POINT); } @@ -6820,7 +6823,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static ULONG surface_resource_incref(struct wined3d_resource *resource) { return wined3d_surface_incref(surface_from_resource(resource)); -@@ -985,6 +1265,7 @@ +@@ -986,6 +1266,7 @@ TRACE("surface %p.\n", surface); @@ -6828,7 +6831,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(device, NULL); gl_info = context->gl_info; -@@ -996,6 +1277,23 @@ +@@ -997,6 +1278,23 @@ * opengl resources, so we cannot leave early. */ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DISCARDED); wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DISCARDED); @@ -6852,7 +6855,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* We also get here when the ddraw swapchain is destroyed, for example * for a mode switch. In this case this surface won't necessarily be -@@ -1005,10 +1303,24 @@ +@@ -1006,10 +1304,24 @@ } else { @@ -6877,7 +6880,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Destroy fbo render buffers. This is needed for implicit render targets, for * all application-created targets the application has to release the surface -@@ -1039,6 +1351,7 @@ +@@ -1040,6 +1352,7 @@ resource_unload(resource); } @@ -6885,7 +6888,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); -@@ -1054,6 +1367,19 @@ +@@ -1055,6 +1368,19 @@ { surface_private_setup, surface_frontbuffer_updated, @@ -6905,7 +6908,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c }; /***************************************************************************** -@@ -1097,6 +1423,7 @@ +@@ -1098,6 +1424,7 @@ return WINED3D_OK; } @@ -6913,7 +6916,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static void gdi_surface_frontbuffer_updated(struct wined3d_surface *surface) { x11_copy_to_screen(surface->container->swapchain, &surface->lockedRect); -@@ -1106,6 +1433,23 @@ +@@ -1107,6 +1434,23 @@ { gdi_surface_private_setup, gdi_surface_frontbuffer_updated, @@ -6937,7 +6940,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c }; /* This call just downloads data, the caller is responsible for binding the -@@ -1124,7 +1468,11 @@ +@@ -1125,7 +1469,11 @@ return; } @@ -6947,9 +6950,9 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + surface_get_memory(surface, &data, dst_location); +#endif /* STAGING_CSMT */ - if (format->flags & WINED3DFMT_FLAG_COMPRESSED) + if (surface->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) { -@@ -1373,6 +1721,7 @@ +@@ -1374,6 +1722,7 @@ } } @@ -6957,7 +6960,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) { struct wined3d_box box; -@@ -1387,6 +1736,27 @@ +@@ -1388,6 +1737,27 @@ box.bottom = rect->bottom; box.back = 1; return wined3d_resource_check_block_align(&surface->resource, &box); @@ -6985,7 +6988,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, -@@ -1469,11 +1839,17 @@ +@@ -1473,11 +1843,17 @@ return WINED3DERR_INVALIDCALL; } @@ -7003,7 +7006,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(dst_surface->resource.device, NULL); gl_info = context->gl_info; -@@ -1484,10 +1860,17 @@ +@@ -1488,10 +1864,17 @@ if (update_w == dst_w && update_h == dst_h) wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); else @@ -7021,7 +7024,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -@@ -1495,8 +1878,13 @@ +@@ -1499,8 +1882,13 @@ context_release(context); @@ -7035,7 +7038,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -1600,8 +1988,12 @@ +@@ -1604,8 +1992,12 @@ return GL_BACK; } @@ -7048,7 +7051,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; -@@ -1610,6 +2002,7 @@ +@@ -1614,6 +2006,7 @@ if (surface->resource.pool == WINED3D_POOL_SCRATCH) ERR("Not supported on scratch surfaces.\n"); @@ -7056,7 +7059,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface->resource.locations & location) { TRACE("surface is already in texture\n"); -@@ -1618,6 +2011,16 @@ +@@ -1622,6 +2015,16 @@ TRACE("Reloading because surface is dirty.\n"); wined3d_resource_load_location(&surface->resource, context, location); @@ -7073,7 +7076,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_evict_sysmem(surface); } -@@ -1700,6 +2103,7 @@ +@@ -1704,6 +2107,7 @@ void CDECL wined3d_surface_preload(struct wined3d_surface *surface) { @@ -7081,7 +7084,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c const struct wined3d_device *device = surface->resource.device; TRACE("surface %p.\n", surface); -@@ -1710,6 +2114,17 @@ +@@ -1714,6 +2118,17 @@ } wined3d_cs_emit_surface_preload(device->cs, surface); @@ -7099,7 +7102,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) -@@ -1917,6 +2332,7 @@ +@@ -1921,6 +2336,7 @@ { DeleteDC(surface->hDC); DeleteObject(surface->dib.DIBsection); @@ -7107,7 +7110,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.bitmap_data = NULL; surface->flags &= ~SFLAG_DIBSECTION; create_dib = TRUE; -@@ -1925,6 +2341,15 @@ +@@ -1929,6 +2345,15 @@ surface->resource.locations = 0; wined3d_resource_free_sysmem(&surface->resource); surface->resource.map_heap_memory = NULL; @@ -7123,7 +7126,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c width = texture_resource->width; height = texture_resource->height; -@@ -1950,7 +2375,11 @@ +@@ -1954,7 +2379,11 @@ else surface->flags &= ~SFLAG_NONPOW2; @@ -7135,7 +7138,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; -@@ -1992,11 +2421,19 @@ +@@ -1996,11 +2425,19 @@ if (!valid_location) { @@ -7155,7 +7158,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -2355,6 +2792,7 @@ +@@ -2359,6 +2796,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) { @@ -7163,7 +7166,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; -@@ -2363,6 +2801,13 @@ +@@ -2367,6 +2805,13 @@ struct wined3d_surface *dst; struct wined3d_context *context = NULL; struct wined3d_device *device = source->resource.device; @@ -7177,7 +7180,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conv = find_converter(source->resource.format->id, to_fmt); if (!conv) -@@ -2386,6 +2831,7 @@ +@@ -2390,6 +2835,7 @@ } dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); @@ -7185,7 +7188,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); -@@ -2426,6 +2872,32 @@ +@@ -2430,6 +2876,32 @@ if (context) context_release(context); return NULL; @@ -7218,7 +7221,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, -@@ -2493,6 +2965,7 @@ +@@ -2497,6 +2969,7 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -7226,10 +7229,10 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p.\n", surface); -@@ -2510,6 +2983,39 @@ - { +@@ -2515,6 +2988,40 @@ struct wined3d_box box; const struct wined3d_format *format = surface->resource.format; + unsigned int fmt_flags = surface->resource.format_flags; +#else /* STAGING_CSMT */ + TRACE("surface %p.\n", surface); + @@ -7249,6 +7252,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + struct wined3d_map_desc *map_desc, const RECT *rect, DWORD flags) +{ + const struct wined3d_format *format = surface->resource.format; ++ unsigned int fmt_flags = surface->resource.format_flags; + struct wined3d_device *device = surface->resource.device; + struct wined3d_context *context; + const struct wined3d_gl_info *gl_info; @@ -7264,9 +7268,9 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + } +#endif /* STAGING_CSMT */ - if ((format->flags & WINED3DFMT_FLAG_BLOCKS) && rect + if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && rect && !surface_check_block_align(surface, rect)) -@@ -2521,6 +3027,13 @@ +@@ -2526,6 +3033,13 @@ return WINED3DERR_INVALIDCALL; } @@ -7280,7 +7284,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 -@@ -2536,6 +3049,7 @@ +@@ -2541,6 +3055,7 @@ } } @@ -7288,7 +7292,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (rect) { surface->lockedRect = *rect; -@@ -2600,22 +3114,121 @@ +@@ -2605,20 +3120,119 @@ WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->resource.format->id)); return WINED3DERR_INVALIDCALL; } @@ -7322,8 +7326,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c - TRACE("Returning dc %p.\n", *dc); + if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) + surface_invalidate_location(surface, ~surface->resource.map_binding); - -- return *dc ? WINED3D_OK : WINED3DERR_INVALIDCALL; ++ + switch (surface->resource.map_binding) + { + case WINED3D_LOCATION_SYSMEM: @@ -7355,7 +7358,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + base_memory = NULL; + } + -+ if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) ++ if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + map_desc->row_pitch = surface->resource.width * format->byte_count; + else + wined3d_resource_get_pitch(&surface->resource, &map_desc->row_pitch, &map_desc->slice_pitch); @@ -7371,7 +7374,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + } + else + { -+ if ((format->flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) ++ if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) + { + /* Compressed textures are block based, so calculate the offset of + * the block that contains the top-left pixel of the locked rectangle. */ @@ -7418,12 +7421,10 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + wined3d_cs_emit_getdc(device->cs, surface); + *dc = surface->hDC; + TRACE("Returning dc %p.\n", *dc); -+ -+ return *dc ? WINED3D_OK : WINED3DERR_INVALIDCALL; - } - void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) -@@ -2641,6 +3254,35 @@ + return *dc ? WINED3D_OK : WINED3DERR_INVALIDCALL; + } +@@ -2646,6 +3260,35 @@ if (context) context_release(context); } @@ -7459,7 +7460,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -@@ -2660,6 +3302,7 @@ +@@ -2665,6 +3308,7 @@ surface->resource.map_count--; surface->flags &= ~SFLAG_DCINUSE; @@ -7467,7 +7468,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; -@@ -2672,6 +3315,31 @@ +@@ -2677,6 +3321,31 @@ const struct wined3d_gl_info *gl_info; struct wined3d_context *context; struct wined3d_surface *restore_rt; @@ -7499,7 +7500,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BYTE *mem; BYTE *row, *top, *bottom; int i; -@@ -2679,6 +3347,7 @@ +@@ -2684,6 +3353,7 @@ struct wined3d_bo_address data; UINT row_pitch, slice_pitch; @@ -7507,7 +7508,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 -@@ -2696,6 +3365,11 @@ +@@ -2701,6 +3371,11 @@ context = context_acquire(device, surface); } @@ -7519,7 +7520,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context_apply_blit_state(context, device); gl_info = context->gl_info; -@@ -2784,12 +3458,16 @@ +@@ -2789,12 +3464,16 @@ checkGLcall("glBindBuffer"); } @@ -7536,7 +7537,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Read the framebuffer contents into a texture. Note that this function -@@ -2851,6 +3529,85 @@ +@@ -2856,6 +3535,85 @@ } } @@ -7622,7 +7623,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, -@@ -2957,8 +3714,13 @@ +@@ -2962,8 +3720,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. */ @@ -7636,7 +7637,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Uses the hardware to stretch and flip the image */ -@@ -3026,7 +3788,11 @@ +@@ -3031,7 +3794,11 @@ checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -7648,7 +7649,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 -@@ -3223,6 +3989,7 @@ +@@ -3228,6 +3995,7 @@ checkGLcall("glDeleteTextures(1, &backup)"); } @@ -7656,7 +7657,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) -@@ -3234,6 +4001,17 @@ +@@ -3239,6 +4007,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); @@ -7674,7 +7675,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3264,6 +4042,7 @@ +@@ -3269,6 +4048,7 @@ rect->bottom = drawable_height - rect->bottom; } @@ -7682,7 +7683,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, -@@ -3298,6 +4077,26 @@ +@@ -3303,6 +4083,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. */ @@ -7709,7 +7710,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 */ -@@ -3340,6 +4139,7 @@ +@@ -3345,6 +4145,7 @@ /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -7717,7 +7718,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 -@@ -3353,6 +4153,14 @@ +@@ -3358,6 +4159,14 @@ context = context_acquire(device, restore_rt); context_release(context); } @@ -7732,7 +7733,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) -@@ -3376,8 +4184,13 @@ +@@ -3381,8 +4190,13 @@ enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -7746,7 +7747,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), -@@ -3568,6 +4381,7 @@ +@@ -3573,6 +4387,7 @@ { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -7754,7 +7755,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))) -@@ -3576,6 +4390,15 @@ +@@ -3581,6 +4396,15 @@ surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; surface->resource.locations = location; @@ -7770,7 +7771,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Context activation is done by the caller. */ -@@ -3590,7 +4413,11 @@ +@@ -3595,7 +4419,11 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -7782,7 +7783,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; -@@ -3616,7 +4443,11 @@ +@@ -3621,7 +4449,11 @@ return; } @@ -7794,7 +7795,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Surface was discarded, no need copy data.\n"); switch (location) -@@ -3633,6 +4464,7 @@ +@@ -3638,6 +4470,7 @@ default: FIXME("Unhandled location %#x\n", location); } @@ -7802,7 +7803,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; -@@ -3644,6 +4476,19 @@ +@@ -3649,6 +4482,19 @@ { FIXME("No up to date depth stencil location.\n"); surface->resource.locations |= location; @@ -7822,7 +7823,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; -@@ -3708,9 +4553,13 @@ +@@ -3713,9 +4559,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7836,7 +7837,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) -@@ -3726,9 +4575,13 @@ +@@ -3731,9 +4581,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7850,7 +7851,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 -@@ -3736,6 +4589,7 @@ +@@ -3741,6 +4595,7 @@ ERR("Invalid location (%#x) specified.\n", location); } @@ -7858,7 +7859,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; -@@ -3781,6 +4635,135 @@ +@@ -3786,6 +4641,135 @@ TRACE("Surface was discarded, nothing to do.\n"); return WINED3D_OK; } @@ -7994,7 +7995,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)) -@@ -3790,6 +4773,7 @@ +@@ -3795,6 +4779,7 @@ } surface_get_rect(surface, NULL, &r); @@ -8002,7 +8003,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); -@@ -3858,6 +4842,66 @@ +@@ -3863,6 +4848,66 @@ RECT rect = {0, 0, surface->resource.width, surface->resource.height}; surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, @@ -8038,7 +8039,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + } + + if (surface->locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) -+ && (surface->resource.format->flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB) ++ && (surface->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB) + && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) @@ -8054,7 +8055,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + } + + if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) -+ && (!srgb || (surface->resource.format->flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)) ++ && (!srgb || (surface->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)) + && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) @@ -8069,7 +8070,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c &rect, surface, dst_location, &rect); return WINED3D_OK; -@@ -3867,6 +4911,7 @@ +@@ -3872,6 +4917,7 @@ if (srgb) { @@ -8077,7 +8078,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) { -@@ -3895,6 +4940,39 @@ +@@ -3900,6 +4946,39 @@ wined3d_resource_prepare_system_memory(&surface->resource); wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); } @@ -8117,7 +8118,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); -@@ -3909,7 +4987,11 @@ +@@ -3914,7 +4993,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. */ @@ -8129,7 +8130,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3918,6 +5000,7 @@ +@@ -3923,6 +5006,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -8137,7 +8138,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); -@@ -3925,6 +5008,14 @@ +@@ -3930,6 +5014,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -8152,7 +8153,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. */ -@@ -3970,6 +5061,7 @@ +@@ -3975,6 +5067,7 @@ wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); @@ -8160,7 +8161,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HeapFree(GetProcessHeap(), 0, mem); return WINED3D_OK; -@@ -3993,6 +5085,31 @@ +@@ -3998,6 +5091,31 @@ struct wined3d_context *context, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); @@ -8192,7 +8193,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)); -@@ -4000,6 +5117,7 @@ +@@ -4005,6 +5123,7 @@ if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -8200,7 +8201,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); -@@ -4009,21 +5127,63 @@ +@@ -4014,21 +5133,63 @@ && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) { /* Already up to date, nothing to do. */ @@ -8269,7 +8270,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -4032,6 +5192,7 @@ +@@ -4037,6 +5198,7 @@ case WINED3D_LOCATION_USER_MEMORY: case WINED3D_LOCATION_SYSMEM: case WINED3D_LOCATION_BUFFER: @@ -8277,7 +8278,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_load_sysmem(surface, context, location); break; -@@ -4049,6 +5210,24 @@ +@@ -4054,6 +5216,24 @@ if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) return; @@ -8302,7 +8303,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -4056,12 +5235,21 @@ +@@ -4061,12 +5241,21 @@ break; } @@ -8324,7 +8325,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; } -@@ -4171,6 +5359,7 @@ +@@ -4176,6 +5365,7 @@ const RECT *dst_rect, const struct wined3d_color *color) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8332,7 +8333,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; -@@ -4191,6 +5380,21 @@ +@@ -4196,6 +5386,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); @@ -8354,7 +8355,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4199,6 +5403,7 @@ +@@ -4204,6 +5409,7 @@ const RECT *dst_rect, float depth) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8362,7 +8363,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; -@@ -4214,6 +5419,20 @@ +@@ -4219,6 +5425,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); @@ -8383,7 +8384,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4226,6 +5445,7 @@ +@@ -4231,6 +5451,7 @@ /* Blit from offscreen surface to render target */ struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key; DWORD old_color_key_flags = src_surface->container->async.color_key_flags; @@ -8391,7 +8392,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_context *context; TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); -@@ -4243,6 +5463,22 @@ +@@ -4248,6 +5469,22 @@ 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); @@ -8414,15 +8415,15 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } const struct blit_shader ffp_blit = { -@@ -4401,6 +5637,7 @@ - int bpp, srcheight, srcwidth, dstheight, dstwidth, width; +@@ -4407,6 +5644,7 @@ const struct wined3d_format *src_format, *dst_format; + unsigned int src_fmt_flags, dst_fmt_flags; struct wined3d_texture *src_texture = NULL; +#if defined(STAGING_CSMT) void *src_data = NULL, *dst_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const BYTE *sbase = NULL; -@@ -4431,6 +5668,23 @@ +@@ -4437,6 +5675,23 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -8445,9 +8446,9 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +#endif /* STAGING_CSMT */ src_format = dst_surface->resource.format; dst_format = src_format; - } -@@ -4439,12 +5693,14 @@ - dst_format = dst_surface->resource.format; + dst_fmt_flags = dst_surface->resource.format_flags; +@@ -4448,12 +5703,14 @@ + dst_fmt_flags = dst_surface->resource.format_flags; if (src_surface) { +#if defined(STAGING_CSMT) @@ -8461,7 +8462,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))) -@@ -4455,9 +5711,13 @@ +@@ -4464,9 +5721,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -8473,10 +8474,10 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + wined3d_surface_map(src_surface, &src_map, NULL, WINED3D_MAP_READONLY); +#endif /* STAGING_CSMT */ src_format = src_surface->resource.format; + src_fmt_flags = src_surface->resource.format_flags; } - else -@@ -4465,8 +5725,12 @@ - src_format = dst_format; +@@ -4476,8 +5737,12 @@ + src_fmt_flags = dst_fmt_flags; } +#if defined(STAGING_CSMT) @@ -8488,7 +8489,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_surface->resource.format->byte_count; -@@ -4477,12 +5741,24 @@ +@@ -4488,12 +5753,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -8511,9 +8512,9 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + + ((dst_rect->left / dst_format->block_width) * dst_format->block_byte_count); +#endif /* STAGING_CSMT */ - if (src_format->flags & dst_format->flags & WINED3DFMT_FLAG_BLOCKS) + if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4517,7 +5793,11 @@ +@@ -4528,7 +5805,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -8525,7 +8526,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format, flags, fx); goto release; } -@@ -4525,7 +5805,11 @@ +@@ -4536,7 +5817,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -8537,7 +8538,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c flags &= ~WINEDDBLT_COLORFILL; } -@@ -4574,6 +5858,7 @@ +@@ -4585,6 +5870,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -8545,7 +8546,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4587,6 +5872,21 @@ +@@ -4598,6 +5884,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -8567,7 +8568,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c memcpy(dbuf, sbuf, width); } } -@@ -4596,8 +5896,13 @@ +@@ -4607,8 +5908,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -8581,7 +8582,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4606,9 +5911,15 @@ +@@ -4617,9 +5923,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8597,7 +8598,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4618,6 +5929,7 @@ +@@ -4629,6 +5941,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8605,7 +8606,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)) -@@ -4625,6 +5937,15 @@ +@@ -4636,6 +5949,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -8621,7 +8622,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4671,6 +5992,7 @@ +@@ -4682,6 +6004,7 @@ } #undef STRETCH_ROW } @@ -8629,7 +8630,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dbuf += dst_row_pitch; last_sy = sy; } -@@ -4679,6 +6001,16 @@ +@@ -4690,6 +6013,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -8646,7 +8647,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)) -@@ -4728,7 +6060,11 @@ +@@ -4739,7 +6072,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -8658,7 +8659,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4805,6 +6141,7 @@ +@@ -4816,6 +6153,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -8666,7 +8667,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4826,6 +6163,29 @@ +@@ -4837,6 +6175,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -8696,7 +8697,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c switch (bpp) { -@@ -4844,7 +6204,11 @@ +@@ -4855,7 +6216,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8708,7 +8709,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4875,10 +6239,12 @@ +@@ -4886,10 +6251,12 @@ } } @@ -8721,7 +8722,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4886,6 +6252,7 @@ +@@ -4897,6 +6264,7 @@ } release: @@ -8729,7 +8730,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); -@@ -4904,6 +6271,14 @@ +@@ -4915,6 +6283,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -8744,7 +8745,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -4948,6 +6323,7 @@ +@@ -4959,6 +6335,7 @@ cpu_blit_blit_surface, }; @@ -8752,7 +8753,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) -@@ -4955,6 +6331,16 @@ +@@ -4966,6 +6343,16 @@ struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_device *device = dst_surface->resource.device; DWORD src_ds_flags, dst_ds_flags; @@ -8769,7 +8770,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -4965,6 +6351,106 @@ +@@ -4976,6 +6363,106 @@ | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -8876,7 +8877,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5007,8 +6493,13 @@ +@@ -5018,8 +6505,13 @@ } scale = src_surface @@ -8889,8 +8890,8 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +#endif /* STAGING_CSMT */ 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); -@@ -5026,6 +6517,7 @@ + dst_ds_flags = dst_surface->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); +@@ -5037,6 +6529,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -8898,7 +8899,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))) -@@ -5036,6 +6528,24 @@ +@@ -5047,6 +6540,24 @@ if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding, src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect))) return; @@ -8923,7 +8924,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -5044,8 +6554,13 @@ +@@ -5055,8 +6566,13 @@ /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ @@ -8937,7 +8938,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5066,8 +6581,13 @@ +@@ -5077,8 +6593,13 @@ palette, fx->u5.dwFillColor, &color)) goto fallback; @@ -8951,7 +8952,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -5085,8 +6605,13 @@ +@@ -5096,8 +6617,13 @@ color_key = &src_surface->container->async.src_blt_color_key; blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY; } @@ -8965,7 +8966,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { /* Upload */ if (scale) -@@ -5095,6 +6620,7 @@ +@@ -5106,6 +6632,7 @@ TRACE("Not doing upload because of format conversion.\n"); else { @@ -8973,7 +8974,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))) -@@ -5107,6 +6633,15 @@ +@@ -5118,6 +6645,15 @@ context_release(context); } return; @@ -8989,7 +8990,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -5130,6 +6665,7 @@ +@@ -5141,6 +6677,7 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -8997,7 +8998,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; } -@@ -5325,6 +6861,49 @@ +@@ -5336,6 +6873,49 @@ wined3d_surface_location_invalidated, wined3d_surface_load_location, }; @@ -9047,7 +9048,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) -@@ -5392,7 +6971,11 @@ +@@ -5403,7 +6983,11 @@ } surface->container = container; @@ -9059,7 +9060,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5424,9 +7007,14 @@ +@@ -5435,9 +7019,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -9074,7 +9075,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } return hr; -@@ -5453,7 +7041,11 @@ +@@ -5464,7 +7053,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr); @@ -9641,7 +9642,7 @@ diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -128,7 +128,9 @@ +@@ -131,7 +131,9 @@ ERR("Failed to allocate system memory.\n"); return E_OUTOFMEMORY; } @@ -9651,7 +9652,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c } else { -@@ -152,6 +154,7 @@ +@@ -155,6 +157,7 @@ return WINED3D_OK; } @@ -9659,7 +9660,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c void wined3d_resource_free_bo(struct wined3d_resource *resource) { struct wined3d_context *context = context_acquire(resource->device, NULL); -@@ -177,6 +180,7 @@ +@@ -180,6 +183,7 @@ resource->map_heap_memory = NULL; } @@ -9667,7 +9668,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c void resource_cleanup(struct wined3d_resource *resource) { const struct wined3d *d3d = resource->device->wined3d; -@@ -189,7 +193,11 @@ +@@ -192,7 +196,11 @@ adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); } @@ -9679,7 +9680,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c device_resource_released(resource->device, resource); } -@@ -199,9 +207,11 @@ +@@ -202,9 +210,11 @@ if (resource->map_count) ERR("Resource %p is being unloaded while mapped.\n", resource); @@ -9691,7 +9692,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c context_resource_unloaded(resource->device, resource, resource->type); } -@@ -264,7 +274,11 @@ +@@ -267,7 +277,11 @@ p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1; *p = mem; @@ -9703,7 +9704,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c return TRUE; } -@@ -330,7 +344,11 @@ +@@ -333,7 +347,11 @@ return ret; } @@ -9715,7 +9716,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c { if (d3d_flags & WINED3D_MAP_READONLY) return GL_READ_ONLY_ARB; -@@ -400,6 +418,7 @@ +@@ -403,6 +421,7 @@ TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); } @@ -9723,7 +9724,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) { -@@ -946,3 +965,4 @@ +@@ -949,3 +968,4 @@ wined3d_resource_invalidate_location(resource, ~resource->map_binding); }