diff --git a/README.md b/README.md index 31b71d30..803a78e0 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Included bug fixes and improvements **Bugs fixed in Wine Staging 1.7.34-1 [135]:** -* ATL IOCS data should not be stored in GWLP_USERDATA ([Wine Bug #21767](https://bugs.winehq.org/show_bug.cgi?id=21767)) +* ~~ATL IOCS data should not be stored in GWLP_USERDATA~~ ([Wine Bug #21767](https://bugs.winehq.org/show_bug.cgi?id=21767)) * Add Dynamic DST exceptions for Israel Standard Time ([Wine Bug #36374](https://bugs.winehq.org/show_bug.cgi?id=36374)) * Add default ACLs for user shell folders * Add nvapi stubs required for GPU PhysX support @@ -65,7 +65,7 @@ Included bug fixes and improvements * Avoid race-conditions of async WSARecv() operations with write watches. * Basic support for CUDA * Black & White needs DXTn software decoding support ([Wine Bug #14939](https://bugs.winehq.org/show_bug.cgi?id=14939)) -* Correctly treat '.' when checking for empty directories ([Wine Bug #26272](https://bugs.winehq.org/show_bug.cgi?id=26272)) +* ~~Correctly treat '.' when checking for empty directories~~ ([Wine Bug #26272](https://bugs.winehq.org/show_bug.cgi?id=26272)) * CreateProcess does not prioritize the working directory over the system search path ([Wine Bug #23934](https://bugs.winehq.org/show_bug.cgi?id=23934)) * D3DCompileShader should filter specific warning messages ([Wine Bug #33770](https://bugs.winehq.org/show_bug.cgi?id=33770)) * Do not fail when a used context is passed to wglShareLists ([Wine Bug #11436](https://bugs.winehq.org/show_bug.cgi?id=11436)) @@ -112,7 +112,7 @@ Included bug fixes and improvements * Implement an Arial replacement font ([Wine Bug #32323](https://bugs.winehq.org/show_bug.cgi?id=32323)) * Implement exclusive mode in PulseAudio backend ([Wine Bug #37042](https://bugs.winehq.org/show_bug.cgi?id=37042)) * Improvement for heap allocation performance -* Initialize irp.Tail.Overlay.OriginalFileObject with stub file object ([Wine Bug #37537](https://bugs.winehq.org/show_bug.cgi?id=37537)) +* ~~Initialize irp.Tail.Overlay.OriginalFileObject with stub file object~~ ([Wine Bug #37537](https://bugs.winehq.org/show_bug.cgi?id=37537)) * Lego Stunt Rally requires DXTn software de/encoding support ([Wine Bug #25486](https://bugs.winehq.org/show_bug.cgi?id=25486)) * Limit cross thread access to ImmSet* functions ([Wine Bug #35361](https://bugs.winehq.org/show_bug.cgi?id=35361)) * Lockfree algorithm for filedescriptor cache (improves file access speed) diff --git a/debian/changelog b/debian/changelog index 28692f3b..739a29f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ wine-staging (1.7.35) UNRELEASED; urgency=low * Added patch to fix init of LONGLONG variable with a negative value in TGA decoder. * Removed patch to set last error on success in WSARecv (accepted upstream). * Removed patch to fix handling of subdirectory in FtpFindFirstFile (accepted upstream). + * Removed patch to initialize irp.Tail.Overlay.OriginalFileObject with stub file object (accepted upstream). + * Removed patch to fix incorrect behaviour of PathIsDirectoryEmptyW (accepted upstream). + * Removed patch to store IOCS data in a property instead of GWLP_USERDATA (accepted upstream). -- Sebastian Lackner Mon, 12 Jan 2015 13:06:22 +0100 wine-staging (1.7.34-1) unstable; urgency=low diff --git a/debian/tools/patchupdate.py b/debian/tools/patchupdate.py index 1f382fdf..c0414468 100755 --- a/debian/tools/patchupdate.py +++ b/debian/tools/patchupdate.py @@ -146,11 +146,12 @@ def _stable_compholio_version(): if distro.lower() != "unreleased": return version -def _latest_wine_commit(): +def _latest_wine_commit(commit=None): """Get latest wine commit.""" if not os.path.isdir(config.path_wine): raise PatchUpdaterError("Please create a symlink to the wine repository in %s" % config.path_wine) - commit = subprocess.check_output(["git", "rev-parse", "origin/master"], cwd=config.path_wine).strip() + if commit is None: + commit = subprocess.check_output(["git", "rev-parse", "origin/master"], cwd=config.path_wine).strip() assert len(commit) == 40 return commit @@ -650,7 +651,7 @@ if __name__ == "__main__": try: # Get information about Wine and Compholio version - latest_wine_commit = _latest_wine_commit() + latest_wine_commit = _latest_wine_commit(sys.argv[1] if len(sys.argv) >= 2 else None) stable_compholio_version = _stable_compholio_version() # Read current and stable patches diff --git a/patches/atl-IOCS_Property/0001-atl-Don-t-use-GWLP_USERDATA-to-store-IOCS-to-avoid-c.patch b/patches/atl-IOCS_Property/0001-atl-Don-t-use-GWLP_USERDATA-to-store-IOCS-to-avoid-c.patch deleted file mode 100644 index fe00c836..00000000 --- a/patches/atl-IOCS_Property/0001-atl-Don-t-use-GWLP_USERDATA-to-store-IOCS-to-avoid-c.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 4d79656ea8c30f14fcd4a8e6a901e7b50ea50eef Mon Sep 17 00:00:00 2001 -From: Qian Hong -Date: Thu, 17 Apr 2014 04:34:30 +0800 -Subject: atl: Don't use GWLP_USERDATA to store IOCS to avoid conflict with - Apps. - ---- - dlls/atl/atl_ax.c | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - -diff --git a/dlls/atl/atl_ax.c b/dlls/atl/atl_ax.c -index 5bafbf1..45936e8 100644 ---- a/dlls/atl/atl_ax.c -+++ b/dlls/atl/atl_ax.c -@@ -38,6 +38,8 @@ - - #include "wine/unicode.h" - -+#define WINE_IOCS_PROPERTY "WINE_IOCS" -+ - WINE_DEFAULT_DEBUG_CHANNEL(atl); - - typedef struct IOCS { -@@ -150,7 +152,7 @@ static HRESULT IOCS_Detach( IOCS *This ) /* remove subclassing */ - if ( This->hWnd ) - { - SetWindowLongPtrW( This->hWnd, GWLP_WNDPROC, (ULONG_PTR) This->OrigWndProc ); -- SetWindowLongPtrW( This->hWnd, GWLP_USERDATA, 0 ); -+ RemovePropA( This->hWnd, WINE_IOCS_PROPERTY ); - This->hWnd = NULL; - } - if ( This->control ) -@@ -906,7 +908,7 @@ static LRESULT IOCS_OnWndProc( IOCS *This, HWND hWnd, UINT uMsg, WPARAM wParam, - - static LRESULT CALLBACK AtlHost_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam ) - { -- IOCS *This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA ); -+ IOCS *This = (IOCS *)GetPropA( hWnd, WINE_IOCS_PROPERTY ); - return IOCS_OnWndProc( This, hWnd, wMsg, wParam, lParam ); - } - -@@ -915,7 +917,7 @@ static HRESULT IOCS_Attach( IOCS *This, HWND hWnd, IUnknown *pUnkControl ) /* su - This->hWnd = hWnd; - IUnknown_QueryInterface( pUnkControl, &IID_IOleObject, (void**)&This->control ); - IOleObject_SetClientSite( This->control, &This->IOleClientSite_iface ); -- SetWindowLongPtrW( hWnd, GWLP_USERDATA, (ULONG_PTR) This ); -+ SetPropA( hWnd, WINE_IOCS_PROPERTY, This ); - This->OrigWndProc = (WNDPROC)SetWindowLongPtrW( hWnd, GWLP_WNDPROC, (ULONG_PTR) AtlHost_wndproc ); - - return S_OK; -@@ -1329,7 +1331,7 @@ HRESULT WINAPI AtlAxGetHost(HWND hWnd, IUnknown **host) - - *host = NULL; - -- This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA ); -+ This = (IOCS *)GetPropA( hWnd, WINE_IOCS_PROPERTY ); - if ( !This ) - { - WARN("No container attached to %p\n", hWnd ); -@@ -1351,7 +1353,7 @@ HRESULT WINAPI AtlAxGetControl(HWND hWnd, IUnknown **pUnk) - - *pUnk = NULL; - -- This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA ); -+ This = (IOCS *)GetPropA ( hWnd, WINE_IOCS_PROPERTY ); - if ( !This || !This->control ) - { - WARN("No control attached to %p\n", hWnd ); --- -1.7.9.5 - diff --git a/patches/atl-IOCS_Property/definition b/patches/atl-IOCS_Property/definition deleted file mode 100644 index 5d741726..00000000 --- a/patches/atl-IOCS_Property/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [21767] ATL IOCS data should not be stored in GWLP_USERDATA diff --git a/patches/ntoskrnl-Stub_FileObject/0001-ntoskrnl-Initialize-irp.Tail.Overlay.OriginalFileObj.patch b/patches/ntoskrnl-Stub_FileObject/0001-ntoskrnl-Initialize-irp.Tail.Overlay.OriginalFileObj.patch deleted file mode 100644 index 45a35e03..00000000 --- a/patches/ntoskrnl-Stub_FileObject/0001-ntoskrnl-Initialize-irp.Tail.Overlay.OriginalFileObj.patch +++ /dev/null @@ -1,51 +0,0 @@ -From b8a93a6c879b8bd2d49cb43755cf8180d5372525 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Mon, 10 Nov 2014 23:48:14 +0100 -Subject: ntoskrnl: Initialize irp.Tail.Overlay.OriginalFileObject with stub - file object. - ---- - dlls/ntoskrnl.exe/ntoskrnl.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c -index 1d87110..aee68b3 100644 ---- a/dlls/ntoskrnl.exe/ntoskrnl.c -+++ b/dlls/ntoskrnl.exe/ntoskrnl.c -@@ -142,6 +142,7 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff, - IRP irp; - MDL mdl; - IO_STACK_LOCATION irpsp; -+ FILE_OBJECT file; - PDRIVER_DISPATCH dispatch = device->DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL]; - NTSTATUS status; - LARGE_INTEGER count; -@@ -152,6 +153,7 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff, - memset( &irp, 0x55, sizeof(irp) ); - memset( &irpsp, 0x66, sizeof(irpsp) ); - memset( &mdl, 0x77, sizeof(mdl) ); -+ memset( &file, 0x88, sizeof(file) ); - - irp.RequestorMode = UserMode; - if ((code & 3) == METHOD_BUFFERED) -@@ -166,6 +168,7 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff, - irp.UserBuffer = out_buff; - irp.MdlAddress = &mdl; - irp.Tail.Overlay.s.u2.CurrentStackLocation = &irpsp; -+ irp.Tail.Overlay.OriginalFileObject = &file; - irp.UserIosb = NULL; - - irpsp.MajorFunction = IRP_MJ_DEVICE_CONTROL; -@@ -182,6 +185,9 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff, - mdl.ByteCount = *out_size; - mdl.ByteOffset = 0; - -+ file.FsContext = NULL; -+ file.FsContext2 = NULL; -+ - device->CurrentIrp = &irp; - - KeQueryTickCount( &count ); /* update the global KeTickCount */ --- -2.1.3 - diff --git a/patches/ntoskrnl-Stub_FileObject/definition b/patches/ntoskrnl-Stub_FileObject/definition deleted file mode 100644 index a7909e93..00000000 --- a/patches/ntoskrnl-Stub_FileObject/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [37537] Initialize irp.Tail.Overlay.OriginalFileObject with stub file object diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 5524d2df..9508f1f0 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -60,7 +60,6 @@ patch_enable_all () enable_Miscellaneous="$1" enable_Pipelight="$1" enable_Staging="$1" - enable_atl_IOCS_Property="$1" enable_comctl32_LoadIconMetric="$1" enable_configure_Absolute_RPATH="$1" enable_d3d9_Surface_Refcount="$1" @@ -128,7 +127,6 @@ patch_enable_all () enable_ntdll_WinSqm="$1" enable_ntoskrnl_Emulator="$1" enable_ntoskrnl_Irp_Status="$1" - enable_ntoskrnl_Stub_FileObject="$1" enable_nvapi_Stub_DLL="$1" enable_nvcuda_CUDA_Support="$1" enable_nvcuvid_CUDA_Video_Support="$1" @@ -153,7 +151,6 @@ patch_enable_all () enable_shell32_RunDLL_CallEntry16="$1" enable_shell32_SHCreateSessionKey="$1" enable_shell32_SHFileOperation="$1" - enable_shlwapi_PathIsDirectoryEmptyW="$1" enable_shlwapi_UrlCombine="$1" enable_slc_SLGetWindowsInformation="$1" enable_urlmon_CoInternetSetFeatureEnabled="$1" @@ -208,9 +205,6 @@ patch_enable () Staging) enable_Staging="$2" ;; - atl-IOCS_Property) - enable_atl_IOCS_Property="$2" - ;; comctl32-LoadIconMetric) enable_comctl32_LoadIconMetric="$2" ;; @@ -412,9 +406,6 @@ patch_enable () ntoskrnl-Irp_Status) enable_ntoskrnl_Irp_Status="$2" ;; - ntoskrnl-Stub_FileObject) - enable_ntoskrnl_Stub_FileObject="$2" - ;; nvapi-Stub_DLL) enable_nvapi_Stub_DLL="$2" ;; @@ -487,9 +478,6 @@ patch_enable () shell32-SHFileOperation) enable_shell32_SHFileOperation="$2" ;; - shlwapi-PathIsDirectoryEmptyW) - enable_shlwapi_PathIsDirectoryEmptyW="$2" - ;; shlwapi-UrlCombine) enable_shlwapi_UrlCombine="$2" ;; @@ -1033,21 +1021,6 @@ if test "$enable_Staging" -eq 1; then ) >> "$patchlist" fi -# Patchset atl-IOCS_Property -# | -# | This patchset fixes the following Wine bugs: -# | * [#21767] ATL IOCS data should not be stored in GWLP_USERDATA -# | -# | Modified files: -# | * dlls/atl/atl_ax.c -# | -if test "$enable_atl_IOCS_Property" -eq 1; then - patch_apply atl-IOCS_Property/0001-atl-Don-t-use-GWLP_USERDATA-to-store-IOCS-to-avoid-c.patch - ( - echo '+ { "Qian Hong", "atl: Don'\''t use GWLP_USERDATA to store IOCS to avoid conflict with Apps.", 1 },'; - ) >> "$patchlist" -fi - # Patchset comctl32-LoadIconMetric # | # | This patchset fixes the following Wine bugs: @@ -2172,21 +2145,6 @@ if test "$enable_ntoskrnl_Irp_Status" -eq 1; then ) >> "$patchlist" fi -# Patchset ntoskrnl-Stub_FileObject -# | -# | This patchset fixes the following Wine bugs: -# | * [#37537] Initialize irp.Tail.Overlay.OriginalFileObject with stub file object -# | -# | Modified files: -# | * dlls/ntoskrnl.exe/ntoskrnl.c -# | -if test "$enable_ntoskrnl_Stub_FileObject" -eq 1; then - patch_apply ntoskrnl-Stub_FileObject/0001-ntoskrnl-Initialize-irp.Tail.Overlay.OriginalFileObj.patch - ( - echo '+ { "Sebastian Lackner", "ntoskrnl: Initialize irp.Tail.Overlay.OriginalFileObject with stub file object.", 1 },'; - ) >> "$patchlist" -fi - # Patchset nvcuda-CUDA_Support # | # | Modified files: @@ -2623,21 +2581,6 @@ if test "$enable_shell32_SHFileOperation" -eq 1; then ) >> "$patchlist" fi -# Patchset shlwapi-PathIsDirectoryEmptyW -# | -# | This patchset fixes the following Wine bugs: -# | * [#26272] Correctly treat '.' when checking for empty directories -# | -# | Modified files: -# | * dlls/shlwapi/path.c -# | -if test "$enable_shlwapi_PathIsDirectoryEmptyW" -eq 1; then - patch_apply shlwapi-PathIsDirectoryEmptyW/0001-shlwapi-Correctly-treat-.-when-enumerating-files-in-.patch - ( - echo '+ { "Michael Müller", "shlwapi: Correctly treat '\''.'\'' when enumerating files in PathIsDirectoryEmptyW.", 1 },'; - ) >> "$patchlist" -fi - # Patchset shlwapi-UrlCombine # | # | Modified files: @@ -2853,6 +2796,21 @@ if test "$enable_winebuild_LinkerVersion" -eq 1; then ) >> "$patchlist" fi +# Patchset wined3d-Color_Key +# | +# | This patchset fixes the following Wine bugs: +# | * [#37748] Fix color key regression causing pink rectangles around text +# | +# | Modified files: +# | * dlls/wined3d/surface.c +# | +if test "$enable_wined3d_Color_Key" -eq 1; then + patch_apply wined3d-Color_Key/0001-wined3d-Use-proper-color-key-type-define-when-callin.patch + ( + echo '+ { "Christian Costa", "wined3d: Use proper color key type define when calling wined3d_texture_set_color_key.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-CSMT_Helper # | # | Modified files: @@ -2869,21 +2827,6 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then ) >> "$patchlist" fi -# Patchset wined3d-Color_Key -# | -# | This patchset fixes the following Wine bugs: -# | * [#37748] Fix color key regression causing pink rectangles around text -# | -# | Modified files: -# | * dlls/wined3d/surface.c -# | -if test "$enable_wined3d_Color_Key" -eq 1; then - patch_apply wined3d-Color_Key/0001-wined3d-Use-proper-color-key-type-define-when-callin.patch - ( - echo '+ { "Christian Costa", "wined3d: Use proper color key type define when calling wined3d_texture_set_color_key.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-CSMT_Main # | # | This patchset fixes the following Wine bugs: diff --git a/patches/shlwapi-PathIsDirectoryEmptyW/0001-shlwapi-Correctly-treat-.-when-enumerating-files-in-.patch b/patches/shlwapi-PathIsDirectoryEmptyW/0001-shlwapi-Correctly-treat-.-when-enumerating-files-in-.patch deleted file mode 100644 index 28a30a50..00000000 --- a/patches/shlwapi-PathIsDirectoryEmptyW/0001-shlwapi-Correctly-treat-.-when-enumerating-files-in-.patch +++ /dev/null @@ -1,62 +0,0 @@ -From b145c61782e6bfc45d44f4b8877ec53823796751 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sun, 28 Sep 2014 17:30:45 +0200 -Subject: shlwapi: Correctly treat '.' when enumerating files in - PathIsDirectoryEmptyW. - ---- - dlls/shlwapi/path.c | 23 ++++++++++++++++------- - 1 file changed, 16 insertions(+), 7 deletions(-) - -diff --git a/dlls/shlwapi/path.c b/dlls/shlwapi/path.c -index 5c7a88a..051ce0f 100644 ---- a/dlls/shlwapi/path.c -+++ b/dlls/shlwapi/path.c -@@ -3870,13 +3870,13 @@ BOOL WINAPI PathIsDirectoryEmptyW(LPCWSTR lpszPath) - WCHAR szSearch[MAX_PATH]; - DWORD dwLen; - HANDLE hfind; -- BOOL retVal = FALSE; -+ BOOL retVal = TRUE; - WIN32_FIND_DATAW find_data; - - TRACE("(%s)\n",debugstr_w(lpszPath)); - - if (!lpszPath || !PathIsDirectoryW(lpszPath)) -- return FALSE; -+ return FALSE; - - lstrcpynW(szSearch, lpszPath, MAX_PATH); - PathAddBackslashW(szSearch); -@@ -3886,14 +3886,23 @@ BOOL WINAPI PathIsDirectoryEmptyW(LPCWSTR lpszPath) - - strcpyW(szSearch + dwLen, szAllFiles); - hfind = FindFirstFileW(szSearch, &find_data); -- if (hfind != INVALID_HANDLE_VALUE) -+ if (hfind == INVALID_HANDLE_VALUE) -+ return FALSE; -+ -+ do - { -- if (find_data.cFileName[0] == '.' && find_data.cFileName[1] == '.') -- /* The only directory entry should be the parent */ -- retVal = !FindNextFileW(hfind, &find_data); -- FindClose(hfind); -+ if (find_data.cFileName[0] == '.') -+ { -+ if (find_data.cFileName[1] == '\0') continue; -+ if (find_data.cFileName[1] == '.' && find_data.cFileName[2] == '\0') continue; -+ } -+ -+ retVal = FALSE; -+ break; - } -+ while (FindNextFileW(hfind, &find_data)); - -+ FindClose(hfind); - return retVal; - } - --- -1.9.1 - diff --git a/patches/shlwapi-PathIsDirectoryEmptyW/definition b/patches/shlwapi-PathIsDirectoryEmptyW/definition deleted file mode 100644 index 94ac3db4..00000000 --- a/patches/shlwapi-PathIsDirectoryEmptyW/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [26272] Correctly treat '.' when checking for empty directories diff --git a/patches/wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch b/patches/wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch index 195fefcc..fc249921 100644 --- a/patches/wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch +++ b/patches/wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch @@ -1,4 +1,4 @@ -From e29e2b0ccda7ed5e930eb18b3c73204150a68123 Mon Sep 17 00:00:00 2001 +From fb2ae897035c342f2d78590928eaa62f8bb2b47e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 17 Nov 2013 19:16:40 +0100 Subject: wined3d: Pass a context to read_from_framebuffer. @@ -12,10 +12,10 @@ load_location / preload callers. This is related to bug 34574. 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 3877139..ef6a233 100644 +index 534a152..534d4bd 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -2781,11 +2781,13 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) +@@ -2935,11 +2935,13 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) return WINED3D_OK; } @@ -30,7 +30,7 @@ index 3877139..ef6a233 100644 BYTE *mem; BYTE *row, *top, *bottom; int i; -@@ -2794,7 +2796,21 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2948,7 +2950,21 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc surface_get_memory(surface, &data, dst_location); @@ -53,8 +53,8 @@ index 3877139..ef6a233 100644 context_apply_blit_state(context, device); gl_info = context->gl_info; -@@ -2882,7 +2898,12 @@ error: - checkGLcall("glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0)"); +@@ -3036,7 +3052,12 @@ error: + checkGLcall("glBindBuffer"); } - context_release(context); @@ -67,7 +67,7 @@ index 3877139..ef6a233 100644 } /* Read the framebuffer contents into a texture. Note that this function -@@ -4037,7 +4058,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, +@@ -4191,7 +4212,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, if (surface->locations & WINED3D_LOCATION_DRAWABLE) { @@ -77,5 +77,5 @@ index 3877139..ef6a233 100644 } -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch b/patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch index 7d608666..ac387861 100644 --- a/patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch +++ b/patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch @@ -1,4 +1,4 @@ -From 7b874f424fc87ef49a94bc78d7080616ac9681a4 Mon Sep 17 00:00:00 2001 +From 75d61e9b6e6f30be95ef495a5c2dd6e88955c575 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,7 +15,7 @@ Subject: wined3d: Remove surface_invalidate_location. 8 files changed, 31 insertions(+), 43 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index 08f92cb..f612099 100644 +index 93ecb99..f7bea42 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -7687,7 +7687,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter, @@ -28,7 +28,7 @@ index 08f92cb..f612099 100644 return WINED3D_OK; } diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 1f34992..61c074f 100644 +index d214037..3c17b03 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -3085,7 +3085,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d @@ -41,7 +41,7 @@ index 1f34992..61c074f 100644 } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index bde37b1..a6620f5 100644 +index a26f1b0..2ef0efc 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -393,7 +393,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c @@ -67,7 +67,7 @@ index 7034b25..eef7e2c 100644 } } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 6f48834..8789d44 100644 +index 9f74a39..d3bbb54 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -599,7 +599,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) @@ -80,7 +80,7 @@ index 6f48834..8789d44 100644 static void surface_release_client_storage(struct wined3d_surface *surface) @@ -1185,7 +1185,7 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win - checkGLcall("glDeleteBuffersARB(1, &surface->pbo)"); + checkGLcall("glDeleteBuffers(1, &surface->pbo)"); surface->pbo = 0; - surface_invalidate_location(surface, WINED3D_LOCATION_BUFFER); @@ -136,7 +136,7 @@ index 6f48834..8789d44 100644 /* Switching color keying on / off may change the internal format. */ if (ck_changed) wined3d_texture_force_reload(surface->container); -@@ -2813,7 +2816,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2822,7 +2825,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, } if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) @@ -145,7 +145,7 @@ index 6f48834..8789d44 100644 switch (surface->resource.map_binding) { -@@ -2929,7 +2932,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2938,7 +2941,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) } surface_load_location(surface, context, WINED3D_LOCATION_DIB); @@ -154,7 +154,7 @@ index 6f48834..8789d44 100644 if (context) context_release(context); -@@ -2978,7 +2981,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) +@@ -2987,7 +2990,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); @@ -163,7 +163,7 @@ index 6f48834..8789d44 100644 if (context) context_release(context); } -@@ -3352,7 +3355,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc +@@ -3361,7 +3364,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); @@ -172,7 +172,7 @@ index 6f48834..8789d44 100644 } /* Uses the hardware to stretch and flip the image */ -@@ -3420,7 +3423,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3429,7 +3432,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 */ @@ -181,7 +181,7 @@ index 6f48834..8789d44 100644 } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3626,7 +3629,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3635,7 +3638,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); @@ -190,7 +190,7 @@ index 6f48834..8789d44 100644 } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3939,7 +3942,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE +@@ -3948,7 +3951,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE (old_color_key_flags & WINEDDSD_CKSRCBLT) ? &old_blt_key : NULL); wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); @@ -199,7 +199,7 @@ index 6f48834..8789d44 100644 return WINED3D_OK; } -@@ -4183,18 +4186,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4192,18 +4195,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } @@ -218,7 +218,7 @@ index 6f48834..8789d44 100644 static DWORD resource_access_from_location(DWORD location) { switch (location) -@@ -5674,7 +5665,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5683,7 +5674,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); @@ -227,7 +227,7 @@ index 6f48834..8789d44 100644 return WINED3D_OK; } -@@ -5803,7 +5794,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text +@@ -5812,7 +5803,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); @@ -237,10 +237,10 @@ index 6f48834..8789d44 100644 return hr; diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 3b0c6b3..290a6cd 100644 +index bdb4b67..e64715e 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c -@@ -517,7 +517,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT +@@ -512,7 +512,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); @@ -249,7 +249,7 @@ index 3b0c6b3..290a6cd 100644 swapchain->render_to_fbo = TRUE; swapchain_update_draw_bindings(swapchain); } -@@ -579,15 +579,15 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT +@@ -574,15 +574,15 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT else { wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); @@ -268,7 +268,7 @@ index 3b0c6b3..290a6cd 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. If it is FLIP however, -@@ -596,7 +596,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT +@@ -591,7 +591,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) { wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding); @@ -277,7 +277,7 @@ index 3b0c6b3..290a6cd 100644 } } -@@ -871,7 +871,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 +@@ -866,7 +866,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); @@ -287,7 +287,7 @@ index 3b0c6b3..290a6cd 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 9d89774..24c6cb9 100644 +index f2bba1a..6d82ce6 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -855,7 +855,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub @@ -311,10 +311,10 @@ index 9d89774..24c6cb9 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 2790115..002afea 100644 +index acee894..878a98c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2366,7 +2366,6 @@ HRESULT surface_color_fill(struct wined3d_surface *s, +@@ -2365,7 +2365,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; @@ -323,5 +323,5 @@ index 2790115..002afea 100644 void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; -- -1.9.1 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch b/patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch index 58a4781b..308dfe4b 100644 --- a/patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch +++ b/patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch @@ -1,4 +1,4 @@ -From 2ccc91e1322be4c1cffed1dd28c04e42466955f2 Mon Sep 17 00:00:00 2001 +From 680c99d5fb4ab94a37f934c66bf9c22a326b0dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 3 Oct 2013 12:47:01 +0200 Subject: wined3d: Move load_location into the resource. @@ -16,7 +16,7 @@ and downloading from textures will be delegated to surfaces / volumes. 6 files changed, 91 insertions(+), 36 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index d9bc820..2e44f0f 100644 +index 5931232..2386410 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1128,12 +1128,20 @@ static void wined3d_buffer_location_invalidated(struct wined3d_resource *resourc @@ -99,7 +99,7 @@ index a63eab8..7f283f5 100644 + resource->resource_ops->resource_load_location(resource, context, location); +} diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 738941e..73e74a6 100644 +index b9d8968..5f6a0c2 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1281,12 +1281,20 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour @@ -167,7 +167,7 @@ index 6d82ce6..fc0f6d6 100644 static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 2cc0baf..3c51bdf 100644 +index 6b685bd..e2c9d4a 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -137,27 +137,6 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) @@ -249,7 +249,7 @@ index 2cc0baf..3c51bdf 100644 - wined3d_volume_load_location(volume, context, WINED3D_LOCATION_BUFFER); + wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_BUFFER); - GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo)); + GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo)); @@ -585,7 +560,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM)) diff --git a/patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch b/patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch index 8979f741..a6319a48 100644 --- a/patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch +++ b/patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch @@ -1,4 +1,4 @@ -From 6502ec68de4a38d59a2e6690eca2546e710b6cbc Mon Sep 17 00:00:00 2001 +From d93611cca0ee39d60a221d4c2422ba183a2a88ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 18 Sep 2013 22:30:57 +0200 Subject: wined3d: Introduce helper functions for mapping volumes. @@ -8,10 +8,10 @@ Subject: wined3d: Introduce helper functions for mapping volumes. 1 file changed, 96 insertions(+), 61 deletions(-) diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index c93a1ef..ee64070 100644 +index e2c9d4a..ad37cce 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -475,12 +475,67 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol +@@ -476,12 +476,67 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol return TRUE; } @@ -43,22 +43,22 @@ index c93a1ef..ee64070 100644 + { + case WINED3D_LOCATION_BUFFER: + gl_info = context->gl_info; -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo)); + + if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) + { + GLbitfield mapflags = wined3d_resource_gl_map_flags(flags); + mapflags &= ~GL_MAP_FLUSH_EXPLICIT_BIT; -+ ptr = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER_ARB, ++ ptr = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, + 0, volume->resource.size, mapflags)); + } + else + { + GLenum access = wined3d_resource_gl_legacy_map_flags(flags); -+ ptr = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, access)); ++ ptr = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); + } + -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("Map PBO"); + return ptr; + @@ -80,7 +80,7 @@ index c93a1ef..ee64070 100644 BYTE *base_memory; const struct wined3d_format *format = volume->resource.format; -@@ -512,58 +567,22 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -513,58 +568,22 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags); @@ -97,22 +97,22 @@ index c93a1ef..ee64070 100644 - else - wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_BUFFER); - -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo)); - - if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) - { - GLbitfield mapflags = wined3d_resource_gl_map_flags(flags); - mapflags &= ~GL_MAP_FLUSH_EXPLICIT_BIT; -- base_memory = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER_ARB, +- base_memory = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, - 0, volume->resource.size, mapflags)); - } - else - { - GLenum access = wined3d_resource_gl_legacy_map_flags(flags); -- base_memory = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, access)); +- base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); - } - -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); - checkGLcall("Map PBO"); - + WARN("Out of memory.\n"); @@ -150,7 +150,7 @@ index c93a1ef..ee64070 100644 TRACE("Base memory pointer %p.\n", base_memory); -@@ -621,8 +640,34 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour +@@ -622,8 +641,34 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour return volume_from_resource(resource); } @@ -163,9 +163,9 @@ index c93a1ef..ee64070 100644 + { + case WINED3D_LOCATION_BUFFER: + gl_info = context->gl_info; -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo)); -+ GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo)); ++ GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("Unmap PBO"); + return; + @@ -185,7 +185,7 @@ index c93a1ef..ee64070 100644 TRACE("volume %p.\n", volume); if (!volume->resource.map_count) -@@ -631,19 +676,9 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) +@@ -632,19 +677,9 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) return WINED3DERR_INVALIDCALL; } @@ -195,9 +195,9 @@ index c93a1ef..ee64070 100644 - struct wined3d_context *context = context_acquire(device, NULL); - const struct wined3d_gl_info *gl_info = context->gl_info; - -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo)); -- GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)); -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo)); +- GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); - checkGLcall("Unmap PBO"); - - context_release(context); @@ -209,5 +209,5 @@ index c93a1ef..ee64070 100644 volume->resource.map_count--; -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch b/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch index b27565f8..e9db2af1 100644 --- a/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch +++ b/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch @@ -1,4 +1,4 @@ -From f6dd61b4db19ba22e8e8f7d9d6bcf92e4419dc0f Mon Sep 17 00:00:00 2001 +From ba5c51ffdfff3be025ace2dd52218bd845c9d851 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,7 +10,7 @@ Subject: wined3d: Move volume PBO infrastructure into the resource. 3 files changed, 82 insertions(+), 79 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 7f283f5..c1ec97b 100644 +index 7f283f5..c907424 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -292,7 +292,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) @@ -37,22 +37,22 @@ index 7f283f5..c1ec97b 100644 + { + case WINED3D_LOCATION_BUFFER: + gl_info = context->gl_info; -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->buffer_object)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer_object)); + + if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) + { + GLbitfield mapflags = wined3d_resource_gl_map_flags(flags); + mapflags &= ~GL_MAP_FLUSH_EXPLICIT_BIT; -+ ptr = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER_ARB, ++ ptr = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, + 0, resource->size, mapflags)); + } + else + { + GLenum access = wined3d_resource_gl_legacy_map_flags(flags); -+ ptr = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, access)); ++ ptr = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); + } + -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("Map GL buffer"); + return ptr; + @@ -74,9 +74,9 @@ index 7f283f5..c1ec97b 100644 + { + case WINED3D_LOCATION_BUFFER: + gl_info = context->gl_info; -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->buffer_object)); -+ GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer_object)); ++ GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("Unmap GL buffer"); + return; + @@ -89,7 +89,7 @@ index 7f283f5..c1ec97b 100644 + } +} diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 2e92dd7..c538e08 100644 +index ad37cce..db3a68c 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -216,7 +216,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, @@ -127,12 +127,12 @@ index 2e92dd7..c538e08 100644 + if (volume->resource.buffer_object) return; -- GL_EXTCALL(glGenBuffersARB(1, &volume->pbo)); -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo)); -+ GL_EXTCALL(glGenBuffersARB(1, &volume->resource.buffer_object)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->resource.buffer_object)); - GL_EXTCALL(glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->resource.size, NULL, GL_STREAM_DRAW_ARB)); - GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); +- GL_EXTCALL(glGenBuffers(1, &volume->pbo)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo)); ++ GL_EXTCALL(glGenBuffers(1, &volume->resource.buffer_object)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->resource.buffer_object)); + GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, volume->resource.size, NULL, GL_STREAM_DRAW)); + GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); checkGLcall("Create PBO"); - TRACE("Created PBO %u for volume %p.\n", volume->pbo, volume); @@ -145,10 +145,10 @@ index 2e92dd7..c538e08 100644 const struct wined3d_gl_info *gl_info = context->gl_info; - TRACE("Deleting PBO %u belonging to volume %p.\n", volume->pbo, volume); -- GL_EXTCALL(glDeleteBuffersARB(1, &volume->pbo)); +- GL_EXTCALL(glDeleteBuffers(1, &volume->pbo)); + TRACE("Deleting PBO %u belonging to volume %p.\n", volume->resource.buffer_object, volume); -+ GL_EXTCALL(glDeleteBuffersARB(1, &volume->resource.buffer_object)); - checkGLcall("glDeleteBuffersARB"); ++ GL_EXTCALL(glDeleteBuffers(1, &volume->resource.buffer_object)); + checkGLcall("glDeleteBuffers"); - volume->pbo = 0; + volume->resource.buffer_object = 0; context_release(context); @@ -186,22 +186,22 @@ index 2e92dd7..c538e08 100644 - { - case WINED3D_LOCATION_BUFFER: - gl_info = context->gl_info; -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo)); - - if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) - { - GLbitfield mapflags = wined3d_resource_gl_map_flags(flags); - mapflags &= ~GL_MAP_FLUSH_EXPLICIT_BIT; -- ptr = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER_ARB, +- ptr = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, - 0, volume->resource.size, mapflags)); - } - else - { - GLenum access = wined3d_resource_gl_legacy_map_flags(flags); -- ptr = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, access)); +- ptr = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); - } - -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); - checkGLcall("Map PBO"); - return ptr; - @@ -239,9 +239,9 @@ index 2e92dd7..c538e08 100644 - { - case WINED3D_LOCATION_BUFFER: - gl_info = context->gl_info; -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo)); -- GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)); -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo)); +- GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); - checkGLcall("Unmap PBO"); - return; - diff --git a/patches/wined3d-CSMT_Main/0021-wined3d-Remove-surface-pbo.patch b/patches/wined3d-CSMT_Main/0021-wined3d-Remove-surface-pbo.patch index 4ff42906..30c6ce83 100644 --- a/patches/wined3d-CSMT_Main/0021-wined3d-Remove-surface-pbo.patch +++ b/patches/wined3d-CSMT_Main/0021-wined3d-Remove-surface-pbo.patch @@ -1,4 +1,4 @@ -From f6bb878818089d9f8f735ce5e2e4495f40ce7ec8 Mon Sep 17 00:00:00 2001 +From b8a17a0ce26bee0843d1bab91a435575751b7063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 13:25:48 +0100 Subject: wined3d: Remove surface->pbo. @@ -9,7 +9,7 @@ Subject: wined3d: Remove surface->pbo. 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 6154315..4a2b636 100644 +index 1496beb..e534a9f 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -46,7 +46,7 @@ static void surface_cleanup(struct wined3d_surface *surface) @@ -29,9 +29,9 @@ index 6154315..4a2b636 100644 + if (surface->resource.buffer_object) { - TRACE("Deleting PBO %u.\n", surface->pbo); -- GL_EXTCALL(glDeleteBuffersARB(1, &surface->pbo)); +- GL_EXTCALL(glDeleteBuffers(1, &surface->pbo)); + TRACE("Deleting PBO %u.\n", surface->resource.buffer_object); -+ GL_EXTCALL(glDeleteBuffersARB(1, &surface->resource.buffer_object)); ++ GL_EXTCALL(glDeleteBuffers(1, &surface->resource.buffer_object)); } if (surface->rb_multisample) @@ -55,8 +55,8 @@ index 6154315..4a2b636 100644 context = context_acquire(surface->resource.device, NULL); gl_info = context->gl_info; -- GL_EXTCALL(glGenBuffersARB(1, &surface->pbo)); -+ GL_EXTCALL(glGenBuffersARB(1, &surface->resource.buffer_object)); +- GL_EXTCALL(glGenBuffers(1, &surface->pbo)); ++ GL_EXTCALL(glGenBuffers(1, &surface->resource.buffer_object)); error = gl_info->gl_ops.gl.p_glGetError(); - if (!surface->pbo || error != GL_NO_ERROR) + if (!surface->resource.buffer_object || error != GL_NO_ERROR) @@ -65,28 +65,28 @@ index 6154315..4a2b636 100644 - TRACE("Binding PBO %u.\n", surface->pbo); + TRACE("Binding PBO %u.\n", surface->resource.buffer_object); -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->pbo)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->resource.buffer_object)); - checkGLcall("glBindBufferARB"); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->pbo)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->resource.buffer_object)); + checkGLcall("glBindBuffer"); - GL_EXTCALL(glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->resource.size + 4, + GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, surface->resource.size + 4, @@ -735,7 +735,7 @@ static void surface_unmap(struct wined3d_surface *surface) context = context_acquire(device, NULL); gl_info = context->gl_info; -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->pbo)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->resource.buffer_object)); - GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)); - GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); - checkGLcall("glUnmapBufferARB"); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->pbo)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->resource.buffer_object)); + GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); + GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("glUnmapBuffer"); @@ -1181,10 +1181,10 @@ HRESULT CDECL wined3d_surface_get_render_target_data(struct wined3d_surface *sur /* Context activation is done by the caller. */ static void surface_remove_pbo(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info) { -- GL_EXTCALL(glDeleteBuffersARB(1, &surface->pbo)); -- checkGLcall("glDeleteBuffersARB(1, &surface->pbo)"); -+ GL_EXTCALL(glDeleteBuffersARB(1, &surface->resource.buffer_object)); -+ checkGLcall("glDeleteBuffersARB(1, &surface->resource.buffer_object)"); +- GL_EXTCALL(glDeleteBuffers(1, &surface->pbo)); +- checkGLcall("glDeleteBuffers(1, &surface->pbo)"); ++ GL_EXTCALL(glDeleteBuffers(1, &surface->resource.buffer_object)); ++ checkGLcall("glDeleteBuffers(1, &surface->resource.buffer_object)"); - surface->pbo = 0; + surface->resource.buffer_object = 0; @@ -102,16 +102,16 @@ index 6154315..4a2b636 100644 surface_remove_pbo(surface, gl_info); /* Destroy fbo render buffers. This is needed for implicit render targets, for -@@ -2683,7 +2683,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2837,7 +2837,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, context = context_acquire(device, NULL); gl_info = context->gl_info; -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->pbo)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->resource.buffer_object)); - base_memory = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_READ_WRITE_ARB)); - GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->pbo)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->resource.buffer_object)); + base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_READ_WRITE)); + GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); checkGLcall("map PBO"); -@@ -2774,7 +2774,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2928,7 +2928,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) } if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM @@ -120,7 +120,7 @@ index 6154315..4a2b636 100644 surface->resource.map_binding = WINED3D_LOCATION_DIB; } -@@ -3055,9 +3055,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) +@@ -3209,9 +3209,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) /* Flip the PBO */ { @@ -133,7 +133,7 @@ index 6154315..4a2b636 100644 } /* Flip the opengl texture */ -@@ -4234,7 +4234,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4388,7 +4388,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ @@ -143,10 +143,10 @@ index 6154315..4a2b636 100644 TRACE("Removing the pbo attached to surface %p.\n", surface); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 9285ab8..8dbee1a 100644 +index 8cce2d9..7efecd4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2310,8 +2310,6 @@ struct wined3d_surface +@@ -2324,8 +2324,6 @@ struct wined3d_surface UINT pow2Width; UINT pow2Height; @@ -156,5 +156,5 @@ index 9285ab8..8dbee1a 100644 GLuint rb_resolved; GLenum texture_target; -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch b/patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch index 2b9112eb..983a37d5 100644 --- a/patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch +++ b/patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch @@ -1,4 +1,4 @@ -From f3a0af1c19472f9af90881b17ffe0352285b5d64 Mon Sep 17 00:00:00 2001 +From 7e3863693c9694e35f3ae8e72011939fffe63690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 13:30:59 +0100 Subject: wined3d: Use resource buffer mapping facilities in surfaces. @@ -9,10 +9,10 @@ Subject: wined3d: Use resource buffer mapping facilities in surfaces. 2 files changed, 23 insertions(+), 63 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index d904c36..c0e4d70 100644 +index c907424..358a29e 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -430,6 +430,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, +@@ -461,6 +461,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, case WINED3D_LOCATION_SYSMEM: return resource->heap_memory; @@ -25,7 +25,7 @@ index d904c36..c0e4d70 100644 default: ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); return NULL; -@@ -452,6 +458,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -483,6 +489,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, return; case WINED3D_LOCATION_SYSMEM: @@ -35,7 +35,7 @@ index d904c36..c0e4d70 100644 default: diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 4a2b636..4be6a50 100644 +index e534a9f..d720d26 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -716,36 +716,10 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) @@ -61,10 +61,10 @@ index 4a2b636..4be6a50 100644 - context = context_acquire(device, NULL); - gl_info = context->gl_info; - -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->resource.buffer_object)); -- GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)); -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); -- checkGLcall("glUnmapBufferARB"); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->resource.buffer_object)); +- GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); +- checkGLcall("glUnmapBuffer"); - context_release(context); - break; - @@ -75,7 +75,7 @@ index 4a2b636..4be6a50 100644 if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)) { TRACE("Not dirtified, nothing to do.\n"); -@@ -2579,6 +2553,8 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso +@@ -2733,6 +2707,8 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -84,7 +84,7 @@ index 4a2b636..4be6a50 100644 TRACE("surface %p.\n", surface); if (!surface->resource.map_count) -@@ -2588,6 +2564,12 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) +@@ -2742,6 +2718,12 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) } --surface->resource.map_count; @@ -97,7 +97,7 @@ index 4a2b636..4be6a50 100644 surface->surface_ops->surface_unmap(surface); return WINED3D_OK; -@@ -2598,8 +2580,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2752,8 +2734,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, { const struct wined3d_format *format = surface->resource.format; struct wined3d_device *device = surface->resource.device; @@ -107,7 +107,7 @@ index 4a2b636..4be6a50 100644 BYTE *base_memory; TRACE("surface %p, map_desc %p, rect %s, flags %#x.\n", -@@ -2641,6 +2622,9 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2795,6 +2776,9 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, } } @@ -117,7 +117,7 @@ index 4a2b636..4be6a50 100644 surface_prepare_map_memory(surface); if (flags & WINED3D_MAP_DISCARD) { -@@ -2650,51 +2634,19 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2804,51 +2788,19 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, } else { @@ -155,9 +155,9 @@ index 4a2b636..4be6a50 100644 - gl_info = context->gl_info; + base_memory = wined3d_resource_get_map_ptr(&surface->resource, context, flags); -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->resource.buffer_object)); -- base_memory = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_READ_WRITE_ARB)); -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->resource.buffer_object)); +- base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_READ_WRITE)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); - checkGLcall("map PBO"); - - context_release(context); @@ -173,5 +173,5 @@ index 4a2b636..4be6a50 100644 if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) map_desc->row_pitch = surface->resource.width * format->byte_count; -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch b/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch index f56d814f..f701899b 100644 --- a/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch +++ b/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch @@ -1,4 +1,4 @@ -From bd0eabcb62d243fc8ff0dd5fbe200caf9b1db1e1 Mon Sep 17 00:00:00 2001 +From 6bbf121fadc87b21f96f54cdc573218ace005098 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. @@ -15,7 +15,7 @@ surface_load_location will write a lot of ERRs. 4 files changed, 72 insertions(+), 63 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index ea146d1..1760969 100644 +index 358a29e..032371f 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -142,6 +142,18 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * @@ -28,8 +28,8 @@ index ea146d1..1760969 100644 + const struct wined3d_gl_info *gl_info = context->gl_info; + + TRACE("Deleting GL buffer %u belonging to resource %p.\n", resource->buffer_object, resource); -+ GL_EXTCALL(glDeleteBuffersARB(1, &resource->buffer_object)); -+ checkGLcall("glDeleteBuffersARB"); ++ GL_EXTCALL(glDeleteBuffers(1, &resource->buffer_object)); ++ checkGLcall("glDeleteBuffers"); + resource->buffer_object = 0; + context_release(context); +} @@ -70,10 +70,10 @@ index ea146d1..1760969 100644 + if (resource->buffer_object) + return; + -+ GL_EXTCALL(glGenBuffersARB(1, &resource->buffer_object)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->buffer_object)); -+ GL_EXTCALL(glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->size, NULL, GL_STREAM_DRAW_ARB)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); ++ GL_EXTCALL(glGenBuffers(1, &resource->buffer_object)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer_object)); ++ GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, resource->size, NULL, GL_STREAM_DRAW)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("Create GL buffer"); + + TRACE("Created GL buffer %u for resource %p.\n", resource->buffer_object, resource); @@ -123,7 +123,7 @@ index 066219d..9981703 100644 TRACE("Enabling GL_UNPACK_CLIENT_STORAGE_APPLE for volume %p\n", volume); gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index c538e08..af2fbd1 100644 +index db3a68c..8e72b17 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -312,42 +312,10 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * @@ -138,10 +138,10 @@ index c538e08..af2fbd1 100644 - if (volume->resource.buffer_object) - return; - -- GL_EXTCALL(glGenBuffersARB(1, &volume->resource.buffer_object)); -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->resource.buffer_object)); -- GL_EXTCALL(glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->resource.size, NULL, GL_STREAM_DRAW_ARB)); -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); +- GL_EXTCALL(glGenBuffers(1, &volume->resource.buffer_object)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->resource.buffer_object)); +- GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, volume->resource.size, NULL, GL_STREAM_DRAW)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); - checkGLcall("Create PBO"); - - TRACE("Created PBO %u for volume %p.\n", volume->resource.buffer_object, volume); @@ -153,8 +153,8 @@ index c538e08..af2fbd1 100644 - const struct wined3d_gl_info *gl_info = context->gl_info; - - TRACE("Deleting PBO %u belonging to volume %p.\n", volume->resource.buffer_object, volume); -- GL_EXTCALL(glDeleteBuffersARB(1, &volume->resource.buffer_object)); -- checkGLcall("glDeleteBuffersARB"); +- GL_EXTCALL(glDeleteBuffers(1, &volume->resource.buffer_object)); +- checkGLcall("glDeleteBuffers"); - volume->resource.buffer_object = 0; - context_release(context); -} diff --git a/patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch b/patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch index d19268ba..f1510b3d 100644 --- a/patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch +++ b/patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch @@ -1,4 +1,4 @@ -From 94dbd1a23471584d1f837ebc10f071d0ea09f9cf Mon Sep 17 00:00:00 2001 +From ee8e2567fab13b3f0f0d88d905d0fd8dc1cdb622 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. @@ -11,10 +11,10 @@ Subject: wined3d: Replace surface alloc functions with resource ones. 4 files changed, 20 insertions(+), 87 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 0093c6a..59626f7 100644 +index 78441e6..c6b3945 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -573,6 +573,16 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru +@@ -601,6 +601,16 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru case WINED3D_LOCATION_SYSMEM: return wined3d_resource_prepare_system_memory(resource); @@ -32,7 +32,7 @@ index 0093c6a..59626f7 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 b0f6ec9..85b1fd6 100644 +index c65a723..48de325 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -479,81 +479,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) @@ -51,22 +51,22 @@ index b0f6ec9..85b1fd6 100644 - context = context_acquire(surface->resource.device, NULL); - gl_info = context->gl_info; - -- GL_EXTCALL(glGenBuffersARB(1, &surface->resource.buffer_object)); +- GL_EXTCALL(glGenBuffers(1, &surface->resource.buffer_object)); - error = gl_info->gl_ops.gl.p_glGetError(); - if (!surface->resource.buffer_object || error != GL_NO_ERROR) - ERR("Failed to create a PBO with error %s (%#x).\n", debug_glerror(error), error); - - TRACE("Binding PBO %u.\n", surface->resource.buffer_object); - -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->resource.buffer_object)); -- checkGLcall("glBindBufferARB"); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->resource.buffer_object)); +- checkGLcall("glBindBuffer"); - -- GL_EXTCALL(glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->resource.size + 4, -- NULL, GL_STREAM_DRAW_ARB)); -- checkGLcall("glBufferDataARB"); +- GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, surface->resource.size + 4, +- NULL, GL_STREAM_DRAW)); +- checkGLcall("glBufferData"); - -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); -- checkGLcall("glBindBufferARB"); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); +- checkGLcall("glBindBuffer"); - - context_release(context); -} @@ -144,7 +144,7 @@ index b0f6ec9..85b1fd6 100644 valid_location = WINED3D_LOCATION_SYSMEM; } -@@ -2712,7 +2637,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2721,7 +2646,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, if (device->d3d_initialized) context = context_acquire(device, NULL); @@ -153,7 +153,7 @@ index b0f6ec9..85b1fd6 100644 if (flags & WINED3D_MAP_DISCARD) { TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n", -@@ -4242,7 +4167,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4251,7 +4176,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, { /* Performance warning... */ FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); @@ -162,7 +162,7 @@ index b0f6ec9..85b1fd6 100644 wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); } } -@@ -4253,7 +4178,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4262,7 +4187,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, { /* Performance warning... */ FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); @@ -171,7 +171,7 @@ index b0f6ec9..85b1fd6 100644 wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); } } -@@ -4262,7 +4187,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4271,7 +4196,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... */ @@ -180,7 +180,7 @@ index b0f6ec9..85b1fd6 100644 wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); } -@@ -4295,7 +4220,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4304,7 +4229,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -190,7 +190,7 @@ index b0f6ec9..85b1fd6 100644 surface_remove_pbo(surface, gl_info); } diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 0c3fe95..06a041c 100644 +index aee50f6..869c44f 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -851,8 +851,8 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub @@ -203,7 +203,7 @@ index 0c3fe95..06a041c 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); -@@ -966,8 +966,7 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi +@@ -964,8 +964,7 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi } else { @@ -214,10 +214,10 @@ index 0c3fe95..06a041c 100644 surface->flags |= SFLAG_CLIENT; mem = surface->resource.heap_memory; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7ea1374..b9d77f3 100644 +index e32d650..beaf9bc 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2395,7 +2395,6 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w +@@ -2394,7 +2394,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; @@ -226,5 +226,5 @@ index 7ea1374..b9d77f3 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; -- -1.9.1 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0035-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch b/patches/wined3d-CSMT_Main/0035-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch index 58a35ef5..fa4cccfc 100644 --- a/patches/wined3d-CSMT_Main/0035-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch +++ b/patches/wined3d-CSMT_Main/0035-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch @@ -1,4 +1,4 @@ -From 900dc644b944426cf580aa03f236043322a1ac20 Mon Sep 17 00:00:00 2001 +From 408f3f44631f7d3b32e936129e380992c5396094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 16:41:33 +0100 Subject: wined3d: Don't delete the buffer in surface_cleanup. @@ -8,7 +8,7 @@ Subject: wined3d: Don't delete the buffer in surface_cleanup. 1 file changed, 6 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 4c2a759..7d2d1ea 100644 +index 48de325..e5edd34 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -56,12 +56,6 @@ static void surface_cleanup(struct wined3d_surface *surface) @@ -18,12 +18,12 @@ index 4c2a759..7d2d1ea 100644 - if (surface->resource.buffer_object) - { - TRACE("Deleting PBO %u.\n", surface->resource.buffer_object); -- GL_EXTCALL(glDeleteBuffersARB(1, &surface->resource.buffer_object)); +- GL_EXTCALL(glDeleteBuffers(1, &surface->resource.buffer_object)); - } - if (surface->rb_multisample) { TRACE("Deleting multisample renderbuffer %u.\n", surface->rb_multisample); -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0036-wined3d-Use-resource-facilities-to-destroy-PBOs.patch b/patches/wined3d-CSMT_Main/0036-wined3d-Use-resource-facilities-to-destroy-PBOs.patch index 662ec6a4..63e1b944 100644 --- a/patches/wined3d-CSMT_Main/0036-wined3d-Use-resource-facilities-to-destroy-PBOs.patch +++ b/patches/wined3d-CSMT_Main/0036-wined3d-Use-resource-facilities-to-destroy-PBOs.patch @@ -1,4 +1,4 @@ -From 259e98f79a3de596a4fb79227180106c47423aa8 Mon Sep 17 00:00:00 2001 +From a0d7057a64862170f97d4c99d15d58323681efe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 16:49:21 +0100 Subject: wined3d: Use resource facilities to destroy PBOs. @@ -10,7 +10,7 @@ Subject: wined3d: Use resource facilities to destroy PBOs. 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index aa81c00..2a58a0c 100644 +index c6b3945..9783b78 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -142,7 +142,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * @@ -23,7 +23,7 @@ index aa81c00..2a58a0c 100644 struct wined3d_context *context = context_acquire(resource->device, NULL); const struct wined3d_gl_info *gl_info = context->gl_info; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 7d2d1ea..91d9e59 100644 +index e5edd34..b197655 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1029,16 +1029,6 @@ HRESULT CDECL wined3d_surface_get_render_target_data(struct wined3d_surface *sur @@ -33,8 +33,8 @@ index 7d2d1ea..91d9e59 100644 -/* Context activation is done by the caller. */ -static void surface_remove_pbo(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info) -{ -- GL_EXTCALL(glDeleteBuffersARB(1, &surface->resource.buffer_object)); -- checkGLcall("glDeleteBuffersARB(1, &surface->resource.buffer_object)"); +- GL_EXTCALL(glDeleteBuffers(1, &surface->resource.buffer_object)); +- checkGLcall("glDeleteBuffers(1, &surface->resource.buffer_object)"); - - surface->resource.buffer_object = 0; - wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_BUFFER); @@ -54,7 +54,7 @@ index 7d2d1ea..91d9e59 100644 /* Destroy fbo render buffers. This is needed for implicit render targets, for * all application-created targets the application has to release the surface * before calling _Reset -@@ -4071,7 +4057,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4225,7 +4211,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, wined3d_resource_prepare_map_memory(&surface->resource, context); wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); @@ -65,10 +65,10 @@ index 7d2d1ea..91d9e59 100644 wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 51c957b..81c9cfe 100644 +index beaf9bc..5e6d5d3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2115,6 +2115,7 @@ DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; +@@ -2126,6 +2126,7 @@ DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, const struct wined3d_box *box) DECLSPEC_HIDDEN; @@ -77,5 +77,5 @@ index 51c957b..81c9cfe 100644 BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0037-wined3d-Move-simple-location-copying-to-the-resource.patch b/patches/wined3d-CSMT_Main/0037-wined3d-Move-simple-location-copying-to-the-resource.patch index f793c9de..988dd0c4 100644 --- a/patches/wined3d-CSMT_Main/0037-wined3d-Move-simple-location-copying-to-the-resource.patch +++ b/patches/wined3d-CSMT_Main/0037-wined3d-Move-simple-location-copying-to-the-resource.patch @@ -1,4 +1,4 @@ -From 15497169d7c01aa9cbe051377b8e7088daacf2b3 Mon Sep 17 00:00:00 2001 +From ff992d330fdc3184bdfdf2daf55b87cc49235587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 16:58:08 +0100 Subject: wined3d: Move simple location copying to the resource. @@ -9,10 +9,10 @@ Subject: wined3d: Move simple location copying to the resource. 2 files changed, 42 insertions(+), 47 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 2a58a0c..d9e2216 100644 +index 9783b78..939377f 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -423,6 +423,38 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, +@@ -454,6 +454,38 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, } /* Context activation is optionally by the caller. Context may be NULL. */ @@ -29,18 +29,18 @@ index 2a58a0c..d9e2216 100644 + if (dst.buffer_object) + { + gl_info = context->gl_info; -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, dst.buffer_object)); -+ GL_EXTCALL(glBufferSubDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0, size, src.addr)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, dst.buffer_object)); ++ GL_EXTCALL(glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, size, src.addr)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("Upload PBO"); + return; + } + if (src.buffer_object) + { + gl_info = context->gl_info; -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, src.buffer_object)); -+ GL_EXTCALL(glGetBufferSubDataARB(GL_PIXEL_PACK_BUFFER_ARB, 0, size, dst.addr)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, src.buffer_object)); ++ GL_EXTCALL(glGetBufferSubData(GL_PIXEL_PACK_BUFFER, 0, size, dst.addr)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, 0)); + checkGLcall("Download PBO"); + return; + } @@ -51,7 +51,7 @@ index 2a58a0c..d9e2216 100644 void wined3d_resource_load_location(struct wined3d_resource *resource, struct wined3d_context *context, DWORD location) { -@@ -449,6 +481,12 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, +@@ -480,6 +512,12 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, resource->locations |= location; return; } @@ -65,7 +65,7 @@ index 2a58a0c..d9e2216 100644 /* Context is NULL in ddraw-only operation without OpenGL. */ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 91d9e59..5b2359e 100644 +index b197655..b620b02 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -36,10 +36,6 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); @@ -79,7 +79,7 @@ index 91d9e59..5b2359e 100644 static void surface_cleanup(struct wined3d_surface *surface) { struct wined3d_surface *overlay, *cur; -@@ -3832,54 +3828,12 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3986,54 +3982,12 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } @@ -98,9 +98,9 @@ index 91d9e59..5b2359e 100644 - { - context = context_acquire(device, NULL); - gl_info = context->gl_info; -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, dst.buffer_object)); -- GL_EXTCALL(glBufferSubDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0, size, src.addr)); -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, dst.buffer_object)); +- GL_EXTCALL(glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, size, src.addr)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); - checkGLcall("Upload PBO"); - context_release(context); - return; @@ -109,9 +109,9 @@ index 91d9e59..5b2359e 100644 - { - context = context_acquire(device, NULL); - gl_info = context->gl_info; -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, src.buffer_object)); -- GL_EXTCALL(glGetBufferSubDataARB(GL_PIXEL_PACK_BUFFER_ARB, 0, size, dst.addr)); -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, src.buffer_object)); +- GL_EXTCALL(glGetBufferSubData(GL_PIXEL_PACK_BUFFER, 0, size, dst.addr)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, 0)); - checkGLcall("Download PBO"); - context_release(context); - return; @@ -134,7 +134,7 @@ index 91d9e59..5b2359e 100644 if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); -@@ -3943,6 +3897,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4097,6 +4051,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, struct wined3d_format format; POINT dst_point = {0, 0}; BYTE *mem = NULL; @@ -144,7 +144,7 @@ index 91d9e59..5b2359e 100644 if (surface->resource.locations & WINED3D_LOCATION_DISCARDED) { -@@ -4018,7 +3975,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4172,7 +4129,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } } @@ -154,5 +154,5 @@ index 91d9e59..5b2359e 100644 WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); /* Lets hope we get it from somewhere... */ -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0045-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch b/patches/wined3d-CSMT_Main/0045-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch index 80e3b264..efd1b88e 100644 --- a/patches/wined3d-CSMT_Main/0045-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch +++ b/patches/wined3d-CSMT_Main/0045-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch @@ -1,4 +1,4 @@ -From b3e18543b31f43d2f72e4271c37f65c47e3f674f Mon Sep 17 00:00:00 2001 +From 3ccf9437225eff52fd9cad94d861e4d8fa2f5ec0 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,11 +18,11 @@ here... 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 2e44f0f..f335dfc 100644 +index 2386410..3de580e 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 - checkGLcall("glUnmapBufferARB"); + checkGLcall("glUnmapBuffer"); } -void buffer_mark_used(struct wined3d_buffer *buffer) @@ -31,7 +31,7 @@ index 2e44f0f..f335dfc 100644 buffer->flags &= ~(WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); } diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 679e728..ffb1c43 100644 +index 2204d29..861af29 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 @@ -49,10 +49,10 @@ index 679e728..ffb1c43 100644 if (state->index_buffer) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7339ae5..9c05b6c 100644 +index fd7e8f9..69c984ba 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2669,7 +2669,6 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co +@@ -2686,7 +2686,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; @@ -61,5 +61,5 @@ index 7339ae5..9c05b6c 100644 struct wined3d_rendertarget_view { -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0047-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch b/patches/wined3d-CSMT_Main/0047-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch index 68c830d5..e054710b 100644 --- a/patches/wined3d-CSMT_Main/0047-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch +++ b/patches/wined3d-CSMT_Main/0047-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch @@ -1,4 +1,4 @@ -From 8eb60915d38e68c45223eafa534452fc4ffeb1fe Mon Sep 17 00:00:00 2001 +From ff3ebefd7ff7834c3c1a7c9b7998592929e40714 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Sat, 8 Dec 2012 19:28:54 +0100 Subject: wined3d: Wait for resource updates to finish when using the @@ -17,7 +17,7 @@ then it's probably useful for debugging. 6 files changed, 40 insertions(+), 13 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index 2875fe1..ca456ad 100644 +index 9f29aa4..59c3409 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -7679,7 +7679,9 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter, @@ -32,13 +32,13 @@ index 2875fe1..ca456ad 100644 && (dst_surface->container->swapchain->front_buffer == dst_surface->container))) context->gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index f335dfc..abad8b8 100644 +index 3de580e..41bc6f0 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1100,7 +1100,9 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) } - GL_EXTCALL(glUnmapBufferARB(buffer->buffer_type_hint)); + GL_EXTCALL(glUnmapBuffer(buffer->buffer_type_hint)); - if (wined3d_settings.strict_draw_ordering) + if (wined3d_settings.cs_multithreaded) + gl_info->gl_ops.gl.p_glFinish(); @@ -47,7 +47,7 @@ index f335dfc..abad8b8 100644 context_release(context); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 92478d7..08422ad 100644 +index e33d0c0..b9935e0 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -463,7 +463,9 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c @@ -89,7 +89,7 @@ index 98261f9..d3a9e03 100644 context_release(context); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 642210d..8fa2c9f 100644 +index 1aafda1..caf9618 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -687,7 +687,9 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, @@ -114,8 +114,8 @@ index 642210d..8fa2c9f 100644 || (dst_location == WINED3D_LOCATION_DRAWABLE && dst_surface->container->swapchain->front_buffer == dst_surface->container)) gl_info->gl_ops.gl.p_glFlush(); -@@ -1393,7 +1397,9 @@ static void surface_upload_data(struct wined3d_surface *surface, const struct wi - checkGLcall("glBindBufferARB"); +@@ -1393,7 +1397,9 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w + checkGLcall("glBindBuffer"); } - if (wined3d_settings.strict_draw_ordering) @@ -125,7 +125,7 @@ index 642210d..8fa2c9f 100644 gl_info->gl_ops.gl.p_glFlush(); if (gl_info->quirks & WINED3D_QUIRK_FBO_TEX_UPDATE) -@@ -3183,7 +3189,9 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3337,7 +3343,9 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st checkGLcall("glDeleteTextures(1, &backup)"); } @@ -136,7 +136,7 @@ index 642210d..8fa2c9f 100644 gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ context_release(context); -@@ -3298,7 +3306,9 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, +@@ -3452,7 +3460,9 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -147,7 +147,7 @@ index 642210d..8fa2c9f 100644 || (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. */ -@@ -3719,7 +3729,9 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3873,7 +3883,9 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -158,7 +158,7 @@ index 642210d..8fa2c9f 100644 gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else if (location == WINED3D_LOCATION_DRAWABLE) -@@ -3735,7 +3747,9 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3889,7 +3901,9 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -186,5 +186,5 @@ index ed2964e..60504ef 100644 /* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */ gl_info->gl_ops.wgl.p_wglSwapBuffers(context->hdc); /* TODO: cycle through the swapchain buffers */ -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0099-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch b/patches/wined3d-CSMT_Main/0099-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch index f136e2ad..689c5524 100644 --- a/patches/wined3d-CSMT_Main/0099-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch +++ b/patches/wined3d-CSMT_Main/0099-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch @@ -1,4 +1,4 @@ -From 37bbd4699a2266175bd1344b006d8bd5f352b8b5 Mon Sep 17 00:00:00 2001 +From bd911b7f7d610d7b2a4441827aef64bb24257e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 1 Aug 2013 01:43:35 +0200 Subject: wined3d: Get rid of the surface_upload_data glFinish @@ -8,11 +8,11 @@ Subject: wined3d: Get rid of the surface_upload_data glFinish 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index b2a5d22..b19355c 100644 +index c503c67..5dda903 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -1403,9 +1403,7 @@ static void surface_upload_data(struct wined3d_surface *surface, const struct wi - checkGLcall("glBindBufferARB"); +@@ -1403,9 +1403,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w + checkGLcall("glBindBuffer"); } - if (wined3d_settings.cs_multithreaded) @@ -23,5 +23,5 @@ index b2a5d22..b19355c 100644 if (gl_info->quirks & WINED3D_QUIRK_FBO_TEX_UPDATE) -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch b/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch index ebf98574..cc25ebb2 100644 --- a/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch +++ b/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch @@ -1,4 +1,4 @@ -From 7690fa9323a0c910cb788ae09f474657d298acf6 Mon Sep 17 00:00:00 2001 +From 4f37cdd5e369a388229874ba94a0390e809f3aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 30 Aug 2013 17:00:35 +0200 Subject: wined3d: Wrap GL BOs in a structure @@ -14,7 +14,7 @@ them for DISCARD maps. 5 files changed, 86 insertions(+), 28 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 6a5fc5a..bd53a1f 100644 +index d051974..3aec1dd 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4981,3 +4981,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL @@ -41,12 +41,12 @@ index 6a5fc5a..bd53a1f 100644 + + gl_info = context->gl_info; + -+ GL_EXTCALL(glGenBuffersARB(1, &ret->name)); ++ GL_EXTCALL(glGenBuffers(1, &ret->name)); + if (type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) + context_invalidate_state(context, STATE_INDEXBUFFER); -+ GL_EXTCALL(glBindBufferARB(type_hint, ret->name)); -+ GL_EXTCALL(glBufferDataARB(type_hint, size, NULL, gl_usage)); -+ GL_EXTCALL(glBindBufferARB(type_hint, 0)); ++ GL_EXTCALL(glBindBuffer(type_hint, ret->name)); ++ GL_EXTCALL(glBufferData(type_hint, size, NULL, gl_usage)); ++ GL_EXTCALL(glBindBuffer(type_hint, 0)); + checkGLcall("Create buffer object"); + + TRACE("Successfully created and set up buffer %u\n", ret->name); @@ -60,8 +60,8 @@ index 6a5fc5a..bd53a1f 100644 + const struct wined3d_gl_info *gl_info = context->gl_info; + TRACE("device %p, bo %p, GL bo %u\n", device, bo, bo->name); + -+ GL_EXTCALL(glDeleteBuffersARB(1, &bo->name)); -+ checkGLcall("glDeleteBuffersARB"); ++ GL_EXTCALL(glDeleteBuffers(1, &bo->name)); ++ checkGLcall("glDeleteBuffers"); + + HeapFree(GetProcessHeap(), 0, bo); +} @@ -75,7 +75,7 @@ index 6a5fc5a..bd53a1f 100644 + wined3d_device_destroy_bo(device, context, bo); +} diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 788c8e6..ba4b85b 100644 +index 2dc25bf..8fb95a1 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -145,12 +145,10 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * @@ -85,8 +85,8 @@ index 788c8e6..ba4b85b 100644 - const struct wined3d_gl_info *gl_info = context->gl_info; - TRACE("Deleting GL buffer %u belonging to resource %p.\n", resource->buffer_object, resource); -- GL_EXTCALL(glDeleteBuffersARB(1, &resource->buffer_object)); -- checkGLcall("glDeleteBuffersARB"); +- GL_EXTCALL(glDeleteBuffers(1, &resource->buffer_object)); +- checkGLcall("glDeleteBuffers"); - resource->buffer_object = 0; + wined3d_device_release_bo(resource->device, resource->buffer, context); + resource->buffer = NULL; @@ -125,8 +125,8 @@ index 788c8e6..ba4b85b 100644 { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->buffer_object)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->buffer->name)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer_object)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer->name)); if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) { @@ -134,10 +134,10 @@ index 788c8e6..ba4b85b 100644 { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->buffer_object)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->buffer->name)); - GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)); - GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer_object)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer->name)); + GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); + GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); checkGLcall("Unmap GL buffer"); @@ -598,20 +596,14 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, } @@ -152,21 +152,21 @@ index 788c8e6..ba4b85b 100644 + if (resource->buffer) return; -- GL_EXTCALL(glGenBuffersARB(1, &resource->buffer_object)); -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->buffer_object)); -- GL_EXTCALL(glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->size, NULL, GL_STREAM_DRAW_ARB)); -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); +- GL_EXTCALL(glGenBuffers(1, &resource->buffer_object)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer_object)); +- GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, resource->size, NULL, GL_STREAM_DRAW)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); - checkGLcall("Create GL buffer"); - - TRACE("Created GL buffer %u for resource %p.\n", resource->buffer_object, resource); + resource->buffer = wined3d_device_get_bo(resource->device, resource->size, -+ GL_STREAM_DRAW_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, context); ++ GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); + TRACE("Created GL buffer %u for resource %p.\n", resource->buffer->name, resource); } BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index d093744..4d8dd01 100644 +index 1392745..90fa582 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -48,7 +48,7 @@ static void surface_cleanup(struct wined3d_surface *surface) @@ -197,7 +197,7 @@ index d093744..4d8dd01 100644 TRACE("Removing the pbo attached to surface %p.\n", surface); diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 53d73e3..7b040f0 100644 +index 6b41ca1..28985a4 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -216,7 +216,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, diff --git a/patches/wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch b/patches/wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch index eca61c64..3b7f8a7c 100644 --- a/patches/wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch +++ b/patches/wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch @@ -1,4 +1,4 @@ -From 4a9d09e89a1ae33ae766eec2af1a1c07276b7a94 Mon Sep 17 00:00:00 2001 +From 93fe426cbd0d2b61997d59fbbd1e49b2615f8c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 30 Aug 2013 17:06:29 +0200 Subject: wined3d: Separate resource map and draw buffers @@ -9,7 +9,7 @@ Subject: wined3d: Separate resource map and draw buffers 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index ba4b85b..83f3b30 100644 +index 8fb95a1..39555ef 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -146,8 +146,12 @@ void wined3d_resource_free_bo(struct wined3d_resource *resource) @@ -29,8 +29,8 @@ index ba4b85b..83f3b30 100644 { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->buffer->name)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->map_buffer->name)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer->name)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->map_buffer->name)); if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) { @@ -38,15 +38,15 @@ index ba4b85b..83f3b30 100644 { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; -- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->buffer->name)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->map_buffer->name)); - GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)); - GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->buffer->name)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, resource->map_buffer->name)); + GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); + GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); checkGLcall("Unmap GL buffer"); @@ -603,6 +607,7 @@ static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struc resource->buffer = wined3d_device_get_bo(resource->device, resource->size, - GL_STREAM_DRAW_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, context); + GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); + resource->map_buffer = resource->buffer; TRACE("Created GL buffer %u for resource %p.\n", resource->buffer->name, resource); } diff --git a/patches/wined3d-CSMT_Main/0116-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch b/patches/wined3d-CSMT_Main/0116-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch index cb561630..a1a531b8 100644 --- a/patches/wined3d-CSMT_Main/0116-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch +++ b/patches/wined3d-CSMT_Main/0116-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch @@ -1,4 +1,4 @@ -From fe033b6524bc09e86116176d015a14214735439d Mon Sep 17 00:00:00 2001 +From eb880bc806a44d2d2d09df19a43fd1a5f7d8ecf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 27 Sep 2013 19:06:41 +0200 Subject: wined3d: Implement DISCARD resource maps with buffers. @@ -45,7 +45,7 @@ index f5c10dd..d86aa59 100644 cs->ops->submit(cs, sizeof(*op)); } diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 65e8f55..8d9757c 100644 +index 39555ef..69dd95a 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -697,9 +697,27 @@ void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD fla @@ -57,7 +57,7 @@ index 65e8f55..8d9757c 100644 + { + case WINED3D_LOCATION_BUFFER: + resource->map_buffer = wined3d_device_get_bo(device, resource->size, -+ GL_STREAM_DRAW_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, context); ++ GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); + break; + + default: @@ -122,10 +122,10 @@ index 65e8f55..8d9757c 100644 wined3d_resource_invalidate_location(resource, ~resource->map_binding); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index eb84cbc..15d63e2 100644 +index 374dbc2..abf3ca2 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2159,7 +2159,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -2170,7 +2170,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -135,7 +135,7 @@ index eb84cbc..15d63e2 100644 BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, const struct wined3d_box *box) DECLSPEC_HIDDEN; void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -@@ -2676,7 +2677,8 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf +@@ -2693,7 +2694,8 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; @@ -146,5 +146,5 @@ index eb84cbc..15d63e2 100644 DWORD flags) DECLSPEC_HIDDEN; void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch b/patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch index 316cf703..064a6a64 100644 --- a/patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch +++ b/patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch @@ -1,4 +1,4 @@ -From 8494f0465c33b7d735d4a4dbeb2c5b9ea3ce9430 Mon Sep 17 00:00:00 2001 +From 589330d01be6e2555b395b0914012248b1bff069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 27 Sep 2013 19:24:21 +0200 Subject: wined3d: Implement DISCARD resource maps with heap memory. @@ -13,7 +13,7 @@ Subject: wined3d: Implement DISCARD resource maps with heap memory. 6 files changed, 48 insertions(+), 10 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index b76a07d..3ca1143 100644 +index 7187114..c9b2ae7b2 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -493,6 +493,7 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *con @@ -61,7 +61,7 @@ index d86aa59..9307246 100644 cs->ops->submit(cs, sizeof(*op)); } diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 5e62915..ebb9ff3 100644 +index 69dd95a..b7aa587 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -119,6 +119,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * @@ -107,7 +107,7 @@ index 5e62915..ebb9ff3 100644 } @@ -705,6 +708,10 @@ void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD fla - GL_STREAM_DRAW_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, context); + GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); break; + case WINED3D_LOCATION_SYSMEM: @@ -175,7 +175,7 @@ index 5e62915..ebb9ff3 100644 wined3d_resource_invalidate_location(resource, ~resource->map_binding); } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 4d8dd01..03f49a8 100644 +index 90fa582..f56bb6b 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -487,6 +487,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) @@ -203,7 +203,7 @@ index 4d8dd01..03f49a8 100644 wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); } diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 7b040f0..829cb8a 100644 +index 28985a4..d253a17 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -134,6 +134,7 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume, diff --git a/patches/wined3d-CSMT_Main/0128-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch b/patches/wined3d-CSMT_Main/0128-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch index 52ea5ae6..24dbb10b 100644 --- a/patches/wined3d-CSMT_Main/0128-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch +++ b/patches/wined3d-CSMT_Main/0128-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch @@ -1,4 +1,4 @@ -From bca1f6b098077f30abc3d86ea3e7c3be17dc35f4 Mon Sep 17 00:00:00 2001 +From 8d084548850a169be0ef5863e7c8fe2ebce83c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 24 Jul 2013 13:02:06 +0200 Subject: wined3d: Use glBufferSubData instead of glMapBufferRange @@ -11,7 +11,7 @@ do mapbuffer through the CS. 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index a09ca90..675dbec 100644 +index 12ef20f..04e38cb 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -657,43 +657,17 @@ drop_query: @@ -23,8 +23,8 @@ index a09ca90..675dbec 100644 /* This potentially invalidates the element array buffer binding, but the * caller always takes care of this. */ - GL_EXTCALL(glBindBufferARB(This->buffer_type_hint, This->buffer_object)); - checkGLcall("glBindBufferARB"); + GL_EXTCALL(glBindBuffer(This->buffer_type_hint, This->buffer_object)); + checkGLcall("glBindBuffer"); - if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) - { - GLbitfield mapflags; @@ -48,8 +48,8 @@ index a09ca90..675dbec 100644 - syncflags |= WINED3D_MAP_NOOVERWRITE; - buffer_sync_apple(This, syncflags, gl_info); - } -- map = GL_EXTCALL(glMapBufferARB(This->buffer_type_hint, GL_WRITE_ONLY_ARB)); -- checkGLcall("glMapBufferARB"); +- map = GL_EXTCALL(glMapBuffer(This->buffer_type_hint, GL_WRITE_ONLY)); +- checkGLcall("glMapBuffer"); - } - if (!map) + @@ -57,8 +57,8 @@ index a09ca90..675dbec 100644 { - ERR("Failed to map opengl buffer\n"); - return; -+ GL_EXTCALL(glBufferDataARB(This->buffer_type_hint, This->resource.size, NULL, GL_STREAM_DRAW_ARB)); -+ checkGLcall("glBufferDataARB"); ++ GL_EXTCALL(glBufferData(This->buffer_type_hint, This->resource.size, NULL, GL_STREAM_DRAW)); ++ checkGLcall("glBufferData"); } while (This->modified_areas) @@ -78,14 +78,14 @@ index a09ca90..675dbec 100644 - GL_EXTCALL(glFlushMappedBufferRangeAPPLE(This->buffer_type_hint, start, len)); - checkGLcall("glFlushMappedBufferRangeAPPLE"); - } -+ GL_EXTCALL(glBufferSubDataARB(This->buffer_type_hint, start, len, (BYTE *)This->resource.heap_memory + start)); -+ checkGLcall("glBufferSubDataARB"); ++ GL_EXTCALL(glBufferSubData(This->buffer_type_hint, start, len, (BYTE *)This->resource.heap_memory + start)); ++ checkGLcall("glBufferSubData"); } -- GL_EXTCALL(glUnmapBufferARB(This->buffer_type_hint)); -- checkGLcall("glUnmapBufferARB"); +- GL_EXTCALL(glUnmapBuffer(This->buffer_type_hint)); +- checkGLcall("glUnmapBuffer"); } static void buffer_mark_used(struct wined3d_buffer *buffer) -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0130-wined3d-Create-buffers-before-mapping-them.patch b/patches/wined3d-CSMT_Main/0130-wined3d-Create-buffers-before-mapping-them.patch index 5e6f78db..b7143c79 100644 --- a/patches/wined3d-CSMT_Main/0130-wined3d-Create-buffers-before-mapping-them.patch +++ b/patches/wined3d-CSMT_Main/0130-wined3d-Create-buffers-before-mapping-them.patch @@ -1,4 +1,4 @@ -From f11244b08c7979837fb685d1406f17d9630c6c98 Mon Sep 17 00:00:00 2001 +From bc693691b0caf8ad1d7d1de0d7b93834b4993128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 29 Aug 2013 17:35:53 +0200 Subject: wined3d: Create buffers before mapping them. @@ -8,11 +8,11 @@ Subject: wined3d: Create buffers before mapping them. 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 8b09aee..81c607d 100644 +index d393280..5ebe487 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -185,6 +185,8 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine - ERR("glBufferDataARB failed with error %s (%#x)\n", debug_glerror(error), error); + ERR("glBufferData failed with error %s (%#x)\n", debug_glerror(error), error); goto fail; } + if (wined3d_settings.strict_draw_ordering || wined3d_settings.cs_multithreaded) @@ -38,7 +38,7 @@ index 8b09aee..81c607d 100644 + * + * Don't try to solve this by going back to always invalidating changed areas. + * This won't work if we ever want to support glMapBufferRange mapping with -+ * GL_ARB_buffer_storage in the CS. ++ * GL_buffer_storage in the CS. + * + * Also keep in mind that UnLoad can destroy the VBO, so simply creating it + * on buffer creation won't work either. */ @@ -62,5 +62,5 @@ index 8b09aee..81c607d 100644 if (wined3d_settings.cs_multithreaded) -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0135-wined3d-Create-VBOs-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0135-wined3d-Create-VBOs-through-the-command-stream.patch index 11759f3c..898e4ed5 100644 --- a/patches/wined3d-CSMT_Main/0135-wined3d-Create-VBOs-through-the-command-stream.patch +++ b/patches/wined3d-CSMT_Main/0135-wined3d-Create-VBOs-through-the-command-stream.patch @@ -1,4 +1,4 @@ -From 551886caadf25e70d783f9d4584054b7a4fed39d Mon Sep 17 00:00:00 2001 +From 60ebba02de794f88fea7b31406493de579ce01e3 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 81c607d..fc65d3a 100644 +index 5ebe487..7c3dc17 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 @@ -24,7 +24,7 @@ index 81c607d..fc65d3a 100644 GLenum gl_usage = GL_STATIC_DRAW_ARB; GLenum error; @@ -185,8 +185,6 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine - ERR("glBufferDataARB failed with error %s (%#x)\n", debug_glerror(error), error); + ERR("glBufferData failed with error %s (%#x)\n", debug_glerror(error), error); goto fail; } - if (wined3d_settings.strict_draw_ordering || wined3d_settings.cs_multithreaded) @@ -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 86ee114..74e059c 100644 +index 2cdc6e9..63b8ece 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2705,6 +2705,7 @@ void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_renderta +@@ -2722,6 +2722,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,7 +119,7 @@ index 86ee114..74e059c 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 -@@ -2793,6 +2794,8 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte +@@ -2810,6 +2811,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; @@ -129,5 +129,5 @@ index 86ee114..74e059c 100644 struct wined3d_rendertarget_view { -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0158-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch b/patches/wined3d-CSMT_Main/0158-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch index 337d984d..c9473b65 100644 --- a/patches/wined3d-CSMT_Main/0158-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch +++ b/patches/wined3d-CSMT_Main/0158-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch @@ -1,4 +1,4 @@ -From 95b883bf187904f5cdd00dbf360ebd444b455a63 Mon Sep 17 00:00:00 2001 +From 80c6dcd25ef96df6885a55cdd23900ae55f30bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 5 Jun 2014 13:07:27 +0200 Subject: wined3d: Set map_heap_memory = NULL when allocating a PBO. @@ -15,11 +15,11 @@ LOCATION_SYSMEM. 1 file changed, 1 insertion(+) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 805c6da..8069160 100644 +index 671ab50..1dff0ed 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -585,6 +585,7 @@ static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struc - GL_STREAM_DRAW_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, context); +@@ -616,6 +616,7 @@ static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struc + GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); resource->map_buffer = resource->buffer; TRACE("Created GL buffer %u for resource %p.\n", resource->buffer->name, resource); + resource->map_heap_memory = NULL; @@ -27,5 +27,5 @@ index 805c6da..8069160 100644 BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0167-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch b/patches/wined3d-CSMT_Main/0167-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch index 9b835dd2..c4300034 100644 --- a/patches/wined3d-CSMT_Main/0167-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch +++ b/patches/wined3d-CSMT_Main/0167-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch @@ -1,4 +1,4 @@ -From ee64ddd005a7f0677b34b30b37469d587ae6fc76 Mon Sep 17 00:00:00 2001 +From 86347e81d7f9b1cf0c231833b5cbba783c0acbd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 29 Aug 2014 18:52:22 +0200 Subject: wined3d: Put GL_APPLE_flush_buffer_range syncing back in place. @@ -8,12 +8,12 @@ Subject: wined3d: Put GL_APPLE_flush_buffer_range syncing back in place. 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index c0f96e3..d743f0a 100644 +index e1ba423..d2da303 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -673,6 +673,12 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined - GL_EXTCALL(glBufferDataARB(This->buffer_type_hint, This->resource.size, NULL, GL_STREAM_DRAW_ARB)); - checkGLcall("glBufferDataARB"); + GL_EXTCALL(glBufferData(This->buffer_type_hint, This->resource.size, NULL, GL_STREAM_DRAW)); + checkGLcall("glBufferData"); } + else if (flags & WINED3D_BUFFER_SYNC && This->flags & WINED3D_BUFFER_APPLESYNC) + { @@ -48,5 +48,5 @@ index c0f96e3..d743f0a 100644 } -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 65df14da..c1557ce1 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -723,10 +723,10 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c + if (volume->pbo) + return; + -+ GL_EXTCALL(glGenBuffersARB(1, &volume->pbo)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo)); -+ GL_EXTCALL(glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->resource.size, NULL, GL_STREAM_DRAW_ARB)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); ++ GL_EXTCALL(glGenBuffers(1, &volume->pbo)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo)); ++ GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, volume->resource.size, NULL, GL_STREAM_DRAW)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("Create PBO"); + + TRACE("Created PBO %u for volume %p.\n", volume->pbo, volume); @@ -738,8 +738,8 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c + const struct wined3d_gl_info *gl_info = context->gl_info; + + TRACE("Deleting PBO %u belonging to volume %p.\n", volume->pbo, volume); -+ GL_EXTCALL(glDeleteBuffersARB(1, &volume->pbo)); -+ checkGLcall("glDeleteBuffersARB"); ++ GL_EXTCALL(glDeleteBuffers(1, &volume->pbo)); ++ checkGLcall("glDeleteBuffers"); + volume->pbo = 0; + context_release(context); +} @@ -905,22 +905,22 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c + else + wined3d_volume_load_location(volume, context, WINED3D_LOCATION_BUFFER); + -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo)); + + if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) + { + GLbitfield mapflags = wined3d_resource_gl_map_flags(flags); + mapflags &= ~GL_MAP_FLUSH_EXPLICIT_BIT; -+ base_memory = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER_ARB, ++ base_memory = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, + 0, volume->resource.size, mapflags)); + } + else + { + GLenum access = wined3d_resource_gl_legacy_map_flags(flags); -+ base_memory = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, access)); ++ base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); + } + -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("Map PBO"); + + context_release(context); @@ -1030,9 +1030,9 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c + struct wined3d_context *context = context_acquire(device, NULL); + const struct wined3d_gl_info *gl_info = context->gl_info; + -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo)); -+ GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo)); ++ GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("Unmap PBO"); + + context_release(context); @@ -6287,7 +6287,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + if (surface->pbo) + { + TRACE("Deleting PBO %u.\n", surface->pbo); -+ GL_EXTCALL(glDeleteBuffersARB(1, &surface->pbo)); ++ GL_EXTCALL(glDeleteBuffers(1, &surface->pbo)); + } + +#endif /* STAGING_CSMT */ @@ -6413,22 +6413,22 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + context = context_acquire(surface->resource.device, NULL); + gl_info = context->gl_info; + -+ GL_EXTCALL(glGenBuffersARB(1, &surface->pbo)); ++ GL_EXTCALL(glGenBuffers(1, &surface->pbo)); + error = gl_info->gl_ops.gl.p_glGetError(); + if (!surface->pbo || error != GL_NO_ERROR) + ERR("Failed to create a PBO with error %s (%#x).\n", debug_glerror(error), error); + + TRACE("Binding PBO %u.\n", surface->pbo); + -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->pbo)); -+ checkGLcall("glBindBufferARB"); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->pbo)); ++ checkGLcall("glBindBuffer"); + -+ GL_EXTCALL(glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->resource.size + 4, -+ NULL, GL_STREAM_DRAW_ARB)); -+ checkGLcall("glBufferDataARB"); ++ GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, surface->resource.size + 4, ++ NULL, GL_STREAM_DRAW)); ++ checkGLcall("glBufferData"); + -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); -+ checkGLcall("glBindBufferARB"); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); ++ checkGLcall("glBindBuffer"); + + context_release(context); +} @@ -6561,10 +6561,10 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + context = context_acquire(device, NULL); + gl_info = context->gl_info; + -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->pbo)); -+ GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); -+ checkGLcall("glUnmapBufferARB"); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->pbo)); ++ GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); ++ checkGLcall("glUnmapBuffer"); + context_release(context); + break; + @@ -6690,8 +6690,8 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +/* Context activation is done by the caller. */ +static void surface_remove_pbo(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info) +{ -+ GL_EXTCALL(glDeleteBuffersARB(1, &surface->pbo)); -+ checkGLcall("glDeleteBuffersARB(1, &surface->pbo)"); ++ GL_EXTCALL(glDeleteBuffers(1, &surface->pbo)); ++ checkGLcall("glDeleteBuffers(1, &surface->pbo)"); + + surface->pbo = 0; + surface_invalidate_location(surface, WINED3D_LOCATION_BUFFER); @@ -7234,9 +7234,9 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + context = context_acquire(device, NULL); + gl_info = context->gl_info; + -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, surface->pbo)); -+ base_memory = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_READ_WRITE_ARB)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->pbo)); ++ base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_READ_WRITE)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("map PBO"); + + context_release(context); @@ -7401,7 +7401,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info = context->gl_info; @@ -2860,12 +3541,16 @@ - checkGLcall("glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0)"); + checkGLcall("glBindBuffer"); } +#if defined(STAGING_CSMT) @@ -7845,9 +7845,9 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + { + context = context_acquire(device, NULL); + gl_info = context->gl_info; -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, dst.buffer_object)); -+ GL_EXTCALL(glBufferSubDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0, size, src.addr)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, dst.buffer_object)); ++ GL_EXTCALL(glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, size, src.addr)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("Upload PBO"); + context_release(context); + return; @@ -7856,9 +7856,9 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + { + context = context_acquire(device, NULL); + gl_info = context->gl_info; -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, src.buffer_object)); -+ GL_EXTCALL(glGetBufferSubDataARB(GL_PIXEL_PACK_BUFFER_ARB, 0, size, dst.addr)); -+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, src.buffer_object)); ++ GL_EXTCALL(glGetBufferSubData(GL_PIXEL_PACK_BUFFER, 0, size, dst.addr)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, 0)); + checkGLcall("Download PBO"); + context_release(context); + return; @@ -9196,8 +9196,8 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c + + /* This potentially invalidates the element array buffer binding, but the + * caller always takes care of this. */ -+ GL_EXTCALL(glBindBufferARB(This->buffer_type_hint, This->buffer_object)); -+ checkGLcall("glBindBufferARB"); ++ GL_EXTCALL(glBindBuffer(This->buffer_type_hint, This->buffer_object)); ++ checkGLcall("glBindBuffer"); + if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) + { + GLbitfield mapflags; @@ -9221,8 +9221,8 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c + syncflags |= WINED3D_MAP_NOOVERWRITE; + buffer_sync_apple(This, syncflags, gl_info); + } -+ map = GL_EXTCALL(glMapBufferARB(This->buffer_type_hint, GL_WRITE_ONLY_ARB)); -+ checkGLcall("glMapBufferARB"); ++ map = GL_EXTCALL(glMapBuffer(This->buffer_type_hint, GL_WRITE_ONLY)); ++ checkGLcall("glMapBuffer"); + } + if (!map) + { @@ -9237,8 +9237,8 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c len = This->maps[This->modified_areas].size; +#if defined(STAGING_CSMT) - GL_EXTCALL(glBufferSubDataARB(This->buffer_type_hint, start, len, (BYTE *)This->resource.heap_memory + start)); - checkGLcall("glBufferSubDataARB"); + GL_EXTCALL(glBufferSubData(This->buffer_type_hint, start, len, (BYTE *)This->resource.heap_memory + start)); + checkGLcall("glBufferSubData"); } } @@ -9257,8 +9257,8 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c + checkGLcall("glFlushMappedBufferRangeAPPLE"); + } + } -+ GL_EXTCALL(glUnmapBufferARB(This->buffer_type_hint)); -+ checkGLcall("glUnmapBufferARB"); ++ GL_EXTCALL(glUnmapBuffer(This->buffer_type_hint)); ++ checkGLcall("glUnmapBuffer"); +} + +void buffer_mark_used(struct wined3d_buffer *buffer) @@ -9406,7 +9406,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c @@ -1136,6 +1323,7 @@ } - GL_EXTCALL(glUnmapBufferARB(buffer->buffer_type_hint)); + GL_EXTCALL(glUnmapBuffer(buffer->buffer_type_hint)); +#if defined(STAGING_CSMT) if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); @@ -9514,7 +9514,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 -@@ -5181,9 +5181,15 @@ +@@ -5197,9 +5197,15 @@ DebugBreak(); }