From bad649359737a4916a1626d8fc8eac47d234115c Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Tue, 5 Jan 2016 22:38:02 +0100 Subject: [PATCH] Rebase against 367b30d8278684aaff373f5666b78264137d7a8f. --- README.md | 4 +- ...nt-D3DXCreateAnimationController-wit.patch | 10 +- ...ximum-window-size-to-screen-buffer-.patch} | 0 ...-the-largest-console-window-size-inf.patch | 54 -- ...mplement-GetLargestConsoleWindowSize.patch | 65 -- ...rnel32-Add-a-stub-for-SetConsoleFont.patch | 44 -- ...efresh-the-console-to-clear-the-cons.patch | 38 -- ...dd-tests-for-GetLargestConsoleWindow.patch | 93 --- .../definition | 1 - ...tLogicalProcessorInformationEx-a-stu.patch | 38 -- .../definition | 1 - patches/patchinstall.sh | 40 +- ...ore-volume-locations-in-the-resource.patch | 37 +- ...d-Remove-surface_invalidate_location.patch | 62 +- ...surface_load_location-with-resource_.patch | 87 ++- ...ume-PBO-infrastructure-into-the-reso.patch | 44 +- ...ve-buffer-creation-into-the-resource.patch | 44 +- ...-sysmem-for-client-storage-if-it-doe.patch | 37 - ...surface-alloc-functions-with-resourc.patch | 48 +- ...Use-client-storage-with-DIB-sections.patch | 78 --- ...ad-buffers-if-streamsrc-is-not-dirty.patch | 18 +- ...ned3d-Don-t-preload-buffers-on-unmap.patch | 8 +- ...he-buffer-dirty-areas-through-the-CS.patch | 22 +- ...-GL-buffer-discard-control-from-igno.patch | 24 +- ...eate-VBOs-through-the-command-stream.patch | 26 +- ...-buffer-resource-data-through-the-CS.patch | 26 +- ...dc-and-releasedc-through-the-command.patch | 35 +- ...e-buffer-map-array-before-mapping-th.patch | 17 +- .../wined3d-CSMT_Main/9999-IfDefined.patch | 642 ++++++++---------- staging/changelog | 4 + 30 files changed, 523 insertions(+), 1124 deletions(-) rename patches/kernel32-GetLargestConsoleWindowSize/{0006-kernel32-Clamp-maximum-window-size-to-screen-buffer-.patch => 0001-kernel32-Clamp-maximum-window-size-to-screen-buffer-.patch} (100%) delete mode 100644 patches/kernel32-GetLargestConsoleWindowSize/0001-wineconsole-Send-the-largest-console-window-size-inf.patch delete mode 100644 patches/kernel32-GetLargestConsoleWindowSize/0002-kernel32-Implement-GetLargestConsoleWindowSize.patch delete mode 100644 patches/kernel32-GetLargestConsoleWindowSize/0003-kernel32-Add-a-stub-for-SetConsoleFont.patch delete mode 100644 patches/kernel32-GetLargestConsoleWindowSize/0004-kernel32-tests-Refresh-the-console-to-clear-the-cons.patch delete mode 100644 patches/kernel32-GetLargestConsoleWindowSize/0005-kernel32-tests-Add-tests-for-GetLargestConsoleWindow.patch delete mode 100644 patches/kernel32-GetLargestConsoleWindowSize/definition delete mode 100644 patches/kernel32-GetLogicalProcessorInformationEx/0001-kernel32-Make-GetLogicalProcessorInformationEx-a-stu.patch delete mode 100644 patches/kernel32-GetLogicalProcessorInformationEx/definition delete mode 100644 patches/wined3d-CSMT_Main/0025-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch delete mode 100644 patches/wined3d-CSMT_Main/0035-wined3d-Use-client-storage-with-DIB-sections.patch diff --git a/README.md b/README.md index 08c20a15..2c9c45d5 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ for more details.* * Basic handling of write watches triggered while we're on the signal stack. * Basic support for CUDA * Black & White needs DXTn software decoding support ([Wine Bug #14939](https://bugs.winehq.org/show_bug.cgi?id=14939)) -* CPU-Z fails to start because GetLogicalProcessorInformationEx returns FALSE +* ~~CPU-Z fails to start because GetLogicalProcessorInformationEx returns FALSE~~ * Calculate msvcrt exponential math operations with higher precision ([Wine Bug #37149](https://bugs.winehq.org/show_bug.cgi?id=37149)) * Catch invalid memory accesses in imagehlp.CheckSumMappedFile * Check IsWoW64Process before calling Wow64 functions in UNIXFS_get_unix_path @@ -243,7 +243,7 @@ for more details.* * Process APC calls before starting process * Properly close sockets when WSACleanup is called ([Wine Bug #18670](https://bugs.winehq.org/show_bug.cgi?id=18670)) * Properly handle multiple registry notifications per key -* Properly implement GetLargestConsoleWindowSize ([Wine Bug #10919](https://bugs.winehq.org/show_bug.cgi?id=10919)) +* ~~Properly implement GetLargestConsoleWindowSize~~ ([Wine Bug #10919](https://bugs.winehq.org/show_bug.cgi?id=10919)) * Properly implement imagehlp.ImageLoad and ImageUnload ([Wine Bug #23455](https://bugs.winehq.org/show_bug.cgi?id=23455)) * Properly initialize caps->dwZBufferBitDepths in ddraw7_GetCaps ([Wine Bug #27002](https://bugs.winehq.org/show_bug.cgi?id=27002)) * Properly render themed buttons when they are pressed ([Wine Bug #37584](https://bugs.winehq.org/show_bug.cgi?id=37584)) diff --git a/patches/d3dx9_36-AnimationController/0001-d3dx9_36-Implement-D3DXCreateAnimationController-wit.patch b/patches/d3dx9_36-AnimationController/0001-d3dx9_36-Implement-D3DXCreateAnimationController-wit.patch index c9cf3752..10dc47a5 100644 --- a/patches/d3dx9_36-AnimationController/0001-d3dx9_36-Implement-D3DXCreateAnimationController-wit.patch +++ b/patches/d3dx9_36-AnimationController/0001-d3dx9_36-Implement-D3DXCreateAnimationController-wit.patch @@ -1,4 +1,4 @@ -From 9ec1a00c3d775cd5abd91ec88af216d669136152 Mon Sep 17 00:00:00 2001 +From 5d2fa4b454acdbcecd8967ca885ae6a8e8557e5c Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Sat, 17 Jan 2015 23:54:14 +0100 Subject: d3dx9_36: Implement D3DXCreateAnimationController with a stubbed @@ -13,7 +13,7 @@ Subject: d3dx9_36: Implement D3DXCreateAnimationController with a stubbed create mode 100644 dlls/d3dx9_36/animation.c diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in -index aa387b5..fd710c2 100644 +index 5958c57..95e3045 100644 --- a/dlls/d3dx9_36/Makefile.in +++ b/dlls/d3dx9_36/Makefile.in @@ -3,6 +3,7 @@ IMPORTLIB = d3dx9 @@ -486,12 +486,12 @@ index 0000000..72f685f + return D3D_OK; +} diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec -index 13f0d99..4182f59 100644 +index 5eda041..aa7c928 100644 --- a/dlls/d3dx9_36/d3dx9_36.spec +++ b/dlls/d3dx9_36/d3dx9_36.spec @@ -30,7 +30,7 @@ @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) - @ stub D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) + @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) @ stub D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) -@ stub D3DXCreateAnimationController(long long long long ptr) +@ stdcall D3DXCreateAnimationController(long long long long ptr) @@ -532,5 +532,5 @@ index b5f2232..c4d4d64 100644 UINT max_num_tracks, UINT max_num_events, ID3DXAnimationController **anim_controller) PURE; }; -- -2.2.1 +2.6.4 diff --git a/patches/kernel32-GetLargestConsoleWindowSize/0006-kernel32-Clamp-maximum-window-size-to-screen-buffer-.patch b/patches/kernel32-GetLargestConsoleWindowSize/0001-kernel32-Clamp-maximum-window-size-to-screen-buffer-.patch similarity index 100% rename from patches/kernel32-GetLargestConsoleWindowSize/0006-kernel32-Clamp-maximum-window-size-to-screen-buffer-.patch rename to patches/kernel32-GetLargestConsoleWindowSize/0001-kernel32-Clamp-maximum-window-size-to-screen-buffer-.patch diff --git a/patches/kernel32-GetLargestConsoleWindowSize/0001-wineconsole-Send-the-largest-console-window-size-inf.patch b/patches/kernel32-GetLargestConsoleWindowSize/0001-wineconsole-Send-the-largest-console-window-size-inf.patch deleted file mode 100644 index 7392bc04..00000000 --- a/patches/kernel32-GetLargestConsoleWindowSize/0001-wineconsole-Send-the-largest-console-window-size-inf.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 621d31b627bd14ab424e20f76c9dc2d786e5ec9e Mon Sep 17 00:00:00 2001 -From: Hugh McMaster -Date: Fri, 4 Dec 2015 15:47:42 +1100 -Subject: wineconsole: Send the largest console window size information to the - server - -Signed-off-by: Hugh McMaster ---- - programs/wineconsole/wineconsole.c | 6 +++++- - server/console.c | 7 ------- - 2 files changed, 5 insertions(+), 8 deletions(-) - -diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c -index 7a89eeb..729416f 100644 ---- a/programs/wineconsole/wineconsole.c -+++ b/programs/wineconsole/wineconsole.c -@@ -424,11 +424,15 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf - if (strcmpiW(data->curcfg.face_name, cfg->face_name) || data->curcfg.cell_width != cfg->cell_width || - data->curcfg.cell_height != cfg->cell_height || data->curcfg.font_weight != cfg->font_weight) - { -+ RECT r; - data->fnSetFont(data, cfg->face_name, cfg->cell_height, cfg->font_weight); -+ SystemParametersInfoW(SPI_GETWORKAREA, 0, &r, 0); - SERVER_START_REQ(set_console_output_info) - { - req->handle = wine_server_obj_handle( data->hConOut ); -- req->mask = SET_CONSOLE_OUTPUT_INFO_FONT; -+ req->mask = SET_CONSOLE_OUTPUT_INFO_MAX_SIZE | SET_CONSOLE_OUTPUT_INFO_FONT; -+ req->max_width = (r.right - r.left) / cfg->cell_width; -+ req->max_height = (r.bottom - r.top - GetSystemMetrics(SM_CYCAPTION)) / cfg->cell_height; - req->font_width = cfg->cell_width; - req->font_height = cfg->cell_height; - wine_server_call( req ); -diff --git a/server/console.c b/server/console.c -index a57b2fe..9b01614 100644 ---- a/server/console.c -+++ b/server/console.c -@@ -1018,13 +1018,6 @@ static int set_console_output_info( struct screen_buffer *screen_buffer, - } - if (req->mask & SET_CONSOLE_OUTPUT_INFO_MAX_SIZE) - { -- /* can only be done by renderer */ -- if (current->process->console != screen_buffer->input) -- { -- set_error( STATUS_INVALID_PARAMETER ); -- return 0; -- } -- - screen_buffer->max_width = req->max_width; - screen_buffer->max_height = req->max_height; - } --- -2.6.2 - diff --git a/patches/kernel32-GetLargestConsoleWindowSize/0002-kernel32-Implement-GetLargestConsoleWindowSize.patch b/patches/kernel32-GetLargestConsoleWindowSize/0002-kernel32-Implement-GetLargestConsoleWindowSize.patch deleted file mode 100644 index ba7dea35..00000000 --- a/patches/kernel32-GetLargestConsoleWindowSize/0002-kernel32-Implement-GetLargestConsoleWindowSize.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 56d5cc64d9047dc5f9866ff2542eb0f07f9ad75d Mon Sep 17 00:00:00 2001 -From: Hugh McMaster -Date: Fri, 4 Dec 2015 15:48:12 +1100 -Subject: kernel32: Implement GetLargestConsoleWindowSize - -Signed-off-by: Hugh McMaster ---- - dlls/kernel32/console.c | 24 +++++++++++++++++++----- - 1 file changed, 19 insertions(+), 5 deletions(-) - -diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c -index 51d6e60..f48bca7 100644 ---- a/dlls/kernel32/console.c -+++ b/dlls/kernel32/console.c -@@ -1360,6 +1360,22 @@ DWORD WINAPI GetConsoleTitleW(LPWSTR title, DWORD size) - return ret; - } - -+static COORD get_largest_console_window_size(HANDLE hConsole) -+{ -+ COORD c = {0,0}; -+ -+ SERVER_START_REQ(get_console_output_info) -+ { -+ req->handle = console_handle_unmap(hConsole); -+ if (!wine_server_call_err(req)) -+ { -+ c.X = reply->max_width; -+ c.Y = reply->max_height; -+ } -+ } -+ SERVER_END_REQ; -+ return c; -+} - - /*********************************************************************** - * GetLargestConsoleWindowSize (KERNEL32.@) -@@ -1378,8 +1394,7 @@ DWORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) - COORD c; - DWORD w; - } x; -- x.c.X = 80; -- x.c.Y = 24; -+ x.c = get_largest_console_window_size(hConsoleOutput); - TRACE("(%p), returning %dx%d (%x)\n", hConsoleOutput, x.c.X, x.c.Y, x.w); - return x.w; - } -@@ -1399,12 +1414,11 @@ DWORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) - COORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) - { - COORD c; -- c.X = 80; -- c.Y = 24; -+ c = get_largest_console_window_size(hConsoleOutput); - TRACE("(%p), returning %dx%d\n", hConsoleOutput, c.X, c.Y); - return c; - } --#endif /* defined(__i386__) */ -+#endif /* !defined(__i386__) */ - - static WCHAR* S_EditString /* = NULL */; - static unsigned S_EditStrPos /* = 0 */; --- -2.6.2 - diff --git a/patches/kernel32-GetLargestConsoleWindowSize/0003-kernel32-Add-a-stub-for-SetConsoleFont.patch b/patches/kernel32-GetLargestConsoleWindowSize/0003-kernel32-Add-a-stub-for-SetConsoleFont.patch deleted file mode 100644 index b367d34c..00000000 --- a/patches/kernel32-GetLargestConsoleWindowSize/0003-kernel32-Add-a-stub-for-SetConsoleFont.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0042b3a28cc7fbe462850eb600df0424a8dfb1e5 Mon Sep 17 00:00:00 2001 -From: Hugh McMaster -Date: Fri, 4 Dec 2015 16:00:27 +1100 -Subject: kernel32: Add a stub for SetConsoleFont - -Signed-off-by: Hugh McMaster ---- - dlls/kernel32/console.c | 6 ++++++ - dlls/kernel32/kernel32.spec | 2 +- - 2 files changed, 7 insertions(+), 1 deletion(-) - -diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c -index f48bca7..3c53b52 100644 ---- a/dlls/kernel32/console.c -+++ b/dlls/kernel32/console.c -@@ -3256,6 +3256,12 @@ DWORD WINAPI GetNumberOfConsoleFonts(void) - return 1; - } - -+BOOL WINAPI SetConsoleFont(HANDLE hConsole, DWORD index) -+{ -+ FIXME("(%p, %u): stub!\n", hConsole, index); -+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); -+ return FALSE; -+} - - BOOL WINAPI SetConsoleKeyShortcuts(BOOL set, BYTE keys, VOID *a, DWORD b) - { -diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec -index ff67e54..d10e6bb 100644 ---- a/dlls/kernel32/kernel32.spec -+++ b/dlls/kernel32/kernel32.spec -@@ -1345,7 +1345,7 @@ - @ stub SetConsoleCursorMode - @ stdcall SetConsoleCursorPosition(long long) - @ stdcall SetConsoleDisplayMode(long long ptr) --@ stub SetConsoleFont -+@ stdcall SetConsoleFont(long long) - @ stub SetConsoleHardwareState - @ stdcall SetConsoleIcon(ptr) - @ stdcall SetConsoleInputExeNameA(ptr) --- -2.6.2 - diff --git a/patches/kernel32-GetLargestConsoleWindowSize/0004-kernel32-tests-Refresh-the-console-to-clear-the-cons.patch b/patches/kernel32-GetLargestConsoleWindowSize/0004-kernel32-tests-Refresh-the-console-to-clear-the-cons.patch deleted file mode 100644 index a9076164..00000000 --- a/patches/kernel32-GetLargestConsoleWindowSize/0004-kernel32-tests-Refresh-the-console-to-clear-the-cons.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 3935a3728751863c959f1f45e8e1866ed98c3ce4 Mon Sep 17 00:00:00 2001 -From: Hugh McMaster -Date: Fri, 4 Dec 2015 16:02:38 +1100 -Subject: kernel32/tests: Refresh the console to clear the console font table - -The testScreenBuffer function unintentionally causes the console -font table to duplicate. This patch clears the font table. - -Signed-off-by: Hugh McMaster ---- - dlls/kernel32/tests/console.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c -index 240d9d8..3ba1da5 100644 ---- a/dlls/kernel32/tests/console.c -+++ b/dlls/kernel32/tests/console.c -@@ -2787,6 +2787,17 @@ START_TEST(console) - testScroll(hConOut, sbi.dwSize); - /* will test sb creation / modification / codepage handling */ - testScreenBuffer(hConOut); -+ -+ /* clear duplicated console font table */ -+ CloseHandle(hConIn); -+ CloseHandle(hConOut); -+ FreeConsole(); -+ ok(AllocConsole(), "Couldn't alloc console\n"); -+ hConIn = CreateFileA("CONIN$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); -+ hConOut = CreateFileA("CONOUT$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); -+ ok(hConIn != INVALID_HANDLE_VALUE, "Opening ConIn\n"); -+ ok(hConOut != INVALID_HANDLE_VALUE, "Opening ConOut\n"); -+ - testCtrlHandler(); - /* still to be done: access rights & access on objects */ - --- -2.6.2 - diff --git a/patches/kernel32-GetLargestConsoleWindowSize/0005-kernel32-tests-Add-tests-for-GetLargestConsoleWindow.patch b/patches/kernel32-GetLargestConsoleWindowSize/0005-kernel32-tests-Add-tests-for-GetLargestConsoleWindow.patch deleted file mode 100644 index f2934fa1..00000000 --- a/patches/kernel32-GetLargestConsoleWindowSize/0005-kernel32-tests-Add-tests-for-GetLargestConsoleWindow.patch +++ /dev/null @@ -1,93 +0,0 @@ -From cea4e680a6e23edcbbba8d0457834ee15c2f7c3a Mon Sep 17 00:00:00 2001 -From: Hugh McMaster -Date: Fri, 4 Dec 2015 16:07:24 +1100 -Subject: kernel32/tests: Add tests for GetLargestConsoleWindowSize - -Signed-off-by: Hugh McMaster ---- - dlls/kernel32/tests/console.c | 64 +++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 64 insertions(+) - -diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c -index 3ba1da5..f362415 100644 ---- a/dlls/kernel32/tests/console.c -+++ b/dlls/kernel32/tests/console.c -@@ -2681,6 +2681,69 @@ static void test_GetConsoleFontSize(HANDLE std_output) - ok(!c.Y, "got %d, expected 0\n", c.Y); - } - -+static void test_GetLargestConsoleWindowSize(HANDLE std_output) -+{ -+ COORD c, font; -+ RECT r; -+ LONG workarea_w, workarea_h, maxcon_w, maxcon_h; -+ CONSOLE_FONT_INFO cfi; -+ DWORD index, i; -+ HMODULE hmod; -+ DWORD (WINAPI *pGetNumberOfConsoleFonts)(void); -+ BOOL (WINAPI *pSetConsoleFont)(HANDLE, DWORD); -+ -+ memset(&c, 10, sizeof(COORD)); -+ SetLastError(0xdeadbeef); -+ c = GetLargestConsoleWindowSize(NULL); -+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); -+ ok(!c.X, "got %d, expected 0\n", c.X); -+ ok(!c.Y, "got %d, expected 0\n", c.Y); -+ -+ memset(&c, 10, sizeof(COORD)); -+ SetLastError(0xdeadbeef); -+ c = GetLargestConsoleWindowSize(GetStdHandle(STD_INPUT_HANDLE)); -+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); -+ ok(!c.X, "got %d, expected 0\n", c.X); -+ ok(!c.Y, "got %d, expected 0\n", c.Y); -+ -+ SystemParametersInfoW(SPI_GETWORKAREA, 0, &r, 0); -+ workarea_w = r.right - r.left; -+ workarea_h = r.bottom - r.top - GetSystemMetrics(SM_CYCAPTION); -+ -+ GetCurrentConsoleFont(std_output, FALSE, &cfi); -+ index = cfi.nFont; /* save current font index */ -+ -+ hmod = GetModuleHandleA("kernel32.dll"); -+ pGetNumberOfConsoleFonts = (void *)GetProcAddress(hmod, "GetNumberOfConsoleFonts"); -+ if (!pGetNumberOfConsoleFonts) -+ { -+ win_skip("GetNumberOfConsoleFonts is not available\n"); -+ return; -+ } -+ pSetConsoleFont = (void *)GetProcAddress(hmod, "SetConsoleFont"); -+ if (!pSetConsoleFont) -+ { -+ win_skip("SetConsoleFont is not available\n"); -+ return; -+ } -+ -+ for (i = 0; i < pGetNumberOfConsoleFonts(); i++) -+ { -+ pSetConsoleFont(std_output, i); -+ memset(&c, 10, sizeof(COORD)); -+ SetLastError(0xdeadbeef); -+ c = GetLargestConsoleWindowSize(std_output); -+ ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); -+ GetCurrentConsoleFont(std_output, FALSE, &cfi); -+ font = GetConsoleFontSize(std_output, cfi.nFont); -+ maxcon_w = workarea_w / font.X; -+ maxcon_h = workarea_h / font.Y; -+ ok(c.X == maxcon_w || c.X == maxcon_w - 1 /* Win10 */, "got %d, expected %d\n", c.X, maxcon_w); -+ ok(c.Y == maxcon_h || c.Y == maxcon_h - 1 /* Win10 */, "got %d, expected %d\n", c.Y, maxcon_h); -+ } -+ pSetConsoleFont(std_output, index); /* restore original font size */ -+} -+ - START_TEST(console) - { - static const char font_name[] = "Lucida Console"; -@@ -2826,4 +2889,5 @@ START_TEST(console) - test_ReadConsoleOutputAttribute(hConOut); - test_GetCurrentConsoleFont(hConOut); - test_GetConsoleFontSize(hConOut); -+ test_GetLargestConsoleWindowSize(hConOut); - } --- -2.6.2 - diff --git a/patches/kernel32-GetLargestConsoleWindowSize/definition b/patches/kernel32-GetLargestConsoleWindowSize/definition deleted file mode 100644 index 0b417a40..00000000 --- a/patches/kernel32-GetLargestConsoleWindowSize/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [10919] Properly implement GetLargestConsoleWindowSize diff --git a/patches/kernel32-GetLogicalProcessorInformationEx/0001-kernel32-Make-GetLogicalProcessorInformationEx-a-stu.patch b/patches/kernel32-GetLogicalProcessorInformationEx/0001-kernel32-Make-GetLogicalProcessorInformationEx-a-stu.patch deleted file mode 100644 index 474aaa31..00000000 --- a/patches/kernel32-GetLogicalProcessorInformationEx/0001-kernel32-Make-GetLogicalProcessorInformationEx-a-stu.patch +++ /dev/null @@ -1,38 +0,0 @@ -From f7ea420c1ca707503214eba3c9bfce6719e66fdc Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Fri, 20 Jun 2014 21:16:39 +0200 -Subject: kernel32: Make GetLogicalProcessorInformationEx a stub which returns - TRUE. - ---- - dlls/kernel32/process.c | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c -index b371e73..24da577 100644 ---- a/dlls/kernel32/process.c -+++ b/dlls/kernel32/process.c -@@ -3831,8 +3831,18 @@ BOOL WINAPI GetLogicalProcessorInformation(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION - BOOL WINAPI GetLogicalProcessorInformationEx(LOGICAL_PROCESSOR_RELATIONSHIP relationship, PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX buffer, PDWORD pBufLen) - { - FIXME("(%u,%p,%p): stub\n", relationship, buffer, pBufLen); -- SetLastError(ERROR_CALL_NOT_IMPLEMENTED); -- return FALSE; -+ -+ if (!pBufLen) -+ { -+ SetLastError(ERROR_INVALID_PARAMETER); -+ return FALSE; -+ } -+ -+ /* MSDN says '[...] at least one SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX -+ * structure is written to the output buffer.' - don't be surprised if this -+ * stub doesn't work always. */ -+ *pBufLen = 0; -+ return TRUE; - } - - /*********************************************************************** --- -2.3.0 - diff --git a/patches/kernel32-GetLogicalProcessorInformationEx/definition b/patches/kernel32-GetLogicalProcessorInformationEx/definition deleted file mode 100644 index 2392d95c..00000000 --- a/patches/kernel32-GetLogicalProcessorInformationEx/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: CPU-Z fails to start because GetLogicalProcessorInformationEx returns FALSE diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index d0e82fcd..0009c0a6 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "f6998ea4ced8b2051df64dd81242416d903a90d7" + echo "367b30d8278684aaff373f5666b78264137d7a8f" } # Show version information @@ -158,7 +158,6 @@ patch_enable_all () enable_kernel32_FreeUserPhysicalPages="$1" enable_kernel32_GetFinalPathNameByHandle="$1" enable_kernel32_GetLargestConsoleWindowSize="$1" - enable_kernel32_GetLogicalProcessorInformationEx="$1" enable_kernel32_LocaleNameToLCID="$1" enable_kernel32_Named_Pipe="$1" enable_kernel32_NeedCurrentDirectoryForExePath="$1" @@ -589,9 +588,6 @@ patch_enable () kernel32-GetLargestConsoleWindowSize) enable_kernel32_GetLargestConsoleWindowSize="$2" ;; - kernel32-GetLogicalProcessorInformationEx) - enable_kernel32_GetLogicalProcessorInformationEx="$2" - ;; kernel32-LocaleNameToLCID) enable_kernel32_LocaleNameToLCID="$2" ;; @@ -3532,42 +3528,16 @@ fi # Patchset kernel32-GetLargestConsoleWindowSize # | -# | This patchset fixes the following Wine bugs: -# | * [#10919] Properly implement GetLargestConsoleWindowSize -# | # | Modified files: -# | * dlls/kernel32/console.c, dlls/kernel32/kernel32.spec, dlls/kernel32/tests/console.c, programs/wineconsole/wineconsole.c, -# | server/console.c +# | * dlls/kernel32/console.c, dlls/kernel32/tests/console.c # | if test "$enable_kernel32_GetLargestConsoleWindowSize" -eq 1; then - patch_apply kernel32-GetLargestConsoleWindowSize/0001-wineconsole-Send-the-largest-console-window-size-inf.patch - patch_apply kernel32-GetLargestConsoleWindowSize/0002-kernel32-Implement-GetLargestConsoleWindowSize.patch - patch_apply kernel32-GetLargestConsoleWindowSize/0003-kernel32-Add-a-stub-for-SetConsoleFont.patch - patch_apply kernel32-GetLargestConsoleWindowSize/0004-kernel32-tests-Refresh-the-console-to-clear-the-cons.patch - patch_apply kernel32-GetLargestConsoleWindowSize/0005-kernel32-tests-Add-tests-for-GetLargestConsoleWindow.patch - patch_apply kernel32-GetLargestConsoleWindowSize/0006-kernel32-Clamp-maximum-window-size-to-screen-buffer-.patch + patch_apply kernel32-GetLargestConsoleWindowSize/0001-kernel32-Clamp-maximum-window-size-to-screen-buffer-.patch ( - echo '+ { "Hugh McMaster", "wineconsole: Send the largest console window size information to the server.", 1 },'; - echo '+ { "Hugh McMaster", "kernel32: Implement GetLargestConsoleWindowSize.", 1 },'; - echo '+ { "Hugh McMaster", "kernel32: Add a stub for SetConsoleFont.", 1 },'; - echo '+ { "Hugh McMaster", "kernel32/tests: Refresh the console to clear the console font table.", 1 },'; - echo '+ { "Hugh McMaster", "kernel32/tests: Add tests for GetLargestConsoleWindowSize.", 1 },'; echo '+ { "Sebastian Lackner", "kernel32: Clamp maximum window size to screen buffer size.", 1 },'; ) >> "$patchlist" fi -# Patchset kernel32-GetLogicalProcessorInformationEx -# | -# | Modified files: -# | * dlls/kernel32/process.c -# | -if test "$enable_kernel32_GetLogicalProcessorInformationEx" -eq 1; then - patch_apply kernel32-GetLogicalProcessorInformationEx/0001-kernel32-Make-GetLogicalProcessorInformationEx-a-stu.patch - ( - echo '+ { "Sebastian Lackner", "kernel32: Make GetLogicalProcessorInformationEx a stub which returns TRUE.", 1 },'; - ) >> "$patchlist" -fi - # Patchset kernel32-LocaleNameToLCID # | # | This patchset fixes the following Wine bugs: @@ -6110,7 +6080,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then patch_apply wined3d-CSMT_Main/0022-wined3d-Discard-implicit-surfaces-on-unload.patch patch_apply wined3d-CSMT_Main/0023-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch patch_apply wined3d-CSMT_Main/0024-wined3d-Discard-the-backbuffer-in-discard-presents.patch - patch_apply wined3d-CSMT_Main/0025-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch patch_apply wined3d-CSMT_Main/0026-wined3d-Introduce-a-function-to-retrieve-resource-me.patch patch_apply wined3d-CSMT_Main/0027-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch patch_apply wined3d-CSMT_Main/0028-wined3d-Move-check_block_align-to-resource.c.patch @@ -6120,7 +6089,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then patch_apply wined3d-CSMT_Main/0032-wined3d-Move-simple-location-copying-to-the-resource.patch patch_apply wined3d-CSMT_Main/0033-wined3d-Move-most-of-volume_map-to-resource.c.patch patch_apply wined3d-CSMT_Main/0034-wined3d-Use-resource_map-for-surface_map.patch - patch_apply wined3d-CSMT_Main/0035-wined3d-Use-client-storage-with-DIB-sections.patch patch_apply wined3d-CSMT_Main/0036-wined3d-Don-t-call-the-public-map-function-in-surfac.patch patch_apply wined3d-CSMT_Main/0037-wined3d-Don-t-call-the-public-map-function-in-surfac.patch patch_apply wined3d-CSMT_Main/0038-wined3d-Move-the-framebuffer-into-wined3d_state.patch @@ -6284,7 +6252,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then echo '+ { "Stefan Dösinger", "wined3d: Discard implicit surfaces on unload.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Don'\''t try to flip sysmem copies in swapchain_present.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Discard the backbuffer in discard presents.", 1 },'; - echo '+ { "Stefan Dösinger", "wined3d: Allocate sysmem for client storage if it doesn'\''t exist already.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Introduce a function to retrieve resource memory.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Make surface_ops->unmap specific for front buffers.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Move check_block_align to resource.c.", 1 },'; @@ -6294,7 +6261,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then echo '+ { "Stefan Dösinger", "wined3d: Move simple location copying to the resource.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Move most of volume_map to resource.c.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Use resource_map for surface_map.", 1 },'; - echo '+ { "Stefan Dösinger", "wined3d: Use client storage with DIB sections.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call the public map function in surface_convert_format.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call the public map function in surface_cpu_blt.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Move the framebuffer into wined3d_state.", 1 },'; diff --git a/patches/wined3d-CSMT_Main/0004-wined3d-Store-volume-locations-in-the-resource.patch b/patches/wined3d-CSMT_Main/0004-wined3d-Store-volume-locations-in-the-resource.patch index 1bc810aa..07389f11 100644 --- a/patches/wined3d-CSMT_Main/0004-wined3d-Store-volume-locations-in-the-resource.patch +++ b/patches/wined3d-CSMT_Main/0004-wined3d-Store-volume-locations-in-the-resource.patch @@ -1,15 +1,15 @@ -From 81726de3e2c63759ff771038ec1a829758314bc7 Mon Sep 17 00:00:00 2001 +From d9832814763ffc0c5b9f43223507f049a60859f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 3 Oct 2013 12:31:24 +0200 Subject: wined3d: Store volume locations in the resource. --- dlls/wined3d/volume.c | 46 +++++++++++++++++++++--------------------- - dlls/wined3d/wined3d_private.h | 5 +++-- - 2 files changed, 26 insertions(+), 25 deletions(-) + dlls/wined3d/wined3d_private.h | 4 ++-- + 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 1a5e629..5f5fe8b 100644 +index c4bd3e7..d9405b9 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -102,15 +102,15 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine @@ -32,7 +32,7 @@ index 1a5e629..5f5fe8b 100644 } /* Context activation is done by the caller. */ -@@ -218,9 +218,9 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -216,9 +216,9 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, DWORD required_access = volume_access_from_location(location); TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location), @@ -44,7 +44,7 @@ index 1a5e629..5f5fe8b 100644 { TRACE("Location(s) already up to date.\n"); return; -@@ -243,36 +243,36 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -241,36 +241,36 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, && !(volume->container->flags & WINED3D_TEXTURE_SRGB_ALLOCATED))) ERR("Trying to load (s)RGB texture without prior allocation.\n"); @@ -87,7 +87,7 @@ index 1a5e629..5f5fe8b 100644 return; } wined3d_volume_validate_location(volume, location); -@@ -286,16 +286,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -284,16 +284,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, if (!volume->resource.heap_memory) ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n"); @@ -107,7 +107,7 @@ index 1a5e629..5f5fe8b 100644 wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -306,7 +306,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -304,7 +304,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, else { FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n", @@ -116,7 +116,7 @@ index 1a5e629..5f5fe8b 100644 return; } wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); -@@ -316,16 +316,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -314,16 +314,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, if (!volume->pbo) ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); @@ -136,7 +136,7 @@ index 1a5e629..5f5fe8b 100644 wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -335,7 +335,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -333,7 +333,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, else { FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n", @@ -145,7 +145,7 @@ index 1a5e629..5f5fe8b 100644 return; } wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER); -@@ -343,7 +343,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -341,7 +341,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, default: FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location), @@ -154,7 +154,7 @@ index 1a5e629..5f5fe8b 100644 } } -@@ -600,7 +600,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -565,7 +565,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, { wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); } @@ -163,7 +163,7 @@ index 1a5e629..5f5fe8b 100644 { context = context_acquire(device, NULL); wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM); -@@ -748,7 +748,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture +@@ -724,7 +724,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture } volume->texture_level = level; @@ -173,7 +173,7 @@ index 1a5e629..5f5fe8b 100644 if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC && gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 254dfd7..f2d3943 100644 +index f4b06a4..b25ce65 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -5,7 +5,7 @@ @@ -185,7 +185,7 @@ index 254dfd7..f2d3943 100644 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public -@@ -2123,6 +2123,7 @@ struct wined3d_resource +@@ -2197,6 +2197,7 @@ struct wined3d_resource void *heap_memory; UINT custom_row_pitch, custom_slice_pitch; struct list resource_list_entry; @@ -193,15 +193,14 @@ index 254dfd7..f2d3943 100644 void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2271,7 +2272,7 @@ struct wined3d_volume +@@ -2345,7 +2346,6 @@ struct wined3d_volume struct wined3d_resource resource; struct wined3d_texture *container; -- DWORD flags, locations; -+ DWORD flags; +- DWORD locations; GLint texture_level; DWORD download_count; GLuint pbo; -- -2.3.5 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/0010-wined3d-Remove-surface_invalidate_location.patch b/patches/wined3d-CSMT_Main/0010-wined3d-Remove-surface_invalidate_location.patch index 3aafbdef..16d6f614 100644 --- a/patches/wined3d-CSMT_Main/0010-wined3d-Remove-surface_invalidate_location.patch +++ b/patches/wined3d-CSMT_Main/0010-wined3d-Remove-surface_invalidate_location.patch @@ -1,4 +1,4 @@ -From c1235a5f6ed86eefc1b797df0836a1b61d6fceb7 Mon Sep 17 00:00:00 2001 +From cea59537439aaf4e67ad4c2f9a9eadd1d8e70c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 4 Jan 2014 01:02:15 +0100 Subject: wined3d: Remove surface_invalidate_location. @@ -15,10 +15,10 @@ Subject: wined3d: Remove surface_invalidate_location. 8 files changed, 29 insertions(+), 41 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index a87b09b..4df6e2f 100644 +index e22b558..c2a6a96 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c -@@ -7889,7 +7889,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter, +@@ -7895,7 +7895,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_ context_release(context); wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); @@ -41,7 +41,7 @@ index 1e357e7..230946d 100644 } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 58edac3..143cf9c 100644 +index bacd887..a9ac2ca 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -399,7 +399,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c @@ -53,7 +53,7 @@ index 58edac3..143cf9c 100644 } } -@@ -4048,7 +4048,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4065,7 +4065,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str context_release(context); wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_TEXTURE_RGB); @@ -63,7 +63,7 @@ index 58edac3..143cf9c 100644 HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index 943a829..95245a9 100644 +index 75489db..9ba6ef7 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -628,7 +628,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co @@ -76,10 +76,10 @@ index 943a829..95245a9 100644 else { diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index ad43381..7c0594f 100644 +index 728b4b2..374b1da 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -599,7 +599,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) +@@ -597,7 +597,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) return; wined3d_resource_free_sysmem(&surface->resource); @@ -87,8 +87,8 @@ index ad43381..7c0594f 100644 + wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); } - static void surface_release_client_storage(struct wined3d_surface *surface) -@@ -1119,7 +1119,7 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win + static BOOL surface_use_pbo(const struct wined3d_surface *surface) +@@ -1095,7 +1095,7 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win checkGLcall("glDeleteBuffers(1, &surface->pbo)"); surface->pbo = 0; @@ -97,7 +97,7 @@ index ad43381..7c0594f 100644 } static ULONG surface_resource_incref(struct wined3d_resource *resource) -@@ -1159,21 +1159,21 @@ static void surface_unload(struct wined3d_resource *resource) +@@ -1135,21 +1135,21 @@ static void surface_unload(struct wined3d_resource *resource) if (resource->usage & WINED3DUSAGE_DEPTHSTENCIL) { wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DISCARDED); @@ -122,7 +122,7 @@ index ad43381..7c0594f 100644 } /* Destroy PBOs, but load them into real sysmem before */ -@@ -1224,7 +1224,10 @@ static HRESULT surface_resource_sub_resource_unmap(struct wined3d_resource *reso +@@ -1200,7 +1200,10 @@ static HRESULT surface_resource_sub_resource_unmap(struct wined3d_resource *reso static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location) { @@ -134,7 +134,7 @@ index ad43381..7c0594f 100644 } static const struct wined3d_resource_ops surface_resource_ops = -@@ -1702,7 +1705,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1678,7 +1681,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P context_release(context); wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); @@ -143,7 +143,7 @@ index ad43381..7c0594f 100644 return WINED3D_OK; } -@@ -2702,7 +2705,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2678,7 +2681,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, } if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) @@ -152,7 +152,7 @@ index ad43381..7c0594f 100644 switch (surface->resource.map_binding) { -@@ -2818,7 +2821,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2788,7 +2791,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) } surface_load_location(surface, context, WINED3D_LOCATION_DIB); @@ -161,7 +161,7 @@ index ad43381..7c0594f 100644 if (context) context_release(context); -@@ -2867,7 +2870,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) +@@ -2837,7 +2840,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) context = context_acquire(device, NULL); surface_load_location(surface, context, surface->resource.map_binding); @@ -170,7 +170,7 @@ index ad43381..7c0594f 100644 if (context) context_release(context); } -@@ -3174,7 +3177,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc +@@ -3144,7 +3147,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); @@ -179,7 +179,7 @@ index ad43381..7c0594f 100644 } /* Uses the hardware to stretch and flip the image */ -@@ -3242,7 +3245,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3212,7 +3215,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 */ @@ -188,7 +188,7 @@ index ad43381..7c0594f 100644 } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3447,7 +3450,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3417,7 +3420,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); @@ -197,7 +197,7 @@ index ad43381..7c0594f 100644 } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3924,18 +3927,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3894,18 +3897,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } @@ -216,7 +216,7 @@ index ad43381..7c0594f 100644 static DWORD resource_access_from_location(DWORD location) { switch (location) -@@ -4493,7 +4484,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter, +@@ -4472,7 +4463,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, enum wined3d_bl (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); @@ -225,7 +225,7 @@ index ad43381..7c0594f 100644 } const struct blit_shader ffp_blit = { -@@ -5474,7 +5465,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5458,7 +5449,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC context_release(context); wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); @@ -234,7 +234,7 @@ index ad43381..7c0594f 100644 return WINED3D_OK; } -@@ -5596,7 +5587,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text +@@ -5581,7 +5572,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text { wined3d_resource_free_sysmem(&surface->resource); wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB); @@ -244,10 +244,10 @@ index ad43381..7c0594f 100644 return hr; diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 9758be4..4e50ef9 100644 +index 68f12e5..2797067 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c -@@ -518,7 +518,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT +@@ -526,7 +526,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO) { surface_load_location(back_buffer, context, WINED3D_LOCATION_TEXTURE_RGB); @@ -256,7 +256,7 @@ index 9758be4..4e50ef9 100644 swapchain->render_to_fbo = TRUE; swapchain_update_draw_bindings(swapchain); } -@@ -563,7 +563,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT +@@ -571,7 +571,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); @@ -265,7 +265,7 @@ index 9758be4..4e50ef9 100644 /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM * and INTEXTURE copies can keep their old content if they have any defined content. * If the swapeffect is COPY, the content remains the same. -@@ -836,7 +836,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 +@@ -844,7 +844,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 if (!(device->wined3d->flags & WINED3D_NO3D)) { wined3d_resource_validate_location(&front_buffer->resource, WINED3D_LOCATION_DRAWABLE); @@ -275,7 +275,7 @@ index 9758be4..4e50ef9 100644 /* MSDN says we're only allowed a single fullscreen swapchain per device, diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 7e31832..be378fc 100644 +index 8f4c625..b6d21cb 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -776,7 +776,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub @@ -299,10 +299,10 @@ index 7e31832..be378fc 100644 static void texture2d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ed013a9..54f95e3 100644 +index 0a10b6b..ac43834 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2458,7 +2458,6 @@ HRESULT surface_color_fill(struct wined3d_surface *s, +@@ -2460,7 +2460,6 @@ HRESULT surface_color_fill(struct wined3d_surface *s, 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; @@ -311,5 +311,5 @@ index ed013a9..54f95e3 100644 void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; -- -2.6.2 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/0013-wined3d-Replace-surface_load_location-with-resource_.patch b/patches/wined3d-CSMT_Main/0013-wined3d-Replace-surface_load_location-with-resource_.patch index 208e626b..9936e32e 100644 --- a/patches/wined3d-CSMT_Main/0013-wined3d-Replace-surface_load_location-with-resource_.patch +++ b/patches/wined3d-CSMT_Main/0013-wined3d-Replace-surface_load_location-with-resource_.patch @@ -1,4 +1,4 @@ -From b26629e64f25b8a3a431f7b784fc4d70d1539c48 Mon Sep 17 00:00:00 2001 +From b7612231d57a3c77fc57a24690d14d118791824a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 17 Nov 2013 20:33:17 +0100 Subject: wined3d: Replace surface_load_location with resource_load_location. @@ -8,17 +8,17 @@ FIXME: Check if this patch is complete enough to make sense. dlls/wined3d/context.c | 2 +- dlls/wined3d/device.c | 4 +- dlls/wined3d/drawprim.c | 2 +- - dlls/wined3d/surface.c | 115 +++++++++++++---------------------------- + dlls/wined3d/surface.c | 113 +++++++++++++---------------------------- dlls/wined3d/swapchain.c | 8 +-- dlls/wined3d/texture.c | 2 +- dlls/wined3d/wined3d_private.h | 2 - - 7 files changed, 46 insertions(+), 89 deletions(-) + 7 files changed, 45 insertions(+), 88 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 52fb407..15a2dc3 100644 +index 230946d..1325dc9 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -2287,7 +2287,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, +@@ -2292,7 +2292,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ @@ -28,10 +28,10 @@ index 52fb407..15a2dc3 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 77ea1e9..367dc22 100644 +index a9ac2ca..0a07197 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -323,7 +323,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c +@@ -324,7 +324,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c if (rt && rt->resource.format->id != WINED3DFMT_NULL) { if (flags & WINED3DCLEAR_TARGET && !is_full_clear(target, draw_rect, clear_rect)) @@ -40,7 +40,7 @@ index 77ea1e9..367dc22 100644 else wined3d_surface_prepare(rt, context, rt->container->resource.draw_binding); } -@@ -4010,7 +4010,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4056,7 +4056,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str && src_rect.bottom == sub_resource->height) wined3d_texture_prepare_texture(texture, context, FALSE); else @@ -50,7 +50,7 @@ index 77ea1e9..367dc22 100644 wined3d_surface_upload_data(surface, gl_info, resource->format, diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index 95245a9..4b01b7d 100644 +index 9ba6ef7..0afeff9 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -627,7 +627,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co @@ -63,10 +63,10 @@ index 95245a9..4b01b7d 100644 } else diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 9aff2f2..421b1ed 100644 +index 032d284..2d87c08 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -759,7 +759,7 @@ static void surface_unmap(struct wined3d_surface *surface) +@@ -735,7 +735,7 @@ static void surface_unmap(struct wined3d_surface *surface) if (device->d3d_initialized) context = context_acquire(device, surface); @@ -75,7 +75,7 @@ index 9aff2f2..421b1ed 100644 if (context) context_release(context); } -@@ -825,9 +825,9 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, +@@ -801,9 +801,9 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, /* Make sure the locations are up-to-date. Loading the destination * surface isn't required if the entire surface is overwritten. */ @@ -87,7 +87,7 @@ index 9aff2f2..421b1ed 100644 else wined3d_surface_prepare(dst_surface, context, dst_location); -@@ -918,9 +918,9 @@ static void surface_blt_fbo(const struct wined3d_device *device, +@@ -894,9 +894,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.) */ @@ -99,7 +99,7 @@ index 9aff2f2..421b1ed 100644 else wined3d_surface_prepare(dst_surface, old_ctx, dst_location); -@@ -1178,7 +1178,7 @@ static void surface_unload(struct wined3d_resource *resource) +@@ -1148,7 +1148,7 @@ static void surface_unload(struct wined3d_resource *resource) else { surface_prepare_map_memory(surface); @@ -108,7 +108,7 @@ index 9aff2f2..421b1ed 100644 wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); } -@@ -1236,24 +1236,6 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour +@@ -1206,24 +1206,6 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour wined3d_texture_set_dirty(surface->container); } @@ -133,7 +133,7 @@ index 9aff2f2..421b1ed 100644 static const struct wined3d_surface_ops surface_ops = { surface_private_setup, -@@ -1707,7 +1689,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1677,7 +1659,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 @@ -142,7 +142,7 @@ index 9aff2f2..421b1ed 100644 wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); surface_get_memory(src_surface, &data, src_surface->resource.locations); -@@ -1840,7 +1822,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte +@@ -1810,7 +1792,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte } TRACE("Reloading because surface is dirty.\n"); @@ -151,7 +151,7 @@ index 9aff2f2..421b1ed 100644 surface_evict_sysmem(surface); } -@@ -2729,7 +2711,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2683,7 +2665,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, if (surface->resource.device->d3d_initialized) context = context_acquire(surface->resource.device, NULL); @@ -160,16 +160,7 @@ index 9aff2f2..421b1ed 100644 if (context) context_release(context); } -@@ -2834,7 +2816,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - { - if (surface->flags & SFLAG_CLIENT) - { -- surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); - surface_release_client_storage(surface); - } - hr = surface_create_dib_section(surface); -@@ -2850,7 +2832,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2798,7 +2780,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) surface->resource.map_binding = WINED3D_LOCATION_DIB; } @@ -178,7 +169,7 @@ index 9aff2f2..421b1ed 100644 wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB); if (context) -@@ -2899,7 +2881,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) +@@ -2847,7 +2829,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) if (device->d3d_initialized) context = context_acquire(device, NULL); @@ -187,7 +178,7 @@ index 9aff2f2..421b1ed 100644 wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); if (context) context_release(context); -@@ -3536,8 +3518,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, +@@ -3484,8 +3466,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, gl_info = context->gl_info; /* Make sure the surface is up-to-date. This should probably use @@ -198,7 +189,7 @@ index 9aff2f2..421b1ed 100644 wined3d_texture_load(src_surface->container, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -3957,29 +3939,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3905,29 +3887,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } @@ -228,7 +219,7 @@ index 9aff2f2..421b1ed 100644 static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD location) { struct wined3d_device *device = surface->resource.device; -@@ -4029,7 +3988,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, +@@ -3977,7 +3936,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, } if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) @@ -237,7 +228,7 @@ index 9aff2f2..421b1ed 100644 /* Download the surface to system memory. */ if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -@@ -4065,7 +4024,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, +@@ -4013,7 +3972,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, } surface_get_rect(surface, NULL, &r); @@ -246,7 +237,7 @@ index 9aff2f2..421b1ed 100644 surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -4138,7 +4097,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4086,7 +4045,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); @@ -255,7 +246,7 @@ index 9aff2f2..421b1ed 100644 } } else -@@ -4149,7 +4108,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4097,7 +4056,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); @@ -264,7 +255,7 @@ index 9aff2f2..421b1ed 100644 } } -@@ -4158,7 +4117,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4106,7 +4065,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); @@ -273,7 +264,7 @@ index 9aff2f2..421b1ed 100644 } wined3d_texture_prepare_texture(texture, context, srgb); -@@ -4184,7 +4143,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4132,7 +4091,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; surface_prepare_map_memory(surface); @@ -282,7 +273,7 @@ index 9aff2f2..421b1ed 100644 surface_remove_pbo(surface, gl_info); } -@@ -4259,9 +4218,11 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi +@@ -4207,9 +4166,11 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi surface, src_location, &rect, surface, dst_location, &rect); } @@ -296,7 +287,7 @@ index 9aff2f2..421b1ed 100644 HRESULT hr; TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4288,20 +4249,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4236,20 +4197,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte } } @@ -317,7 +308,7 @@ index 9aff2f2..421b1ed 100644 if (!surface->resource.locations) { ERR("Surface %p does not have any up to date location.\n", surface); -@@ -5452,7 +5399,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5413,7 +5360,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) { struct wined3d_context *context = context_acquire(device, dst_surface); @@ -327,7 +318,7 @@ index 9aff2f2..421b1ed 100644 context_release(context); } return WINED3D_OK; -@@ -5525,6 +5473,17 @@ cpu: +@@ -5487,6 +5435,17 @@ cpu: return surface_cpu_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter); } @@ -346,7 +337,7 @@ index 9aff2f2..421b1ed 100644 const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) { diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index e87a209..b9bf4c1 100644 +index 5e2c515..7463ae2 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -315,7 +315,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain, @@ -358,7 +349,7 @@ index e87a209..b9bf4c1 100644 } context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, backbuffer, NULL, location); -@@ -517,14 +517,14 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT +@@ -525,14 +525,14 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT */ if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO) { @@ -375,7 +366,7 @@ index e87a209..b9bf4c1 100644 } if (swapchain->render_to_fbo) -@@ -617,7 +617,7 @@ void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *r +@@ -625,7 +625,7 @@ void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *r TRACE("Copying surface %p to screen.\n", front); @@ -385,7 +376,7 @@ index e87a209..b9bf4c1 100644 src_dc = front->hDC; window = swapchain->win_handle; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 2a183e8..29c7eec 100644 +index 71f1c47..e05238d 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -774,7 +774,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub @@ -398,10 +389,10 @@ index 2a183e8..29c7eec 100644 wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 031e684..879d5f0 100644 +index 6fa239e..a5af340 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2466,8 +2466,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, +@@ -2468,8 +2468,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *context) DECLSPEC_HIDDEN; @@ -411,5 +402,5 @@ index 031e684..879d5f0 100644 void wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; -- -2.6.2 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/0015-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch b/patches/wined3d-CSMT_Main/0015-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch index 1a4aebd7..ae611ac3 100644 --- a/patches/wined3d-CSMT_Main/0015-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch +++ b/patches/wined3d-CSMT_Main/0015-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch @@ -1,4 +1,4 @@ -From 5b00654bc918a13d1c702d102de41bdaaf0dc360 Mon Sep 17 00:00:00 2001 +From 7131fa240dda38ce201e9e6dfa45ed3adbaf264d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 16 Jan 2014 22:07:17 +0100 Subject: wined3d: Move volume PBO infrastructure into the resource. @@ -10,10 +10,10 @@ Subject: wined3d: Move volume PBO infrastructure into the resource. 3 files changed, 83 insertions(+), 80 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 39df397..5f0a98e 100644 +index bff4997..16c4ab9 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -373,7 +373,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) +@@ -389,7 +389,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) return ret; } @@ -22,7 +22,7 @@ index 39df397..5f0a98e 100644 { if (d3d_flags & WINED3D_MAP_READONLY) return GL_READ_ONLY_ARB; -@@ -511,3 +511,65 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, +@@ -527,3 +527,65 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, resource->resource_ops->resource_load_location(resource, context, location); } @@ -89,10 +89,10 @@ index 39df397..5f0a98e 100644 + } +} diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index af3f055..084e0e6 100644 +index c274eb7..78b153d 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -218,7 +218,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -216,7 +216,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, } else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) { @@ -101,7 +101,7 @@ index af3f055..084e0e6 100644 wined3d_texture_bind_and_dirtify(volume->container, context, location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_volume_upload_data(volume, context, &data); -@@ -274,7 +274,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -272,7 +272,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, break; case WINED3D_LOCATION_BUFFER: @@ -110,7 +110,7 @@ index af3f055..084e0e6 100644 ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) -@@ -284,7 +284,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -282,7 +282,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, } else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { @@ -119,7 +119,7 @@ index af3f055..084e0e6 100644 if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); -@@ -321,16 +321,16 @@ static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct win +@@ -319,16 +319,16 @@ static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct win { const struct wined3d_gl_info *gl_info = context->gl_info; @@ -140,7 +140,7 @@ index af3f055..084e0e6 100644 } static void wined3d_volume_free_pbo(struct wined3d_volume *volume) -@@ -338,10 +338,10 @@ static void wined3d_volume_free_pbo(struct wined3d_volume *volume) +@@ -336,10 +336,10 @@ static void wined3d_volume_free_pbo(struct wined3d_volume *volume) struct wined3d_context *context = context_acquire(volume->resource.device, NULL); const struct wined3d_gl_info *gl_info = context->gl_info; @@ -155,7 +155,7 @@ index af3f055..084e0e6 100644 context_release(context); } -@@ -349,7 +349,7 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) +@@ -347,7 +347,7 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) { TRACE("volume %p.\n", volume); @@ -164,7 +164,7 @@ index af3f055..084e0e6 100644 wined3d_volume_free_pbo(volume); resource_cleanup(&volume->resource); -@@ -382,7 +382,7 @@ static void volume_unload(struct wined3d_resource *resource) +@@ -380,7 +380,7 @@ static void volume_unload(struct wined3d_resource *resource) wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); } @@ -173,7 +173,7 @@ index af3f055..084e0e6 100644 { /* Should not happen because only dynamic default pool volumes * have a buffer, and those are not evicted by device_evit_managed_resources -@@ -486,44 +486,6 @@ static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, str +@@ -462,44 +462,6 @@ static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, str } } @@ -218,7 +218,7 @@ index af3f055..084e0e6 100644 HRESULT wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { -@@ -575,7 +537,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, +@@ -551,7 +513,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, else wined3d_resource_load_location(&volume->resource, context, volume->resource.map_binding); @@ -227,7 +227,7 @@ index af3f055..084e0e6 100644 context_release(context); TRACE("Base memory pointer %p.\n", base_memory); -@@ -629,30 +591,6 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, +@@ -605,30 +567,6 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, return WINED3D_OK; } @@ -258,7 +258,7 @@ index af3f055..084e0e6 100644 HRESULT wined3d_volume_unmap(struct wined3d_volume *volume) { struct wined3d_device *device = volume->resource.device; -@@ -666,7 +604,7 @@ HRESULT wined3d_volume_unmap(struct wined3d_volume *volume) +@@ -642,7 +580,7 @@ HRESULT wined3d_volume_unmap(struct wined3d_volume *volume) } context = context_acquire(device, NULL); @@ -268,10 +268,10 @@ index af3f055..084e0e6 100644 volume->resource.map_count--; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 394ea0e..2a113e0 100644 +index a5af340..db60de5 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2174,6 +2174,7 @@ struct wined3d_resource +@@ -2199,6 +2199,7 @@ struct wined3d_resource DWORD priority; void *heap_memory, *user_memory, *bitmap_data; UINT custom_row_pitch, custom_slice_pitch; @@ -279,7 +279,7 @@ index 394ea0e..2a113e0 100644 struct list resource_list_entry; DWORD locations; -@@ -2203,14 +2204,17 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; +@@ -2228,14 +2229,17 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -298,8 +298,8 @@ index 394ea0e..2a113e0 100644 DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; -@@ -2337,7 +2341,6 @@ struct wined3d_volume - DWORD flags; +@@ -2356,7 +2360,6 @@ struct wined3d_volume + GLint texture_level; DWORD download_count; - GLuint pbo; @@ -307,5 +307,5 @@ index 394ea0e..2a113e0 100644 static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) -- -2.6.0 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/0018-wined3d-Move-buffer-creation-into-the-resource.patch b/patches/wined3d-CSMT_Main/0018-wined3d-Move-buffer-creation-into-the-resource.patch index e70c071f..985f1bcd 100644 --- a/patches/wined3d-CSMT_Main/0018-wined3d-Move-buffer-creation-into-the-resource.patch +++ b/patches/wined3d-CSMT_Main/0018-wined3d-Move-buffer-creation-into-the-resource.patch @@ -1,4 +1,4 @@ -From e6f030ca36c31b52f7dce040eb03552a2a73b2e7 Mon Sep 17 00:00:00 2001 +From bd7832b10a3c2c43e33abff97a9447d52166da3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 18 Sep 2013 22:49:34 +0200 Subject: wined3d: Move buffer creation into the resource. @@ -9,13 +9,12 @@ location scheme. Otherwise the unimplemented buffer_load_location and surface_load_location will write a lot of ERRs. --- dlls/wined3d/resource.c | 66 ++++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/texture.c | 2 +- dlls/wined3d/volume.c | 63 ++-------------------------------------- dlls/wined3d/wined3d_private.h | 4 ++- - 4 files changed, 72 insertions(+), 63 deletions(-) + 3 files changed, 71 insertions(+), 62 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index dda77f0..e20f353 100644 +index 5204fee..0d2145f 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -223,6 +223,18 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * @@ -57,7 +56,7 @@ index dda77f0..e20f353 100644 context_resource_unloaded(resource->device, resource, resource->type); } -@@ -581,3 +599,51 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -597,3 +615,51 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, return; } } @@ -109,24 +108,11 @@ index dda77f0..e20f353 100644 + return FALSE; + } +} -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 0241309..abd2d8a 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -1289,7 +1289,7 @@ static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wi - void *mem = NULL; - - if (gl_info->supported[APPLE_CLIENT_STORAGE] && !format->convert -- && volume_prepare_system_memory(volume)) -+ && wined3d_resource_prepare_system_memory(&volume->resource)) - { - TRACE("Enabling GL_UNPACK_CLIENT_STORAGE_APPLE for volume %p\n", volume); - gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 084e0e6..d823ebd 100644 +index 78b153d..c95af94 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -316,42 +316,10 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * +@@ -314,42 +314,10 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); } @@ -169,7 +155,7 @@ index 084e0e6..d823ebd 100644 resource_cleanup(&volume->resource); volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); HeapFree(GetProcessHeap(), 0, volume); -@@ -368,7 +336,7 @@ static void volume_unload(struct wined3d_resource *resource) +@@ -366,7 +334,7 @@ static void volume_unload(struct wined3d_resource *resource) TRACE("texture %p.\n", resource); @@ -178,7 +164,7 @@ index 084e0e6..d823ebd 100644 { context = context_acquire(device, NULL); wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM); -@@ -382,15 +350,6 @@ static void volume_unload(struct wined3d_resource *resource) +@@ -380,15 +348,6 @@ static void volume_unload(struct wined3d_resource *resource) wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); } @@ -192,9 +178,9 @@ index 084e0e6..d823ebd 100644 - } - /* The texture name is managed by the container. */ - volume->flags &= ~WINED3D_VFLAG_CLIENT_STORAGE; -@@ -468,24 +427,6 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol + resource_unload(resource); +@@ -444,24 +403,6 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol return TRUE; } @@ -219,7 +205,7 @@ index 084e0e6..d823ebd 100644 HRESULT wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { -@@ -524,7 +465,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, +@@ -500,7 +441,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags); context = context_acquire(device, NULL); @@ -229,10 +215,10 @@ index 084e0e6..d823ebd 100644 WARN("Out of memory.\n"); map_desc->data = NULL; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 828f9a7..67c1de2 100644 +index 6dc1b04..0049165 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2213,6 +2213,9 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO +@@ -2238,6 +2238,9 @@ 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; @@ -242,7 +228,7 @@ index 828f9a7..67c1de2 100644 void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, const struct wined3d_context *context) DECLSPEC_HIDDEN; DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; -@@ -2348,7 +2351,6 @@ static inline struct wined3d_volume *volume_from_resource(struct wined3d_resourc +@@ -2367,7 +2370,6 @@ static inline struct wined3d_volume *volume_from_resource(struct wined3d_resourc return CONTAINING_RECORD(resource, struct wined3d_volume, resource); } @@ -251,5 +237,5 @@ index 828f9a7..67c1de2 100644 unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; -- -2.6.0 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/0025-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch b/patches/wined3d-CSMT_Main/0025-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch deleted file mode 100644 index 1705916e..00000000 --- a/patches/wined3d-CSMT_Main/0025-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch +++ /dev/null @@ -1,37 +0,0 @@ -From d0f1f1278a8225075bd03c9586112bf29318563c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 16 Sep 2013 22:22:39 +0200 -Subject: wined3d: Allocate sysmem for client storage if it doesn't exist - already. - ---- - dlls/wined3d/texture.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 41cf61d..8298e53 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -904,8 +904,7 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi - if (gl_info->supported[APPLE_CLIENT_STORAGE]) - { - if (surface->flags & (SFLAG_NONPOW2 | SFLAG_DIBSECTION) -- || texture->flags & WINED3D_TEXTURE_CONVERTED -- || !surface->resource.heap_memory) -+ || texture->flags & WINED3D_TEXTURE_CONVERTED) - { - /* In some cases we want to disable client storage. - * SFLAG_NONPOW2 has a bigger opengl texture than the client memory, and different pitches -@@ -917,6 +916,9 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi - } - else - { -+ if (!surface->resource.heap_memory) -+ wined3d_resource_allocate_sysmem(&surface->resource); -+ - surface->flags |= SFLAG_CLIENT; - mem = surface->resource.heap_memory; - --- -2.1.3 - diff --git a/patches/wined3d-CSMT_Main/0029-wined3d-Replace-surface-alloc-functions-with-resourc.patch b/patches/wined3d-CSMT_Main/0029-wined3d-Replace-surface-alloc-functions-with-resourc.patch index 161ef794..d7105831 100644 --- a/patches/wined3d-CSMT_Main/0029-wined3d-Replace-surface-alloc-functions-with-resourc.patch +++ b/patches/wined3d-CSMT_Main/0029-wined3d-Replace-surface-alloc-functions-with-resourc.patch @@ -1,4 +1,4 @@ -From 4345b09b18121021362ea09caa4232d1b97bcf37 Mon Sep 17 00:00:00 2001 +From 1505be1b5bedf3387daa7dc558314f3480b2004e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 16:40:56 +0100 Subject: wined3d: Replace surface alloc functions with resource ones. @@ -6,15 +6,15 @@ Subject: wined3d: Replace surface alloc functions with resource ones. --- dlls/wined3d/resource.c | 10 +++++ dlls/wined3d/surface.c | 89 ++++-------------------------------------- - dlls/wined3d/texture.c | 5 +-- + dlls/wined3d/texture.c | 2 +- dlls/wined3d/wined3d_private.h | 1 - - 4 files changed, 19 insertions(+), 86 deletions(-) + 4 files changed, 18 insertions(+), 84 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 9b87d6b..1da4da5 100644 +index b47536a..261b386 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -610,6 +610,16 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru +@@ -700,6 +700,16 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru case WINED3D_LOCATION_SYSMEM: return wined3d_resource_prepare_system_memory(resource); @@ -32,10 +32,10 @@ index 9b87d6b..1da4da5 100644 ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); return FALSE; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 3bcf0ab..0a908b1 100644 +index af4de99..2287523 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -478,81 +478,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) +@@ -479,81 +479,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) return WINED3D_OK; } @@ -117,7 +117,7 @@ index 3bcf0ab..0a908b1 100644 static void surface_evict_sysmem(struct wined3d_surface *surface) { /* In some conditions the surface memory must not be freed: -@@ -1159,7 +1084,7 @@ static void surface_unload(struct wined3d_resource *resource) +@@ -1064,7 +989,7 @@ static void surface_unload(struct wined3d_resource *resource) } else { @@ -126,7 +126,7 @@ index 3bcf0ab..0a908b1 100644 wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); } -@@ -2139,7 +2064,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -1999,7 +1924,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, if (!valid_location) { @@ -135,7 +135,7 @@ index 3bcf0ab..0a908b1 100644 valid_location = WINED3D_LOCATION_SYSMEM; } -@@ -2695,7 +2620,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2556,7 +2481,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, if (device->d3d_initialized) context = context_acquire(device, NULL); @@ -144,7 +144,7 @@ index 3bcf0ab..0a908b1 100644 if (flags & WINED3D_MAP_DISCARD) { TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n", -@@ -4226,7 +4151,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3932,7 +3857,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, { /* Performance warning... */ FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); @@ -153,7 +153,7 @@ index 3bcf0ab..0a908b1 100644 wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); } } -@@ -4237,7 +4162,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3943,7 +3868,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, { /* Performance warning... */ FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); @@ -162,7 +162,7 @@ index 3bcf0ab..0a908b1 100644 wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); } } -@@ -4246,7 +4171,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3952,7 +3877,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... */ @@ -171,7 +171,7 @@ index 3bcf0ab..0a908b1 100644 wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); } -@@ -4272,7 +4197,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3978,7 +3903,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -181,10 +181,10 @@ index 3bcf0ab..0a908b1 100644 surface_remove_pbo(surface, gl_info); } diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 2ae36ef..8faeefa 100644 +index 174cea4..746131c 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -783,8 +783,8 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub +@@ -772,8 +772,8 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub struct wined3d_surface *surface = surface_from_resource(sub_resource); struct wined3d_context *context; @@ -194,21 +194,11 @@ index 2ae36ef..8faeefa 100644 wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); context_release(context); wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); -@@ -896,8 +896,7 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi - } - else - { -- if (!surface->resource.heap_memory) -- wined3d_resource_allocate_sysmem(&surface->resource); -+ wined3d_resource_prepare_system_memory(&surface->resource); - - surface->flags |= SFLAG_CLIENT; - mem = surface->resource.heap_memory; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 4540df1..bbf9128 100644 +index b882152..915d529 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2397,7 +2397,6 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w +@@ -2490,7 +2490,6 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w GLenum target, unsigned int level, unsigned int layer, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -217,5 +207,5 @@ index 4540df1..bbf9128 100644 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; -- -2.3.0 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/0035-wined3d-Use-client-storage-with-DIB-sections.patch b/patches/wined3d-CSMT_Main/0035-wined3d-Use-client-storage-with-DIB-sections.patch deleted file mode 100644 index 34b4f8e8..00000000 --- a/patches/wined3d-CSMT_Main/0035-wined3d-Use-client-storage-with-DIB-sections.patch +++ /dev/null @@ -1,78 +0,0 @@ -From e2500c76e7b1b762eeb610d580ce90eec9798773 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 21 Jan 2014 17:06:20 +0100 -Subject: wined3d: Use client storage with DIB sections. - -Now that DIBs are a separate location, we can keep the sysmem around for -OpenGL's use. ---- - dlls/wined3d/surface.c | 27 --------------------------- - dlls/wined3d/texture.c | 3 +-- - 2 files changed, 1 insertion(+), 29 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 16233d3..303a0dc 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -484,28 +484,6 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) - wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); - } - --static void surface_release_client_storage(struct wined3d_surface *surface) --{ -- struct wined3d_context *context = context_acquire(surface->resource.device, NULL); -- const struct wined3d_gl_info *gl_info = context->gl_info; -- -- if (surface->container->texture_rgb.name) -- { -- wined3d_texture_bind_and_dirtify(surface->container, context, FALSE); -- gl_info->gl_ops.gl.p_glTexImage2D(surface->texture_target, surface->texture_level, -- GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); -- } -- if (surface->container->texture_srgb.name) -- { -- wined3d_texture_bind_and_dirtify(surface->container, context, TRUE); -- gl_info->gl_ops.gl.p_glTexImage2D(surface->texture_target, surface->texture_level, -- GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); -- } -- wined3d_texture_force_reload(surface->container); -- -- context_release(context); --} -- - static BOOL surface_use_pbo(const struct wined3d_surface *surface) - { - const struct wined3d_gl_info *gl_info = &surface->resource.device->adapter->gl_info; -@@ -2483,11 +2461,6 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - /* Create a DIB section if there isn't a dc yet. */ - if (!surface->hDC) - { -- if (surface->flags & SFLAG_CLIENT) -- { -- wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); -- surface_release_client_storage(surface); -- } - hr = surface_create_dib_section(surface); - if (FAILED(hr)) - { -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 429eb89..ec5c847 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -903,12 +903,11 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi - - if (gl_info->supported[APPLE_CLIENT_STORAGE]) - { -- if (surface->flags & (SFLAG_NONPOW2 | SFLAG_DIBSECTION) -+ if (surface->flags & (SFLAG_NONPOW2) - || texture->flags & WINED3D_TEXTURE_CONVERTED) - { - /* In some cases we want to disable client storage. - * SFLAG_NONPOW2 has a bigger opengl texture than the client memory, and different pitches -- * SFLAG_DIBSECTION: Dibsections may have read / write protections on the memory. Avoid issues... - * WINED3D_TEXTURE_CONVERTED: The conversion destination memory is freed after loading the surface - * heap_memory == NULL: Not defined in the extension. Seems to disable client storage effectively - */ --- -2.1.3 - diff --git a/patches/wined3d-CSMT_Main/0040-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch b/patches/wined3d-CSMT_Main/0040-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch index efd1b88e..6bd84474 100644 --- a/patches/wined3d-CSMT_Main/0040-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch +++ b/patches/wined3d-CSMT_Main/0040-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch @@ -1,4 +1,4 @@ -From 3ccf9437225eff52fd9cad94d861e4d8fa2f5ec0 Mon Sep 17 00:00:00 2001 +From e2f09806ffc0332e4b3fdb3a6112ad9a2bedb1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 7 Jul 2013 12:06:31 +0200 Subject: wined3d: Preload buffers if streamsrc is not dirty @@ -18,7 +18,7 @@ here... 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 2386410..3de580e 100644 +index 4e91176..7eef51e 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -711,7 +711,7 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined @@ -31,10 +31,10 @@ index 2386410..3de580e 100644 buffer->flags &= ~(WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); } diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 2204d29..861af29 100644 +index 46aa0cc..116bf67 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -2999,8 +2999,12 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de +@@ -3227,8 +3227,12 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de for (i = 0, map = context->stream_info.use_map; map; map >>= 1, ++i) { if (map & 1) @@ -49,17 +49,17 @@ index 2204d29..861af29 100644 if (state->index_buffer) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index fd7e8f9..69c984ba 100644 +index d320a62..4bbfe42 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2686,7 +2686,6 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co +@@ -2786,7 +2786,6 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co 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; -void buffer_mark_used(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, + const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; - struct wined3d_rendertarget_view - { -- -2.2.1 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/0076-wined3d-Don-t-preload-buffers-on-unmap.patch b/patches/wined3d-CSMT_Main/0076-wined3d-Don-t-preload-buffers-on-unmap.patch index 9962f2d6..8a2da253 100644 --- a/patches/wined3d-CSMT_Main/0076-wined3d-Don-t-preload-buffers-on-unmap.patch +++ b/patches/wined3d-CSMT_Main/0076-wined3d-Don-t-preload-buffers-on-unmap.patch @@ -1,4 +1,4 @@ -From 0603f71135885ebf0666d406380385936ed5ff7b Mon Sep 17 00:00:00 2001 +From e65b83c7523a8c124cd04dc97b3f617175e24541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 4 Jul 2013 23:40:56 +0200 Subject: wined3d: Don't preload buffers on unmap @@ -8,7 +8,7 @@ Subject: wined3d: Don't preload buffers on unmap 1 file changed, 4 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 5544640..b76a07d 100644 +index c519fcd..3c8c681 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1129,10 +1129,6 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) @@ -21,7 +21,7 @@ index 5544640..b76a07d 100644 - } } - static ULONG buffer_resource_incref(struct wined3d_resource *resource) + HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, -- -2.1.3 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/0118-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch b/patches/wined3d-CSMT_Main/0118-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch index 4c680a86..3387f57d 100644 --- a/patches/wined3d-CSMT_Main/0118-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0118-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch @@ -1,4 +1,4 @@ -From 6d53bc01b8d6db32aab6c0d9e7b93c20f2a7af94 Mon Sep 17 00:00:00 2001 +From 9725eb43a6e513c68761a40b534f308c85e55086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 6 Jul 2013 17:05:12 +0200 Subject: wined3d: Access the buffer dirty areas through the CS @@ -27,7 +27,7 @@ be protected by locks. 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index c0bbfb7..df44ae0 100644 +index 7d1a532..9b6ccc8 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); @@ -52,7 +52,7 @@ index c0bbfb7..df44ae0 100644 if (!(buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER)) { diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 0a246a9..b871d92 100644 +index 491ad85..bc90df2 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -70,6 +70,7 @@ enum wined3d_cs_op @@ -77,7 +77,7 @@ index 0a246a9..b871d92 100644 struct wined3d_cs_skip { enum wined3d_cs_op opcode; -@@ -2272,6 +2280,28 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe +@@ -2273,6 +2281,28 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe cs->ops->submit(cs, sizeof(*op)); } @@ -106,7 +106,7 @@ index 0a246a9..b871d92 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2320,6 +2350,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2321,6 +2351,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, @@ -115,10 +115,10 @@ index 0a246a9..b871d92 100644 /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index efc5d2d..801c221 100644 +index e30ae80..7d0eba9 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2745,6 +2745,8 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur +@@ -2813,6 +2813,8 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; @@ -127,14 +127,14 @@ index efc5d2d..801c221 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -@@ -2830,6 +2832,7 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co +@@ -2898,6 +2900,7 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co 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; +void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; + HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, + const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; - struct wined3d_rendertarget_view - { -- -2.4.2 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/0122-wined3d-Separate-GL-buffer-discard-control-from-igno.patch b/patches/wined3d-CSMT_Main/0122-wined3d-Separate-GL-buffer-discard-control-from-igno.patch index b4355ead..70f9f907 100644 --- a/patches/wined3d-CSMT_Main/0122-wined3d-Separate-GL-buffer-discard-control-from-igno.patch +++ b/patches/wined3d-CSMT_Main/0122-wined3d-Separate-GL-buffer-discard-control-from-igno.patch @@ -1,4 +1,4 @@ -From fd33771329457adaba5a2fb8006991e7ad756ec7 Mon Sep 17 00:00:00 2001 +From cb3001744c90910e2a44caa6bb05eb0c5a685efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 30 Jul 2013 22:17:10 +0200 Subject: wined3d: Separate GL buffer discard control from ignoring @@ -18,7 +18,7 @@ There are some problems left: 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 675dbec..8b09aee 100644 +index 3945549..2421eb3 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -32,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); @@ -67,7 +67,7 @@ index 675dbec..8b09aee 100644 wined3d_resource_allocate_sysmem(&buffer->resource); wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); } -@@ -1332,3 +1338,10 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, +@@ -1399,3 +1405,10 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, return WINED3D_OK; } @@ -79,10 +79,10 @@ index 675dbec..8b09aee 100644 + buffer->flags |= WINED3D_BUFFER_DISCARD; +} diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 6b16d51..4b9af57 100644 +index ee76ef0..5eb8803 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -722,11 +722,17 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun +@@ -732,11 +732,17 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun op->indexed = indexed; if (indexed) @@ -100,7 +100,7 @@ index 6b16d51..4b9af57 100644 } for (i = 0; i < sizeof(state->textures) / sizeof(*state->textures); i++) { -@@ -2151,8 +2157,7 @@ static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *d +@@ -2265,8 +2271,7 @@ static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *d const struct wined3d_cs_buffer_swap_mem *op = data; struct wined3d_buffer *buffer = op->buffer; @@ -111,10 +111,10 @@ index 6b16d51..4b9af57 100644 if (!buffer->buffer_object && buffer->resource.bind_count) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 4070e1d..0f88961 100644 +index 27a534a..c79b6a9 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2760,6 +2760,7 @@ struct wined3d_buffer +@@ -2877,6 +2877,7 @@ struct wined3d_buffer GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -122,14 +122,14 @@ index 4070e1d..0f88961 100644 void *map_ptr; struct wined3d_map_range *maps; -@@ -2785,6 +2786,7 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *con +@@ -2902,6 +2903,7 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *con void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN; void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; +void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; + HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, + const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; - struct wined3d_rendertarget_view - { -- -2.1.3 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/0128-wined3d-Create-VBOs-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0128-wined3d-Create-VBOs-through-the-command-stream.patch index 898e4ed5..bc7f091f 100644 --- a/patches/wined3d-CSMT_Main/0128-wined3d-Create-VBOs-through-the-command-stream.patch +++ b/patches/wined3d-CSMT_Main/0128-wined3d-Create-VBOs-through-the-command-stream.patch @@ -1,4 +1,4 @@ -From 60ebba02de794f88fea7b31406493de579ce01e3 Mon Sep 17 00:00:00 2001 +From 66a6fe6a092a4fa661e5baab52bbb2c1d7c661de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 2 Oct 2013 21:47:08 +0200 Subject: wined3d: Create VBOs through the command stream. @@ -11,7 +11,7 @@ A stop-gap solution to make fglrx happier until buffers are updated. 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 5ebe487..7c3dc17 100644 +index 8f86a5b..a937b90 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -117,7 +117,7 @@ static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_g @@ -44,10 +44,10 @@ index 5ebe487..7c3dc17 100644 } diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 21d5b74..c00d1d3 100644 +index 59b9a9c..33a3b05 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -81,6 +81,7 @@ enum wined3d_cs_op +@@ -82,6 +82,7 @@ enum wined3d_cs_op WINED3D_CS_OP_VIEW_DESTROY, WINED3D_CS_OP_VDECL_DESTROY, WINED3D_CS_OP_SHADER_CLEANUP, @@ -55,7 +55,7 @@ index 21d5b74..c00d1d3 100644 WINED3D_CS_OP_STOP, }; -@@ -470,6 +471,12 @@ struct wined3d_cs_shader_cleanup +@@ -480,6 +481,12 @@ struct wined3d_cs_shader_cleanup struct wined3d_shader *shader; }; @@ -68,7 +68,7 @@ index 21d5b74..c00d1d3 100644 static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2307,6 +2314,30 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader +@@ -2421,6 +2428,30 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader cs->ops->submit(cs, sizeof(*op)); } @@ -99,7 +99,7 @@ index 21d5b74..c00d1d3 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2366,6 +2397,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2481,6 +2512,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, @@ -108,10 +108,10 @@ index 21d5b74..c00d1d3 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 2cdc6e9..63b8ece 100644 +index 9eb3c3a..4d5710a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2722,6 +2722,7 @@ void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_renderta +@@ -2822,6 +2822,7 @@ void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_renderta void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader *shader) DECLSPEC_HIDDEN; @@ -119,15 +119,15 @@ index 2cdc6e9..63b8ece 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -@@ -2810,6 +2811,8 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte +@@ -2910,6 +2911,8 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte const struct wined3d_state *state) DECLSPEC_HIDDEN; void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; +void buffer_create_buffer_object(struct wined3d_buffer *This, + struct wined3d_context *context) DECLSPEC_HIDDEN; + HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, + const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; - struct wined3d_rendertarget_view - { -- -2.2.1 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/0130-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch b/patches/wined3d-CSMT_Main/0130-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch index 1ca24cef..cad49161 100644 --- a/patches/wined3d-CSMT_Main/0130-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0130-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch @@ -1,4 +1,4 @@ -From 6462e66d6d2229b1755e7689e2b01eee97696676 Mon Sep 17 00:00:00 2001 +From 1ddba156e6aa9f96e9e05b18b1324183884a2596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 2 Oct 2013 22:50:08 +0200 Subject: wined3d: Clean up buffer resource data through the CS. @@ -10,7 +10,7 @@ Subject: wined3d: Clean up buffer resource data through the CS. 3 files changed, 50 insertions(+), 19 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index d968dcb..15ed760 100644 +index e248ca9..12a1ca0 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -545,37 +545,38 @@ static void buffer_unload(struct wined3d_resource *resource) @@ -72,10 +72,10 @@ index d968dcb..15ed760 100644 return refcount; diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 6edd5e3..40cd85d 100644 +index 4a42ca3..f64c43d 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -83,6 +83,7 @@ enum wined3d_cs_op +@@ -84,6 +84,7 @@ enum wined3d_cs_op WINED3D_CS_OP_SHADER_CLEANUP, WINED3D_CS_OP_CREATE_VBO, WINED3D_CS_OP_RESOURCE_CLEANUP, @@ -83,7 +83,7 @@ index 6edd5e3..40cd85d 100644 WINED3D_CS_OP_STOP, }; -@@ -484,6 +485,12 @@ struct wined3d_cs_resource_cleanup +@@ -494,6 +495,12 @@ struct wined3d_cs_resource_cleanup struct wined3d_resource *resource; }; @@ -96,7 +96,7 @@ index 6edd5e3..40cd85d 100644 static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2365,6 +2372,26 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_reso +@@ -2479,6 +2486,26 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_reso cs->ops->submit(cs, sizeof(*op)); } @@ -123,7 +123,7 @@ index 6edd5e3..40cd85d 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2426,6 +2453,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2541,6 +2568,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, @@ -132,10 +132,10 @@ index 6edd5e3..40cd85d 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index f4c269c..76c0708 100644 +index e80859a..83c94c5 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2709,6 +2709,7 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader +@@ -2826,6 +2826,7 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -143,14 +143,14 @@ index f4c269c..76c0708 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -@@ -2799,6 +2800,7 @@ void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT s +@@ -2916,6 +2917,7 @@ void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT s void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; void buffer_create_buffer_object(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; +void wined3d_buffer_cleanup_cs(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, + const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; - struct wined3d_rendertarget_view - { -- -2.1.3 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/0150-wined3d-Send-getdc-and-releasedc-through-the-command.patch b/patches/wined3d-CSMT_Main/0150-wined3d-Send-getdc-and-releasedc-through-the-command.patch index 84792fb1..f0197dd4 100644 --- a/patches/wined3d-CSMT_Main/0150-wined3d-Send-getdc-and-releasedc-through-the-command.patch +++ b/patches/wined3d-CSMT_Main/0150-wined3d-Send-getdc-and-releasedc-through-the-command.patch @@ -1,4 +1,4 @@ -From 660da782e4f462082b582638dab578af11c65b5f Mon Sep 17 00:00:00 2001 +From d16e01527b157dc80e7d6417b6f209d09450aecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 16 Mar 2014 14:13:42 +0100 Subject: wined3d: Send getdc and releasedc through the command stream. @@ -8,13 +8,13 @@ activation bug I just regret that I didn't describe more verbously earlier. I forgot what it was about exactly and can't be bothered to investigate atm. --- - dlls/wined3d/cs.c | 58 +++++++++++++++++++++++++ - dlls/wined3d/surface.c | 96 +++++++++++++++++++++--------------------- + dlls/wined3d/cs.c | 58 ++++++++++++++++++++++++++ + dlls/wined3d/surface.c | 93 +++++++++++++++++++++--------------------- dlls/wined3d/wined3d_private.h | 4 ++ - 3 files changed, 110 insertions(+), 48 deletions(-) + 3 files changed, 109 insertions(+), 46 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 56e5e1c..63040f6 100644 +index afc17a4..4830eb5 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -91,6 +91,8 @@ enum wined3d_cs_op @@ -104,17 +104,17 @@ index 56e5e1c..63040f6 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index f35f56e..3d42543 100644 +index c63bb66..18a2f91 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -2497,48 +2497,23 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2474,36 +2474,12 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, return wined3d_resource_map(&surface->resource, map_desc, box, flags); } -HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +void wined3d_surface_getdc_cs(struct wined3d_surface *surface) { -- HRESULT hr; + HRESULT hr; struct wined3d_device *device = surface->resource.device; struct wined3d_context *context = NULL; @@ -145,12 +145,7 @@ index f35f56e..3d42543 100644 if (device->d3d_initialized) context = context_acquire(surface->resource.device, NULL); - /* Create a DIB section if there isn't a dc yet. */ - if (!surface->hDC) - { -- hr = surface_create_dib_section(surface); -+ HRESULT hr = surface_create_dib_section(surface); - if (FAILED(hr)) +@@ -2514,7 +2490,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) { if (context) context_release(context); @@ -159,7 +154,7 @@ index f35f56e..3d42543 100644 } if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM -@@ -2551,35 +2526,40 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2527,35 +2503,40 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) if (context) context_release(context); @@ -220,7 +215,7 @@ index f35f56e..3d42543 100644 && surface->resource.map_binding != WINED3D_LOCATION_DIB)) { /* The game Salammbo modifies the surface contents without mapping the surface between -@@ -2600,6 +2580,26 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) +@@ -2576,6 +2557,26 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) if (context) context_release(context); } @@ -248,10 +243,10 @@ index f35f56e..3d42543 100644 return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7307746..d68bb48 100644 +index ec7bda3..670c14c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2540,6 +2540,8 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ +@@ -2571,6 +2571,8 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -260,7 +255,7 @@ index 7307746..d68bb48 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; -@@ -2815,6 +2817,8 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, +@@ -2844,6 +2846,8 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -270,5 +265,5 @@ index 7307746..d68bb48 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -2.6.0 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/0170-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch b/patches/wined3d-CSMT_Main/0170-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch index ef3a8703..9c1a92ee 100644 --- a/patches/wined3d-CSMT_Main/0170-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch +++ b/patches/wined3d-CSMT_Main/0170-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch @@ -1,4 +1,4 @@ -From 3f00564e2ed6f37b857d0724dea00646285c747c Mon Sep 17 00:00:00 2001 +From b0f13fef660a46a781b1dd849996049ebe514242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 28 Aug 2015 01:13:32 +0200 Subject: wined3d: Alloc the buffer map array before mapping the buffer. @@ -9,10 +9,10 @@ FIXME: This needs to go into whatever patch creates the VBO on first map. 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 6995264..753e38c 100644 +index 0c3dc56..531eb39 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c -@@ -1250,6 +1250,16 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device +@@ -1317,27 +1317,28 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device buffer->flags |= WINED3D_BUFFER_CREATEBO; } @@ -28,17 +28,14 @@ index 6995264..753e38c 100644 + if (data) { - BYTE *ptr; -@@ -1258,6 +1268,7 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device - if (FAILED(hr)) + if (FAILED(hr = wined3d_buffer_upload_data(buffer, NULL, data->data))) { - ERR("Failed to map buffer, hr %#x\n", hr); + ERR("Failed to upload data, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, buffer->maps); buffer_unload(&buffer->resource); resource_cleanup(&buffer->resource); return hr; -@@ -1268,16 +1279,6 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device - wined3d_buffer_unmap(buffer); + } } - buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps)); @@ -55,5 +52,5 @@ index 6995264..753e38c 100644 buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER; -- -2.5.1 +2.6.4 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 3cf234e2..732b1c1e 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -558,7 +558,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } /* Context activation is done by the caller. */ -@@ -177,6 +248,7 @@ +@@ -175,6 +246,7 @@ return TRUE; } @@ -566,7 +566,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c /* Context activation is done by the caller. */ static void wined3d_volume_load_location(struct wined3d_resource *resource, -@@ -187,6 +259,22 @@ +@@ -185,6 +257,22 @@ TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location), wined3d_debug_location(volume->resource.locations)); @@ -589,7 +589,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if ((volume->resource.access_flags & required_access) != required_access) { -@@ -205,6 +293,7 @@ +@@ -203,6 +291,7 @@ && !(volume->container->flags & WINED3D_TEXTURE_SRGB_ALLOCATED))) ERR("Trying to load (s)RGB texture without prior allocation.\n"); @@ -597,7 +597,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) { TRACE("Volume previously discarded, nothing to do.\n"); -@@ -238,6 +327,41 @@ +@@ -236,6 +325,41 @@ return; } wined3d_resource_validate_location(&volume->resource, location); @@ -639,7 +639,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (wined3d_volume_can_evict(volume)) wined3d_volume_evict_sysmem(volume); -@@ -248,11 +372,24 @@ +@@ -246,11 +370,24 @@ if (!volume->resource.heap_memory) ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n"); @@ -664,7 +664,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -263,6 +400,7 @@ +@@ -261,6 +398,7 @@ else { FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n", @@ -672,7 +672,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_debug_location(volume->resource.locations)); return; } -@@ -278,6 +416,28 @@ +@@ -276,6 +414,28 @@ struct wined3d_bo_address data = {volume->resource.buffer->name, NULL}; if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) @@ -701,7 +701,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -287,6 +447,7 @@ +@@ -285,6 +445,7 @@ else { FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n", @@ -709,7 +709,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_debug_location(volume->resource.locations)); return; } -@@ -296,6 +457,17 @@ +@@ -294,6 +455,17 @@ default: FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location), wined3d_debug_location(volume->resource.locations)); @@ -727,7 +727,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } } -@@ -303,6 +475,7 @@ +@@ -301,6 +473,7 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode) { wined3d_texture_prepare_texture(volume->container, context, srgb_mode); @@ -735,7 +735,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_resource_load_location(&volume->resource, context, srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); } -@@ -315,6 +488,51 @@ +@@ -313,6 +486,51 @@ resource_cleanup(&volume->resource); volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); wined3d_cs_emit_volume_cleanup(device->cs, volume); @@ -787,7 +787,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } static void volume_unload(struct wined3d_resource *resource) -@@ -328,6 +546,7 @@ +@@ -326,6 +544,7 @@ TRACE("texture %p.\n", resource); @@ -795,7 +795,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (wined3d_resource_prepare_system_memory(&volume->resource)) { context = context_acquire(device, NULL); -@@ -340,6 +559,29 @@ +@@ -338,6 +557,29 @@ ERR("Out of memory when unloading volume %p.\n", volume); wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); @@ -825,7 +825,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } /* The texture name is managed by the container. */ -@@ -348,6 +590,36 @@ +@@ -345,6 +587,36 @@ resource_unload(resource); } @@ -862,7 +862,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume, const struct wined3d_box *box) { -@@ -373,6 +645,7 @@ +@@ -370,6 +642,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { @@ -870,7 +870,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c HRESULT hr; const struct wined3d_format *format = volume->resource.format; const unsigned int fmt_flags = volume->container->resource.format_flags; -@@ -413,6 +686,177 @@ +@@ -410,6 +683,177 @@ if (hr == WINEDDERR_NOTLOCKED) return WINED3DERR_INVALIDCALL; return hr; @@ -1048,7 +1048,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } static ULONG volume_resource_incref(struct wined3d_resource *resource) -@@ -423,11 +867,13 @@ +@@ -420,11 +864,13 @@ return wined3d_texture_incref(volume->container); } @@ -1062,7 +1062,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c static ULONG volume_resource_decref(struct wined3d_resource *resource) { struct wined3d_volume *volume = volume_from_resource(resource); -@@ -449,6 +895,7 @@ +@@ -446,6 +892,7 @@ return WINED3DERR_INVALIDCALL; } @@ -1070,7 +1070,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); -@@ -457,6 +904,7 @@ +@@ -454,6 +901,7 @@ wined3d_texture_set_dirty(volume->container); } @@ -1078,7 +1078,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c static const struct wined3d_resource_ops volume_resource_ops = { volume_resource_incref, -@@ -464,8 +912,10 @@ +@@ -461,8 +909,10 @@ volume_unload, volume_resource_sub_resource_map, volume_resource_sub_resource_unmap, @@ -1089,7 +1089,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, -@@ -497,7 +947,11 @@ +@@ -494,7 +944,11 @@ } volume->texture_level = level; @@ -1101,7 +1101,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] -@@ -505,7 +959,9 @@ +@@ -502,7 +956,9 @@ { wined3d_resource_free_sysmem(&volume->resource); volume->resource.map_binding = WINED3D_LOCATION_BUFFER; @@ -1226,7 +1226,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader shader_arb_ps_local_constants(compiled, context, state, rt_height); } -@@ -7846,7 +7854,11 @@ +@@ -7849,7 +7857,11 @@ /* Now load the surface */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO @@ -1238,7 +1238,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader == WINED3D_LOCATION_DRAWABLE && !wined3d_resource_is_offscreen(&src_surface->container->resource)) { -@@ -7884,6 +7896,7 @@ +@@ -7887,6 +7899,7 @@ /* Leave the opengl state valid for blitting */ arbfp_blit_unset(context->gl_info); @@ -1246,7 +1246,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader if (wined3d_settings.cs_multithreaded) context->gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering -@@ -7895,6 +7908,17 @@ +@@ -7898,6 +7911,17 @@ 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); @@ -2008,24 +2008,23 @@ 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, -@@ -2439,9 +2544,16 @@ +@@ -2437,8 +2542,15 @@ struct wined3d_resource resource; struct wined3d_texture *container; +#if defined(STAGING_CSMT) - DWORD flags; - GLint texture_level; - DWORD download_count; -+#else /* STAGING_CSMT */ -+ DWORD flags, locations; + GLint texture_level; + DWORD download_count; ++#else /* STAGING_CSMT */ ++ DWORD locations; + GLint texture_level; + DWORD download_count; + GLuint pbo; +#endif /* STAGING_CSMT */ }; static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) -@@ -2449,6 +2561,7 @@ +@@ -2446,6 +2558,7 @@ return CONTAINING_RECORD(resource, struct wined3d_volume, resource); } @@ -2033,7 +2032,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; -@@ -2464,6 +2577,27 @@ +@@ -2461,6 +2574,27 @@ struct wined3d_surface_dib { HBITMAP DIBsection; @@ -2061,7 +2060,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT bitmap_size; }; -@@ -2489,7 +2623,11 @@ +@@ -2486,7 +2620,11 @@ struct wined3d_surface_ops { HRESULT (*surface_private_setup)(struct wined3d_surface *surface); @@ -2073,7 +2072,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_surface -@@ -2497,12 +2635,26 @@ +@@ -2494,12 +2632,26 @@ struct wined3d_resource resource; const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; @@ -2100,7 +2099,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h GLuint rb_multisample; GLuint rb_resolved; GLenum texture_target; -@@ -2546,11 +2698,22 @@ +@@ -2543,11 +2695,22 @@ 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; @@ -2123,7 +2122,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 wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; -@@ -2562,6 +2725,7 @@ +@@ -2559,6 +2722,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; @@ -2131,7 +2130,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; -@@ -2576,6 +2740,17 @@ +@@ -2573,6 +2737,17 @@ void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_getdc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -2149,7 +2148,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h 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; -@@ -2597,8 +2772,10 @@ +@@ -2593,8 +2768,10 @@ GLuint name; }; @@ -2160,7 +2159,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_vertex_declaration_element { const struct wined3d_format *format; -@@ -2627,8 +2804,10 @@ +@@ -2623,8 +2800,10 @@ BOOL half_float_conv_needed; }; @@ -2171,7 +2170,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]; -@@ -2696,6 +2875,7 @@ +@@ -2692,6 +2871,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2179,7 +2178,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; -@@ -2746,6 +2926,32 @@ +@@ -2742,6 +2922,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; @@ -2212,7 +2211,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; -@@ -2795,6 +3001,7 @@ +@@ -2791,6 +2997,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; @@ -2220,7 +2219,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, -@@ -2858,6 +3065,7 @@ +@@ -2854,6 +3061,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, unsigned int depth_pitch) DECLSPEC_HIDDEN; @@ -2228,7 +2227,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 -@@ -2872,8 +3080,12 @@ +@@ -2868,8 +3076,12 @@ struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -2241,7 +2240,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_query -@@ -2887,12 +3099,16 @@ +@@ -2883,12 +3095,16 @@ enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -2258,7 +2257,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 */ -@@ -2919,7 +3135,9 @@ +@@ -2915,7 +3131,9 @@ GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -2268,7 +2267,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -2944,11 +3162,15 @@ +@@ -2940,11 +3158,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; @@ -2281,10 +2280,10 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +#else /* STAGING_CSMT */ +void buffer_mark_used(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; +#endif /* STAGING_CSMT */ + HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, + const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; - struct wined3d_rendertarget_view - { -@@ -2987,8 +3209,10 @@ +@@ -2985,8 +3207,10 @@ return surface_from_resource(resource); } @@ -2295,7 +2294,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_shader_resource_view { LONG refcount; -@@ -3001,8 +3225,12 @@ +@@ -2999,8 +3223,12 @@ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, @@ -2308,7 +2307,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_swapchain -@@ -3041,8 +3269,10 @@ +@@ -3039,8 +3267,10 @@ void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -2319,7 +2318,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /***************************************************************************** * Utility function prototypes -@@ -3246,7 +3476,9 @@ +@@ -3244,7 +3474,9 @@ void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_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; @@ -4022,7 +4021,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, resource %p, sub_resource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u.\n", device, resource, sub_resource_idx, box, data, row_pitch, depth_pitch); -@@ -3980,7 +4419,14 @@ +@@ -3997,7 +4436,14 @@ WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx); return; } @@ -4037,7 +4036,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (box) { if (box->left >= box->right || box->right > sub_resource->width -@@ -3990,9 +4436,47 @@ +@@ -4007,9 +4453,47 @@ box->left, box->top, box->front, box->right, box->bottom, box->back); return; } @@ -4085,7 +4084,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, -@@ -4023,8 +4507,14 @@ +@@ -4040,8 +4524,14 @@ rect = &r; } @@ -4100,7 +4099,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, -@@ -4038,6 +4528,7 @@ +@@ -4055,6 +4545,7 @@ return NULL; } @@ -4108,7 +4107,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return device->state.fb.render_targets[view_idx]; } -@@ -4053,6 +4544,22 @@ +@@ -4070,6 +4561,22 @@ { struct wined3d_rendertarget_view *prev; struct wined3d_fb_state *fb = &device->state.fb; @@ -4131,7 +4130,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n", device, view_idx, view, set_viewport); -@@ -4092,6 +4599,7 @@ +@@ -4109,6 +4616,7 @@ } @@ -4139,7 +4138,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c prev = fb->render_targets[view_idx]; if (view == prev) return WINED3D_OK; -@@ -4099,6 +4607,15 @@ +@@ -4116,6 +4624,15 @@ if (view) wined3d_rendertarget_view_incref(view); fb->render_targets[view_idx] = view; @@ -4155,7 +4154,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view); /* Release after the assignment, to prevent device_resource_released() * from seeing the surface as still in use. */ -@@ -4110,6 +4627,7 @@ +@@ -4127,6 +4644,7 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -4163,7 +4162,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_fb_state *fb = &device->state.fb; struct wined3d_rendertarget_view *prev; -@@ -4127,6 +4645,66 @@ +@@ -4144,6 +4662,66 @@ wined3d_cs_emit_set_depth_stencil_view(device->cs, view); if (prev) wined3d_rendertarget_view_decref(prev); @@ -4230,7 +4229,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device, -@@ -4147,6 +4725,14 @@ +@@ -4164,6 +4742,14 @@ cursor_image = surface_from_resource(sub_resource); @@ -4245,7 +4244,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (cursor_image->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM) { WARN("Surface %p has an invalid format %s.\n", -@@ -4174,6 +4760,13 @@ +@@ -4191,6 +4777,13 @@ * release it after setting the cursor image. Windows doesn't * addref the set surface, so we can't do this either without * creating circular refcount dependencies. */ @@ -4259,7 +4258,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (cursor_image->resource.width == 32 && cursor_image->resource.height == 32) { -@@ -4278,6 +4871,12 @@ +@@ -4295,6 +4888,12 @@ else SetCursor(NULL); } @@ -4272,7 +4271,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return oldVisible; } -@@ -4288,8 +4887,10 @@ +@@ -4305,8 +4904,10 @@ TRACE("device %p.\n", device); @@ -4283,7 +4282,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) { TRACE("Checking resource %p for eviction.\n", resource); -@@ -4297,6 +4898,7 @@ +@@ -4314,6 +4915,7 @@ if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) { TRACE("Evicting %p.\n", resource); @@ -4291,7 +4290,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_evict_resource(device->cs, resource); } } -@@ -4315,6 +4917,37 @@ +@@ -4332,6 +4934,37 @@ context = context_acquire(device, NULL); gl_info = context->gl_info; @@ -4329,7 +4328,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->depth_blt_texture) { -@@ -4335,6 +4968,7 @@ +@@ -4352,6 +4985,7 @@ HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -4337,7 +4336,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c swapchain->num_contexts = 0; } -@@ -4354,6 +4988,14 @@ +@@ -4371,6 +5005,14 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { @@ -4352,7 +4351,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HRESULT hr; if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4370,6 +5012,7 @@ +@@ -4387,6 +5029,7 @@ return hr; } @@ -4360,7 +4359,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); if (FAILED(hr)) { -@@ -4380,6 +5023,34 @@ +@@ -4397,6 +5040,34 @@ } wined3d_cs_emit_create_dummy_textures(device->cs); @@ -4395,7 +4394,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4398,9 +5069,11 @@ +@@ -4415,9 +5086,11 @@ TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n", device, swapchain_desc, mode, callback, reset_state); @@ -4407,7 +4406,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { ERR("Failed to get the first implicit swapchain.\n"); -@@ -4415,9 +5088,21 @@ +@@ -4432,9 +5105,21 @@ wined3d_texture_decref(device->logo_texture); device->logo_texture = NULL; } @@ -4429,7 +4428,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4426,6 +5111,7 @@ +@@ -4443,6 +5128,7 @@ } wined3d_device_set_depth_stencil_view(device, NULL); @@ -4437,7 +4436,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (reset_state) { state_unbind_resources(&device->state); -@@ -4435,6 +5121,12 @@ +@@ -4452,6 +5138,12 @@ { wined3d_texture_decref(device->cs->onscreen_depth_stencil->container); device->cs->onscreen_depth_stencil = NULL; @@ -4450,7 +4449,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4447,6 +5139,7 @@ +@@ -4464,6 +5156,7 @@ } } @@ -4458,7 +4457,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Free implicit resources and wait for the command stream before modifying * swapchain parameters. After modifying the swapchain parameters a new GL * context may be acquired by the worker thread. This causes problems in the -@@ -4468,6 +5161,7 @@ +@@ -4485,6 +5178,7 @@ } device->cs->ops->finish(device->cs); @@ -4466,7 +4465,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("New params:\n"); TRACE("backbuffer_width %u\n", swapchain_desc->backbuffer_width); TRACE("backbuffer_height %u\n", swapchain_desc->backbuffer_height); -@@ -4594,6 +5288,13 @@ +@@ -4611,6 +5305,13 @@ swapchain_desc->multisample_type, swapchain_desc->multisample_quality))) return hr; @@ -4480,7 +4479,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (swapchain->desc.enable_auto_depth_stencil) { struct wined3d_resource_desc texture_desc; -@@ -4636,6 +5337,13 @@ +@@ -4653,6 +5354,13 @@ wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); } @@ -4494,7 +4493,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface( surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)), NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) -@@ -4656,12 +5364,20 @@ +@@ -4673,12 +5381,20 @@ } wined3d_cs_emit_reset_state(device->cs); state_cleanup(&device->state); @@ -4515,7 +4514,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize device state, hr %#x.\n", hr); device->update_state = &device->state; -@@ -4670,6 +5386,7 @@ +@@ -4687,6 +5403,7 @@ } else if (device->back_buffer_view) { @@ -4523,7 +4522,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_state *state = &device->state; wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE); -@@ -4685,6 +5402,24 @@ +@@ -4702,6 +5419,24 @@ state->scissor_rect.left = 0; state->scissor_rect.right = swapchain->desc.backbuffer_width; state->scissor_rect.bottom = swapchain->desc.backbuffer_height; @@ -4548,7 +4547,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4760,6 +5495,10 @@ +@@ -4777,6 +5512,10 @@ TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); @@ -4559,7 +4558,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c switch (type) { case WINED3D_RTYPE_SURFACE: -@@ -4770,6 +5509,7 @@ +@@ -4787,6 +5526,7 @@ for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -4567,7 +4566,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface) { ERR("Surface %p is still in use as render target %u.\n", surface, i); -@@ -4781,6 +5521,19 @@ +@@ -4798,6 +5538,19 @@ { ERR("Surface %p is still in use as depth/stencil buffer.\n", surface); device->state.fb.depth_stencil = NULL; @@ -4587,7 +4586,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } } break; -@@ -4943,7 +5696,11 @@ +@@ -4960,7 +5713,11 @@ device->blitter = adapter->blitter; @@ -4599,7 +4598,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) { ERR("Failed to initialize device state, hr %#x.\n", hr); -@@ -5042,6 +5799,7 @@ +@@ -5059,6 +5816,7 @@ else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -4607,7 +4606,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Context activation is done by the caller */ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, -@@ -5095,3 +5853,4 @@ +@@ -5112,3 +5870,4 @@ wined3d_device_destroy_bo(device, context, bo); } @@ -6173,42 +6172,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } static void texture2d_sub_resource_upload_data(struct wined3d_resource *sub_resource, -@@ -890,6 +945,7 @@ - - if (gl_info->supported[APPLE_CLIENT_STORAGE]) - { -+#if defined(STAGING_CSMT) - if (surface->flags & (SFLAG_NONPOW2) - || texture->flags & WINED3D_TEXTURE_CONVERTED) - { -@@ -898,12 +954,26 @@ - * WINED3D_TEXTURE_CONVERTED: The conversion destination memory is freed after loading the surface - * heap_memory == NULL: Not defined in the extension. Seems to disable client storage effectively - */ -+#else /* STAGING_CSMT */ -+ if (surface->flags & (SFLAG_NONPOW2 | SFLAG_DIBSECTION) -+ || texture->flags & WINED3D_TEXTURE_CONVERTED -+ || !surface->resource.heap_memory) -+ { -+ /* In some cases we want to disable client storage. -+ * SFLAG_NONPOW2 has a bigger opengl texture than the client memory, and different pitches -+ * SFLAG_DIBSECTION: Dibsections may have read / write protections on the memory. Avoid issues... -+ * WINED3D_TEXTURE_CONVERTED: The conversion destination memory is freed after loading the surface -+ * heap_memory == NULL: Not defined in the extension. Seems to disable client storage effectively -+ */ -+#endif /* STAGING_CSMT */ - surface->flags &= ~SFLAG_CLIENT; - } - else - { -+#if defined(STAGING_CSMT) - wined3d_resource_prepare_system_memory(&surface->resource); - -+#endif /* STAGING_CSMT */ - surface->flags |= SFLAG_CLIENT; - mem = surface->resource.heap_memory; - -@@ -994,6 +1064,7 @@ +@@ -954,6 +1009,7 @@ return wined3d_surface_unmap(surface_from_resource(sub_resource)); } @@ -6216,7 +6180,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c static void wined3d_texture_load_location_invalidated(struct wined3d_resource *resource, DWORD location) { ERR("Should not be called on textures.\n"); -@@ -1006,6 +1077,7 @@ +@@ -966,6 +1022,7 @@ ERR("Should not be called on textures.\n"); } @@ -6224,7 +6188,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c static const struct wined3d_resource_ops texture2d_resource_ops = { texture_resource_incref, -@@ -1013,8 +1085,10 @@ +@@ -973,8 +1030,10 @@ wined3d_texture_unload, texture2d_resource_sub_resource_map, texture2d_resource_sub_resource_unmap, @@ -6235,7 +6199,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c }; static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, -@@ -1031,7 +1105,9 @@ +@@ -991,7 +1050,9 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6245,7 +6209,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1041,6 +1117,7 @@ +@@ -1001,6 +1062,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); @@ -6253,7 +6217,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1049,6 +1126,14 @@ +@@ -1009,6 +1071,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6268,7 +6232,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1069,7 +1154,9 @@ +@@ -1029,7 +1099,9 @@ else { WARN("Attempted to create a NPOT cube texture (edge length %u) without GL support.\n", desc->width); @@ -6278,7 +6242,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1079,7 +1166,9 @@ +@@ -1039,7 +1111,9 @@ surface_flags, device, parent, parent_ops, &texture2d_resource_ops))) { WARN("Failed to initialize texture, returning %#x\n", hr); @@ -6288,7 +6252,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1142,7 +1231,9 @@ +@@ -1102,7 +1176,9 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6298,7 +6262,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1173,7 +1264,9 @@ +@@ -1133,7 +1209,9 @@ else { WARN("Attempted to create a mipmapped NPOT texture without unconditional NPOT support.\n"); @@ -6308,7 +6272,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1186,6 +1279,7 @@ +@@ -1146,6 +1224,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n"); @@ -6316,7 +6280,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1194,6 +1288,14 @@ +@@ -1154,6 +1233,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6331,7 +6295,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1202,7 +1304,9 @@ +@@ -1162,7 +1249,9 @@ surface_flags, device, parent, parent_ops, &texture2d_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6341,7 +6305,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1288,12 +1392,25 @@ +@@ -1248,12 +1337,25 @@ static void texture3d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) { @@ -6367,7 +6331,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_resource, -@@ -1303,7 +1420,11 @@ +@@ -1263,7 +1365,11 @@ struct wined3d_const_bo_address addr; unsigned int row_pitch, slice_pitch; @@ -6379,19 +6343,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (row_pitch != data->row_pitch || slice_pitch != data->slice_pitch) FIXME("Ignoring row/slice pitch (%u/%u).\n", data->row_pitch, data->slice_pitch); -@@ -1328,7 +1449,11 @@ - void *mem = NULL; - - if (gl_info->supported[APPLE_CLIENT_STORAGE] && !format->convert -+#if defined(STAGING_CSMT) - && wined3d_resource_prepare_system_memory(&volume->resource)) -+#else /* STAGING_CSMT */ -+ && volume_prepare_system_memory(volume)) -+#endif /* STAGING_CSMT */ - { - TRACE("Enabling GL_UNPACK_CLIENT_STORAGE_APPLE for volume %p\n", volume); - gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); -@@ -1405,6 +1530,7 @@ +@@ -1348,6 +1454,7 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6399,7 +6351,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1413,6 +1539,14 @@ +@@ -1356,6 +1463,14 @@ { WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture); HeapFree(GetProcessHeap(), 0, texture); @@ -6414,7 +6366,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1422,6 +1556,7 @@ +@@ -1365,6 +1480,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); @@ -6422,7 +6374,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1430,6 +1565,14 @@ +@@ -1373,6 +1489,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6437,7 +6389,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1457,7 +1600,9 @@ +@@ -1400,7 +1524,9 @@ { WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n", desc->width, desc->height, desc->depth); @@ -6447,7 +6399,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1467,7 +1612,9 @@ +@@ -1410,7 +1536,9 @@ 0, device, parent, parent_ops, &texture3d_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6457,7 +6409,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1568,6 +1715,9 @@ +@@ -1511,6 +1639,9 @@ if (FAILED(hr)) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6729,7 +6681,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: -@@ -499,8 +666,34 @@ +@@ -497,8 +664,12 @@ return; wined3d_resource_free_sysmem(&surface->resource); @@ -6738,33 +6690,11 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); +#else /* STAGING_CSMT */ + surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM); -+} -+ -+static void surface_release_client_storage(struct wined3d_surface *surface) -+{ -+ struct wined3d_context *context = context_acquire(surface->resource.device, NULL); -+ const struct wined3d_gl_info *gl_info = context->gl_info; -+ -+ if (surface->container->texture_rgb.name) -+ { -+ wined3d_texture_bind_and_dirtify(surface->container, context, FALSE); -+ gl_info->gl_ops.gl.p_glTexImage2D(surface->texture_target, surface->texture_level, -+ GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); -+ } -+ if (surface->container->texture_srgb.name) -+ { -+ wined3d_texture_bind_and_dirtify(surface->container, context, TRUE); -+ gl_info->gl_ops.gl.p_glTexImage2D(surface->texture_target, surface->texture_level, -+ GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); -+ } -+ wined3d_texture_force_reload(surface->container); -+ -+ context_release(context); +#endif /* STAGING_CSMT */ } static BOOL surface_use_pbo(const struct wined3d_surface *surface) -@@ -585,7 +778,11 @@ +@@ -583,7 +754,11 @@ } if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) @@ -6776,7 +6706,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; -@@ -593,6 +790,7 @@ +@@ -591,6 +766,7 @@ return WINED3D_OK; } @@ -6784,7 +6714,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; -@@ -609,6 +807,54 @@ +@@ -607,6 +783,54 @@ wined3d_resource_load_location(&surface->resource, context, surface->container->resource.draw_binding); if (context) context_release(context); @@ -6839,7 +6769,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static BOOL surface_is_full_rect(const struct wined3d_surface *surface, const RECT *r) -@@ -669,9 +915,15 @@ +@@ -667,9 +891,15 @@ /* Make sure the locations are up-to-date. Loading the destination * surface isn't required if the entire surface is overwritten. */ @@ -6855,7 +6785,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c else wined3d_surface_prepare(dst_surface, context, dst_location); -@@ -762,9 +1014,15 @@ +@@ -760,9 +990,15 @@ * 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.) */ @@ -6871,7 +6801,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c else wined3d_surface_prepare(dst_surface, old_ctx, dst_location); -@@ -956,6 +1214,18 @@ +@@ -954,6 +1190,18 @@ return WINED3D_OK; } @@ -6890,7 +6820,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)); -@@ -981,6 +1251,7 @@ +@@ -979,6 +1227,7 @@ if (resource->pool == WINED3D_POOL_DEFAULT) { @@ -6898,7 +6828,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Default pool resources are supposed to be destroyed before Reset is called. * Implicit resources stay however. So this means we have an implicit render target * or depth stencil. The content may be destroyed, but we still have to tear down -@@ -994,6 +1265,40 @@ +@@ -992,6 +1241,40 @@ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); } @@ -6939,7 +6869,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 -@@ -1037,6 +1342,7 @@ +@@ -1035,6 +1318,7 @@ return WINED3DERR_INVALIDCALL; } @@ -6947,7 +6877,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); -@@ -1052,6 +1358,21 @@ +@@ -1050,6 +1334,21 @@ { surface_private_setup, surface_frontbuffer_updated, @@ -6969,7 +6899,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c }; /***************************************************************************** -@@ -1095,6 +1416,7 @@ +@@ -1093,6 +1392,7 @@ return WINED3D_OK; } @@ -6977,7 +6907,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); -@@ -1104,6 +1426,23 @@ +@@ -1102,6 +1402,23 @@ { gdi_surface_private_setup, gdi_surface_frontbuffer_updated, @@ -7001,7 +6931,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 -@@ -1122,7 +1461,11 @@ +@@ -1120,7 +1437,11 @@ return; } @@ -7013,7 +6943,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface->container->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) { -@@ -1150,6 +1493,7 @@ +@@ -1148,6 +1469,7 @@ void *mem; GLenum gl_format = format->glFormat; GLenum gl_type = format->glType; @@ -7021,7 +6951,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c UINT src_pitch = 0; UINT dst_row_pitch, dst_slice_pitch; -@@ -1158,6 +1502,16 @@ +@@ -1156,6 +1478,16 @@ unsigned char alignment = surface->resource.device->surface_alignment; src_pitch = format->byte_count * surface->pow2Width; wined3d_resource_get_pitch(&surface->resource, &dst_row_pitch, &dst_slice_pitch); @@ -7038,7 +6968,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1); mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * surface->pow2Height); } -@@ -1244,12 +1598,21 @@ +@@ -1242,12 +1574,21 @@ * won't be released, and doesn't have to be re-read. */ src_data = mem; dst_data = data.addr; @@ -7060,7 +6990,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HeapFree(GetProcessHeap(), 0, mem); -@@ -1373,10 +1736,33 @@ +@@ -1371,10 +1712,33 @@ static BOOL surface_check_block_align(struct wined3d_surface *surface, const struct wined3d_box *box) { @@ -7094,7 +7024,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { struct wined3d_box box = {rect->left, rect->top, rect->right, rect->bottom, 0, 1}; -@@ -1395,7 +1781,11 @@ +@@ -1393,7 +1757,11 @@ UINT update_w, update_h; UINT dst_w, dst_h; RECT r, dst_rect; @@ -7106,7 +7036,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c POINT p; TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n", -@@ -1466,11 +1856,17 @@ +@@ -1464,11 +1832,17 @@ return WINED3DERR_INVALIDCALL; } @@ -7124,7 +7054,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; -@@ -1481,6 +1877,7 @@ +@@ -1479,6 +1853,7 @@ if (update_w == dst_w && update_h == dst_h) wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); else @@ -7132,7 +7062,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); -@@ -1494,6 +1891,21 @@ +@@ -1492,6 +1867,21 @@ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -7154,7 +7084,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -1607,6 +2019,7 @@ +@@ -1605,6 +1995,7 @@ if (surface->resource.pool == WINED3D_POOL_SCRATCH) ERR("Not supported on scratch surfaces.\n"); @@ -7162,7 +7092,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"); -@@ -1615,6 +2028,16 @@ +@@ -1613,6 +2004,16 @@ TRACE("Reloading because surface is dirty.\n"); wined3d_resource_load_location(&surface->resource, context, location); @@ -7179,7 +7109,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_evict_sysmem(surface); } -@@ -1697,6 +2120,7 @@ +@@ -1695,6 +2096,7 @@ void CDECL wined3d_surface_preload(struct wined3d_surface *surface) { @@ -7187,7 +7117,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); -@@ -1707,6 +2131,17 @@ +@@ -1705,6 +2107,17 @@ } wined3d_cs_emit_surface_preload(device->cs, surface); @@ -7205,7 +7135,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) -@@ -1725,10 +2160,28 @@ +@@ -1723,10 +2136,28 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface) { @@ -7234,7 +7164,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y) -@@ -1853,6 +2306,7 @@ +@@ -1851,6 +2282,7 @@ { DeleteDC(surface->hDC); DeleteObject(surface->dib.DIBsection); @@ -7242,7 +7172,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; -@@ -1861,6 +2315,15 @@ +@@ -1859,6 +2291,15 @@ surface->resource.locations = 0; wined3d_resource_free_sysmem(&surface->resource); surface->resource.map_heap_memory = NULL; @@ -7258,7 +7188,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c width = texture_resource->width; height = texture_resource->height; -@@ -1886,6 +2349,7 @@ +@@ -1884,6 +2325,7 @@ else surface->flags &= ~SFLAG_NONPOW2; @@ -7266,7 +7196,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((surface->resource.user_memory = mem)) { surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; -@@ -1906,6 +2370,27 @@ +@@ -1904,6 +2346,27 @@ surface->resource.size = wined3d_format_calculate_size(texture_resource->format, 1, width, height, 1); surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width); @@ -7294,7 +7224,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* The format might be changed to a format that needs conversion. -@@ -1928,11 +2413,19 @@ +@@ -1926,11 +2389,19 @@ if (!valid_location) { @@ -7314,7 +7244,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -2291,6 +2784,7 @@ +@@ -2289,6 +2760,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) { @@ -7322,7 +7252,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; -@@ -2299,6 +2793,13 @@ +@@ -2297,6 +2769,13 @@ struct wined3d_surface *dst; struct wined3d_context *context = NULL; struct wined3d_device *device = source->resource.device; @@ -7336,7 +7266,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conv = find_converter(source->resource.format->id, to_fmt); if (!conv) -@@ -2322,6 +2823,7 @@ +@@ -2320,6 +2799,7 @@ } dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); @@ -7344,7 +7274,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); -@@ -2362,6 +2864,32 @@ +@@ -2360,6 +2840,32 @@ if (context) context_release(context); return NULL; @@ -7377,7 +7307,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, -@@ -2429,6 +2957,7 @@ +@@ -2427,6 +2933,7 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -7385,7 +7315,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p.\n", surface); -@@ -2439,6 +2968,20 @@ +@@ -2437,6 +2944,20 @@ memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); return hr; @@ -7406,11 +7336,10 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, -@@ -2446,7 +2989,22 @@ +@@ -2444,6 +2965,21 @@ { const struct wined3d_format *format = surface->resource.format; unsigned int fmt_flags = surface->container->resource.format_flags; -- +#if !defined(STAGING_CSMT) + struct wined3d_device *device = surface->resource.device; + struct wined3d_context *context; @@ -7426,11 +7355,10 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + return WINED3DERR_INVALIDCALL; + } +#endif /* STAGING_CSMT */ -+ + if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box && !surface_check_block_align(surface, box)) - { -@@ -2457,6 +3015,13 @@ +@@ -2455,6 +2991,13 @@ return WINED3DERR_INVALIDCALL; } @@ -7444,7 +7372,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 -@@ -2472,6 +3037,7 @@ +@@ -2470,6 +3013,7 @@ } } @@ -7452,10 +7380,11 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (box) { surface->lockedRect.left = box->left; -@@ -2553,6 +3119,179 @@ - void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) - { - if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM +@@ -2493,7 +3037,121 @@ + HRESULT hr; + struct wined3d_device *device = surface->resource.device; + struct wined3d_context *context = NULL; +- +#else /* STAGING_CSMT */ + surface_prepare_map_memory(surface); + if (flags & WINED3D_MAP_DISCARD) @@ -7569,23 +7498,24 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + /* Can't GetDC if the surface is locked. */ + if (surface->resource.map_count) + return WINED3DERR_INVALIDCALL; ++#endif /* STAGING_CSMT */ + -+ if (device->d3d_initialized) -+ context = context_acquire(surface->resource.device, NULL); -+ -+ /* Create a DIB section if there isn't a dc yet. */ -+ if (!surface->hDC) -+ { -+ if (surface->flags & SFLAG_CLIENT) -+ { -+ surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM); -+ surface_release_client_storage(surface); -+ } -+ hr = surface_create_dib_section(surface); -+ if (FAILED(hr)) -+ { -+ if (context) -+ context_release(context); + if (device->d3d_initialized) + context = context_acquire(surface->resource.device, NULL); + +@@ -2504,6 +3162,7 @@ + { + if (context) + context_release(context); ++#if defined(STAGING_CSMT) + return; + } + if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY +@@ -2551,6 +3210,50 @@ + void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) + { + if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM ++#else /* STAGING_CSMT */ + return WINED3DERR_INVALIDCALL; + } + if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY @@ -7632,7 +7562,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c && surface->resource.map_binding != WINED3D_LOCATION_DIB)) { /* The game Salammbo modifies the surface contents without mapping the surface between -@@ -2568,6 +3307,7 @@ +@@ -2566,6 +3269,7 @@ if (device->d3d_initialized) context = context_acquire(device, NULL); @@ -7640,7 +7570,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); if (context) -@@ -2593,6 +3333,13 @@ +@@ -2591,6 +3295,13 @@ surface->flags &= ~SFLAG_DCINUSE; wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); @@ -7654,7 +7584,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -2609,9 +3356,14 @@ +@@ -2607,9 +3318,14 @@ int i; BOOL srcIsUpsideDown; struct wined3d_bo_address data; @@ -7669,7 +7599,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface != old_ctx->current_rt) { -@@ -2651,8 +3403,13 @@ +@@ -2649,8 +3365,13 @@ } /* Setup pixel store pack state -- to glReadPixels into the correct place */ @@ -7683,7 +7613,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c checkGLcall("glPixelStorei"); gl_info->gl_ops.gl.p_glReadPixels(0, 0, -@@ -2669,6 +3426,10 @@ +@@ -2667,6 +3388,10 @@ { /* glReadPixels returns the image upside down, and there is no way to prevent this. * Flip the lines in software. */ @@ -7694,7 +7624,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) goto error; -@@ -2895,8 +3656,13 @@ +@@ -2893,8 +3618,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. */ @@ -7708,7 +7638,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Uses the hardware to stretch and flip the image */ -@@ -2964,7 +3730,11 @@ +@@ -2962,7 +3692,11 @@ checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -7720,7 +7650,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 -@@ -3161,6 +3931,7 @@ +@@ -3159,6 +3893,7 @@ checkGLcall("glDeleteTextures(1, &backup)"); } @@ -7728,7 +7658,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) -@@ -3172,6 +3943,17 @@ +@@ -3170,6 +3905,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); @@ -7746,7 +7676,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3226,9 +4008,15 @@ +@@ -3224,9 +3970,15 @@ gl_info = context->gl_info; @@ -7762,7 +7692,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 */ -@@ -3271,9 +4059,13 @@ +@@ -3269,9 +4021,13 @@ /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -7776,7 +7706,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c || (dst_surface->container->swapchain && dst_surface->container->swapchain->front_buffer == dst_surface->container)) gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ -@@ -3303,8 +4095,13 @@ +@@ -3301,8 +4057,13 @@ enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -7790,7 +7720,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), -@@ -3495,6 +4292,7 @@ +@@ -3493,6 +4254,7 @@ { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -7798,7 +7728,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))) -@@ -3503,6 +4301,15 @@ +@@ -3501,6 +4263,15 @@ surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; surface->resource.locations = location; @@ -7814,7 +7744,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Context activation is done by the caller. */ -@@ -3517,7 +4324,11 @@ +@@ -3515,7 +4286,11 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -7826,7 +7756,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; -@@ -3543,6 +4354,7 @@ +@@ -3541,6 +4316,7 @@ return; } @@ -7834,7 +7764,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface->resource.locations & WINED3D_LOCATION_DISCARDED) { TRACE("Surface was discarded, no need copy data.\n"); -@@ -3558,6 +4370,23 @@ +@@ -3556,6 +4332,23 @@ { FIXME("No up to date depth stencil location.\n"); surface->resource.locations |= location; @@ -7858,7 +7788,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; -@@ -3621,9 +4450,13 @@ +@@ -3619,9 +4412,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7872,7 +7802,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) -@@ -3639,9 +4472,13 @@ +@@ -3637,9 +4434,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7886,7 +7816,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 -@@ -3649,6 +4486,7 @@ +@@ -3647,6 +4448,7 @@ ERR("Invalid location (%#x) specified.\n", location); } @@ -7894,7 +7824,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; -@@ -3681,6 +4519,124 @@ +@@ -3679,6 +4481,124 @@ FIXME("Can't load surface %p with location flags %s into sysmem.\n", surface, wined3d_debug_location(surface->resource.locations)); @@ -8019,7 +7949,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Context activation is done by the caller. */ -@@ -3689,12 +4645,14 @@ +@@ -3687,12 +4607,14 @@ { RECT r; @@ -8034,7 +7964,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)) { -@@ -3703,7 +4661,11 @@ +@@ -3701,7 +4623,11 @@ } surface_get_rect(surface, NULL, &r); @@ -8046,7 +7976,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -3718,6 +4680,7 @@ +@@ -3716,6 +4642,7 @@ struct wined3d_device *device = surface->resource.device; const struct wined3d_color_key_conversion *conversion; struct wined3d_texture *texture = surface->container; @@ -8054,7 +7984,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c UINT width, src_row_pitch, src_slice_pitch, dst_pitch; struct wined3d_bo_address data; struct wined3d_format format; -@@ -3744,6 +4707,24 @@ +@@ -3742,6 +4669,24 @@ } if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) @@ -8079,7 +8009,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c && (surface->container->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB) && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, -@@ -3759,6 +4740,7 @@ +@@ -3757,6 +4702,7 @@ return WINED3D_OK; } @@ -8087,7 +8017,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) && (!srgb || (surface->container->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)) && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, -@@ -3766,6 +4748,15 @@ +@@ -3764,6 +4710,15 @@ NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) { DWORD src_location = surface->resource.locations & WINED3D_LOCATION_RB_RESOLVED ? @@ -8103,7 +8033,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE; DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; RECT rect = {0, 0, surface->resource.width, surface->resource.height}; -@@ -3780,6 +4771,7 @@ +@@ -3778,6 +4733,7 @@ if (srgb) { @@ -8111,7 +8041,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) { -@@ -3814,6 +4806,42 @@ +@@ -3812,6 +4768,42 @@ width = surface->resource.width; wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch); @@ -8154,7 +8084,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c format = *texture->resource.format; if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) -@@ -3822,7 +4850,11 @@ +@@ -3820,7 +4812,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. */ @@ -8166,7 +8096,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3831,6 +4863,7 @@ +@@ -3829,6 +4825,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -8174,7 +8104,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); -@@ -3838,6 +4871,14 @@ +@@ -3836,6 +4833,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -8189,7 +8119,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. */ -@@ -3852,9 +4893,15 @@ +@@ -3850,9 +4855,15 @@ context_release(context); return E_OUTOFMEMORY; } @@ -8205,7 +8135,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c data.addr = mem; } else if (conversion) -@@ -3874,6 +4921,7 @@ +@@ -3872,6 +4883,7 @@ } if (texture->swapchain && texture->swapchain->palette) palette = texture->swapchain->palette; @@ -8213,7 +8143,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conversion->convert(data.addr, src_row_pitch, mem, dst_pitch, width, height, palette, &texture->async.gl_color_key); src_row_pitch = dst_pitch; -@@ -3882,6 +4930,16 @@ +@@ -3880,6 +4892,16 @@ wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); @@ -8230,7 +8160,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HeapFree(GetProcessHeap(), 0, mem); -@@ -3895,11 +4953,19 @@ +@@ -3893,11 +4915,19 @@ const RECT rect = {0, 0, surface->resource.width, surface->resource.height}; DWORD src_location; @@ -8250,7 +8180,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_location = WINED3D_LOCATION_TEXTURE_SRGB; else /* surface_blt_fbo will load the source location if necessary. */ src_location = WINED3D_LOCATION_TEXTURE_RGB; -@@ -3908,41 +4974,87 @@ +@@ -3906,41 +4936,87 @@ surface, src_location, &rect, surface, dst_location, &rect); } @@ -8347,7 +8277,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -3956,7 +5068,11 @@ +@@ -3954,7 +5030,11 @@ case WINED3D_LOCATION_DRAWABLE: if (FAILED(hr = surface_load_drawable(surface, context))) @@ -8359,7 +8289,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; case WINED3D_LOCATION_RB_RESOLVED: -@@ -3968,7 +5084,11 @@ +@@ -3966,7 +5046,11 @@ case WINED3D_LOCATION_TEXTURE_SRGB: if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) @@ -8371,7 +8301,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -3976,12 +5096,21 @@ +@@ -3974,12 +5058,21 @@ break; } @@ -8393,7 +8323,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; } -@@ -4090,6 +5219,7 @@ +@@ -4088,6 +5181,7 @@ const RECT *dst_rect, const struct wined3d_color *color) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8401,7 +8331,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; -@@ -4110,6 +5240,21 @@ +@@ -4108,6 +5202,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); @@ -8423,7 +8353,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4118,6 +5263,7 @@ +@@ -4116,6 +5225,7 @@ const RECT *dst_rect, float depth) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8431,7 +8361,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; -@@ -4133,6 +5279,20 @@ +@@ -4131,6 +5241,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); @@ -8452,7 +8382,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4169,8 +5329,13 @@ +@@ -4167,8 +5291,13 @@ wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); @@ -8466,7 +8396,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } const struct blit_shader ffp_blit = { -@@ -4326,6 +5491,7 @@ +@@ -4324,6 +5453,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) { @@ -8474,7 +8404,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c int bpp, srcheight, srcwidth, dstheight, dstwidth, width; const struct wined3d_format *src_format, *dst_format; unsigned int src_fmt_flags, dst_fmt_flags; -@@ -4360,6 +5526,28 @@ +@@ -4358,6 +5488,28 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -8503,7 +8433,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = dst_surface->resource.format; dst_format = src_format; dst_fmt_flags = dst_surface->container->resource.format_flags; -@@ -4371,12 +5559,14 @@ +@@ -4369,12 +5521,14 @@ dst_fmt_flags = dst_surface->container->resource.format_flags; if (src_surface) { @@ -8518,7 +8448,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))) -@@ -4387,9 +5577,13 @@ +@@ -4385,9 +5539,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -8532,7 +8462,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = src_surface->resource.format; src_fmt_flags = src_surface->container->resource.format_flags; } -@@ -4399,8 +5593,12 @@ +@@ -4397,8 +5555,12 @@ src_fmt_flags = dst_fmt_flags; } @@ -8545,7 +8475,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_surface->resource.format->byte_count; -@@ -4411,12 +5609,24 @@ +@@ -4409,12 +5571,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -8570,7 +8500,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4451,7 +5661,11 @@ +@@ -4449,7 +5623,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -8582,7 +8512,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format, flags, fx); goto release; } -@@ -4459,7 +5673,11 @@ +@@ -4457,7 +5635,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -8594,7 +8524,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c flags &= ~WINEDDBLT_COLORFILL; } -@@ -4509,6 +5727,7 @@ +@@ -4507,6 +5689,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -8602,7 +8532,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4522,6 +5741,21 @@ +@@ -4520,6 +5703,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -8624,7 +8554,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c memcpy(dbuf, sbuf, width); } } -@@ -4531,8 +5765,13 @@ +@@ -4529,8 +5727,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -8638,7 +8568,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4541,9 +5780,15 @@ +@@ -4539,9 +5742,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8654,7 +8584,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4553,6 +5798,7 @@ +@@ -4551,6 +5760,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8662,7 +8592,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)) -@@ -4560,6 +5806,15 @@ +@@ -4558,6 +5768,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -8678,7 +8608,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4606,6 +5861,7 @@ +@@ -4604,6 +5823,7 @@ } #undef STRETCH_ROW } @@ -8686,7 +8616,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dbuf += dst_row_pitch; last_sy = sy; } -@@ -4614,6 +5870,16 @@ +@@ -4612,6 +5832,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -8703,7 +8633,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)) -@@ -4663,7 +5929,11 @@ +@@ -4661,7 +5891,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -8715,7 +8645,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4740,6 +6010,7 @@ +@@ -4738,6 +5972,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -8723,7 +8653,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4761,6 +6032,29 @@ +@@ -4759,6 +5994,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -8753,7 +8683,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c switch (bpp) { -@@ -4779,7 +6073,11 @@ +@@ -4777,7 +6035,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8765,7 +8695,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4810,10 +6108,12 @@ +@@ -4808,10 +6070,12 @@ } } @@ -8778,7 +8708,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4821,6 +6121,7 @@ +@@ -4819,6 +6083,7 @@ } release: @@ -8786,7 +8716,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); -@@ -4839,6 +6140,14 @@ +@@ -4837,6 +6102,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -8801,7 +8731,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -4883,6 +6192,7 @@ +@@ -4881,6 +6154,7 @@ cpu_blit_blit_surface, }; @@ -8809,7 +8739,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) -@@ -4890,6 +6200,16 @@ +@@ -4888,6 +6162,16 @@ struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_device *device = dst_surface->resource.device; DWORD src_ds_flags, dst_ds_flags; @@ -8826,7 +8756,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -4901,6 +6221,106 @@ +@@ -4899,6 +6183,106 @@ | WINEDDBLT_DONOTWAIT | WINEDDBLT_ALPHATEST; @@ -8933,7 +8863,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -4943,8 +6363,13 @@ +@@ -4941,8 +6325,13 @@ } scale = src_surface @@ -8947,7 +8877,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; dst_ds_flags = dst_surface->container->resource.format_flags -@@ -4964,6 +6389,7 @@ +@@ -4962,6 +6351,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -8955,7 +8885,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))) -@@ -4974,6 +6400,24 @@ +@@ -4972,6 +6362,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; @@ -8980,7 +8910,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -4982,8 +6426,13 @@ +@@ -4980,8 +6388,13 @@ /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ @@ -8994,7 +8924,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5004,8 +6453,13 @@ +@@ -5002,8 +6415,13 @@ palette, fx->u5.dwFillColor, &color)) goto fallback; @@ -9008,7 +8938,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -5027,8 +6481,13 @@ +@@ -5025,8 +6443,13 @@ { blit_op = WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST; } @@ -9022,7 +8952,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { /* Upload */ if (scale) -@@ -5037,6 +6496,7 @@ +@@ -5035,6 +6458,7 @@ TRACE("Not doing upload because of format conversion.\n"); else { @@ -9030,7 +8960,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))) -@@ -5049,6 +6509,19 @@ +@@ -5047,6 +6471,19 @@ context_release(context); } return; @@ -9050,7 +8980,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -5072,6 +6545,7 @@ +@@ -5070,6 +6507,7 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -9058,7 +8988,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; } -@@ -5280,6 +6754,54 @@ +@@ -5278,6 +6716,54 @@ wined3d_surface_location_invalidated, wined3d_surface_load_location, }; @@ -9113,7 +9043,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) -@@ -5341,7 +6863,11 @@ +@@ -5339,7 +6825,11 @@ } surface->container = container; @@ -9125,7 +9055,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5373,9 +6899,14 @@ +@@ -5371,9 +6861,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -9140,7 +9070,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } return hr; -@@ -5402,7 +6933,11 @@ +@@ -5400,7 +6895,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr); @@ -9640,7 +9570,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c } } -@@ -1198,6 +1398,7 @@ +@@ -1225,6 +1425,7 @@ return WINED3D_OK; } @@ -9648,7 +9578,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c static void wined3d_buffer_location_invalidated(struct wined3d_resource *resource, DWORD location) { ERR("Not yet implemented.\n"); -@@ -1210,6 +1411,7 @@ +@@ -1237,6 +1438,7 @@ ERR("Not yet implemented.\n"); } @@ -9656,7 +9586,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c static const struct wined3d_resource_ops buffer_resource_ops = { buffer_resource_incref, -@@ -1217,8 +1419,10 @@ +@@ -1244,8 +1446,10 @@ buffer_unload, buffer_resource_sub_resource_map, buffer_resource_sub_resource_unmap, @@ -9667,7 +9597,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c }; static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, -@@ -1250,7 +1454,9 @@ +@@ -1277,7 +1481,9 @@ return hr; } buffer->buffer_type_hint = bind_hint; @@ -9677,7 +9607,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage, debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory, buffer); -@@ -1266,6 +1472,7 @@ +@@ -1293,6 +1499,7 @@ dynamic_buffer_ok = gl_info->supported[APPLE_FLUSH_BUFFER_RANGE] || gl_info->supported[ARB_MAP_BUFFER_RANGE]; @@ -9685,7 +9615,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c /* Observations show that draw_strided_slow is faster on dynamic VBs than converting + * drawStridedFast (half-life 2 and others). * -@@ -1273,6 +1480,15 @@ +@@ -1300,6 +1507,15 @@ * show that draw_strided_slow is faster than converting + uploading + drawStridedFast. * Therefore do not create a VBO for WINED3DUSAGE_DYNAMIC buffers. */ @@ -9701,7 +9631,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c if (!gl_info->supported[ARB_VERTEX_BUFFER_OBJECT]) { TRACE("Not creating a vbo because GL_ARB_vertex_buffer is not supported\n"); -@@ -1290,6 +1506,7 @@ +@@ -1317,6 +1533,7 @@ buffer->flags |= WINED3D_BUFFER_CREATEBO; } @@ -9709,32 +9639,22 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps)); if (!buffer->maps) { -@@ -1300,6 +1517,7 @@ - } - buffer->maps_size = 1; +@@ -1341,6 +1558,28 @@ -+#endif /* STAGING_CSMT */ - if (data) - { - BYTE *ptr; -@@ -1308,7 +1526,9 @@ - if (FAILED(hr)) - { - ERR("Failed to map buffer, hr %#x\n", hr); -+#if defined(STAGING_CSMT) - HeapFree(GetProcessHeap(), 0, buffer->maps); -+#endif /* STAGING_CSMT */ - buffer_unload(&buffer->resource); - resource_cleanup(&buffer->resource); - return hr; -@@ -1319,8 +1539,20 @@ - wined3d_buffer_unmap(buffer); - } - -+#if defined(STAGING_CSMT) if (wined3d_settings.cs_multithreaded) buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER; +#else /* STAGING_CSMT */ ++ if (data) ++ { ++ if (FAILED(hr = wined3d_buffer_upload_data(buffer, NULL, data->data))) ++ { ++ ERR("Failed to upload data, hr %#x.\n", hr); ++ buffer_unload(&buffer->resource); ++ resource_cleanup(&buffer->resource); ++ return hr; ++ } ++ } ++ + buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps)); + if (!buffer->maps) + { @@ -9748,7 +9668,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c return WINED3D_OK; } -@@ -1429,6 +1661,7 @@ +@@ -1449,6 +1688,7 @@ return WINED3D_OK; } @@ -9756,7 +9676,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) { -@@ -1436,3 +1669,4 @@ +@@ -1456,3 +1696,4 @@ buffer->resource.heap_memory = mem; buffer->flags |= WINED3D_BUFFER_DISCARD; } @@ -9764,7 +9684,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c -@@ -5555,9 +5555,15 @@ +@@ -5553,9 +5553,15 @@ DebugBreak(); } diff --git a/staging/changelog b/staging/changelog index ff160f0f..bdd8105b 100644 --- a/staging/changelog +++ b/staging/changelog @@ -2,6 +2,10 @@ wine-staging (1.9.1) UNRELEASED; urgency=low * Removed patch to implement SystemHandleInformation (accepted upstream). * Removed patch to align terminating null WCHAR in SysAllocStringByteLen (accepted upstream). + * Removed patch to properly implement GetLargestConsoleWindowSize (accepted + upstream). + * Removed patch to implement stub for GetLogicalProcessorInformationEx (semi- + stub accepted upstream). * Added patch to remove dead code from SCROLL_TrackScrollBar. * Added patch to do a device check before returning a default serial port name.