diff -Nru wine-staging-1.7.47~ubuntu12.04.1/aclocal.m4 wine-staging-1.7.48~ubuntu12.04.1/aclocal.m4 --- wine-staging-1.7.47~ubuntu12.04.1/aclocal.m4 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/aclocal.m4 2015-07-29 19:28:54.000000000 +0000 @@ -42,6 +42,7 @@ dnl AC_DEFUN([WINE_PATH_SONAME_TOOLS], [AC_PATH_PROG(LDD,ldd,true,/sbin:/usr/sbin:$PATH) +AC_CHECK_TOOL(OTOOL,otool,otool) AC_CHECK_TOOL(READELF,[readelf],true)]) AC_DEFUN([WINE_PATH_PKG_CONFIG], @@ -62,7 +63,7 @@ AC_LINK_IFELSE([AC_LANG_CALL([], [$2])], [case "$LIBEXT" in dll) AS_VAR_SET(ac_Lib,[`$ac_cv_path_LDD conftest.exe | grep "$1" | sed -e "s/dll.*/dll/"';2,$d'`]) ;; - dylib) AS_VAR_SET(ac_Lib,[`otool -L conftest$ac_exeext | grep "ac_lib_pattern\\.[[0-9A-Za-z.]]*dylib" | sed -e "s/^.*\/\(ac_lib_pattern\.[[0-9A-Za-z.]]*dylib\).*$/\1/"';2,$d'`]) ;; + dylib) AS_VAR_SET(ac_Lib,[`$OTOOL -L conftest$ac_exeext | grep "ac_lib_pattern\\.[[0-9A-Za-z.]]*dylib" | sed -e "s/^.*\/\(ac_lib_pattern\.[[0-9A-Za-z.]]*dylib\).*$/\1/"';2,$d'`]) ;; *) AS_VAR_SET(ac_Lib,[`$READELF -d conftest$ac_exeext | grep "NEEDED.*ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\\m4_dquote(\\(ac_lib_pattern\\.$LIBEXT[[^ ]]*\\)\\).*$/\1/"';2,$d'`]) AS_VAR_IF([ac_Lib],[], [AS_VAR_SET(ac_Lib,[`$LDD conftest$ac_exeext | grep "ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\(ac_lib_pattern\.$LIBEXT[[^ ]]*\).*$/\1/"';2,$d'`])]) ;; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/ANNOUNCE wine-staging-1.7.48~ubuntu12.04.1/ANNOUNCE --- wine-staging-1.7.47~ubuntu12.04.1/ANNOUNCE 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/ANNOUNCE 2015-07-29 19:28:54.000000000 +0000 @@ -1,17 +1,16 @@ -The Wine development release 1.7.47 is now available. +The Wine development release 1.7.48 is now available. What's new in this release (see below for details): - - Text drawing in Direct2D. - - Support for the new thread pool API. - - Toolbar state saving. - - Beginnings of an implementation for proper HID support. - - Support for file objects in device drivers. + - Fleshed out OpenMP implementation. + - I/O stream support in the MSVCIRT C++ runtime. + - Support for pixel snapping in DirectWrite. + - More support for OpenGL core contexts. - Various bug fixes. The source is available from the following locations: - http://prdownloads.sourceforge.net/wine/wine-1.7.47.tar.bz2 - http://mirrors.ibiblio.org/wine/source/1.7/wine-1.7.47.tar.bz2 + http://prdownloads.sourceforge.net/wine/wine-1.7.48.tar.bz2 + http://mirrors.ibiblio.org/wine/source/1.7/wine-1.7.48.tar.bz2 Binary packages for various distributions will be available from: @@ -27,432 +26,353 @@ ---------------------------------------------------------------- -Bugs fixed in 1.7.47 (total 48): +Bugs fixed in 1.7.48 (total 39): - 3077 WeatherScope: Right mouse button stuck - 6955 Multiple games need software vertex blending implementation (NOLF2, Divinity 2, Dark Age of Camelot, Warhammer Online, PSU:AOTI) - 9210 3DMark06 doesn't recognize Pixel Shaders 2.0 - 11499 sound effects not played correctly Battlefield 1942 - 15924 VT Trader freezes during login - 17402 Battlefield 2 runs unplayably slow (and mission loading takes longer) on ATi with GLSL - 17597 CharmTale2 crashes when releasing mshtml - 22384 DbgHelp doesn't support DWARF-2 on Mac OS X - 22579 Outlook Express does not show menu bar - 22782 Battlefield 1942: missing some textures inside vehicles - 24850 Explorer++ resets custom toolbar buttons on each startup - 25289 Civilization 4: fails with 'error loading shader libraries' unless native d3dx9_26 is used - 26262 No video output in Commandos - Behind Enemy lines - 27286 Source Insight: Crashes when jumping to function definition. - 28125 Microsoft 'ctfmon.exe' crashes on unimplemented function msctf.dll.TF_InitMlngInfo - 28875 NullDC 1.0.4 (Dreamcast emulator) crashes when starting system (shader 'register' keyword used at global scope) - 29326 Magicka crashes on audio init with winealsa.drv - 29636 QQ International crashes after login - 30686 Word 2010 Pro Plus adds spaces before umlauts - 31001 SecureCRT: could not write to the host key database file - 31156 Skyrim does not work with ENB - 31391 anarchy online game crashing after login - 33907 Civilization 4: missing some sound (could not read file) - 34945 AppleWin 1.23.0: CPU usage is very high when should be minimal - 35192 Multiple Adobe applications crash on unimplemented function KERNEL32.dll.CreateThreadpool (Vista+ API)(Lightroom 5.x, Creative Cloud) - 35789 Morrowind random crashes during game play. - 36164 valgrind shows an unitialized variable in programs/cmd/tests/batch.c - 36171 valgrind shows several leaks in winmm/waveform.c - 36194 valgrind shows some possible leaks in mmdevapi/tests/dependency.c - 36236 valgrind shows a leak in comctl32/tests/propsheet.c - 36265 valgrind shows a couple leaks in dmband/tests/dmband.c - 36270 valgrind shows several leaks in dmcompos/tests/dmcompos.c - 36271 valgrind shows several leaks in dmime/tests/dmime.c - 36273 valgrind shows several leaks in dmstyle/tests/dmstyle.c - 36357 valgrind shows a leak in dswave/tests/dswave.c - 36364 valgrind shows a few leaks in ieframe/tests/intshcut.c - 36837 Steam fallout new vegas error - 37306 Multiple applications trying to use Vista+ Thread Pool Timer API crash on startup with Wine configured as Vista or higher ('CreateThreadpoolTimer')(64-bit ApexDC 1.6.0, Watchtower Library 2014) - 38474 Quake Live launcher fails to start - 38492 vcrun2008 does not install via Winetricks under Kubuntu 15.04. Works in Kubuntu 14.04. - 38493 Steam steamwebhelper based on CEF 41.x crashes in Win7 mode (needs Kernel32.SetFileCompletionNotificationModes) - 38510 STDU (Scientific and Technical Documentation Utility) Viewer v1.6.375 crashes when opening PDF file (typelib information for marshaller from registry-free COM server) - 38660 NUMA Explorer crashes on unimplemented function KERNEL32.dll.GetNumaProcessorNode - 38714 64-bit ARM Windows applications from Windows SDK for Windows 10 crash in entry (loader needs to set/randomize security cookie for PE modules) - 38796 dwrite analyzer test crashes on my system - 38822 FotoSketcher Portable 3.00 reports 'Exception externe C06D007F' on startup when running as 'Windows Vista' or higher (wants UxTheme.dll 'DrawThemeTextEx') - 38832 Painting artifacts when moving a window that clips its children - 38864 Microsoft Lync Basic 2013 (MS Office 15.0) installer crashes + 11059 Sid Meier's Railroads Demo crashes on startup + 16519 EssentialPIM: Bold text not rendering correctly + 17506 Achtung die Kurve: Game doesn't start + 18191 Notepad corrupts files saved as utf-8 without a byte order mark (BOM) + 19289 Gtk+/Pango based applications have ugly font rendering or crash on startup + 19666 Multiple applications start wrong executable if whitespace present in name ('ShellExecute' doesn't quote executable name)(FoxitReader 3.0, GTA2 Manager) + 22399 Quake III Arena installer: Text area is scrolled at the bottom, and all text is selected + 26439 Chernobyl terrorist attack demo crashes on start + 27238 Tesla: The Weather Man demo: movement keys not working (GetKeyState should fallback to GetAsyncKeyState for threads without message queue) + 31063 Crash bug after finishing conversion in FormatFactory + 31643 Multiple games and applications crash on unimplemented function vcomp.dll._vcomp_fork (Gothic 3 demo, NeXTA) + 31984 Multiple games need d3dx9_36.dll.D3DXComputeTangentFrameEx (Starlaxis, Chernobyl Terrorist Attack Demo, The Endless Forest 3) + 32227 P2kCommander v6.0.0 crashes on startup (Wine's ungif reports app .gif image as broken) + 33153 DirectX11 games need d3d11.dll.D3D11CreateDeviceAndSwapChain (ARMA III Alpha, Strike Suit Zero, Stalker CoP, Perspective) + 33989 iexplore.exe crash when logging in to www.roblox.com + 34356 Multiple applications fail to install or crash on startup due gdiplus enumeration/query failure for GIF encoder support (Magnus 2011 translation dictionaries, Collectorz.com Movie Collector v9.x) + 34939 Dragon NaturallySpeaking does not run in 64-bit version + 34947 Creo Elements/Direct Modeling Express 4.0 InstallShield based installer shows oversized "installation completed" setup wizard window + 35493 IMVU shows loading bar, but will not start. + 35534 Oblivion: very loud/distorted/horrible collision sounds + 36336 NaturallySpeaking doesn't work with alsa or pasuspender + 36966 Turkey - Europe/Istanbul timezone is not detected + 37129 Clang Static Analyzer: Buffer overflow + 37281 Lord of The Rings Online: Crashes + 37449 Lexware Quicken 2014 Deluxe reports error 0x0000054f on startup (Promon Shield DRM needs RtlDecompressBuffer with COMPRESSION_FORMAT_LZNT1 support) + 38027 HyperStudio 5 (.NET 4.0 app) fails to start, reports 'tiff_get_decode_info unhandled grayscale sample count 2' + 38697 wineconsole: Cannot enable or disable Insert Mode through user dialog + 38712 win-key press incorrectly recognized + 38735 Windows Performance Analyzer from Windows SDK 8.1 Windows Performance Toolkit crashes due to 'IDWriteFontFace::GetGdiCompatibleGlyphMetrics' stub + 38806 Starcraft Campaign Editor does not scroll to bottom after copying a trigger + 38848 valgrind shows several uninitialized values in dmime/tests/dmime.c:test_track() + 38895 Multiple applications fail to load or crash due to incorrect security cookie randomization by loader (IrfanView WebP plugin, Word Viewer 2007) + 38904 Ufo Aftermath launcher hangs on start (missing "HKLM\Software\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers" registry key) + 38908 PlanetSide 2 v5.2.4.x launcher process exit causes wineserver crash + 38913 valgrind shows some definite leaks in d3drm/tests/d3drm.c: + 38914 valgrind shows uninitialized memory in dlls/dwrite/tests/layout.c + 38925 ipstats.c:1992 runtime error: index 32 out of bounds for type 'char [32]' + 38937 Bully: Scholarship Edition crashes on starting a new game (needs vcomp.dll._vcomp_for_static_simple_init implementation) + 38952 PDF-Xchange Viewer crashes when we launch OCR ---------------------------------------------------------------- -Changes since 1.7.46: +Changes since 1.7.47: -Aaryaman Vasishta (4): - d3drm/tests: Add test for IDirect3DRM*::CreateDeviceFromClipper. - d3drm: Fix function signature for IDirect3DRM3::CreateDeviceFromSurface. - d3drm/tests: Add test for IDirect3DRM*::CreateDeviceFromSurface. - d3drm/tests: Add test for IDirect3DRM*::CreateDeviceFromD3D. - -Alex Henrie (1): - cmd: Consistently wrap lines to 75 characters. - -Alexandre Julliard (8): - msvcirt/tests: Fix comparison with EOL. - include: Add ddk/ prefix when including ddk headers. - server: Pass the device client pointer as part of the IRP parameters. - server: Queue an IRP_MJ_CREATE request on file creation. - server: Queue an IRP_MJ_CLOSE request on file destruction. - ntoskrnl: Implement creation and destruction of file objects. - server: Pass the file instead of the device pointer in all IRP requests. - ntoskrnl: Forward IRP_MJ_CREATE and IRP_MJ_CLOSE requests to the loaded driver. - -Alistair Leslie-Hughes (2): - d3drm: Add DllCanUnloadNow, DllGetClassObject stubs. - gdiplus: GdipConvertToEmfPlus parameter succ is optional. - -André Hentschel (2): - ntdll: Silence warning about TAPE_GetStatus when sys/mtio.h is not available. - ntdll: Randomize security cookie when available. - -Aric Stewart (17): - hid: Implement HidP_GetCaps. - hid: Implement HidP_GetButtonCaps. - hid: Implement HidP_GetValueCaps. - hid: Implement HidP_GetUsages. - hid: Implement HidP_GetUsageValue. - hid: Implement HidP_InitializeReportForID. - hid: Implement HidD_GetPreparsedData and HidD_FreePreparsedData. - hid: Implement HidD_GetInputReport. - hid: Implement HidD_GetAttributes. - hid: Implement HidP_MaxUsageListLength. - hid: Implement HidP_GetScaledUsageValue. - wine.inf: Add Dev Class for HID devices. - include: Add ddk/hidport.h. - include: New ddk/hidtypes.h include file. - include: Add HID_XFER_PACKET and HID_REVISION to hidclass.h. - include: Add IRP_MJ_POWER minor function codes. - hidclass.sys: Add hidclass.sys. +Aaryaman Vasishta (6): + d3drm: Move AddRef from device2->device3. + d3drm: Move Release from device2->device3. + d3drm: Move QueryInterface from device2->device3. + d3drm/tests: Fix leaks while creating device in tests (Valgrind). + d3drm: Thunk relevant IDirect3DRMDevice2 stubs to version 3. + d3drm: Add stubs for IDirect3DRMDevice methods. + +Akihiro Sagawa (3): + po: Update Japanese translation. + po: Fix a mistake in Japanese translation. + mciseq: Ensure the player thread termination when stopping. + +Alasdair Sinclair (1): + ntdll: Add missing WINAPI to RtlDecompressFragment. + +Alex Henrie (3): + user32: Simplify if-else statement. + user32: Scroll listbox item completely into view on LB_SETCURSEL. + user32/tests: Correct spelling of "Invisible". + +Alexandre Julliard (2): + server: Don't associate a thread to the MJ_CREATE and MJ_CLOSE requests. + winebuild: Add DllMain to the list of functions that should be private. + +Alistair Leslie-Hughes (1): + include: Correct spelling of Tessellate. + +Andrew Cook (1): + server: Implement JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE. + +André Hentschel (10): + iphlpapi: Fix possible Out-of-bounds write (Coverity). + ws2_32: Pass correct buffer length to WS_inet_ntop (Coverity). + mcicda: Remove dead code (Coverity). + wordpad: Copy the correct amount of data with lstrcpynW (Coverity). + notepad: Use character count for GetFileTitleW (Coverity). + widl: Remove unused initializer (Clang). + krnl386.exe16: Remove unused initializers (Clang). + winedbg: Remove dead variable (Clang). + dwrite: Remove unused initializer (Clang). + winedump: Dump load config when available. -Austin English (2): - davclnt: Add stub dll. - d3d11: Add a stub for D3D11CreateDeviceAndSwapChain. +Aurimas Fišeras (1): + po: Update Lithuanian translation. -Bernhard Übelacker (8): - msi/tests: Test MsiSourceListEnumMediaDisks with volumeLabel and diskPrompt as NULL. - msi: Remove shortcut which calls RegEnumValueW with value and val_count as NULL. - mpr/tests: Add tests for WNetCachePassword and friends. - mpr: Call RegEnumValueA with valid value parameter. - dwrite: Call RegEnumValueW with value and val_count parameters. - regedit: Call RegEnumValueW with value and val_count parameters. - oleview: Call RegEnumValueW with value and val_count parameters. - advapi32: Fail in RegEnumValue on missing value or val_count parameters. - -Damjan Jovanovic (1): - ole32: Convey the Alt button state to the drop target. - -Daniel Lehman (3): - msvcp90: Copy name in _Getctype (Valgrind). - msvcp90: Make argument to _Locinfo__Getdays/months const. - msvcp110: Add export for facet dtor. - -Dmitry Timoshkov (3): - user32/tests: Add some tests to show that WS_CLIPCHILDREN doesn't exclude children from update region. - winex11: Don't call ExcludeUpdateRgn for a window with WS_CLIPCHILDREN style. - ole32: Accept STG_E_UNIMPLEMENTEDFUNCTION when ILockBytes implementation doesn't support locking. - -Gerald Pfeifer (1): - widl: Fix indentation in the EXPR_ADDRESSOF case in resolve_expression. - -Hans Leidekker (1): - msi/tests: Avoid test failures on win2k3. - -Henri Verbeet (10): - d2d1: Implement d2d_d3d_render_target_DrawGlyphRun(). - d2d1: Implement d2d_text_renderer_IsPixelSnappingDisabled(). - d2d1: Implement d2d_text_renderer_GetCurrentTransform(). - d2d1: Implement d2d_text_renderer_GetPixelsPerDip(). - include: Add Direct2D error codes to winerror.h. - d2d1: Only allow path geometries to be opened once. - d2d1: Implement d2d_geometry_sink_BeginFigure() and d2d_geometry_sink_EndFigure(). - d2d1: Implement d2d_path_geometry_GetFigureCount(). - d2d1: Implement d2d_path_geometry_GetSegmentCount(). - d2d1: Implement d2d_d3d_render_target_DrawText(). +Austin English (2): + loader: Add HKLM\Software\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers registry key. + winsta: Add initial winsta.h. -Hugh McMaster (1): - wineconsole: Add HKCU registry entries for Insert Mode. +Christian Costa (2): + d3dx9_36: Add stub for D3DXComputeTangentFrameEx. + d3dx9_36: Add stub for D3DXIntersect. + +Dan Kegel (2): + vcomp: Implement stub for _vcomp_fork. + vcomp/tests: Add additional tests for _vcomp_fork. + +Daniel Lehman (2): + msvcp90: Implement time_get ctors and dtors (Valgrind). + gdi32: Check for NULL pointer in GetOutlineTextMetrics. + +Dmitry Timoshkov (15): + kernel32: Fix compilation of loader tests with PSDK. + kernel32/tests: Add a loader test using minimal PE image that Windows7 is able to load. + ole32: Fix a memory leak. + include: Add support for NtCurrentTeb and PSDK compiler in 64-bit mode. + winex11.drv: On KeymapNotify event also sychronize WinKey state. + windowscodecs: Add support for 8bpp grayscale TIFF with 8bpp alpha. + gdiplus: Move the burden of supporting GIF encoding to the WIC backend. + windowscodecs/tests: Add some tests for loading truncated GIF images. + windowscodecs: Don't fail to decode GIF if an image has been already loaded. + ntdll: Cache contents of IMAGE_TLS_DIRECTORY instead of saving a directory pointer. + windowscodecs: Properly handle empty GIF extension blocks. + user32: Add a test to show that fonts returned by SystemParametersInfo(SPI_GETNONCLIENTMETRICS) should be listed by EnumFontFamilies(hdc, NULL). + gdi32: Add a test for enumerating substituted fonts. + gdi32: EnumFontFamilies should enumerate substituted fonts only when directly asked for. + user32: SystemParametersInfo(SPI_GETNONCLIENTMETRICS) should return real font names. + +Erich Hoover (2): + ntoskrnl.exe: Improve IoGetDeviceObjectPointer stub to appease SecuROM 5.x. + ntdll: Only set the security cookie if it has not already been set. + +Frédéric Delanoy (2): + wineconsole: Leave more room for translations in resource file. + po: Update French translation. + +Hans Leidekker (19): + msi: Check the return value of MSI_QueryGetRecord (Coverity). + msi: Fix a couple of memory leaks (Coverity). + msi: Add a stub implementation of MsiJoinTransaction. + msi/tests: Avoid another test failure on win2k3. + ieframe: Implement IViewObject::GetAdvise and IViewObject::SetAdvise. + ieframe: Never pass a NULL string pointer with DISPID_STATUSTEXTCHANGE. + user32: Add a stub implementation of UnregisterPowerSettingNotification. + user32: Return a fake handle from RegisterPowerSettingNotification. + server: Make returning used privileges optional in token_access_check. + msi/tests: Mark a test result on win2k3 as broken. + wininet/tests: Include the error code in a failure message. + davclnt: Add stub implementations of DavRegisterAuthCallback and DavUnregisterAuthCallback. + iphlpapi: Add a partial implementation of CreateSortedAddressPairs. + iphlpapi: Implement a couple of interface identifier conversion functions. + include: Add definition of MIB_IF_ROW2. + iphlpapi: Implement GetIfEntry2. + netprofm: Create a connection point object for INetworkCostManagerEvents. + netprofm: Improve the stub for INetworkCostManager::GetDataPlanStatus. + netapi32: Implement DavGetHTTPFromUNCPath. + +Henri Verbeet (18): + d2d1: Implement d2d_factory_CreateRectangleGeometry(). + d2d1: Also bind the pixel shader and blend state in d2d_brush_bind_resources(). + d2d1: Introduce a separate function to construct pixel shader constant buffers for brushes. + d2d1: Implement d2d_d3d_render_target_FillGeometry(). + d2d1: Implement d2d_geometry_sink_AddLines(). + d2d1: Properly trace "vertex_count" in d2d_path_geometry_triangulate(). + d2d1/tests: Don't call compare_surface() inside ok(). + d2d1: Implement d2d_geometry_sink_SetFillMode(). + d2d1: Implement initial support for drawing bezier curves. + d2d1: Add some FIXMEs for unimplemented functionality to d2d_d3d_render_target_DrawGlyphRun(). + d3d10core: Implement d3d10_device_CopySubresourceRegion(). + d2d1: Add a missing TRACE to d2d_d3d_render_target_FillRectangle(). + d2d1: Implement d2d_d3d_render_target_FillRoundedRectangle(). + d2d1: Implement d2d_d3d_render_target_FillEllipse(). + d2d1: Fix the bitmap DPI scale for bitmap brushes. + d2d1: Implement d2d_d3d_render_target_GetPixelFormat(). + include: Add WIC error codes to winerror.h. + d2d1: Also infer the alpha mode in d2d_d3d_render_target_CreateBitmapFromWicBitmap(). + +Hugh McMaster (3): + wineconsole: Rearrange user dialog to make room for new controls and improve resource strings. + wineconsole: Allow users to enable or disable Insert Mode via the user dialog. + kernel32: Enabling/disabling Insert Mode via the user dialog should take effect immediately. Huw D. M. Davies (15): - comctl32: Add helpers to set the button text. - comctl32: Add a helper to free button text. - comctl32: Don't leak button text. - comctl32: Implement toolbar saving. - comctl32: The number of buttons is set by the first TBN_RESTORE notification. - comctl32: All negative entries in the toolbar save state are special cases. - comctl32: Reset the string and lparam fields between notifications. - riched20: Free the script cache when updating the default style. - comctl32: Set the default separator width when notifying a -ve cmd id. - comctl32: Implement the legacy notifications during restore. - dwrite/tests: Add tests for GetGdiCompatibleMetrics. - comctl32/tests: Extra WM_PAINT messages are occasionally sent on Vista and Win 7. - shell32/tests: Win XP splits the args if there are spaces in the path. - shell32/tests: Win 2k doesn't cope with spaces in the path. - shell32: Fix threading model for the Known Folder Manager and Shell Link objects. - -Iván Matellanes (6): - msvcirt: Add implementation of streambuf::pbackfail. - msvcirt: Add implementation of streambuf::sputbackc. - msvcirt: Add implementation of streambuf::dbp. - msvcirt: Add stub of class ios. - msvcirt/tests: Add initial tests for ios. - msvcirt: Implement ios constructors and assignment. - -Jacek Caban (12): - user32: Limit number of hooks called recursively. - mshtml: Initialize output paramter before test call. - vbscript: Treat empty regexp pattern the same way as NULL pattern. - msscript.ocx: Added IScriptControl stub implementation. - mshtml: Added support for binding XHR events. - wincrypt.h: Added some missing constants. - secur32: Added SECPKG_ATTR_SUPPORTED_ALGS tests. - mshtml: Added nsIIOService::NewChannelFromURI2 semi-stub implementation. - msscript.ocx: Added support for IDispatch functions. - dvdmedia.h: Added AMINTERLACE_* defines. - wincodec.idl: Added missing GUID_WICPixelFormat32bpp* declarations. - shdocvw: Call DisableThreadLibraryCalls in DllMain. - -Józef Kucia (4): - wined3d: Show fixme about unimplemented vertex processing once. - wined3d: Implement vertex blending in glsl_vertex_pipe. - wined3d: Implement normals transformation for vertex blending. - d3d9/tests: Add basic tests for vertex blending. - -Ken Thomases (4): - dbghelp: Fix mapping of DWARF register numbers on x86 OS X. - dbghelp: Don't parse the DWARF info from Mach-O files if we were requested to only provide public symbols. - dbghelp: Add support for loading an external DWARF debug info file associated with a Mach-O module. - Revert "configure: Prefer stabs debug info on Mac OS.". - -Matteo Bruni (12): - wined3d: Fix GLSL backend with non-GLSL vertex and pixel pipeline combination. - wined3d: Replace an open-coded implementation of LIST_FOR_EACH_ENTRY_SAFE. - wined3d: Fix NP2 fixups in GLSL fragment FFP replacement. - wined3d: Improve NP2 fixups in GLSL PS texture sampling code. - wined3d: Don't hardcode WINED3DPTEXTURECAPS_NONPOW2CONDITIONAL cap flag. - wined3d: Use a lookup table to select the sampler function name. - wined3d: Use a core-compatible GL format for ATI2N. - wined3d: Use the correct texture coordinates in swapchain_blit() in the non-glBlitFramebuffer, NP2 case. - wined3d: Add a setting for the maximum OpenGL version to use. - wined3d: Use GLSL 1.50 on core contexts. - d3d9/tests: Add a test for UpdateTexture. - d3d8/tests: Add a test for UpdateTexture. - -Michael Müller (3): - msvcrt/tests: Add additional tests for atof / strtod functions. - kernel32/tests: Add tests for GetNumaProcessorNode. - kernel32: Implement GetNumaProcessorNode. - -Michael Stefaniuc (78): - dmstyle: Move struct definitions to the files that need them. - dmstyle: Remove unused DirectMusicMelodyFormulationTrack stuff. - dmcompos: COM cleanup for IDirectMusicTrack8 of DMChordMapTrack. - dmcompos: Remove the extraneous IUnknown from DMChordMapTrack. - dmcompos: Use the generic IPersistStream for DMChordMapTrack. - dmcompos: COM cleanup for IDirectMusicTrack8 of DMSignPostTrack. - dmcompos: Remove the extraneous IUnknown from DMSignPostTrack. - dmcompos: Use the generic IPersistStream for DMSignPostTrack. - dmcompos: Mark IPersistStream_Save of DMSignPostTrack as a stub. - dmband: Add missing TRACE to QI. - dmusic: Remove old and ugly COM macros. - dmstyle: Implement the E_NOTIMPL methods of IDirectMusicTrack8. - dmstyle/tests: Add some basic DirectMusicTrack8 tests. - dmstyle: COM cleanup for IDirectMusicTrack8 of DMMuteTrack. - dmstyle: Remove the extraneous IUnknown from DMMuteTrack. - dmstyle: Use the generic IPersistStream for DMMuteTrack. - dmstyle: COM cleanup for IDirectMusicTrack8 of DMAuditionTrack. - dmstyle: Remove the extraneous IUnknown from DMAuditionTrack. - dmstyle: Use the generic IPersistStream for DMAuditionTrack. - dmstyle: COM cleanup for IDirectMusicTrack8 of DMMotifTrack. - dmstyle: Remove the extraneous IUnknown from DMMotifTrack. - dmstyle: Use the generic IPersistStream for DMMotifTrack. - kernel32/tests: The result of a comparison is already a BOOL. - explorer: Print the debug string and not the pointer to it. - riched20: Print the debug string and not the pointer to it. - dmstyle: Pass objects instead of ifaces to helpers. - dmstyle: COM cleanup for IDirectMusicTrack8 of DMCommandTrack. - dmstyle: Remove the extraneous IUnknown from DMCommandTrack. - dmstyle: Use the generic IPersistStream for DMCommandTrack. - dmstyle: COM cleanup for IDirectMusicTrack8 of DMChordTrack. - dmstyle: Remove the extraneous IUnknown from DMChordTrack. - dmstyle: Use the generic IPersistStream for DMChordTrack. - dmstyle: COM cleanup for IDirectMusicTrack8 of DMStyleTrack. - dmstyle: Remove the extraneous IUnknown from DMStyleTrack. - dmstyle: Use the generic IPersistStream for DMStyleTrack. - dmstyle: Mark IPersistStream_Save() as stub. - dmime: Pass objects instead of ifaces to helpers. - dmime: DMMarkerTrack doesn't have IDirectMusicTrack8. - dmime: DMTimeSigTrack doesn't have IDirectMusicTrack8. - dmime/tests: Deal with DMTrack objects without IDirectMusicTrack8. - dmime: COM cleanup for IDirectMusicTrack of DMMarkerTrack. - dmime: Remove the extraneous IUnknown from DMMarkerTrack. - dmime: Use the generic IPersistStream for DMMarkerTrack. - dmime: COM cleanup for IDirectMusicTrack of DMTimeSigTrack. - dmime: Remove the extraneous IUnknown from DMTimeSigTrack. - dmime: Use the generic IPersistStream for DMTimeSigTrack. - dmstyle/tests: Remove skips wrongly copied from the dmime tests. - dmime: Implement the E_NOTIMPL methods of IDMTrack8 for DMSeqTrack. - dmime: Implement the E_NOTIMPL methods of IDMTrack8 for DMSysExTrack. - dmime: COM cleanup for IDirectMusicTrack of DMSeqTrack. - dmime: Remove the extraneous IUnknown from DMSeqTrack. - dmime: Use the generic IPersistStream for DMSeqTrack. - dmime: COM cleanup for IDirectMusicTrack of DMSysExTrack. - dmime: Remove the extraneous IUnknown from DMSysExTrack. - dmime: Use the generic IPersistStream for DMSysExTrack. - dmime: Implement the E_NOTIMPL methods in DMLyricsTrack. - dmime: COM cleanup for IDirectMusicTrack of DMLyricsTrack. - dmime: Remove the extraneous IUnknown from DMLyricsTrack. - dmime: Use the generic IPersistStream for DMLyricsTrack. - dmime: Implement the E_NOTIMPL methods in DMParamControlTrack. - dmime: COM cleanup for IDirectMusicTrack of DMParamControlTrack. - dmime: Remove the extraneous IUnknown from DMParamControlTrack. - dmime: Use the generic IPersistStream for DMParamControlTrack. - dmime: Implement the E_NOTIMPL methods in DMWaveTrack. - dmime: COM cleanup for IDirectMusicTrack of DMWaveTrack. - dmime: Remove the extraneous IUnknown from DMWaveTrack. - dmime: Use the generic IPersistStream for DMWaveTrack. - dmime: Implement the remaining E_NOTIMPL methods of IDirectMusicTrack8. - dmime/tests: Add some basic IDirectMusicTrack8 tests. - dmime: COM cleanup for IDirectMusicTrack of DMSegTriggerTrack. - dmime: Remove the extraneous IUnknown from DMSegTriggerTrack. - dmime: Use the generic IPersistStream for DMSegTriggerTrack. - dmime: COM cleanup for IDirectMusicTrack of DMTempoTrack. - dmime: Remove the extraneous IUnknown from DMTempoTrack. - dmime: Use the generic IPersistStream for DMTempoTrack. - dmsynth: Remove a now unused macro. - dmstyle: Remove an unused variable. - dmstyle: Remove a not very useful macro. - -Nikolay Sivov (37): - user32: Added stubs for ShutdownBlockReasonCreate/ShutdownBlockReasonDestroy. - gdiplus: Check GetMetadataFormat() return value (Coverity). - ole32: Handle EnumElements() failure (Coverity). - shell32: Fix memory leak on NULL return length (Coverity). - winecfg: Fix a leak when applying drive changes (Coverity). - winecfg: Fix string buffer length for override settings (Valgrind). - oleaut32: Use context redirects when creating typelib marshaler proxy/stub. - gdi32: Add a separate helper to load FT_Short values (Coverity). - kernel32: Simplify the way EnumCalendarInfo vs EnumCalendarInfoEx are handled internally. - kernel32: Implement EnumCalendarInfoExEx(). - qmgr: Fix WINHTTP_OPTION_CONTEXT_VALUE data pointer (Coverity). - dwrite: Update current line count when adding metrics for new line. - dwrite: Fix number of clusters effective run is built on. - dwrite: Clip range length to text length when updating breakpoints. - dwrite: Always set canWrapLineAfter for last cluster. - gdi32: Clarify offsets and sizes in vdmx table lookup code. - dwrite: Initial layout GetMetrics() implementation. - dwrite: Add last cluster width to line width. - uxtheme: Partial implementation of DrawThemeTextEx. - dwrite: Store layout width/height directly in metrics structure. - dwrite: Reset calculated text height before updating it. - dwrite: Remove separate line count layout field. - dwrite: Make it possible to set text alignment on created layout. - dwrite: Implement leading and trailing text alignment modes. - dwrite: Implement paragraph alignment. - dwrite/tests: Test that pair kerning affects shaping. - shell32: Handle string-to-guid conversion errors (Coverity). - gdiplus: Remove always true condition (Coverity). - shell32/tests: Try harder to close Open With window. - dwrite: Remove a couple of useless checks. - dwrite: Implement centered text alignment. - dwrite: Implement GetPanose(). - dwrite/tests: Extend GetGdiCompatibleMetrics() test to test DWRITE_FONT_METRICS1 as well. - dwrite: Implement GetGdiCompatibleMetrics(). - dwrite: Implement SetReadingDirection() for layout. - dwrite: Fix alignment shifts in RTL case. - dwrite: Properly set run origin in DWRITE_READING_DIRECTION_RIGHT_TO_LEFT case. - -Olivier F. R. Dierick (2): - kernel32: Fail gracefully in K32EnumProcessModules with NULL pointer. - psapi/tests: Add test for EnumProcessModules with NULL pointer. - -Piotr Caban (4): - msvcirt: Fix ostrstream::ostrstream() constructor stub. - msvcrt: Add ismbblead_l implementation. - msvcrt: Add _mbscat_s_l implementation. - msvcirt: Fix leak in ~ios and ios::init implementation. - -Sebastian Lackner (51): - msvcrt: Set *end to NULL when strtod is called with NULL pointer string. - windowscodecs: Distinguish interface and implementation pointer for IcnsEncoder. - windowscodecs: Fix build failure on OSX. - ntdll: Implement TpSimpleTryPost and basic threadpool infrastructure. - ntdll: Implement TpSetPoolMaxThreads. - ntdll: Implement TpSetPoolMinThreads. - ntdll: Implement threadpool cleanup group functions. - ntdll/tests: Add tests for TpAllocCleanupGroup and related functions. - ntdll: Implement threadpool work item functions. - ntdll/tests: Add basic tests for threadpool work items. - ntdll/tests: Add threadpool scheduler tests for work items. - ntdll: Add support for threadpool group cancel callback. - ntdll/tests: Add tests for threadpool group cancel callback. - ntdll: Add support for threadpool finalization callback. - ntdll: Implement threadpool RaceDll environment variable. - ntdll: Implement instance objects and the TpCallbackMayRunLong function. - ntdll: Implement TpCallbackLeaveCriticalSectionOnCompletion. - ntdll: Implement TpCallbackReleaseMutexOnCompletion. - ntdll: Implement TpCallbackReleaseSemaphoreOnCompletion. - ntdll/tests: Add tests for TpCallbackReleaseSemaphoreOnCompletion and finalization callback. - ntdll: Implement TpCallbackSetEventOnCompletion. - ntdll: Implement TpCallbackUnloadDllOnCompletion. - ntdll: Implement TpDisassociateCallback and add a separate group completion event. - ntdll/tests: Add tests for TpDisassociateCallback. - ntdll: Implement TpAllocTimer and TpReleaseTimer. - ntdll: Implement threadpool timer queues. - ntdll/tests: Add basic tests for threadpool timer functions. - ntdll/tests: Add tests for threadpool timer merging. - kernel32: Forward threadpool cleanup group functions to ntdll. - kernel32: Forward threadpool work functions to ntdll. - kernel32: Forward threadpool timer functions to ntdll. - kernel32: Forward threadpool instance functions to ntdll. - kernel32: Forward remaining threadpool functions to ntdll. - kernel32/tests: Fix leak of threadpool object. - ntdll: Implement TpAllocWait and TpReleaseWait. - ntdll: Implement threadpool wait queues. - ntdll: Implement TpSetWait and TpWaitForWait. - ntdll/tests: Add basic tests for threadpool wait objects. - ntdll/tests: Add threadpool wait tests with more than 63 objects. - ntdll: Try to merge threadpool wait queue buckets if possible. - kernel32: Forward threadpool wait functions to ntdll. - ntdll: Add missing calls to RtlExitUserThread. - ntdll/tests: Add tests for RtlCompressBuffer. - ntdll: Implement semi-stub for LZNT1 compression in RtlCompressBuffer. - ntdll/tests: Add tests for RtlGetCompressionWorkSpaceSize. - ntdll: Implement semi-stub for RtlGetCompressionWorkSpaceSize. - ntdll: Implement RtlDecompressFragment. - ntdll/tests: Add tests for RtlDecompressBuffer. - ntdll/tests: Add tests for RtlDecompressFragment. - user32/tests: Add tests for calling GetKeyState from thread without message queue. - server: Add fallback to desktop keystate in get_key_state wineserver call. - -Thomas Faber (7): - shell32/tests: Do not leak shell folder references. - shell32: Add missing parameter check in ISF_Desktop_fnQueryInterface. - shell32: Use QueryInterface in FolderView_GetFolder. - shell32/tests: Remove a misleading test. - shell32/tests: Fix an ok() print. - shell32/tests: Destroy shell view windows. - shell32/tests: Test that shell view windows reference their shell view. - -Vincent Povirk (3): - winex11.drv: Track external changes to _NET_WM_STATE in net_wm_state. - ole32: Add a storage test using a custom ILockBytes. - ole32: Use grfLocksSupported to decide when LockRegion is implemented. - -YongHao Hu (3): - msvcp110: Add tr2_sys__Copy_file implementation and test. - msvcp110: Add tr2_sys__Rename implementation and test. - msvcp110: Add tr2_sys__Statvfs implementation and test. - -Zhenbo Li (5): - mshtml: Add IHTMLXMLHttpRequestFactory::create() method implementation. - mshtml: Add IHTMLXMLHttpRequest:open() method implementation. - mshtml: Add IHTMLXMLHttpRequest::readyState property implementation. - mshtml/tests: Wait for the document to be completely loaded. - mshtml: Add IHTMLXMLHttpRequest::send() method implementation. + rpcrt4: Initialize CorrDespIncrement to zero and mark the pre-Vista behaviour as broken. + rpcrt4: Set CorrDespIncrement to the size of the (non-range) /robust payload. + rpcrt4: Add missing calls to NdrCorrelationInitialize/Free. + rpcrt4: Use CorrDespIncrement to skip over the correlation descriptor. + rpcrt4: Procedures containing a range within a conformance have a larger correlation descriptor. + msi: Fix a registry key leak. + msi: Be more selective about which access modes are used to open or create keys. + advapi32: Don't call CloseServiceHandle() with an invalid handle. + msi: Don't call CloseServiceHandle() with an invalid handle. + net: Don't call CloseServiceHandle() with an invalid handle. + wbemprox: Don't call CloseServiceHandle() with an invalid handle. + mshtml/tests: Fix a crash on Win 2008. + winhttp: Fix a reference leak. + winhttp: Don't wait for the task thread to exit. + winhttp: Implement WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT. + +Iván Matellanes (21): + msvcirt: Implement ios locking control. + msvcirt: Implement ios object locking. + msvcirt: Implement ios stream locking. + msvcirt: Implement ios static locking. + msvcirt: Implement ios::flags. + msvcirt: Implement ios::setf. + msvcirt: Implement ios::unsetf. + msvcirt: Implement ios::fill. + msvcirt: Implement ios::precision. + msvcirt: Implement ios::width. + msvcirt: Implement ios::tie. + msvcirt: Implement ios::rdbuf. + msvcirt: Implement ios::delbuf. + msvcirt: Implement ios status-testing functions. + msvcirt: Implement ios operators. + msvcirt: Add ios format flag masks. + msvcirt: Implement ios manipulators. + msvcirt: Implement ios::bitalloc. + msvcirt: Add support for ios state variables. + msvcirt: Add ios instance counter. + msvcirt: Correct the statebuf array exports. + +Jacek Caban (7): + ieframe: Allow travellog buffer to grow even if we're loading from the history. + ieframe: Fixed invalid COM object usage. + widl: Don't output C++ default value if the argument is followed by another without default value. + include: Added inspectable.idl file. + ieframe: Release client site interface before destroying embedding window. + ieframe: Added support for OnFocus notifications. + ieframe: Improved debug traces. + +Jactry Zeng (2): + gdi32: Add a helper to map font replacement. + gdi32: Add multiple font replacement support. + +Jarkko Korpi (1): + widl: Increase buffer size in typegen.c. + +Julian Rüger (1): + po: Update German translation. + +Lauri Kenttä (1): + po: Update Finnish translation. + +Matteo Bruni (8): + wined3d: Make the core extensions enabling table-based. + wined3d: Add more entries to the core extensions table. + wined3d: Bind a VAO when using core profile contexts. + wined3d: Avoid glBegin() / glEnd() in check_fbo_compat() when possible. + wined3d: Don't run check_filter() on core contexts. + wined3d: Allow to apply extension emulation wrappers independently. + wined3d: Don't crash when emulating GL_EXT_fogcoord. + wined3d: Only install emulation wrappers when required. + +Michael Müller (1): + aclocal.m4: Search for otool using AC_CHECK_TOOL. + +Michael Stefaniuc (6): + include: Add IAMVfwCaptureDialogs declaration. + qcap: Remove initialization code from QI of VfwCapture. + qcap: There can be only ONE QueryInterface in VfwCapture!. + qcap: Support COM aggregation in VfwCapture. + qcap/tests: Add COM tests for VfwCapture. + wined3d: Merge two adjacent ifs with identical condition (PVS-Studio). + +Nikolay Sivov (30): + dwrite: Implement pixel snapping in Draw(). + dwrite: Check GetGdiCompatibleMetrics() return value (Coverity). + dwrite: Implement SetWordWrapping() for layout. + dwrite: Handle negative emsize in GetGdiCompatibleMetrics(). + dwrite: Implement GetMetrics() for trimming sign. + dwrite: Remove excessive tracing when forwarding to IDWriteTextFormat1. + dwrite: Fix EndFigure notification in GetGlyphRunOutline(). + po: Update Russian translation. + dwrite: Make sure explicit levels are always initialized (Valgrind). + dwrite/tests: Fix trimming sign instance leak (Valgrind). + dwrite: Fix transform matrix usage for pixel snapping. + dwrite: Partially implement GetGdiCompatibleGlyphAdvances(). + dwrite: Partial implementation of GetGdiCompatibleGlyphMetrics(). + dwrite: Properly pass measuring mode to renderer. + dwrite/tests: Some tests for CreateGdiCompatibleTextLayout(). + dwrite: Round advances returned from GetGdiCompatibleGlyphPlacements(). + dwrite: Fix vector transformation in GetGlyphOrientationTransform(). + dwrite: Aliased texture could only be requested for aliased rendering mode. + dwrite: Improve parameter validation in GetGdiCompatibleGlyphAdvances(), add some tests. + dwrite/tests: Some tests for bounds returned by GetAlphaTextureBounds(). + dwrite: Round centered alignment shift for compatible layouts. + dwrite/tests: Some tests for isNewline clusters. + dwrite: Bitmap render target uses top-down DIB. + dwrite: Update cached bitmap size on Resize() as well. + shell32: Added GetCurrentProcessExplicitAppUserModelID() stub. + webservices: Added WsCreateError stub. + user32: Initialize buffer before sending WM_GETTEXT. + user32: Don't send WM_GETTEXT from GetWindowText() with invalid buffer length. + dwrite/tests: Some tests for GetRecommendedRenderingMode(). + dwrite: Implement GetRecommendedRenderingMode(). + +Piotr Caban (6): + shell32: Remove code for separating arguments from file path. + shell32: Handle executable with space in path in SHELL_execute. + shell32: Fix SHELL_execute code that removes quote arround file name. + msvcrt: Don't call DeleteCriticalSection on static critical section. + winemac.drv: Release mouse capture when destroying window specified in SetCapture call. + mshtml: Test body.offsetHeight value in quirks mode. + +Qian Hong (1): + kernel32: Fix GetComputerName buffer overflow. + +Sebastian Lackner (30): + ntdll: Fix incorrect assignment in assert statement (Coverity). + dwrite: Avoid dereferencing NULL pointer for fonts without VDMX. + vcomp: Implement omp_get_max_threads and omp_set_num_threads. + vcomp: Implement omp_{get,set}_nested. + vcomp: Implement _vcomp_set_num_threads and omp_get_thread_num. + server: Avoid sending unexpected wakeup with uninitialized cookie value. + kernel32/tests: Repeat test for SignalObjectAndWait multiple times to test wineserver wakeup cookie management. + configure: Do not assume gcc strength reduce bug when cross-compiling. + shell32: Ensure that commandline is null-terminated when no parameters are given. + ntdll: Avoid possible deadlock by using _exit() in NtTerminateProcess. + vcomp: Add multithreaded implementation for _vcomp_fork. + vcomp: Implement _vcomp_barrier. + vcomp/tests: Add initial tests. + vcomp: Implement _vcomp_sections_init and _vcomp_sections_next. + vcomp/tests: Add tests for vcomp sections. + vcomp: Allow calls to _vcomp_sections_init outside of parallel environment. + vcomp: Fix handling of _vcomp_fork with ifval == FALSE. + vcomp: Implement omp_in_parallel and add tests. + vcomp: Implement _vcomp_for_static_simple_init and _vcomp_for_static_end. + vcomp/tests: Add tests for _vcomp_for_static_simple_init. + vcomp: Implement _vcomp_for_static_init. + vcomp/tests: Add tests for _vcomp_for_static_init. + ntdll/tests: Add basic tests for RtlQueueWorkItem. + ntdll: Reimplement RtlQueueWorkItem on top of new threadpool API. + vcomp: Implement 32-bit atomic integer functions. + vcomp/tests: Add tests for 32-bit atomic integer functions. + vcomp: Implement atomic float functions. + vcomp/tests: Add tests for atomic float functions. + vcomp: Implement atomic double functions. + vcomp/tests: Add tests for atomic double functions. + +Vincent Povirk (1): + winex11.drv: Don't change net_wm maximized state for minimized windows. + +YongHao Hu (1): + msvcp110: Fix TRACE msg of tr2 functions. + +Zhenbo Li (3): + mshtml: Add IHTMLXMLHttpRequest::responseText() method implementation. + mshtml: Add IHTMLXMLHttpRequest::status property implementation. + mshtml: Add nsChannel_GetResponseStatusText implementation. -- Alexandre Julliard diff -Nru wine-staging-1.7.47~ubuntu12.04.1/AUTHORS wine-staging-1.7.48~ubuntu12.04.1/AUTHORS --- wine-staging-1.7.47~ubuntu12.04.1/AUTHORS 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/AUTHORS 2015-07-29 19:28:54.000000000 +0000 @@ -601,6 +601,7 @@ Jan Zerebecki Jared Lapsley Jared Smudde +Jarkko Korpi Jaroslav Šmíd Jaroslaw Piotr Sobieszek Jason Edmeades diff -Nru wine-staging-1.7.47~ubuntu12.04.1/configure wine-staging-1.7.48~ubuntu12.04.1/configure --- wine-staging-1.7.47~ubuntu12.04.1/configure 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/configure 2015-07-29 19:28:54.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Wine 1.7.47. +# Generated by GNU Autoconf 2.69 for Wine 1.7.48. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='1.7.47' -PACKAGE_STRING='Wine 1.7.47' +PACKAGE_VERSION='1.7.48' +PACKAGE_STRING='Wine 1.7.48' PACKAGE_BUGREPORT='wine-devel@winehq.org' PACKAGE_URL='http://www.winehq.org' @@ -705,6 +705,7 @@ LOADER_RULES ALL_TEST_RESOURCES READELF +OTOOL LDD LDRPATH_LOCAL LDRPATH_INSTALL @@ -2041,7 +2042,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Wine 1.7.47 to adapt to many kinds of systems. +\`configure' configures Wine 1.7.48 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2110,7 +2111,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.7.47:";; + short | recursive ) echo "Configuration of Wine 1.7.48:";; esac cat <<\_ACEOF @@ -2306,7 +2307,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.7.47 +Wine configure 1.7.48 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2824,7 +2825,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Wine $as_me 1.7.47, which was +It was created by Wine $as_me 1.7.48, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -7127,6 +7128,98 @@ if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL="otool" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + +if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args. set dummy ${ac_tool_prefix}readelf; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -9532,7 +9625,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_X11=`$ac_cv_path_LDD conftest.exe | grep "X11" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_X11=`otool -L conftest$ac_exeext | grep "libX11\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libX11\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_X11=`$OTOOL -L conftest$ac_exeext | grep "libX11\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libX11\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_X11=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libX11\\.$LIBEXT" | sed -e "s/^.*\\[\\(libX11\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_X11:+false} :; then : ac_cv_lib_soname_X11=`$LDD conftest$ac_exeext | grep "libX11\\.$LIBEXT" | sed -e "s/^.*\(libX11\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -9585,7 +9678,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_Xext=`$ac_cv_path_LDD conftest.exe | grep "Xext" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xext=`otool -L conftest$ac_exeext | grep "libXext\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXext\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_Xext=`$OTOOL -L conftest$ac_exeext | grep "libXext\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXext\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_Xext=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXext\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXext\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_Xext:+false} :; then : ac_cv_lib_soname_Xext=`$LDD conftest$ac_exeext | grep "libXext\\.$LIBEXT" | sed -e "s/^.*\(libXext\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -9721,7 +9814,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_Xcursor=`$ac_cv_path_LDD conftest.exe | grep "Xcursor" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xcursor=`otool -L conftest$ac_exeext | grep "libXcursor\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXcursor\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_Xcursor=`$OTOOL -L conftest$ac_exeext | grep "libXcursor\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXcursor\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_Xcursor=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXcursor\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXcursor\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_Xcursor:+false} :; then : ac_cv_lib_soname_Xcursor=`$LDD conftest$ac_exeext | grep "libXcursor\\.$LIBEXT" | sed -e "s/^.*\(libXcursor\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -9786,7 +9879,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_Xi=`$ac_cv_path_LDD conftest.exe | grep "Xi" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xi=`otool -L conftest$ac_exeext | grep "libXi\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXi\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_Xi=`$OTOOL -L conftest$ac_exeext | grep "libXi\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXi\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_Xi=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXi\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXi\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_Xi:+false} :; then : ac_cv_lib_soname_Xi=`$LDD conftest$ac_exeext | grep "libXi\\.$LIBEXT" | sed -e "s/^.*\(libXi\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -9971,7 +10064,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_Xxf86vm=`$ac_cv_path_LDD conftest.exe | grep "Xxf86vm" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xxf86vm=`otool -L conftest$ac_exeext | grep "libXxf86vm\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXxf86vm\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_Xxf86vm=`$OTOOL -L conftest$ac_exeext | grep "libXxf86vm\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXxf86vm\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_Xxf86vm=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXxf86vm\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXxf86vm\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_Xxf86vm:+false} :; then : ac_cv_lib_soname_Xxf86vm=`$LDD conftest$ac_exeext | grep "libXxf86vm\\.$LIBEXT" | sed -e "s/^.*\(libXxf86vm\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -10036,7 +10129,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_Xrender=`$ac_cv_path_LDD conftest.exe | grep "Xrender" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xrender=`otool -L conftest$ac_exeext | grep "libXrender\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXrender\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_Xrender=`$OTOOL -L conftest$ac_exeext | grep "libXrender\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXrender\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_Xrender=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXrender\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXrender\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_Xrender:+false} :; then : ac_cv_lib_soname_Xrender=`$LDD conftest$ac_exeext | grep "libXrender\\.$LIBEXT" | sed -e "s/^.*\(libXrender\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -10198,7 +10291,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_Xrandr=`$ac_cv_path_LDD conftest.exe | grep "Xrandr" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xrandr=`otool -L conftest$ac_exeext | grep "libXrandr\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXrandr\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_Xrandr=`$OTOOL -L conftest$ac_exeext | grep "libXrandr\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXrandr\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_Xrandr=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXrandr\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXrandr\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_Xrandr:+false} :; then : ac_cv_lib_soname_Xrandr=`$LDD conftest$ac_exeext | grep "libXrandr\\.$LIBEXT" | sed -e "s/^.*\(libXrandr\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -10295,7 +10388,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_Xinerama=`$ac_cv_path_LDD conftest.exe | grep "Xinerama" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xinerama=`otool -L conftest$ac_exeext | grep "libXinerama\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXinerama\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_Xinerama=`$OTOOL -L conftest$ac_exeext | grep "libXinerama\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXinerama\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_Xinerama=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXinerama\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXinerama\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_Xinerama:+false} :; then : ac_cv_lib_soname_Xinerama=`$LDD conftest$ac_exeext | grep "libXinerama\\.$LIBEXT" | sed -e "s/^.*\(libXinerama\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -10362,7 +10455,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_Xcomposite=`$ac_cv_path_LDD conftest.exe | grep "Xcomposite" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_Xcomposite=`otool -L conftest$ac_exeext | grep "libXcomposite\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXcomposite\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_Xcomposite=`$OTOOL -L conftest$ac_exeext | grep "libXcomposite\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXcomposite\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_Xcomposite=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libXcomposite\\.$LIBEXT" | sed -e "s/^.*\\[\\(libXcomposite\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_Xcomposite:+false} :; then : ac_cv_lib_soname_Xcomposite=`$LDD conftest$ac_exeext | grep "libXcomposite\\.$LIBEXT" | sed -e "s/^.*\(libXcomposite\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -10455,7 +10548,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_GL=`$ac_cv_path_LDD conftest.exe | grep "GL" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_GL=`otool -L conftest$ac_exeext | grep "libGL\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_GL=`$OTOOL -L conftest$ac_exeext | grep "libGL\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_GL=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libGL\\.$LIBEXT" | sed -e "s/^.*\\[\\(libGL\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_GL:+false} :; then : ac_cv_lib_soname_GL=`$LDD conftest$ac_exeext | grep "libGL\\.$LIBEXT" | sed -e "s/^.*\(libGL\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -10497,7 +10590,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_GL=`$ac_cv_path_LDD conftest.exe | grep "GL" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_GL=`otool -L conftest$ac_exeext | grep "libGL\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_GL=`$OTOOL -L conftest$ac_exeext | grep "libGL\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_GL=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libGL\\.$LIBEXT" | sed -e "s/^.*\\[\\(libGL\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_GL:+false} :; then : ac_cv_lib_soname_GL=`$LDD conftest$ac_exeext | grep "libGL\\.$LIBEXT" | sed -e "s/^.*\(libGL\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -10620,7 +10713,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_OSMesa=`$ac_cv_path_LDD conftest.exe | grep "OSMesa" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_OSMesa=`otool -L conftest$ac_exeext | grep "libOSMesa\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libOSMesa\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_OSMesa=`$OTOOL -L conftest$ac_exeext | grep "libOSMesa\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libOSMesa\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_OSMesa=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libOSMesa\\.$LIBEXT" | sed -e "s/^.*\\[\\(libOSMesa\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_OSMesa:+false} :; then : ac_cv_lib_soname_OSMesa=`$LDD conftest$ac_exeext | grep "libOSMesa\\.$LIBEXT" | sed -e "s/^.*\(libOSMesa\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -11172,7 +11265,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_xslt=`$ac_cv_path_LDD conftest.exe | grep "xslt" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_xslt=`otool -L conftest$ac_exeext | grep "libxslt\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libxslt\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_xslt=`$OTOOL -L conftest$ac_exeext | grep "libxslt\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libxslt\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_xslt=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libxslt\\.$LIBEXT" | sed -e "s/^.*\\[\\(libxslt\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_xslt:+false} :; then : ac_cv_lib_soname_xslt=`$LDD conftest$ac_exeext | grep "libxslt\\.$LIBEXT" | sed -e "s/^.*\(libxslt\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -11263,7 +11356,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_dbus_1=`$ac_cv_path_LDD conftest.exe | grep "dbus-1" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_dbus_1=`otool -L conftest$ac_exeext | grep "libdbus-1\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libdbus-1\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_dbus_1=`$OTOOL -L conftest$ac_exeext | grep "libdbus-1\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libdbus-1\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_dbus_1=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libdbus-1\\.$LIBEXT" | sed -e "s/^.*\\[\\(libdbus-1\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_dbus_1:+false} :; then : ac_cv_lib_soname_dbus_1=`$LDD conftest$ac_exeext | grep "libdbus-1\\.$LIBEXT" | sed -e "s/^.*\(libdbus-1\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -11357,7 +11450,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_hal=`$ac_cv_path_LDD conftest.exe | grep "hal" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_hal=`otool -L conftest$ac_exeext | grep "libhal\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libhal\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_hal=`$OTOOL -L conftest$ac_exeext | grep "libhal\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libhal\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_hal=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libhal\\.$LIBEXT" | sed -e "s/^.*\\[\\(libhal\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_hal:+false} :; then : ac_cv_lib_soname_hal=`$LDD conftest$ac_exeext | grep "libhal\\.$LIBEXT" | sed -e "s/^.*\(libhal\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -11464,7 +11557,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_gnutls=`$ac_cv_path_LDD conftest.exe | grep "gnutls" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_gnutls=`otool -L conftest$ac_exeext | grep "libgnutls\\(-deb0\\)\\{0,1\\}\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libgnutls\\(-deb0\\)\\{0,1\\}\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_gnutls=`$OTOOL -L conftest$ac_exeext | grep "libgnutls\\(-deb0\\)\\{0,1\\}\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libgnutls\\(-deb0\\)\\{0,1\\}\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_gnutls=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libgnutls\\(-deb0\\)\\{0,1\\}\\.$LIBEXT" | sed -e "s/^.*\\[\\(libgnutls\\(-deb0\\)\\{0,1\\}\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_gnutls:+false} :; then : ac_cv_lib_soname_gnutls=`$LDD conftest$ac_exeext | grep "libgnutls\\(-deb0\\)\\{0,1\\}\\.$LIBEXT" | sed -e "s/^.*\(libgnutls\\(-deb0\\)\\{0,1\\}\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -11541,7 +11634,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_ncurses=`$ac_cv_path_LDD conftest.exe | grep "ncurses" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_ncurses=`otool -L conftest$ac_exeext | grep "libncursesw\\{0,1\\}\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libncursesw\\{0,1\\}\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_ncurses=`$OTOOL -L conftest$ac_exeext | grep "libncursesw\\{0,1\\}\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libncursesw\\{0,1\\}\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_ncurses=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libncursesw\\{0,1\\}\\.$LIBEXT" | sed -e "s/^.*\\[\\(libncursesw\\{0,1\\}\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_ncurses:+false} :; then : ac_cv_lib_soname_ncurses=`$LDD conftest$ac_exeext | grep "libncursesw\\{0,1\\}\\.$LIBEXT" | sed -e "s/^.*\(libncursesw\\{0,1\\}\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -11596,7 +11689,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_curses=`$ac_cv_path_LDD conftest.exe | grep "curses" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_curses=`otool -L conftest$ac_exeext | grep "libcurses\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libcurses\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_curses=`$OTOOL -L conftest$ac_exeext | grep "libcurses\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libcurses\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_curses=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libcurses\\.$LIBEXT" | sed -e "s/^.*\\[\\(libcurses\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_curses:+false} :; then : ac_cv_lib_soname_curses=`$LDD conftest$ac_exeext | grep "libcurses\\.$LIBEXT" | sed -e "s/^.*\(libcurses\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -11694,7 +11787,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_sane=`$ac_cv_path_LDD conftest.exe | grep "sane" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_sane=`otool -L conftest$ac_exeext | grep "libsane\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libsane\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_sane=`$OTOOL -L conftest$ac_exeext | grep "libsane\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libsane\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_sane=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libsane\\.$LIBEXT" | sed -e "s/^.*\\[\\(libsane\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_sane:+false} :; then : ac_cv_lib_soname_sane=`$LDD conftest$ac_exeext | grep "libsane\\.$LIBEXT" | sed -e "s/^.*\(libsane\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -11768,7 +11861,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_v4l1=`$ac_cv_path_LDD conftest.exe | grep "v4l1" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_v4l1=`otool -L conftest$ac_exeext | grep "libv4l1\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libv4l1\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_v4l1=`$OTOOL -L conftest$ac_exeext | grep "libv4l1\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libv4l1\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_v4l1=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libv4l1\\.$LIBEXT" | sed -e "s/^.*\\[\\(libv4l1\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_v4l1:+false} :; then : ac_cv_lib_soname_v4l1=`$LDD conftest$ac_exeext | grep "libv4l1\\.$LIBEXT" | sed -e "s/^.*\(libv4l1\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -12177,7 +12270,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_freetype=`$ac_cv_path_LDD conftest.exe | grep "freetype" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_freetype=`otool -L conftest$ac_exeext | grep "libfreetype\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libfreetype\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_freetype=`$OTOOL -L conftest$ac_exeext | grep "libfreetype\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libfreetype\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_freetype=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libfreetype\\.$LIBEXT" | sed -e "s/^.*\\[\\(libfreetype\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_freetype:+false} :; then : ac_cv_lib_soname_freetype=`$LDD conftest$ac_exeext | grep "libfreetype\\.$LIBEXT" | sed -e "s/^.*\(libfreetype\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -12720,7 +12813,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_capi20=`$ac_cv_path_LDD conftest.exe | grep "capi20" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_capi20=`otool -L conftest$ac_exeext | grep "libcapi20\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libcapi20\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_capi20=`$OTOOL -L conftest$ac_exeext | grep "libcapi20\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libcapi20\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_capi20=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libcapi20\\.$LIBEXT" | sed -e "s/^.*\\[\\(libcapi20\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_capi20:+false} :; then : ac_cv_lib_soname_capi20=`$LDD conftest$ac_exeext | grep "libcapi20\\.$LIBEXT" | sed -e "s/^.*\(libcapi20\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -12803,7 +12896,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_cups=`$ac_cv_path_LDD conftest.exe | grep "cups" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_cups=`otool -L conftest$ac_exeext | grep "libcups\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libcups\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_cups=`$OTOOL -L conftest$ac_exeext | grep "libcups\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libcups\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_cups=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libcups\\.$LIBEXT" | sed -e "s/^.*\\[\\(libcups\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_cups:+false} :; then : ac_cv_lib_soname_cups=`$LDD conftest$ac_exeext | grep "libcups\\.$LIBEXT" | sed -e "s/^.*\(libcups\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -12904,7 +12997,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_fontconfig=`$ac_cv_path_LDD conftest.exe | grep "fontconfig" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_fontconfig=`otool -L conftest$ac_exeext | grep "libfontconfig\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libfontconfig\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_fontconfig=`$OTOOL -L conftest$ac_exeext | grep "libfontconfig\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libfontconfig\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_fontconfig=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libfontconfig\\.$LIBEXT" | sed -e "s/^.*\\[\\(libfontconfig\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_fontconfig:+false} :; then : ac_cv_lib_soname_fontconfig=`$LDD conftest$ac_exeext | grep "libfontconfig\\.$LIBEXT" | sed -e "s/^.*\(libfontconfig\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -12976,7 +13069,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_gsm=`$ac_cv_path_LDD conftest.exe | grep "gsm" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_gsm=`otool -L conftest$ac_exeext | grep "libgsm\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libgsm\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_gsm=`$OTOOL -L conftest$ac_exeext | grep "libgsm\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libgsm\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_gsm=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libgsm\\.$LIBEXT" | sed -e "s/^.*\\[\\(libgsm\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_gsm:+false} :; then : ac_cv_lib_soname_gsm=`$LDD conftest$ac_exeext | grep "libgsm\\.$LIBEXT" | sed -e "s/^.*\(libgsm\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -13072,7 +13165,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_jpeg=`$ac_cv_path_LDD conftest.exe | grep "jpeg" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_jpeg=`otool -L conftest$ac_exeext | grep "libjpeg\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libjpeg\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_jpeg=`$OTOOL -L conftest$ac_exeext | grep "libjpeg\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libjpeg\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_jpeg=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libjpeg\\.$LIBEXT" | sed -e "s/^.*\\[\\(libjpeg\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_jpeg:+false} :; then : ac_cv_lib_soname_jpeg=`$LDD conftest$ac_exeext | grep "libjpeg\\.$LIBEXT" | sed -e "s/^.*\(libjpeg\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -13175,7 +13268,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_png=`$ac_cv_path_LDD conftest.exe | grep "png" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_png=`otool -L conftest$ac_exeext | grep "libpng[0-9]*\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libpng[0-9]*\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_png=`$OTOOL -L conftest$ac_exeext | grep "libpng[0-9]*\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libpng[0-9]*\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_png=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libpng[0-9]*\\.$LIBEXT" | sed -e "s/^.*\\[\\(libpng[0-9]*\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_png:+false} :; then : ac_cv_lib_soname_png=`$LDD conftest$ac_exeext | grep "libpng[0-9]*\\.$LIBEXT" | sed -e "s/^.*\(libpng[0-9]*\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -13294,7 +13387,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_tiff=`$ac_cv_path_LDD conftest.exe | grep "tiff" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_tiff=`otool -L conftest$ac_exeext | grep "libtiff\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libtiff\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_tiff=`$OTOOL -L conftest$ac_exeext | grep "libtiff\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libtiff\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_tiff=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libtiff\\.$LIBEXT" | sed -e "s/^.*\\[\\(libtiff\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_tiff:+false} :; then : ac_cv_lib_soname_tiff=`$LDD conftest$ac_exeext | grep "libtiff\\.$LIBEXT" | sed -e "s/^.*\(libtiff\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -13458,7 +13551,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_openal=`$ac_cv_path_LDD conftest.exe | grep "openal" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_openal=`otool -L conftest$ac_exeext | grep "libopenal\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libopenal\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_openal=`$OTOOL -L conftest$ac_exeext | grep "libopenal\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libopenal\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_openal=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libopenal\\.$LIBEXT" | sed -e "s/^.*\\[\\(libopenal\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_openal:+false} :; then : ac_cv_lib_soname_openal=`$LDD conftest$ac_exeext | grep "libopenal\\.$LIBEXT" | sed -e "s/^.*\(libopenal\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -13625,7 +13718,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_odbc=`$ac_cv_path_LDD conftest.exe | grep "odbc" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_odbc=`otool -L conftest$ac_exeext | grep "libodbc\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libodbc\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_odbc=`$OTOOL -L conftest$ac_exeext | grep "libodbc\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libodbc\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_odbc=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libodbc\\.$LIBEXT" | sed -e "s/^.*\\[\\(libodbc\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_odbc:+false} :; then : ac_cv_lib_soname_odbc=`$LDD conftest$ac_exeext | grep "libodbc\\.$LIBEXT" | sed -e "s/^.*\(libodbc\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -13684,7 +13777,7 @@ if ac_fn_c_try_link "$LINENO"; then : case "$LIBEXT" in dll) ac_cv_lib_soname_netapi=`$ac_cv_path_LDD conftest.exe | grep "netapi" | sed -e "s/dll.*/dll/"';2,$d'` ;; - dylib) ac_cv_lib_soname_netapi=`otool -L conftest$ac_exeext | grep "libnetapi\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libnetapi\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + dylib) ac_cv_lib_soname_netapi=`$OTOOL -L conftest$ac_exeext | grep "libnetapi\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libnetapi\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; *) ac_cv_lib_soname_netapi=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libnetapi\\.$LIBEXT" | sed -e "s/^.*\\[\\(libnetapi\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'` if ${ac_cv_lib_soname_netapi:+false} :; then : ac_cv_lib_soname_netapi=`$LDD conftest$ac_exeext | grep "libnetapi\\.$LIBEXT" | sed -e "s/^.*\(libnetapi\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` @@ -13739,7 +13832,7 @@ $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : - ac_cv_c_gcc_strength_bug="yes" + ac_cv_c_gcc_strength_bug="no" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17626,6 +17719,7 @@ wine_fn_config_dll vbscript enable_vbscript clean wine_fn_config_test dlls/vbscript/tests vbscript_test clean wine_fn_config_dll vcomp enable_vcomp +wine_fn_config_test dlls/vcomp/tests vcomp_test wine_fn_config_dll vcomp100 enable_vcomp100 wine_fn_config_dll vcomp90 enable_vcomp90 wine_fn_config_dll vdhcp.vxd enable_win16 @@ -18508,7 +18602,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Wine $as_me 1.7.47, which was +This file was extended by Wine $as_me 1.7.48, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18579,7 +18673,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Wine config.status 1.7.47 +Wine config.status 1.7.48 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/configure.ac wine-staging-1.7.48~ubuntu12.04.1/configure.ac --- wine-staging-1.7.47~ubuntu12.04.1/configure.ac 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/configure.ac 2015-07-29 19:28:54.000000000 +0000 @@ -1797,7 +1797,7 @@ for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]]; L[[i]] = 4; return (Array[[1]] != -2 || L[[2]] != 3)]])], - [ac_cv_c_gcc_strength_bug="no"],[ac_cv_c_gcc_strength_bug="yes"],[ac_cv_c_gcc_strength_bug="yes"]) ) + [ac_cv_c_gcc_strength_bug="no"],[ac_cv_c_gcc_strength_bug="yes"],[ac_cv_c_gcc_strength_bug="no"]) ) if test "$ac_cv_c_gcc_strength_bug" = "yes" then EXTRACFLAGS="$EXTRACFLAGS -fno-strength-reduce" @@ -3322,6 +3322,7 @@ WINE_CONFIG_DLL(vbscript,,[clean]) WINE_CONFIG_TEST(dlls/vbscript/tests,[clean]) WINE_CONFIG_DLL(vcomp) +WINE_CONFIG_TEST(dlls/vcomp/tests) WINE_CONFIG_DLL(vcomp100) WINE_CONFIG_DLL(vcomp90) WINE_CONFIG_DLL(vdhcp.vxd,enable_win16) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/debian/bzr-builder.manifest wine-staging-1.7.48~ubuntu12.04.1/debian/bzr-builder.manifest --- wine-staging-1.7.47~ubuntu12.04.1/debian/bzr-builder.manifest 2015-07-15 05:08:18.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/debian/bzr-builder.manifest 2015-07-29 20:23:12.000000000 +0000 @@ -1,3 +1,3 @@ -# bzr-builder format 0.4 deb-version 1.7.47 -lp:wine revid:git-v1:744f7b69bf4692265588e10650090ca2f5129ccd -merge compholio-release-package lp:wine-compholio revid:git-v1:cd4db49a7412ab06c72e247ac090ab8c5816b6fd +# bzr-builder format 0.4 deb-version 1.7.48 +lp:wine revid:git-v1:797c037bff2f7621f5b3d632bd899349529d6b2b +merge compholio-release-package lp:wine-compholio revid:git-v1:5ec4d6171e1ad4086f88c3e2db6d2fe1a38c1578 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/debian/changelog wine-staging-1.7.48~ubuntu12.04.1/debian/changelog --- wine-staging-1.7.47~ubuntu12.04.1/debian/changelog 2015-07-15 05:08:18.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/debian/changelog 2015-07-29 20:23:12.000000000 +0000 @@ -1,8 +1,52 @@ -wine-staging (1.7.47~ubuntu12.04.1) precise; urgency=low +wine-staging (1.7.48~ubuntu12.04.1) precise; urgency=low * Auto build. - -- Sebastian Lackner Wed, 15 Jul 2015 05:08:18 +0000 + -- Sebastian Lackner Wed, 29 Jul 2015 20:23:12 +0000 + +wine-staging (1.7.48) unstable; urgency=low + * Update patches for d3dx9_36.D3DXGetShader{Input,Output}Semantics and add + additional tests. + * Update patchset to query GPU infos with GLX_MESA_query_renderer extension + (fixes a regression with broken MESA versions). + * Update vcomp patchset and add implementation for various atomic functions. + * Updated CSMT patchset to fix crash in Path of Exile after character + selection (fixes Wine Staging Bug #451). + * Added patch to forward exitcode from child process when in wineconsole. + * Added patch to check architecture before trying to load libraries. + * Added patch to share source of d3dx9_36 with d3dx9_33 to avoid Wine DLL + forwards. + * Added patch with stubs for d3dx10_43.D3DX10CreateEffectFromFileA/W. + * Added patch to silence repeated LocaleNameToLCID/LCIDToLocaleName + unsupported flags FIXMEs. + * Added patches to improve security cookie handling. + * Added patches to implement ThreadQuerySetWin32StartAddress info class. + * Added patch to fake success in kernel32.SetFileCompletionNotificationModes. + * Added patch to export additional OpenAL32 functions. + * Added patch to return dummy ID3DXSkinInfo interface when skinning info not + present. + * Added patch to store registry timestamps with nanoseconds precision. + * Added patch to implement AMStream GetMultiMediaStream functions. + * Added patch with stub for D3DXTessellateNPatches. + * Added patch with stubs for D3DCompile2 and D3DCompileFromFile. + * Added patch to implement dbghelp.UnDecorateSymbolNameW. + * Added patch to add wined3d detection of GeForce GT 425M. + * Added patch to use video memory for rendering targets if possible. + * Added patch to avoid race-conditions with long running threadpool tasks. + * Removed patch to allow to enable/disable InsertMode in wineconsole settings + (accepted upstream). + * Removed patch to improve IoGetDeviceObjectPointer stub to appease SecuROM + 5.x (accepted upstream). + * Removed patch to forward GIF encoder requests to Windowscodecs (accepted + upstream). + * Removed patch to ignore garbage after decoding gif lines (accepted + upstream). + * Removed patch to increase buffer size in widl/typegen.c (accepted upstream). + * Removed patch to revert security cookie changes in loader (fixed upstream). + * Removed patch to add support 8bpp grayscale TIFF images with 8bpp alpha + channel (accepted upstream). + * Partrially removed patches for vcomp implementation (accepted upstream). + -- Sebastian Lackner Wed, 29 Jul 2015 21:11:07 +0200 wine-staging (1.7.47) unstable; urgency=low * Added patch to silence repeated winhttp "no support on this platform" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/debian/control wine-staging-1.7.48~ubuntu12.04.1/debian/control --- wine-staging-1.7.47~ubuntu12.04.1/debian/control 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/debian/control 2015-07-29 19:51:42.000000000 +0000 @@ -14,7 +14,7 @@ flex, fontforge, gawk, - gcc-4.5 | gcc-4.7 | ubuntu-desktop (<< 1.207), + gcc-4.5 | gcc-4.7 | gcc-4.9 | ubuntu-desktop (<< 1.207), gettext, libacl1-dev, libasound2-dev, @@ -83,10 +83,7 @@ libfontconfig1 | libfontconfig, libfreetype6, libgnutls26, - libgphoto2-6 | libgphoto2-2 (>= 2.4.6), - libgphoto2-port10 | libgphoto2-port0 (>= 2.4.6), libjpeg8, - libopenal1 (>= 1:1.12), libosmesa6, libpcap0.8, libpng12-0, @@ -140,10 +137,7 @@ libfontconfig1 | libfontconfig, libfreetype6, libgnutls26, - libgphoto2-6 | libgphoto2-2 (>= 2.4.6), - libgphoto2-port10 | libgphoto2-port0 (>= 2.4.6), libjpeg8, - libopenal1 (>= 1:1.12), libosmesa6, libpcap0.8, libpng12-0, diff -Nru wine-staging-1.7.47~ubuntu12.04.1/debian/rules wine-staging-1.7.48~ubuntu12.04.1/debian/rules --- wine-staging-1.7.47~ubuntu12.04.1/debian/rules 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/debian/rules 2015-07-29 19:51:42.000000000 +0000 @@ -1,11 +1,8 @@ #!/usr/bin/make -f -# Use gcc-4.5 if it's available -ifeq ($(shell which gcc-4.5),) - CC = gcc -else - CC = gcc-4.5 -endif +# Prefer gcc-4.5, then 4.7, then 4.9 - otherwise fallback to gcc. +export CC = $(shell for _cc in gcc-4.5 gcc-4.7 gcc-4.9 gcc false; do \ + if which "$$_cc" >/dev/null 2>&1; then echo "$$_cc"; break; fi; done) %: dh $@ --parallel diff -Nru wine-staging-1.7.47~ubuntu12.04.1/debian/tools/patchutils.py wine-staging-1.7.48~ubuntu12.04.1/debian/tools/patchutils.py --- wine-staging-1.7.47~ubuntu12.04.1/debian/tools/patchutils.py 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/debian/tools/patchutils.py 2015-07-29 19:51:42.000000000 +0000 @@ -305,6 +305,8 @@ if r is not None: return "%s: %s" % (r.group(1), r.group(4)), int(r.group(3)) r = re.match("^(.*) +%s$" % version, subject, re.IGNORECASE) if r is not None: return r.group(1).strip(), int(r.group(3)) + r = re.match("^(.*)\\(resend\\)$", subject, re.IGNORECASE) + if r is not None: return r.group(1).strip(), 1 return subject, 1 header = {} diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/acledit/acledit.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/acledit/acledit.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/acledit/acledit.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/acledit/acledit.spec 2015-07-29 19:28:54.000000000 +0000 @@ -1,7 +1,7 @@ 1 stub EditAuditInfo 2 stub EditOwnerInfo 3 stub EditPermissionInfo -4 stdcall DllMain(long long ptr) +4 stdcall -private DllMain(long long ptr) 5 stdcall FMExtensionProcW(long long long) 6 stub SedDiscretionaryAclEditor 7 stub SedSystemAclEditor diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/advapi32/security.c wine-staging-1.7.48~ubuntu12.04.1/dlls/advapi32/security.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/advapi32/security.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/advapi32/security.c 2015-07-29 19:28:54.000000000 +0000 @@ -431,8 +431,10 @@ err = SERV_OpenSCManagerW( NULL, NULL, access, (SC_HANDLE *)&manager ); if (err == ERROR_SUCCESS) + { err = SERV_OpenServiceW( manager, full_service_name, access, (SC_HANDLE *)service ); - CloseServiceHandle( manager ); + CloseServiceHandle( manager ); + } return err; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/api-ms-win-downlevel-shell32-l1-1-0/api-ms-win-downlevel-shell32-l1-1-0.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/api-ms-win-downlevel-shell32-l1-1-0/api-ms-win-downlevel-shell32-l1-1-0.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/api-ms-win-downlevel-shell32-l1-1-0/api-ms-win-downlevel-shell32-l1-1-0.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/api-ms-win-downlevel-shell32-l1-1-0/api-ms-win-downlevel-shell32-l1-1-0.spec 2015-07-29 19:28:54.000000000 +0000 @@ -1,3 +1,3 @@ @ stdcall CommandLineToArgvW(wstr ptr) shell32.CommandLineToArgvW -@ stub GetCurrentProcessExplicitAppUserModelID +@ stdcall GetCurrentProcessExplicitAppUserModelID(ptr) shell32.GetCurrentProcessExplicitAppUserModelID @ stdcall SetCurrentProcessExplicitAppUserModelID(wstr) shell32.SetCurrentProcessExplicitAppUserModelID diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d2d1/brush.c wine-staging-1.7.48~ubuntu12.04.1/dlls/d2d1/brush.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d2d1/brush.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d2d1/brush.c 2015-07-29 19:28:54.000000000 +0000 @@ -709,10 +709,106 @@ } } -void d2d_brush_bind_resources(struct d2d_brush *brush, ID3D10Device *device) +HRESULT d2d_brush_get_ps_cb(struct d2d_brush *brush, struct d2d_d3d_render_target *render_target, + ID3D10Buffer **ps_cb) { + D3D10_SUBRESOURCE_DATA buffer_data; + D3D10_BUFFER_DESC buffer_desc; + struct + { + float _11, _21, _31, pad0; + float _12, _22, _32, pad1; + } transform; + D2D1_COLOR_F color; HRESULT hr; + buffer_desc.Usage = D3D10_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D10_BIND_CONSTANT_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + + buffer_data.SysMemPitch = 0; + buffer_data.SysMemSlicePitch = 0; + + if (brush->type == D2D_BRUSH_TYPE_SOLID) + { + color = brush->u.solid.color; + color.a *= brush->opacity; + + buffer_desc.ByteWidth = sizeof(color); + buffer_data.pSysMem = &color; + } + else if (brush->type == D2D_BRUSH_TYPE_BITMAP) + { + struct d2d_bitmap *bitmap = brush->u.bitmap.bitmap; + D2D_MATRIX_3X2_F w, b; + float dpi_scale, d; + + /* Scale for dpi. */ + w = render_target->drawing_state.transform; + dpi_scale = render_target->dpi_x / 96.0f; + w._11 *= dpi_scale; + w._21 *= dpi_scale; + w._31 *= dpi_scale; + dpi_scale = render_target->dpi_y / 96.0f; + w._12 *= dpi_scale; + w._22 *= dpi_scale; + w._32 *= dpi_scale; + + /* Scale for bitmap size and dpi. */ + b = brush->transform; + dpi_scale = bitmap->pixel_size.width * (96.0f / bitmap->dpi_x); + b._11 *= dpi_scale; + b._21 *= dpi_scale; + dpi_scale = bitmap->pixel_size.height * (96.0f / bitmap->dpi_y); + b._12 *= dpi_scale; + b._22 *= dpi_scale; + + d2d_matrix_multiply(&b, &w); + + /* Invert the matrix. (Because the matrix is applied to the sampling + * coordinates. I.e., to scale the bitmap by 2 we need to divide the + * coordinates by 2.) */ + d = b._11 * b._22 - b._21 * b._12; + if (d != 0.0f) + { + transform._11 = b._22 / d; + transform._21 = -b._21 / d; + transform._31 = (b._21 * b._32 - b._31 * b._22) / d; + transform._12 = -b._12 / d; + transform._22 = b._11 / d; + transform._32 = -(b._11 * b._32 - b._31 * b._12) / d; + } + transform.pad1 = brush->opacity; + + buffer_desc.ByteWidth = sizeof(transform); + buffer_data.pSysMem = &transform; + } + else + { + FIXME("Unhandled brush type %#x.\n", brush->type); + return E_NOTIMPL; + } + + if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, &buffer_desc, &buffer_data, ps_cb))) + ERR("Failed to create constant buffer, hr %#x.\n", hr); + + return hr; +} + +void d2d_brush_bind_resources(struct d2d_brush *brush, struct d2d_d3d_render_target *render_target, + enum d2d_shape_type shape_type) +{ + static const float blend_factor[] = {1.0f, 1.0f, 1.0f, 1.0f}; + ID3D10Device *device = render_target->device; + ID3D10PixelShader *ps; + HRESULT hr; + + ID3D10Device_OMSetBlendState(device, render_target->bs, blend_factor, D3D10_DEFAULT_SAMPLE_MASK); + if (!(ps = render_target->shape_resources[shape_type].ps[brush->type])) + FIXME("No pixel shader for shape type %#x and brush type %#x.\n", shape_type, brush->type); + ID3D10Device_PSSetShader(device, ps); + if (brush->type == D2D_BRUSH_TYPE_BITMAP) { ID3D10Device_PSSetShaderResources(device, 0, 1, &brush->u.bitmap.bitmap->view); @@ -743,4 +839,8 @@ } ID3D10Device_PSSetSamplers(device, 0, 1, &brush->u.bitmap.sampler_state); } + else if (brush->type != D2D_BRUSH_TYPE_SOLID) + { + FIXME("Unhandled brush type %#x.\n", brush->type); + } } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d2d1/d2d1_private.h wine-staging-1.7.48~ubuntu12.04.1/dlls/d2d1/d2d1_private.h --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d2d1/d2d1_private.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d2d1/d2d1_private.h 2015-07-29 19:28:54.000000000 +0000 @@ -35,6 +35,14 @@ D2D_BRUSH_TYPE_SOLID, D2D_BRUSH_TYPE_LINEAR, D2D_BRUSH_TYPE_BITMAP, + D2D_BRUSH_TYPE_COUNT, +}; + +enum d2d_shape_type +{ + D2D_SHAPE_TYPE_TRIANGLE, + D2D_SHAPE_TYPE_BEZIER, + D2D_SHAPE_TYPE_COUNT, }; struct d2d_clip_stack @@ -44,6 +52,13 @@ unsigned int count; }; +struct d2d_shape_resources +{ + ID3D10InputLayout *il; + ID3D10VertexShader *vs; + ID3D10PixelShader *ps[D2D_BRUSH_TYPE_COUNT]; +}; + struct d2d_d3d_render_target { ID2D1RenderTarget ID2D1RenderTarget_iface; @@ -54,19 +69,17 @@ ID3D10Device *device; ID3D10RenderTargetView *view; ID3D10StateBlock *stateblock; - ID3D10InputLayout *il; + struct d2d_shape_resources shape_resources[D2D_SHAPE_TYPE_COUNT]; + ID3D10Buffer *ib; unsigned int vb_stride; ID3D10Buffer *vb; - ID3D10VertexShader *vs; ID3D10RasterizerState *rs; ID3D10BlendState *bs; - ID3D10PixelShader *rect_solid_ps; - ID3D10PixelShader *rect_bitmap_ps; - D2D1_DRAWING_STATE_DESCRIPTION drawing_state; IDWriteRenderingParams *text_rendering_params; + D2D1_PIXEL_FORMAT format; D2D1_SIZE_U pixel_size; struct d2d_clip_stack clip_stack; float dpi_x; @@ -141,7 +154,10 @@ HRESULT d2d_bitmap_brush_init(struct d2d_brush *brush, struct d2d_d3d_render_target *render_target, ID2D1Bitmap *bitmap, const D2D1_BITMAP_BRUSH_PROPERTIES *bitmap_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc) DECLSPEC_HIDDEN; -void d2d_brush_bind_resources(struct d2d_brush *brush, ID3D10Device *device) DECLSPEC_HIDDEN; +void d2d_brush_bind_resources(struct d2d_brush *brush, struct d2d_d3d_render_target *render_target, + enum d2d_shape_type shape_type) DECLSPEC_HIDDEN; +HRESULT d2d_brush_get_ps_cb(struct d2d_brush *brush, struct d2d_d3d_render_target *render_target, + ID3D10Buffer **ps_cb) DECLSPEC_HIDDEN; struct d2d_brush *unsafe_impl_from_ID2D1Brush(ID2D1Brush *iface) DECLSPEC_HIDDEN; struct d2d_stroke_style @@ -198,16 +214,73 @@ D2D_GEOMETRY_STATE_FIGURE, }; +struct d2d_bezier +{ + struct + { + D2D1_POINT_2F position; + struct + { + float u, v, sign; + } texcoord; + } v[3]; +}; + +struct d2d_face +{ + UINT16 v[3]; +}; + struct d2d_geometry { ID2D1Geometry ID2D1Geometry_iface; - ID2D1GeometrySink ID2D1GeometrySink_iface; LONG refcount; - enum d2d_geometry_state state; - UINT32 figure_count, segment_count; + D2D1_POINT_2F *vertices; + size_t vertex_count; + + struct d2d_face *faces; + size_t faces_size; + size_t face_count; + + struct d2d_bezier *beziers; + size_t bezier_count; + + union + { + struct + { + ID2D1GeometrySink ID2D1GeometrySink_iface; + + struct d2d_figure *figures; + size_t figures_size; + size_t figure_count; + + enum d2d_geometry_state state; + D2D1_FILL_MODE fill_mode; + UINT32 segment_count; + } path; + struct + { + D2D1_RECT_F rect; + } rectangle; + } u; }; void d2d_path_geometry_init(struct d2d_geometry *geometry) DECLSPEC_HIDDEN; +HRESULT d2d_rectangle_geometry_init(struct d2d_geometry *geometry, const D2D1_RECT_F *rect) DECLSPEC_HIDDEN; +struct d2d_geometry *unsafe_impl_from_ID2D1Geometry(ID2D1Geometry *iface) DECLSPEC_HIDDEN; + +static inline void d2d_matrix_multiply(D2D_MATRIX_3X2_F *a, const D2D_MATRIX_3X2_F *b) +{ + D2D_MATRIX_3X2_F tmp = *a; + + a->_11 = tmp._11 * b->_11 + tmp._12 * b->_21; + a->_12 = tmp._11 * b->_12 + tmp._12 * b->_22; + a->_21 = tmp._21 * b->_11 + tmp._22 * b->_21; + a->_22 = tmp._21 * b->_12 + tmp._22 * b->_22; + a->_31 = tmp._31 * b->_11 + tmp._32 * b->_21 + b->_31; + a->_32 = tmp._31 * b->_12 + tmp._32 * b->_22 + b->_32; +} #endif /* __WINE_D2D1_PRIVATE_H */ diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d2d1/factory.c wine-staging-1.7.48~ubuntu12.04.1/dlls/d2d1/factory.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d2d1/factory.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d2d1/factory.c 2015-07-29 19:28:54.000000000 +0000 @@ -94,9 +94,25 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRectangleGeometry(ID2D1Factory *iface, const D2D1_RECT_F *rect, ID2D1RectangleGeometry **geometry) { - FIXME("iface %p, rect %p, geometry %p stub!\n", iface, rect, geometry); + struct d2d_geometry *object; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, rect %p, geometry %p.\n", iface, rect, geometry); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d2d_rectangle_geometry_init(object, rect))) + { + WARN("Failed to initialize rectangle geometry, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created rectangle geometry %p.\n", object); + *geometry = (ID2D1RectangleGeometry *)&object->ID2D1Geometry_iface; + + return S_OK; } static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRoundedRectangleGeometry(ID2D1Factory *iface, diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d2d1/geometry.c wine-staging-1.7.48~ubuntu12.04.1/dlls/d2d1/geometry.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d2d1/geometry.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d2d1/geometry.c 2015-07-29 19:28:54.000000000 +0000 @@ -23,9 +23,977 @@ WINE_DEFAULT_DEBUG_CHANNEL(d2d); +#define D2D_CDT_EDGE_FLAG_FREED 0x80000000u +#define D2D_CDT_EDGE_FLAG_VISITED(r) (1u << (r)) + +enum d2d_cdt_edge_next +{ + D2D_EDGE_NEXT_ORIGIN = 0, + D2D_EDGE_NEXT_ROT = 1, + D2D_EDGE_NEXT_SYM = 2, + D2D_EDGE_NEXT_TOR = 3, +}; + +struct d2d_figure +{ + D2D1_POINT_2F *vertices; + size_t vertices_size; + size_t vertex_count; + + struct d2d_bezier *beziers; + size_t beziers_size; + size_t bezier_count; +}; + +struct d2d_cdt_edge_ref +{ + size_t idx; + enum d2d_cdt_edge_next r; +}; + +struct d2d_cdt_edge +{ + struct d2d_cdt_edge_ref next[4]; + size_t vertex[2]; + unsigned int flags; +}; + +struct d2d_cdt +{ + struct d2d_cdt_edge *edges; + size_t edges_size; + size_t edge_count; + size_t free_edge; + + const D2D1_POINT_2F *vertices; +}; + +static void d2d_point_subtract(D2D1_POINT_2F *out, + const D2D1_POINT_2F *a, const D2D1_POINT_2F *b) +{ + out->x = a->x - b->x; + out->y = a->y - b->y; +} + +static float d2d_point_ccw(const D2D1_POINT_2F *a, const D2D1_POINT_2F *b, const D2D1_POINT_2F *c) +{ + D2D1_POINT_2F ab, ac; + + d2d_point_subtract(&ab, b, a); + d2d_point_subtract(&ac, c, a); + + return ab.x * ac.y - ab.y * ac.x; +} + +static BOOL d2d_array_reserve(void **elements, size_t *capacity, size_t element_count, size_t element_size) +{ + size_t new_capacity, max_capacity; + void *new_elements; + + if (element_count <= *capacity) + return TRUE; + + max_capacity = ~(size_t)0 / element_size; + if (max_capacity < element_count) + return FALSE; + + new_capacity = max(*capacity, 4); + while (new_capacity < element_count && new_capacity <= max_capacity / 2) + new_capacity *= 2; + + if (new_capacity < element_count) + new_capacity = max_capacity; + + if (*elements) + new_elements = HeapReAlloc(GetProcessHeap(), 0, *elements, new_capacity * element_size); + else + new_elements = HeapAlloc(GetProcessHeap(), 0, new_capacity * element_size); + + if (!new_elements) + return FALSE; + + *elements = new_elements; + *capacity = new_capacity; + return TRUE; +} + +static BOOL d2d_figure_insert_vertex(struct d2d_figure *figure, size_t idx, D2D1_POINT_2F vertex) +{ + if (!d2d_array_reserve((void **)&figure->vertices, &figure->vertices_size, + figure->vertex_count + 1, sizeof(*figure->vertices))) + { + ERR("Failed to grow vertices array.\n"); + return FALSE; + } + + memmove(&figure->vertices[idx + 1], &figure->vertices[idx], + (figure->vertex_count - idx) * sizeof(*figure->vertices)); + figure->vertices[idx] = vertex; + ++figure->vertex_count; + return TRUE; +} + +static BOOL d2d_figure_add_vertex(struct d2d_figure *figure, D2D1_POINT_2F vertex) +{ + if (!d2d_array_reserve((void **)&figure->vertices, &figure->vertices_size, + figure->vertex_count + 1, sizeof(*figure->vertices))) + { + ERR("Failed to grow vertices array.\n"); + return FALSE; + } + + figure->vertices[figure->vertex_count] = vertex; + ++figure->vertex_count; + return TRUE; +} + +/* FIXME: No inside/outside testing is done for beziers. */ +static BOOL d2d_figure_add_bezier(struct d2d_figure *figure, D2D1_POINT_2F p0, D2D1_POINT_2F p1, D2D1_POINT_2F p2) +{ + struct d2d_bezier *b; + unsigned int idx1, idx2; + float sign; + + if (!d2d_array_reserve((void **)&figure->beziers, &figure->beziers_size, + figure->bezier_count + 1, sizeof(*figure->beziers))) + { + ERR("Failed to grow beziers array.\n"); + return FALSE; + } + + if (d2d_point_ccw(&p0, &p1, &p2) > 0.0f) + { + sign = -1.0f; + idx1 = 1; + idx2 = 2; + } + else + { + sign = 1.0f; + idx1 = 2; + idx2 = 1; + } + + b = &figure->beziers[figure->bezier_count]; + b->v[0].position = p0; + b->v[0].texcoord.u = 0.0f; + b->v[0].texcoord.v = 0.0f; + b->v[0].texcoord.sign = sign; + b->v[idx1].position = p1; + b->v[idx1].texcoord.u = 0.5f; + b->v[idx1].texcoord.v = 0.0f; + b->v[idx1].texcoord.sign = sign; + b->v[idx2].position = p2; + b->v[idx2].texcoord.u = 1.0f; + b->v[idx2].texcoord.v = 1.0f; + b->v[idx2].texcoord.sign = sign; + ++figure->bezier_count; + + if (sign > 0.0f && !d2d_figure_add_vertex(figure, p1)) + return FALSE; + if (!d2d_figure_add_vertex(figure, p2)) + return FALSE; + return TRUE; +} + +static void d2d_cdt_edge_rot(struct d2d_cdt_edge_ref *dst, const struct d2d_cdt_edge_ref *src) +{ + dst->idx = src->idx; + dst->r = (src->r + D2D_EDGE_NEXT_ROT) & 3; +} + +static void d2d_cdt_edge_sym(struct d2d_cdt_edge_ref *dst, const struct d2d_cdt_edge_ref *src) +{ + dst->idx = src->idx; + dst->r = (src->r + D2D_EDGE_NEXT_SYM) & 3; +} + +static void d2d_cdt_edge_tor(struct d2d_cdt_edge_ref *dst, const struct d2d_cdt_edge_ref *src) +{ + dst->idx = src->idx; + dst->r = (src->r + D2D_EDGE_NEXT_TOR) & 3; +} + +static void d2d_cdt_edge_next_left(const struct d2d_cdt *cdt, + struct d2d_cdt_edge_ref *dst, const struct d2d_cdt_edge_ref *src) +{ + d2d_cdt_edge_rot(dst, &cdt->edges[src->idx].next[(src->r + D2D_EDGE_NEXT_TOR) & 3]); +} + +static void d2d_cdt_edge_next_origin(const struct d2d_cdt *cdt, + struct d2d_cdt_edge_ref *dst, const struct d2d_cdt_edge_ref *src) +{ + *dst = cdt->edges[src->idx].next[src->r]; +} + +static void d2d_cdt_edge_prev_origin(const struct d2d_cdt *cdt, + struct d2d_cdt_edge_ref *dst, const struct d2d_cdt_edge_ref *src) +{ + d2d_cdt_edge_rot(dst, &cdt->edges[src->idx].next[(src->r + D2D_EDGE_NEXT_ROT) & 3]); +} + +static size_t d2d_cdt_edge_origin(const struct d2d_cdt *cdt, const struct d2d_cdt_edge_ref *e) +{ + return cdt->edges[e->idx].vertex[e->r >> 1]; +} + +static size_t d2d_cdt_edge_destination(const struct d2d_cdt *cdt, const struct d2d_cdt_edge_ref *e) +{ + return cdt->edges[e->idx].vertex[!(e->r >> 1)]; +} + +static void d2d_cdt_edge_set_origin(const struct d2d_cdt *cdt, + const struct d2d_cdt_edge_ref *e, size_t vertex) +{ + cdt->edges[e->idx].vertex[e->r >> 1] = vertex; +} + +static void d2d_cdt_edge_set_destination(const struct d2d_cdt *cdt, + const struct d2d_cdt_edge_ref *e, size_t vertex) +{ + cdt->edges[e->idx].vertex[!(e->r >> 1)] = vertex; +} + +static float d2d_cdt_ccw(const struct d2d_cdt *cdt, size_t a, size_t b, size_t c) +{ + return d2d_point_ccw(&cdt->vertices[a], &cdt->vertices[b], &cdt->vertices[c]); +} + +static BOOL d2d_cdt_rightof(const struct d2d_cdt *cdt, size_t p, const struct d2d_cdt_edge_ref *e) +{ + return d2d_cdt_ccw(cdt, p, d2d_cdt_edge_destination(cdt, e), d2d_cdt_edge_origin(cdt, e)) > 0.0f; +} + +static BOOL d2d_cdt_leftof(const struct d2d_cdt *cdt, size_t p, const struct d2d_cdt_edge_ref *e) +{ + return d2d_cdt_ccw(cdt, p, d2d_cdt_edge_origin(cdt, e), d2d_cdt_edge_destination(cdt, e)) > 0.0f; +} + +/* Determine if point D is inside or outside the circle defined by points A, + * B, C. As explained in the paper by Guibas and Stolfi, this is equivalent to + * calculating the signed volume of the tetrahedron defined by projecting the + * points onto the paraboloid of revolution x = x² + y², + * λ:(x, y) → (x, y, x² + y²). I.e., D is inside the cirlce if + * + * |λ(A) 1| + * |λ(B) 1| > 0 + * |λ(C) 1| + * |λ(D) 1| + * + * After translating D to the origin, that becomes: + * + * |λ(A-D)| + * |λ(B-D)| > 0 + * |λ(C-D)| */ +static BOOL d2d_cdt_incircle(const struct d2d_cdt *cdt, size_t a, size_t b, size_t c, size_t d) +{ + const D2D1_POINT_2F *p = cdt->vertices; + const struct + { + double x, y; + } + da = {p[a].x - p[d].x, p[a].y - p[d].y}, + db = {p[b].x - p[d].x, p[b].y - p[d].y}, + dc = {p[c].x - p[d].x, p[c].y - p[d].y}; + + return (da.x * da.x + da.y * da.y) * (db.x * dc.y - db.y * dc.x) + + (db.x * db.x + db.y * db.y) * (dc.x * da.y - dc.y * da.x) + + (dc.x * dc.x + dc.y * dc.y) * (da.x * db.y - da.y * db.x) > 0.0; +} + +static void d2d_cdt_splice(const struct d2d_cdt *cdt, const struct d2d_cdt_edge_ref *a, + const struct d2d_cdt_edge_ref *b) +{ + struct d2d_cdt_edge_ref ta, tb, alpha, beta; + + ta = cdt->edges[a->idx].next[a->r]; + tb = cdt->edges[b->idx].next[b->r]; + cdt->edges[a->idx].next[a->r] = tb; + cdt->edges[b->idx].next[b->r] = ta; + + d2d_cdt_edge_rot(&alpha, &ta); + d2d_cdt_edge_rot(&beta, &tb); + + ta = cdt->edges[alpha.idx].next[alpha.r]; + tb = cdt->edges[beta.idx].next[beta.r]; + cdt->edges[alpha.idx].next[alpha.r] = tb; + cdt->edges[beta.idx].next[beta.r] = ta; +} + +static BOOL d2d_cdt_create_edge(struct d2d_cdt *cdt, struct d2d_cdt_edge_ref *e) +{ + struct d2d_cdt_edge *edge; + + if (cdt->free_edge != ~0u) + { + e->idx = cdt->free_edge; + cdt->free_edge = cdt->edges[e->idx].next[D2D_EDGE_NEXT_ORIGIN].idx; + } + else + { + if (!d2d_array_reserve((void **)&cdt->edges, &cdt->edges_size, cdt->edge_count + 1, sizeof(*cdt->edges))) + { + ERR("Failed to grow edges array.\n"); + return FALSE; + } + e->idx = cdt->edge_count++; + } + e->r = 0; + + edge = &cdt->edges[e->idx]; + edge->next[D2D_EDGE_NEXT_ORIGIN] = *e; + d2d_cdt_edge_tor(&edge->next[D2D_EDGE_NEXT_ROT], e); + d2d_cdt_edge_sym(&edge->next[D2D_EDGE_NEXT_SYM], e); + d2d_cdt_edge_rot(&edge->next[D2D_EDGE_NEXT_TOR], e); + edge->flags = 0; + + return TRUE; +} + +static void d2d_cdt_destroy_edge(struct d2d_cdt *cdt, const struct d2d_cdt_edge_ref *e) +{ + struct d2d_cdt_edge_ref next, sym, prev; + + d2d_cdt_edge_next_origin(cdt, &next, e); + if (next.idx != e->idx || next.r != e->r) + { + d2d_cdt_edge_prev_origin(cdt, &prev, e); + d2d_cdt_splice(cdt, e, &prev); + } + + d2d_cdt_edge_sym(&sym, e); + + d2d_cdt_edge_next_origin(cdt, &next, &sym); + if (next.idx != sym.idx || next.r != sym.r) + { + d2d_cdt_edge_prev_origin(cdt, &prev, &sym); + d2d_cdt_splice(cdt, &sym, &prev); + } + + cdt->edges[e->idx].flags |= D2D_CDT_EDGE_FLAG_FREED; + cdt->edges[e->idx].next[D2D_EDGE_NEXT_ORIGIN].idx = cdt->free_edge; + cdt->free_edge = e->idx; +} + +static BOOL d2d_cdt_connect(struct d2d_cdt *cdt, struct d2d_cdt_edge_ref *e, + const struct d2d_cdt_edge_ref *a, const struct d2d_cdt_edge_ref *b) +{ + struct d2d_cdt_edge_ref tmp; + + if (!d2d_cdt_create_edge(cdt, e)) + return FALSE; + d2d_cdt_edge_set_origin(cdt, e, d2d_cdt_edge_destination(cdt, a)); + d2d_cdt_edge_set_destination(cdt, e, d2d_cdt_edge_origin(cdt, b)); + d2d_cdt_edge_next_left(cdt, &tmp, a); + d2d_cdt_splice(cdt, e, &tmp); + d2d_cdt_edge_sym(&tmp, e); + d2d_cdt_splice(cdt, &tmp, b); + + return TRUE; +} + +static BOOL d2d_cdt_merge(struct d2d_cdt *cdt, struct d2d_cdt_edge_ref *left_outer, + struct d2d_cdt_edge_ref *left_inner, struct d2d_cdt_edge_ref *right_inner, + struct d2d_cdt_edge_ref *right_outer) +{ + struct d2d_cdt_edge_ref base_edge, tmp; + + /* Create the base edge between both parts. */ + for (;;) + { + if (d2d_cdt_leftof(cdt, d2d_cdt_edge_origin(cdt, right_inner), left_inner)) + { + d2d_cdt_edge_next_left(cdt, left_inner, left_inner); + } + else if (d2d_cdt_rightof(cdt, d2d_cdt_edge_origin(cdt, left_inner), right_inner)) + { + d2d_cdt_edge_sym(&tmp, right_inner); + d2d_cdt_edge_next_origin(cdt, right_inner, &tmp); + } + else + { + break; + } + } + + d2d_cdt_edge_sym(&tmp, right_inner); + if (!d2d_cdt_connect(cdt, &base_edge, &tmp, left_inner)) + return FALSE; + if (d2d_cdt_edge_origin(cdt, left_inner) == d2d_cdt_edge_origin(cdt, left_outer)) + d2d_cdt_edge_sym(left_outer, &base_edge); + if (d2d_cdt_edge_origin(cdt, right_inner) == d2d_cdt_edge_origin(cdt, right_outer)) + *right_outer = base_edge; + + for (;;) + { + struct d2d_cdt_edge_ref left_candidate, right_candidate, sym_base_edge; + BOOL left_valid, right_valid; + + /* Find the left candidate. */ + d2d_cdt_edge_sym(&sym_base_edge, &base_edge); + d2d_cdt_edge_next_origin(cdt, &left_candidate, &sym_base_edge); + if ((left_valid = d2d_cdt_leftof(cdt, d2d_cdt_edge_destination(cdt, &left_candidate), &sym_base_edge))) + { + d2d_cdt_edge_next_origin(cdt, &tmp, &left_candidate); + while (d2d_cdt_edge_destination(cdt, &tmp) != d2d_cdt_edge_destination(cdt, &sym_base_edge) + && d2d_cdt_incircle(cdt, + d2d_cdt_edge_origin(cdt, &sym_base_edge), d2d_cdt_edge_destination(cdt, &sym_base_edge), + d2d_cdt_edge_destination(cdt, &left_candidate), d2d_cdt_edge_destination(cdt, &tmp))) + { + d2d_cdt_destroy_edge(cdt, &left_candidate); + left_candidate = tmp; + d2d_cdt_edge_next_origin(cdt, &tmp, &left_candidate); + } + } + d2d_cdt_edge_sym(&left_candidate, &left_candidate); + + /* Find the right candidate. */ + d2d_cdt_edge_prev_origin(cdt, &right_candidate, &base_edge); + if ((right_valid = d2d_cdt_rightof(cdt, d2d_cdt_edge_destination(cdt, &right_candidate), &base_edge))) + { + d2d_cdt_edge_prev_origin(cdt, &tmp, &right_candidate); + while (d2d_cdt_edge_destination(cdt, &tmp) != d2d_cdt_edge_destination(cdt, &base_edge) + && d2d_cdt_incircle(cdt, + d2d_cdt_edge_origin(cdt, &sym_base_edge), d2d_cdt_edge_destination(cdt, &sym_base_edge), + d2d_cdt_edge_destination(cdt, &right_candidate), d2d_cdt_edge_destination(cdt, &tmp))) + { + d2d_cdt_destroy_edge(cdt, &right_candidate); + right_candidate = tmp; + d2d_cdt_edge_prev_origin(cdt, &tmp, &right_candidate); + } + } + + if (!left_valid && !right_valid) + break; + + /* Connect the appropriate candidate with the base edge. */ + if (!left_valid || (right_valid && d2d_cdt_incircle(cdt, + d2d_cdt_edge_origin(cdt, &left_candidate), d2d_cdt_edge_destination(cdt, &left_candidate), + d2d_cdt_edge_origin(cdt, &right_candidate), d2d_cdt_edge_destination(cdt, &right_candidate)))) + { + if (!d2d_cdt_connect(cdt, &base_edge, &right_candidate, &sym_base_edge)) + return FALSE; + } + else + { + if (!d2d_cdt_connect(cdt, &base_edge, &sym_base_edge, &left_candidate)) + return FALSE; + } + } + + return TRUE; +} + +/* Create a Delaunay triangulation from a set of vertices. This is an + * implementation of the divide-and-conquer algorithm described by Guibas and + * Stolfi. Should be called with at least two vertices. */ +static BOOL d2d_cdt_triangulate(struct d2d_cdt *cdt, size_t start_vertex, size_t vertex_count, + struct d2d_cdt_edge_ref *left_edge, struct d2d_cdt_edge_ref *right_edge) +{ + struct d2d_cdt_edge_ref left_inner, left_outer, right_inner, right_outer, tmp; + size_t cut; + + /* Only two vertices, create a single edge. */ + if (vertex_count == 2) + { + struct d2d_cdt_edge_ref a; + + if (!d2d_cdt_create_edge(cdt, &a)) + return FALSE; + d2d_cdt_edge_set_origin(cdt, &a, start_vertex); + d2d_cdt_edge_set_destination(cdt, &a, start_vertex + 1); + + *left_edge = a; + d2d_cdt_edge_sym(right_edge, &a); + + return TRUE; + } + + /* Three vertices, create a triangle. */ + if (vertex_count == 3) + { + struct d2d_cdt_edge_ref a, b, c; + float det; + + if (!d2d_cdt_create_edge(cdt, &a)) + return FALSE; + if (!d2d_cdt_create_edge(cdt, &b)) + return FALSE; + d2d_cdt_edge_sym(&tmp, &a); + d2d_cdt_splice(cdt, &tmp, &b); + + d2d_cdt_edge_set_origin(cdt, &a, start_vertex); + d2d_cdt_edge_set_destination(cdt, &a, start_vertex + 1); + d2d_cdt_edge_set_origin(cdt, &b, start_vertex + 1); + d2d_cdt_edge_set_destination(cdt, &b, start_vertex + 2); + + det = d2d_cdt_ccw(cdt, start_vertex, start_vertex + 1, start_vertex + 2); + if (det != 0.0f && !d2d_cdt_connect(cdt, &c, &b, &a)) + return FALSE; + + if (det < 0.0f) + { + d2d_cdt_edge_sym(left_edge, &c); + *right_edge = c; + } + else + { + *left_edge = a; + d2d_cdt_edge_sym(right_edge, &b); + } + + return TRUE; + } + + /* More than tree vertices, divide. */ + cut = vertex_count / 2; + if (!d2d_cdt_triangulate(cdt, start_vertex, cut, &left_outer, &left_inner)) + return FALSE; + if (!d2d_cdt_triangulate(cdt, start_vertex + cut, vertex_count - cut, &right_inner, &right_outer)) + return FALSE; + /* Merge the left and right parts. */ + if (!d2d_cdt_merge(cdt, &left_outer, &left_inner, &right_inner, &right_outer)) + return FALSE; + + *left_edge = left_outer; + *right_edge = right_outer; + return TRUE; +} + +static int d2d_cdt_compare_vertices(const void *a, const void *b) +{ + const D2D1_POINT_2F *p0 = a; + const D2D1_POINT_2F *p1 = b; + float diff = p0->x - p1->x; + + if (diff == 0.0f) + diff = p0->y - p1->y; + + return diff == 0.0f ? 0 : (diff > 0.0f ? 1 : -1); +} + +/* Determine whether a given point is inside the geometry, using the current + * fill mode rule. */ +static BOOL d2d_path_geometry_point_inside(const struct d2d_geometry *geometry, const D2D1_POINT_2F *probe) +{ + const D2D1_POINT_2F *p0, *p1; + D2D1_POINT_2F v_p, v_probe; + unsigned int score; + size_t i, j; + + for (i = 0, score = 0; i < geometry->u.path.figure_count; ++i) + { + const struct d2d_figure *figure = &geometry->u.path.figures[i]; + + p0 = &figure->vertices[figure->vertex_count - 1]; + for (j = 0; j < figure->vertex_count; p0 = p1, ++j) + { + p1 = &figure->vertices[j]; + d2d_point_subtract(&v_p, p1, p0); + d2d_point_subtract(&v_probe, probe, p0); + + if ((probe->y < p0->y) != (probe->y < p1->y) && v_probe.x < v_p.x * (v_probe.y / v_p.y)) + { + if (geometry->u.path.fill_mode == D2D1_FILL_MODE_ALTERNATE || (probe->y < p0->y)) + ++score; + else + --score; + } + } + } + + return geometry->u.path.fill_mode == D2D1_FILL_MODE_ALTERNATE ? score & 1 : score; +} + +static BOOL d2d_path_geometry_add_face(struct d2d_geometry *geometry, const struct d2d_cdt *cdt, + const struct d2d_cdt_edge_ref *base_edge) +{ + struct d2d_cdt_edge_ref tmp; + struct d2d_face *face; + D2D1_POINT_2F probe; + + if (cdt->edges[base_edge->idx].flags & D2D_CDT_EDGE_FLAG_VISITED(base_edge->r)) + return TRUE; + + if (!d2d_array_reserve((void **)&geometry->faces, &geometry->faces_size, + geometry->face_count + 1, sizeof(*geometry->faces))) + { + ERR("Failed to grow faces array.\n"); + return FALSE; + } + + face = &geometry->faces[geometry->face_count]; + + /* It may seem tempting to use the center of the face as probe origin, but + * multiplying by powers of two works much better for preserving accuracy. */ + + tmp = *base_edge; + cdt->edges[tmp.idx].flags |= D2D_CDT_EDGE_FLAG_VISITED(tmp.r); + face->v[0] = d2d_cdt_edge_origin(cdt, &tmp); + probe.x = cdt->vertices[d2d_cdt_edge_origin(cdt, &tmp)].x * 0.25f; + probe.y = cdt->vertices[d2d_cdt_edge_origin(cdt, &tmp)].y * 0.25f; + + d2d_cdt_edge_next_left(cdt, &tmp, &tmp); + cdt->edges[tmp.idx].flags |= D2D_CDT_EDGE_FLAG_VISITED(tmp.r); + face->v[1] = d2d_cdt_edge_origin(cdt, &tmp); + probe.x += cdt->vertices[d2d_cdt_edge_origin(cdt, &tmp)].x * 0.25f; + probe.y += cdt->vertices[d2d_cdt_edge_origin(cdt, &tmp)].y * 0.25f; + + d2d_cdt_edge_next_left(cdt, &tmp, &tmp); + cdt->edges[tmp.idx].flags |= D2D_CDT_EDGE_FLAG_VISITED(tmp.r); + face->v[2] = d2d_cdt_edge_origin(cdt, &tmp); + probe.x += cdt->vertices[d2d_cdt_edge_origin(cdt, &tmp)].x * 0.50f; + probe.y += cdt->vertices[d2d_cdt_edge_origin(cdt, &tmp)].y * 0.50f; + + d2d_cdt_edge_next_left(cdt, &tmp, &tmp); + if (tmp.idx == base_edge->idx && d2d_path_geometry_point_inside(geometry, &probe)) + ++geometry->face_count; + + return TRUE; +} + +static BOOL d2d_cdt_generate_faces(const struct d2d_cdt *cdt, struct d2d_geometry *geometry) +{ + struct d2d_cdt_edge_ref base_edge; + size_t i; + + for (i = 0; i < cdt->edge_count; ++i) + { + if (cdt->edges[i].flags & D2D_CDT_EDGE_FLAG_FREED) + continue; + + base_edge.idx = i; + base_edge.r = 0; + if (!d2d_path_geometry_add_face(geometry, cdt, &base_edge)) + goto fail; + d2d_cdt_edge_sym(&base_edge, &base_edge); + if (!d2d_path_geometry_add_face(geometry, cdt, &base_edge)) + goto fail; + } + + return TRUE; + +fail: + HeapFree(GetProcessHeap(), 0, geometry->faces); + geometry->faces = NULL; + geometry->faces_size = 0; + geometry->face_count = 0; + return FALSE; +} + +static BOOL d2d_cdt_fixup(struct d2d_cdt *cdt, const struct d2d_cdt_edge_ref *base_edge) +{ + struct d2d_cdt_edge_ref candidate, next, new_base; + unsigned int count = 0; + + d2d_cdt_edge_next_left(cdt, &next, base_edge); + if (next.idx == base_edge->idx) + { + ERR("Degenerate face.\n"); + return FALSE; + } + + candidate = next; + while (d2d_cdt_edge_destination(cdt, &next) != d2d_cdt_edge_origin(cdt, base_edge)) + { + if (d2d_cdt_incircle(cdt, d2d_cdt_edge_origin(cdt, base_edge), d2d_cdt_edge_destination(cdt, base_edge), + d2d_cdt_edge_destination(cdt, &candidate), d2d_cdt_edge_destination(cdt, &next))) + candidate = next; + d2d_cdt_edge_next_left(cdt, &next, &next); + ++count; + } + + if (count > 1) + { + if (!d2d_cdt_connect(cdt, &new_base, &candidate, base_edge)) + return FALSE; + if (!d2d_cdt_fixup(cdt, &new_base)) + return FALSE; + d2d_cdt_edge_sym(&new_base, &new_base); + if (!d2d_cdt_fixup(cdt, &new_base)) + return FALSE; + } + + return TRUE; +} + +static void d2d_cdt_cut_edges(struct d2d_cdt *cdt, struct d2d_cdt_edge_ref *end_edge, + const struct d2d_cdt_edge_ref *base_edge, size_t start_vertex, size_t end_vertex) +{ + struct d2d_cdt_edge_ref next; + + d2d_cdt_edge_next_left(cdt, &next, base_edge); + if (d2d_cdt_edge_destination(cdt, &next) == end_vertex) + { + *end_edge = next; + return; + } + + if (d2d_cdt_ccw(cdt, d2d_cdt_edge_destination(cdt, &next), end_vertex, start_vertex) > 0.0f) + d2d_cdt_edge_next_left(cdt, &next, &next); + + d2d_cdt_edge_sym(&next, &next); + d2d_cdt_cut_edges(cdt, end_edge, &next, start_vertex, end_vertex); + d2d_cdt_destroy_edge(cdt, &next); +} + +static BOOL d2d_cdt_insert_segment(struct d2d_cdt *cdt, struct d2d_geometry *geometry, + const struct d2d_cdt_edge_ref *origin, size_t end_vertex) +{ + struct d2d_cdt_edge_ref base_edge, current, next, target; + + for (current = *origin;; current = next) + { + d2d_cdt_edge_next_origin(cdt, &next, ¤t); + + if (d2d_cdt_edge_destination(cdt, ¤t) == end_vertex) + return TRUE; + + if (d2d_cdt_rightof(cdt, end_vertex, &next) && d2d_cdt_leftof(cdt, end_vertex, ¤t)) + { + d2d_cdt_edge_next_left(cdt, &base_edge, ¤t); + + d2d_cdt_edge_sym(&base_edge, &base_edge); + d2d_cdt_cut_edges(cdt, &target, &base_edge, d2d_cdt_edge_origin(cdt, origin), end_vertex); + d2d_cdt_destroy_edge(cdt, &base_edge); + + if (!d2d_cdt_connect(cdt, &base_edge, &target, ¤t)) + return FALSE; + if (!d2d_cdt_fixup(cdt, &base_edge)) + return FALSE; + d2d_cdt_edge_sym(&base_edge, &base_edge); + if (!d2d_cdt_fixup(cdt, &base_edge)) + return FALSE; + + return TRUE; + } + + if (next.idx == origin->idx) + { + ERR("Triangle not found.\n"); + return FALSE; + } + } +} + +static BOOL d2d_cdt_insert_segments(struct d2d_cdt *cdt, struct d2d_geometry *geometry) +{ + size_t start_vertex, end_vertex, i, j, k; + const struct d2d_figure *figure; + struct d2d_cdt_edge_ref edge; + const D2D1_POINT_2F *p; + + for (i = 0; i < geometry->u.path.figure_count; ++i) + { + figure = &geometry->u.path.figures[i]; + + p = bsearch(&figure->vertices[figure->vertex_count - 1], cdt->vertices, + geometry->vertex_count, sizeof(*p), d2d_cdt_compare_vertices); + start_vertex = p - cdt->vertices; + + for (j = 0; j < figure->vertex_count; start_vertex = end_vertex, ++j) + { + p = bsearch(&figure->vertices[j], cdt->vertices, + geometry->vertex_count, sizeof(*p), d2d_cdt_compare_vertices); + end_vertex = p - cdt->vertices; + + if (start_vertex == end_vertex) + continue; + + for (k = 0; k < cdt->edge_count; ++k) + { + if (cdt->edges[k].flags & D2D_CDT_EDGE_FLAG_FREED) + continue; + + edge.idx = k; + edge.r = 0; + + if (d2d_cdt_edge_origin(cdt, &edge) == start_vertex) + { + if (!d2d_cdt_insert_segment(cdt, geometry, &edge, end_vertex)) + return FALSE; + break; + } + d2d_cdt_edge_sym(&edge, &edge); + if (d2d_cdt_edge_origin(cdt, &edge) == start_vertex) + { + if (!d2d_cdt_insert_segment(cdt, geometry, &edge, end_vertex)) + return FALSE; + break; + } + } + } + } + + return TRUE; +} + +/* Intersect the geometry's segments with themselves. This uses the + * straightforward approach of testing everything against everything, but + * there certainly exist more scalable algorithms for this. */ +/* FIXME: Beziers can't currently self-intersect. */ +static BOOL d2d_geometry_intersect_self(struct d2d_geometry *geometry) +{ + D2D1_POINT_2F p0, p1, q0, q1, v_p, v_q, v_qp, intersection; + struct d2d_figure *figure_p, *figure_q; + size_t i, j, k, l, limit; + float s, t, det; + + for (i = 0; i < geometry->u.path.figure_count; ++i) + { + figure_p = &geometry->u.path.figures[i]; + p0 = figure_p->vertices[figure_p->vertex_count - 1]; + for (k = 0; k < figure_p->vertex_count; p0 = p1, ++k) + { + p1 = figure_p->vertices[k]; + d2d_point_subtract(&v_p, &p1, &p0); + for (j = 0; j < i || (j == i && k); ++j) + { + figure_q = &geometry->u.path.figures[j]; + limit = j == i ? k - 1 : figure_q->vertex_count; + q0 = figure_q->vertices[figure_q->vertex_count - 1]; + for (l = 0; l < limit; q0 = q1, ++l) + { + q1 = figure_q->vertices[l]; + d2d_point_subtract(&v_q, &q1, &q0); + d2d_point_subtract(&v_qp, &p0, &q0); + + det = v_p.x * v_q.y - v_p.y * v_q.x; + if (det == 0.0f) + continue; + + s = (v_q.x * v_qp.y - v_q.y * v_qp.x) / det; + t = (v_p.x * v_qp.y - v_p.y * v_qp.x) / det; + + if (s < 0.0f || s > 1.0f || t < 0.0f || t > 1.0f) + continue; + + intersection.x = p0.x + v_p.x * s; + intersection.y = p0.y + v_p.y * s; + + if (t > 0.0f && t < 1.0f) + { + if (!d2d_figure_insert_vertex(figure_q, l, intersection)) + return FALSE; + if (j == i) + ++k; + ++limit; + ++l; + } + + if (s > 0.0f && s < 1.0f) + { + if (!d2d_figure_insert_vertex(figure_p, k, intersection)) + return FALSE; + p1 = intersection; + d2d_point_subtract(&v_p, &p1, &p0); + } + } + } + } + } + + return TRUE; +} + +static HRESULT d2d_path_geometry_triangulate(struct d2d_geometry *geometry) +{ + struct d2d_cdt_edge_ref left_edge, right_edge; + size_t vertex_count, i, j; + struct d2d_cdt cdt = {0}; + D2D1_POINT_2F *vertices; + + for (i = 0, vertex_count = 0; i < geometry->u.path.figure_count; ++i) + { + vertex_count += geometry->u.path.figures[i].vertex_count; + } + + if (vertex_count < 3) + { + WARN("Geometry has %lu vertices.\n", (long)vertex_count); + return S_OK; + } + + if (!(vertices = HeapAlloc(GetProcessHeap(), 0, vertex_count * sizeof(*vertices)))) + return E_OUTOFMEMORY; + + for (i = 0, j = 0; i < geometry->u.path.figure_count; ++i) + { + memcpy(&vertices[j], geometry->u.path.figures[i].vertices, + geometry->u.path.figures[i].vertex_count * sizeof(*vertices)); + j += geometry->u.path.figures[i].vertex_count; + } + + /* Sort vertices, eliminate duplicates. */ + qsort(vertices, vertex_count, sizeof(*vertices), d2d_cdt_compare_vertices); + for (i = 1; i < vertex_count; ++i) + { + if (!memcmp(&vertices[i - 1], &vertices[i], sizeof(*vertices))) + { + --vertex_count; + memmove(&vertices[i], &vertices[i + 1], (vertex_count - i) * sizeof(*vertices)); + --i; + } + } + + geometry->vertices = vertices; + geometry->vertex_count = vertex_count; + + cdt.free_edge = ~0u; + cdt.vertices = vertices; + if (!d2d_cdt_triangulate(&cdt, 0, vertex_count, &left_edge, &right_edge)) + goto fail; + if (!d2d_cdt_insert_segments(&cdt, geometry)) + goto fail; + if (!d2d_cdt_generate_faces(&cdt, geometry)) + goto fail; + + HeapFree(GetProcessHeap(), 0, cdt.edges); + return S_OK; + +fail: + geometry->vertices = NULL; + geometry->vertex_count = 0; + HeapFree(GetProcessHeap(), 0, vertices); + HeapFree(GetProcessHeap(), 0, cdt.edges); + return E_FAIL; +} + +static BOOL d2d_path_geometry_add_figure(struct d2d_geometry *geometry) +{ + struct d2d_figure *figure; + + if (!d2d_array_reserve((void **)&geometry->u.path.figures, &geometry->u.path.figures_size, + geometry->u.path.figure_count + 1, sizeof(*geometry->u.path.figures))) + { + ERR("Failed to grow figures array.\n"); + return FALSE; + } + + figure = &geometry->u.path.figures[geometry->u.path.figure_count]; + memset(figure, 0, sizeof(*figure)); + + ++geometry->u.path.figure_count; + return TRUE; +} + +static void d2d_geometry_destroy(struct d2d_geometry *geometry) +{ + HeapFree(GetProcessHeap(), 0, geometry->beziers); + HeapFree(GetProcessHeap(), 0, geometry->faces); + HeapFree(GetProcessHeap(), 0, geometry->vertices); + HeapFree(GetProcessHeap(), 0, geometry); +} + +static void d2d_geometry_init(struct d2d_geometry *geometry, const struct ID2D1GeometryVtbl *vtbl) +{ + geometry->ID2D1Geometry_iface.lpVtbl = vtbl; + geometry->refcount = 1; +} + static inline struct d2d_geometry *impl_from_ID2D1GeometrySink(ID2D1GeometrySink *iface) { - return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1GeometrySink_iface); + return CONTAINING_RECORD(iface, struct d2d_geometry, u.path.ID2D1GeometrySink_iface); } static HRESULT STDMETHODCALLTYPE d2d_geometry_sink_QueryInterface(ID2D1GeometrySink *iface, REFIID iid, void **out) @@ -67,7 +1035,11 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_SetFillMode(ID2D1GeometrySink *iface, D2D1_FILL_MODE mode) { - FIXME("iface %p, mode %#x stub!\n", iface, mode); + struct d2d_geometry *geometry = impl_from_ID2D1GeometrySink(iface); + + TRACE("iface %p, mode %#x.\n", iface, mode); + + geometry->u.path.fill_mode = mode; } static void STDMETHODCALLTYPE d2d_geometry_sink_SetSegmentFlags(ID2D1GeometrySink *iface, D2D1_PATH_SEGMENT flags) @@ -80,80 +1052,177 @@ { struct d2d_geometry *geometry = impl_from_ID2D1GeometrySink(iface); - FIXME("iface %p, start_point {%.8e, %.8e}, figure_begin %#x stub!\n", + TRACE("iface %p, start_point {%.8e, %.8e}, figure_begin %#x.\n", iface, start_point.x, start_point.y, figure_begin); - if (geometry->state != D2D_GEOMETRY_STATE_OPEN) + if (geometry->u.path.state != D2D_GEOMETRY_STATE_OPEN) + { + geometry->u.path.state = D2D_GEOMETRY_STATE_ERROR; + return; + } + + if (figure_begin != D2D1_FIGURE_BEGIN_FILLED) + FIXME("Ignoring figure_begin %#x.\n", figure_begin); + + if (!d2d_path_geometry_add_figure(geometry)) { - geometry->state = D2D_GEOMETRY_STATE_ERROR; + ERR("Failed to add figure.\n"); + geometry->u.path.state = D2D_GEOMETRY_STATE_ERROR; return; } - geometry->state = D2D_GEOMETRY_STATE_FIGURE; - ++geometry->figure_count; - ++geometry->segment_count; + + if (!d2d_figure_add_vertex(&geometry->u.path.figures[geometry->u.path.figure_count - 1], start_point)) + ERR("Failed to add vertex.\n"); + + geometry->u.path.state = D2D_GEOMETRY_STATE_FIGURE; + ++geometry->u.path.segment_count; } static void STDMETHODCALLTYPE d2d_geometry_sink_AddLines(ID2D1GeometrySink *iface, const D2D1_POINT_2F *points, UINT32 count) { struct d2d_geometry *geometry = impl_from_ID2D1GeometrySink(iface); + unsigned int i; - FIXME("iface %p, points %p, count %u stub!\n", iface, points, count); + TRACE("iface %p, points %p, count %u.\n", iface, points, count); - if (geometry->state != D2D_GEOMETRY_STATE_FIGURE) + if (geometry->u.path.state != D2D_GEOMETRY_STATE_FIGURE) { - geometry->state = D2D_GEOMETRY_STATE_ERROR; + geometry->u.path.state = D2D_GEOMETRY_STATE_ERROR; return; } - geometry->segment_count += count; + for (i = 0; i < count; ++i) + { + if (!d2d_figure_add_vertex(&geometry->u.path.figures[geometry->u.path.figure_count - 1], points[i])) + { + ERR("Failed to add vertex.\n"); + return; + } + } + + geometry->u.path.segment_count += count; } static void STDMETHODCALLTYPE d2d_geometry_sink_AddBeziers(ID2D1GeometrySink *iface, const D2D1_BEZIER_SEGMENT *beziers, UINT32 count) { struct d2d_geometry *geometry = impl_from_ID2D1GeometrySink(iface); + struct d2d_figure *figure = &geometry->u.path.figures[geometry->u.path.figure_count - 1]; + D2D1_POINT_2F p; + unsigned int i; - FIXME("iface %p, beziers %p, count %u stub!\n", iface, beziers, count); + TRACE("iface %p, beziers %p, count %u.\n", iface, beziers, count); - if (geometry->state != D2D_GEOMETRY_STATE_FIGURE) + if (geometry->u.path.state != D2D_GEOMETRY_STATE_FIGURE) { - geometry->state = D2D_GEOMETRY_STATE_ERROR; + geometry->u.path.state = D2D_GEOMETRY_STATE_ERROR; return; } - geometry->segment_count += count; + for (i = 0; i < count; ++i) + { + /* FIXME: This tries to approximate a cubic bezier with a quadratic one. */ + p.x = (beziers[i].point1.x + beziers[i].point2.x) * 0.75f; + p.y = (beziers[i].point1.y + beziers[i].point2.y) * 0.75f; + p.x -= (figure->vertices[figure->vertex_count - 1].x + beziers[i].point3.x) * 0.25f; + p.y -= (figure->vertices[figure->vertex_count - 1].y + beziers[i].point3.y) * 0.25f; + if (!d2d_figure_add_bezier(figure, figure->vertices[figure->vertex_count - 1], p, beziers[i].point3)) + { + ERR("Failed to add bezier.\n"); + return; + } + } + + geometry->u.path.segment_count += count; } static void STDMETHODCALLTYPE d2d_geometry_sink_EndFigure(ID2D1GeometrySink *iface, D2D1_FIGURE_END figure_end) { struct d2d_geometry *geometry = impl_from_ID2D1GeometrySink(iface); - FIXME("iface %p, figure_end %#x stub!\n", iface, figure_end); + TRACE("iface %p, figure_end %#x.\n", iface, figure_end); - if (geometry->state != D2D_GEOMETRY_STATE_FIGURE) + if (geometry->u.path.state != D2D_GEOMETRY_STATE_FIGURE) { - geometry->state = D2D_GEOMETRY_STATE_ERROR; + geometry->u.path.state = D2D_GEOMETRY_STATE_ERROR; return; } - geometry->state = D2D_GEOMETRY_STATE_OPEN; + + if (figure_end != D2D1_FIGURE_END_CLOSED) + FIXME("Ignoring figure_end %#x.\n", figure_end); + + geometry->u.path.state = D2D_GEOMETRY_STATE_OPEN; +} + +static void d2d_path_geometry_free_figures(struct d2d_geometry *geometry) +{ + size_t i; + + if (!geometry->u.path.figures) + return; + + for (i = 0; i < geometry->u.path.figure_count; ++i) + { + HeapFree(GetProcessHeap(), 0, geometry->u.path.figures[i].beziers); + HeapFree(GetProcessHeap(), 0, geometry->u.path.figures[i].vertices); + } + HeapFree(GetProcessHeap(), 0, geometry->u.path.figures); + geometry->u.path.figures = NULL; + geometry->u.path.figures_size = 0; } static HRESULT STDMETHODCALLTYPE d2d_geometry_sink_Close(ID2D1GeometrySink *iface) { struct d2d_geometry *geometry = impl_from_ID2D1GeometrySink(iface); + HRESULT hr = E_FAIL; + size_t i, start; TRACE("iface %p.\n", iface); - if (geometry->state != D2D_GEOMETRY_STATE_OPEN) + if (geometry->u.path.state != D2D_GEOMETRY_STATE_OPEN) { - if (geometry->state != D2D_GEOMETRY_STATE_CLOSED) - geometry->state = D2D_GEOMETRY_STATE_ERROR; + if (geometry->u.path.state != D2D_GEOMETRY_STATE_CLOSED) + geometry->u.path.state = D2D_GEOMETRY_STATE_ERROR; return D2DERR_WRONG_STATE; } - geometry->state = D2D_GEOMETRY_STATE_CLOSED; + geometry->u.path.state = D2D_GEOMETRY_STATE_CLOSED; - return S_OK; + if (!d2d_geometry_intersect_self(geometry)) + goto done; + if (FAILED(hr = d2d_path_geometry_triangulate(geometry))) + goto done; + + for (i = 0; i < geometry->u.path.figure_count; ++i) + { + geometry->bezier_count += geometry->u.path.figures[i].bezier_count; + } + + if (!(geometry->beziers = HeapAlloc(GetProcessHeap(), 0, + geometry->bezier_count * sizeof(*geometry->beziers)))) + { + ERR("Failed to allocate beziers array.\n"); + geometry->bezier_count = 0; + hr = E_OUTOFMEMORY; + goto done; + } + + for (i = 0, start = 0; i < geometry->u.path.figure_count; ++i) + { + struct d2d_figure *figure = &geometry->u.path.figures[i]; + if (figure->bezier_count) + { + memcpy(&geometry->beziers[start], figure->beziers, + figure->bezier_count * sizeof(*figure->beziers)); + start += figure->bezier_count; + } + } + +done: + d2d_path_geometry_free_figures(geometry); + if (FAILED(hr)) + geometry->u.path.state = D2D_GEOMETRY_STATE_ERROR; + return hr; } static void STDMETHODCALLTYPE d2d_geometry_sink_AddLine(ID2D1GeometrySink *iface, D2D1_POINT_2F point) @@ -182,16 +1251,28 @@ const D2D1_QUADRATIC_BEZIER_SEGMENT *beziers, UINT32 bezier_count) { struct d2d_geometry *geometry = impl_from_ID2D1GeometrySink(iface); + struct d2d_figure *figure = &geometry->u.path.figures[geometry->u.path.figure_count - 1]; + unsigned int i; - FIXME("iface %p, beziers %p, bezier_count %u stub!\n", iface, beziers, bezier_count); + TRACE("iface %p, beziers %p, bezier_count %u.\n", iface, beziers, bezier_count); - if (geometry->state != D2D_GEOMETRY_STATE_FIGURE) + if (geometry->u.path.state != D2D_GEOMETRY_STATE_FIGURE) { - geometry->state = D2D_GEOMETRY_STATE_ERROR; + geometry->u.path.state = D2D_GEOMETRY_STATE_ERROR; return; } - geometry->segment_count += bezier_count; + for (i = 0; i < bezier_count; ++i) + { + if (!d2d_figure_add_bezier(figure, figure->vertices[figure->vertex_count - 1], + beziers[i].point1, beziers[i].point2)) + { + ERR("Failed to add bezier.\n"); + return; + } + } + + geometry->u.path.segment_count += bezier_count; } static void STDMETHODCALLTYPE d2d_geometry_sink_AddArc(ID2D1GeometrySink *iface, const D2D1_ARC_SEGMENT *arc) @@ -200,13 +1281,19 @@ FIXME("iface %p, arc %p stub!\n", iface, arc); - if (geometry->state != D2D_GEOMETRY_STATE_FIGURE) + if (geometry->u.path.state != D2D_GEOMETRY_STATE_FIGURE) + { + geometry->u.path.state = D2D_GEOMETRY_STATE_ERROR; + return; + } + + if (!d2d_figure_add_vertex(&geometry->u.path.figures[geometry->u.path.figure_count - 1], arc->point)) { - geometry->state = D2D_GEOMETRY_STATE_ERROR; + ERR("Failed to add vertex.\n"); return; } - ++geometry->segment_count; + ++geometry->u.path.segment_count; } struct ID2D1GeometrySinkVtbl d2d_geometry_sink_vtbl = @@ -271,7 +1358,10 @@ TRACE("%p decreasing refcount to %u.\n", iface, refcount); if (!refcount) - HeapFree(GetProcessHeap(), 0, geometry); + { + d2d_path_geometry_free_figures(geometry); + d2d_geometry_destroy(geometry); + } return refcount; } @@ -406,13 +1496,13 @@ TRACE("iface %p, sink %p.\n", iface, sink); - if (geometry->state != D2D_GEOMETRY_STATE_INITIAL) + if (geometry->u.path.state != D2D_GEOMETRY_STATE_INITIAL) return D2DERR_WRONG_STATE; - *sink = &geometry->ID2D1GeometrySink_iface; + *sink = &geometry->u.path.ID2D1GeometrySink_iface; ID2D1GeometrySink_AddRef(*sink); - geometry->state = D2D_GEOMETRY_STATE_OPEN; + geometry->u.path.state = D2D_GEOMETRY_STATE_OPEN; return S_OK; } @@ -430,10 +1520,10 @@ TRACE("iface %p, count %p.\n", iface, count); - if (geometry->state != D2D_GEOMETRY_STATE_CLOSED) + if (geometry->u.path.state != D2D_GEOMETRY_STATE_CLOSED) return D2DERR_WRONG_STATE; - *count = geometry->segment_count; + *count = geometry->u.path.segment_count; return S_OK; } @@ -444,10 +1534,10 @@ TRACE("iface %p, count %p.\n", iface, count); - if (geometry->state != D2D_GEOMETRY_STATE_CLOSED) + if (geometry->u.path.state != D2D_GEOMETRY_STATE_CLOSED) return D2DERR_WRONG_STATE; - *count = geometry->figure_count; + *count = geometry->u.path.figure_count; return S_OK; } @@ -479,7 +1569,255 @@ void d2d_path_geometry_init(struct d2d_geometry *geometry) { - geometry->ID2D1Geometry_iface.lpVtbl = (ID2D1GeometryVtbl *)&d2d_path_geometry_vtbl; - geometry->ID2D1GeometrySink_iface.lpVtbl = &d2d_geometry_sink_vtbl; - geometry->refcount = 1; + d2d_geometry_init(geometry, (ID2D1GeometryVtbl *)&d2d_path_geometry_vtbl); + geometry->u.path.ID2D1GeometrySink_iface.lpVtbl = &d2d_geometry_sink_vtbl; +} + +static inline struct d2d_geometry *impl_from_ID2D1RectangleGeometry(ID2D1RectangleGeometry *iface) +{ + return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface); +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_QueryInterface(ID2D1RectangleGeometry *iface, + REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_ID2D1RectangleGeometry) + || IsEqualGUID(iid, &IID_ID2D1Geometry) + || IsEqualGUID(iid, &IID_ID2D1Resource) + || IsEqualGUID(iid, &IID_IUnknown)) + { + ID2D1RectangleGeometry_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE d2d_rectangle_geometry_AddRef(ID2D1RectangleGeometry *iface) +{ + struct d2d_geometry *geometry = impl_from_ID2D1RectangleGeometry(iface); + ULONG refcount = InterlockedIncrement(&geometry->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG STDMETHODCALLTYPE d2d_rectangle_geometry_Release(ID2D1RectangleGeometry *iface) +{ + struct d2d_geometry *geometry = impl_from_ID2D1RectangleGeometry(iface); + ULONG refcount = InterlockedDecrement(&geometry->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + d2d_geometry_destroy(geometry); + + return refcount; +} + +static void STDMETHODCALLTYPE d2d_rectangle_geometry_GetFactory(ID2D1RectangleGeometry *iface, ID2D1Factory **factory) +{ + FIXME("iface %p, factory %p stub!\n", iface, factory); + + *factory = NULL; +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_GetBounds(ID2D1RectangleGeometry *iface, + const D2D1_MATRIX_3X2_F *transform, D2D1_RECT_F *bounds) +{ + FIXME("iface %p, transform %p, bounds %p stub!\n", iface, transform, bounds); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_GetWidenedBounds(ID2D1RectangleGeometry *iface, + float stroke_width, ID2D1StrokeStyle *stroke_style, const D2D1_MATRIX_3X2_F *transform, + float tolerance, D2D1_RECT_F *bounds) +{ + FIXME("iface %p, stroke_width %.8e, stroke_style %p, transform %p, tolerance %.8e, bounds %p stub!\n", + iface, stroke_width, stroke_style, transform, tolerance, bounds); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_StrokeContainsPoint(ID2D1RectangleGeometry *iface, + D2D1_POINT_2F point, float stroke_width, ID2D1StrokeStyle *stroke_style, const D2D1_MATRIX_3X2_F *transform, + float tolerance, BOOL *contains) +{ + FIXME("iface %p, point {%.8e, %.8e}, stroke_width %.8e, stroke_style %p, " + "transform %p, tolerance %.8e, contains %p stub!\n", + iface, point.x, point.y, stroke_width, stroke_style, transform, tolerance, contains); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_FillContainsPoint(ID2D1RectangleGeometry *iface, + D2D1_POINT_2F point, const D2D1_MATRIX_3X2_F *transform, float tolerance, BOOL *contains) +{ + FIXME("iface %p, point {%.8e, %.8e}, transform %p, tolerance %.8e, contains %p stub!\n", + iface, point.x, point.y, transform, tolerance, contains); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_CompareWithGeometry(ID2D1RectangleGeometry *iface, + ID2D1Geometry *geometry, const D2D1_MATRIX_3X2_F *transform, float tolerance, D2D1_GEOMETRY_RELATION *relation) +{ + FIXME("iface %p, geometry %p, transform %p, tolerance %.8e, relation %p stub!\n", + iface, geometry, transform, tolerance, relation); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_Simplify(ID2D1RectangleGeometry *iface, + D2D1_GEOMETRY_SIMPLIFICATION_OPTION option, const D2D1_MATRIX_3X2_F *transform, float tolerance, + ID2D1SimplifiedGeometrySink *sink) +{ + FIXME("iface %p, option %#x, transform %p, tolerance %.8e, sink %p stub!\n", + iface, option, transform, tolerance, sink); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_Tessellate(ID2D1RectangleGeometry *iface, + const D2D1_MATRIX_3X2_F *transform, float tolerance, ID2D1TessellationSink *sink) +{ + FIXME("iface %p, transform %p, tolerance %.8e, sink %p stub!\n", iface, transform, tolerance, sink); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_CombineWithGeometry(ID2D1RectangleGeometry *iface, + ID2D1Geometry *geometry, D2D1_COMBINE_MODE combine_mode, const D2D1_MATRIX_3X2_F *transform, + float tolerance, ID2D1SimplifiedGeometrySink *sink) +{ + FIXME("iface %p, geometry %p, combine_mode %#x, transform %p, tolerance %.8e, sink %p stub!\n", + iface, geometry, combine_mode, transform, tolerance, sink); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_Outline(ID2D1RectangleGeometry *iface, + const D2D1_MATRIX_3X2_F *transform, float tolerance, ID2D1SimplifiedGeometrySink *sink) +{ + FIXME("iface %p, transform %p, tolerance %.8e, sink %p stub!\n", iface, transform, tolerance, sink); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_ComputeArea(ID2D1RectangleGeometry *iface, + const D2D1_MATRIX_3X2_F *transform, float tolerance, float *area) +{ + FIXME("iface %p, transform %p, tolerance %.8e, area %p stub!\n", iface, transform, tolerance, area); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_ComputeLength(ID2D1RectangleGeometry *iface, + const D2D1_MATRIX_3X2_F *transform, float tolerance, float *length) +{ + FIXME("iface %p, transform %p, tolerance %.8e, length %p stub!\n", iface, transform, tolerance, length); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_ComputePointAtLength(ID2D1RectangleGeometry *iface, + float length, const D2D1_MATRIX_3X2_F *transform, float tolerance, D2D1_POINT_2F *point, + D2D1_POINT_2F *tangent) +{ + FIXME("iface %p, length %.8e, transform %p, tolerance %.8e, point %p, tangent %p stub!\n", + iface, length, transform, tolerance, point, tangent); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_Widen(ID2D1RectangleGeometry *iface, float stroke_width, + ID2D1StrokeStyle *stroke_style, const D2D1_MATRIX_3X2_F *transform, float tolerance, + ID2D1SimplifiedGeometrySink *sink) +{ + FIXME("iface %p, stroke_width %.8e, stroke_style %p, transform %p, tolerance %.8e, sink %p stub!\n", + iface, stroke_width, stroke_style, transform, tolerance, sink); + + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d2d_rectangle_geometry_GetRect(ID2D1RectangleGeometry *iface, D2D1_RECT_F *rect) +{ + struct d2d_geometry *geometry = impl_from_ID2D1RectangleGeometry(iface); + + TRACE("iface %p, rect %p.\n", iface, rect); + + *rect = geometry->u.rectangle.rect; +} + +static const struct ID2D1RectangleGeometryVtbl d2d_rectangle_geometry_vtbl = +{ + d2d_rectangle_geometry_QueryInterface, + d2d_rectangle_geometry_AddRef, + d2d_rectangle_geometry_Release, + d2d_rectangle_geometry_GetFactory, + d2d_rectangle_geometry_GetBounds, + d2d_rectangle_geometry_GetWidenedBounds, + d2d_rectangle_geometry_StrokeContainsPoint, + d2d_rectangle_geometry_FillContainsPoint, + d2d_rectangle_geometry_CompareWithGeometry, + d2d_rectangle_geometry_Simplify, + d2d_rectangle_geometry_Tessellate, + d2d_rectangle_geometry_CombineWithGeometry, + d2d_rectangle_geometry_Outline, + d2d_rectangle_geometry_ComputeArea, + d2d_rectangle_geometry_ComputeLength, + d2d_rectangle_geometry_ComputePointAtLength, + d2d_rectangle_geometry_Widen, + d2d_rectangle_geometry_GetRect, +}; + +HRESULT d2d_rectangle_geometry_init(struct d2d_geometry *geometry, const D2D1_RECT_F *rect) +{ + d2d_geometry_init(geometry, (ID2D1GeometryVtbl *)&d2d_rectangle_geometry_vtbl); + geometry->u.rectangle.rect = *rect; + + if (!(geometry->vertices = HeapAlloc(GetProcessHeap(), 0, 4 * sizeof(*geometry->vertices)))) + return E_OUTOFMEMORY; + geometry->vertex_count = 4; + if (!d2d_array_reserve((void **)&geometry->faces, &geometry->faces_size, 2, sizeof(*geometry->faces))) + { + HeapFree(GetProcessHeap(), 0, geometry->vertices); + return E_OUTOFMEMORY; + } + geometry->face_count = 2; + + geometry->vertices[0].x = min(rect->left, rect->right); + geometry->vertices[0].y = min(rect->top, rect->bottom); + geometry->vertices[1].x = min(rect->left, rect->right); + geometry->vertices[1].y = max(rect->top, rect->bottom); + geometry->vertices[2].x = max(rect->left, rect->right); + geometry->vertices[2].y = min(rect->top, rect->bottom); + geometry->vertices[3].x = max(rect->left, rect->right); + geometry->vertices[3].y = max(rect->top, rect->bottom); + + geometry->faces[0].v[0] = 0; + geometry->faces[0].v[1] = 2; + geometry->faces[0].v[2] = 1; + geometry->faces[1].v[0] = 1; + geometry->faces[1].v[1] = 2; + geometry->faces[1].v[2] = 3; + + return S_OK; +} + +struct d2d_geometry *unsafe_impl_from_ID2D1Geometry(ID2D1Geometry *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == (const ID2D1GeometryVtbl *)&d2d_path_geometry_vtbl + || iface->lpVtbl == (const ID2D1GeometryVtbl *)&d2d_rectangle_geometry_vtbl); + return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d2d1/render_target.c wine-staging-1.7.48~ubuntu12.04.1/dlls/d2d1/render_target.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d2d1/render_target.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d2d1/render_target.c 2015-07-29 19:28:54.000000000 +0000 @@ -32,18 +32,6 @@ D2D1_DRAW_TEXT_OPTIONS options; }; -static void d2d_matrix_multiply(D2D_MATRIX_3X2_F *a, const D2D_MATRIX_3X2_F *b) -{ - D2D_MATRIX_3X2_F tmp = *a; - - a->_11 = tmp._11 * b->_11 + tmp._12 * b->_21; - a->_12 = tmp._11 * b->_12 + tmp._12 * b->_22; - a->_21 = tmp._21 * b->_11 + tmp._22 * b->_21; - a->_22 = tmp._21 * b->_12 + tmp._22 * b->_22; - a->_31 = tmp._31 * b->_11 + tmp._32 * b->_21 + b->_31; - a->_32 = tmp._31 * b->_12 + tmp._32 * b->_22 + b->_32; -} - static void d2d_point_set(D2D1_POINT_2F *dst, float x, float y) { dst->x = x; @@ -139,14 +127,15 @@ --stack->count; } -static void d2d_draw(struct d2d_d3d_render_target *render_target, ID3D10Buffer *vs_cb, - ID3D10PixelShader *ps, ID3D10Buffer *ps_cb, struct d2d_brush *brush) +static void d2d_draw(struct d2d_d3d_render_target *render_target, enum d2d_shape_type shape_type, + ID3D10Buffer *ib, unsigned int index_count, ID3D10Buffer *vb, unsigned int vb_stride, + ID3D10Buffer *vs_cb, ID3D10Buffer *ps_cb, struct d2d_brush *brush) { + struct d2d_shape_resources *shape_resources = &render_target->shape_resources[shape_type]; ID3D10Device *device = render_target->device; unsigned int offset; D3D10_VIEWPORT vp; HRESULT hr; - static const float blend_factor[] = {1.0f, 1.0f, 1.0f, 1.0f}; vp.TopLeftX = 0; vp.TopLeftY = 0; @@ -163,15 +152,14 @@ ID3D10Device_ClearState(device); - ID3D10Device_IASetInputLayout(device, render_target->il); - ID3D10Device_IASetPrimitiveTopology(device, D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + ID3D10Device_IASetInputLayout(device, shape_resources->il); + ID3D10Device_IASetPrimitiveTopology(device, D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST); + ID3D10Device_IASetIndexBuffer(device, ib, DXGI_FORMAT_R16_UINT, 0); offset = 0; - ID3D10Device_IASetVertexBuffers(device, 0, 1, &render_target->vb, - &render_target->vb_stride, &offset); + ID3D10Device_IASetVertexBuffers(device, 0, 1, &vb, &vb_stride, &offset); ID3D10Device_VSSetConstantBuffers(device, 0, 1, &vs_cb); - ID3D10Device_VSSetShader(device, render_target->vs); + ID3D10Device_VSSetShader(device, shape_resources->vs); ID3D10Device_PSSetConstantBuffers(device, 0, 1, &ps_cb); - ID3D10Device_PSSetShader(device, ps); ID3D10Device_RSSetViewports(device, 1, &vp); if (render_target->clip_stack.count) { @@ -188,12 +176,14 @@ } ID3D10Device_OMSetRenderTargets(device, 1, &render_target->view, NULL); if (brush) - { - ID3D10Device_OMSetBlendState(device, render_target->bs, blend_factor, D3D10_DEFAULT_SAMPLE_MASK); - d2d_brush_bind_resources(brush, device); - } + d2d_brush_bind_resources(brush, render_target, shape_type); + else + ID3D10Device_PSSetShader(device, shape_resources->ps[D2D_BRUSH_TYPE_SOLID]); - ID3D10Device_Draw(device, 4, 0); + if (ib) + ID3D10Device_DrawIndexed(device, index_count, 0, 0); + else + ID3D10Device_Draw(device, index_count, 0); if (FAILED(hr = render_target->stateblock->lpVtbl->Apply(render_target->stateblock))) WARN("Failed to apply stateblock, hr %#x.\n", hr); @@ -242,16 +232,25 @@ if (!refcount) { + unsigned int i, j; + d2d_clip_stack_cleanup(&render_target->clip_stack); if (render_target->text_rendering_params) IDWriteRenderingParams_Release(render_target->text_rendering_params); - ID3D10PixelShader_Release(render_target->rect_bitmap_ps); - ID3D10PixelShader_Release(render_target->rect_solid_ps); ID3D10BlendState_Release(render_target->bs); ID3D10RasterizerState_Release(render_target->rs); - ID3D10VertexShader_Release(render_target->vs); ID3D10Buffer_Release(render_target->vb); - ID3D10InputLayout_Release(render_target->il); + ID3D10Buffer_Release(render_target->ib); + for (i = 0; i < D2D_SHAPE_TYPE_COUNT; ++i) + { + for (j = 0; j < D2D_BRUSH_TYPE_COUNT; ++j) + { + if (render_target->shape_resources[i].ps[j]) + ID3D10PixelShader_Release(render_target->shape_resources[i].ps[j]); + } + ID3D10VertexShader_Release(render_target->shape_resources[i].vs); + ID3D10InputLayout_Release(render_target->shape_resources[i].il); + } render_target->stateblock->lpVtbl->Release(render_target->stateblock); ID3D10RenderTargetView_Release(render_target->view); ID3D10Device_Release(render_target->device); @@ -301,14 +300,28 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapFromWicBitmap(ID2D1RenderTarget *iface, IWICBitmapSource *bitmap_source, const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **bitmap) { + const D2D1_PIXEL_FORMAT *d2d_format; D2D1_BITMAP_PROPERTIES bitmap_desc; + WICPixelFormatGUID wic_format; unsigned int bpp, data_size; D2D1_SIZE_U size; + unsigned int i; WICRect rect; UINT32 pitch; HRESULT hr; void *data; + static const struct + { + const WICPixelFormatGUID *wic; + D2D1_PIXEL_FORMAT d2d; + } + format_lookup[] = + { + {&GUID_WICPixelFormat32bppPBGRA, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}}, + {&GUID_WICPixelFormat32bppBGR, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE}}, + }; + TRACE("iface %p, bitmap_source %p, desc %p, bitmap %p.\n", iface, bitmap_source, desc, bitmap); @@ -330,28 +343,32 @@ bitmap_desc = *desc; } - if (bitmap_desc.pixelFormat.format == DXGI_FORMAT_UNKNOWN) + if (FAILED(hr = IWICBitmapSource_GetPixelFormat(bitmap_source, &wic_format))) { - WICPixelFormatGUID wic_format; + WARN("Failed to get bitmap format, hr %#x.\n", hr); + return hr; + } - if (FAILED(hr = IWICBitmapSource_GetPixelFormat(bitmap_source, &wic_format))) + for (i = 0, d2d_format = NULL; i < sizeof(format_lookup) / sizeof(*format_lookup); ++i) + { + if (IsEqualGUID(&wic_format, format_lookup[i].wic)) { - WARN("Failed to get bitmap format, hr %#x.\n", hr); - return hr; + d2d_format = &format_lookup[i].d2d; + break; } + } - if (IsEqualGUID(&wic_format, &GUID_WICPixelFormat32bppPBGRA) - || IsEqualGUID(&wic_format, &GUID_WICPixelFormat32bppBGR)) - { - bitmap_desc.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM; - } - else - { - WARN("Unsupported WIC bitmap format %s.\n", debugstr_guid(&wic_format)); - return D2DERR_UNSUPPORTED_PIXEL_FORMAT; - } + if (!d2d_format) + { + WARN("Unsupported WIC bitmap format %s.\n", debugstr_guid(&wic_format)); + return D2DERR_UNSUPPORTED_PIXEL_FORMAT; } + if (bitmap_desc.pixelFormat.format == DXGI_FORMAT_UNKNOWN) + bitmap_desc.pixelFormat.format = d2d_format->format; + if (bitmap_desc.pixelFormat.alphaMode == D2D1_ALPHA_MODE_UNKNOWN) + bitmap_desc.pixelFormat.alphaMode = d2d_format->alphaMode; + switch (bitmap_desc.pixelFormat.format) { case DXGI_FORMAT_B8G8R8A8_UNORM: @@ -549,12 +566,89 @@ const D2D1_RECT_F *rect, ID2D1Brush *brush) { struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + ID2D1RectangleGeometry *geometry; + HRESULT hr; + + TRACE("iface %p, rect %p, brush %p.\n", iface, rect, brush); + + if (FAILED(hr = ID2D1Factory_CreateRectangleGeometry(render_target->factory, rect, &geometry))) + { + ERR("Failed to create geometry, hr %#x.\n", hr); + return; + } + + ID2D1RenderTarget_FillGeometry(iface, (ID2D1Geometry *)geometry, brush, NULL); + ID2D1RectangleGeometry_Release(geometry); +} + +static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawRoundedRectangle(ID2D1RenderTarget *iface, + const D2D1_ROUNDED_RECT *rect, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) +{ + FIXME("iface %p, rect %p, brush %p, stroke_width %.8e, stroke_style %p stub!\n", + iface, rect, brush, stroke_width, stroke_style); +} + +static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRoundedRectangle(ID2D1RenderTarget *iface, + const D2D1_ROUNDED_RECT *rect, ID2D1Brush *brush) +{ + struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + ID2D1RoundedRectangleGeometry *geometry; + HRESULT hr; + + TRACE("iface %p, rect %p, brush %p.\n", iface, rect, brush); + + if (FAILED(hr = ID2D1Factory_CreateRoundedRectangleGeometry(render_target->factory, rect, &geometry))) + { + ERR("Failed to create geometry, hr %#x.\n", hr); + return; + } + + ID2D1RenderTarget_FillGeometry(iface, (ID2D1Geometry *)geometry, brush, NULL); + ID2D1RoundedRectangleGeometry_Release(geometry); +} + +static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawEllipse(ID2D1RenderTarget *iface, + const D2D1_ELLIPSE *ellipse, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) +{ + FIXME("iface %p, ellipse %p, brush %p, stroke_width %.8e, stroke_style %p stub!\n", + iface, ellipse, brush, stroke_width, stroke_style); +} + +static void STDMETHODCALLTYPE d2d_d3d_render_target_FillEllipse(ID2D1RenderTarget *iface, + const D2D1_ELLIPSE *ellipse, ID2D1Brush *brush) +{ + struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + ID2D1EllipseGeometry *geometry; + HRESULT hr; + + TRACE("iface %p, ellipse %p, brush %p.\n", iface, ellipse, brush); + + if (FAILED(hr = ID2D1Factory_CreateEllipseGeometry(render_target->factory, ellipse, &geometry))) + { + ERR("Failed to create geometry, hr %#x.\n", hr); + return; + } + + ID2D1RenderTarget_FillGeometry(iface, (ID2D1Geometry *)geometry, brush, NULL); + ID2D1EllipseGeometry_Release(geometry); +} + +static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawGeometry(ID2D1RenderTarget *iface, + ID2D1Geometry *geometry, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) +{ + FIXME("iface %p, geometry %p, brush %p, stroke_width %.8e, stroke_style %p stub!\n", + iface, geometry, brush, stroke_width, stroke_style); +} + +static void STDMETHODCALLTYPE d2d_d3d_render_target_FillGeometry(ID2D1RenderTarget *iface, + ID2D1Geometry *geometry, ID2D1Brush *brush, ID2D1Brush *opacity_brush) +{ + struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); struct d2d_brush *brush_impl = unsafe_impl_from_ID2D1Brush(brush); + const struct d2d_geometry *geometry_impl; + ID3D10Buffer *ib, *vb, *vs_cb, *ps_cb; D3D10_SUBRESOURCE_DATA buffer_data; D3D10_BUFFER_DESC buffer_desc; - ID3D10Buffer *vs_cb, *ps_cb; - ID3D10PixelShader *ps; - D2D1_COLOR_F color; float tmp_x, tmp_y; HRESULT hr; struct @@ -563,17 +657,13 @@ float _12, _22, _32, pad1; } transform; - TRACE("iface %p, rect %p, brush %p.\n", iface, rect, brush); + TRACE("iface %p, geometry %p, brush %p, opacity_brush %p.\n", iface, geometry, brush, opacity_brush); - if (brush_impl->type != D2D_BRUSH_TYPE_SOLID - && brush_impl->type != D2D_BRUSH_TYPE_BITMAP) - { - FIXME("Unhandled brush type %#x.\n", brush_impl->type); - return; - } + if (opacity_brush) + FIXME("Ignoring opacity brush %p.\n", opacity_brush); + + geometry_impl = unsafe_impl_from_ID2D1Geometry(geometry); - /* Translate from clip space to world (D2D rendertarget) space, taking the - * dpi and rendertarget transform into account. */ tmp_x = (2.0f * render_target->dpi_x) / (96.0f * render_target->pixel_size.width); tmp_y = -(2.0f * render_target->dpi_y) / (96.0f * render_target->pixel_size.height); transform._11 = render_target->drawing_state.transform._11 * tmp_x; @@ -585,18 +675,6 @@ transform._32 = render_target->drawing_state.transform._32 * tmp_y + 1.0f; transform.pad1 = 0.0f; - /* Translate from world space to object space. */ - tmp_x = min(rect->left, rect->right) + fabsf(rect->right - rect->left) / 2.0f; - tmp_y = min(rect->top, rect->bottom) + fabsf(rect->bottom - rect->top) / 2.0f; - transform._31 += tmp_x * transform._11 + tmp_y * transform._21; - transform._32 += tmp_x * transform._12 + tmp_y * transform._22; - tmp_x = fabsf(rect->right - rect->left) / 2.0f; - tmp_y = fabsf(rect->bottom - rect->top) / 2.0f; - transform._11 *= tmp_x; - transform._12 *= tmp_x; - transform._21 *= tmp_y; - transform._22 *= tmp_y; - buffer_desc.ByteWidth = sizeof(transform); buffer_desc.Usage = D3D10_USAGE_DEFAULT; buffer_desc.BindFlags = D3D10_BIND_CONSTANT_BUFFER; @@ -613,115 +691,60 @@ return; } - if (brush_impl->type == D2D_BRUSH_TYPE_BITMAP) + if (FAILED(hr = d2d_brush_get_ps_cb(brush_impl, render_target, &ps_cb))) { - struct d2d_bitmap *bitmap = brush_impl->u.bitmap.bitmap; - D2D_MATRIX_3X2_F w, b; - float dpi_scale, d; - - ps = render_target->rect_bitmap_ps; - - /* Scale for dpi. */ - w = render_target->drawing_state.transform; - dpi_scale = render_target->dpi_x / 96.0f; - w._11 *= dpi_scale; - w._21 *= dpi_scale; - w._31 *= dpi_scale; - dpi_scale = render_target->dpi_y / 96.0f; - w._12 *= dpi_scale; - w._22 *= dpi_scale; - w._32 *= dpi_scale; - - /* Scale for bitmap size and dpi. */ - b = brush_impl->transform; - dpi_scale = bitmap->pixel_size.width * (bitmap->dpi_x / 96.0f); - b._11 *= dpi_scale; - b._21 *= dpi_scale; - dpi_scale = bitmap->pixel_size.height * (bitmap->dpi_y / 96.0f); - b._12 *= dpi_scale; - b._22 *= dpi_scale; - - d2d_matrix_multiply(&b, &w); - - /* Invert the matrix. (Because the matrix is applied to the sampling - * coordinates. I.e., to scale the bitmap by 2 we need to divide the - * coordinates by 2.) */ - d = b._11 * b._22 - b._21 * b._12; - if (d != 0.0f) - { - transform._11 = b._22 / d; - transform._21 = -b._21 / d; - transform._31 = (b._21 * b._32 - b._31 * b._22) / d; - transform._12 = -b._12 / d; - transform._22 = b._11 / d; - transform._32 = -(b._11 * b._32 - b._31 * b._12) / d; - } - transform.pad1 = brush_impl->opacity; - - buffer_desc.ByteWidth = sizeof(transform); - buffer_data.pSysMem = &transform; + WARN("Failed to get ps constant buffer, hr %#x.\n", hr); + ID3D10Buffer_Release(vs_cb); + return; } - else - { - ps = render_target->rect_solid_ps; - color = brush_impl->u.solid.color; - color.a *= brush_impl->opacity; + buffer_desc.ByteWidth = geometry_impl->face_count * sizeof(*geometry_impl->faces); + buffer_desc.BindFlags = D3D10_BIND_INDEX_BUFFER; + buffer_data.pSysMem = geometry_impl->faces; - buffer_desc.ByteWidth = sizeof(color); - buffer_data.pSysMem = &color; + if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, &buffer_desc, &buffer_data, &ib))) + { + WARN("Failed to create index buffer, hr %#x.\n", hr); + goto done; } - if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, &buffer_desc, &buffer_data, &ps_cb))) + buffer_desc.ByteWidth = geometry_impl->vertex_count * sizeof(*geometry_impl->vertices); + buffer_desc.BindFlags = D3D10_BIND_VERTEX_BUFFER; + buffer_data.pSysMem = geometry_impl->vertices; + + if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, &buffer_desc, &buffer_data, &vb))) { - WARN("Failed to create constant buffer, hr %#x.\n", hr); - ID3D10Buffer_Release(vs_cb); - return; + ERR("Failed to create vertex buffer, hr %#x.\n", hr); + ID3D10Buffer_Release(ib); + goto done; } - d2d_draw(render_target, vs_cb, ps, ps_cb, brush_impl); + d2d_draw(render_target, D2D_SHAPE_TYPE_TRIANGLE, ib, 3 * geometry_impl->face_count, vb, + sizeof(*geometry_impl->vertices), vs_cb, ps_cb, brush_impl); - ID3D10Buffer_Release(ps_cb); - ID3D10Buffer_Release(vs_cb); -} + ID3D10Buffer_Release(vb); + ID3D10Buffer_Release(ib); -static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawRoundedRectangle(ID2D1RenderTarget *iface, - const D2D1_ROUNDED_RECT *rect, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) -{ - FIXME("iface %p, rect %p, brush %p, stroke_width %.8e, stroke_style %p stub!\n", - iface, rect, brush, stroke_width, stroke_style); -} - -static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRoundedRectangle(ID2D1RenderTarget *iface, - const D2D1_ROUNDED_RECT *rect, ID2D1Brush *brush) -{ - FIXME("iface %p, rect %p, brush %p stub!\n", iface, rect, brush); -} + if (geometry_impl->bezier_count) + { + buffer_desc.ByteWidth = geometry_impl->bezier_count * sizeof(*geometry_impl->beziers); + buffer_data.pSysMem = geometry_impl->beziers; -static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawEllipse(ID2D1RenderTarget *iface, - const D2D1_ELLIPSE *ellipse, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) -{ - FIXME("iface %p, ellipse %p, brush %p, stroke_width %.8e, stroke_style %p stub!\n", - iface, ellipse, brush, stroke_width, stroke_style); -} + if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, &buffer_desc, &buffer_data, &vb))) + { + ERR("Failed to create beziers vertex buffer, hr %#x.\n", hr); + goto done; + } -static void STDMETHODCALLTYPE d2d_d3d_render_target_FillEllipse(ID2D1RenderTarget *iface, - const D2D1_ELLIPSE *ellipse, ID2D1Brush *brush) -{ - FIXME("iface %p, ellipse %p, brush %p stub!\n", iface, ellipse, brush); -} + d2d_draw(render_target, D2D_SHAPE_TYPE_BEZIER, NULL, 3 * geometry_impl->bezier_count, vb, + sizeof(*geometry_impl->beziers->v), vs_cb, ps_cb, brush_impl); -static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawGeometry(ID2D1RenderTarget *iface, - ID2D1Geometry *geometry, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) -{ - FIXME("iface %p, geometry %p, brush %p, stroke_width %.8e, stroke_style %p stub!\n", - iface, geometry, brush, stroke_width, stroke_style); -} + ID3D10Buffer_Release(vb); + } -static void STDMETHODCALLTYPE d2d_d3d_render_target_FillGeometry(ID2D1RenderTarget *iface, - ID2D1Geometry *geometry, ID2D1Brush *brush, ID2D1Brush *opacity_brush) -{ - FIXME("iface %p, geometry %p, brush %p, opacity_brush %p stub!\n", iface, geometry, brush, opacity_brush); +done: + ID3D10Buffer_Release(ps_cb); + ID3D10Buffer_Release(vs_cb); } static void STDMETHODCALLTYPE d2d_d3d_render_target_FillMesh(ID2D1RenderTarget *iface, @@ -871,6 +894,10 @@ if (measuring_mode) FIXME("Ignoring measuring mode %#x.\n", measuring_mode); + if (render_target->text_rendering_params) + FIXME("Ignoring text rendering parameters %p.\n", render_target->text_rendering_params); + if (render_target->drawing_state.textAntialiasMode != D2D1_TEXT_ANTIALIAS_MODE_ALIASED) + FIXME("Ignoring text antialiasing mode %#x.\n", render_target->drawing_state.textAntialiasMode); if (FAILED(hr = ID2D1Factory_CreatePathGeometry(render_target->factory, &geometry))) { @@ -1145,7 +1172,8 @@ return; } - d2d_draw(render_target, vs_cb, render_target->rect_solid_ps, ps_cb, NULL); + d2d_draw(render_target, D2D_SHAPE_TYPE_TRIANGLE, render_target->ib, 6, + render_target->vb, render_target->vb_stride, vs_cb, ps_cb, NULL); ID3D10Buffer_Release(ps_cb); ID3D10Buffer_Release(vs_cb); @@ -1172,10 +1200,11 @@ static D2D1_PIXEL_FORMAT * STDMETHODCALLTYPE d2d_d3d_render_target_GetPixelFormat(ID2D1RenderTarget *iface, D2D1_PIXEL_FORMAT *format) { - FIXME("iface %p, format %p stub!\n", iface, format); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + + TRACE("iface %p, format %p.\n", iface, format); - format->format = DXGI_FORMAT_UNKNOWN; - format->alphaMode = D2D1_ALPHA_MODE_UNKNOWN; + *format = render_target->format; return format; } @@ -1458,13 +1487,19 @@ D3D10_BUFFER_DESC buffer_desc; D3D10_BLEND_DESC blend_desc; ID3D10Resource *resource; + unsigned int i, j; HRESULT hr; - static const D3D10_INPUT_ELEMENT_DESC il_desc[] = + static const D3D10_INPUT_ELEMENT_DESC il_desc_triangle[] = { {"POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D10_INPUT_PER_VERTEX_DATA, 0}, }; - static const DWORD vs_code[] = + static const D3D10_INPUT_ELEMENT_DESC il_desc_bezier[] = + { + {"POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D10_INPUT_PER_VERTEX_DATA, 0}, + {"TEXCOORD", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 8, D3D10_INPUT_PER_VERTEX_DATA, 0}, + }; + static const DWORD vs_code_triangle[] = { /* float3x2 transform; * @@ -1483,7 +1518,32 @@ 0x00000000, 0x00208246, 0x00000000, 0x00000001, 0x05000036, 0x001020c2, 0x00000000, 0x00101ea6, 0x00000000, 0x0100003e, }; - static const DWORD rect_solid_ps_code[] = + static const DWORD vs_code_bezier[] = + { +#if 0 + float3x2 transform; + + float4 main(float4 position : POSITION, + inout float3 texcoord : TEXCOORD0) : SV_POSITION + { + return float4(mul(position.xyw, transform), position.zw); + } +#endif + 0x43425844, 0x5e578adb, 0x093f7e27, 0x50d478af, 0xec3dfa4f, 0x00000001, 0x00000198, 0x00000003, + 0x0000002c, 0x00000080, 0x000000d8, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000041, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000707, 0x49534f50, 0x4e4f4954, 0x58455400, 0x524f4f43, 0xabab0044, + 0x4e47534f, 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000807, + 0x505f5653, 0x5449534f, 0x004e4f49, 0x43584554, 0x44524f4f, 0xababab00, 0x52444853, 0x000000b8, + 0x00010040, 0x0000002e, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0300005f, 0x001010f2, + 0x00000000, 0x0300005f, 0x00101072, 0x00000001, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, + 0x03000065, 0x00102072, 0x00000001, 0x08000010, 0x00102012, 0x00000000, 0x00101346, 0x00000000, + 0x00208246, 0x00000000, 0x00000000, 0x08000010, 0x00102022, 0x00000000, 0x00101346, 0x00000000, + 0x00208246, 0x00000000, 0x00000001, 0x05000036, 0x001020c2, 0x00000000, 0x00101ea6, 0x00000000, + 0x05000036, 0x00102072, 0x00000001, 0x00101246, 0x00000001, 0x0100003e, + }; + static const DWORD ps_code_triangle_solid[] = { /* float4 color; * @@ -1499,7 +1559,7 @@ 0x00000010, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x06000036, 0x001020f2, 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x0100003e, }; - static const DWORD rect_bitmap_ps_code[] = + static const DWORD ps_code_triangle_bitmap[] = { #if 0 float3x2 transform; @@ -1537,6 +1597,32 @@ 0x00000000, 0x0010003a, 0x00000000, 0x0020803a, 0x00000000, 0x00000001, 0x05000036, 0x00102072, 0x00000000, 0x00100246, 0x00000000, 0x0100003e, }; + /* The basic idea here is to evaluate the implicit form of the curve in + * texture space. "t.z" determines which side of the curve is shaded. */ + static const DWORD ps_code_bezier_solid[] = + { +#if 0 + float4 color; + + float4 main(float4 position : SV_POSITION, float3 t : TEXCOORD0) : SV_Target + { + clip((t.x * t.x - t.y) * t.z); + return color; + } +#endif + 0x43425844, 0x66075f9e, 0x2ffe405b, 0xb551ee63, 0xa0d9f457, 0x00000001, 0x00000180, 0x00000003, + 0x0000002c, 0x00000084, 0x000000b8, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000707, 0x505f5653, 0x5449534f, 0x004e4f49, 0x43584554, 0x44524f4f, + 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, + 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x000000c0, + 0x00000040, 0x00000030, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03001062, 0x00101072, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0a000032, 0x00100012, + 0x00000000, 0x0010100a, 0x00000001, 0x0010100a, 0x00000001, 0x8010101a, 0x00000041, 0x00000001, + 0x07000038, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010102a, 0x00000001, 0x07000031, + 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0x00000000, 0x0304000d, 0x0010000a, + 0x00000000, 0x06000036, 0x001020f2, 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x0100003e, + }; static const struct { float x, y; @@ -1548,6 +1634,7 @@ { 1.0f, 1.0f}, { 1.0f, -1.0f}, }; + static const UINT16 indices[] = {0, 1, 2, 2, 1, 3}; static const D2D1_MATRIX_3X2_F identity = { 1.0f, 0.0f, @@ -1596,36 +1683,86 @@ goto err; } - if (FAILED(hr = ID3D10Device_CreateInputLayout(render_target->device, il_desc, - sizeof(il_desc) / sizeof(*il_desc), vs_code, sizeof(vs_code), - &render_target->il))) + if (FAILED(hr = ID3D10Device_CreateInputLayout(render_target->device, il_desc_triangle, + sizeof(il_desc_triangle) / sizeof(*il_desc_triangle), vs_code_triangle, sizeof(vs_code_triangle), + &render_target->shape_resources[D2D_SHAPE_TYPE_TRIANGLE].il))) { - WARN("Failed to create clear input layout, hr %#x.\n", hr); + WARN("Failed to create triangle input layout, hr %#x.\n", hr); goto err; } - buffer_desc.ByteWidth = sizeof(quad); + if (FAILED(hr = ID3D10Device_CreateInputLayout(render_target->device, il_desc_bezier, + sizeof(il_desc_bezier) / sizeof(*il_desc_bezier), vs_code_bezier, sizeof(vs_code_bezier), + &render_target->shape_resources[D2D_SHAPE_TYPE_BEZIER].il))) + { + WARN("Failed to create bezier input layout, hr %#x.\n", hr); + goto err; + } + + if (FAILED(hr = ID3D10Device_CreateVertexShader(render_target->device, vs_code_triangle, + sizeof(vs_code_triangle), &render_target->shape_resources[D2D_SHAPE_TYPE_TRIANGLE].vs))) + { + WARN("Failed to create triangle vertex shader, hr %#x.\n", hr); + goto err; + } + + if (FAILED(hr = ID3D10Device_CreateVertexShader(render_target->device, vs_code_bezier, + sizeof(vs_code_bezier), &render_target->shape_resources[D2D_SHAPE_TYPE_BEZIER].vs))) + { + WARN("Failed to create bezier vertex shader, hr %#x.\n", hr); + goto err; + } + + if (FAILED(hr = ID3D10Device_CreatePixelShader(render_target->device, + ps_code_triangle_solid, sizeof(ps_code_triangle_solid), + &render_target->shape_resources[D2D_SHAPE_TYPE_TRIANGLE].ps[D2D_BRUSH_TYPE_SOLID]))) + { + WARN("Failed to create triangle/solid pixel shader, hr %#x.\n", hr); + goto err; + } + + if (FAILED(hr = ID3D10Device_CreatePixelShader(render_target->device, + ps_code_triangle_bitmap, sizeof(ps_code_triangle_bitmap), + &render_target->shape_resources[D2D_SHAPE_TYPE_TRIANGLE].ps[D2D_BRUSH_TYPE_BITMAP]))) + { + WARN("Failed to create triangle/bitmap pixel shader, hr %#x.\n", hr); + goto err; + } + + if (FAILED(hr = ID3D10Device_CreatePixelShader(render_target->device, + ps_code_bezier_solid, sizeof(ps_code_bezier_solid), + &render_target->shape_resources[D2D_SHAPE_TYPE_BEZIER].ps[D2D_BRUSH_TYPE_SOLID]))) + { + WARN("Failed to create bezier/solid pixel shader, hr %#x.\n", hr); + goto err; + } + + buffer_desc.ByteWidth = sizeof(indices); buffer_desc.Usage = D3D10_USAGE_DEFAULT; - buffer_desc.BindFlags = D3D10_BIND_VERTEX_BUFFER; + buffer_desc.BindFlags = D3D10_BIND_INDEX_BUFFER; buffer_desc.CPUAccessFlags = 0; buffer_desc.MiscFlags = 0; - buffer_data.pSysMem = quad; + buffer_data.pSysMem = indices; buffer_data.SysMemPitch = 0; buffer_data.SysMemSlicePitch = 0; - render_target->vb_stride = sizeof(*quad); if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, - &buffer_desc, &buffer_data, &render_target->vb))) + &buffer_desc, &buffer_data, &render_target->ib))) { - WARN("Failed to create clear vertex buffer, hr %#x.\n", hr); + WARN("Failed to create clear index buffer, hr %#x.\n", hr); goto err; } - if (FAILED(hr = ID3D10Device_CreateVertexShader(render_target->device, - vs_code, sizeof(vs_code), &render_target->vs))) + buffer_desc.ByteWidth = sizeof(quad); + buffer_desc.BindFlags = D3D10_BIND_VERTEX_BUFFER; + buffer_data.pSysMem = quad; + + render_target->vb_stride = sizeof(*quad); + if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, + &buffer_desc, &buffer_data, &render_target->vb))) { - WARN("Failed to create clear vertex shader, hr %#x.\n", hr); + WARN("Failed to create clear vertex buffer, hr %#x.\n", hr); goto err; } @@ -1660,26 +1797,13 @@ goto err; } - if (FAILED(hr = ID3D10Device_CreatePixelShader(render_target->device, - rect_solid_ps_code, sizeof(rect_solid_ps_code), &render_target->rect_solid_ps))) - { - WARN("Failed to create pixel shader, hr %#x.\n", hr); - goto err; - } - - if (FAILED(hr = ID3D10Device_CreatePixelShader(render_target->device, - rect_bitmap_ps_code, sizeof(rect_bitmap_ps_code), &render_target->rect_bitmap_ps))) - { - WARN("Failed to create pixel shader, hr %#x.\n", hr); - goto err; - } - if (FAILED(hr = IDXGISurface_GetDesc(surface, &surface_desc))) { WARN("Failed to get surface desc, hr %#x.\n", hr); goto err; } + render_target->format = desc->pixelFormat; render_target->pixel_size.width = surface_desc.Width; render_target->pixel_size.height = surface_desc.Height; render_target->drawing_state.transform = identity; @@ -1703,20 +1827,26 @@ return S_OK; err: - if (render_target->rect_bitmap_ps) - ID3D10PixelShader_Release(render_target->rect_bitmap_ps); - if (render_target->rect_solid_ps) - ID3D10PixelShader_Release(render_target->rect_solid_ps); if (render_target->bs) ID3D10BlendState_Release(render_target->bs); if (render_target->rs) ID3D10RasterizerState_Release(render_target->rs); - if (render_target->vs) - ID3D10VertexShader_Release(render_target->vs); if (render_target->vb) ID3D10Buffer_Release(render_target->vb); - if (render_target->il) - ID3D10InputLayout_Release(render_target->il); + if (render_target->ib) + ID3D10Buffer_Release(render_target->ib); + for (i = 0; i < D2D_SHAPE_TYPE_COUNT; ++i) + { + for (j = 0; j < D2D_BRUSH_TYPE_COUNT; ++j) + { + if (render_target->shape_resources[i].ps[j]) + ID3D10PixelShader_Release(render_target->shape_resources[i].ps[j]); + } + if (render_target->shape_resources[i].vs) + ID3D10VertexShader_Release(render_target->shape_resources[i].vs); + if (render_target->shape_resources[i].il) + ID3D10InputLayout_Release(render_target->shape_resources[i].il); + } if (render_target->stateblock) render_target->stateblock->lpVtbl->Release(render_target->stateblock); if (render_target->view) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d2d1/tests/d2d1.c wine-staging-1.7.48~ubuntu12.04.1/dlls/d2d1/tests/d2d1.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d2d1/tests/d2d1.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d2d1/tests/d2d1.c 2015-07-29 19:28:54.000000000 +0000 @@ -24,12 +24,27 @@ #include "initguid.h" #include "dwrite.h" +struct figure +{ + unsigned int *spans; + unsigned int spans_size; + unsigned int span_count; +}; + static void set_point(D2D1_POINT_2F *point, float x, float y) { point->x = x; point->y = y; } +static void set_quadratic(D2D1_QUADRATIC_BEZIER_SEGMENT *quadratic, float x1, float y1, float x2, float y2) +{ + quadratic->point1.x = x1; + quadratic->point1.y = y1; + quadratic->point2.x = x2; + quadratic->point2.y = y2; +} + static void set_rect(D2D1_RECT_F *rect, float left, float top, float right, float bottom) { rect->left = left; @@ -179,6 +194,192 @@ return ret; } +static void serialize_figure(struct figure *figure) +{ + static const char lookup[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + unsigned int i, j, k, span; + char output[76]; + char t[3]; + char *p; + + for (i = 0, j = 0, k = 0, p = output; i < figure->span_count; ++i) + { + span = figure->spans[i]; + while (span) + { + t[j] = span & 0x7f; + if (span > 0x7f) + t[j] |= 0x80; + span >>= 7; + if (++j == 3) + { + p[0] = lookup[(t[0] & 0xfc) >> 2]; + p[1] = lookup[((t[0] & 0x03) << 4) | ((t[1] & 0xf0) >> 4)]; + p[2] = lookup[((t[1] & 0x0f) << 2) | ((t[2] & 0xc0) >> 6)]; + p[3] = lookup[t[2] & 0x3f]; + p += 4; + if (++k == 19) + { + trace("%.76s\n", output); + p = output; + k = 0; + } + j = 0; + } + } + } + if (j) + { + for (i = j; i < 3; ++i) + t[i] = 0; + p[0] = lookup[(t[0] & 0xfc) >> 2]; + p[1] = lookup[((t[0] & 0x03) << 4) | ((t[1] & 0xf0) >> 4)]; + p[2] = lookup[((t[1] & 0x0f) << 2) | ((t[2] & 0xc0) >> 6)]; + p[3] = lookup[t[2] & 0x3f]; + ++k; + } + if (k) + trace("%.*s\n", k * 4, output); +} + +static void deserialize_span(struct figure *figure, unsigned int *current, unsigned int *shift, unsigned int c) +{ + *current |= (c & 0x7f) << *shift; + if (c & 0x80) + { + *shift += 7; + return; + } + + if (figure->span_count == figure->spans_size) + { + figure->spans_size *= 2; + figure->spans = HeapReAlloc(GetProcessHeap(), 0, figure->spans, + figure->spans_size * sizeof(*figure->spans)); + } + + figure->spans[figure->span_count++] = *current; + *current = 0; + *shift = 0; +} + +static void deserialize_figure(struct figure *figure, const BYTE *s) +{ + static const BYTE lookup[] = + { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f, + 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, + 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff, + }; + unsigned int current = 0, shift = 0; + const BYTE *ptr; + BYTE x, y; + + figure->span_count = 0; + figure->spans_size = 64; + figure->spans = HeapAlloc(GetProcessHeap(), 0, figure->spans_size * sizeof(*figure->spans)); + + for (ptr = s; *ptr; ptr += 4) + { + x = lookup[ptr[0]]; + y = lookup[ptr[1]]; + deserialize_span(figure, ¤t, &shift, ((x & 0x3f) << 2) | ((y & 0x3f) >> 4)); + x = lookup[ptr[2]]; + deserialize_span(figure, ¤t, &shift, ((y & 0x0f) << 4) | ((x & 0x3f) >> 2)); + y = lookup[ptr[3]]; + deserialize_span(figure, ¤t, &shift, ((x & 0x03) << 6) | (y & 0x3f)); + } +} + +static BOOL compare_figure(IDXGISurface *surface, unsigned int x, unsigned int y, + unsigned int w, unsigned int h, DWORD prev, unsigned int max_diff, const char *ref) +{ + D3D10_MAPPED_TEXTURE2D mapped_texture; + D3D10_TEXTURE2D_DESC texture_desc; + struct figure ref_figure, figure; + DXGI_SURFACE_DESC surface_desc; + unsigned int i, j, span, diff; + ID3D10Resource *src_resource; + ID3D10Texture2D *texture; + ID3D10Device *device; + HRESULT hr; + + hr = IDXGISurface_GetDevice(surface, &IID_ID3D10Device, (void **)&device); + ok(SUCCEEDED(hr), "Failed to get device, hr %#x.\n", hr); + hr = IDXGISurface_QueryInterface(surface, &IID_ID3D10Resource, (void **)&src_resource); + ok(SUCCEEDED(hr), "Failed to query resource interface, hr %#x.\n", hr); + + hr = IDXGISurface_GetDesc(surface, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); + texture_desc.Width = surface_desc.Width; + texture_desc.Height = surface_desc.Height; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = surface_desc.Format; + texture_desc.SampleDesc = surface_desc.SampleDesc; + texture_desc.Usage = D3D10_USAGE_STAGING; + texture_desc.BindFlags = 0; + texture_desc.CPUAccessFlags = D3D10_CPU_ACCESS_READ; + texture_desc.MiscFlags = 0; + hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + ID3D10Device_CopyResource(device, (ID3D10Resource *)texture, src_resource); + hr = ID3D10Texture2D_Map(texture, 0, D3D10_MAP_READ, 0, &mapped_texture); + ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr); + + figure.span_count = 0; + figure.spans_size = 64; + figure.spans = HeapAlloc(GetProcessHeap(), 0, figure.spans_size * sizeof(*figure.spans)); + + for (i = 0, span = 0; i < h; ++i) + { + const DWORD *row = (DWORD *)((BYTE *)mapped_texture.pData + (y + i) * mapped_texture.RowPitch + x * 4); + for (j = 0; j < w; ++j, ++span) + { + if ((i || j) && prev != row[j]) + { + if (figure.span_count == figure.spans_size) + { + figure.spans_size *= 2; + figure.spans = HeapReAlloc(GetProcessHeap(), 0, figure.spans, + figure.spans_size * sizeof(*figure.spans)); + } + figure.spans[figure.span_count++] = span; + prev = row[j]; + span = 0; + } + } + } + + deserialize_figure(&ref_figure, (BYTE *)ref); + + j = min(figure.span_count, ref_figure.span_count); + for (i = 0, diff = 0; i < j; ++i) + diff += abs(figure.spans[i] - ref_figure.spans[i]); + for (i = j; j < figure.span_count; ++j) + diff += figure.spans[i]; + for (i = j; j < ref_figure.span_count; ++j) + diff += ref_figure.spans[i]; + if (diff > max_diff) + serialize_figure(&figure); + + HeapFree(GetProcessHeap(), 0, ref_figure.spans); + HeapFree(GetProcessHeap(), 0, figure.spans); + ID3D10Texture2D_Unmap(texture, 0); + + ID3D10Texture2D_Release(texture); + ID3D10Resource_Release(src_resource); + ID3D10Device_Release(device); + + return diff <= max_diff; +} + static ID3D10Device1 *create_device(void) { ID3D10Device1 *device; @@ -277,6 +478,7 @@ D2D1_SIZE_F size; HWND window; HRESULT hr; + BOOL match; static const D2D1_MATRIX_3X2_F identity = { 1.0f, 0.0f, @@ -370,7 +572,8 @@ hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL); ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr); - ok(compare_surface(surface, "035a44d4198d6e422e9de6185b5b2c2bac5e33c9"), "Surface does not match.\n"); + match = compare_surface(surface, "035a44d4198d6e422e9de6185b5b2c2bac5e33c9"); + ok(match, "Surface does not match.\n"); ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); @@ -606,6 +809,7 @@ float opacity; HWND window; HRESULT hr; + BOOL match; if (!(device = create_device())) { @@ -681,7 +885,8 @@ hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL); ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr); - ok(compare_surface(surface, "6d1218fca5e21fb7e287b3a439d60dbc251f5ceb"), "Surface does not match.\n"); + match = compare_surface(surface, "6d1218fca5e21fb7e287b3a439d60dbc251f5ceb"); + ok(match, "Surface does not match.\n"); ID2D1SolidColorBrush_Release(brush); ID2D1RenderTarget_Release(rt); @@ -711,6 +916,7 @@ float opacity; HWND window; HRESULT hr; + BOOL match; static const struct { @@ -833,7 +1039,8 @@ hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL); ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr); - ok(compare_surface(surface, "393636185359a550d459e1e5f0e25411814f724c"), "Surface does not match.\n"); + match = compare_surface(surface, "393636185359a550d459e1e5f0e25411814f724c"); + ok(match, "Surface does not match.\n"); ID2D1RenderTarget_BeginDraw(rt); @@ -861,7 +1068,8 @@ hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL); ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr); - ok(compare_surface(surface, "b4b775afecdae2d26642001f4faff73663bb8b31"), "Surface does not match.\n"); + match = compare_surface(surface, "b4b775afecdae2d26642001f4faff73663bb8b31"); + ok(match, "Surface does not match.\n"); ID2D1BitmapBrush_Release(brush); refcount = ID2D1Bitmap_Release(bitmap); @@ -873,20 +1081,155 @@ DestroyWindow(window); } +static void fill_geometry_sink(ID2D1GeometrySink *sink) +{ + D2D1_POINT_2F point; + + set_point(&point, 15.0f, 20.0f); + ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED); + set_point(&point, 55.0f, 20.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 55.0f, 220.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 25.0f, 220.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 25.0f, 100.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 75.0f, 100.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 75.0f, 300.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 5.0f, 300.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 5.0f, 60.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 45.0f, 60.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 45.0f, 180.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 35.0f, 180.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 35.0f, 140.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 65.0f, 140.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 65.0f, 260.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 15.0f, 260.0f); + ID2D1GeometrySink_AddLine(sink, point); + ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED); + + set_point(&point, 155.0f, 300.0f); + ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED); + set_point(&point, 155.0f, 160.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 85.0f, 160.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 85.0f, 300.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 120.0f, 300.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 120.0f, 20.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 155.0f, 20.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 155.0f, 160.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 85.0f, 160.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 85.0f, 20.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 120.0f, 20.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 120.0f, 300.0f); + ID2D1GeometrySink_AddLine(sink, point); + ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED); + + set_point(&point, 165.0f, 20.0f); + ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED); + set_point(&point, 165.0f, 300.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 235.0f, 300.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 235.0f, 20.0f); + ID2D1GeometrySink_AddLine(sink, point); + ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED); + set_point(&point, 225.0f, 60.0f); + ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED); + set_point(&point, 225.0f, 260.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 175.0f, 260.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 175.0f, 60.0f); + ID2D1GeometrySink_AddLine(sink, point); + ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED); + set_point(&point, 215.0f, 220.0f); + ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED); + set_point(&point, 185.0f, 220.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 185.0f, 100.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 215.0f, 100.0f); + ID2D1GeometrySink_AddLine(sink, point); + ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED); + set_point(&point, 195.0f, 180.0f); + ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED); + set_point(&point, 205.0f, 180.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 205.0f, 140.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 195.0f, 140.0f); + ID2D1GeometrySink_AddLine(sink, point); + ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED); +} + +static void fill_geometry_sink_bezier(ID2D1GeometrySink *sink) +{ + D2D1_QUADRATIC_BEZIER_SEGMENT quadratic; + D2D1_POINT_2F point; + + set_point(&point, 5.0f, 160.0f); + ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED); + set_quadratic(&quadratic, 40.0f, 160.0f, 40.0f, 20.0f); + ID2D1GeometrySink_AddQuadraticBezier(sink, &quadratic); + set_quadratic(&quadratic, 40.0f, 160.0f, 75.0f, 160.0f); + ID2D1GeometrySink_AddQuadraticBezier(sink, &quadratic); + set_quadratic(&quadratic, 40.0f, 160.0f, 40.0f, 300.0f); + ID2D1GeometrySink_AddQuadraticBezier(sink, &quadratic); + set_quadratic(&quadratic, 40.0f, 160.0f, 5.0f, 160.0f); + ID2D1GeometrySink_AddQuadraticBezier(sink, &quadratic); + ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED); + + set_point(&point, 20.0f, 160.0f); + ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED); + set_quadratic(&quadratic, 20.0f, 80.0f, 40.0f, 80.0f); + ID2D1GeometrySink_AddQuadraticBezier(sink, &quadratic); + set_quadratic(&quadratic, 60.0f, 80.0f, 60.0f, 160.0f); + ID2D1GeometrySink_AddQuadraticBezier(sink, &quadratic); + set_quadratic(&quadratic, 60.0f, 240.0f, 40.0f, 240.0f); + ID2D1GeometrySink_AddQuadraticBezier(sink, &quadratic); + set_quadratic(&quadratic, 20.0f, 240.0f, 20.0f, 160.0f); + ID2D1GeometrySink_AddQuadraticBezier(sink, &quadratic); + ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED); +} + static void test_path_geometry(void) { ID2D1GeometrySink *sink, *tmp_sink; D2D1_POINT_2F point = {0.0f, 0.0f}; + ID2D1SolidColorBrush *brush; ID2D1PathGeometry *geometry; IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; ID3D10Device1 *device; IDXGISurface *surface; ID2D1Factory *factory; + D2D1_COLOR_F color; ULONG refcount; UINT32 count; HWND window; HRESULT hr; + BOOL match; if (!(device = create_device())) { @@ -902,6 +1245,12 @@ ok(!!rt, "Failed to create render target.\n"); ID2D1RenderTarget_GetFactory(rt, &factory); + ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f); + ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED); + set_color(&color, 0.890f, 0.851f, 0.600f, 1.0f); + hr = ID2D1RenderTarget_CreateSolidColorBrush(rt, &color, NULL, &brush); + ok(SUCCEEDED(hr), "Failed to create brush, hr %#x.\n", hr); + /* Close() when closed. */ hr = ID2D1Factory_CreatePathGeometry(factory, &geometry); ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr); @@ -1054,6 +1403,124 @@ ok(count == 1, "Got unexpected segment count %u.\n", count); ID2D1PathGeometry_Release(geometry); + hr = ID2D1Factory_CreatePathGeometry(factory, &geometry); + ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr); + hr = ID2D1PathGeometry_Open(geometry, &sink); + ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr); + /* The fillmode that's used is the last one set before the sink is closed. */ + ID2D1GeometrySink_SetFillMode(sink, D2D1_FILL_MODE_WINDING); + fill_geometry_sink(sink); + ID2D1GeometrySink_SetFillMode(sink, D2D1_FILL_MODE_ALTERNATE); + hr = ID2D1GeometrySink_Close(sink); + ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr); + hr = ID2D1PathGeometry_GetFigureCount(geometry, &count); + ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr); + ok(count == 6, "Got unexpected figure count %u.\n", count); + hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count); + ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr); + /* Intersections don't create extra segments. */ + ok(count == 44, "Got unexpected segment count %u.\n", count); + ID2D1GeometrySink_SetFillMode(sink, D2D1_FILL_MODE_WINDING); + ID2D1GeometrySink_Release(sink); + + ID2D1RenderTarget_BeginDraw(rt); + set_color(&color, 0.396f, 0.180f, 0.537f, 1.0f); + ID2D1RenderTarget_Clear(rt, &color); + ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL); + hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr); + match = compare_surface(surface, "736d9bf019bcf0be264571c1bd954f07752330ab"); + ok(match, "Surface does not match.\n"); + ID2D1PathGeometry_Release(geometry); + + hr = ID2D1Factory_CreatePathGeometry(factory, &geometry); + ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr); + hr = ID2D1PathGeometry_Open(geometry, &sink); + ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr); + fill_geometry_sink(sink); + ID2D1GeometrySink_SetFillMode(sink, D2D1_FILL_MODE_WINDING); + hr = ID2D1GeometrySink_Close(sink); + ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr); + hr = ID2D1PathGeometry_GetFigureCount(geometry, &count); + ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr); + ok(count == 6, "Got unexpected figure count %u.\n", count); + hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count); + ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr); + ok(count == 44, "Got unexpected segment count %u.\n", count); + ID2D1GeometrySink_Release(sink); + + ID2D1RenderTarget_BeginDraw(rt); + ID2D1RenderTarget_Clear(rt, &color); + ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL); + hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr); + match = compare_surface(surface, "dd80ed3c218698687156ff4598db3a53917f8476"); + ok(match, "Surface does not match.\n"); + ID2D1PathGeometry_Release(geometry); + + hr = ID2D1Factory_CreatePathGeometry(factory, &geometry); + ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr); + hr = ID2D1PathGeometry_Open(geometry, &sink); + ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr); + fill_geometry_sink_bezier(sink); + hr = ID2D1GeometrySink_Close(sink); + ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr); + hr = ID2D1PathGeometry_GetFigureCount(geometry, &count); + ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr); + ok(count == 2, "Got unexpected figure count %u.\n", count); + hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count); + ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr); + ok(count == 10, "Got unexpected segment count %u.\n", count); + ID2D1GeometrySink_Release(sink); + + ID2D1RenderTarget_BeginDraw(rt); + ID2D1RenderTarget_Clear(rt, &color); + ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL); + hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr); + match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 64, + "7xoCngECngECngECngECngECngECngECnQEEnAEEnAEEnAEEnAEEmwEGmgEGmgEGmgEGmQEImAEI" + "lAEECASLAQgKCIEBDQoMew8KD3YQDBByEgwSbhMOEmwUDhRpFBAUZxUQFWUVEhVjFhIWYRYUFl8X" + "FBddFxYWXRYYFlsXGBdaFhoWWRYcFlgVHhVXFSAVVhQiFFUUIxRVEyYTVBIoElQRKhFUECwQUxAu" + "EFIOMg5SDTQNUgs4C1IJPAlRCEAIUAZEBlAESARQAU4BTgJQAkgGUAY/C1ALMhNQEyoTUBMyC1AL" + "PwZQBkgCUAJOAU4BUARIBFAGRAZQCEAIUQk8CVILOAtSDTQNUg4yDlIQLhBTECwQVBEqEVQSKBJU" + "EyYTVBQjFFYUIhRWFSAVVxUeFVgWHBZZFhoWWhcYF1sWGBZcFxYWXhcUF18WFBZhFhIWYxUSFWUV" + "EBVnFBAUaRQOFGsTDhJvEgwSchAMEHYPCg96DQoMggEICgiLAQQIBJQBCJgBCJkBBpoBBpoBBpoB" + "BpsBBJwBBJwBBJwBBJwBBJ0BAp4BAp4BAp4BAp4BAp4BAp4BAp4BAgAA"); + todo_wine ok(match, "Figure does not match.\n"); + ID2D1PathGeometry_Release(geometry); + + hr = ID2D1Factory_CreatePathGeometry(factory, &geometry); + ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr); + hr = ID2D1PathGeometry_Open(geometry, &sink); + ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr); + fill_geometry_sink_bezier(sink); + ID2D1GeometrySink_SetFillMode(sink, D2D1_FILL_MODE_WINDING); + hr = ID2D1GeometrySink_Close(sink); + ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr); + hr = ID2D1PathGeometry_GetFigureCount(geometry, &count); + ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr); + ok(count == 2, "Got unexpected figure count %u.\n", count); + hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count); + ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr); + ok(count == 10, "Got unexpected segment count %u.\n", count); + ID2D1GeometrySink_Release(sink); + + ID2D1RenderTarget_BeginDraw(rt); + ID2D1RenderTarget_Clear(rt, &color); + ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL); + hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr); + match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 64, + "7xoCngECngECngECngECngECngECngECnQEEnAEEnAEEnAEEnAEEmwEGmgEGmgEGmgEGmQEImAEI" + "lAEQiwEagQEjeyh2LHIwbjNsNmk4ZzplPGM+YUBfQl1DXURbRlpGWUhYSFdKVkpVS1VMVExUTFRM" + "U05STlJOUk5STlFQUFBQUFBQTlRIXD9mMnYqdjJmP1xIVE5QUFBQUFBQUU5STlJOUk5STlNMVExU" + "TFRMVEtWSlZKV0hYSFlGWkZbRFxDXkJfQGE+YzxlOmc4aTZrM28wcix2KHojggEaiwEQlAEImAEI" + "mQEGmgEGmgEGmgEGmwEEnAEEnAEEnAEEnAEEnQECngECngECngECngECngECngECngEC"); + ok(match, "Figure does not match.\n"); + ID2D1PathGeometry_Release(geometry); + + ID2D1SolidColorBrush_Release(brush); ID2D1RenderTarget_Release(rt); refcount = ID2D1Factory_Release(factory); ok(!refcount, "Factory has %u references left.\n", refcount); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3d10core/device.c wine-staging-1.7.48~ubuntu12.04.1/dlls/d3d10core/device.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3d10core/device.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3d10core/device.c 2015-07-29 19:28:54.000000000 +0000 @@ -635,10 +635,25 @@ ID3D10Resource *dst_resource, UINT dst_subresource_idx, UINT dst_x, UINT dst_y, UINT dst_z, ID3D10Resource *src_resource, UINT src_subresource_idx, const D3D10_BOX *src_box) { - FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, dst_x %u, dst_y %u, dst_z %u,\n" - "\tsrc_resource %p, src_subresource_idx %u, src_box %p stub!\n", + struct wined3d_resource *wined3d_dst_resource, *wined3d_src_resource; + struct d3d10_device *device = impl_from_ID3D10Device(iface); + struct wined3d_box wined3d_src_box; + + TRACE("iface %p, dst_resource %p, dst_subresource_idx %u, dst_x %u, dst_y %u, dst_z %u, " + "src_resource %p, src_subresource_idx %u, src_box %p.\n", iface, dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, src_resource, src_subresource_idx, src_box); + + wined3d_dst_resource = wined3d_resource_from_resource(dst_resource); + wined3d_src_resource = wined3d_resource_from_resource(src_resource); + wined3d_src_box.left = src_box->left; + wined3d_src_box.top = src_box->top; + wined3d_src_box.front = src_box->front; + wined3d_src_box.right = src_box->right; + wined3d_src_box.bottom = src_box->bottom; + wined3d_src_box.back = src_box->back; + wined3d_device_copy_sub_resource_region(device->wined3d_device, wined3d_dst_resource, dst_subresource_idx, + dst_x, dst_y, dst_z, wined3d_src_resource, src_subresource_idx, &wined3d_src_box); } static void STDMETHODCALLTYPE d3d10_device_CopyResource(ID3D10Device1 *iface, diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3drm/device.c wine-staging-1.7.48~ubuntu12.04.1/dlls/d3drm/device.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3drm/device.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3drm/device.c 2015-07-29 19:28:54.000000000 +0000 @@ -33,6 +33,7 @@ struct d3drm_device { + IDirect3DRMDevice IDirect3DRMDevice_iface; IDirect3DRMDevice2 IDirect3DRMDevice2_iface; IDirect3DRMDevice3 IDirect3DRMDevice3_iface; IDirect3DRMWinDevice IDirect3DRMWinDevice_iface; @@ -44,6 +45,11 @@ DWORD width; }; +static inline struct d3drm_device *impl_from_IDirect3DRMDevice(IDirect3DRMDevice *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice_iface); +} + static inline struct d3drm_device *impl_from_IDirect3DRMDevice2(IDirect3DRMDevice2 *iface) { return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice2_iface); @@ -59,66 +65,384 @@ return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMWinDevice_iface); } +static HRESULT WINAPI d3drm_device1_QueryInterface(IDirect3DRMDevice *iface, REFIID riid, void **out) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + return IDirect3DRMDevice3_QueryInterface(&device->IDirect3DRMDevice3_iface, riid, out); +} + +static ULONG WINAPI d3drm_device1_AddRef(IDirect3DRMDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_AddRef(&device->IDirect3DRMDevice3_iface); +} + +static ULONG WINAPI d3drm_device1_Release(IDirect3DRMDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_Release(&device->IDirect3DRMDevice3_iface); +} + +static HRESULT WINAPI d3drm_device1_Clone(IDirect3DRMDevice *iface, + IUnknown *outer, REFIID iid, void **out) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer, debugstr_guid(iid), out); + + return IDirect3DRMDevice3_Clone(&device->IDirect3DRMDevice3_iface, outer, iid, out); +} + +static HRESULT WINAPI d3drm_device1_AddDestroyCallback(IDirect3DRMDevice *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device1_DeleteDestroyCallback(IDirect3DRMDevice *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device1_SetAppData(IDirect3DRMDevice *iface, DWORD data) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, data %#x.\n", iface, data); + + return IDirect3DRMDevice3_SetAppData(&device->IDirect3DRMDevice3_iface, data); +} + +static DWORD WINAPI d3drm_device1_GetAppData(IDirect3DRMDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetAppData(&device->IDirect3DRMDevice3_iface); +} + +static HRESULT WINAPI d3drm_device1_SetName(IDirect3DRMDevice *iface, const char *name) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, name %s.\n", iface, debugstr_a(name)); + + return IDirect3DRMDevice3_SetName(&device->IDirect3DRMDevice3_iface, name); +} + +static HRESULT WINAPI d3drm_device1_GetName(IDirect3DRMDevice *iface, DWORD *size, char *name) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMDevice3_GetName(&device->IDirect3DRMDevice3_iface, size, name); +} + +static HRESULT WINAPI d3drm_device1_GetClassName(IDirect3DRMDevice *iface, DWORD *size, char *name) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMDevice3_GetClassName(&device->IDirect3DRMDevice3_iface, size, name); +} + +static HRESULT WINAPI d3drm_device1_Init(IDirect3DRMDevice *iface, ULONG width, ULONG height) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, width %u, height %u.\n", iface, width, height); + + return IDirect3DRMDevice3_Init(&device->IDirect3DRMDevice3_iface, width, height); +} + +static HRESULT WINAPI d3drm_device1_InitFromD3D(IDirect3DRMDevice *iface, + IDirect3D *d3d, IDirect3DDevice *d3d_device) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device); + + return IDirect3DRMDevice3_InitFromD3D(&device->IDirect3DRMDevice3_iface, d3d, d3d_device); +} + +static HRESULT WINAPI d3drm_device1_InitFromClipper(IDirect3DRMDevice *iface, + IDirectDrawClipper *clipper, GUID *guid, int width, int height) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, clipper %p, guid %s, width %d, height %d.\n", + iface, clipper, debugstr_guid(guid), width, height); + + return IDirect3DRMDevice3_InitFromClipper(&device->IDirect3DRMDevice3_iface, + clipper, guid, width, height); +} + +static HRESULT WINAPI d3drm_device1_Update(IDirect3DRMDevice *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_device1_AddUpdateCallback(IDirect3DRMDevice *iface, + D3DRMUPDATECALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device1_DeleteUpdateCallback(IDirect3DRMDevice *iface, + D3DRMUPDATECALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device1_SetBufferCount(IDirect3DRMDevice *iface, DWORD count) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, count %u.\n", iface, count); + + return IDirect3DRMDevice3_SetBufferCount(&device->IDirect3DRMDevice3_iface, count); +} + +static DWORD WINAPI d3drm_device1_GetBufferCount(IDirect3DRMDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetBufferCount(&device->IDirect3DRMDevice3_iface); +} + +static HRESULT WINAPI d3drm_device1_SetDither(IDirect3DRMDevice *iface, BOOL enable) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, enabled %#x.\n", iface, enable); + + return IDirect3DRMDevice3_SetDither(&device->IDirect3DRMDevice3_iface, enable); +} + +static HRESULT WINAPI d3drm_device1_SetShades(IDirect3DRMDevice *iface, DWORD count) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, count %u.\n", iface, count); + + return IDirect3DRMDevice3_SetShades(&device->IDirect3DRMDevice3_iface, count); +} + +static HRESULT WINAPI d3drm_device1_SetQuality(IDirect3DRMDevice *iface, D3DRMRENDERQUALITY quality) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, quality %u.\n", iface, quality); + + return IDirect3DRMDevice3_SetQuality(&device->IDirect3DRMDevice3_iface, quality); +} + +static HRESULT WINAPI d3drm_device1_SetTextureQuality(IDirect3DRMDevice *iface, D3DRMTEXTUREQUALITY quality) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, quality %u.\n", iface, quality); + + return IDirect3DRMDevice3_SetTextureQuality(&device->IDirect3DRMDevice3_iface, quality); +} + +static HRESULT WINAPI d3drm_device1_GetViewports(IDirect3DRMDevice *iface, IDirect3DRMViewportArray **array) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, array %p.\n", iface, array); + + return IDirect3DRMDevice3_GetViewports(&device->IDirect3DRMDevice3_iface, array); +} + +static BOOL WINAPI d3drm_device1_GetDither(IDirect3DRMDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetDither(&device->IDirect3DRMDevice3_iface); +} + +static DWORD WINAPI d3drm_device1_GetShades(IDirect3DRMDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetShades(&device->IDirect3DRMDevice3_iface); +} + +static DWORD WINAPI d3drm_device1_GetHeight(IDirect3DRMDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetHeight(&device->IDirect3DRMDevice3_iface); +} + +static DWORD WINAPI d3drm_device1_GetWidth(IDirect3DRMDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetWidth(&device->IDirect3DRMDevice3_iface); +} + +static DWORD WINAPI d3drm_device1_GetTrianglesDrawn(IDirect3DRMDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetTrianglesDrawn(&device->IDirect3DRMDevice3_iface); +} + +static DWORD WINAPI d3drm_device1_GetWireframeOptions(IDirect3DRMDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetWireframeOptions(&device->IDirect3DRMDevice3_iface); +} + +static D3DRMRENDERQUALITY WINAPI d3drm_device1_GetQuality(IDirect3DRMDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetQuality(&device->IDirect3DRMDevice3_iface); +} + +static D3DCOLORMODEL WINAPI d3drm_device1_GetColorModel(IDirect3DRMDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p stub!\n", iface); + + return IDirect3DRMDevice3_GetColorModel(&device->IDirect3DRMDevice3_iface); +} + +static D3DRMTEXTUREQUALITY WINAPI d3drm_device1_GetTextureQuality(IDirect3DRMDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetTextureQuality(&device->IDirect3DRMDevice3_iface); +} + +static HRESULT WINAPI d3drm_device1_GetDirect3DDevice(IDirect3DRMDevice *iface, IDirect3DDevice **d3d_device) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface); + + TRACE("iface %p, d3d_device %p.\n", iface, d3d_device); + + return IDirect3DRMDevice3_GetDirect3DDevice(&device->IDirect3DRMDevice3_iface, d3d_device); +} + +static const struct IDirect3DRMDeviceVtbl d3drm_device1_vtbl = +{ + d3drm_device1_QueryInterface, + d3drm_device1_AddRef, + d3drm_device1_Release, + d3drm_device1_Clone, + d3drm_device1_AddDestroyCallback, + d3drm_device1_DeleteDestroyCallback, + d3drm_device1_SetAppData, + d3drm_device1_GetAppData, + d3drm_device1_SetName, + d3drm_device1_GetName, + d3drm_device1_GetClassName, + d3drm_device1_Init, + d3drm_device1_InitFromD3D, + d3drm_device1_InitFromClipper, + d3drm_device1_Update, + d3drm_device1_AddUpdateCallback, + d3drm_device1_DeleteUpdateCallback, + d3drm_device1_SetBufferCount, + d3drm_device1_GetBufferCount, + d3drm_device1_SetDither, + d3drm_device1_SetShades, + d3drm_device1_SetQuality, + d3drm_device1_SetTextureQuality, + d3drm_device1_GetViewports, + d3drm_device1_GetDither, + d3drm_device1_GetShades, + d3drm_device1_GetHeight, + d3drm_device1_GetWidth, + d3drm_device1_GetTrianglesDrawn, + d3drm_device1_GetWireframeOptions, + d3drm_device1_GetQuality, + d3drm_device1_GetColorModel, + d3drm_device1_GetTextureQuality, + d3drm_device1_GetDirect3DDevice, +}; + static HRESULT WINAPI d3drm_device2_QueryInterface(IDirect3DRMDevice2 *iface, REFIID riid, void **out) { struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); - if (IsEqualGUID(riid, &IID_IDirect3DRMDevice2) - || IsEqualGUID(riid, &IID_IDirect3DRMDevice) - || IsEqualGUID(riid, &IID_IUnknown)) - { - *out = &device->IDirect3DRMDevice2_iface; - } - else if (IsEqualGUID(riid, &IID_IDirect3DRMDevice3)) - { - *out = &device->IDirect3DRMDevice3_iface; - } - else if (IsEqualGUID(riid, &IID_IDirect3DRMWinDevice)) - { - *out = &device->IDirect3DRMWinDevice_iface; - } - else - { - *out = NULL; - WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown *)*out); - return S_OK; + return IDirect3DRMDevice3_QueryInterface(&device->IDirect3DRMDevice3_iface, riid, out); } static ULONG WINAPI d3drm_device2_AddRef(IDirect3DRMDevice2 *iface) { struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - ULONG refcount = InterlockedIncrement(&device->ref); - TRACE("%p increasing refcount to %u.\n", iface, refcount); + TRACE("iface %p.\n", iface); - return refcount; + return IDirect3DRMDevice3_AddRef(&device->IDirect3DRMDevice3_iface); } static ULONG WINAPI d3drm_device2_Release(IDirect3DRMDevice2 *iface) { struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - ULONG refcount = InterlockedDecrement(&device->ref); - TRACE("%p decreasing refcount to %u.\n", iface, refcount); - - if (!refcount) - HeapFree(GetProcessHeap(), 0, device); + TRACE("iface %p.\n", iface); - return refcount; + return IDirect3DRMDevice3_Release(&device->IDirect3DRMDevice3_iface); } static HRESULT WINAPI d3drm_device2_Clone(IDirect3DRMDevice2 *iface, IUnknown *outer, REFIID iid, void **out) { - FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p, outer %p, iid %s, out %p\n", iface, outer, debugstr_guid(iid), out); + + return IDirect3DRMDevice3_Clone(&device->IDirect3DRMDevice3_iface, outer, iid, out); } static HRESULT WINAPI d3drm_device2_AddDestroyCallback(IDirect3DRMDevice2 *iface, @@ -139,30 +463,38 @@ static HRESULT WINAPI d3drm_device2_SetAppData(IDirect3DRMDevice2 *iface, DWORD data) { - FIXME("iface %p, data %#x stub!\n", iface, data); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p, data %#x.\n", iface, data); + + return IDirect3DRMDevice3_SetAppData(&device->IDirect3DRMDevice3_iface, data); } static DWORD WINAPI d3drm_device2_GetAppData(IDirect3DRMDevice2 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return 0; + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetAppData(&device->IDirect3DRMDevice3_iface); } static HRESULT WINAPI d3drm_device2_SetName(IDirect3DRMDevice2 *iface, const char *name) { - FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p, name %s.\n", iface, debugstr_a(name)); + + return IDirect3DRMDevice3_SetName(&device->IDirect3DRMDevice3_iface, name); } static HRESULT WINAPI d3drm_device2_GetName(IDirect3DRMDevice2 *iface, DWORD *size, char *name) { - FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMDevice3_GetName(&device->IDirect3DRMDevice3_iface, size, name); } static HRESULT WINAPI d3drm_device2_GetClassName(IDirect3DRMDevice2 *iface, DWORD *size, char *name) @@ -186,9 +518,11 @@ static HRESULT WINAPI d3drm_device2_InitFromD3D(IDirect3DRMDevice2 *iface, IDirect3D *d3d, IDirect3DDevice *d3d_device) { - FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface, d3d, d3d_device); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device); + + return IDirect3DRMDevice3_InitFromD3D(&device->IDirect3DRMDevice3_iface, d3d, d3d_device); } static HRESULT WINAPI d3drm_device2_InitFromClipper(IDirect3DRMDevice2 *iface, @@ -228,16 +562,20 @@ static HRESULT WINAPI d3drm_device2_SetBufferCount(IDirect3DRMDevice2 *iface, DWORD count) { - FIXME("iface %p, count %u.\n", iface, count); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p, count %u.\n", iface, count); + + return IDirect3DRMDevice3_SetBufferCount(&device->IDirect3DRMDevice3_iface, count); } static DWORD WINAPI d3drm_device2_GetBufferCount(IDirect3DRMDevice2 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetBufferCount(&device->IDirect3DRMDevice3_iface); } static HRESULT WINAPI d3drm_device2_SetDither(IDirect3DRMDevice2 *iface, BOOL enable) @@ -251,9 +589,11 @@ static HRESULT WINAPI d3drm_device2_SetShades(IDirect3DRMDevice2 *iface, DWORD count) { - FIXME("iface %p, count %u stub!\n", iface, count); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p, count %u.\n", iface, count); + + return IDirect3DRMDevice3_SetShades(&device->IDirect3DRMDevice3_iface, count); } static HRESULT WINAPI d3drm_device2_SetQuality(IDirect3DRMDevice2 *iface, D3DRMRENDERQUALITY quality) @@ -267,16 +607,20 @@ static HRESULT WINAPI d3drm_device2_SetTextureQuality(IDirect3DRMDevice2 *iface, D3DRMTEXTUREQUALITY quality) { - FIXME("iface %p, quality %u stub!\n", iface, quality); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p, quality %u.\n", iface, quality); + + return IDirect3DRMDevice3_SetTextureQuality(&device->IDirect3DRMDevice3_iface, quality); } static HRESULT WINAPI d3drm_device2_GetViewports(IDirect3DRMDevice2 *iface, IDirect3DRMViewportArray **array) { - FIXME("iface %p, array %p stub!\n", iface, array); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p, array %p.\n", iface, array); + + return IDirect3DRMDevice3_GetViewports(&device->IDirect3DRMDevice3_iface, array); } static BOOL WINAPI d3drm_device2_GetDither(IDirect3DRMDevice2 *iface) @@ -290,9 +634,11 @@ static DWORD WINAPI d3drm_device2_GetShades(IDirect3DRMDevice2 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p.\n.", iface); + + return IDirect3DRMDevice3_GetShades(&device->IDirect3DRMDevice3_iface); } static DWORD WINAPI d3drm_device2_GetHeight(IDirect3DRMDevice2 *iface) @@ -315,16 +661,20 @@ static DWORD WINAPI d3drm_device2_GetTrianglesDrawn(IDirect3DRMDevice2 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetTrianglesDrawn(&device->IDirect3DRMDevice3_iface); } static DWORD WINAPI d3drm_device2_GetWireframeOptions(IDirect3DRMDevice2 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetWireframeOptions(&device->IDirect3DRMDevice3_iface); } static D3DRMRENDERQUALITY WINAPI d3drm_device2_GetQuality(IDirect3DRMDevice2 *iface) @@ -338,40 +688,50 @@ static D3DCOLORMODEL WINAPI d3drm_device2_GetColorModel(IDirect3DRMDevice2 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetColorModel(&device->IDirect3DRMDevice3_iface); } static D3DRMTEXTUREQUALITY WINAPI d3drm_device2_GetTextureQuality(IDirect3DRMDevice2 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetTextureQuality(&device->IDirect3DRMDevice3_iface); } static HRESULT WINAPI d3drm_device2_GetDirect3DDevice(IDirect3DRMDevice2 *iface, IDirect3DDevice **d3d_device) { - FIXME("iface %p, d3d_device %p stub!\n", iface, d3d_device); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p, d3d_device %p.\n", iface, d3d_device); + + return IDirect3DRMDevice3_GetDirect3DDevice(&device->IDirect3DRMDevice3_iface, d3d_device); } static HRESULT WINAPI d3drm_device2_InitFromD3D2(IDirect3DRMDevice2 *iface, IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device) { - FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface, d3d, d3d_device); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device); + + return IDirect3DRMDevice3_InitFromD3D2(&device->IDirect3DRMDevice3_iface, d3d, d3d_device); } static HRESULT WINAPI d3drm_device2_InitFromSurface(IDirect3DRMDevice2 *iface, GUID *guid, IDirectDraw *ddraw, IDirectDrawSurface *backbuffer) { - FIXME("iface %p, guid %s, ddraw %p, backbuffer %p stub!\n", + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + + TRACE("iface %p, guid %s, ddraw %p, backbuffer %p.\n", iface, debugstr_guid(guid), ddraw, backbuffer); - return E_NOTIMPL; + return IDirect3DRMDevice3_InitFromSurface(&device->IDirect3DRMDevice3_iface, guid, ddraw, backbuffer); } static HRESULT WINAPI d3drm_device2_SetRenderMode(IDirect3DRMDevice2 *iface, DWORD flags) @@ -394,9 +754,11 @@ static HRESULT WINAPI d3drm_device2_GetDirect3DDevice2(IDirect3DRMDevice2 *iface, IDirect3DDevice2 **d3d_device) { - FIXME("iface %p, d3d_device %p stub!\n", iface, d3d_device); + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - return E_NOTIMPL; + TRACE("iface %p, d3d_device %p.\n", iface, d3d_device); + + return IDirect3DRMDevice3_GetDirect3DDevice2(&device->IDirect3DRMDevice3_iface, d3d_device); } static const struct IDirect3DRMDevice2Vtbl d3drm_device2_vtbl = @@ -446,21 +808,57 @@ { struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); - return d3drm_device2_QueryInterface(&device->IDirect3DRMDevice2_iface, riid, out); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMDevice3) + || IsEqualGUID(riid, &IID_IUnknown)) + { + *out = &device->IDirect3DRMDevice3_iface; + } + else if (IsEqualGUID(riid, &IID_IDirect3DRMDevice2)) + { + *out = &device->IDirect3DRMDevice2_iface; + } + else if (IsEqualGUID(riid, &IID_IDirect3DRMDevice)) + { + *out = &device->IDirect3DRMDevice_iface; + } + else if (IsEqualGUID(riid, &IID_IDirect3DRMWinDevice)) + { + *out = &device->IDirect3DRMWinDevice_iface; + } + else + { + *out = NULL; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; } static ULONG WINAPI d3drm_device3_AddRef(IDirect3DRMDevice3 *iface) { struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + ULONG refcount = InterlockedIncrement(&device->ref); - return d3drm_device2_AddRef(&device->IDirect3DRMDevice2_iface); + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; } static ULONG WINAPI d3drm_device3_Release(IDirect3DRMDevice3 *iface) { struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + ULONG refcount = InterlockedDecrement(&device->ref); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + HeapFree(GetProcessHeap(), 0, device); - return d3drm_device2_Release(&device->IDirect3DRMDevice2_iface); + return refcount; } static HRESULT WINAPI d3drm_device3_Clone(IDirect3DRMDevice3 *iface, @@ -858,29 +1256,37 @@ { struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface); - return d3drm_device2_QueryInterface(&device->IDirect3DRMDevice2_iface, riid, out); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + return d3drm_device3_QueryInterface(&device->IDirect3DRMDevice3_iface, riid, out); } static ULONG WINAPI d3drm_device_win_AddRef(IDirect3DRMWinDevice *iface) { struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface); - return d3drm_device2_AddRef(&device->IDirect3DRMDevice2_iface); + TRACE("iface %p.\n", iface); + + return d3drm_device3_AddRef(&device->IDirect3DRMDevice3_iface); } static ULONG WINAPI d3drm_device_win_Release(IDirect3DRMWinDevice *iface) { struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface); - return d3drm_device2_Release(&device->IDirect3DRMDevice2_iface); + TRACE("iface %p.\n", iface); + + return d3drm_device3_Release(&device->IDirect3DRMDevice3_iface); } static HRESULT WINAPI d3drm_device_win_Clone(IDirect3DRMWinDevice *iface, IUnknown *outer, REFIID iid, void **out) { - FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface); - return E_NOTIMPL; + TRACE("iface %p, outer %p, iid %s, out %p\n", iface, outer, debugstr_guid(iid), out); + + return IDirect3DRMDevice3_Clone(&device->IDirect3DRMDevice3_iface, outer, iid, out); } static HRESULT WINAPI d3drm_device_win_AddDestroyCallback(IDirect3DRMWinDevice *iface, @@ -901,30 +1307,38 @@ static HRESULT WINAPI d3drm_device_win_SetAppData(IDirect3DRMWinDevice *iface, DWORD data) { - FIXME("iface %p, data %#x stub!\n", iface, data); + struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface); - return E_NOTIMPL; + TRACE("iface %p, data %#x.\n", iface, data); + + return IDirect3DRMDevice3_SetAppData(&device->IDirect3DRMDevice3_iface, data); } static DWORD WINAPI d3drm_device_win_GetAppData(IDirect3DRMWinDevice *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface); - return 0; + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetAppData(&device->IDirect3DRMDevice3_iface); } static HRESULT WINAPI d3drm_device_win_SetName(IDirect3DRMWinDevice *iface, const char *name) { - FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface); - return E_NOTIMPL; + TRACE("iface %p, name %s.\n", iface, debugstr_a(name)); + + return IDirect3DRMDevice3_SetName(&device->IDirect3DRMDevice3_iface, name); } static HRESULT WINAPI d3drm_device_win_GetName(IDirect3DRMWinDevice *iface, DWORD *size, char *name) { - FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface); - return E_NOTIMPL; + TRACE("iface %p, size %p, name %p stub!\n", iface, size, name); + + return IDirect3DRMDevice3_GetName(&device->IDirect3DRMDevice3_iface, size, name); } static HRESULT WINAPI d3drm_device_win_GetClassName(IDirect3DRMWinDevice *iface, DWORD *size, char *name) @@ -970,21 +1384,21 @@ HRESULT Direct3DRMDevice_create(REFIID riid, IUnknown **out) { struct d3drm_device *object; + HRESULT hr; TRACE("riid %s, out %p.\n", debugstr_guid(riid), out); if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; + object->IDirect3DRMDevice_iface.lpVtbl = &d3drm_device1_vtbl; object->IDirect3DRMDevice2_iface.lpVtbl = &d3drm_device2_vtbl; object->IDirect3DRMDevice3_iface.lpVtbl = &d3drm_device3_vtbl; object->IDirect3DRMWinDevice_iface.lpVtbl = &d3drm_device_win_vtbl; object->ref = 1; - if (IsEqualGUID(riid, &IID_IDirect3DRMDevice3)) - *out = (IUnknown*)&object->IDirect3DRMDevice3_iface; - else - *out = (IUnknown*)&object->IDirect3DRMDevice2_iface; + hr = IDirect3DRMDevice_QueryInterface(&object->IDirect3DRMDevice3_iface, riid, (void **)out); + IDirect3DRMDevice3_Release(&object->IDirect3DRMDevice3_iface); - return S_OK; + return hr; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3drm/tests/d3drm.c wine-staging-1.7.48~ubuntu12.04.1/dlls/d3drm/tests/d3drm.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3drm/tests/d3drm.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3drm/tests/d3drm.c 2015-07-29 19:28:54.000000000 +0000 @@ -1999,10 +1999,14 @@ hr = IDirect3DRM2_CreateDeviceFromClipper(d3drm2, clipper, &driver, 0, 0, &device2); todo_wine ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %x.\n", hr); + if (SUCCEEDED(hr)) + IDirect3DRMDevice2_Release(device2); /* If NULL is passed for clipper, CreateDeviceFromClipper returns D3DRMERR_BADVALUE */ hr = IDirect3DRM2_CreateDeviceFromClipper(d3drm2, NULL, &driver, 0, 0, &device2); todo_wine ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %x.\n", hr); + if (SUCCEEDED(hr)) + IDirect3DRMDevice2_Release(device2); hr = IDirect3DRM2_CreateDeviceFromClipper(d3drm2, clipper, &driver, 300, 200, &device2); ok(hr == D3DRM_OK, "Cannot create IDirect3DRMDevice2 interface (hr = %x).\n", hr); @@ -2197,6 +2201,8 @@ hr = IDirect3DRM2_CreateDeviceFromSurface(d3drm2, &driver, ddraw, surface, &device2); todo_wine ok(hr == DDERR_INVALIDCAPS, "Expected hr == DDERR_INVALIDCAPS, got %x.\n", hr); IDirectDrawSurface_Release(surface); + if (SUCCEEDED(hr)) + IDirect3DRMDevice2_Release(device2); desc.ddsCaps.dwCaps |= DDSCAPS_3DDEVICE; hr = IDirectDraw_CreateSurface(ddraw, &desc, &surface, NULL); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_24/d3dx9_24.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_24/d3dx9_24.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_24/d3dx9_24.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_24/d3dx9_24.spec 2015-07-29 19:28:54.000000000 +0000 @@ -22,7 +22,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_25/d3dx9_25.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_25/d3dx9_25.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_25/d3dx9_25.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_25/d3dx9_25.spec 2015-07-29 19:28:54.000000000 +0000 @@ -22,7 +22,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_26/d3dx9_26.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_26/d3dx9_26.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_26/d3dx9_26.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_26/d3dx9_26.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_27/d3dx9_27.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_27/d3dx9_27.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_27/d3dx9_27.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_27/d3dx9_27.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_28/d3dx9_28.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_28/d3dx9_28.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_28/d3dx9_28.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_28/d3dx9_28.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_29/d3dx9_29.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_29/d3dx9_29.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_29/d3dx9_29.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_29/d3dx9_29.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_30/d3dx9_30.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_30/d3dx9_30.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_30/d3dx9_30.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_30/d3dx9_30.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_31/d3dx9_31.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_31/d3dx9_31.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_31/d3dx9_31.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_31/d3dx9_31.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_32/d3dx9_32.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_32/d3dx9_32.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_32/d3dx9_32.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_32/d3dx9_32.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_33/d3dx9_33.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_33/d3dx9_33.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_33/d3dx9_33.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_33/d3dx9_33.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_34/d3dx9_34.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_34/d3dx9_34.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_34/d3dx9_34.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_34/d3dx9_34.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_35/d3dx9_35.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_35/d3dx9_35.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_35/d3dx9_35.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_35/d3dx9_35.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_36/d3dx9_36.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_36/d3dx9_36.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_36/d3dx9_36.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_36/d3dx9_36.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stub D3DXComputeNormals(ptr ptr) @ stub D3DXComputeTangent(ptr long long long long ptr) @ stub D3DXComputeTangentFrame(ptr long) -@ stub D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) @ stub D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) @ stub D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) @@ -165,7 +165,7 @@ @ stdcall D3DXGetShaderSize(ptr) @ stdcall D3DXGetShaderVersion(ptr) @ stdcall D3DXGetVertexShaderProfile(ptr) -@ stub D3DXIntersect(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall D3DXIntersect(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) @ stub D3DXIntersectSubset(ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr) @ stdcall D3DXIntersectTri(ptr ptr ptr ptr ptr ptr ptr ptr) @ stdcall D3DXLoadMeshFromXA(str long ptr ptr ptr ptr ptr ptr) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_36/mesh.c wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_36/mesh.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_36/mesh.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_36/mesh.c 2015-07-29 19:28:54.000000000 +0000 @@ -7234,3 +7234,35 @@ error: return hr; } + +/************************************************************************* + * D3DXComputeTangentFrameEx (D3DX9_36.@) + */ +HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *mesh, DWORD texture_in_semantic, DWORD texture_in_index, + DWORD u_partial_out_semantic, DWORD u_partial_out_index, DWORD v_partial_out_semantic, + DWORD v_partial_out_index, DWORD normal_out_semantic, DWORD normal_out_index, DWORD options, + const DWORD *adjacency, float partial_edge_threshold, float singular_point_threshold, + float normal_edge_threshold, ID3DXMesh **mesh_out, ID3DXBuffer **vertex_mapping) +{ + FIXME("mesh %p, texture_in_semantic %u, texture_in_index %u, u_partial_out_semantic %u, u_partial_out_index %u, " + "v_partial_out_semantic %u, v_partial_out_index %u, normal_out_semantic %u, normal_out_index %u, " + "options %#x, adjacency %p, partial_edge_threshold %f, singular_point_threshold %f, " + "normal_edge_threshold %f, mesh_out %p, vertex_mapping %p stub!\n", + mesh, texture_in_semantic, texture_in_index, u_partial_out_semantic, u_partial_out_index, + v_partial_out_semantic, v_partial_out_index, normal_out_semantic, normal_out_index, options, adjacency, + partial_edge_threshold, singular_point_threshold, normal_edge_threshold, mesh_out, vertex_mapping); + + return E_NOTIMPL; +} + +/************************************************************************* + * D3DXIntersect (D3DX9_36.@) + */ +HRESULT WINAPI D3DXIntersect(ID3DXBaseMesh *mesh, const D3DXVECTOR3 *ray_pos, const D3DXVECTOR3 *ray_dir, + BOOL *hit, DWORD *face_index, float *u, float *v, float *distance, ID3DXBuffer **all_hits, DWORD *count_of_hits) +{ + FIXME("mesh %p, ray_pos %p, ray_dir %p, hit %p, face_index %p, u %p, v %p, distance %p, all_hits %p, " + "count_of_hits %p stub!\n", mesh, ray_pos, ray_dir, hit, face_index, u, v, distance, all_hits, count_of_hits); + + return E_NOTIMPL; +} diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_37/d3dx9_37.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_37/d3dx9_37.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_37/d3dx9_37.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_37/d3dx9_37.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_38/d3dx9_38.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_38/d3dx9_38.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_38/d3dx9_38.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_38/d3dx9_38.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_39/d3dx9_39.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_39/d3dx9_39.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_39/d3dx9_39.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_39/d3dx9_39.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_40/d3dx9_40.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_40/d3dx9_40.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_40/d3dx9_40.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_40/d3dx9_40.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_41/d3dx9_41.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_41/d3dx9_41.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_41/d3dx9_41.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_41/d3dx9_41.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_42/d3dx9_42.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_42/d3dx9_42.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_42/d3dx9_42.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_42/d3dx9_42.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_43/d3dx9_43.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_43/d3dx9_43.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/d3dx9_43/d3dx9_43.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/d3dx9_43/d3dx9_43.spec 2015-07-29 19:28:54.000000000 +0000 @@ -26,7 +26,7 @@ @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/davclnt/davclnt.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/davclnt/davclnt.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/davclnt/davclnt.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/davclnt/davclnt.spec 2015-07-29 19:28:54.000000000 +0000 @@ -3,8 +3,8 @@ @ stub DavGetDiskSpaceUsage @ stub DavGetTheLockOwnerOfTheFile @ stub DavInvalidateCache -@ stub DavRegisterAuthCallback -@ stub DavUnregisterAuthCallback +@ stdcall DavRegisterAuthCallback(ptr long) +@ stdcall DavUnregisterAuthCallback(long) @ stub DllCanUnloadNow @ stub DllGetClassObject @ stdcall -private DllMain(long long ptr) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/davclnt/main.c wine-staging-1.7.48~ubuntu12.04.1/dlls/davclnt/main.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/davclnt/main.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/davclnt/main.c 2015-07-29 19:28:54.000000000 +0000 @@ -24,6 +24,11 @@ #include "windef.h" #include "winbase.h" +#include "davclnt.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(davclnt); BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) { @@ -38,3 +43,20 @@ return TRUE; } + +/*********************************************************************** + * DavRegisterAuthCallback (davclnt.@) + */ +OPAQUE_HANDLE WINAPI DavRegisterAuthCallback(PFNDAVAUTHCALLBACK cb, ULONG version) +{ + FIXME("%p, %u\n", cb, version); + return 0; +} + +/*********************************************************************** + * DavUnregisterAuthCallback (davclnt.@) + */ +VOID WINAPI DavUnregisterAuthCallback(OPAQUE_HANDLE handle) +{ + FIXME("%u\n", handle); +} diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/analyzer.c wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/analyzer.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/analyzer.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/analyzer.c 2015-07-29 19:28:54.000000000 +0000 @@ -21,6 +21,8 @@ #define COBJMACROS +#include + #include "dwrite_private.h" #include "scripts.h" @@ -1066,7 +1068,7 @@ static HRESULT WINAPI dwritetextanalyzer_GetGdiCompatibleGlyphPlacements(IDWriteTextAnalyzer2 *iface, WCHAR const* text, UINT16 const* clustermap, DWRITE_SHAPING_TEXT_PROPERTIES* props, UINT32 text_len, UINT16 const* glyphs, DWRITE_SHAPING_GLYPH_PROPERTIES const* glyph_props, - UINT32 glyph_count, IDWriteFontFace *fontface, FLOAT emSize, FLOAT pixels_per_dip, + UINT32 glyph_count, IDWriteFontFace *fontface, FLOAT emSize, FLOAT ppdip, DWRITE_MATRIX const* transform, BOOL use_gdi_natural, BOOL is_sideways, BOOL is_rtl, DWRITE_SCRIPT_ANALYSIS const* analysis, WCHAR const* locale, DWRITE_TYPOGRAPHIC_FEATURES const** features, UINT32 const* feature_range_lengths, UINT32 feature_ranges, FLOAT *advances, DWRITE_GLYPH_OFFSET *offsets) @@ -1077,7 +1079,7 @@ UINT32 i; TRACE("(%s %p %p %u %p %p %u %p %.2f %.2f %p %d %d %d %p %s %p %p %u %p %p)\n", debugstr_wn(text, text_len), - clustermap, props, text_len, glyphs, glyph_props, glyph_count, fontface, emSize, pixels_per_dip, + clustermap, props, text_len, glyphs, glyph_props, glyph_count, fontface, emSize, ppdip, transform, use_gdi_natural, is_sideways, is_rtl, analysis, debugstr_w(locale), features, feature_range_lengths, feature_ranges, advances, offsets); @@ -1090,16 +1092,21 @@ return hr; } - IDWriteFontFace_GetGdiCompatibleMetrics(fontface, emSize, pixels_per_dip, transform, &metrics); + hr = IDWriteFontFace_GetGdiCompatibleMetrics(fontface, emSize, ppdip, transform, &metrics); + if (FAILED(hr)) { + IDWriteFontFace1_Release(fontface1); + WARN("failed to get compat metrics, 0x%08x\n", hr); + return hr; + } for (i = 0; i < glyph_count; i++) { INT32 a; - hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, emSize, pixels_per_dip, + hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, emSize, ppdip, transform, use_gdi_natural, is_sideways, 1, &glyphs[i], &a); if (FAILED(hr)) - a = 0; - - advances[i] = get_scaled_advance_width(a, emSize, &metrics); + advances[i] = 0.0; + else + advances[i] = floorf(a * emSize * ppdip / metrics.designUnitsPerEm + 0.5f) / ppdip; offsets[i].advanceOffset = 0.0; offsets[i].ascenderOffset = 0.0; } @@ -1500,22 +1507,8 @@ /* shift components represent transform necessary to get from original point to rotated one in new coordinate system */ if ((originX != 0.0 || originY != 0.0) && angle != DWRITE_GLYPH_ORIENTATION_ANGLE_0_DEGREES) { - const DWRITE_MATRIX *p; - - switch (angle) { - case DWRITE_GLYPH_ORIENTATION_ANGLE_90_DEGREES: - angle = DWRITE_GLYPH_ORIENTATION_ANGLE_270_DEGREES; - break; - case DWRITE_GLYPH_ORIENTATION_ANGLE_270_DEGREES: - angle = DWRITE_GLYPH_ORIENTATION_ANGLE_90_DEGREES; - break; - default: - ; - } - - p = &transforms[angle]; - m->dx = originX - (p->m11 * originX + p->m12 * originY); - m->dy = originY - (p->m21 * originX + p->m22 * originY); + m->dx = originX - (m->m11 * originX + m->m21 * originY); + m->dy = originY - (m->m12 * originX + m->m22 * originY); } return S_OK; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/bidi.c wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/bidi.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/bidi.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/bidi.c 2015-07-29 19:28:54.000000000 +0000 @@ -445,8 +445,9 @@ pop_stack(); break; - /* X8: Nothing */ + /* X8 */ default: + levels[i] = baselevel; break; } } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/dwrite_private.h wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/dwrite_private.h --- wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/dwrite_private.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/dwrite_private.h 2015-07-29 19:28:54.000000000 +0000 @@ -92,6 +92,13 @@ return wine_dbg_sprintf("%u:%u", range->startPosition, range->length); } +static inline const char *debugstr_matrix(const DWRITE_MATRIX *m) +{ + if (!m) return "(null)"; + return wine_dbg_sprintf("{%.2f,%.2f,%.2f,%.2f,%.2f,%.2f}", m->m11, m->m12, m->m21, m->m22, + m->dx, m->dy); +} + static inline unsigned short get_table_entry(const unsigned short *table, WCHAR ch) { return table[table[table[ch >> 8] + ((ch >> 4) & 0x0f)] + (ch & 0xf)]; @@ -141,6 +148,15 @@ extern HRESULT opentype_get_typographic_features(IDWriteFontFace*,UINT32,UINT32,UINT32,UINT32*,DWRITE_FONT_FEATURE_TAG*) DECLSPEC_HIDDEN; extern BOOL opentype_get_vdmx_size(const void*,INT,UINT16*,UINT16*) DECLSPEC_HIDDEN; +enum gasp_flags { + GASP_GRIDFIT = 0x0001, + GASP_DOGRAY = 0x0002, + GASP_SYMMETRIC_GRIDFIT = 0x0004, + GASP_SYMMETRIC_SMOOTHING = 0x0008, +}; + +extern WORD opentype_get_gasp_flags(const WORD*,UINT32,INT) DECLSPEC_HIDDEN; + /* BiDi helpers */ extern HRESULT bidi_computelevels(const WCHAR*,UINT32,UINT8,UINT8*,UINT8*) DECLSPEC_HIDDEN; extern WCHAR bidi_get_mirrored_char(WCHAR) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/font.c wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/font.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/font.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/font.c 2015-07-29 19:28:54.000000000 +0000 @@ -32,9 +32,14 @@ #define MS_CMAP_TAG DWRITE_MAKE_OPENTYPE_TAG('c','m','a','p') #define MS_NAME_TAG DWRITE_MAKE_OPENTYPE_TAG('n','a','m','e') #define MS_VDMX_TAG DWRITE_MAKE_OPENTYPE_TAG('V','D','M','X') +#define MS_GASP_TAG DWRITE_MAKE_OPENTYPE_TAG('g','a','s','p') static const IID IID_issystemcollection = {0x14d88047,0x331f,0x4cd3,{0xbc,0xa8,0x3e,0x67,0x99,0xaf,0x34,0x75}}; +static const FLOAT RECOMMENDED_OUTLINE_AA_THRESHOLD = 100.0f; +static const FLOAT RECOMMENDED_OUTLINE_A_THRESHOLD = 350.0f; +static const FLOAT RECOMMENDED_NATURAL_PPEM = 20.0f; + struct dwrite_font_data { LONG ref; @@ -104,6 +109,8 @@ struct dwrite_glyphrunanalysis { IDWriteGlyphRunAnalysis IDWriteGlyphRunAnalysis_iface; LONG ref; + + DWRITE_RENDERING_MODE rendering_mode; }; #define GLYPH_BLOCK_SHIFT 8 @@ -127,6 +134,7 @@ struct dwrite_fonttable cmap; struct dwrite_fonttable vdmx; + struct dwrite_fonttable gasp; DWRITE_GLYPH_METRICS *glyphs[GLYPH_MAX/GLYPH_BLOCK_SIZE]; }; @@ -228,6 +236,13 @@ return get_fontface_table(fontface, MS_VDMX_TAG, &fontface->vdmx); } +static inline void* get_fontface_gasp(struct dwrite_fontface *fontface, UINT32 *size) +{ + void *ptr = get_fontface_table(fontface, MS_GASP_TAG, &fontface->gasp); + *size = fontface->gasp.size; + return ptr; +} + static void release_font_data(struct dwrite_font_data *data) { int i; @@ -302,6 +317,8 @@ IDWriteFontFace2_ReleaseFontTable(iface, This->cmap.context); if (This->vdmx.context) IDWriteFontFace2_ReleaseFontTable(iface, This->vdmx.context); + if (This->gasp.context) + IDWriteFontFace2_ReleaseFontTable(iface, This->gasp.context); for (i = 0; i < This->file_count; i++) { if (This->streams[i]) IDWriteFontFileStream_Release(This->streams[i]); @@ -583,12 +600,64 @@ return S_OK; } +static DWRITE_RENDERING_MODE fontface_renderingmode_from_measuringmode(DWRITE_MEASURING_MODE measuring, + FLOAT ppem, WORD gasp) +{ + DWRITE_RENDERING_MODE mode = DWRITE_RENDERING_MODE_DEFAULT; + + switch (measuring) + { + case DWRITE_MEASURING_MODE_NATURAL: + { + if (!(gasp & GASP_SYMMETRIC_SMOOTHING) && (ppem <= RECOMMENDED_NATURAL_PPEM)) + mode = DWRITE_RENDERING_MODE_NATURAL; + else + mode = DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC; + break; + } + case DWRITE_MEASURING_MODE_GDI_CLASSIC: + mode = DWRITE_RENDERING_MODE_GDI_CLASSIC; + break; + case DWRITE_MEASURING_MODE_GDI_NATURAL: + mode = DWRITE_RENDERING_MODE_GDI_NATURAL; + break; + default: + ; + } + + return mode; +} + static HRESULT WINAPI dwritefontface_GetRecommendedRenderingMode(IDWriteFontFace2 *iface, FLOAT emSize, - FLOAT pixels_per_dip, DWRITE_MEASURING_MODE mode, IDWriteRenderingParams* params, DWRITE_RENDERING_MODE* rendering_mode) + FLOAT ppdip, DWRITE_MEASURING_MODE measuring, IDWriteRenderingParams *params, DWRITE_RENDERING_MODE *mode) { struct dwrite_fontface *This = impl_from_IDWriteFontFace2(iface); - FIXME("(%p)->(%f %f %d %p %p): stub\n", This, emSize, pixels_per_dip, mode, params, rendering_mode); - return E_NOTIMPL; + WORD gasp, *ptr; + UINT32 size; + FLOAT ppem; + + TRACE("(%p)->(%.2f %.2f %d %p %p)\n", This, emSize, ppdip, measuring, params, mode); + + if (!params) { + *mode = DWRITE_RENDERING_MODE_DEFAULT; + return E_INVALIDARG; + } + + *mode = IDWriteRenderingParams_GetRenderingMode(params); + if (*mode != DWRITE_RENDERING_MODE_DEFAULT) + return S_OK; + + ppem = emSize * ppdip; + + if (ppem >= RECOMMENDED_OUTLINE_AA_THRESHOLD) { + *mode = DWRITE_RENDERING_MODE_OUTLINE; + return S_OK; + } + + ptr = get_fontface_gasp(This, &size); + gasp = opentype_get_gasp_flags(ptr, size, ppem); + *mode = fontface_renderingmode_from_measuringmode(measuring, ppem, gasp); + return S_OK; } static HRESULT WINAPI dwritefontface_GetGdiCompatibleMetrics(IDWriteFontFace2 *iface, FLOAT emSize, FLOAT pixels_per_dip, @@ -600,14 +669,48 @@ return hr; } -static HRESULT WINAPI dwritefontface_GetGdiCompatibleGlyphMetrics(IDWriteFontFace2 *iface, FLOAT emSize, FLOAT pixels_per_dip, - DWRITE_MATRIX const *transform, BOOL use_gdi_natural, UINT16 const *glyph_indices, UINT32 glyph_count, +static inline int round_metric(FLOAT metric) +{ + return (int)floorf(metric + 0.5f); +} + +static HRESULT WINAPI dwritefontface_GetGdiCompatibleGlyphMetrics(IDWriteFontFace2 *iface, FLOAT emSize, FLOAT ppdip, + DWRITE_MATRIX const *m, BOOL use_gdi_natural, UINT16 const *glyphs, UINT32 glyph_count, DWRITE_GLYPH_METRICS *metrics, BOOL is_sideways) { struct dwrite_fontface *This = impl_from_IDWriteFontFace2(iface); - FIXME("(%p)->(%f %f %p %d %p %u %p %d): stub\n", This, emSize, pixels_per_dip, transform, use_gdi_natural, glyph_indices, + FLOAT scale; + HRESULT hr; + UINT32 i; + + TRACE("(%p)->(%.2f %.2f %p %d %p %u %p %d)\n", This, emSize, ppdip, m, use_gdi_natural, glyphs, glyph_count, metrics, is_sideways); - return E_NOTIMPL; + + if (m && memcmp(m, &identity, sizeof(*m))) + FIXME("transform is not supported, %s\n", debugstr_matrix(m)); + + scale = emSize * ppdip / This->metrics.designUnitsPerEm; + + for (i = 0; i < glyph_count; i++) { + DWRITE_GLYPH_METRICS *ret = metrics + i; + DWRITE_GLYPH_METRICS design; + + hr = IDWriteFontFace2_GetDesignGlyphMetrics(iface, glyphs + i, 1, &design, is_sideways); + if (FAILED(hr)) + return hr; + +#define SCALE_METRIC(x) ret->x = round_metric(round_metric((design.x) * scale) / scale) + SCALE_METRIC(leftSideBearing); + SCALE_METRIC(advanceWidth); + SCALE_METRIC(rightSideBearing); + SCALE_METRIC(topSideBearing); + SCALE_METRIC(advanceHeight); + SCALE_METRIC(bottomSideBearing); + SCALE_METRIC(verticalOriginY); +#undef SCALE_METRIC + } + + return S_OK; } static void WINAPI dwritefontface1_GetMetrics(IDWriteFontFace2 *iface, DWRITE_FONT_METRICS1 *metrics) @@ -617,11 +720,6 @@ *metrics = This->metrics; } -static inline int round_metric(FLOAT metric) -{ - return (int)floor(metric + 0.5); -} - static HRESULT WINAPI dwritefontface1_GetGdiCompatibleMetrics(IDWriteFontFace2 *iface, FLOAT em_size, FLOAT pixels_per_dip, const DWRITE_MATRIX *m, DWRITE_FONT_METRICS1 *metrics) { @@ -632,7 +730,7 @@ TRACE("(%p)->(%.2f %.2f %p %p)\n", This, em_size, pixels_per_dip, m, metrics); - if (pixels_per_dip <= 0.0) { + if (em_size <= 0.0 || pixels_per_dip <= 0.0) { memset(metrics, 0, sizeof(*metrics)); return E_INVALIDARG; } @@ -729,13 +827,42 @@ } static HRESULT WINAPI dwritefontface1_GetGdiCompatibleGlyphAdvances(IDWriteFontFace2 *iface, - FLOAT em_size, FLOAT pixels_per_dip, const DWRITE_MATRIX *transform, BOOL use_gdi_natural, - BOOL is_sideways, UINT32 glyph_count, UINT16 const *indices, INT32 *advances) + FLOAT em_size, FLOAT ppdip, const DWRITE_MATRIX *m, BOOL use_gdi_natural, + BOOL is_sideways, UINT32 glyph_count, UINT16 const *glyphs, INT32 *advances) { struct dwrite_fontface *This = impl_from_IDWriteFontFace2(iface); - FIXME("(%p)->(%f %f %p %d %d %u %p %p): stub\n", This, em_size, pixels_per_dip, transform, - use_gdi_natural, is_sideways, glyph_count, indices, advances); - return E_NOTIMPL; + FLOAT scale; + HRESULT hr; + UINT32 i; + + TRACE("(%p)->(%.2f %.2f %p %d %d %u %p %p)\n", This, em_size, ppdip, m, + use_gdi_natural, is_sideways, glyph_count, glyphs, advances); + + if (em_size < 0.0 || ppdip <= 0.0) { + memset(advances, 0, sizeof(*advances) * glyph_count); + return E_INVALIDARG; + } + + scale = em_size * ppdip / This->metrics.designUnitsPerEm; + if (scale == 0.0) { + memset(advances, 0, sizeof(*advances) * glyph_count); + return S_OK; + } + + if (m && memcmp(m, &identity, sizeof(*m))) + FIXME("transform is not supported, %s\n", debugstr_matrix(m)); + + for (i = 0; i < glyph_count; i++) { + hr = IDWriteFontFace2_GetDesignGlyphAdvances(iface, 1, glyphs + i, advances + i, is_sideways); + if (FAILED(hr)) + return hr; + +#define SCALE_METRIC(x) x = round_metric(round_metric((x) * scale) / scale) + SCALE_METRIC(advances[i]); +#undef SCALE_METRIC + } + + return S_OK; } static HRESULT WINAPI dwritefontface1_GetKerningPairAdjustments(IDWriteFontFace2 *iface, UINT32 count, @@ -772,10 +899,7 @@ FLOAT font_emsize, FLOAT dpiX, FLOAT dpiY, const DWRITE_MATRIX *transform, BOOL is_sideways, DWRITE_OUTLINE_THRESHOLD threshold, DWRITE_MEASURING_MODE measuring_mode, DWRITE_RENDERING_MODE *rendering_mode) { - struct dwrite_fontface *This = impl_from_IDWriteFontFace2(iface); DWRITE_GRID_FIT_MODE gridfitmode; - TRACE("(%p)->(%.2f %.2f %.2f %p %d %d %d %p)\n", This, font_emsize, dpiX, dpiY, transform, is_sideways, - threshold, measuring_mode, rendering_mode); return IDWriteFontFace2_GetRecommendedRenderingMode(iface, font_emsize, dpiX, dpiY, transform, is_sideways, threshold, measuring_mode, NULL, rendering_mode, &gridfitmode); } @@ -824,15 +948,63 @@ return E_NOTIMPL; } -static HRESULT WINAPI dwritefontface2_GetRecommendedRenderingMode(IDWriteFontFace2 *iface, FLOAT fontEmSize, - FLOAT dpiX, FLOAT dpiY, DWRITE_MATRIX const *transform, BOOL is_sideways, DWRITE_OUTLINE_THRESHOLD threshold, +static HRESULT WINAPI dwritefontface2_GetRecommendedRenderingMode(IDWriteFontFace2 *iface, FLOAT emSize, + FLOAT dpiX, FLOAT dpiY, DWRITE_MATRIX const *m, BOOL is_sideways, DWRITE_OUTLINE_THRESHOLD threshold, DWRITE_MEASURING_MODE measuringmode, IDWriteRenderingParams *params, DWRITE_RENDERING_MODE *renderingmode, DWRITE_GRID_FIT_MODE *gridfitmode) { struct dwrite_fontface *This = impl_from_IDWriteFontFace2(iface); - FIXME("(%p)->(%f %f %f %p %d %d %d %p %p %p): stub\n", This, fontEmSize, dpiX, dpiY, transform, is_sideways, threshold, + FLOAT emthreshold; + WORD gasp, *ptr; + UINT32 size; + + TRACE("(%p)->(%.2f %.2f %.2f %p %d %d %d %p %p %p)\n", This, emSize, dpiX, dpiY, m, is_sideways, threshold, measuringmode, params, renderingmode, gridfitmode); - return E_NOTIMPL; + + if (m) + FIXME("transform not supported %s\n", debugstr_matrix(m)); + + if (is_sideways) + FIXME("sideways mode not supported\n"); + + *renderingmode = DWRITE_RENDERING_MODE_DEFAULT; + *gridfitmode = DWRITE_GRID_FIT_MODE_DEFAULT; + if (params) { + IDWriteRenderingParams2 *params2; + HRESULT hr; + + hr = IDWriteRenderingParams_QueryInterface(params, &IID_IDWriteRenderingParams2, (void**)¶ms2); + if (hr == S_OK) { + *renderingmode = IDWriteRenderingParams2_GetRenderingMode(params2); + *gridfitmode = IDWriteRenderingParams2_GetGridFitMode(params2); + IDWriteRenderingParams2_Release(params2); + } + else + *renderingmode = IDWriteRenderingParams_GetRenderingMode(params); + } + + emthreshold = threshold == DWRITE_OUTLINE_THRESHOLD_ANTIALIASED ? RECOMMENDED_OUTLINE_AA_THRESHOLD : RECOMMENDED_OUTLINE_A_THRESHOLD; + + ptr = get_fontface_gasp(This, &size); + gasp = opentype_get_gasp_flags(ptr, size, emSize); + + if (*renderingmode == DWRITE_RENDERING_MODE_DEFAULT) { + if (emSize >= emthreshold) + *renderingmode = DWRITE_RENDERING_MODE_OUTLINE; + else + *renderingmode = fontface_renderingmode_from_measuringmode(measuringmode, emSize, gasp); + } + + if (*gridfitmode == DWRITE_GRID_FIT_MODE_DEFAULT) { + if (emSize >= emthreshold) + *gridfitmode = DWRITE_GRID_FIT_MODE_DISABLED; + else if (measuringmode == DWRITE_MEASURING_MODE_GDI_CLASSIC || measuringmode == DWRITE_MEASURING_MODE_GDI_NATURAL) + *gridfitmode = DWRITE_GRID_FIT_MODE_ENABLED; + else + *gridfitmode = (gasp & (GASP_GRIDFIT|GASP_SYMMETRIC_GRIDFIT)) ? DWRITE_GRID_FIT_MODE_ENABLED : DWRITE_GRID_FIT_MODE_DISABLED; + } + + return S_OK; } static const IDWriteFontFace2Vtbl dwritefontfacevtbl = { @@ -2284,8 +2456,10 @@ fontface->file_count = files_number; memset(&fontface->cmap, 0, sizeof(fontface->cmap)); memset(&fontface->vdmx, 0, sizeof(fontface->vdmx)); + memset(&fontface->gasp, 0, sizeof(fontface->gasp)); fontface->cmap.exists = TRUE; fontface->vdmx.exists = TRUE; + fontface->gasp.exists = TRUE; fontface->index = index; fontface->simulations = simulations; memset(fontface->glyphs, 0, sizeof(fontface->glyphs)); @@ -2725,7 +2899,20 @@ static HRESULT WINAPI glyphrunanalysis_GetAlphaTextureBounds(IDWriteGlyphRunAnalysis *iface, DWRITE_TEXTURE_TYPE type, RECT* bounds) { struct dwrite_glyphrunanalysis *This = impl_from_IDWriteGlyphRunAnalysis(iface); + FIXME("(%p)->(%d %p): stub\n", This, type, bounds); + + if ((UINT32)type > DWRITE_TEXTURE_CLEARTYPE_3x1) { + memset(bounds, 0, sizeof(*bounds)); + return E_INVALIDARG; + } + + if ((type == DWRITE_TEXTURE_ALIASED_1x1 && This->rendering_mode != DWRITE_RENDERING_MODE_ALIASED) || + (type == DWRITE_TEXTURE_CLEARTYPE_3x1 && This->rendering_mode == DWRITE_RENDERING_MODE_ALIASED)) { + memset(bounds, 0, sizeof(*bounds)); + return S_OK; + } + return E_NOTIMPL; } @@ -2770,6 +2957,7 @@ analysis->IDWriteGlyphRunAnalysis_iface.lpVtbl = &glyphrunanalysisvtbl; analysis->ref = 1; + analysis->rendering_mode = rendering_mode; *ret = &analysis->IDWriteGlyphRunAnalysis_iface; return S_OK; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/freetype.c wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/freetype.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/freetype.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/freetype.c 2015-07-29 19:28:54.000000000 +0000 @@ -297,12 +297,6 @@ cubic_control[2].y += (cubic_control[3].y + 1) / 3; } -static inline void set_outline_end_tag(short point, short endpoint, UINT8 *tag) -{ - if (point == endpoint) - *tag |= OUTLINE_POINT_END; -} - static short get_outline_data(const FT_Outline *outline, struct glyph_outline *ret) { short contour, point = 0, first_pt, count; @@ -312,6 +306,8 @@ if (ret) { ft_vector_to_d2d_point(&outline->points[point], &ret->points[count]); ret->tags[count] = OUTLINE_POINT_START; + if (count) + ret->tags[count-1] |= OUTLINE_POINT_END; } point++; @@ -323,7 +319,6 @@ if (ret) { ft_vector_to_d2d_point(&outline->points[point], &ret->points[count]); ret->tags[count] |= OUTLINE_POINT_LINE; - set_outline_end_tag(point, outline->contours[contour], &ret->tags[count]); } point++; @@ -341,7 +336,6 @@ ret->tags[count] = OUTLINE_POINT_BEZIER; ret->tags[count+1] = OUTLINE_POINT_BEZIER; ret->tags[count+2] = OUTLINE_POINT_BEZIER; - set_outline_end_tag(point, outline->contours[contour], &ret->tags[count+2]); } count += 3; @@ -361,6 +355,9 @@ } } + if (ret) + ret->tags[count-1] |= OUTLINE_POINT_END; + return count; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/gdiinterop.c wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/gdiinterop.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/gdiinterop.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/gdiinterop.c 2015-07-29 19:28:54.000000000 +0000 @@ -47,25 +47,28 @@ HDC hdc; }; -static HRESULT create_target_dibsection(HDC hdc, UINT32 width, UINT32 height) +static HRESULT create_target_dibsection(struct rendertarget *target, UINT32 width, UINT32 height) { char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors[256])]; BITMAPINFO *bmi = (BITMAPINFO*)bmibuf; HBITMAP hbm; + target->size.cx = width; + target->size.cy = height; + memset(bmi, 0, sizeof(bmibuf)); bmi->bmiHeader.biSize = sizeof(bmi->bmiHeader); - bmi->bmiHeader.biHeight = height; + bmi->bmiHeader.biHeight = -height; bmi->bmiHeader.biWidth = width; bmi->bmiHeader.biBitCount = 32; bmi->bmiHeader.biPlanes = 1; bmi->bmiHeader.biCompression = BI_RGB; - hbm = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, NULL, NULL, 0); + hbm = CreateDIBSection(target->hdc, bmi, DIB_RGB_COLORS, NULL, NULL, 0); if (!hbm) hbm = CreateBitmap(1, 1, 1, 1, NULL); - DeleteObject(SelectObject(hdc, hbm)); + DeleteObject(SelectObject(target->hdc, hbm)); return S_OK; } @@ -199,7 +202,7 @@ if (This->size.cx == width && This->size.cy == height) return S_OK; - return create_target_dibsection(This->hdc, width, height); + return create_target_dibsection(This, width, height); } static DWRITE_TEXT_ANTIALIAS_MODE WINAPI rendertarget_GetTextAntialiasMode(IDWriteBitmapRenderTarget1 *iface) @@ -251,11 +254,8 @@ target->IDWriteBitmapRenderTarget1_iface.lpVtbl = &rendertargetvtbl; target->ref = 1; - target->size.cx = width; - target->size.cy = height; - target->hdc = CreateCompatibleDC(hdc); - hr = create_target_dibsection(target->hdc, width, height); + hr = create_target_dibsection(target, width, height); if (FAILED(hr)) { IDWriteBitmapRenderTarget1_Release(&target->IDWriteBitmapRenderTarget1_iface); return hr; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/layout.c wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/layout.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/layout.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/layout.c 2015-07-29 19:28:54.000000000 +0000 @@ -21,6 +21,7 @@ #define COBJMACROS #include +#include #include "windef.h" #include "winbase.h" @@ -251,10 +252,10 @@ DWRITE_TEXT_METRICS1 metrics; + DWRITE_MEASURING_MODE measuringmode; + /* gdi-compatible layout specifics */ - BOOL gdicompatible; - FLOAT pixels_per_dip; - BOOL use_gdi_natural; + FLOAT ppdip; DWRITE_MATRIX transform; }; @@ -280,6 +281,11 @@ UINT32 count; }; +struct dwrite_vec { + FLOAT x; + FLOAT y; +}; + static const IDWriteTextFormat1Vtbl dwritetextformatvtbl; static void release_format_data(struct dwrite_textformat_data *data) @@ -332,6 +338,11 @@ run->descr.stringLength); } +static inline BOOL is_layout_gdi_compatible(struct dwrite_textlayout *layout) +{ + return layout->measuringmode != DWRITE_MEASURING_MODE_NATURAL; +} + static inline HRESULT format_set_textalignment(struct dwrite_textformat_data *format, DWRITE_TEXT_ALIGNMENT alignment, BOOL *changed) { @@ -362,6 +373,16 @@ return S_OK; } +static inline HRESULT format_set_wordwrapping(struct dwrite_textformat_data *format, + DWRITE_WORD_WRAPPING wrapping, BOOL *changed) +{ + if ((UINT32)wrapping > DWRITE_WORD_WRAPPING_CHARACTER) + return E_INVALIDARG; + if (changed) *changed = format->wrapping != wrapping; + format->wrapping = wrapping; + return S_OK; +} + static HRESULT get_fontfallback_from_format(const struct dwrite_textformat_data *format, IDWriteFontFallback **fallback) { *fallback = format->fallback; @@ -797,12 +818,12 @@ goto memerr; /* now set advances and offsets */ - if (layout->gdicompatible) + if (is_layout_gdi_compatible(layout)) hr = IDWriteTextAnalyzer_GetGdiCompatibleGlyphPlacements(analyzer, run->descr.string, run->descr.clusterMap, text_props, run->descr.stringLength, run->run.glyphIndices, glyph_props, run->glyphcount, - run->run.fontFace, run->run.fontEmSize, layout->pixels_per_dip, &layout->transform, layout->use_gdi_natural, - run->run.isSideways, run->run.bidiLevel & 1, &run->sa, run->descr.localeName, NULL, NULL, 0, - run->advances, run->offsets); + run->run.fontFace, run->run.fontEmSize, layout->ppdip, &layout->transform, + layout->measuringmode == DWRITE_MEASURING_MODE_GDI_NATURAL, run->run.isSideways, + run->run.bidiLevel & 1, &run->sa, run->descr.localeName, NULL, NULL, 0, run->advances, run->offsets); else hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, run->descr.string, run->descr.clusterMap, text_props, run->descr.stringLength, run->run.glyphIndices, glyph_props, run->glyphcount, run->run.fontFace, @@ -826,13 +847,14 @@ run->run.glyphCount = run->glyphcount; /* baseline derived from font metrics */ - if (layout->gdicompatible) { - /* FIXME: check return value when it's actually implemented */ - IDWriteFontFace_GetGdiCompatibleMetrics(run->run.fontFace, + if (is_layout_gdi_compatible(layout)) { + hr = IDWriteFontFace_GetGdiCompatibleMetrics(run->run.fontFace, run->run.fontEmSize, - layout->pixels_per_dip, + layout->ppdip, &layout->transform, &fontmetrics); + if (FAILED(hr)) + WARN("failed to get compat metrics, 0x%08x\n", hr); } else IDWriteFontFace_GetMetrics(run->run.fontFace, &fontmetrics); @@ -1042,11 +1064,11 @@ if (!s) return E_OUTOFMEMORY; - if (layout->gdicompatible) { + if (is_layout_gdi_compatible(layout)) { HRESULT hr = IDWriteFontFace_GetGdiCompatibleMetrics( r->u.regular.run.fontFace, r->u.regular.run.fontEmSize, - layout->pixels_per_dip, + layout->ppdip, &layout->transform, &metrics); if (FAILED(hr)) @@ -1061,7 +1083,7 @@ s->s.readingDirection = layout->format.readingdir; s->s.flowDirection = layout->format.flow; s->s.localeName = r->u.regular.descr.localeName; - s->s.measuringMode = DWRITE_MEASURING_MODE_NATURAL; /* FIXME */ + s->s.measuringMode = layout->measuringmode; s->run = run; list_add_tail(&layout->strikethrough, &s->entry); @@ -1149,6 +1171,43 @@ return width; } +static inline BOOL should_skip_transform(const DWRITE_MATRIX *m, FLOAT *det) +{ + *det = m->m11 * m->m22 - m->m12 * m->m21; + /* on certain conditions we can skip transform */ + return (!memcmp(m, &identity, sizeof(*m)) || fabsf(*det) <= 1e-10f); +} + +static inline void layout_apply_snapping(struct dwrite_vec *vec, BOOL skiptransform, FLOAT ppdip, + const DWRITE_MATRIX *m, FLOAT det) +{ + if (!skiptransform) { + FLOAT vec2[2]; + + /* apply transform */ + vec->x *= ppdip; + vec->y *= ppdip; + + vec2[0] = m->m11 * vec->x + m->m21 * vec->y + m->dx; + vec2[1] = m->m12 * vec->x + m->m22 * vec->y + m->dy; + + /* snap */ + vec2[0] = floorf(vec2[0] + 0.5f); + vec2[1] = floorf(vec2[1] + 0.5f); + + /* apply inverted transform, we don't care about X component at this point */ + vec->x = (m->m22 * vec2[0] - m->m21 * vec2[1] + m->m21 * m->dy - m->m22 * m->dx) / det; + vec->x /= ppdip; + + vec->y = (-m->m12 * vec2[0] + m->m11 * vec2[1] - (m->m11 * m->dy - m->m12 * m->dx)) / det; + vec->y /= ppdip; + } + else { + vec->x = floorf(vec->x * ppdip + 0.5f) / ppdip; + vec->y = floorf(vec->y * ppdip + 0.5f) / ppdip; + } +} + static void layout_apply_leading_alignment(struct dwrite_textlayout *layout) { BOOL is_rtl = layout->format.readingdir == DWRITE_READING_DIRECTION_RIGHT_TO_LEFT; @@ -1202,19 +1261,35 @@ layout->metrics.left = is_rtl ? 0.0 : layout->metrics.layoutWidth - layout->metrics.width; } +static inline FLOAT layout_get_centered_shift(struct dwrite_textlayout *layout, BOOL skiptransform, + FLOAT width, FLOAT det) +{ + if (is_layout_gdi_compatible(layout)) { + struct dwrite_vec vec = { layout->metrics.layoutWidth - width, 0.0 }; + layout_apply_snapping(&vec, skiptransform, layout->ppdip, &layout->transform, det); + return floorf(vec.x / 2.0f); + } + else + return (layout->metrics.layoutWidth - width) / 2.0f; +} + static void layout_apply_centered_alignment(struct dwrite_textlayout *layout) { BOOL is_rtl = layout->format.readingdir == DWRITE_READING_DIRECTION_RIGHT_TO_LEFT; struct layout_effective_inline *inrun; struct layout_effective_run *erun; + BOOL skiptransform; UINT32 line; + FLOAT det; erun = layout_get_next_erun(layout, NULL); inrun = layout_get_next_inline_run(layout, NULL); + skiptransform = should_skip_transform(&layout->transform, &det); + for (line = 0; line < layout->metrics.lineCount; line++) { FLOAT width = layout_get_line_width(layout, erun, inrun, line); - FLOAT shift = (layout->metrics.layoutWidth - width) / 2.0; + FLOAT shift = layout_get_centered_shift(layout, skiptransform, width, det); if (is_rtl) shift *= -1.0; @@ -1348,7 +1423,7 @@ layout->clustermetrics[i].isNewline || /* always wrap on new line */ i == layout->cluster_count - 1) /* end of the text */ { - UINT32 strlength, last_cluster = i, index; + UINT32 strlength, last_cluster, index; FLOAT descent, trailingspacewidth; if (!overflow) { @@ -2197,7 +2272,6 @@ static HRESULT WINAPI dwritetextlayout_SetWordWrapping(IDWriteTextLayout2 *iface, DWRITE_WORD_WRAPPING wrapping) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)->(%d)\n", This, wrapping); return IDWriteTextFormat1_SetWordWrapping(&This->IDWriteTextFormat1_iface, wrapping); } @@ -2246,35 +2320,30 @@ static DWRITE_PARAGRAPH_ALIGNMENT WINAPI dwritetextlayout_GetParagraphAlignment(IDWriteTextLayout2 *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)\n", This); return IDWriteTextFormat1_GetParagraphAlignment(&This->IDWriteTextFormat1_iface); } static DWRITE_WORD_WRAPPING WINAPI dwritetextlayout_GetWordWrapping(IDWriteTextLayout2 *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)\n", This); return IDWriteTextFormat1_GetWordWrapping(&This->IDWriteTextFormat1_iface); } static DWRITE_READING_DIRECTION WINAPI dwritetextlayout_GetReadingDirection(IDWriteTextLayout2 *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)\n", This); return IDWriteTextFormat1_GetReadingDirection(&This->IDWriteTextFormat1_iface); } static DWRITE_FLOW_DIRECTION WINAPI dwritetextlayout_GetFlowDirection(IDWriteTextLayout2 *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)\n", This); return IDWriteTextFormat1_GetFlowDirection(&This->IDWriteTextFormat1_iface); } static FLOAT WINAPI dwritetextlayout_GetIncrementalTabStop(IDWriteTextLayout2 *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)\n", This); return IDWriteTextFormat1_GetIncrementalTabStop(&This->IDWriteTextFormat1_iface); } @@ -2282,7 +2351,6 @@ IDWriteInlineObject **trimming_sign) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)->(%p %p)\n", This, options, trimming_sign); return IDWriteTextFormat1_GetTrimming(&This->IDWriteTextFormat1_iface, options, trimming_sign); } @@ -2290,70 +2358,60 @@ FLOAT *spacing, FLOAT *baseline) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)->(%p %p %p)\n", This, method, spacing, baseline); return IDWriteTextFormat1_GetLineSpacing(&This->IDWriteTextFormat1_iface, method, spacing, baseline); } static HRESULT WINAPI dwritetextlayout_GetFontCollection(IDWriteTextLayout2 *iface, IDWriteFontCollection **collection) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)->(%p)\n", This, collection); return IDWriteTextFormat1_GetFontCollection(&This->IDWriteTextFormat1_iface, collection); } static UINT32 WINAPI dwritetextlayout_GetFontFamilyNameLength(IDWriteTextLayout2 *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)\n", This); return IDWriteTextFormat1_GetFontFamilyNameLength(&This->IDWriteTextFormat1_iface); } static HRESULT WINAPI dwritetextlayout_GetFontFamilyName(IDWriteTextLayout2 *iface, WCHAR *name, UINT32 size) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)->(%p %u)\n", This, name, size); return IDWriteTextFormat1_GetFontFamilyName(&This->IDWriteTextFormat1_iface, name, size); } static DWRITE_FONT_WEIGHT WINAPI dwritetextlayout_GetFontWeight(IDWriteTextLayout2 *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)\n", This); return IDWriteTextFormat1_GetFontWeight(&This->IDWriteTextFormat1_iface); } static DWRITE_FONT_STYLE WINAPI dwritetextlayout_GetFontStyle(IDWriteTextLayout2 *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)\n", This); return IDWriteTextFormat1_GetFontStyle(&This->IDWriteTextFormat1_iface); } static DWRITE_FONT_STRETCH WINAPI dwritetextlayout_GetFontStretch(IDWriteTextLayout2 *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)\n", This); return IDWriteTextFormat1_GetFontStretch(&This->IDWriteTextFormat1_iface); } static FLOAT WINAPI dwritetextlayout_GetFontSize(IDWriteTextLayout2 *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)\n", This); return IDWriteTextFormat1_GetFontSize(&This->IDWriteTextFormat1_iface); } static UINT32 WINAPI dwritetextlayout_GetLocaleNameLength(IDWriteTextLayout2 *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)\n", This); return IDWriteTextFormat1_GetLocaleNameLength(&This->IDWriteTextFormat1_iface); } static HRESULT WINAPI dwritetextlayout_GetLocaleName(IDWriteTextLayout2 *iface, WCHAR *name, UINT32 size) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); - TRACE("(%p)->(%p %u)\n", This, name, size); return IDWriteTextFormat1_GetLocaleName(&This->IDWriteTextFormat1_iface, name, size); } @@ -2732,13 +2790,43 @@ return get_string_attribute_value(This, LAYOUT_RANGE_ATTR_LOCALE, position, locale, length, r); } +static inline FLOAT renderer_apply_snapping(FLOAT coord, BOOL skiptransform, FLOAT ppdip, FLOAT det, + const DWRITE_MATRIX *m) +{ + FLOAT vec[2], vec2[2]; + + if (!skiptransform) { + /* apply transform */ + vec[0] = 0.0; + vec[1] = coord * ppdip; + + vec2[0] = m->m11 * vec[0] + m->m21 * vec[1] + m->dx; + vec2[1] = m->m12 * vec[0] + m->m22 * vec[1] + m->dy; + + /* snap */ + vec2[0] = floorf(vec2[0] + 0.5f); + vec2[1] = floorf(vec2[1] + 0.5f); + + /* apply inverted transform, we don't care about X component at this point */ + vec[1] = (-m->m12 * vec2[0] + m->m11 * vec2[1] - (m->m11 * m->dy - m->m12 * m->dx)) / det; + vec[1] /= ppdip; + } + else + vec[1] = floorf(coord * ppdip + 0.5f) / ppdip; + + return vec[1]; +} + static HRESULT WINAPI dwritetextlayout_Draw(IDWriteTextLayout2 *iface, void *context, IDWriteTextRenderer* renderer, FLOAT origin_x, FLOAT origin_y) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout2(iface); + BOOL disabled = FALSE, skiptransform = FALSE; struct layout_effective_inline *inlineobject; struct layout_effective_run *run; struct layout_strikethrough *s; + FLOAT det = 0.0, ppdip = 0.0; + DWRITE_MATRIX m = { 0 }; HRESULT hr; TRACE("(%p)->(%p %p %.2f %.2f)\n", This, context, renderer, origin_x, origin_y); @@ -2747,6 +2835,29 @@ if (FAILED(hr)) return hr; + hr = IDWriteTextRenderer_IsPixelSnappingDisabled(renderer, context, &disabled); + if (FAILED(hr)) + return hr; + + if (!disabled) { + hr = IDWriteTextRenderer_GetPixelsPerDip(renderer, context, &ppdip); + if (FAILED(hr)) + return hr; + + hr = IDWriteTextRenderer_GetCurrentTransform(renderer, context, &m); + if (FAILED(hr)) + return hr; + + /* it's only allowed to have a diagonal/antidiagonal transform matrix */ + if (ppdip <= 0.0 || + (m.m11 * m.m22 != 0.0 && (m.m12 != 0.0 || m.m21 != 0.0)) || + (m.m12 * m.m21 != 0.0 && (m.m11 != 0.0 || m.m22 != 0.0))) + disabled = TRUE; + else + skiptransform = should_skip_transform(&m, &det); + } + +#define SNAP_COORD(x) renderer_apply_snapping((x), skiptransform, ppdip, det, &m) /* 1. Regular runs */ LIST_FOR_EACH_ENTRY(run, &This->eruns, struct layout_effective_run, entry) { const struct regular_layout_run *regular = &run->run->u.regular; @@ -2776,8 +2887,8 @@ IDWriteTextRenderer_DrawGlyphRun(renderer, context, run->origin_x + run->align_dx + origin_x, - run->origin_y + origin_y, - DWRITE_MEASURING_MODE_NATURAL, + disabled ? run->origin_y + origin_y : SNAP_COORD(run->origin_y + origin_y), + This->measuringmode, &glyph_run, &descr, NULL); @@ -2788,7 +2899,7 @@ IDWriteTextRenderer_DrawInlineObject(renderer, context, inlineobject->origin_x + inlineobject->align_dx + origin_x, - inlineobject->origin_y + origin_y, + disabled ? inlineobject->origin_y + origin_y : SNAP_COORD(inlineobject->origin_y + origin_y), inlineobject->object, inlineobject->is_sideways, inlineobject->is_rtl, @@ -2802,10 +2913,11 @@ IDWriteTextRenderer_DrawStrikethrough(renderer, context, s->run->origin_x, - s->run->origin_y, + disabled ? s->run->origin_y : SNAP_COORD(s->run->origin_y), &s->s, NULL); } +#undef SNAP_COORD return S_OK; } @@ -3236,8 +3348,19 @@ static HRESULT WINAPI dwritetextformat1_layout_SetWordWrapping(IDWriteTextFormat1 *iface, DWRITE_WORD_WRAPPING wrapping) { struct dwrite_textlayout *This = impl_layout_form_IDWriteTextFormat1(iface); - FIXME("(%p)->(%d): stub\n", This, wrapping); - return E_NOTIMPL; + BOOL changed; + HRESULT hr; + + TRACE("(%p)->(%d)\n", This, wrapping); + + hr = format_set_wordwrapping(&This->format, wrapping, &changed); + if (FAILED(hr)) + return hr; + + if (changed) + This->recompute |= RECOMPUTE_EFFECTIVE_RUNS; + + return S_OK; } static HRESULT WINAPI dwritetextformat1_layout_SetReadingDirection(IDWriteTextFormat1 *iface, DWRITE_READING_DIRECTION direction) @@ -3305,7 +3428,7 @@ static DWRITE_WORD_WRAPPING WINAPI dwritetextformat1_layout_GetWordWrapping(IDWriteTextFormat1 *iface) { struct dwrite_textlayout *This = impl_layout_form_IDWriteTextFormat1(iface); - FIXME("(%p): stub\n", This); + TRACE("(%p)\n", This); return This->format.wrapping; } @@ -3829,10 +3952,9 @@ memset(&layout->metrics, 0, sizeof(layout->metrics)); layout->metrics.layoutWidth = maxwidth; layout->metrics.layoutHeight = maxheight; + layout->measuringmode = DWRITE_MEASURING_MODE_NATURAL; - layout->gdicompatible = FALSE; - layout->pixels_per_dip = 0.0; - layout->use_gdi_natural = FALSE; + layout->ppdip = 0.0; memset(&layout->transform, 0, sizeof(layout->transform)); layout->str = heap_strdupnW(str, len); @@ -3887,7 +4009,7 @@ } HRESULT create_gdicompat_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *format, FLOAT maxwidth, FLOAT maxheight, - FLOAT pixels_per_dip, const DWRITE_MATRIX *transform, BOOL use_gdi_natural, IDWriteTextLayout **ret) + FLOAT ppdip, const DWRITE_MATRIX *transform, BOOL use_gdi_natural, IDWriteTextLayout **ret) { struct dwrite_textlayout *layout; HRESULT hr; @@ -3899,10 +4021,10 @@ hr = init_textlayout(str, len, format, maxwidth, maxheight, layout); if (hr == S_OK) { + layout->measuringmode = use_gdi_natural ? DWRITE_MEASURING_MODE_GDI_NATURAL : DWRITE_MEASURING_MODE_GDI_CLASSIC; + /* set gdi-specific properties */ - layout->gdicompatible = TRUE; - layout->pixels_per_dip = pixels_per_dip; - layout->use_gdi_natural = use_gdi_natural; + layout->ppdip = ppdip; layout->transform = transform ? *transform : identity; *ret = (IDWriteTextLayout*)&layout->IDWriteTextLayout2_iface; @@ -3962,11 +4084,24 @@ return IDWriteTextLayout_Draw(This->layout, context, renderer, originX, originY); } -static HRESULT WINAPI dwritetrimmingsign_GetMetrics(IDWriteInlineObject *iface, DWRITE_INLINE_OBJECT_METRICS *metrics) +static HRESULT WINAPI dwritetrimmingsign_GetMetrics(IDWriteInlineObject *iface, DWRITE_INLINE_OBJECT_METRICS *ret) { struct dwrite_trimmingsign *This = impl_from_IDWriteInlineObject(iface); - FIXME("(%p)->(%p): stub\n", This, metrics); - memset(metrics, 0, sizeof(*metrics)); + DWRITE_TEXT_METRICS metrics; + HRESULT hr; + + TRACE("(%p)->(%p)\n", This, ret); + + hr = IDWriteTextLayout_GetMetrics(This->layout, &metrics); + if (FAILED(hr)) { + memset(ret, 0, sizeof(*ret)); + return hr; + } + + ret->width = metrics.width; + ret->height = 0.0; + ret->baseline = 0.0; + ret->supportsSideways = FALSE; return S_OK; } @@ -4121,14 +4256,8 @@ static HRESULT WINAPI dwritetextformat_SetWordWrapping(IDWriteTextFormat1 *iface, DWRITE_WORD_WRAPPING wrapping) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat1(iface); - TRACE("(%p)->(%d)\n", This, wrapping); - - if ((UINT32)wrapping > DWRITE_WORD_WRAPPING_CHARACTER) - return E_INVALIDARG; - - This->format.wrapping = wrapping; - return S_OK; + return format_set_wordwrapping(&This->format, wrapping, NULL); } static HRESULT WINAPI dwritetextformat_SetReadingDirection(IDWriteTextFormat1 *iface, DWRITE_READING_DIRECTION direction) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/opentype.c wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/opentype.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/opentype.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/opentype.c 2015-07-29 19:28:54.000000000 +0000 @@ -21,6 +21,7 @@ #define COBJMACROS #include "dwrite_private.h" +#include "winternl.h" WINE_DEFAULT_DEBUG_CHANNEL(dwrite); @@ -37,8 +38,8 @@ #define GET_BE_WORD(x) (x) #define GET_BE_DWORD(x) (x) #else -#define GET_BE_WORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x)) -#define GET_BE_DWORD(x) MAKELONG(GET_BE_WORD(HIWORD(x)), GET_BE_WORD(LOWORD(x))) +#define GET_BE_WORD(x) RtlUshortByteSwap(x) +#define GET_BE_DWORD(x) RtlUlongByteSwap(x) #endif typedef struct { @@ -1347,7 +1348,7 @@ BOOL opentype_get_vdmx_size(const void *data, INT emsize, UINT16 *ascent, UINT16 *descent) { const struct VDMX_Header *hdr = (const struct VDMX_Header*)data; - const struct VDMX_group *group = find_vdmx_group(hdr); + const struct VDMX_group *group; const struct VDMX_vTable *tables; WORD recs, i; @@ -1377,3 +1378,28 @@ } return FALSE; } + +WORD opentype_get_gasp_flags(const WORD *ptr, UINT32 size, INT emsize) +{ + WORD num_recs, version; + WORD flags = 0; + + if (!ptr) + return 0; + + version = GET_BE_WORD( *ptr++ ); + num_recs = GET_BE_WORD( *ptr++ ); + if (version > 1 || size < (num_recs * 2 + 2) * sizeof(WORD)) { + ERR("unsupported gasp table: ver %d size %d recs %d\n", version, size, num_recs); + goto done; + } + + while (num_recs--) { + flags = GET_BE_WORD( *(ptr + 1) ); + if (emsize <= GET_BE_WORD( *ptr )) break; + ptr += 2; + } + +done: + return flags; +} diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/tests/analyzer.c wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/tests/analyzer.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/tests/analyzer.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/tests/analyzer.c 2015-07-29 19:28:54.000000000 +0000 @@ -22,6 +22,8 @@ #include #include +#include +#include #include "initguid.h" #include "windows.h" @@ -1878,6 +1880,93 @@ IDWriteTextAnalyzer1_Release(analyzer1); } +static inline BOOL float_eq(FLOAT left, FLOAT right) +{ + int x = *(int *)&left; + int y = *(int *)&right; + + if (x < 0) + x = INT_MIN - x; + if (y < 0) + y = INT_MIN - y; + + return abs(x - y) <= 8; +} + +static void test_GetGdiCompatibleGlyphPlacements(void) +{ + static const WCHAR strW[] = {'A',0}; + DWRITE_SHAPING_GLYPH_PROPERTIES glyphprops[1]; + DWRITE_SHAPING_TEXT_PROPERTIES textprops[1]; + DWRITE_SCRIPT_ANALYSIS sa = { 0 }; + IDWriteTextAnalyzer *analyzer; + IDWriteFontFace *fontface; + UINT16 clustermap[1]; + HRESULT hr; + UINT32 count; + UINT16 glyphs[1]; + FLOAT advance; + DWRITE_GLYPH_OFFSET offsets[1]; + DWRITE_FONT_METRICS fontmetrics; + FLOAT emsize; + + hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + fontface = create_fontface(); + + IDWriteFontFace_GetMetrics(fontface, &fontmetrics); + + count = 0; + hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, strW, 1, fontface, + FALSE, FALSE, &sa, NULL, NULL, NULL, NULL, 0, 1, clustermap, + textprops, glyphs, glyphprops, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 1, "got %u\n", count); + + for (emsize = 12.0; emsize <= 20.0; emsize += 1.0) { + FLOAT compatadvance, expected, ppdip; + DWRITE_GLYPH_METRICS metrics; + + hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, strW, clustermap, + textprops, 1, glyphs, glyphprops, count, fontface, emsize, FALSE, FALSE, + &sa, NULL, NULL, NULL, 0, &advance, offsets); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(advance > 0.0, "got %f\n", advance); + + /* 1 ppdip, no transform */ + ppdip = 1.0; + hr = IDWriteFontFace_GetGdiCompatibleGlyphMetrics(fontface, emsize, ppdip, NULL, FALSE, + glyphs, 1, &metrics, FALSE); + ok(hr == S_OK, "got 0x%08x\n", hr); + + expected = floorf(metrics.advanceWidth * emsize * ppdip / fontmetrics.designUnitsPerEm + 0.5f) / ppdip; + hr = IDWriteTextAnalyzer_GetGdiCompatibleGlyphPlacements(analyzer, strW, + clustermap, textprops, 1, glyphs, glyphprops, count, fontface, emsize, + ppdip, NULL, FALSE, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, &compatadvance, offsets); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(compatadvance == expected, "%.0f: got advance %f, expected %f, natural %f\n", emsize, + compatadvance, expected, advance); + + /* 1.2 ppdip, no transform */ + ppdip = 1.2; + hr = IDWriteFontFace_GetGdiCompatibleGlyphMetrics(fontface, emsize, ppdip, NULL, FALSE, + glyphs, 1, &metrics, FALSE); + ok(hr == S_OK, "got 0x%08x\n", hr); + + expected = floorf(metrics.advanceWidth * emsize * ppdip / fontmetrics.designUnitsPerEm + 0.5f) / ppdip; + hr = IDWriteTextAnalyzer_GetGdiCompatibleGlyphPlacements(analyzer, strW, + clustermap, textprops, 1, glyphs, glyphprops, count, fontface, emsize, + ppdip, NULL, FALSE, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, &compatadvance, offsets); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(float_eq(compatadvance, expected), "%.0f: got advance %f, expected %f, natural %f\n", emsize, + compatadvance, expected, advance); + } + + IDWriteFontFace_Release(fontface); + IDWriteTextAnalyzer_Release(analyzer); +} + START_TEST(analyzer) { HRESULT hr; @@ -1904,6 +1993,7 @@ test_ApplyCharacterSpacing(); test_GetGlyphOrientationTransform(); test_GetBaseline(); + test_GetGdiCompatibleGlyphPlacements(); IDWriteFactory_Release(factory); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/tests/font.c wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/tests/font.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/tests/font.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/tests/font.c 2015-07-29 19:28:54.000000000 +0000 @@ -37,6 +37,7 @@ #define MS_CMAP_TAG MS_MAKE_TAG('c','m','a','p') #define MS_VDMX_TAG MS_MAKE_TAG('V','D','M','X') +#define MS_GASP_TAG MS_MAKE_TAG('g','a','s','p') #define EXPECT_HR(hr,hr_exp) \ ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp) @@ -849,18 +850,36 @@ hr = IDWriteBitmapRenderTarget_Resize(target, 5, 5); ok(hr == S_OK, "got 0x%08x\n", hr); + size.cx = size.cy = -1; + hr = IDWriteBitmapRenderTarget_GetSize(target, &size); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(size.cx == 5, "got %d\n", size.cx); + ok(size.cy == 5, "got %d\n", size.cy); + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); hr = IDWriteBitmapRenderTarget_Resize(target, 20, 5); ok(hr == S_OK, "got 0x%08x\n", hr); + size.cx = size.cy = -1; + hr = IDWriteBitmapRenderTarget_GetSize(target, &size); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(size.cx == 20, "got %d\n", size.cx); + ok(size.cy == 5, "got %d\n", size.cy); + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); hr = IDWriteBitmapRenderTarget_Resize(target, 1, 5); ok(hr == S_OK, "got 0x%08x\n", hr); + size.cx = size.cy = -1; + hr = IDWriteBitmapRenderTarget_GetSize(target, &size); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(size.cx == 1, "got %d\n", size.cx); + ok(size.cy == 5, "got %d\n", size.cy); + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); @@ -876,6 +895,12 @@ hr = IDWriteBitmapRenderTarget_Resize(target, 0, 5); ok(hr == S_OK, "got 0x%08x\n", hr); + size.cx = size.cy = -1; + hr = IDWriteBitmapRenderTarget_GetSize(target, &size); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(size.cx == 0, "got %d\n", size.cx); + ok(size.cy == 5, "got %d\n", size.cy); + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); @@ -3344,6 +3369,7 @@ IDWriteRenderingParams2 *params2; IDWriteRenderingParams1 *params1; IDWriteRenderingParams *params; + DWRITE_RENDERING_MODE mode; IDWriteFactory *factory; HRESULT hr; @@ -3379,33 +3405,63 @@ win_skip("IDWriteRenderingParams1 not supported.\n"); IDWriteRenderingParams_Release(params); + + hr = IDWriteFactory_CreateRenderingParams(factory, ¶ms); + ok(hr == S_OK, "got 0x%08x\n", hr); + + mode = IDWriteRenderingParams_GetRenderingMode(params); + ok(mode == DWRITE_RENDERING_MODE_DEFAULT, "got %d\n", mode); + IDWriteRenderingParams_Release(params); + IDWriteFactory_Release(factory); } static void test_CreateGlyphRunAnalysis(void) { + static const DWRITE_RENDERING_MODE rendermodes[] = { + DWRITE_RENDERING_MODE_ALIASED, + DWRITE_RENDERING_MODE_GDI_CLASSIC, + DWRITE_RENDERING_MODE_GDI_NATURAL, + DWRITE_RENDERING_MODE_NATURAL, + DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, + }; + IDWriteGlyphRunAnalysis *analysis; IDWriteFactory *factory; DWRITE_GLYPH_RUN run; IDWriteFontFace *face; - UINT16 index; + UINT16 glyph; FLOAT advance; HRESULT hr; UINT32 ch; + RECT rect; + DWRITE_GLYPH_OFFSET offset; + DWRITE_GLYPH_METRICS metrics; + DWRITE_FONT_METRICS fm; + int i; factory = create_factory(); face = create_fontface(factory); ch = 'A'; - hr = IDWriteFontFace_GetGlyphIndices(face, &ch, 1, &index); + glyph = 0; + hr = IDWriteFontFace_GetGlyphIndices(face, &ch, 1, &glyph); ok(hr == S_OK, "got 0x%08x\n", hr); + ok(glyph > 0, "got %u\n", glyph); + + hr = IDWriteFontFace_GetDesignGlyphMetrics(face, &glyph, 1, &metrics, FALSE); + ok(hr == S_OK, "got 0x%08x\n", hr); + advance = metrics.advanceWidth; + + offset.advanceOffset = 0.0; + offset.ascenderOffset = 0.0; run.fontFace = face; run.fontEmSize = 24.0; run.glyphCount = 1; - run.glyphIndices = &index; + run.glyphIndices = &glyph; run.glyphAdvances = &advance; - run.glyphOffsets = NULL; + run.glyphOffsets = &offset; run.isSideways = FALSE; run.bidiLevel = 0; @@ -3422,11 +3478,90 @@ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, - DWRITE_RENDERING_MODE_GDI_CLASSIC, DWRITE_MEASURING_MODE_NATURAL, + DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); ok(hr == S_OK, "got 0x%08x\n", hr); + + /* invalid texture type */ + memset(&rect, 0xcc, sizeof(rect)); + hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1+1, &rect); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(rect.left == 0 && rect.right == 0 && + rect.top == 0 && rect.bottom == 0, "unexpected rect\n"); IDWriteGlyphRunAnalysis_Release(analysis); + for (i = 0; i < sizeof(rendermodes)/sizeof(rendermodes[0]); i++) { + hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, + rendermodes[i], DWRITE_MEASURING_MODE_NATURAL, + 0.0, 0.0, &analysis); + ok(hr == S_OK, "got 0x%08x\n", hr); + + if (rendermodes[i] == DWRITE_RENDERING_MODE_ALIASED) { + memset(&rect, 0, sizeof(rect)); + hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); + todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!IsRectEmpty(&rect), "got empty rect\n"); + } + rect.left = rect.top = 0; + rect.bottom = rect.right = 1; + hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(IsRectEmpty(&rect), "unexpected empty rect\n"); + } + else { + rect.left = rect.top = 0; + rect.bottom = rect.right = 1; + hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(IsRectEmpty(&rect), "got empty rect\n"); + + memset(&rect, 0, sizeof(rect)); + hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect); + todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!IsRectEmpty(&rect), "got empty rect\n"); + } + } + + IDWriteGlyphRunAnalysis_Release(analysis); + } + + IDWriteFontFace_GetMetrics(run.fontFace, &fm); + + /* check bbox for a single glyph run */ + for (run.fontEmSize = 1.0; run.fontEmSize <= 100.0; run.fontEmSize += 1.0) { + DWRITE_GLYPH_METRICS gm; + LONG bboxX, bboxY; + + hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, + DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC, + 0.0, 0.0, &analysis); + ok(hr == S_OK, "got 0x%08x\n", hr); + + memset(&rect, 0, sizeof(rect)); + hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); + todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + if (hr != S_OK) + break; + + hr = IDWriteFontFace_GetGdiCompatibleGlyphMetrics(run.fontFace, run.fontEmSize, 1.0, NULL, + DWRITE_MEASURING_MODE_GDI_CLASSIC, run.glyphIndices, 1, &gm, run.isSideways); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* metrics are in design units */ + bboxX = (int)floorf((gm.advanceWidth - gm.leftSideBearing - gm.rightSideBearing) * run.fontEmSize / fm.designUnitsPerEm + 0.5f); + bboxY = (int)floorf((gm.advanceHeight - gm.topSideBearing - gm.bottomSideBearing) * run.fontEmSize / fm.designUnitsPerEm + 0.5f); + + rect.right -= rect.left; + rect.bottom -= rect.top; + ok(abs(bboxX - rect.right) <= 1, "%.0f: bbox width %d, from metrics %d\n", run.fontEmSize, rect.right, bboxX); + ok(abs(bboxY - rect.bottom) <= 1, "%.0f: bbox height %d, from metrics %d\n", run.fontEmSize, rect.bottom, bboxY); + + IDWriteGlyphRunAnalysis_Release(analysis); + } + IDWriteFontFace_Release(face); IDWriteFactory_Release(factory); } @@ -3602,6 +3737,33 @@ emsize, metrics->hasTypographicMetrics, expected->hasTypographicMetrics); } +struct compatmetrics_test { + DWRITE_MATRIX m; + FLOAT ppdip; + FLOAT emsize; +}; + +static struct compatmetrics_test compatmetrics_tests[] = { + { { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, 1.0, 5.0 }, + { { 0.0, 0.0, 0.0, -1.0, 0.0, 0.0 }, 1.0, 5.0 }, + { { 0.0, 0.0, 0.0, -1.0, 0.0, 0.0 }, 2.0, 5.0 }, + { { 0.0, 0.0, 0.0, 3.0, 0.0, 0.0 }, 2.0, 5.0 }, + { { 0.0, 0.0, 0.0, -3.0, 0.0, 0.0 }, 2.0, 5.0 }, + { { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, 2.0, 5.0 }, + { { 1.0, 0.0, 0.0, 1.0, 5.0, 0.0 }, 2.0, 5.0 }, + { { 1.0, 0.0, 0.0, 1.0, 0.0, 5.0 }, 2.0, 5.0 }, +}; + +static void get_expected_metrics(IDWriteFontFace *fontface, struct compatmetrics_test *ptr, + DWRITE_FONT_METRICS *expected) +{ + HRESULT hr; + + memset(expected, 0, sizeof(*expected)); + hr = IDWriteFontFace_GetGdiCompatibleMetrics(fontface, ptr->ppdip * fabsf(ptr->m.m22) * ptr->emsize, 1.0, NULL, expected); + ok(hr == S_OK, "got %08x\n", hr); +} + static void test_GetGdiCompatibleMetrics_face(IDWriteFontFace *face) { IDWriteFontFace1 *fontface1 = NULL; @@ -3615,7 +3777,7 @@ void *vdmx_ctx; BOOL exists; const struct VDMX_group *vdmx_group = NULL; - DWRITE_MATRIX m; + int i; hr = IDWriteFontFace_QueryInterface(face, &IID_IDWriteFontFace1, (void**)&fontface1); if (hr != S_OK) @@ -3635,6 +3797,20 @@ else vdmx_group = find_vdmx_group(vdmx); + /* negative emsize */ + memset(&comp_metrics, 0xcc, sizeof(comp_metrics)); + memset(&expected, 0, sizeof(expected)); + hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, -10.0, 1.0, NULL, &comp_metrics); + ok(hr == E_INVALIDARG, "got %08x\n", hr); + test_metrics_cmp(0.0, &comp_metrics, &expected); + + /* zero emsize */ + memset(&comp_metrics, 0xcc, sizeof(comp_metrics)); + memset(&expected, 0, sizeof(expected)); + hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 0.0, 1.0, NULL, &comp_metrics); + ok(hr == E_INVALIDARG, "got %08x\n", hr); + test_metrics_cmp(0.0, &comp_metrics, &expected); + /* zero pixels per dip */ memset(&comp_metrics, 0xcc, sizeof(comp_metrics)); memset(&expected, 0, sizeof(expected)); @@ -3647,39 +3823,14 @@ ok(hr == E_INVALIDARG, "got %08x\n", hr); test_metrics_cmp(5.0, &comp_metrics, &expected); - memset(&m, 0, sizeof(m)); - /* zero matrix m22 */ - m.m22 = 1.0; - hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 5.0, 1.0, NULL, (DWRITE_FONT_METRICS*)&expected); - ok(hr == S_OK, "got %08x\n", hr); - hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 5.0, 1.0, &m, &comp_metrics); - ok(hr == S_OK, "got %08x\n", hr); - test_metrics_cmp(5.0, &comp_metrics, &expected); - - m.m22 = -1.0; - hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 5.0, 1.0, &m, &comp_metrics); - ok(hr == S_OK, "got %08x\n", hr); - test_metrics_cmp(5.0, &comp_metrics, &expected); - - /* pixels per dip == 2 */ - hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 10.0, 1.0, NULL, (DWRITE_FONT_METRICS*)&expected); - ok(hr == S_OK, "got %08x\n", hr); - hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 5.0, 2.0, NULL, &comp_metrics); - ok(hr == S_OK, "got %08x\n", hr); - test_metrics_cmp(5.0, &comp_metrics, &expected); - - /* pixels per dip == 2, m22 == 3.0 */ - hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 30.0, 1.0, NULL, (DWRITE_FONT_METRICS*)&expected); - ok(hr == S_OK, "got %08x\n", hr); + for (i = 0; i < sizeof(compatmetrics_tests)/sizeof(compatmetrics_tests[0]); i++) { + struct compatmetrics_test *ptr = &compatmetrics_tests[i]; - m.m22 = 3.0; - hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 5.0, 2.0, &m, &comp_metrics); - ok(hr == S_OK, "got %08x\n", hr); - test_metrics_cmp(5.0, &comp_metrics, &expected); - m.m22 = -3.0; - hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 5.0, 2.0, &m, &comp_metrics); - ok(hr == S_OK, "got %08x\n", hr); - test_metrics_cmp(5.0, &comp_metrics, &expected); + get_expected_metrics(face, ptr, (DWRITE_FONT_METRICS*)&expected); + hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, ptr->emsize, ptr->ppdip, &ptr->m, &comp_metrics); + ok(hr == S_OK, "got %08x\n", hr); + test_metrics_cmp(ptr->emsize, &comp_metrics, &expected); + } for (emsize = 5; emsize <= design_metrics.designUnitsPerEm; emsize++) { @@ -3824,6 +3975,377 @@ IDWriteFactory_Release(factory); } +static INT32 get_gdi_font_advance(HDC hdc, FLOAT emsize) +{ + LOGFONTW logfont; + HFONT hfont; + BOOL ret; + ABC abc; + + memset(&logfont, 0, sizeof(logfont)); + logfont.lfHeight = (LONG)-emsize; + logfont.lfWeight = FW_NORMAL; + logfont.lfQuality = CLEARTYPE_QUALITY; + lstrcpyW(logfont.lfFaceName, tahomaW); + + hfont = CreateFontIndirectW(&logfont); + SelectObject(hdc, hfont); + + ret = GetCharABCWidthsW(hdc, 'A', 'A', &abc); + ok(ret, "got %d\n", ret); + + DeleteObject(hfont); + + return abc.abcA + abc.abcB + abc.abcC; +} + +static void test_GetGdiCompatibleGlyphAdvances(void) +{ + IDWriteFontFace1 *fontface1; + IDWriteFontFace *fontface; + IDWriteFactory *factory; + IDWriteFont *font; + HRESULT hr; + HDC hdc; + UINT32 codepoint; + UINT16 glyph; + FLOAT emsize; + DWRITE_FONT_METRICS1 fm; + INT32 advance; + + factory = create_factory(); + font = get_tahoma_instance(factory, DWRITE_FONT_STYLE_NORMAL); + + hr = IDWriteFont_CreateFontFace(font, &fontface); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteFont_Release(font); + + hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1); + IDWriteFontFace_Release(fontface); + + if (hr != S_OK) { + IDWriteFactory_Release(factory); + win_skip("GetGdiCompatibleGlyphAdvances() is not supported\n"); + return; + } + + codepoint = 'A'; + glyph = 0; + hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &codepoint, 1, &glyph); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(glyph > 0, "got %u\n", glyph); + + /* zero emsize */ + advance = 1; + hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, 0.0, + 1.0, NULL, FALSE, FALSE, 1, &glyph, &advance); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(advance == 0, "got %d\n", advance); + + /* negative emsize */ + advance = 1; + hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, -1.0, + 1.0, NULL, FALSE, FALSE, 1, &glyph, &advance); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(advance == 0, "got %d\n", advance); + + /* zero ppdip */ + advance = 1; + hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, 1.0, + 0.0, NULL, FALSE, FALSE, 1, &glyph, &advance); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(advance == 0, "got %d\n", advance); + + /* negative ppdip */ + advance = 1; + hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, 1.0, + -1.0, NULL, FALSE, FALSE, 1, &glyph, &advance); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(advance == 0, "got %d\n", advance); + + IDWriteFontFace1_GetMetrics(fontface1, &fm); + + hdc = CreateCompatibleDC(0); + + for (emsize = 1.0; emsize <= fm.designUnitsPerEm; emsize += 1.0) { + INT32 gdi_advance; + + gdi_advance = get_gdi_font_advance(hdc, emsize); + hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, emsize, + 1.0, NULL, FALSE, FALSE, 1, &glyph, &advance); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* advance is in design units */ + advance = (int)floorf(emsize * advance / fm.designUnitsPerEm + 0.5f); + + /* allow 1 pixel difference for large sizes, for Tahoma this happens for 16 sizes in [1, 2048] range */ + if (emsize > 150.0) + ok((advance - gdi_advance) <= 1, "%.0f: got advance %d, expected %d\n", emsize, advance, gdi_advance); + else + ok(gdi_advance == advance, "%.0f: got advance %d, expected %d\n", emsize, advance, gdi_advance); + } + + DeleteObject(hdc); + + IDWriteFactory_Release(factory); +} + +static WORD get_gasp_flags(IDWriteFontFace *fontface, FLOAT emsize) +{ + WORD num_recs, version; + const WORD *ptr; + WORD flags = 0; + UINT32 size; + BOOL exists; + void *ctxt; + HRESULT hr; + + exists = FALSE; + hr = IDWriteFontFace_TryGetFontTable(fontface, MS_GASP_TAG, + (const void**)&ptr, &size, &ctxt, &exists); + ok(hr == S_OK, "got 0x%08x\n", hr); + + if (!exists) + goto done; + + version = GET_BE_WORD( *ptr++ ); + num_recs = GET_BE_WORD( *ptr++ ); + if (version > 1 || size < (num_recs * 2 + 2) * sizeof(WORD)) { + ok(0, "unsupported gasp table: ver %d size %d recs %d\n", version, size, num_recs); + goto done; + } + + while (num_recs--) + { + flags = GET_BE_WORD( *(ptr + 1) ); + if (emsize <= GET_BE_WORD( *ptr )) break; + ptr += 2; + } + +done: + IDWriteFontFace_ReleaseFontTable(fontface, ctxt); + return flags; +} + +#define GASP_GRIDFIT 0x0001 +#define GASP_DOGRAY 0x0002 +#define GASP_SYMMETRIC_GRIDFIT 0x0004 +#define GASP_SYMMETRIC_SMOOTHING 0x0008 + +static BOOL g_is_vista; +static DWRITE_RENDERING_MODE get_expected_rendering_mode(FLOAT emsize, WORD gasp, DWRITE_MEASURING_MODE mode, + DWRITE_OUTLINE_THRESHOLD threshold) +{ + static const FLOAT aa_threshold = 100.0f; + static const FLOAT a_threshold = 350.0f; + static const FLOAT naturalemsize = 20.0f; + FLOAT v; + + /* outline threshold */ + if (g_is_vista) + v = mode == DWRITE_MEASURING_MODE_NATURAL ? aa_threshold : a_threshold; + else + v = threshold == DWRITE_OUTLINE_THRESHOLD_ANTIALIASED ? aa_threshold : a_threshold; + + if (emsize >= v) + return DWRITE_RENDERING_MODE_OUTLINE; + + switch (mode) + { + case DWRITE_MEASURING_MODE_NATURAL: + if (!(gasp & GASP_SYMMETRIC_SMOOTHING) && (emsize <= naturalemsize)) + return DWRITE_RENDERING_MODE_NATURAL; + else + return DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC; + case DWRITE_MEASURING_MODE_GDI_CLASSIC: + return DWRITE_RENDERING_MODE_GDI_CLASSIC; + case DWRITE_MEASURING_MODE_GDI_NATURAL: + return DWRITE_RENDERING_MODE_GDI_NATURAL; + default: + ; + } + + /* should be unreachable */ + return DWRITE_RENDERING_MODE_DEFAULT; +} + +static DWRITE_GRID_FIT_MODE get_expected_gridfit_mode(FLOAT emsize, WORD gasp, DWRITE_MEASURING_MODE mode, + DWRITE_OUTLINE_THRESHOLD threshold) +{ + static const FLOAT aa_threshold = 100.0f; + static const FLOAT a_threshold = 350.0f; + FLOAT v; + + v = threshold == DWRITE_OUTLINE_THRESHOLD_ANTIALIASED ? aa_threshold : a_threshold; + if (emsize >= v) + return DWRITE_GRID_FIT_MODE_DISABLED; + + if (mode == DWRITE_MEASURING_MODE_GDI_CLASSIC || mode == DWRITE_MEASURING_MODE_GDI_NATURAL) + return DWRITE_GRID_FIT_MODE_ENABLED; + + return (gasp & (GASP_GRIDFIT|GASP_SYMMETRIC_GRIDFIT)) ? DWRITE_GRID_FIT_MODE_ENABLED : DWRITE_GRID_FIT_MODE_DISABLED; +} + +struct recommendedmode_test +{ + DWRITE_MEASURING_MODE measuring; + DWRITE_OUTLINE_THRESHOLD threshold; +}; + +static const struct recommendedmode_test recmode_tests[] = { + { DWRITE_MEASURING_MODE_NATURAL, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED }, + { DWRITE_MEASURING_MODE_GDI_CLASSIC, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED }, + { DWRITE_MEASURING_MODE_GDI_NATURAL, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED }, +}; + +static const struct recommendedmode_test recmode_tests1[] = { + { DWRITE_MEASURING_MODE_NATURAL, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED }, + { DWRITE_MEASURING_MODE_GDI_CLASSIC, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED }, + { DWRITE_MEASURING_MODE_GDI_NATURAL, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED }, + { DWRITE_MEASURING_MODE_NATURAL, DWRITE_OUTLINE_THRESHOLD_ALIASED }, + { DWRITE_MEASURING_MODE_GDI_CLASSIC, DWRITE_OUTLINE_THRESHOLD_ALIASED }, + { DWRITE_MEASURING_MODE_GDI_NATURAL, DWRITE_OUTLINE_THRESHOLD_ALIASED }, +}; + +static void test_GetRecommendedRenderingMode(void) +{ + IDWriteRenderingParams *params; + IDWriteFontFace2 *fontface2; + IDWriteFontFace1 *fontface1; + IDWriteFontFace *fontface; + DWRITE_RENDERING_MODE mode; + IDWriteFactory *factory; + FLOAT emsize; + HRESULT hr; + + factory = create_factory(); + fontface = create_fontface(factory); + + fontface1 = NULL; + hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1); + if (hr != S_OK) + win_skip("IDWriteFontFace1::GetRecommendedRenderingMode() is not supported.\n"); + + fontface2 = NULL; + hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (void**)&fontface2); + if (hr != S_OK) + win_skip("IDWriteFontFace2::GetRecommendedRenderingMode() is not supported.\n"); + +if (0) /* crashes on native */ + hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, 3.0, 1.0, + DWRITE_MEASURING_MODE_GDI_CLASSIC, NULL, NULL); + + mode = 10; + hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, 3.0, 1.0, + DWRITE_MEASURING_MODE_GDI_CLASSIC, NULL, &mode); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(mode == DWRITE_RENDERING_MODE_DEFAULT, "got %d\n", mode); + + hr = IDWriteFactory_CreateRenderingParams(factory, ¶ms); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* detect old dwrite version, that is using higher threshold value */ + g_is_vista = fontface1 == NULL; + + for (emsize = 1.0; emsize < 500.0; emsize += 1.0) { + WORD gasp = get_gasp_flags(fontface, emsize); + DWRITE_RENDERING_MODE expected; + int i; + + for (i = 0; i < sizeof(recmode_tests)/sizeof(recmode_tests[0]); i++) { + mode = 10; + expected = get_expected_rendering_mode(emsize, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold); + hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, 1.0, recmode_tests[i].measuring, params, &mode); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == expected, "%.2f/%d: got %d, flags 0x%04x, expected %d\n", emsize, i, mode, gasp, expected); + } + + /* IDWriteFontFace1 offers another variant of this method */ + if (fontface1) { + for (i = 0; i < sizeof(recmode_tests1)/sizeof(recmode_tests1[0]); i++) { + mode = 10; + expected = get_expected_rendering_mode(emsize, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); + hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, 96.0, 96.0, + NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == expected, "%.2f/%d: got %d, flags 0x%04x, expected %d\n", emsize, i, mode, gasp, expected); + } + } + + /* IDWriteFontFace2 - another one */ + if (fontface2) { + DWRITE_GRID_FIT_MODE gridfit, expected_gridfit; + + for (i = 0; i < sizeof(recmode_tests1)/sizeof(recmode_tests1[0]); i++) { + mode = 10; + expected = get_expected_rendering_mode(emsize, gasp, recmode_tests1[0].measuring, recmode_tests1[0].threshold); + expected_gridfit = get_expected_gridfit_mode(emsize, gasp, recmode_tests1[0].measuring, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED); + hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, emsize, 96.0, 96.0, + NULL, FALSE, recmode_tests1[0].threshold, recmode_tests1[0].measuring, params, &mode, &gridfit); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == expected, "%.2f: got %d, flags 0x%04x, expected %d\n", emsize, mode, gasp, expected); + ok(gridfit == expected_gridfit, "%.2f/%d: gridfit: got %d, flags 0x%04x, expected %d\n", emsize, i, gridfit, + gasp, expected_gridfit); + } + } + } + + IDWriteRenderingParams_Release(params); + + /* test how parameters override returned modes */ + hr = IDWriteFactory_CreateCustomRenderingParams(factory, 1.0, 0.0, 0.0, DWRITE_PIXEL_GEOMETRY_FLAT, + DWRITE_RENDERING_MODE_GDI_CLASSIC, ¶ms); + ok(hr == S_OK, "got 0x%08x\n", hr); + + mode = 10; + hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, 500.0, 1.0, DWRITE_MEASURING_MODE_NATURAL, params, &mode); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == DWRITE_RENDERING_MODE_GDI_CLASSIC, "got %d\n", mode); + + IDWriteRenderingParams_Release(params); + + if (fontface2) { + IDWriteRenderingParams2 *params2; + IDWriteFactory2 *factory2; + DWRITE_GRID_FIT_MODE gridfit; + + hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory2, (void**)&factory2); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory2_CreateCustomRenderingParams(factory2, 1.0, 0.0, 0.0, 0.5, DWRITE_PIXEL_GEOMETRY_FLAT, + DWRITE_RENDERING_MODE_OUTLINE, DWRITE_GRID_FIT_MODE_ENABLED, ¶ms2); + ok(hr == S_OK, "got 0x%08x\n", hr); + + mode = 10; + gridfit = 10; + hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0, 96.0, 96.0, + NULL, FALSE, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC, + NULL, &mode, &gridfit); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == DWRITE_RENDERING_MODE_GDI_CLASSIC, "got %d\n", mode); + ok(gridfit == DWRITE_GRID_FIT_MODE_ENABLED, "got %d\n", gridfit); + + mode = 10; + gridfit = 10; + hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0, 96.0, 96.0, + NULL, FALSE, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC, + (IDWriteRenderingParams*)params2, &mode, &gridfit); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == DWRITE_RENDERING_MODE_OUTLINE, "got %d\n", mode); + ok(gridfit == DWRITE_GRID_FIT_MODE_ENABLED, "got %d\n", gridfit); + + IDWriteRenderingParams2_Release(params2); + IDWriteFactory2_Release(factory2); + } + + if (fontface2) + IDWriteFontFace2_Release(fontface2); + if (fontface1) + IDWriteFontFace1_Release(fontface1); + IDWriteFontFace_Release(fontface); + IDWriteFactory_Release(factory); +} + START_TEST(font) { IDWriteFactory *factory; @@ -3869,6 +4391,8 @@ test_CreateGlyphRunAnalysis(); test_GetGdiCompatibleMetrics(); test_GetPanose(); + test_GetGdiCompatibleGlyphAdvances(); + test_GetRecommendedRenderingMode(); IDWriteFactory_Release(factory); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/tests/layout.c wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/tests/layout.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/dwrite/tests/layout.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/dwrite/tests/layout.c 2015-07-29 19:28:54.000000000 +0000 @@ -21,6 +21,8 @@ #define COBJMACROS #include +#include +#include #include "windows.h" #include "dwrite.h" @@ -417,29 +419,59 @@ return 1; } +struct renderer_context { + BOOL gdicompat; + BOOL use_gdi_natural; + BOOL snapping_disabled; + DWRITE_MATRIX m; + FLOAT ppdip; + FLOAT originX; + FLOAT originY; +}; + static HRESULT WINAPI testrenderer_IsPixelSnappingDisabled(IDWriteTextRenderer *iface, - void *client_drawingcontext, BOOL *disabled) + void *context, BOOL *disabled) { - *disabled = TRUE; + struct renderer_context *ctxt = (struct renderer_context*)context; + if (ctxt) + *disabled = ctxt->snapping_disabled; + else + *disabled = TRUE; return S_OK; } static HRESULT WINAPI testrenderer_GetCurrentTransform(IDWriteTextRenderer *iface, - void *client_drawingcontext, DWRITE_MATRIX *transform) + void *context, DWRITE_MATRIX *m) { - ok(0, "unexpected call\n"); - return E_NOTIMPL; + struct renderer_context *ctxt = (struct renderer_context*)context; + ok(!ctxt->snapping_disabled, "expected enabled snapping\n"); + *m = ctxt->m; + return S_OK; } static HRESULT WINAPI testrenderer_GetPixelsPerDip(IDWriteTextRenderer *iface, - void *client_drawingcontext, FLOAT *pixels_per_dip) + void *context, FLOAT *pixels_per_dip) { - ok(0, "unexpected call\n"); - return E_NOTIMPL; + struct renderer_context *ctxt = (struct renderer_context*)context; + *pixels_per_dip = ctxt->ppdip; + return S_OK; +} + +#define TEST_MEASURING_MODE(ctxt, mode) test_measuring_mode(ctxt, mode, __LINE__) +static void test_measuring_mode(const struct renderer_context *ctxt, DWRITE_MEASURING_MODE mode, int line) +{ + if (ctxt->gdicompat) { + if (ctxt->use_gdi_natural) + ok_(__FILE__, line)(mode == DWRITE_MEASURING_MODE_GDI_NATURAL, "got %d\n", mode); + else + ok_(__FILE__, line)(mode == DWRITE_MEASURING_MODE_GDI_CLASSIC, "got %d\n", mode); + } + else + ok_(__FILE__, line)(mode == DWRITE_MEASURING_MODE_NATURAL, "got %d\n", mode); } static HRESULT WINAPI testrenderer_DrawGlyphRun(IDWriteTextRenderer *iface, - void* client_drawingcontext, + void *context, FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_MEASURING_MODE mode, @@ -447,9 +479,16 @@ DWRITE_GLYPH_RUN_DESCRIPTION const *descr, IUnknown *effect) { + struct renderer_context *ctxt = (struct renderer_context*)context; struct drawcall_entry entry; DWRITE_SCRIPT_ANALYSIS sa; + if (ctxt) { + TEST_MEASURING_MODE(ctxt, mode); + ctxt->originX = baselineOriginX; + ctxt->originY = baselineOriginY; + } + ok(descr->stringLength < sizeof(entry.string)/sizeof(WCHAR), "string is too long\n"); if (descr->stringLength && descr->stringLength < sizeof(entry.string)/sizeof(WCHAR)) { memcpy(entry.string, descr->string, descr->stringLength*sizeof(WCHAR)); @@ -480,13 +519,18 @@ } static HRESULT WINAPI testrenderer_DrawUnderline(IDWriteTextRenderer *iface, - void *client_drawingcontext, + void *context, FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_UNDERLINE const* underline, IUnknown *effect) { + struct renderer_context *ctxt = (struct renderer_context*)context; struct drawcall_entry entry; + + if (ctxt) + TEST_MEASURING_MODE(ctxt, underline->measuringMode); + entry.kind = DRAW_UNDERLINE; if (effect) entry.kind |= DRAW_EFFECT; @@ -495,13 +539,18 @@ } static HRESULT WINAPI testrenderer_DrawStrikethrough(IDWriteTextRenderer *iface, - void *client_drawingcontext, + void *context, FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_STRIKETHROUGH const* strikethrough, IUnknown *effect) { + struct renderer_context *ctxt = (struct renderer_context*)context; struct drawcall_entry entry; + + if (ctxt) + TEST_MEASURING_MODE(ctxt, strikethrough->measuringMode); + entry.kind = DRAW_STRIKETHROUGH; if (effect) entry.kind |= DRAW_EFFECT; @@ -510,7 +559,7 @@ } static HRESULT WINAPI testrenderer_DrawInlineObject(IDWriteTextRenderer *iface, - void *client_drawingcontext, + void *context, FLOAT originX, FLOAT originY, IDWriteInlineObject *object, @@ -736,6 +785,16 @@ IDWriteFactory_Release(factory); } +static DWRITE_MATRIX layoutcreate_transforms[] = { + { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, + { 1.0, 0.0, 0.0, 1.0, 0.3, 0.2 }, + { 1.0, 0.0, 0.0, 1.0,-0.3,-0.2 }, + + { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, + { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, + { 1.0, 2.0, 0.5, 1.0, 0.0, 0.0 }, +}; + static void test_CreateGdiCompatibleTextLayout(void) { static const WCHAR strW[] = {'s','t','r','i','n','g',0}; @@ -744,6 +803,7 @@ IDWriteFactory *factory; FLOAT dimension; HRESULT hr; + int i; factory = create_factory(); @@ -790,6 +850,24 @@ ok(dimension == 100.0, "got %f\n", dimension); IDWriteTextLayout_Release(layout); + + /* negative, zero ppdip */ + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 1, format, 100.0, 100.0, -1.0, NULL, FALSE, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteTextLayout_Release(layout); + + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 1, format, 100.0, 100.0, 0.0, NULL, FALSE, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteTextLayout_Release(layout); + + /* transforms */ + for (i = 0; i < sizeof(layoutcreate_transforms)/sizeof(layoutcreate_transforms[0]); i++) { + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 1, format, 100.0, 100.0, 1.0, + &layoutcreate_transforms[i], FALSE, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteTextLayout_Release(layout); + } + IDWriteTextFormat_Release(format); IDWriteFactory_Release(factory); } @@ -958,6 +1036,7 @@ static void test_CreateEllipsisTrimmingSign(void) { + DWRITE_INLINE_OBJECT_METRICS metrics; DWRITE_BREAK_CONDITION before, after; IDWriteTextFormat *format; IDWriteInlineObject *sign; @@ -979,8 +1058,21 @@ hr = IDWriteInlineObject_QueryInterface(sign, &IID_IDWriteTextLayout, (void**)&unk); ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); -if (0) /* crashes on native */ +if (0) {/* crashes on native */ hr = IDWriteInlineObject_GetBreakConditions(sign, NULL, NULL); + hr = IDWriteInlineObject_GetMetrics(sign, NULL); +} + metrics.width = 0.0; + metrics.height = 123.0; + metrics.baseline = 123.0; + metrics.supportsSideways = TRUE; + hr = IDWriteInlineObject_GetMetrics(sign, &metrics); + ok(hr == S_OK, "got 0x%08x\n", hr); +todo_wine + ok(metrics.width > 0.0, "got %.2f\n", metrics.width); + ok(metrics.height == 0.0, "got %.2f\n", metrics.height); + ok(metrics.baseline == 0.0, "got %.2f\n", metrics.baseline); + ok(!metrics.supportsSideways, "got %d\n", metrics.supportsSideways); before = after = DWRITE_BREAK_CONDITION_CAN_BREAK; hr = IDWriteInlineObject_GetBreakConditions(sign, &before, &after); @@ -1305,15 +1397,21 @@ static const WCHAR str2W[] = {0x202a,0x202c,'a','b',0}; static const WCHAR ruW[] = {'r','u',0}; IDWriteInlineObject *inlineobj; + struct renderer_context ctxt; IDWriteTextFormat *format; IDWriteTextLayout *layout; DWRITE_TEXT_RANGE range; IDWriteFactory *factory; + DWRITE_TEXT_METRICS tm; DWRITE_MATRIX m; HRESULT hr; factory = create_factory(); + ctxt.gdicompat = FALSE; + ctxt.use_gdi_natural = FALSE; + ctxt.snapping_disabled = TRUE; + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_BOLD, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0, ruW, &format); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -1345,7 +1443,7 @@ ok(hr == S_OK, "got 0x%08x\n", hr); flush_sequence(sequences, RENDERER_ID); - hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); ok(hr == S_OK, "got 0x%08x\n", hr); ok_sequence(sequences, RENDERER_ID, draw_seq, "draw test", TRUE); IDWriteTextLayout_Release(layout); @@ -1354,7 +1452,7 @@ hr = IDWriteFactory_CreateTextLayout(factory, strW, 6, format, 5.0, 100.0, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); flush_sequence(sequences, RENDERER_ID); - hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); ok(hr == S_OK, "got 0x%08x\n", hr); ok_sequence(sequences, RENDERER_ID, draw_seq2, "draw test 2", TRUE); IDWriteTextLayout_Release(layout); @@ -1363,7 +1461,7 @@ hr = IDWriteFactory_CreateTextLayout(factory, str2W, 4, format, 500.0, 100.0, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); flush_sequence(sequences, RENDERER_ID); - hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); ok(hr == S_OK, "got 0x%08x\n", hr); ok_sequence(sequences, RENDERER_ID, draw_seq3, "draw test 3", TRUE); IDWriteTextLayout_Release(layout); @@ -1379,7 +1477,7 @@ hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); ok(hr == S_OK, "got 0x%08x\n", hr); ok_sequence(sequences, RENDERER_ID, draw_seq4, "draw test 4", FALSE); IDWriteTextLayout_Release(layout); @@ -1394,7 +1492,7 @@ hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); ok(hr == S_OK, "got 0x%08x\n", hr); ok_sequence(sequences, RENDERER_ID, draw_seq5, "draw test 5", FALSE); IDWriteTextLayout_Release(layout); @@ -1404,48 +1502,79 @@ ok(hr == S_OK, "got 0x%08x\n", hr); flush_sequence(sequences, RENDERER_ID); - hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); ok(hr == S_OK, "got 0x%08x\n", hr); ok_sequence(sequences, RENDERER_ID, empty_seq, "draw test 6", FALSE); IDWriteTextLayout_Release(layout); + ctxt.gdicompat = TRUE; + ctxt.use_gdi_natural = TRUE; + /* different parameter combinations with gdi-compatible layout */ hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, format, 100.0, 100.0, 1.0, NULL, TRUE, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); flush_sequence(sequences, RENDERER_ID); - hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 7", FALSE); + + /* text alignment keeps pixel-aligned origin */ + hr = IDWriteTextLayout_GetMetrics(layout, &tm); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(tm.width == floorf(tm.width), "got %f\n", tm.width); + + hr = IDWriteTextLayout_SetMaxWidth(layout, tm.width + 3.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_CENTER); + ok(hr == S_OK, "got 0x%08x\n", hr); + + ctxt.originX = ctxt.originY = 0.0; + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); ok(hr == S_OK, "got 0x%08x\n", hr); ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 7", FALSE); + ok(ctxt.originX != 0.0 && ctxt.originX == floorf(ctxt.originX), "got %f\n", ctxt.originX); + IDWriteTextLayout_Release(layout); + ctxt.gdicompat = TRUE; + ctxt.use_gdi_natural = FALSE; + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, format, 100.0, 100.0, 1.0, NULL, FALSE, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); flush_sequence(sequences, RENDERER_ID); - hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); ok(hr == S_OK, "got 0x%08x\n", hr); ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 8", FALSE); IDWriteTextLayout_Release(layout); + ctxt.gdicompat = TRUE; + ctxt.use_gdi_natural = TRUE; + m.m11 = m.m22 = 2.0; m.m12 = m.m21 = m.dx = m.dy = 0.0; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, format, 100.0, 100.0, 1.0, &m, TRUE, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); flush_sequence(sequences, RENDERER_ID); - hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); ok(hr == S_OK, "got 0x%08x\n", hr); ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 9", FALSE); IDWriteTextLayout_Release(layout); + ctxt.gdicompat = TRUE; + ctxt.use_gdi_natural = FALSE; + m.m11 = m.m22 = 2.0; m.m12 = m.m21 = m.dx = m.dy = 0.0; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, format, 100.0, 100.0, 1.0, &m, FALSE, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); flush_sequence(sequences, RENDERER_ID); - hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); ok(hr == S_OK, "got 0x%08x\n", hr); ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 10", FALSE); IDWriteTextLayout_Release(layout); + IDWriteInlineObject_Release(inlineobj); IDWriteTextFormat_Release(format); IDWriteFactory_Release(factory); } @@ -1501,12 +1630,14 @@ static void test_GetClusterMetrics(void) { + static const WCHAR str5W[] = {'a','\r','b','\n','c','\n','\r','d','\r','\n','e',0xb,'f',0xc, + 'g',0x0085,'h',0x2028,'i',0x2029,0}; static const WCHAR str3W[] = {0x2066,')',')',0x661,'(',0x627,')',0}; static const WCHAR str2W[] = {0x202a,0x202c,'a',0}; static const WCHAR strW[] = {'a','b','c','d',0}; static const WCHAR str4W[] = {'a',' ',0}; DWRITE_INLINE_OBJECT_METRICS inline_metrics; - DWRITE_CLUSTER_METRICS metrics[4]; + DWRITE_CLUSTER_METRICS metrics[20]; IDWriteTextLayout1 *layout1; IDWriteInlineObject *trimm; IDWriteTextFormat *format; @@ -1764,6 +1895,69 @@ IDWriteTextLayout_Release(layout); + /* compare natural cluster width with gdi layout */ + hr = IDWriteFactory_CreateTextLayout(factory, str4W, 1, format, 100.0, 100.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = 0; + memset(metrics, 0, sizeof(metrics)); + hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 1, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 1, "got %u\n", count); + ok(metrics[0].width != floorf(metrics[0].width), "got %f\n", metrics[0].width); + + IDWriteTextLayout_Release(layout); + + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, str4W, 1, format, 100.0, 100.0, 1.0, NULL, FALSE, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = 0; + memset(metrics, 0, sizeof(metrics)); + hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 1, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 1, "got %u\n", count); + ok(metrics[0].width == floorf(metrics[0].width), "got %f\n", metrics[0].width); + + IDWriteTextLayout_Release(layout); + + /* isNewline tests */ + hr = IDWriteFactory_CreateTextLayout(factory, str5W, 20, format, 100.0, 200.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = 0; + memset(metrics, 0, sizeof(metrics)); + hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 20, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count == 20, "got %u\n", count); + +todo_wine { + ok(metrics[1].isNewline == 1, "got %d\n", metrics[1].isNewline); + ok(metrics[3].isNewline == 1, "got %d\n", metrics[3].isNewline); + ok(metrics[5].isNewline == 1, "got %d\n", metrics[5].isNewline); + ok(metrics[6].isNewline == 1, "got %d\n", metrics[6].isNewline); + ok(metrics[9].isNewline == 1, "got %d\n", metrics[9].isNewline); + ok(metrics[11].isNewline == 1, "got %d\n", metrics[11].isNewline); + ok(metrics[13].isNewline == 1, "got %d\n", metrics[13].isNewline); + ok(metrics[15].isNewline == 1, "got %d\n", metrics[15].isNewline); + ok(metrics[17].isNewline == 1, "got %d\n", metrics[17].isNewline); + ok(metrics[19].isNewline == 1, "got %d\n", metrics[19].isNewline); +} + ok(metrics[0].isNewline == 0, "got %d\n", metrics[0].isNewline); + ok(metrics[2].isNewline == 0, "got %d\n", metrics[2].isNewline); + ok(metrics[4].isNewline == 0, "got %d\n", metrics[4].isNewline); + ok(metrics[7].isNewline == 0, "got %d\n", metrics[7].isNewline); + ok(metrics[8].isNewline == 0, "got %d\n", metrics[8].isNewline); + ok(metrics[10].isNewline == 0, "got %d\n", metrics[10].isNewline); + ok(metrics[12].isNewline == 0, "got %d\n", metrics[12].isNewline); + ok(metrics[14].isNewline == 0, "got %d\n", metrics[14].isNewline); + ok(metrics[16].isNewline == 0, "got %d\n", metrics[16].isNewline); + ok(metrics[18].isNewline == 0, "got %d\n", metrics[18].isNewline); + + for (i = 0; i < count; i++) + ok(metrics[i].length == 1, "%d: got %d\n", i, metrics[i].length); + + IDWriteTextLayout_Release(layout); + IDWriteInlineObject_Release(trimm); IDWriteTextFormat_Release(format); IDWriteFactory_Release(factory); @@ -2821,10 +3015,11 @@ static void test_GetLineMetrics(void) { + static const WCHAR str3W[] = {'a','\r','b','\n','c','\n','\r','d','\r','\n',0}; static const WCHAR strW[] = {'a','b','c','d',' ',0}; static const WCHAR str2W[] = {'a','b','\r','c','d',0}; DWRITE_FONT_METRICS fontmetrics; - DWRITE_LINE_METRICS metrics[2]; + DWRITE_LINE_METRICS metrics[6]; IDWriteTextFormat *format; IDWriteTextLayout *layout; IDWriteFontFace *fontface; @@ -2881,9 +3076,42 @@ metrics[1].baseline); } IDWriteTextLayout_Release(layout); + IDWriteTextFormat_Release(format); - IDWriteFontFace_Release(fontface); + /* line breaks */ + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 12.0, enusW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateTextLayout(factory, str3W, 10, format, 100.0, 300.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + memset(metrics, 0xcc, sizeof(metrics)); + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 6, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); +todo_wine + ok(count == 6, "got %u\n", count); + +todo_wine { + ok(metrics[0].length == 2, "got %u\n", metrics[0].length); + ok(metrics[1].length == 2, "got %u\n", metrics[1].length); + ok(metrics[2].length == 2, "got %u\n", metrics[2].length); + ok(metrics[3].length == 1, "got %u\n", metrics[3].length); + ok(metrics[4].length == 3, "got %u\n", metrics[4].length); + ok(metrics[5].length == 0, "got %u\n", metrics[5].length); +} + +todo_wine { + ok(metrics[0].newlineLength == 1, "got %u\n", metrics[0].newlineLength); + ok(metrics[1].newlineLength == 1, "got %u\n", metrics[1].newlineLength); + ok(metrics[2].newlineLength == 1, "got %u\n", metrics[2].newlineLength); + ok(metrics[3].newlineLength == 1, "got %u\n", metrics[3].newlineLength); + ok(metrics[4].newlineLength == 2, "got %u\n", metrics[4].newlineLength); + ok(metrics[5].newlineLength == 0, "got %u\n", metrics[5].newlineLength); +} + IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); + IDWriteFontFace_Release(fontface); IDWriteFactory_Release(factory); } @@ -3212,6 +3440,223 @@ IDWriteFactory_Release(factory); } +static inline FLOAT get_scaled_font_metric(UINT32 metric, FLOAT emSize, const DWRITE_FONT_METRICS *metrics) +{ + return (FLOAT)metric * emSize / (FLOAT)metrics->designUnitsPerEm; +} + +static FLOAT snap_coord(const DWRITE_MATRIX *m, FLOAT ppdip, FLOAT coord) +{ + FLOAT vec[2], det, vec2[2]; + BOOL transform; + + /* has to be a diagonal matrix */ + if ((ppdip <= 0.0) || + (m->m11 * m->m22 != 0.0 && (m->m12 != 0.0 || m->m21 != 0.0)) || + (m->m12 * m->m21 != 0.0 && (m->m11 != 0.0 || m->m22 != 0.0))) + return coord; + + det = m->m11 * m->m22 - m->m12 * m->m21; + transform = fabsf(det) > 1e-10; + + if (transform) { + /* apply transform */ + vec[0] = 0.0; + vec[1] = coord * ppdip; + + vec2[0] = m->m11 * vec[0] + m->m21 * vec[1] + m->dx; + vec2[1] = m->m12 * vec[0] + m->m22 * vec[1] + m->dy; + + /* snap */ + vec2[0] = floorf(vec2[0] + 0.5f); + vec2[1] = floorf(vec2[1] + 0.5f); + + /* apply inverted transform */ + vec[1] = (-m->m12 * vec2[0] + m->m11 * vec2[1] - (m->m11 * m->dy - m->m12 * m->dx)) / det; + vec[1] /= ppdip; + } + else + vec[1] = floorf(coord * ppdip + 0.5f) / ppdip; + return vec[1]; +} + +static inline BOOL float_eq(FLOAT left, FLOAT right) +{ + int x = *(int *)&left; + int y = *(int *)&right; + + if (x < 0) + x = INT_MIN - x; + if (y < 0) + y = INT_MIN - y; + + return abs(x - y) <= 16; +} + +struct snapping_test { + DWRITE_MATRIX m; + FLOAT ppdip; +}; + +static struct snapping_test snapping_tests[] = { + { { 0.0, 1.0, 2.0, 0.0, 0.2, 0.3 }, 1.0 }, + { { 0.0, 1.0, 2.0, 0.0, 0.0, 0.0 }, 1.0 }, + { { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, 1.0 }, /* identity transform */ + { { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, 0.9 }, + { { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, -1.0 }, + { { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, 0.0 }, + { { 1.0, 0.0, 0.0, 1.0, 0.0, 0.3 }, 1.0 }, /* simple Y shift */ + { { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, 10.0 }, /* identity, 10 ppdip */ + { { 1.0, 0.0, 0.0, 10.0, 0.0, 0.0 }, 10.0 }, + { { 0.0, 1.0, 1.0, 0.0, 0.2, 0.6 }, 1.0 }, + { { 0.0, 2.0, 2.0, 0.0, 0.2, 0.6 }, 1.0 }, + { { 0.0, 0.5, -0.5, 0.0, 0.2, 0.6 }, 1.0 }, + { { 1.0, 2.0, 0.0, 1.0, 0.2, 0.6 }, 1.0 }, + { { 1.0, 1.0, 0.0, 1.0, 0.2, 0.6 }, 1.0 }, + { { 0.5, 0.5, -0.5, 0.5, 0.2, 0.6 }, 1.0 }, /* 45 degrees rotation */ + { { 0.5, 0.5, -0.5, 0.5, 0.0, 0.0 }, 100.0 }, /* 45 degrees rotation */ + { { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, 100.0 }, + { { 0.0, 1.0, -1.0, 0.0, 0.2, 0.6 }, 1.0 }, /* 90 degrees rotation */ + { { -1.0, 0.0, 0.0, -1.0, 0.2, 0.6 }, 1.0 }, /* 180 degrees rotation */ + { { 0.0, -1.0, 1.0, 0.0, 0.2, 0.6 }, 1.0 }, /* 270 degrees rotation */ + { { 1.0, 0.0, 0.0, 1.0,-0.1, 0.2 }, 1.0 }, + { { 0.0, 1.0, -1.0, 0.0,-0.2,-0.3 }, 1.0 }, /* 90 degrees rotation */ + { { -1.0, 0.0, 0.0, -1.0,-0.3,-1.6 }, 1.0 }, /* 180 degrees rotation */ + { { 0.0, -1.0, 1.0, 0.0,-0.7, 0.6 }, 10.0 }, /* 270 degrees rotation */ + { { 0.0, 2.0, 1.0, 0.0, 0.2, 0.6 }, 1.0 }, + { { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 }, 1.0 }, + { { 3.0, 0.0, 0.0, 5.0, 0.2,-0.3 }, 10.0 }, + { { 0.0, -3.0, 5.0, 0.0,-0.1, 0.7 }, 10.0 }, +}; + +static DWRITE_MATRIX compattransforms[] = { + { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, + { 1.0, 0.0, 0.0, 1.0, 0.2, 0.3 }, + { 2.0, 0.0, 0.0, 2.0, 0.2, 0.3 }, + { 2.0, 1.0, 2.0, 2.0, 0.2, 0.3 }, +}; + +static void test_pixelsnapping(void) +{ + static const WCHAR strW[] = {'a',0}; + IDWriteTextLayout *layout, *layout2; + struct renderer_context ctxt; + DWRITE_FONT_METRICS metrics; + IDWriteTextFormat *format; + IDWriteFontFace *fontface; + IDWriteFactory *factory; + FLOAT baseline, originX; + HRESULT hr; + int i, j; + + factory = create_factory(); + + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 12.0, enusW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + fontface = get_fontface_from_format(format); + IDWriteFontFace_GetMetrics(fontface, &metrics); + + hr = IDWriteFactory_CreateTextLayout(factory, strW, 1, format, 500.0, 100.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* disabled snapping */ + ctxt.snapping_disabled = TRUE; + ctxt.gdicompat = FALSE; + ctxt.use_gdi_natural = FALSE; + ctxt.ppdip = 1.0f; + memset(&ctxt.m, 0, sizeof(ctxt.m)); + ctxt.m.m11 = ctxt.m.m22 = 1.0; + originX = 0.1; + + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, originX, 0.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + + baseline = get_scaled_font_metric(metrics.ascent, 12.0, &metrics); + ok(ctxt.originX == originX, "got %f, originX %f\n", ctxt.originX, originX); + ok(ctxt.originY == baseline, "got %f, baseline %f\n", ctxt.originY, baseline); + ok(floor(baseline) != baseline, "got %f\n", baseline); + + ctxt.snapping_disabled = FALSE; + + for (i = 0; i < sizeof(snapping_tests)/sizeof(snapping_tests[0]); i++) { + struct snapping_test *ptr = &snapping_tests[i]; + FLOAT expectedY; + + ctxt.m = ptr->m; + ctxt.ppdip = ptr->ppdip; + ctxt.originX = 678.9; + ctxt.originY = 678.9; + + expectedY = snap_coord(&ctxt.m, ctxt.ppdip, baseline); + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, originX, 0.0); + ok(hr == S_OK, "%d: got 0x%08x\n", i, hr); + ok(ctxt.originX == originX, "%d: got %f, originX %f\n", i, ctxt.originX, originX); + ok(float_eq(ctxt.originY, expectedY), "%d: got %f, expected %f, baseline %f\n", + i, ctxt.originY, expectedY, baseline); + + /* gdicompat layout transform doesn't affect snapping */ + for (j = 0; j < sizeof(compattransforms)/sizeof(compattransforms[0]); j++) { + hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 1, format, 500.0, 100.0, + 1.0, &compattransforms[j], FALSE, &layout2); + ok(hr == S_OK, "%d: got 0x%08x\n", i, hr); + + expectedY = snap_coord(&ctxt.m, ctxt.ppdip, baseline); + hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, originX, 0.0); + ok(hr == S_OK, "%d: got 0x%08x\n", i, hr); + ok(ctxt.originX == originX, "%d: got %f, originX %f\n", i, ctxt.originX, originX); + ok(float_eq(ctxt.originY, expectedY), "%d: got %f, expected %f, baseline %f\n", + i, ctxt.originY, expectedY, baseline); + + IDWriteTextLayout_Release(layout2); + } + } + + IDWriteTextLayout_Release(layout); + IDWriteTextFormat_Release(format); + IDWriteFontFace_Release(fontface); + IDWriteFactory_Release(factory); +} + +static void test_SetWordWrapping(void) +{ + static const WCHAR strW[] = {'a',0}; + IDWriteTextFormat *format; + IDWriteTextLayout *layout; + IDWriteFactory *factory; + DWRITE_WORD_WRAPPING v; + HRESULT hr; + + factory = create_factory(); + + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 12.0, enusW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + v = IDWriteTextFormat_GetWordWrapping(format); + ok(v == DWRITE_WORD_WRAPPING_WRAP, "got %d\n", v); + + hr = IDWriteFactory_CreateTextLayout(factory, strW, 1, format, 500.0, 100.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + + v = IDWriteTextLayout_GetWordWrapping(layout); + ok(v == DWRITE_WORD_WRAPPING_WRAP, "got %d\n", v); + + hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_NO_WRAP); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_NO_WRAP); + ok(hr == S_OK, "got 0x%08x\n", hr); + + v = IDWriteTextFormat_GetWordWrapping(format); + ok(v == DWRITE_WORD_WRAPPING_WRAP, "got %d\n", v); + + IDWriteTextLayout_Release(layout); + IDWriteTextFormat_Release(format); + IDWriteFactory_Release(factory); +} + START_TEST(layout) { static const WCHAR ctrlstrW[] = {0x202a,0}; @@ -3255,6 +3700,8 @@ test_SetTextAlignment(); test_SetParagraphAlignment(); test_SetReadingDirection(); + test_pixelsnapping(); + test_SetWordWrapping(); IDWriteFactory_Release(factory); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/gdi32/freetype.c wine-staging-1.7.48~ubuntu12.04.1/dlls/gdi32/freetype.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/gdi32/freetype.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/gdi32/freetype.c 2015-07-29 19:28:54.000000000 +0000 @@ -2240,6 +2240,27 @@ } } +static BOOL map_font_family(const WCHAR *orig, const WCHAR *repl) +{ + Family *family = find_family_from_any_name(repl); + if (family != NULL) + { + Family *new_family = HeapAlloc(GetProcessHeap(), 0, sizeof(*new_family)); + if (new_family != NULL) + { + TRACE("mapping %s to %s\n", debugstr_w(repl), debugstr_w(orig)); + new_family->FamilyName = strdupW(orig); + new_family->EnglishName = NULL; + list_init(&new_family->faces); + new_family->replacement = &family->faces; + list_add_tail(&font_list, &new_family->entry); + return TRUE; + } + } + TRACE("%s is not available. Skip this replacement.\n", debugstr_w(repl)); + return FALSE; +} + /*********************************************************** * The replacement list is a way to map an entire font * family onto another family. For example adding @@ -2271,35 +2292,27 @@ dlen = datalen; vlen = valuelen; - while(RegEnumValueW(hkey, i++, value, &vlen, NULL, &type, data, - &dlen) == ERROR_SUCCESS) { - TRACE("Got %s=%s\n", debugstr_w(value), debugstr_w(data)); + while(RegEnumValueW(hkey, i++, value, &vlen, NULL, &type, data, &dlen) == ERROR_SUCCESS) + { /* "NewName"="Oldname" */ if(!find_family_from_any_name(value)) { - Family * const family = find_family_from_any_name(data); - if (family != NULL) + if (type == REG_MULTI_SZ) { - Family * const new_family = HeapAlloc(GetProcessHeap(), 0, sizeof(*new_family)); - if (new_family != NULL) + WCHAR *replace = data; + while(*replace) { - TRACE("mapping %s to %s\n", debugstr_w(data), debugstr_w(value)); - new_family->FamilyName = strdupW(value); - new_family->EnglishName = NULL; - list_init(&new_family->faces); - new_family->replacement = &family->faces; - list_add_tail(&font_list, &new_family->entry); + if (map_font_family(value, replace)) + break; + replace += strlenW(replace) + 1; } } else - { - TRACE("%s is not available. Skip this replacement.\n", debugstr_w(data)); - } + map_font_family(value, data); } else - { TRACE("%s is available. Skip this replacement.\n", debugstr_w(value)); - } + /* reset dlen and vlen */ dlen = datalen; vlen = valuelen; @@ -5761,7 +5774,7 @@ } static BOOL enum_face_charsets(const Family *family, Face *face, struct enum_charset_list *list, - FONTENUMPROCW proc, LPARAM lparam) + FONTENUMPROCW proc, LPARAM lparam, const WCHAR *subst) { ENUMLOGFONTEXW elf; NEWTEXTMETRICEXW ntm; @@ -5795,6 +5808,8 @@ else strcpyW(elf.elfFullName, family->FamilyName); } + if (subst) + strcpyW(elf.elfLogFont.lfFaceName, subst); TRACE("enuming face %s full %s style %s charset = %d type %d script %s it %d weight %d ntmflags %08x\n", debugstr_w(elf.elfLogFont.lfFaceName), debugstr_w(elf.elfFullName), debugstr_w(elf.elfStyle), @@ -5849,14 +5864,14 @@ face_list = get_face_list_from_family(family); LIST_FOR_EACH_ENTRY( face, face_list, Face, entry ) { if (!face_matches(family->FamilyName, face, face_name)) continue; - if (!enum_face_charsets(family, face, &enum_charsets, proc, lparam)) return FALSE; + if (!enum_face_charsets(family, face, &enum_charsets, proc, lparam, psub ? psub->from.name : NULL)) return FALSE; } } } else { LIST_FOR_EACH_ENTRY( family, &font_list, Family, entry ) { face_list = get_face_list_from_family(family); face = LIST_ENTRY(list_head(face_list), Face, entry); - if (!enum_face_charsets(family, face, &enum_charsets, proc, lparam)) return FALSE; + if (!enum_face_charsets(family, face, &enum_charsets, proc, lparam, NULL)) return FALSE; } } LeaveCriticalSection( &freetype_cs ); @@ -7707,7 +7722,7 @@ if (physdev->font->potm || get_outline_text_metrics( physdev->font )) { - if(cbSize >= physdev->font->potm->otmSize) + if(potm && cbSize >= physdev->font->potm->otmSize) { memcpy(potm, physdev->font->potm, physdev->font->potm->otmSize); scale_outline_font_metrics(physdev->font, potm); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/gdi32/tests/font.c wine-staging-1.7.48~ubuntu12.04.1/dlls/gdi32/tests/font.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/gdi32/tests/font.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/gdi32/tests/font.c 2015-07-29 19:28:54.000000000 +0000 @@ -1850,6 +1850,8 @@ } SelectObject(hdc, old_hfont); + /* force GDI to use new font, otherwise Windows leaks the font reference */ + GetTextMetricsA(hdc, &tm); DeleteObject(hfont); } } @@ -2002,6 +2004,7 @@ BYTE *ratio_rec; char ttf_name[MAX_PATH]; void *res, *copy; + BOOL ret; if (!pAddFontResourceExA) { @@ -2034,7 +2037,9 @@ test_height( hdc, data[i].fd ); pRemoveFontResourceExA( ttf_name, FR_PRIVATE, 0 ); } - DeleteFileA( ttf_name ); + ret = DeleteFileA( ttf_name ); + ok(ret || broken(!ret && GetLastError() == ERROR_ACCESS_DENIED), + "DeleteFile error %d\n", GetLastError()); } } @@ -2142,6 +2147,11 @@ } ok(otm->otmpFullName == unset_ptr, "expected %p got %p\n", unset_ptr, otm->otmpFullName); + /* check handling of NULL pointer */ + SetLastError(0xdeadbeef); + ret = GetOutlineTextMetricsA(hdc, otm_size, NULL); + ok(ret == otm_size, "expected %u, got %u, error %d\n", otm_size, ret, GetLastError()); + HeapFree(GetProcessHeap(), 0, otm); SelectObject(hdc, hfont_old); @@ -3917,20 +3927,25 @@ { "Times New Roman Greek", 161 }, { "Times New Roman TUR", 162 } }; + static const struct + { + const char *name; + int charset; + } shell_subst[] = + { + { "MS Shell Dlg", 186 }, + { "MS Shell Dlg", 238 }, + { "MS Shell Dlg", 204 }, + { "MS Shell Dlg", 161 }, + { "MS Shell Dlg", 162 } + }; LOGFONTA lf; HDC hdc; HFONT hfont; CHARSETINFO csi; - INT cs, expected_cs, i; + INT cs, expected_cs, i, ret; char buf[LF_FACESIZE]; - if (!is_truetype_font_installed("Arial") || - !is_truetype_font_installed("Times New Roman")) - { - skip("Arial or Times New Roman not installed\n"); - return; - } - expected_cs = GetACP(); if (!TranslateCharsetInfo(ULongToPtr(expected_cs), &csi, TCI_SRCCODEPAGE)) { @@ -3940,7 +3955,48 @@ expected_cs = csi.ciCharset; trace("ACP %d -> charset %d\n", GetACP(), expected_cs); - hdc = GetDC(0); + hdc = CreateCompatibleDC(0); + + for (i = 0; i < sizeof(shell_subst)/sizeof(shell_subst[0]); i++) + { + ret = is_font_installed(shell_subst[i].name); + ok(ret || broken(!ret) /* win2000 */, "%s should be enumerated\n", shell_subst[i].name); + ret = is_truetype_font_installed(shell_subst[i].name); + ok(ret || broken(!ret) /* win2000 */, "%s should be enumerated\n", shell_subst[i].name); + + memset(&lf, 0, sizeof(lf)); + lf.lfHeight = -13; + lf.lfWeight = FW_REGULAR; + strcpy(lf.lfFaceName, shell_subst[i].name); + hfont = CreateFontIndirectA(&lf); + hfont = SelectObject(hdc, hfont); + GetTextFaceA(hdc, sizeof(buf), buf); + ok(!lstrcmpiA(buf, shell_subst[i].name), "expected %s, got %s\n", shell_subst[i].name, buf); + cs = GetTextCharset(hdc); + ok(cs == ANSI_CHARSET, "expected ANSI_CHARSET, got %d for font %s\n", cs, shell_subst[i].name); + + DeleteObject(SelectObject(hdc, hfont)); + + memset(&lf, 0, sizeof(lf)); + lf.lfHeight = -13; + lf.lfWeight = FW_DONTCARE; + strcpy(lf.lfFaceName, shell_subst[i].name); + hfont = CreateFontIndirectA(&lf); + hfont = SelectObject(hdc, hfont); + GetTextFaceA(hdc, sizeof(buf), buf); + ok(!lstrcmpiA(buf, shell_subst[i].name), "expected %s, got %s\n", shell_subst[i].name, buf); + cs = GetTextCharset(hdc); + ok(cs == expected_cs || cs == ANSI_CHARSET, "expected %d, got %d for font %s\n", expected_cs, cs, shell_subst[i].name); + DeleteObject(SelectObject(hdc, hfont)); + } + + if (!is_truetype_font_installed("Arial") || + !is_truetype_font_installed("Times New Roman")) + { + DeleteDC(hdc); + skip("Arial or Times New Roman not installed\n"); + return; + } memset(&lf, 0, sizeof(lf)); lf.lfHeight = 100; @@ -3999,6 +4055,15 @@ for (i = 0; i < sizeof(font_subst)/sizeof(font_subst[0]); i++) { + ret = is_font_installed(font_subst[i].name); +todo_wine + ok(ret || broken(!ret && !i) /* win2000 doesn't have Times New Roman Baltic substitution */, + "%s should be enumerated\n", font_subst[i].name); + ret = is_truetype_font_installed(font_subst[i].name); +todo_wine + ok(ret || broken(!ret && !i) /* win2000 doesn't have Times New Roman Baltic substitution */, + "%s should be enumerated\n", font_subst[i].name); + memset(&lf, 0, sizeof(lf)); lf.lfHeight = -13; lf.lfWeight = FW_REGULAR; @@ -4038,7 +4103,7 @@ DeleteObject(SelectObject(hdc, hfont)); } - ReleaseDC(0, hdc); + DeleteDC(hdc); } static void test_GdiRealizationInfo(void) @@ -4868,7 +4933,6 @@ int ret; LOGFONTA lf; HDC hdc; - struct enum_fullname_data efnd; if (!is_truetype_font_installed("Arial")) { @@ -4929,26 +4993,89 @@ ret = EnumFontFamiliesA(hdc, NULL, enum_all_fonts_proc, (LPARAM)&lf); ok(ret, "font Arial Italic Bold should not be enumerated\n"); - /* MS Shell Dlg and MS Shell Dlg 2 must exist */ + DeleteDC(hdc); +} + +static INT CALLBACK enum_ms_shell_dlg_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) +{ + struct enum_fullname_data *efnd = (struct enum_fullname_data *)lParam; + +if (0) /* Disabled to limit console spam */ + trace("enumed font \"%s\", charset %d, height %d, weight %d, italic %d\n", + lf->lfFaceName, lf->lfCharSet, lf->lfHeight, lf->lfWeight, lf->lfItalic); + + if (type != TRUETYPE_FONTTYPE) return 1; + if (strcmp(lf->lfFaceName, "MS Shell Dlg") != 0) return 1; + + efnd->elf[efnd->total++] = *(ENUMLOGFONTA *)lf; + return 0; +} + +static INT CALLBACK enum_ms_shell_dlg2_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) +{ + struct enum_fullname_data *efnd = (struct enum_fullname_data *)lParam; + +if (0) /* Disabled to limit console spam */ + trace("enumed font \"%s\", charset %d, height %d, weight %d, italic %d\n", + lf->lfFaceName, lf->lfCharSet, lf->lfHeight, lf->lfWeight, lf->lfItalic); + + if (type != TRUETYPE_FONTTYPE) return 1; + if (strcmp(lf->lfFaceName, "MS Shell Dlg 2") != 0) return 1; + + efnd->elf[efnd->total++] = *(ENUMLOGFONTA *)lf; + return 0; +} + +static void test_EnumFonts_subst(void) +{ + int ret; + LOGFONTA lf; + HDC hdc; + struct enum_fullname_data efnd; + + ret = is_font_installed("MS Shell Dlg"); + ok(ret, "MS Shell Dlg should be enumerated\n"); + ret = is_truetype_font_installed("MS Shell Dlg"); + ok(ret, "MS Shell Dlg should be enumerated as a TrueType font\n"); + + ret = is_font_installed("MS Shell Dlg 2"); + ok(ret, "MS Shell Dlg 2 should be enumerated\n"); + ret = is_truetype_font_installed("MS Shell Dlg 2"); + ok(ret, "MS Shell Dlg 2 should be enumerated as a TrueType font\n"); + + hdc = CreateCompatibleDC(0); + + memset(&efnd, 0, sizeof(efnd)); + ret = EnumFontFamiliesExA(hdc, NULL, enum_ms_shell_dlg_proc, (LPARAM)&efnd, 0); + ok(ret, "MS Shell Dlg should not be enumerated\n"); + ok(!efnd.total, "MS Shell Dlg should not be enumerated\n"); + memset(&lf, 0, sizeof(lf)); lf.lfCharSet = DEFAULT_CHARSET; memset(&efnd, 0, sizeof(efnd)); strcpy(lf.lfFaceName, "MS Shell Dlg"); - ret = EnumFontFamiliesExA(hdc, &lf, enum_fullname_data_proc, (LPARAM)&efnd, 0); - ok(ret, "font MS Shell Dlg is not enumerated\n"); - ret = strcmp((char*)efnd.elf[0].elfLogFont.lfFaceName, "MS Shell Dlg"); - todo_wine ok(!ret, "expected MS Shell Dlg got %s\n", efnd.elf[0].elfLogFont.lfFaceName); - ret = strcmp((char*)efnd.elf[0].elfFullName, "MS Shell Dlg"); + ret = EnumFontFamiliesExA(hdc, &lf, enum_ms_shell_dlg_proc, (LPARAM)&efnd, 0); + ok(!ret, "MS Shell Dlg should be enumerated\n"); + ok(efnd.total > 0, "MS Shell Dlg should be enumerated\n"); + ret = strcmp((const char *)efnd.elf[0].elfLogFont.lfFaceName, "MS Shell Dlg"); + ok(!ret, "expected MS Shell Dlg, got %s\n", efnd.elf[0].elfLogFont.lfFaceName); + ret = strcmp((const char *)efnd.elf[0].elfFullName, "MS Shell Dlg"); ok(ret, "did not expect MS Shell Dlg\n"); memset(&efnd, 0, sizeof(efnd)); + ret = EnumFontFamiliesExA(hdc, NULL, enum_ms_shell_dlg2_proc, (LPARAM)&efnd, 0); + ok(ret, "MS Shell Dlg 2 should not be enumerated\n"); + ok(!efnd.total, "MS Shell Dlg 2 should not be enumerated\n"); + + memset(&efnd, 0, sizeof(efnd)); strcpy(lf.lfFaceName, "MS Shell Dlg 2"); - ret = EnumFontFamiliesExA(hdc, &lf, enum_fullname_data_proc, (LPARAM)&efnd, 0); - ok(ret, "font MS Shell Dlg 2 is not enumerated\n"); - ret = strcmp((char*)efnd.elf[0].elfLogFont.lfFaceName, "MS Shell Dlg 2"); - todo_wine ok(!ret, "expected MS Shell Dlg 2 got %s\n", efnd.elf[0].elfLogFont.lfFaceName); - ret = strcmp((char*)efnd.elf[0].elfFullName, "MS Shell Dlg 2"); + ret = EnumFontFamiliesExA(hdc, &lf, enum_ms_shell_dlg2_proc, (LPARAM)&efnd, 0); + ok(!ret, "MS Shell Dlg 2 should be enumerated\n"); + ok(efnd.total > 0, "MS Shell Dlg 2 should be enumerated\n"); + ret = strcmp((const char *)efnd.elf[0].elfLogFont.lfFaceName, "MS Shell Dlg 2"); + ok(!ret, "expected MS Shell Dlg 2, got %s\n", efnd.elf[0].elfLogFont.lfFaceName); + ret = strcmp((const char *)efnd.elf[0].elfFullName, "MS Shell Dlg 2"); ok(ret, "did not expect MS Shell Dlg 2\n"); DeleteDC(hdc); @@ -6229,6 +6356,7 @@ test_height_selection(); test_AddFontMemResource(); test_EnumFonts(); + test_EnumFonts_subst(); /* On Windows Arial has a lot of default charset aliases such as Arial Cyr, * I'd like to avoid them in this test. diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/gdiplus/font.c wine-staging-1.7.48~ubuntu12.04.1/dlls/gdiplus/font.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/gdiplus/font.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/gdiplus/font.c 2015-07-29 19:28:54.000000000 +0000 @@ -630,11 +630,15 @@ static INT CALLBACK is_font_installed_proc(const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam) { + const ENUMLOGFONTW *elfW = (const ENUMLOGFONTW *)elf; + LOGFONTW *lf = (LOGFONTW *)lParam; + if (type & RASTER_FONTTYPE) return 1; - *(LOGFONTW *)lParam = *elf; - + *lf = *elf; + /* replace substituted font name by a real one */ + lstrcpynW(lf->lfFaceName, elfW->elfFullName, LF_FACESIZE); return 0; } @@ -656,8 +660,6 @@ otm.otmSize = sizeof(otm); if (!GetOutlineTextMetricsW(hdc, otm.otmSize, &otm)) return FALSE; - GetTextFaceW(hdc, LF_FACESIZE, fm->facename); - fm->em_height = otm.otmEMSquare; fm->dpi = GetDeviceCaps(hdc, LOGPIXELSY); @@ -706,6 +708,8 @@ { HFONT hfont, old_font; + strcpyW(fm->facename, lf.lfFaceName); + hfont = CreateFontIndirectW(&lf); old_font = SelectObject(hdc, hfont); ret = get_font_metrics(hdc, fm) ? Ok : NotTrueTypeFont; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/gdiplus/image.c wine-staging-1.7.48~ubuntu12.04.1/dlls/gdiplus/image.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/gdiplus/image.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/gdiplus/image.c 2015-07-29 19:28:54.000000000 +0000 @@ -4401,6 +4401,12 @@ return encode_image_wic(image, stream, &GUID_ContainerFormatJpeg, params); } +static GpStatus encode_image_gif(GpImage *image, IStream* stream, + GDIPCONST CLSID* clsid, GDIPCONST EncoderParameters* params) +{ + return encode_image_wic(image, stream, &CLSID_WICGifEncoder, params); +} + /***************************************************************************** * GdipSaveImageToStream [GDIPLUS.@] */ @@ -4611,14 +4617,14 @@ /* FormatDescription */ gif_format, /* FilenameExtension */ gif_extension, /* MimeType */ gif_mimetype, - /* Flags */ ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, + /* Flags */ ImageCodecFlagsDecoder | ImageCodecFlagsEncoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, /* Version */ 1, /* SigCount */ 2, /* SigSize */ 6, /* SigPattern */ gif_sig_pattern, /* SigMask */ gif_sig_mask, }, - NULL, + encode_image_gif, decode_image_gif, select_frame_gif }, diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/gdiplus/tests/image.c wine-staging-1.7.48~ubuntu12.04.1/dlls/gdiplus/tests/image.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/gdiplus/tests/image.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/gdiplus/tests/image.c 2015-07-29 19:28:54.000000000 +0000 @@ -4544,6 +4544,91 @@ GdipDisposeImage((GpImage *)bitmap); } +static BOOL get_encoder_clsid(LPCWSTR mime, GUID *format, CLSID *clsid) +{ + GpStatus status; + UINT n_codecs, info_size, i; + ImageCodecInfo *info; + BOOL ret = FALSE; + + status = GdipGetImageEncodersSize(&n_codecs, &info_size); + expect(Ok, status); + + info = GdipAlloc(info_size); + + status = GdipGetImageEncoders(n_codecs, info_size, info); + expect(Ok, status); + + for (i = 0; i < n_codecs; i++) + { + if (!lstrcmpW(info[i].MimeType, mime)) + { + *format = info[i].FormatID; + *clsid = info[i].Clsid; + ret = TRUE; + break; + } + } + + GdipFree(info); + return ret; +} + +static void test_supported_encoders(void) +{ + static const WCHAR bmp_mimetype[] = { 'i', 'm', 'a','g', 'e', '/', 'b', 'm', 'p',0 }; + static const WCHAR jpeg_mimetype[] = { 'i','m','a','g','e','/','j','p','e','g',0 }; + static const WCHAR gif_mimetype[] = { 'i','m','a','g','e','/','g','i','f',0 }; + static const WCHAR tiff_mimetype[] = { 'i','m','a','g','e','/','t','i','f','f',0 }; + static const WCHAR png_mimetype[] = { 'i','m','a','g','e','/','p','n','g',0 }; + static const struct test_data + { + LPCWSTR mime; + const GUID *format; + BOOL todo; + } td[] = + { + { bmp_mimetype, &ImageFormatBMP, FALSE }, + { jpeg_mimetype, &ImageFormatJPEG, FALSE }, + { gif_mimetype, &ImageFormatGIF, TRUE }, + { tiff_mimetype, &ImageFormatTIFF, FALSE }, + { png_mimetype, &ImageFormatPNG, FALSE } + }; + GUID format, clsid; + BOOL ret; + HRESULT hr; + GpStatus status; + GpBitmap *bm; + IStream *stream; + HGLOBAL hmem; + int i; + + status = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat24bppRGB, NULL, &bm); + ok(status == Ok, "GdipCreateBitmapFromScan0 error %d\n", status); + + for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) + { + ret = get_encoder_clsid(td[i].mime, &format, &clsid); + ok(ret, "%s encoder is not in the list\n", wine_dbgstr_w(td[i].mime)); + expect_guid(td[i].format, &format, __LINE__, FALSE); + + hmem = GlobalAlloc(GMEM_MOVEABLE | GMEM_NODISCARD, 16); + + hr = CreateStreamOnHGlobal(hmem, TRUE, &stream); + ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr); + + status = GdipSaveImageToStream((GpImage *)bm, stream, &clsid, NULL); + if (td[i].todo) + todo_wine ok(status == Ok, "GdipSaveImageToStream error %d\n", status); + else + ok(status == Ok, "GdipSaveImageToStream error %d\n", status); + + IStream_Release(stream); + } + + GdipDisposeImage((GpImage *)bm); +} + START_TEST(image) { struct GdiplusStartupInput gdiplusStartupInput; @@ -4556,6 +4641,7 @@ GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + test_supported_encoders(); test_CloneBitmapArea(); test_ARGB_conversion(); test_DrawImage_scale(); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/gpkcsp/gpkcsp.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/gpkcsp/gpkcsp.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/gpkcsp/gpkcsp.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/gpkcsp/gpkcsp.spec 2015-07-29 19:28:54.000000000 +0000 @@ -21,6 +21,6 @@ @ stub CPSetProvParam @ stub CPSignHash @ stub CPVerifySignature -@ stdcall DllMain(ptr long ptr) +@ stdcall -private DllMain(ptr long ptr) @ stdcall -private DllRegisterServer() @ stdcall -private DllUnregisterServer() diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ieframe/dochost.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ieframe/dochost.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ieframe/dochost.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ieframe/dochost.c 2015-07-29 19:28:54.000000000 +0000 @@ -395,25 +395,25 @@ { travellog_entry_t *new_entry; - if(This->travellog.loading_pos == -1) { - /* Clear forward history. */ - if(!This->travellog.log) { - This->travellog.log = heap_alloc(4 * sizeof(*This->travellog.log)); - if(!This->travellog.log) - return; + if(!This->travellog.log) { + This->travellog.log = heap_alloc(4 * sizeof(*This->travellog.log)); + if(!This->travellog.log) + return; - This->travellog.size = 4; - }else if(This->travellog.size < This->travellog.position+1) { - travellog_entry_t *new_travellog; + This->travellog.size = 4; + }else if(This->travellog.size < This->travellog.position+1) { + travellog_entry_t *new_travellog; - new_travellog = heap_realloc(This->travellog.log, This->travellog.size*2*sizeof(*This->travellog.log)); - if(!new_travellog) - return; + new_travellog = heap_realloc(This->travellog.log, This->travellog.size*2*sizeof(*This->travellog.log)); + if(!new_travellog) + return; - This->travellog.log = new_travellog; - This->travellog.size *= 2; - } + This->travellog.log = new_travellog; + This->travellog.size *= 2; + } + if(This->travellog.loading_pos == -1) { + /* Clear forward history. */ while(This->travellog.length > This->travellog.position) free_travellog_entry(This->travellog.log + --This->travellog.length); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ieframe/ieframe.h wine-staging-1.7.48~ubuntu12.04.1/dlls/ieframe/ieframe.h --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ieframe/ieframe.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ieframe/ieframe.h 2015-07-29 19:28:54.000000000 +0000 @@ -191,6 +191,10 @@ IOleContainer *container; IOleInPlaceSiteEx *inplace; + IAdviseSink *sink; + DWORD sink_aspects; + DWORD sink_flags; + /* window context */ HWND frame_hwnd; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ieframe/navigate.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ieframe/navigate.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ieframe/navigate.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ieframe/navigate.c 2015-07-29 19:28:54.000000000 +0000 @@ -115,7 +115,7 @@ } V_VT(&arg) = VT_BSTR; - V_BSTR(&arg) = str ? SysAllocString(buffer) : NULL; + V_BSTR(&arg) = str ? SysAllocString(buffer) : SysAllocString(emptyW); TRACE("=> %s\n", debugstr_w(V_BSTR(&arg))); call_sink(This->doc_host->cps.wbe2, DISPID_STATUSTEXTCHANGE, &dispparams); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ieframe/oleobject.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ieframe/oleobject.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ieframe/oleobject.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ieframe/oleobject.c 2015-07-29 19:28:54.000000000 +0000 @@ -49,6 +49,22 @@ return 0; } +static void notify_on_focus(WebBrowser *This, BOOL got_focus) +{ + IOleControlSite *control_site; + HRESULT hres; + + if(!This->client) + return; + + hres = IOleClientSite_QueryInterface(This->client, &IID_IOleControlSite, (void**)&control_site); + if(FAILED(hres)) + return; + + IOleControlSite_OnFocus(control_site, got_focus); + IOleControlSite_Release(control_site); +} + static LRESULT WINAPI shell_embedding_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { WebBrowser *This; @@ -67,6 +83,12 @@ return resize_window(This, LOWORD(lParam), HIWORD(lParam)); case WM_DOCHOSTTASK: return process_dochost_tasks(&This->doc_host); + case WM_SETFOCUS: + notify_on_focus(This, TRUE); + break; + case WM_KILLFOCUS: + notify_on_focus(This, FALSE); + break; } return DefWindowProcW(hwnd, msg, wParam, lParam); @@ -203,6 +225,7 @@ IOleInPlaceFrame_SetMenu(This->doc_host.frame, NULL, NULL, This->shell_embedding_hwnd); SetFocus(This->shell_embedding_hwnd); + notify_on_focus(This, TRUE); return S_OK; } @@ -264,6 +287,11 @@ { release_dochost_client(&This->doc_host); + if(This->client) { + IOleClientSite_Release(This->client); + This->client = NULL; + } + if(This->shell_embedding_hwnd) { DestroyWindow(This->shell_embedding_hwnd); This->shell_embedding_hwnd = NULL; @@ -284,9 +312,9 @@ This->uiwindow = NULL; } - if(This->client) { - IOleClientSite_Release(This->client); - This->client = NULL; + if(This->sink) { + IAdviseSink_Release(This->sink); + This->sink = NULL; } } @@ -529,10 +557,11 @@ if(This->uiwindow) IOleInPlaceUIWindow_SetActiveObject(This->uiwindow, NULL, NULL); - if(This->inplace) { + if(This->inplace) IOleInPlaceSiteEx_OnUIDeactivate(This->inplace, FALSE); + notify_on_focus(This, FALSE); + if(This->inplace) IOleInPlaceSiteEx_OnInPlaceDeactivate(This->inplace); - } return IOleObject_SetClientSite(iface, NULL); } @@ -812,7 +841,7 @@ { WebBrowser *This = impl_from_IOleInPlaceObject(iface); - TRACE("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect); + TRACE("(%p)->(%s %s)\n", This, wine_dbgstr_rect(lprcPosRect), wine_dbgstr_rect(lprcClipRect)); This->pos_rect = *lprcPosRect; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ieframe/tests/webbrowser.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ieframe/tests/webbrowser.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ieframe/tests/webbrowser.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ieframe/tests/webbrowser.c 2015-07-29 19:28:54.000000000 +0000 @@ -143,7 +143,8 @@ DEFINE_EXPECT(OnInPlaceDeactivate); DEFINE_EXPECT(RequestUIActivate); DEFINE_EXPECT(ControlSite_TranslateAccelerator); -DEFINE_EXPECT(OnFocus); +DEFINE_EXPECT(OnFocus_TRUE); +DEFINE_EXPECT(OnFocus_FALSE); DEFINE_EXPECT(GetExternal); static const WCHAR wszItem[] = {'i','t','e','m',0}; @@ -833,6 +834,7 @@ ok(pDispParams->cArgs == 1, "cArgs=%d, expected 1\n", pDispParams->cArgs); ok(V_VT(pDispParams->rgvarg) == VT_BSTR, "V_VT(pDispParams->rgvarg)=%d, expected VT_BSTR\n", V_VT(pDispParams->rgvarg)); + ok(V_BSTR(pDispParams->rgvarg) != NULL, "V_BSTR(pDispParams->rgvarg) is NULL\n"); /* TODO: Check text */ break; @@ -1134,7 +1136,10 @@ static HRESULT WINAPI IOleControlSite_fnOnFocus(IOleControlSite* This, BOOL fGotFocus) { - CHECK_EXPECT2(OnFocus); + if(fGotFocus) + CHECK_EXPECT2(OnFocus_TRUE); + else + CHECK_EXPECT2(OnFocus_FALSE); return E_NOTIMPL; } @@ -1812,7 +1817,7 @@ SET_EXPECT(Frame_SetActiveObject); SET_EXPECT(UIWindow_SetActiveObject); SET_EXPECT(SetMenu); - SET_EXPECT(OnFocus); + SET_EXPECT(OnFocus_TRUE); hres = IOleObject_DoVerb(oleobj, OLEIVERB_SHOW, NULL, &ClientSite, 0, (HWND)0xdeadbeef, &rect); @@ -1829,7 +1834,7 @@ CHECK_CALLED(Frame_SetActiveObject); CHECK_CALLED(UIWindow_SetActiveObject); CHECK_CALLED(SetMenu); - todo_wine CHECK_CALLED(OnFocus); + CHECK_CALLED(OnFocus_TRUE); hres = IOleObject_DoVerb(oleobj, OLEIVERB_SHOW, NULL, &ClientSite, 0, (HWND)0xdeadbeef, &rect); @@ -3212,7 +3217,7 @@ SET_EXPECT(RequestUIActivate); SET_EXPECT(ShowUI); SET_EXPECT(HideUI); - SET_EXPECT(OnFocus); + SET_EXPECT(OnFocus_FALSE); } hres = IOleDocumentView_UIActivate(docview, activate); @@ -3226,7 +3231,7 @@ CHECK_CALLED(RequestUIActivate); CHECK_CALLED(ShowUI); CHECK_CALLED(HideUI); - CHECK_CALLED(OnFocus); + CHECK_CALLED(OnFocus_FALSE); } } @@ -3489,7 +3494,7 @@ SET_EXPECT(Frame_SetActiveObject); SET_EXPECT(UIWindow_SetActiveObject); SET_EXPECT(OnUIDeactivate); - SET_EXPECT(OnFocus); + SET_EXPECT(OnFocus_FALSE); SET_EXPECT(OnInPlaceDeactivate); SET_EXPECT(Invoke_STATUSTEXTCHANGE); if(!do_download) { @@ -3512,7 +3517,7 @@ CHECK_CALLED(Frame_SetActiveObject); CHECK_CALLED(UIWindow_SetActiveObject); CHECK_CALLED(OnUIDeactivate); - todo_wine CHECK_CALLED(OnFocus); + CHECK_CALLED(OnFocus_FALSE); CHECK_CALLED(OnInPlaceDeactivate); CLEAR_CALLED(Invoke_STATUSTEXTCHANGE); /* Called by IE9 */ if(!do_download) { @@ -3841,6 +3846,107 @@ DeleteFileA(file_path); } +static HRESULT WINAPI sink_QueryInterface( IAdviseSink *iface, REFIID riid, void **obj) +{ + if (IsEqualGUID(riid, &IID_IAdviseSink) || IsEqualGUID(riid, &IID_IUnknown)) { + *obj = iface; + return S_OK; + } + + ok(0, "unexpected call QI(%s)\n", wine_dbgstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI sink_AddRef(IAdviseSink *iface) +{ + return 2; +} + +static ULONG WINAPI sink_Release(IAdviseSink *iface) +{ + return 1; +} + +static void WINAPI sink_OnDataChange(IAdviseSink *iface, FORMATETC *format, STGMEDIUM *medium) +{ + trace("%p, %p, %p\n", iface, format, medium); +} + +static void WINAPI sink_OnViewChange(IAdviseSink *iface, DWORD aspect, LONG index) +{ + trace("%p, %08x, %d\n", iface, aspect, index); +} + +static void WINAPI sink_OnRename(IAdviseSink *iface, IMoniker *moniker) +{ + trace("%p, %p\n", iface, moniker); +} + +static void WINAPI sink_OnSave(IAdviseSink *iface) +{ + trace("%p\n", iface); +} + +static void WINAPI sink_OnClose(IAdviseSink *iface) +{ + trace("%p\n", iface); +} + +static const IAdviseSinkVtbl sink_vtbl = +{ + sink_QueryInterface, + sink_AddRef, + sink_Release, + sink_OnDataChange, + sink_OnViewChange, + sink_OnRename, + sink_OnSave, + sink_OnClose +}; + +static IAdviseSink test_sink = { &sink_vtbl }; + +static void test_SetAdvise(void) +{ + HRESULT hr; + IWebBrowser2 *browser; + IViewObject2 *view; + IAdviseSink *sink; + DWORD aspects, flags; + + if (!(browser = create_webbrowser())) return; + init_test(browser, 0); + + hr = IWebBrowser2_QueryInterface(browser, &IID_IViewObject2, (void **)&view); + ok(hr == S_OK, "got %08x\n", hr); + if (FAILED(hr)) return; + + aspects = flags = 0xdeadbeef; + sink = (IAdviseSink *)0xdeadbeef; + hr = IViewObject2_GetAdvise(view, &aspects, &flags, &sink); + ok(hr == S_OK, "got %08x\n", hr); + ok(!aspects, "got %08x\n", aspects); + ok(!flags, "got %08x\n", aspects); + ok(sink == NULL, "got %p\n", sink); + + hr = IViewObject2_SetAdvise(view, DVASPECT_CONTENT, 0, (IAdviseSink *)&test_sink); + ok(hr == S_OK, "got %08x\n", hr); + + aspects = flags = 0xdeadbeef; + sink = (IAdviseSink *)0xdeadbeef; + hr = IViewObject2_GetAdvise(view, &aspects, &flags, &sink); + ok(hr == S_OK, "got %08x\n", hr); + ok(aspects == DVASPECT_CONTENT, "got %08x\n", aspects); + ok(!flags, "got %08x\n", aspects); + ok(sink == &test_sink, "got %p\n", sink); + + hr = IViewObject2_SetAdvise(view, 0, 0, NULL); + ok(hr == S_OK, "got %08x\n", hr); + + IViewObject2_Release(view); + IWebBrowser2_Release(browser); +} + START_TEST(webbrowser) { OleInitialize(NULL); @@ -3867,6 +3973,7 @@ trace("Testing WebBrowserV1...\n"); test_WebBrowserV1(); test_FileProtocol(); + test_SetAdvise(); OleUninitialize(); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ieframe/view.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ieframe/view.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ieframe/view.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ieframe/view.c 2015-07-29 19:28:54.000000000 +0000 @@ -92,16 +92,36 @@ IAdviseSink *pAdvSink) { WebBrowser *This = impl_from_IViewObject2(iface); - FIXME("(%p)->(%d %08x %p)\n", This, aspects, advf, pAdvSink); - return E_NOTIMPL; + + TRACE("(%p)->(%d %08x %p)\n", This, aspects, advf, pAdvSink); + + if (aspects || advf) FIXME("aspects and/or flags not supported yet\n"); + + This->sink_aspects = aspects; + This->sink_flags = advf; + if (This->sink) IAdviseSink_Release(This->sink); + This->sink = pAdvSink; + if (This->sink) IAdviseSink_AddRef(This->sink); + + return S_OK; } static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects, DWORD *pAdvf, IAdviseSink **ppAdvSink) { WebBrowser *This = impl_from_IViewObject2(iface); - FIXME("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink); - return E_NOTIMPL; + + TRACE("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink); + + if (pAspects) *pAspects = This->sink_aspects; + if (pAdvf) *pAdvf = This->sink_flags; + if (ppAdvSink) + { + *ppAdvSink = This->sink; + if (*ppAdvSink) IAdviseSink_AddRef(*ppAdvSink); + } + + return S_OK; } static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwAspect, LONG lindex, diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/iphlpapi/iphlpapi_main.c wine-staging-1.7.48~ubuntu12.04.1/dlls/iphlpapi/iphlpapi_main.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/iphlpapi/iphlpapi_main.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/iphlpapi/iphlpapi_main.c 2015-07-29 19:28:54.000000000 +0000 @@ -51,8 +51,11 @@ #include "ipstats.h" #include "ipifcons.h" #include "fltdefs.h" +#include "ifdef.h" +#include "netioapi.h" #include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi); @@ -278,26 +281,140 @@ return ERROR_NOT_SUPPORTED; } +static char *debugstr_ipv6(const struct WS_sockaddr_in6 *sin, char *buf) +{ + const IN6_ADDR *addr = &sin->sin6_addr; + char *p = buf; + int i; + BOOL in_zero = FALSE; + + for (i = 0; i < 7; i++) + { + if (!addr->u.Word[i]) + { + if (i == 0) + *p++ = ':'; + if (!in_zero) + { + *p++ = ':'; + in_zero = TRUE; + } + } + else + { + p += sprintf(p, "%x:", ntohs(addr->u.Word[i])); + in_zero = FALSE; + } + } + sprintf(p, "%x", ntohs(addr->u.Word[7])); + return buf; +} + +static BOOL map_address_6to4( SOCKADDR_IN6 *addr6, SOCKADDR_IN *addr4 ) +{ + ULONG i; + + if (addr6->sin6_family != WS_AF_INET6) return FALSE; + + for (i = 0; i < 5; i++) + if (addr6->sin6_addr.u.Word[i]) return FALSE; + + if (addr6->sin6_addr.u.Word[5] != 0xffff) return FALSE; + + addr4->sin_family = AF_INET; + addr4->sin_port = addr6->sin6_port; + addr4->sin_addr.S_un.S_addr = addr6->sin6_addr.u.Word[6] << 16 | addr6->sin6_addr.u.Word[7]; + memset( &addr4->sin_zero, 0, sizeof(addr4->sin_zero) ); + + return TRUE; +} + +static BOOL find_src_address( MIB_IPADDRTABLE *table, SOCKADDR_IN *dst, SOCKADDR_IN6 *src ) +{ + MIB_IPFORWARDROW row; + DWORD i, j; + + if (GetBestRoute( dst->sin_addr.S_un.S_addr, 0, &row )) return FALSE; + + for (i = 0; i < table->dwNumEntries; i++) + { + /* take the first address */ + if (table->table[i].dwIndex == row.dwForwardIfIndex) + { + src->sin6_family = WS_AF_INET6; + src->sin6_port = 0; + src->sin6_flowinfo = 0; + for (j = 0; j < 5; j++) src->sin6_addr.u.Word[j] = 0; + src->sin6_addr.u.Word[5] = 0xffff; + src->sin6_addr.u.Word[6] = table->table[i].dwAddr & 0xffff; + src->sin6_addr.u.Word[7] = table->table[i].dwAddr >> 16; + return TRUE; + } + } + + return FALSE; +} /****************************************************************** * CreateSortedAddressPairs (IPHLPAPI.@) */ -DWORD WINAPI CreateSortedAddressPairs(const PSOCKADDR_IN6 source, DWORD sourcecount, - const PSOCKADDR_IN6 destination, DWORD destinationcount, - DWORD sortoptions, - PSOCKADDR_IN6_PAIR *sortedaddr, DWORD *sortedcount) -{ - FIXME("(source %p, sourcecount %d, destination %p, destcount %d, sortoptions %x," - " sortedaddr %p, sortedcount %p): stub\n", source, sourcecount, destination, - destinationcount, sortoptions, sortedaddr, sortedcount); +DWORD WINAPI CreateSortedAddressPairs( const PSOCKADDR_IN6 src_list, DWORD src_count, + const PSOCKADDR_IN6 dst_list, DWORD dst_count, + DWORD options, PSOCKADDR_IN6_PAIR *pair_list, + DWORD *pair_count ) +{ + DWORD i, size, ret; + SOCKADDR_IN6_PAIR *pairs; + SOCKADDR_IN6 *ptr; + SOCKADDR_IN addr4; + MIB_IPADDRTABLE *table; - if (source || sourcecount || !destination || !sortedaddr || !sortedcount || destinationcount > 500) - return ERROR_INVALID_PARAMETER; + FIXME( "(src_list %p src_count %u dst_list %p dst_count %u options %x pair_list %p pair_count %p): stub\n", + src_list, src_count, dst_list, dst_count, options, pair_list, pair_count ); - /* Returning not supported tells the client we don't have IPv6 support - * so applications can fallback to IPv4. - */ - return ERROR_NOT_SUPPORTED; + if (src_list || src_count || !dst_list || !pair_list || !pair_count || dst_count > 500) + return ERROR_INVALID_PARAMETER; + + for (i = 0; i < dst_count; i++) + { + if (!map_address_6to4( &dst_list[i], &addr4 )) + { + FIXME("only mapped IPv4 addresses are supported\n"); + return ERROR_NOT_SUPPORTED; + } + } + + size = dst_count * sizeof(*pairs); + size += dst_count * sizeof(SOCKADDR_IN6) * 2; /* source address + destination address */ + if (!(pairs = HeapAlloc( GetProcessHeap(), 0, size ))) return ERROR_NOT_ENOUGH_MEMORY; + ptr = (SOCKADDR_IN6 *)(char *)pairs + dst_count * sizeof(*pairs); + + if ((ret = getIPAddrTable( &table, GetProcessHeap(), 0 ))) + { + HeapFree( GetProcessHeap(), 0, pairs ); + return ret; + } + + for (i = 0; i < dst_count; i++) + { + pairs[i].SourceAddress = ptr++; + if (!map_address_6to4( &dst_list[i], &addr4 ) || + !find_src_address( table, &addr4, pairs[i].SourceAddress )) + { + char buf[46]; + FIXME( "source address for %s not found\n", debugstr_ipv6(&dst_list[i], buf) ); + memset( pairs[i].SourceAddress, 0, sizeof(*pairs[i].SourceAddress) ); + pairs[i].SourceAddress->sin6_family = WS_AF_INET6; + } + + pairs[i].DestinationAddress = ptr++; + memcpy( pairs[i].DestinationAddress, &dst_list[i], sizeof(*pairs[i].DestinationAddress) ); + } + *pair_list = pairs; + *pair_count = dst_count; + + HeapFree( GetProcessHeap(), 0, table ); + return NO_ERROR; } @@ -727,35 +844,6 @@ return buf; } -static char *debugstr_ipv6(const struct WS_sockaddr_in6 *sin, char *buf) -{ - const IN6_ADDR *addr = &sin->sin6_addr; - char *p = buf; - int i; - BOOL in_zero = FALSE; - - for (i = 0; i < 7; i++) - { - if (!addr->u.Word[i]) - { - if (i == 0) - *p++ = ':'; - if (!in_zero) - { - *p++ = ':'; - in_zero = TRUE; - } - } - else - { - p += sprintf(p, "%x:", ntohs(addr->u.Word[i])); - in_zero = FALSE; - } - } - sprintf(p, "%x", ntohs(addr->u.Word[7])); - return buf; -} - static ULONG count_v4_gateways(DWORD index, PMIB_IPFORWARDTABLE routeTable) { DWORD i, num_gateways = 0; @@ -1598,6 +1686,57 @@ return ret; } +/****************************************************************** + * GetIfEntry2 (IPHLPAPI.@) + */ +DWORD WINAPI GetIfEntry2( MIB_IF_ROW2 *row2 ) +{ + DWORD ret, len = sizeof(row2->Description)/sizeof(row2->Description[0]); + char buf[MAX_ADAPTER_NAME], *name; + MIB_IFROW row; + + TRACE("%p\n", row2); + + if (!row2 || (!(name = getInterfaceNameByIndex( row2->InterfaceIndex, buf )) && + !(name = getInterfaceNameByIndex( row2->InterfaceLuid.Info.NetLuidIndex, buf )))) + { + return ERROR_INVALID_PARAMETER; + } + if ((ret = getInterfaceEntryByName( name, &row ))) return ret; + if ((ret = getInterfaceStatsByName( name, &row ))) return ret; + + memset( row2, 0, sizeof(*row2) ); + row2->InterfaceLuid.Info.Reserved = 0; + row2->InterfaceLuid.Info.NetLuidIndex = row.dwIndex; + row2->InterfaceLuid.Info.IfType = row.dwType; + row2->InterfaceIndex = row.dwIndex; + row2->InterfaceGuid.Data1 = row.dwIndex; + row2->Type = row.dwType; + row2->Mtu = row.dwMtu; + MultiByteToWideChar( CP_UNIXCP, 0, (const char *)row.bDescr, -1, row2->Description, len ); + row2->PhysicalAddressLength = row.dwPhysAddrLen; + memcpy( &row2->PhysicalAddress, &row.bPhysAddr, row.dwPhysAddrLen ); + memcpy( &row2->PermanentPhysicalAddress, &row.bPhysAddr, row.dwPhysAddrLen ); + row2->OperStatus = IfOperStatusUp; + row2->AdminStatus = NET_IF_ADMIN_STATUS_UP; + row2->MediaConnectState = MediaConnectStateConnected; + row2->ConnectionType = NET_IF_CONNECTION_DEDICATED; + + /* stats */ + row2->InOctets = row.dwInOctets; + row2->InUcastPkts = row.dwInUcastPkts; + row2->InNUcastPkts = row.dwInNUcastPkts; + row2->InDiscards = row.dwInDiscards; + row2->InErrors = row.dwInErrors; + row2->InUnknownProtos = row.dwInUnknownProtos; + row2->OutOctets = row.dwOutOctets; + row2->OutUcastPkts = row.dwOutUcastPkts; + row2->OutNUcastPkts = row.dwOutNUcastPkts; + row2->OutDiscards = row.dwOutDiscards; + row2->OutErrors = row.dwOutErrors; + + return NO_ERROR; +} static int IfTableSorter(const void *a, const void *b) { @@ -2660,10 +2799,175 @@ } /****************************************************************** + * ConvertInterfaceGuidToLuid (IPHLPAPI.@) + */ +DWORD WINAPI ConvertInterfaceGuidToLuid(const GUID *guid, NET_LUID *luid) +{ + DWORD ret; + MIB_IFROW row; + + TRACE("(%s %p)\n", debugstr_guid(guid), luid); + + if (!guid || !luid) return ERROR_INVALID_PARAMETER; + + row.dwIndex = guid->Data1; + if ((ret = GetIfEntry( &row ))) return ret; + + luid->Info.Reserved = 0; + luid->Info.NetLuidIndex = guid->Data1; + luid->Info.IfType = row.dwType; + return NO_ERROR; +} + +/****************************************************************** + * ConvertInterfaceIndexToLuid (IPHLPAPI.@) + */ +DWORD WINAPI ConvertInterfaceIndexToLuid(NET_IFINDEX index, NET_LUID *luid) +{ + MIB_IFROW row; + + TRACE("(%u %p)\n", index, luid); + + if (!luid) return ERROR_INVALID_PARAMETER; + memset( luid, 0, sizeof(*luid) ); + + row.dwIndex = index; + if (GetIfEntry( &row )) return ERROR_FILE_NOT_FOUND; + + luid->Info.Reserved = 0; + luid->Info.NetLuidIndex = index; + luid->Info.IfType = row.dwType; + return NO_ERROR; +} + +/****************************************************************** * ConvertInterfaceLuidToGuid (IPHLPAPI.@) */ DWORD WINAPI ConvertInterfaceLuidToGuid(const NET_LUID *luid, GUID *guid) { - FIXME("(%p %p) stub\n", luid, guid); - return ERROR_CALL_NOT_IMPLEMENTED; + DWORD ret; + MIB_IFROW row; + + TRACE("(%p %p)\n", luid, guid); + + if (!luid || !guid) return ERROR_INVALID_PARAMETER; + + row.dwIndex = luid->Info.NetLuidIndex; + if ((ret = GetIfEntry( &row ))) return ret; + + guid->Data1 = luid->Info.NetLuidIndex; + return NO_ERROR; +} + +/****************************************************************** + * ConvertInterfaceLuidToIndex (IPHLPAPI.@) + */ +DWORD WINAPI ConvertInterfaceLuidToIndex(const NET_LUID *luid, NET_IFINDEX *index) +{ + DWORD ret; + MIB_IFROW row; + + TRACE("(%p %p)\n", luid, index); + + if (!luid || !index) return ERROR_INVALID_PARAMETER; + + row.dwIndex = luid->Info.NetLuidIndex; + if ((ret = GetIfEntry( &row ))) return ret; + + *index = luid->Info.NetLuidIndex; + return NO_ERROR; +} + +/****************************************************************** + * ConvertInterfaceLuidToNameA (IPHLPAPI.@) + */ +DWORD WINAPI ConvertInterfaceLuidToNameA(const NET_LUID *luid, char *name, SIZE_T len) +{ + DWORD ret; + MIB_IFROW row; + + TRACE("(%p %p %u)\n", luid, name, (DWORD)len); + + if (!luid) return ERROR_INVALID_PARAMETER; + + row.dwIndex = luid->Info.NetLuidIndex; + if ((ret = GetIfEntry( &row ))) return ret; + + if (!name || len < WideCharToMultiByte( CP_UNIXCP, 0, row.wszName, -1, NULL, 0, NULL, NULL )) + return ERROR_NOT_ENOUGH_MEMORY; + + WideCharToMultiByte( CP_UNIXCP, 0, row.wszName, -1, name, len, NULL, NULL ); + return NO_ERROR; +} + +/****************************************************************** + * ConvertInterfaceLuidToNameW (IPHLPAPI.@) + */ +DWORD WINAPI ConvertInterfaceLuidToNameW(const NET_LUID *luid, WCHAR *name, SIZE_T len) +{ + DWORD ret; + MIB_IFROW row; + + TRACE("(%p %p %u)\n", luid, name, (DWORD)len); + + if (!luid || !name) return ERROR_INVALID_PARAMETER; + + row.dwIndex = luid->Info.NetLuidIndex; + if ((ret = GetIfEntry( &row ))) return ret; + + if (len < strlenW( row.wszName ) + 1) return ERROR_NOT_ENOUGH_MEMORY; + strcpyW( name, row.wszName ); + return NO_ERROR; +} + +/****************************************************************** + * ConvertInterfaceNameToLuidA (IPHLPAPI.@) + */ +DWORD WINAPI ConvertInterfaceNameToLuidA(const char *name, NET_LUID *luid) +{ + DWORD ret; + IF_INDEX index; + MIB_IFROW row; + + TRACE("(%s %p)\n", debugstr_a(name), luid); + + if ((ret = getInterfaceIndexByName( name, &index ))) return ERROR_INVALID_NAME; + if (!luid) return ERROR_INVALID_PARAMETER; + + row.dwIndex = index; + if ((ret = GetIfEntry( &row ))) return ret; + + luid->Info.Reserved = 0; + luid->Info.NetLuidIndex = index; + luid->Info.IfType = row.dwType; + return NO_ERROR; +} + +/****************************************************************** + * ConvertInterfaceNameToLuidW (IPHLPAPI.@) + */ +DWORD WINAPI ConvertInterfaceNameToLuidW(const WCHAR *name, NET_LUID *luid) +{ + DWORD ret; + IF_INDEX index; + MIB_IFROW row; + char nameA[IF_MAX_STRING_SIZE + 1]; + + TRACE("(%s %p)\n", debugstr_w(name), luid); + + if (!luid) return ERROR_INVALID_PARAMETER; + memset( luid, 0, sizeof(*luid) ); + + if (!WideCharToMultiByte( CP_UNIXCP, 0, name, -1, nameA, sizeof(nameA), NULL, NULL )) + return ERROR_INVALID_NAME; + + if ((ret = getInterfaceIndexByName( nameA, &index ))) return ret; + + row.dwIndex = index; + if ((ret = GetIfEntry( &row ))) return ret; + + luid->Info.Reserved = 0; + luid->Info.NetLuidIndex = index; + luid->Info.IfType = row.dwType; + return NO_ERROR; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/iphlpapi/iphlpapi.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/iphlpapi/iphlpapi.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/iphlpapi/iphlpapi.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/iphlpapi/iphlpapi.spec 2015-07-29 19:28:54.000000000 +0000 @@ -12,15 +12,15 @@ #@ stub ConvertGuidToStringA #@ stub ConvertGuidToStringW #@ stub ConvertInterfaceAliasToLuid -#@ stub ConvertInterfaceGuidToLuid -#@ stub ConvertInterfaceIndexToLuid +@ stdcall ConvertInterfaceGuidToLuid( ptr ptr ) +@ stdcall ConvertInterfaceIndexToLuid( long ptr ) #@ stub ConvertInterfaceLuidToAlias @ stdcall ConvertInterfaceLuidToGuid( ptr ptr ) -#@ stub ConvertInterfaceLuidToIndex -#@ stub ConvertInterfaceLuidToNameA -#@ stub ConvertInterfaceLuidToNameW -#@ stub ConvertInterfaceNameToLuidA -#@ stub ConvertInterfaceNameToLuidW +@ stdcall ConvertInterfaceLuidToIndex( ptr ptr ) +@ stdcall ConvertInterfaceLuidToNameA( ptr ptr long ) +@ stdcall ConvertInterfaceLuidToNameW( ptr ptr long ) +@ stdcall ConvertInterfaceNameToLuidA( str ptr ) +@ stdcall ConvertInterfaceNameToLuidW( wstr ptr ) #@ stub ConvertInterfacePhysicalAddressToLuid #@ stub ConvertIpv4MaskToLength #@ stub ConvertLengthToIpv4Mask @@ -87,7 +87,7 @@ @ stdcall GetIcmpStatistics( ptr ) @ stub GetIcmpStatsFromStack @ stdcall GetIfEntry( ptr ) -#@ stub GetIfEntry2 +@ stdcall GetIfEntry2( ptr ) @ stub GetIfEntryFromStack #@ stub GetIfStackTable @ stdcall GetIfTable( ptr ptr long ) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/iphlpapi/ipstats.c wine-staging-1.7.48~ubuntu12.04.1/dlls/iphlpapi/ipstats.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/iphlpapi/ipstats.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/iphlpapi/ipstats.c 2015-07-29 19:28:54.000000000 +0000 @@ -1989,7 +1989,7 @@ int len; sprintf( link, "/proc/%u/fd/%s", map[i].unix_pid, dirent->d_name ); - if ((len = readlink( link, name, 32 )) > 0) name[len] = 0; + if ((len = readlink( link, name, sizeof(name) - 1 )) > 0) name[len] = 0; if (len == len_socket && !strcmp( socket, name )) { closedir( dirfd ); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/iphlpapi/tests/iphlpapi.c wine-staging-1.7.48~ubuntu12.04.1/dlls/iphlpapi/tests/iphlpapi.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/iphlpapi/tests/iphlpapi.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/iphlpapi/tests/iphlpapi.c 2015-07-29 19:28:54.000000000 +0000 @@ -38,8 +38,10 @@ #include "winsock2.h" #include "windef.h" #include "winbase.h" +#include "ws2tcpip.h" #include "iphlpapi.h" #include "iprtrmib.h" +#include "netioapi.h" #include "wine/test.h" #include #include @@ -51,6 +53,7 @@ static DWORD (WINAPI *pGetNumberOfInterfaces)(PDWORD); static DWORD (WINAPI *pGetIpAddrTable)(PMIB_IPADDRTABLE,PULONG,BOOL); static DWORD (WINAPI *pGetIfEntry)(PMIB_IFROW); +static DWORD (WINAPI *pGetIfEntry2)(PMIB_IF_ROW2); static DWORD (WINAPI *pGetFriendlyIfIndex)(DWORD); static DWORD (WINAPI *pGetIfTable)(PMIB_IFTABLE,PULONG,BOOL); static DWORD (WINAPI *pGetIpForwardTable)(PMIB_IPFORWARDTABLE,PULONG,BOOL); @@ -77,6 +80,17 @@ static DWORD (WINAPI *pSetTcpEntry)(PMIB_TCPROW); static HANDLE(WINAPI *pIcmpCreateFile)(VOID); static DWORD (WINAPI *pIcmpSendEcho)(HANDLE,IPAddr,LPVOID,WORD,PIP_OPTION_INFORMATION,LPVOID,DWORD,DWORD); +static DWORD (WINAPI *pCreateSortedAddressPairs)(const PSOCKADDR_IN6,ULONG,const PSOCKADDR_IN6,ULONG,ULONG, + PSOCKADDR_IN6_PAIR*,ULONG*); +static void (WINAPI *pFreeMibTable)(void*); +static DWORD (WINAPI *pConvertInterfaceGuidToLuid)(const GUID*,NET_LUID*); +static DWORD (WINAPI *pConvertInterfaceIndexToLuid)(NET_IFINDEX,NET_LUID*); +static DWORD (WINAPI *pConvertInterfaceLuidToGuid)(const NET_LUID*,GUID*); +static DWORD (WINAPI *pConvertInterfaceLuidToIndex)(const NET_LUID*,NET_IFINDEX*); +static DWORD (WINAPI *pConvertInterfaceLuidToNameW)(const NET_LUID*,WCHAR*,SIZE_T); +static DWORD (WINAPI *pConvertInterfaceLuidToNameA)(const NET_LUID*,char*,SIZE_T); +static DWORD (WINAPI *pConvertInterfaceNameToLuidA)(const char*,NET_LUID*); +static DWORD (WINAPI *pConvertInterfaceNameToLuidW)(const WCHAR*,NET_LUID*); static void loadIPHlpApi(void) { @@ -85,6 +99,7 @@ pGetNumberOfInterfaces = (void *)GetProcAddress(hLibrary, "GetNumberOfInterfaces"); pGetIpAddrTable = (void *)GetProcAddress(hLibrary, "GetIpAddrTable"); pGetIfEntry = (void *)GetProcAddress(hLibrary, "GetIfEntry"); + pGetIfEntry2 = (void *)GetProcAddress(hLibrary, "GetIfEntry2"); pGetFriendlyIfIndex = (void *)GetProcAddress(hLibrary, "GetFriendlyIfIndex"); pGetIfTable = (void *)GetProcAddress(hLibrary, "GetIfTable"); pGetIpForwardTable = (void *)GetProcAddress(hLibrary, "GetIpForwardTable"); @@ -111,6 +126,16 @@ pSetTcpEntry = (void *)GetProcAddress(hLibrary, "SetTcpEntry"); pIcmpCreateFile = (void *)GetProcAddress(hLibrary, "IcmpCreateFile"); pIcmpSendEcho = (void *)GetProcAddress(hLibrary, "IcmpSendEcho"); + pCreateSortedAddressPairs = (void *)GetProcAddress(hLibrary, "CreateSortedAddressPairs"); + pFreeMibTable = (void *)GetProcAddress(hLibrary, "FreeMibTable"); + pConvertInterfaceGuidToLuid = (void *)GetProcAddress(hLibrary, "ConvertInterfaceGuidToLuid"); + pConvertInterfaceIndexToLuid = (void *)GetProcAddress(hLibrary, "ConvertInterfaceIndexToLuid"); + pConvertInterfaceLuidToGuid = (void *)GetProcAddress(hLibrary, "ConvertInterfaceLuidToGuid"); + pConvertInterfaceLuidToIndex = (void *)GetProcAddress(hLibrary, "ConvertInterfaceLuidToIndex"); + pConvertInterfaceLuidToNameA = (void *)GetProcAddress(hLibrary, "ConvertInterfaceLuidToNameA"); + pConvertInterfaceLuidToNameW = (void *)GetProcAddress(hLibrary, "ConvertInterfaceLuidToNameW"); + pConvertInterfaceNameToLuidA = (void *)GetProcAddress(hLibrary, "ConvertInterfaceNameToLuidA"); + pConvertInterfaceNameToLuidW = (void *)GetProcAddress(hLibrary, "ConvertInterfaceNameToLuidW"); } } @@ -1562,6 +1587,286 @@ HeapFree( GetProcessHeap(), 0, table_module ); } +static void test_CreateSortedAddressPairs(void) +{ + SOCKADDR_IN6 dst[2]; + SOCKADDR_IN6_PAIR *pair; + ULONG pair_count; + DWORD ret; + + if (!pCreateSortedAddressPairs) + { + win_skip( "CreateSortedAddressPairs not available\n" ); + return; + } + + memset( dst, 0, sizeof(dst) ); + dst[0].sin6_family = AF_INET6; + dst[0].sin6_addr.u.Word[5] = 0xffff; + dst[0].sin6_addr.u.Word[6] = 0x0808; + dst[0].sin6_addr.u.Word[7] = 0x0808; + + pair_count = 0xdeadbeef; + ret = pCreateSortedAddressPairs( NULL, 0, dst, 1, 0, NULL, &pair_count ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( pair_count == 0xdeadbeef, "got %u\n", pair_count ); + + pair = (SOCKADDR_IN6_PAIR *)0xdeadbeef; + pair_count = 0xdeadbeef; + ret = pCreateSortedAddressPairs( NULL, 0, NULL, 1, 0, &pair, &pair_count ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( pair == (SOCKADDR_IN6_PAIR *)0xdeadbeef, "got %p\n", pair ); + ok( pair_count == 0xdeadbeef, "got %u\n", pair_count ); + + pair = NULL; + pair_count = 0xdeadbeef; + ret = pCreateSortedAddressPairs( NULL, 0, dst, 1, 0, &pair, &pair_count ); + ok( ret == NO_ERROR, "got %u\n", ret ); + ok( pair != NULL, "pair not set\n" ); + ok( pair_count == 1, "got %u\n", pair_count ); + ok( pair[0].SourceAddress != NULL, "src address not set\n" ); + ok( pair[0].DestinationAddress != NULL, "dst address not set\n" ); + pFreeMibTable( pair ); + + dst[1].sin6_family = AF_INET6; + dst[1].sin6_addr.u.Word[5] = 0xffff; + dst[1].sin6_addr.u.Word[6] = 0x0404; + dst[1].sin6_addr.u.Word[7] = 0x0808; + + pair = NULL; + pair_count = 0xdeadbeef; + ret = pCreateSortedAddressPairs( NULL, 0, dst, 2, 0, &pair, &pair_count ); + ok( ret == NO_ERROR, "got %u\n", ret ); + ok( pair != NULL, "pair not set\n" ); + ok( pair_count == 2, "got %u\n", pair_count ); + ok( pair[0].SourceAddress != NULL, "src address not set\n" ); + ok( pair[0].DestinationAddress != NULL, "dst address not set\n" ); + ok( pair[1].SourceAddress != NULL, "src address not set\n" ); + ok( pair[1].DestinationAddress != NULL, "dst address not set\n" ); + pFreeMibTable( pair ); +} + +static DWORD get_interface_index(void) +{ + DWORD size = 0, ret = 0; + IP_ADAPTER_ADDRESSES *buf, *aa; + + if (pGetAdaptersAddresses( AF_UNSPEC, 0, NULL, NULL, &size ) != ERROR_BUFFER_OVERFLOW) + return 0; + + buf = HeapAlloc( GetProcessHeap(), 0, size ); + pGetAdaptersAddresses( AF_UNSPEC, 0, NULL, buf, &size ); + for (aa = buf; aa; aa = aa->Next) + { + if (aa->IfType == IF_TYPE_ETHERNET_CSMACD) + { + ret = aa->IfIndex; + break; + } + } + HeapFree( GetProcessHeap(), 0, buf ); + return ret; +} + +static void test_interface_identifier_conversion(void) +{ + DWORD ret; + NET_LUID luid; + GUID guid; + SIZE_T len; + WCHAR nameW[IF_MAX_STRING_SIZE + 1]; + char nameA[IF_MAX_STRING_SIZE + 1]; + NET_IFINDEX index; + + if (!pConvertInterfaceIndexToLuid) + { + win_skip( "ConvertInterfaceIndexToLuid not available\n" ); + return; + } + if (!(index = get_interface_index())) + { + skip( "no suitable interface found\n" ); + return; + } + + /* ConvertInterfaceIndexToLuid */ + ret = pConvertInterfaceIndexToLuid( 0, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &luid, 0xff, sizeof(luid) ); + ret = pConvertInterfaceIndexToLuid( 0, &luid ); + ok( ret == ERROR_FILE_NOT_FOUND, "got %u\n", ret ); + ok( !luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); + ok( !luid.Info.NetLuidIndex, "got %u\n", luid.Info.NetLuidIndex ); + ok( !luid.Info.IfType, "got %u\n", luid.Info.IfType ); + + memset( &luid, 0, sizeof(luid) ); + ret = pConvertInterfaceIndexToLuid( index, &luid ); + ok( !ret, "got %u\n", ret ); + ok( !luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); + ok( luid.Info.NetLuidIndex, "got %u\n", luid.Info.NetLuidIndex ); + ok( luid.Info.IfType == IF_TYPE_ETHERNET_CSMACD, "got %u\n", luid.Info.IfType ); + + /* ConvertInterfaceLuidToIndex */ + ret = pConvertInterfaceLuidToIndex( NULL, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToIndex( NULL, &index ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToIndex( &luid, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToIndex( &luid, &index ); + ok( !ret, "got %u\n", ret ); + + /* ConvertInterfaceLuidToGuid */ + ret = pConvertInterfaceLuidToGuid( NULL, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &guid, 0xff, sizeof(guid) ); + ret = pConvertInterfaceLuidToGuid( NULL, &guid ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( guid.Data1 == 0xffffffff, "got %x\n", guid.Data1 ); + + ret = pConvertInterfaceLuidToGuid( &luid, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &guid, 0, sizeof(guid) ); + ret = pConvertInterfaceLuidToGuid( &luid, &guid ); + ok( !ret, "got %u\n", ret ); + ok( guid.Data1, "got %x\n", guid.Data1 ); + + /* ConvertInterfaceGuidToLuid */ + ret = pConvertInterfaceGuidToLuid( NULL, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + luid.Info.NetLuidIndex = 1; + ret = pConvertInterfaceGuidToLuid( NULL, &luid ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( luid.Info.NetLuidIndex == 1, "got %u\n", luid.Info.NetLuidIndex ); + + ret = pConvertInterfaceGuidToLuid( &guid, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &luid, 0, sizeof(luid) ); + ret = pConvertInterfaceGuidToLuid( &guid, &luid ); + ok( !ret, "got %u\n", ret ); + ok( luid.Info.NetLuidIndex, "got %u\n", luid.Info.NetLuidIndex ); + + /* ConvertInterfaceLuidToNameW */ + ret = pConvertInterfaceLuidToNameW( NULL, NULL, 0 ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToNameW( &luid, NULL, 0 ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToNameW( NULL, nameW, 0 ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToNameW( &luid, nameW, 0 ); + ok( ret == ERROR_NOT_ENOUGH_MEMORY, "got %u\n", ret ); + + nameW[0] = 0; + len = sizeof(nameW)/sizeof(nameW[0]); + ret = pConvertInterfaceLuidToNameW( &luid, nameW, len ); + ok( !ret, "got %u\n", ret ); + ok( nameW[0], "name not set\n" ); + + /* ConvertInterfaceLuidToNameA */ + ret = pConvertInterfaceLuidToNameA( NULL, NULL, 0 ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToNameA( &luid, NULL, 0 ); + ok( ret == ERROR_NOT_ENOUGH_MEMORY, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToNameA( NULL, nameA, 0 ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToNameA( &luid, nameA, 0 ); + ok( ret == ERROR_NOT_ENOUGH_MEMORY, "got %u\n", ret ); + + nameA[0] = 0; + len = sizeof(nameA)/sizeof(nameA[0]); + ret = pConvertInterfaceLuidToNameA( &luid, nameA, len ); + ok( !ret, "got %u\n", ret ); + ok( nameA[0], "name not set\n" ); + + /* ConvertInterfaceNameToLuidW */ + ret = pConvertInterfaceNameToLuidW( NULL, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &luid, 0xff, sizeof(luid) ); + ret = pConvertInterfaceNameToLuidW( NULL, &luid ); + ok( ret == ERROR_INVALID_NAME, "got %u\n", ret ); + ok( !luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); + ok( !luid.Info.NetLuidIndex, "got %u\n", luid.Info.NetLuidIndex ); + ok( !luid.Info.IfType, "got %u\n", luid.Info.IfType ); + + ret = pConvertInterfaceNameToLuidW( nameW, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &luid, 0xff, sizeof(luid) ); + ret = pConvertInterfaceNameToLuidW( nameW, &luid ); + ok( !ret, "got %u\n", ret ); + ok( !luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); + ok( luid.Info.NetLuidIndex, "got %u\n", luid.Info.NetLuidIndex ); + ok( luid.Info.IfType == IF_TYPE_ETHERNET_CSMACD, "got %u\n", luid.Info.IfType ); + + /* ConvertInterfaceNameToLuidA */ + ret = pConvertInterfaceNameToLuidA( NULL, NULL ); + ok( ret == ERROR_INVALID_NAME, "got %u\n", ret ); + + memset( &luid, 0xff, sizeof(luid) ); + ret = pConvertInterfaceNameToLuidA( NULL, &luid ); + ok( ret == ERROR_INVALID_NAME, "got %u\n", ret ); + ok( luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); + ok( luid.Info.NetLuidIndex, "got %u\n", luid.Info.NetLuidIndex ); + ok( luid.Info.IfType, "got %u\n", luid.Info.IfType ); + + ret = pConvertInterfaceNameToLuidA( nameA, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &luid, 0xff, sizeof(luid) ); + ret = pConvertInterfaceNameToLuidA( nameA, &luid ); + ok( !ret, "got %u\n", ret ); + ok( !luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); + ok( luid.Info.NetLuidIndex, "got %u\n", luid.Info.NetLuidIndex ); + ok( luid.Info.IfType == IF_TYPE_ETHERNET_CSMACD, "got %u\n", luid.Info.IfType ); +} + +static void test_GetIfEntry2(void) +{ + DWORD ret; + MIB_IF_ROW2 row; + NET_IFINDEX index; + + if (!pGetIfEntry2) + { + win_skip( "GetIfEntry2 not available\n" ); + return; + } + if (!(index = get_interface_index())) + { + skip( "no suitable interface found\n" ); + return; + } + + ret = pGetIfEntry2( NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &row, 0, sizeof(row) ); + ret = pGetIfEntry2( &row ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &row, 0, sizeof(row) ); + row.InterfaceIndex = index; + ret = pGetIfEntry2( &row ); + ok( ret == NO_ERROR, "got %u\n", ret ); + ok( row.InterfaceIndex == index, "got %u\n", index ); + ok( row.InterfaceLuid.Info.NetLuidIndex, "got %u\n", index ); +} + START_TEST(iphlpapi) { @@ -1581,6 +1886,9 @@ test_GetAdaptersAddresses(); test_GetExtendedTcpTable(); test_GetExtendedUdpTable(); + test_CreateSortedAddressPairs(); + test_interface_identifier_conversion(); + test_GetIfEntry2(); freeIPHlpApi(); } } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/kernel32/editline.c wine-staging-1.7.48~ubuntu12.04.1/dlls/kernel32/editline.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/kernel32/editline.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/kernel32/editline.c 2015-07-29 19:28:54.000000000 +0000 @@ -987,6 +987,10 @@ } } + GetConsoleMode(hConsoleIn, &mode); + ctx.insert = (mode & (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS)) == + (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS); + if (func) (func)(&ctx); else if (!(ir.Event.KeyEvent.dwControlKeyState & LEFT_ALT_PRESSED)) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/kernel32/process.c wine-staging-1.7.48~ubuntu12.04.1/dlls/kernel32/process.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/kernel32/process.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/kernel32/process.c 2015-07-29 19:28:54.000000000 +0000 @@ -517,7 +517,7 @@ OBJECT_ATTRIBUTES attr; UNICODE_STRING nameW; WCHAR *profile_dir = NULL, *all_users_dir = NULL; - WCHAR buf[MAX_COMPUTERNAME_LENGTH]; + WCHAR buf[MAX_COMPUTERNAME_LENGTH+1]; HANDLE hkey; DWORD len; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/kernel32/tests/loader.c wine-staging-1.7.48~ubuntu12.04.1/dlls/kernel32/tests/loader.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/kernel32/tests/loader.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/kernel32/tests/loader.c 2015-07-29 19:28:54.000000000 +0000 @@ -68,6 +68,7 @@ static PVOID (WINAPI *pResolveDelayLoadedAPI)(PVOID, PCIMAGE_DELAYLOAD_DESCRIPTOR, PDELAYLOAD_FAILURE_DLL_CALLBACK, PVOID, PIMAGE_THUNK_DATA ThunkAddress,ULONG); +static PVOID (WINAPI *pRtlImageDirectoryEntryToData)(HMODULE,BOOL,WORD,ULONG *); static PVOID RVAToAddr(DWORD_PTR rva, HMODULE module) { @@ -374,6 +375,16 @@ 1, 0, { ERROR_SUCCESS, ERROR_BAD_EXE_FORMAT } /* vista is more strict */ + }, + /* Minimal PE image that Windows7 is able to load: 268 bytes */ + { 0x04, + 0, 0xf0, /* optional header size just forces 0xf0 bytes to be written, + 0 or another number don't change the behaviour, what really + matters is file size regardless of values in the headers */ + 0x04 /* also serves as e_lfanew in the truncated MZ header */, 0x04, + 0x40, /* minimal image size that Windows7 accepts */ + 0, + { ERROR_SUCCESS } } }; int i; @@ -2703,7 +2714,7 @@ return; } - delaydir = RtlImageDirectoryEntryToData(hlib, TRUE, IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT, &file_size); + delaydir = pRtlImageDirectoryEntryToData(hlib, TRUE, IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT, &file_size); if (!delaydir) { skip("haven't found section for delay import directory.\n"); @@ -2783,6 +2794,7 @@ pLdrUnlockLoaderLock = (void *)GetProcAddress(ntdll, "LdrUnlockLoaderLock"); pRtlAcquirePebLock = (void *)GetProcAddress(ntdll, "RtlAcquirePebLock"); pRtlReleasePebLock = (void *)GetProcAddress(ntdll, "RtlReleasePebLock"); + pRtlImageDirectoryEntryToData = (void *)GetProcAddress(ntdll, "RtlImageDirectoryEntryToData"); pResolveDelayLoadedAPI = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "ResolveDelayLoadedAPI"); GetSystemInfo( &si ); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/kernel32/tests/process.c wine-staging-1.7.48~ubuntu12.04.1/dlls/kernel32/tests/process.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/kernel32/tests/process.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/kernel32/tests/process.c 2015-07-29 19:28:54.000000000 +0000 @@ -2452,7 +2452,6 @@ CloseHandle(job); dwret = WaitForSingleObject(pi.hProcess, 1000); - todo_wine ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret); if (dwret == WAIT_TIMEOUT) TerminateProcess(pi.hProcess, 0); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/kernel32/tests/sync.c wine-staging-1.7.48~ubuntu12.04.1/dlls/kernel32/tests/sync.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/kernel32/tests/sync.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/kernel32/tests/sync.c 2015-07-29 19:28:54.000000000 +0000 @@ -64,6 +64,7 @@ HMODULE kernel32; DWORD r; HANDLE event[2], semaphore[2], file; + int i; kernel32 = GetModuleHandleA("kernel32.dll"); pSignalObjectAndWait = (void*) GetProcAddress(kernel32, "SignalObjectAndWait"); @@ -96,9 +97,13 @@ r = pSignalObjectAndWait(event[0], event[1], 0, FALSE); ok( r == WAIT_OBJECT_0, "should succeed\n"); - /* event[0] is now signalled */ - r = pSignalObjectAndWait(event[0], event[0], 0, FALSE); - ok( r == WAIT_OBJECT_0, "should succeed\n"); + /* event[0] is now signalled - we repeat this test multiple times + * to ensure that the wineserver handles this situation properly. */ + for (i = 0; i < 10000; i++) + { + r = pSignalObjectAndWait(event[0], event[0], 0, FALSE); + ok(r == WAIT_OBJECT_0, "should succeed\n"); + } /* event[0] is not signalled */ r = WaitForSingleObject(event[0], 0); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/krnl386.exe16/local.c wine-staging-1.7.48~ubuntu12.04.1/dlls/krnl386.exe16/local.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/krnl386.exe16/local.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/krnl386.exe16/local.c 2015-07-29 19:28:54.000000000 +0000 @@ -998,7 +998,7 @@ */ static BOOL16 LOCAL_NewHTable( HANDLE16 ds ) { - char *ptr = MapSL( MAKESEGPTR( ds, 0 ) ); + char *ptr; LOCALHEAPINFO *pInfo; LOCALHANDLEENTRY *pEntry; HLOCAL16 handle; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/krnl386.exe16/resource.c wine-staging-1.7.48~ubuntu12.04.1/dlls/krnl386.exe16/resource.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/krnl386.exe16/resource.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/krnl386.exe16/resource.c 2015-07-29 19:28:54.000000000 +0000 @@ -1084,7 +1084,7 @@ */ DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc ) { - NE_MODULE *pModule = NE_GetPtr( hModule ); + NE_MODULE *pModule; TRACE("(%x, %x)\n", hModule, hRsrc ); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/mcicda/mcicda.c wine-staging-1.7.48~ubuntu12.04.1/dlls/mcicda/mcicda.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/mcicda/mcicda.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/mcicda/mcicda.c 2015-07-29 19:28:54.000000000 +0000 @@ -655,10 +655,9 @@ if (!ret) { TRACE("=> %s\n", debugstr_w(str)); if (lpParms->dwRetSize) { - WCHAR zero = 0; /* FIXME? Since NT, mciwave, mciseq and mcicda set dwRetSize * to the number of characters written, excluding \0. */ - lstrcpynW(lpParms->lpstrReturn, str ? str : &zero, lpParms->dwRetSize); + lstrcpynW(lpParms->lpstrReturn, str, lpParms->dwRetSize); } else ret = MCIERR_PARAM_OVERFLOW; } if (MMSYSERR_NOERROR==ret && (dwFlags & MCI_NOTIFY)) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/mciseq/mcimidi.c wine-staging-1.7.48~ubuntu12.04.1/dlls/mciseq/mcimidi.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/mciseq/mcimidi.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/mciseq/mcimidi.c 2015-07-29 19:28:54.000000000 +0000 @@ -776,7 +776,7 @@ if (oldstat == MCI_MODE_PAUSE) dwRet = midiOutReset((HMIDIOUT)wmm->hMidi); - if ((dwFlags & MCI_WAIT) && wmm->hThread) + if (wmm->hThread) WaitForSingleObject(wmm->hThread, INFINITE); } @@ -808,7 +808,10 @@ wmm->hFile = 0; TRACE("hFile closed !\n"); } - if (wmm->hThread) CloseHandle(wmm->hThread); + if (wmm->hThread) { + CloseHandle(wmm->hThread); + wmm->hThread = 0; + } HeapFree(GetProcessHeap(), 0, wmm->tracks); HeapFree(GetProcessHeap(), 0, wmm->lpstrElementName); HeapFree(GetProcessHeap(), 0, wmm->lpstrCopyright); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/binding.h wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/binding.h --- wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/binding.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/binding.h 2015-07-29 19:28:54.000000000 +0000 @@ -51,6 +51,7 @@ char *content_type; char *charset; UINT32 response_status; + char *response_status_text; REQUEST_METHOD request_method; struct list response_headers; struct list request_headers; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/mshtml_private.h wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/mshtml_private.h --- wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/mshtml_private.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/mshtml_private.h 2015-07-29 19:28:54.000000000 +0000 @@ -1230,6 +1230,23 @@ return ret; } +static inline char *heap_strndupWtoU(LPCWSTR str, unsigned len) +{ + char *ret = NULL; + DWORD size; + + if(str && len) { + size = WideCharToMultiByte(CP_UTF8, 0, str, len, NULL, 0, NULL, NULL); + ret = heap_alloc(size + 1); + if(ret) { + WideCharToMultiByte(CP_UTF8, 0, str, len, ret, size, NULL, NULL); + ret[size] = '\0'; + } + } + + return ret; +} + static inline void windowref_addref(windowref_t *ref) { InterlockedIncrement(&ref->ref); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/navigate.c wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/navigate.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/navigate.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/navigate.c 2015-07-29 19:28:54.000000000 +0000 @@ -1595,10 +1595,29 @@ return S_OK; } +static HRESULT process_response_status_text(const WCHAR *header, const WCHAR *header_end, char **status_text) +{ + header = strchrW(header + 1, ' '); + if(!header || header >= header_end) + return E_FAIL; + header = strchrW(header + 1, ' '); + if(!header || header >= header_end) + return E_FAIL; + ++header; + + *status_text = heap_strndupWtoU(header, header_end - header); + + if(!*status_text) + return E_OUTOFMEMORY; + + return S_OK; +} + static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code, LPCWSTR response_headers) { nsChannelBSC *This = nsChannelBSC_from_BSCallback(bsc); + char *str; HRESULT hres; This->response_processed = TRUE; @@ -1608,6 +1627,15 @@ const WCHAR *headers; headers = strchrW(response_headers, '\r'); + hres = process_response_status_text(response_headers, headers, &str); + if(FAILED(hres)) { + WARN("parsing headers failed: %08x\n", hres); + return hres; + } + + heap_free(This->nschannel->response_status_text); + This->nschannel->response_status_text = str; + if(headers && headers[1] == '\n') { headers += 2; hres = process_response_headers(This, headers); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/nsio.c wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/nsio.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/nsio.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/nsio.c 2015-07-29 19:28:54.000000000 +0000 @@ -1394,9 +1394,10 @@ { nsChannel *This = impl_from_nsIHttpChannel(iface); - FIXME("(%p)->(%p)\n", This, aResponseStatusText); + TRACE("(%p)->(%p)\n", This, aResponseStatusText); - return NS_ERROR_NOT_IMPLEMENTED; + nsACString_SetData(aResponseStatusText, This->response_status_text); + return NS_OK; } static nsresult NSAPI nsChannel_GetRequestSucceeded(nsIHttpChannel *iface, diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/tests/dom.c wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/tests/dom.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/tests/dom.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/tests/dom.c 2015-07-29 19:28:54.000000000 +0000 @@ -30,6 +30,7 @@ #include "mshtmcid.h" #include "mshtmhst.h" #include "docobj.h" +#include "hlink.h" #include "dispex.h" #include "mshtml_test.h" #include "objsafe.h" @@ -9071,6 +9072,22 @@ test_compatmode(doc, "CSS1Compat"); } +static void test_quirks_mode_offsetHeight(IHTMLDocument2 *doc) +{ + IHTMLElement *elem; + HRESULT hres; + LONG oh; + + hres = IHTMLDocument2_get_body(doc, &elem); + ok(hres == S_OK, "get_body fauled: %08x\n", hres); + + /* body.offsetHeight value depends on window size in quirks mode */ + hres = IHTMLElement_get_offsetHeight(elem, &oh); + ok(hres == S_OK, "get_offsetHeight failed: %08x\n", hres); + todo_wine ok(oh == 500, "offsetHeight = %d\n", oh); + IHTMLElement_Release(elem); +} + static IHTMLDocument2 *notif_doc; static BOOL doc_complete; @@ -9130,6 +9147,395 @@ static IPropertyNotifySink PropertyNotifySink = { &PropertyNotifySinkVtbl }; +static HRESULT cs_qi(REFIID,void **); +static IOleDocumentView *view; +static HWND container_hwnd; + +static HRESULT WINAPI InPlaceFrame_QueryInterface(IOleInPlaceFrame *iface, REFIID riid, void **ppv) +{ + static const GUID undocumented_frame_iid = {0xfbece6c9,0x48d7,0x4a37,{0x8f,0xe3,0x6a,0xd4,0x27,0x2f,0xdd,0xac}}; + + if(!IsEqualGUID(&undocumented_frame_iid, riid)) + ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid)); + + *ppv = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI InPlaceFrame_AddRef(IOleInPlaceFrame *iface) +{ + return 2; +} + +static ULONG WINAPI InPlaceFrame_Release(IOleInPlaceFrame *iface) +{ + return 1; +} + +static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwnd) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame *iface, BOOL fEnterMode) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI InPlaceFrame_GetBorder(IOleInPlaceFrame *iface, LPRECT lprectBorder) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame *iface, + LPCBORDERWIDTHS pborderwidths) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI InPlaceFrame_SetBorderSpace(IOleInPlaceFrame *iface, + LPCBORDERWIDTHS pborderwidths) +{ + return S_OK; +} + +static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface, + IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName) +{ + return S_OK; +} + +static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hmenuShared, + LPOLEMENUGROUPWIDTHS lpMenuWidths) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI InPlaceFrame_SetMenu(IOleInPlaceFrame *iface, HMENU hmenuShared, + HOLEMENU holemenu, HWND hwndActiveObject) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hmenuShared) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface, LPCOLESTR pszStatusText) +{ + return S_OK; +} + +static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame *iface, LPMSG lpmsg, WORD wID) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const IOleInPlaceFrameVtbl InPlaceFrameVtbl = { + InPlaceFrame_QueryInterface, + InPlaceFrame_AddRef, + InPlaceFrame_Release, + InPlaceFrame_GetWindow, + InPlaceFrame_ContextSensitiveHelp, + InPlaceFrame_GetBorder, + InPlaceFrame_RequestBorderSpace, + InPlaceFrame_SetBorderSpace, + InPlaceFrame_SetActiveObject, + InPlaceFrame_InsertMenus, + InPlaceFrame_SetMenu, + InPlaceFrame_RemoveMenus, + InPlaceFrame_SetStatusText, + InPlaceFrame_EnableModeless, + InPlaceFrame_TranslateAccelerator +}; + +static IOleInPlaceFrame InPlaceFrame = { &InPlaceFrameVtbl }; + +static HRESULT WINAPI InPlaceSite_QueryInterface(IOleInPlaceSite *iface, REFIID riid, void **ppv) +{ + return cs_qi(riid, ppv); +} + +static ULONG WINAPI InPlaceSite_AddRef(IOleInPlaceSite *iface) +{ + return 2; +} + +static ULONG WINAPI InPlaceSite_Release(IOleInPlaceSite *iface) +{ + return 1; +} + +static HRESULT WINAPI InPlaceSite_GetWindow(IOleInPlaceSite *iface, HWND *phwnd) +{ + *phwnd = container_hwnd; + return S_OK; +} + +static HRESULT WINAPI InPlaceSite_ContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI InPlaceSite_CanInPlaceActivate(IOleInPlaceSite *iface) +{ + return S_OK; +} + +static HRESULT WINAPI InPlaceSite_OnInPlaceActivate(IOleInPlaceSite *iface) +{ + return S_OK; +} + +static HRESULT WINAPI InPlaceSite_OnUIActivate(IOleInPlaceSite *iface) +{ + return S_OK; +} + +static HRESULT WINAPI InPlaceSite_GetWindowContext(IOleInPlaceSite *iface, + IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, + LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo) +{ + static const RECT rect = {0,0,500,500}; + + *ppFrame = &InPlaceFrame; + *ppDoc = NULL; + *lprcPosRect = rect; + *lprcClipRect = rect; + + lpFrameInfo->fMDIApp = FALSE; + lpFrameInfo->hwndFrame = container_hwnd; + lpFrameInfo->haccel = NULL; + lpFrameInfo->cAccelEntries = 0; + + return S_OK; +} + +static HRESULT WINAPI InPlaceSite_Scroll(IOleInPlaceSite *iface, SIZE scrollExtant) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI InPlaceSite_OnUIDeactivate(IOleInPlaceSite *iface, BOOL fUndoable) +{ + return S_OK; +} + +static HRESULT WINAPI InPlaceSite_OnInPlaceDeactivate(IOleInPlaceSite *iface) +{ + return S_OK; +} + +static HRESULT WINAPI InPlaceSite_DiscardUndoState(IOleInPlaceSite *iface) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI InPlaceSite_DeactivateAndUndo(IOleInPlaceSite *iface) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI InPlaceSite_OnPosRectChange(IOleInPlaceSite *iface, LPCRECT lprcPosRect) +{ + return E_NOTIMPL; +} + +static const IOleInPlaceSiteVtbl InPlaceSiteVtbl = { + InPlaceSite_QueryInterface, + InPlaceSite_AddRef, + InPlaceSite_Release, + InPlaceSite_GetWindow, + InPlaceSite_ContextSensitiveHelp, + InPlaceSite_CanInPlaceActivate, + InPlaceSite_OnInPlaceActivate, + InPlaceSite_OnUIActivate, + InPlaceSite_GetWindowContext, + InPlaceSite_Scroll, + InPlaceSite_OnUIDeactivate, + InPlaceSite_OnInPlaceDeactivate, + InPlaceSite_DiscardUndoState, + InPlaceSite_DeactivateAndUndo, + InPlaceSite_OnPosRectChange, +}; + +static IOleInPlaceSite InPlaceSite = { &InPlaceSiteVtbl }; + +static HRESULT WINAPI ClientSite_QueryInterface(IOleClientSite *iface, REFIID riid, void **ppv) +{ + return cs_qi(riid, ppv); +} + +static ULONG WINAPI ClientSite_AddRef(IOleClientSite *iface) +{ + return 2; +} + +static ULONG WINAPI ClientSite_Release(IOleClientSite *iface) +{ + return 1; +} + +static HRESULT WINAPI ClientSite_SaveObject(IOleClientSite *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI ClientSite_GetMoniker(IOleClientSite *iface, DWORD dwAssign, DWORD dwWhichMoniker, + IMoniker **ppmon) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI ClientSite_GetContainer(IOleClientSite *iface, IOleContainer **ppContainer) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ClientSite_ShowObject(IOleClientSite *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI ClientSite_OnShowWindow(IOleClientSite *iface, BOOL fShow) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI ClientSite_RequestNewObjectLayout(IOleClientSite *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const IOleClientSiteVtbl ClientSiteVtbl = { + ClientSite_QueryInterface, + ClientSite_AddRef, + ClientSite_Release, + ClientSite_SaveObject, + ClientSite_GetMoniker, + ClientSite_GetContainer, + ClientSite_ShowObject, + ClientSite_OnShowWindow, + ClientSite_RequestNewObjectLayout +}; + +static IOleClientSite ClientSite = { &ClientSiteVtbl }; + +static HRESULT WINAPI DocumentSite_QueryInterface(IOleDocumentSite *iface, REFIID riid, void **ppv) +{ + return cs_qi(riid, ppv); +} + +static ULONG WINAPI DocumentSite_AddRef(IOleDocumentSite *iface) +{ + return 2; +} + +static ULONG WINAPI DocumentSite_Release(IOleDocumentSite *iface) +{ + return 1; +} + +static HRESULT WINAPI DocumentSite_ActivateMe(IOleDocumentSite *iface, IOleDocumentView *pViewToActivate) +{ + RECT rect = {0,0,500,500}; + IOleDocument *document; + HRESULT hres; + + hres = IOleDocumentView_QueryInterface(pViewToActivate, &IID_IOleDocument, (void**)&document); + ok(hres == S_OK, "could not get IOleDocument: %08x\n", hres); + + hres = IOleDocument_CreateView(document, &InPlaceSite, NULL, 0, &view); + IOleDocument_Release(document); + ok(hres == S_OK, "CreateView failed: %08x\n", hres); + + hres = IOleDocumentView_SetInPlaceSite(view, &InPlaceSite); + ok(hres == S_OK, "SetInPlaceSite failed: %08x\n", hres); + + hres = IOleDocumentView_UIActivate(view, TRUE); + ok(hres == S_OK, "UIActivate failed: %08x\n", hres); + + hres = IOleDocumentView_SetRect(view, &rect); + ok(hres == S_OK, "SetRect failed: %08x\n", hres); + + hres = IOleDocumentView_Show(view, TRUE); + ok(hres == S_OK, "Show failed: %08x\n", hres); + + return S_OK; +} + +static const IOleDocumentSiteVtbl DocumentSiteVtbl = { + DocumentSite_QueryInterface, + DocumentSite_AddRef, + DocumentSite_Release, + DocumentSite_ActivateMe +}; + +static IOleDocumentSite DocumentSite = { &DocumentSiteVtbl }; + +static HRESULT cs_qi(REFIID riid, void **ppv) +{ + *ppv = NULL; + + if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IOleClientSite, riid)) + *ppv = &ClientSite; + else if(IsEqualGUID(&IID_IOleDocumentSite, riid)) + *ppv = &DocumentSite; + else if(IsEqualGUID(&IID_IOleWindow, riid) || IsEqualGUID(&IID_IOleInPlaceSite, riid)) + *ppv = &InPlaceSite; + + return *ppv ? S_OK : E_NOINTERFACE; +} + +static void set_client_site(IHTMLDocument2 *doc, BOOL set) +{ + IOleObject *oleobj; + HRESULT hres; + + if(!set && view) { + IOleDocumentView_Show(view, FALSE); + IOleDocumentView_CloseView(view, 0); + IOleDocumentView_SetInPlaceSite(view, NULL); + IOleDocumentView_Release(view); + view = NULL; + } + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IOleObject, (void**)&oleobj); + ok(hres == S_OK, "Could not et IOleObject: %08x\n", hres); + + hres = IOleObject_SetClientSite(oleobj, set ? &ClientSite : NULL); + ok(hres == S_OK, "SetClientSite failed: %08x\n", hres); + + if(set) { + IHlinkTarget *hlink; + + hres = IOleObject_QueryInterface(oleobj, &IID_IHlinkTarget, (void**)&hlink); + ok(hres == S_OK, "Could not get IHlinkTarget iface: %08x\n", hres); + + hres = IHlinkTarget_Navigate(hlink, 0, NULL); + ok(hres == S_OK, "Navgate failed: %08x\n", hres); + + IHlinkTarget_Release(hlink); + } + + IOleObject_Release(oleobj); +} + static IHTMLDocument2 *create_doc_with_string(const char *str) { IPersistStreamInit *init; @@ -9188,6 +9594,7 @@ if(!doc) return; + set_client_site(doc, TRUE); do_advise((IUnknown*)doc, &IID_IPropertyNotifySink, (IUnknown*)&PropertyNotifySink); while(!doc_complete && GetMessageW(&msg, NULL, 0, 0)) { @@ -9197,6 +9604,7 @@ test(doc); + set_client_site(doc, FALSE); ref = IHTMLDocument2_Release(doc); ok(!ref || broken(ref == 1), /* Vista */ "ref = %d\n", ref); @@ -9207,6 +9615,7 @@ run_domtest("", check_quirks_mode); run_domtest("\n", check_strict_mode); run_domtest("\n", check_quirks_mode); + run_domtest("", test_quirks_mode_offsetHeight); } START_TEST(dom) @@ -9216,6 +9625,8 @@ pGetUserDefaultUILanguage = (void*)GetProcAddress(hkernel32, "GetUserDefaultUILanguage"); CoInitialize(NULL); + container_hwnd = CreateWindowA("static", NULL, WS_POPUP|WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, 500, 500, NULL, NULL, NULL, NULL); run_domtest(doc_str1, test_doc_elem); run_domtest(doc_str1, test_get_set_attr); @@ -9241,5 +9652,6 @@ test_quirks_mode(); + DestroyWindow(container_hwnd); CoUninitialize(); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/tests/xmlhttprequest.c wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/tests/xmlhttprequest.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/tests/xmlhttprequest.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/tests/xmlhttprequest.c 2015-07-29 19:28:54.000000000 +0000 @@ -395,6 +395,7 @@ return; } + VariantInit(&var); hres = IHTMLWindow5_get_XMLHttpRequest(window5, &var); IHTMLWindow5_Release(window5); ok(hres == S_OK, "get_XMLHttpRequest failed: %08x\n", hres); @@ -448,12 +449,12 @@ ok(val == 0, "Expect UNSENT, got %d\n", val); hres = IHTMLXMLHttpRequest_get_status(xhr, NULL); - todo_wine ok(hres == E_POINTER, "Expect E_POINTER, got %08x\n", hres); + ok(hres == E_POINTER, "Expect E_POINTER, got %08x\n", hres); val = 0xdeadbeef; hres = IHTMLXMLHttpRequest_get_status(xhr, &val); - todo_wine ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); - todo_wine ok(val == 0, "Expect 0, got %d\n", val); + ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); + ok(val == 0, "Expect 0, got %d\n", val); hres = IHTMLXMLHttpRequest_get_statusText(xhr, NULL); todo_wine ok(hres == E_POINTER, "Expect E_POINTER, got %08x\n", hres); @@ -560,8 +561,8 @@ val = 0xdeadbeef; hres = IHTMLXMLHttpRequest_get_status(xhr, &val); - todo_wine ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); - todo_wine ok(val == 0, "Expect 0, got %d\n", val); + ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); + ok(val == 0, "Expect 0, got %d\n", val); text = (BSTR)0xdeadbeef; hres = IHTMLXMLHttpRequest_get_statusText(xhr, &text); @@ -595,8 +596,8 @@ val = 0xdeadbeef; hres = IHTMLXMLHttpRequest_get_status(xhr, &val); - todo_wine ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); - todo_wine ok(val == 0, "Expect 0, got %d\n", val); + ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); + ok(val == 0, "Expect 0, got %d\n", val); hres = IHTMLXMLHttpRequest_get_statusText(xhr, &text); todo_wine ok(hres == E_FAIL, "Expect E_FAIL, got: %08x\n", hres); @@ -629,8 +630,8 @@ val = 0xdeadbeef; hres = IHTMLXMLHttpRequest_get_status(xhr, &val); - todo_wine ok(hres == S_OK, "get_status failed: %08x\n", hres); - todo_wine ok(val == 200, "Expect 200, got %d\n", val); + ok(hres == S_OK, "get_status failed: %08x\n", hres); + ok(val == 200, "Expect 200, got %d\n", val); text = NULL; hres = IHTMLXMLHttpRequest_get_statusText(xhr, &text); @@ -646,9 +647,9 @@ text = NULL; hres = IHTMLXMLHttpRequest_get_responseText(xhr, &text); - todo_wine ok(hres == S_OK, "get_responseText failed: %08x\n", hres); - todo_wine ok(text != NULL, "test == NULL\n"); - todo_wine ok(!strcmp_wa(text, EXPECT_RESPONSE_TEXT), "expect %s, got %s\n", + ok(hres == S_OK, "get_responseText failed: %08x\n", hres); + ok(text != NULL, "test == NULL\n"); + ok(!strcmp_wa(text, EXPECT_RESPONSE_TEXT), "expect %s, got %s\n", EXPECT_RESPONSE_TEXT, wine_dbgstr_w(text)); SysFreeString(text); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/xmlhttprequest.c wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/xmlhttprequest.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/mshtml/xmlhttprequest.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/mshtml/xmlhttprequest.c 2015-07-29 19:28:54.000000000 +0000 @@ -289,8 +289,17 @@ static HRESULT WINAPI HTMLXMLHttpRequest_get_responseText(IHTMLXMLHttpRequest *iface, BSTR *p) { HTMLXMLHttpRequest *This = impl_from_IHTMLXMLHttpRequest(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString nsstr; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + if(!p) + return E_POINTER; + + nsAString_Init(&nsstr, NULL); + nsres = nsIXMLHttpRequest_GetResponseText(This->nsxhr, &nsstr); + return return_nsstr(nsres, &nsstr, p); } static HRESULT WINAPI HTMLXMLHttpRequest_get_responseXML(IHTMLXMLHttpRequest *iface, IDispatch **p) @@ -303,8 +312,23 @@ static HRESULT WINAPI HTMLXMLHttpRequest_get_status(IHTMLXMLHttpRequest *iface, LONG *p) { HTMLXMLHttpRequest *This = impl_from_IHTMLXMLHttpRequest(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + DWORD val; + nsresult nsres; + TRACE("(%p)->(%p)\n", This, p); + + if(!p) + return E_POINTER; + + nsres = nsIXMLHttpRequest_GetStatus(This->nsxhr, &val); + if(NS_FAILED(nsres)) { + ERR("nsIXMLHttpRequest_GetStatus failed: %08x\n", nsres); + return E_FAIL; + } + *p = val; + if(val == 0) + return E_FAIL; /* WinAPI thinks this is an error */ + + return S_OK; } static HRESULT WINAPI HTMLXMLHttpRequest_get_statusText(IHTMLXMLHttpRequest *iface, BSTR *p) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/msi/action.c wine-staging-1.7.48~ubuntu12.04.1/dlls/msi/action.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/msi/action.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/msi/action.c 2015-07-29 19:28:54.000000000 +0000 @@ -2633,9 +2633,8 @@ return view; } -static HKEY open_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path, BOOL create ) +static HKEY open_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path, BOOL create, REGSAM access ) { - REGSAM access = KEY_ALL_ACCESS; WCHAR *subkey, *p, *q; HKEY hkey, ret = NULL; LONG res; @@ -2657,7 +2656,7 @@ } if (q && q[1]) { - ret = open_key( comp, hkey, q + 1, create ); + ret = open_key( comp, hkey, q + 1, create, access ); RegCloseKey( hkey ); } else ret = hkey; @@ -2882,7 +2881,7 @@ strcpyW(uikey,szRoot); strcatW(uikey,deformated); - if (!(hkey = open_key( comp, root_key, deformated, TRUE ))) + if (!(hkey = open_key( comp, root_key, deformated, TRUE, KEY_QUERY_VALUE | KEY_SET_VALUE ))) { ERR("Could not create key %s\n", debugstr_w(deformated)); msi_free(uikey); @@ -2973,13 +2972,17 @@ access |= get_registry_view( comp ); if (!(subkey = strdupW( path ))) return; - for (;;) + do { - if ((p = strrchrW( subkey, '\\' ))) *p = 0; - hkey = open_key( comp, root, subkey, FALSE ); - if (!hkey) break; - if (p && p[1]) + if ((p = strrchrW( subkey, '\\' ))) + { + *p = 0; + if (!p[1]) continue; /* trailing backslash */ + hkey = open_key( comp, root, subkey, FALSE, access ); + if (!hkey) break; res = RegDeleteKeyExW( hkey, p + 1, access, 0 ); + RegCloseKey( hkey ); + } else res = RegDeleteKeyExW( root, subkey, access, 0 ); if (res) @@ -2987,9 +2990,7 @@ TRACE("failed to delete key %s (%d)\n", debugstr_w(subkey), res); break; } - if (p && p[1]) RegCloseKey( hkey ); - else break; - } + } while (p); msi_free( subkey ); } @@ -2999,7 +3000,7 @@ HKEY hkey; DWORD num_subkeys, num_values; - if ((hkey = open_key( comp, root, path, FALSE ))) + if ((hkey = open_key( comp, root, path, FALSE, KEY_SET_VALUE | KEY_QUERY_VALUE ))) { if ((res = RegDeleteValueW( hkey, value ))) TRACE("failed to delete value %s (%d)\n", debugstr_w(value), res); @@ -3020,7 +3021,7 @@ LONG res; HKEY hkey; - if (!(hkey = open_key( comp, root, path, FALSE ))) return; + if (!(hkey = open_key( comp, root, path, FALSE, KEY_ALL_ACCESS ))) return; res = RegDeleteTreeW( hkey, NULL ); if (res) TRACE("failed to delete subtree of %s (%d)\n", debugstr_w(path), res); delete_key( comp, root, path ); @@ -3553,7 +3554,9 @@ if (!comp->KeyPath || !(file = msi_get_loaded_file(package, comp->KeyPath))) continue; - row = MSI_QueryGetRecord(package->db, query, file->Sequence); + if (!(row = MSI_QueryGetRecord(package->db, query, file->Sequence))) + return ERROR_FUNCTION_FAILED; + sprintfW(source, fmt, MSI_RecordGetInteger(row, 1)); ptr2 = strrchrW(source, '\\') + 1; msiobj_release(&row->hdr); @@ -5873,8 +5876,8 @@ if (image_path != file->TargetPath) msi_free(image_path); done: - CloseServiceHandle(service); - CloseServiceHandle(hscm); + if (service) CloseServiceHandle(service); + if (hscm) CloseServiceHandle(hscm); msi_free(name); msi_free(disp); msi_free(sd.lpDescription); @@ -6048,8 +6051,8 @@ msi_ui_actiondata( package, szStartServices, uirow ); msiobj_release( &uirow->hdr ); - CloseServiceHandle(service); - CloseServiceHandle(scm); + if (service) CloseServiceHandle(service); + if (scm) CloseServiceHandle(scm); msi_free(name); msi_free(args); @@ -6158,8 +6161,8 @@ WARN("Failed to stop service (%s): %d\n", debugstr_w(name), GetLastError()); done: - CloseServiceHandle(service); - CloseServiceHandle(scm); + if (service) CloseServiceHandle(service); + if (scm) CloseServiceHandle(scm); return ERROR_SUCCESS; } @@ -6296,8 +6299,8 @@ msi_ui_actiondata( package, szDeleteServices, uirow ); msiobj_release( &uirow->hdr ); - CloseServiceHandle( service ); - CloseServiceHandle( scm ); + if (service) CloseServiceHandle( service ); + if (scm) CloseServiceHandle( scm ); msi_free( name ); msi_free( display_name ); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/msi/msi.c wine-staging-1.7.48~ubuntu12.04.1/dlls/msi/msi.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/msi/msi.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/msi/msi.c 2015-07-29 19:28:54.000000000 +0000 @@ -4316,6 +4316,17 @@ } /*********************************************************************** + * MsiJoinTransaction [MSI.@] + */ +UINT WINAPI MsiJoinTransaction( MSIHANDLE handle, DWORD attrs, HANDLE *event ) +{ + FIXME("%u %08x %p\n", handle, attrs, event); + + *event = (HANDLE)0xdeadbeef; + return ERROR_SUCCESS; +} + +/*********************************************************************** * MsiEndTransaction [MSI.@] */ UINT WINAPI MsiEndTransaction( DWORD state ) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/msi/msi.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/msi/msi.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/msi/msi.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/msi/msi.spec 2015-07-29 19:28:54.000000000 +0000 @@ -280,7 +280,7 @@ 284 stdcall MsiBeginTransactionA(str long ptr ptr) 285 stdcall MsiBeginTransactionW(wstr long ptr ptr) 286 stdcall MsiEndTransaction(long) -287 stub MsiJoinTransaction +287 stdcall MsiJoinTransaction(long long ptr) 288 stub MsiSetOfflineContextW 289 stdcall MsiEnumComponentsExA(str long long ptr ptr ptr ptr) 290 stdcall MsiEnumComponentsExW(wstr long long ptr ptr ptr ptr) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/msi/table.c wine-staging-1.7.48~ubuntu12.04.1/dlls/msi/table.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/msi/table.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/msi/table.c 2015-07-29 19:28:54.000000000 +0000 @@ -809,7 +809,7 @@ /* add each column to the _Columns table */ r = TABLE_CreateView( db, szColumns, &tv ); if( r ) - return r; + goto err; r = tv->ops->execute( tv, 0 ); TRACE("tv execute returned %x\n", r); @@ -2325,8 +2325,7 @@ } static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string_table *st, - IStorage *stg, - const BYTE *rawdata, UINT bytes_per_strref ) + IStorage *stg, const BYTE *rawdata, UINT bytes_per_strref ) { UINT i, val, ofs = 0; USHORT mask; @@ -2359,12 +2358,14 @@ r = msi_record_encoded_stream_name( tv, rec, &encname ); if ( r != ERROR_SUCCESS ) + { + msiobj_release( &rec->hdr ); return NULL; - - r = IStorage_OpenStream( stg, encname, NULL, - STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stm ); + } + r = IStorage_OpenStream( stg, encname, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stm ); if ( r != ERROR_SUCCESS ) { + msiobj_release( &rec->hdr ); msi_free( encname ); return NULL; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/msi/tests/msi.c wine-staging-1.7.48~ubuntu12.04.1/dlls/msi/tests/msi.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/msi/tests/msi.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/msi/tests/msi.c 2015-07-29 19:28:54.000000000 +0000 @@ -50,6 +50,8 @@ static INSTALLSTATE (WINAPI *pMsiGetComponentPathA) (LPCSTR, LPCSTR, LPSTR, DWORD*); +static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA) + (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD); static INSTALLSTATE (WINAPI *pMsiProvideComponentA) (LPCSTR, LPCSTR, LPCSTR, DWORD, LPSTR, LPDWORD); static INSTALLSTATE (WINAPI *pMsiProvideComponentW) @@ -92,6 +94,7 @@ trace("GetProcAddress(%s) failed\n", #func); GET_PROC(hmsi, MsiGetComponentPathA) + GET_PROC(hmsi, MsiGetComponentPathExA); GET_PROC(hmsi, MsiProvideComponentA) GET_PROC(hmsi, MsiProvideComponentW) GET_PROC(hmsi, MsiGetFileHashA) @@ -14425,7 +14428,8 @@ test_lastusedsource(); test_setpropertyfolder(); test_sourcedir_props(); - test_concurrentinstall(); + if (pMsiGetComponentPathExA) + test_concurrentinstall(); test_command_line_parsing(); SetCurrentDirectoryA(prev_path); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/msi/tests/package.c wine-staging-1.7.48~ubuntu12.04.1/dlls/msi/tests/package.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/msi/tests/package.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/msi/tests/package.c 2015-07-29 19:28:54.000000000 +0000 @@ -3414,7 +3414,7 @@ /* reinstall the product */ r = MsiInstallProductA(msifile3, "REINSTALL=ALL"); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(r == ERROR_SUCCESS || broken(r == ERROR_INSTALL_FAILURE) /* win2k3 */, "Expected ERROR_SUCCESS, got %d\n", r); state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "five"); ok(state == INSTALLSTATE_UNKNOWN, "state = %d\n", state); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/msvcirt/msvcirt.c wine-staging-1.7.48~ubuntu12.04.1/dlls/msvcirt/msvcirt.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/msvcirt/msvcirt.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/msvcirt/msvcirt.c 2015-07-29 19:28:54.000000000 +0000 @@ -30,6 +30,32 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcirt); #define RESERVE_SIZE 512 +#define STATEBUF_SIZE 8 + +/* ?adjustfield@ios@@2JB */ +const LONG ios_adjustfield = FLAGS_left | FLAGS_right | FLAGS_internal; +/* ?basefield@ios@@2JB */ +const LONG ios_basefield = FLAGS_dec | FLAGS_oct | FLAGS_hex; +/* ?floatfield@ios@@2JB */ +const LONG ios_floatfield = FLAGS_scientific | FLAGS_fixed; +/* ?fLockcInit@ios@@0HA */ +/* FIXME: should be initialized to 0 and increased on construction of cin, cout, cerr and clog */ +int ios_fLockcInit = 4; +/* ?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A */ +extern CRITICAL_SECTION ios_static_lock; +CRITICAL_SECTION_DEBUG ios_static_lock_debug = +{ + 0, 0, &ios_static_lock, + { &ios_static_lock_debug.ProcessLocksList, &ios_static_lock_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": ios_static_lock") } +}; +CRITICAL_SECTION ios_static_lock = { &ios_static_lock_debug, -1, 0, 0, 0, 0 }; +/* ?x_maxbit@ios@@0JA */ +LONG ios_maxbit = 0x8000; +/* ?x_curindex@ios@@0HA */ +int ios_curindex = -1; +/* ?x_statebuf@ios@@0PAJA */ +LONG ios_statebuf[STATEBUF_SIZE] = {0}; /* class streambuf */ typedef struct { @@ -72,6 +98,12 @@ } ios; ios* __thiscall ios_assign(ios*, const ios*); +int __thiscall ios_fail(const ios*); +void __cdecl ios_lock(ios*); +void __cdecl ios_lockc(void); +LONG __thiscall ios_setf_mask(ios*, LONG, LONG); +void __cdecl ios_unlock(ios*); +void __cdecl ios_unlockc(void); /* class ostream */ typedef struct _ostream { @@ -712,6 +744,7 @@ ios* __thiscall ios_copy_ctor(ios *this, const ios *copy) { TRACE("(%p %p)\n", this, copy); + ios_fLockcInit++; this->vtable = &MSVCP_ios_vtable; this->sb = NULL; this->delbuf = 0; @@ -725,6 +758,7 @@ ios* __thiscall ios_sb_ctor(ios *this, streambuf *sb) { TRACE("(%p %p)\n", this, sb); + ios_fLockcInit++; this->vtable = &MSVCP_ios_vtable; this->sb = sb; this->state = sb ? IOSTATE_goodbit : IOSTATE_badbit; @@ -754,6 +788,7 @@ void __thiscall ios_dtor(ios *this) { TRACE("(%p)\n", this); + ios_fLockcInit--; if (this->delbuf && this->sb) call_streambuf_vector_dtor(this->sb, 1); this->sb = NULL; @@ -783,8 +818,8 @@ DEFINE_THISCALL_WRAPPER(ios_op_not, 4) int __thiscall ios_op_not(const ios *this) { - FIXME("(%p) stub\n", this); - return 0; + TRACE("(%p)\n", this); + return ios_fail(this); } /* ??Bios@@QBEPAXXZ */ @@ -792,8 +827,8 @@ DEFINE_THISCALL_WRAPPER(ios_op_void, 4) void* __thiscall ios_op_void(const ios *this) { - FIXME("(%p) stub\n", this); - return NULL; + TRACE("(%p)\n", this); + return ios_fail(this) ? NULL : (void*)this; } /* ??_Eios@@UAEPAXI@Z */ @@ -831,15 +866,18 @@ DEFINE_THISCALL_WRAPPER(ios_bad, 4) int __thiscall ios_bad(const ios *this) { - FIXME("(%p) stub\n", this); - return 0; + TRACE("(%p)\n", this); + return (this->state & IOSTATE_badbit); } /* ?bitalloc@ios@@SAJXZ */ LONG __cdecl ios_bitalloc(void) { - FIXME("() stub\n"); - return 0; + TRACE("()\n"); + ios_lockc(); + ios_maxbit <<= 1; + ios_unlockc(); + return ios_maxbit; } /* ?clear@ios@@QAEXH@Z */ @@ -847,14 +885,21 @@ DEFINE_THISCALL_WRAPPER(ios_clear, 8) void __thiscall ios_clear(ios *this, int state) { - FIXME("(%p %d) stub\n", this, state); + TRACE("(%p %d)\n", this, state); + ios_lock(this); + this->state = state; + ios_unlock(this); } /* ?clrlock@ios@@QAAXXZ */ /* ?clrlock@ios@@QEAAXXZ */ void __cdecl ios_clrlock(ios *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + if (this->do_lock <= 0) + this->do_lock++; + if (this->sb) + streambuf_clrlock(this->sb); } /* ?delbuf@ios@@QAEXH@Z */ @@ -862,7 +907,8 @@ DEFINE_THISCALL_WRAPPER(ios_delbuf_set, 8) void __thiscall ios_delbuf_set(ios *this, int delete) { - FIXME("(%p %d) stub\n", this, delete); + TRACE("(%p %d)\n", this, delete); + this->delbuf = delete; } /* ?delbuf@ios@@QBEHXZ */ @@ -870,15 +916,16 @@ DEFINE_THISCALL_WRAPPER(ios_delbuf_get, 4) int __thiscall ios_delbuf_get(const ios *this) { - FIXME("(%p) stub\n", this); - return 0; + TRACE("(%p)\n", this); + return this->delbuf; } /* ?dec@@YAAAVios@@AAV1@@Z */ /* ?dec@@YAAEAVios@@AEAV1@@Z */ ios* __cdecl ios_dec(ios *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + ios_setf_mask(this, FLAGS_dec, ios_basefield); return this; } @@ -887,8 +934,8 @@ DEFINE_THISCALL_WRAPPER(ios_eof, 4) int __thiscall ios_eof(const ios *this) { - FIXME("(%p) stub\n", this); - return 0; + TRACE("(%p)\n", this); + return (this->state & IOSTATE_eofbit); } /* ?fail@ios@@QBEHXZ */ @@ -896,8 +943,8 @@ DEFINE_THISCALL_WRAPPER(ios_fail, 4) int __thiscall ios_fail(const ios *this) { - FIXME("(%p) stub\n", this); - return 0; + TRACE("(%p)\n", this); + return (this->state & (IOSTATE_failbit|IOSTATE_badbit)); } /* ?fill@ios@@QAEDD@Z */ @@ -905,8 +952,12 @@ DEFINE_THISCALL_WRAPPER(ios_fill_set, 8) char __thiscall ios_fill_set(ios *this, char fill) { - FIXME("(%p %d) stub\n", this, fill); - return EOF; + char prev = this->fill; + + TRACE("(%p %d)\n", this, fill); + + this->fill = fill; + return prev; } /* ?fill@ios@@QBEDXZ */ @@ -914,8 +965,8 @@ DEFINE_THISCALL_WRAPPER(ios_fill_get, 4) char __thiscall ios_fill_get(const ios *this) { - FIXME("(%p) stub\n", this); - return EOF; + TRACE("(%p)\n", this); + return this->fill; } /* ?flags@ios@@QAEJJ@Z */ @@ -923,8 +974,12 @@ DEFINE_THISCALL_WRAPPER(ios_flags_set, 8) LONG __thiscall ios_flags_set(ios *this, LONG flags) { - FIXME("(%p %x) stub\n", this, flags); - return 0; + LONG prev = this->flags; + + TRACE("(%p %x)\n", this, flags); + + this->flags = flags; + return prev; } /* ?flags@ios@@QBEJXZ */ @@ -932,8 +987,8 @@ DEFINE_THISCALL_WRAPPER(ios_flags_get, 4) LONG __thiscall ios_flags_get(const ios *this) { - FIXME("(%p) stub\n", this); - return 0; + TRACE("(%p)\n", this); + return this->flags; } /* ?good@ios@@QBEHXZ */ @@ -941,15 +996,16 @@ DEFINE_THISCALL_WRAPPER(ios_good, 4) int __thiscall ios_good(const ios *this) { - FIXME("(%p) stub\n", this); - return 0; + TRACE("(%p)\n", this); + return this->state == IOSTATE_goodbit; } /* ?hex@@YAAAVios@@AAV1@@Z */ /* ?hex@@YAAEAVios@@AEAV1@@Z */ ios* __cdecl ios_hex(ios *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + ios_setf_mask(this, FLAGS_hex, ios_basefield); return this; } @@ -973,28 +1029,32 @@ DEFINE_THISCALL_WRAPPER(ios_iword, 8) LONG* __thiscall ios_iword(const ios *this, int index) { - FIXME("(%p %d) stub\n", this, index); - return NULL; + TRACE("(%p %d)\n", this, index); + return &ios_statebuf[index]; } /* ?lock@ios@@QAAXXZ */ /* ?lock@ios@@QEAAXXZ */ void __cdecl ios_lock(ios *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + if (this->do_lock < 0) + EnterCriticalSection(&this->lock); } /* ?lockbuf@ios@@QAAXXZ */ /* ?lockbuf@ios@@QEAAXXZ */ void __cdecl ios_lockbuf(ios *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + streambuf_lock(this->sb); } /* ?lockc@ios@@KAXXZ */ void __cdecl ios_lockc(void) { - FIXME("() stub\n"); + TRACE("()\n"); + EnterCriticalSection(&ios_static_lock); } /* ?lockptr@ios@@IAEPAU_CRT_CRITICAL_SECTION@@XZ */ @@ -1002,15 +1062,16 @@ DEFINE_THISCALL_WRAPPER(ios_lockptr, 4) CRITICAL_SECTION* __thiscall ios_lockptr(ios *this) { - FIXME("(%p) stub\n", this); - return NULL; + TRACE("(%p)\n", this); + return &this->lock; } /* ?oct@@YAAAVios@@AAV1@@Z */ /* ?oct@@YAAEAVios@@AEAV1@@Z */ ios* __cdecl ios_oct(ios *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + ios_setf_mask(this, FLAGS_oct, ios_basefield); return this; } @@ -1019,8 +1080,12 @@ DEFINE_THISCALL_WRAPPER(ios_precision_set, 8) int __thiscall ios_precision_set(ios *this, int prec) { - FIXME("(%p %d) stub\n", this, prec); - return 0; + int prev = this->precision; + + TRACE("(%p %d)\n", this, prec); + + this->precision = prec; + return prev; } /* ?precision@ios@@QBEHXZ */ @@ -1028,8 +1093,8 @@ DEFINE_THISCALL_WRAPPER(ios_precision_get, 4) int __thiscall ios_precision_get(const ios *this) { - FIXME("(%p) stub\n", this); - return 0; + TRACE("(%p)\n", this); + return this->precision; } /* ?pword@ios@@QBEAAPAXH@Z */ @@ -1037,8 +1102,8 @@ DEFINE_THISCALL_WRAPPER(ios_pword, 8) void** __thiscall ios_pword(const ios *this, int index) { - FIXME("(%p %d) stub\n", this, index); - return NULL; + TRACE("(%p %d)\n", this, index); + return (void**)&ios_statebuf[index]; } /* ?rdbuf@ios@@QBEPAVstreambuf@@XZ */ @@ -1046,8 +1111,8 @@ DEFINE_THISCALL_WRAPPER(ios_rdbuf, 4) streambuf* __thiscall ios_rdbuf(const ios *this) { - FIXME("(%p) stub\n", this); - return NULL; + TRACE("(%p)\n", this); + return this->sb; } /* ?rdstate@ios@@QBEHXZ */ @@ -1055,8 +1120,8 @@ DEFINE_THISCALL_WRAPPER(ios_rdstate, 4) int __thiscall ios_rdstate(const ios *this) { - FIXME("(%p) stub\n", this); - return 0; + TRACE("(%p)\n", this); + return this->state; } /* ?setf@ios@@QAEJJ@Z */ @@ -1064,8 +1129,14 @@ DEFINE_THISCALL_WRAPPER(ios_setf, 8) LONG __thiscall ios_setf(ios *this, LONG flags) { - FIXME("(%p %x) stub\n", this, flags); - return 0; + LONG prev = this->flags; + + TRACE("(%p %x)\n", this, flags); + + ios_lock(this); + this->flags |= flags; + ios_unlock(this); + return prev; } /* ?setf@ios@@QAEJJJ@Z */ @@ -1073,15 +1144,24 @@ DEFINE_THISCALL_WRAPPER(ios_setf_mask, 12) LONG __thiscall ios_setf_mask(ios *this, LONG flags, LONG mask) { - FIXME("(%p %x %x) stub\n", this, flags, mask); - return 0; + LONG prev = this->flags; + + TRACE("(%p %x %x)\n", this, flags, mask); + + ios_lock(this); + this->flags = (this->flags & (~mask)) | (flags & mask); + ios_unlock(this); + return prev; } /* ?setlock@ios@@QAAXXZ */ /* ?setlock@ios@@QEAAXXZ */ void __cdecl ios_setlock(ios *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + this->do_lock--; + if (this->sb) + streambuf_setlock(this->sb); } /* ?sync_with_stdio@ios@@SAXXZ */ @@ -1095,8 +1175,12 @@ DEFINE_THISCALL_WRAPPER(ios_tie_set, 8) ostream* __thiscall ios_tie_set(ios *this, ostream *ostr) { - FIXME("(%p %p) stub\n", this, ostr); - return NULL; + ostream *prev = this->tie; + + TRACE("(%p %p)\n", this, ostr); + + this->tie = ostr; + return prev; } /* ?tie@ios@@QBEPAVostream@@XZ */ @@ -1104,28 +1188,32 @@ DEFINE_THISCALL_WRAPPER(ios_tie_get, 4) ostream* __thiscall ios_tie_get(const ios *this) { - FIXME("(%p) stub\n", this); - return NULL; + TRACE("(%p)\n", this); + return this->tie; } /* ?unlock@ios@@QAAXXZ */ /* ?unlock@ios@@QEAAXXZ */ void __cdecl ios_unlock(ios *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + if (this->do_lock < 0) + LeaveCriticalSection(&this->lock); } /* ?unlockbuf@ios@@QAAXXZ */ /* ?unlockbuf@ios@@QEAAXXZ */ void __cdecl ios_unlockbuf(ios *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + streambuf_unlock(this->sb); } /* ?unlockc@ios@@KAXXZ */ void __cdecl ios_unlockc(void) { - FIXME("() stub\n"); + TRACE("()\n"); + LeaveCriticalSection(&ios_static_lock); } /* ?unsetf@ios@@QAEJJ@Z */ @@ -1133,8 +1221,14 @@ DEFINE_THISCALL_WRAPPER(ios_unsetf, 8) LONG __thiscall ios_unsetf(ios *this, LONG flags) { - FIXME("(%p %x) stub\n", this, flags); - return 0; + LONG prev = this->flags; + + TRACE("(%p %x)\n", this, flags); + + ios_lock(this); + this->flags &= ~flags; + ios_unlock(this); + return prev; } /* ?width@ios@@QAEHH@Z */ @@ -1142,8 +1236,12 @@ DEFINE_THISCALL_WRAPPER(ios_width_set, 8) int __thiscall ios_width_set(ios *this, int width) { - FIXME("(%p %d) stub\n", this, width); - return 0; + int prev = this->width; + + TRACE("(%p %d)\n", this, width); + + this->width = width; + return prev; } /* ?width@ios@@QBEHXZ */ @@ -1151,15 +1249,21 @@ DEFINE_THISCALL_WRAPPER(ios_width_get, 4) int __thiscall ios_width_get(const ios *this) { - FIXME("(%p) stub\n", this); - return 0; + TRACE("(%p)\n", this); + return this->width; } /* ?xalloc@ios@@SAHXZ */ int __cdecl ios_xalloc(void) { - FIXME("() stub\n"); - return 0; + int ret; + + TRACE("()\n"); + + ios_lockc(); + ret = (ios_curindex < STATEBUF_SIZE-1) ? ++ios_curindex : -1; + ios_unlockc(); + return ret; } /****************************************************************** diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/msvcirt/msvcirt.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/msvcirt/msvcirt.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/msvcirt/msvcirt.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/msvcirt/msvcirt.spec 2015-07-29 19:28:54.000000000 +0000 @@ -399,7 +399,7 @@ @ thiscall -arch=win32 ??_Gstreambuf@@UAEPAXI@Z(ptr long) streambuf_scalar_dtor @ stub -arch=win32 ??_Gstrstream@@UAEPAXI@Z # virtual void * __thiscall strstream::`scalar deleting destructor'(unsigned int) @ stub -arch=win32 ??_Gstrstreambuf@@UAEPAXI@Z # virtual void * __thiscall strstreambuf::`scalar deleting destructor'(unsigned int) -# @ extern ?adjustfield@ios@@2JB # static long const ios::adjustfield +@ extern ?adjustfield@ios@@2JB ios_adjustfield @ thiscall -arch=win32 ?allocate@streambuf@@IAEHXZ(ptr) streambuf_allocate @ cdecl -arch=win64 ?allocate@streambuf@@IEAAHXZ(ptr) streambuf_allocate @ stub -arch=win32 ?attach@filebuf@@QAEPAV1@H@Z # class filebuf * __thiscall filebuf::attach(int) @@ -414,7 +414,7 @@ @ cdecl -arch=win64 ?bad@ios@@QEBAHXZ(ptr) ios_bad @ thiscall -arch=win32 ?base@streambuf@@IBEPADXZ(ptr) streambuf_base @ cdecl -arch=win64 ?base@streambuf@@IEBAPEADXZ(ptr) streambuf_base -# @ extern ?basefield@ios@@2JB # static long const ios::basefield +@ extern ?basefield@ios@@2JB ios_basefield # @ extern ?binary@filebuf@@2HB # static int const filebuf::binary @ cdecl ?bitalloc@ios@@SAJXZ() ios_bitalloc @ thiscall -arch=win32 ?blen@streambuf@@IBEHXZ(ptr) streambuf_blen @@ -465,7 +465,7 @@ @ cdecl -arch=win64 ?eof@ios@@QEBAHXZ(ptr) ios_eof @ thiscall -arch=win32 ?epptr@streambuf@@IBEPADXZ(ptr) streambuf_epptr @ cdecl -arch=win64 ?epptr@streambuf@@IEBAPEADXZ(ptr) streambuf_epptr -# @ extern ?fLockcInit@ios@@0HA # static int ios::fLockcInit +@ extern ?fLockcInit@ios@@0HA ios_fLockcInit @ thiscall -arch=win32 ?fail@ios@@QBEHXZ(ptr) ios_fail @ cdecl -arch=win64 ?fail@ios@@QEBAHXZ(ptr) ios_fail @ stub -arch=win32 ?fd@filebuf@@QBEHXZ # int __thiscall filebuf::fd(void)const @@ -484,7 +484,7 @@ @ cdecl -arch=win64 ?flags@ios@@QEAAJJ@Z(ptr long) ios_flags_set @ thiscall -arch=win32 ?flags@ios@@QBEJXZ(ptr) ios_flags_get @ cdecl -arch=win64 ?flags@ios@@QEBAJXZ(ptr) ios_flags_get -# @ extern ?floatfield@ios@@2JB # static long const ios::floatfield +@ extern ?floatfield@ios@@2JB ios_floatfield @ stub -arch=win32 ?flush@@YAAAVostream@@AAV1@@Z # class ostream & __cdecl flush(class ostream &) @ stub -arch=win64 ?flush@@YAAEAVostream@@AEAV1@@Z @ stub -arch=win32 ?flush@ostream@@QAEAAV1@XZ # class ostream & __thiscall ostream::flush(void) @@ -776,10 +776,10 @@ @ stub -arch=win64 ?writepad@ostream@@AEAAAEAV1@PEBD0@Z @ stub -arch=win32 ?ws@@YAAAVistream@@AAV1@@Z # class istream & __cdecl ws(class istream &) @ stub -arch=win64 ?ws@@YAAEAVistream@@AEAV1@@Z -# @ extern ?x_curindex@ios@@0HA # static int ios::x_curindex -# @ extern ?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A # static struct _CRT_CRITICAL_SECTION ios::x_lockc -# @ extern ?x_maxbit@ios@@0JA # static long ios::x_maxbit -# @ extern ?x_statebuf@ios@@0PAJA # static long * ios::x_statebuf +@ extern ?x_curindex@ios@@0HA ios_curindex +@ extern ?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A ios_static_lock +@ extern ?x_maxbit@ios@@0JA ios_maxbit +@ extern ?x_statebuf@ios@@0PAJA ios_statebuf @ cdecl ?xalloc@ios@@SAHXZ() ios_xalloc @ thiscall -arch=win32 ?xsgetn@streambuf@@UAEHPADH@Z(ptr ptr long) streambuf_xsgetn @ cdecl -arch=win64 ?xsgetn@streambuf@@UEAAHPEADH@Z(ptr ptr long) streambuf_xsgetn diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/msvcirt/tests/msvcirt.c wine-staging-1.7.48~ubuntu12.04.1/dlls/msvcirt/tests/msvcirt.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/msvcirt/tests/msvcirt.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/msvcirt/tests/msvcirt.c 2015-07-29 19:28:54.000000000 +0000 @@ -128,6 +128,33 @@ static ios* (*__thiscall p_ios_assign)(ios*, const ios*); static void (*__thiscall p_ios_init)(ios*, streambuf*); static void (*__thiscall p_ios_dtor)(ios*); +static void (*__cdecl p_ios_clrlock)(ios*); +static void (*__cdecl p_ios_setlock)(ios*); +static void (*__cdecl p_ios_lock)(ios*); +static void (*__cdecl p_ios_unlock)(ios*); +static void (*__cdecl p_ios_lockbuf)(ios*); +static void (*__cdecl p_ios_unlockbuf)(ios*); +static CRITICAL_SECTION *p_ios_static_lock; +static void (*__cdecl p_ios_lockc)(void); +static void (*__cdecl p_ios_unlockc)(void); +static LONG (*__thiscall p_ios_flags_set)(ios*, LONG); +static LONG (*__thiscall p_ios_flags_get)(const ios*); +static LONG (*__thiscall p_ios_setf)(ios*, LONG); +static LONG (*__thiscall p_ios_setf_mask)(ios*, LONG, LONG); +static LONG (*__thiscall p_ios_unsetf)(ios*, LONG); +static int (*__thiscall p_ios_good)(const ios*); +static int (*__thiscall p_ios_bad)(const ios*); +static int (*__thiscall p_ios_eof)(const ios*); +static int (*__thiscall p_ios_fail)(const ios*); +static void (*__thiscall p_ios_clear)(ios*, int); +static LONG *p_ios_maxbit; +static LONG (*__cdecl p_ios_bitalloc)(void); +static int *p_ios_curindex; +static LONG *p_ios_statebuf; +static LONG* (*__thiscall p_ios_iword)(const ios*, int); +static void** (*__thiscall p_ios_pword)(const ios*, int); +static int (*__cdecl p_ios_xalloc)(void); +static int *p_ios_fLockcInit; /* Emulate a __thiscall */ #ifdef __i386__ @@ -230,6 +257,24 @@ SET(p_ios_assign, "??4ios@@IEAAAEAV0@AEBV0@@Z"); SET(p_ios_init, "?init@ios@@IEAAXPEAVstreambuf@@@Z"); SET(p_ios_dtor, "??1ios@@UEAA@XZ"); + SET(p_ios_clrlock, "?clrlock@ios@@QEAAXXZ"); + SET(p_ios_setlock, "?setlock@ios@@QEAAXXZ"); + SET(p_ios_lock, "?lock@ios@@QEAAXXZ"); + SET(p_ios_unlock, "?unlock@ios@@QEAAXXZ"); + SET(p_ios_lockbuf, "?lockbuf@ios@@QEAAXXZ"); + SET(p_ios_unlockbuf, "?unlockbuf@ios@@QEAAXXZ"); + SET(p_ios_flags_set, "?flags@ios@@QEAAJJ@Z"); + SET(p_ios_flags_get, "?flags@ios@@QEBAJXZ"); + SET(p_ios_setf, "?setf@ios@@QEAAJJ@Z"); + SET(p_ios_setf_mask, "?setf@ios@@QEAAJJJ@Z"); + SET(p_ios_unsetf, "?unsetf@ios@@QEAAJJ@Z"); + SET(p_ios_good, "?good@ios@@QEBAHXZ"); + SET(p_ios_bad, "?bad@ios@@QEBAHXZ"); + SET(p_ios_eof, "?eof@ios@@QEBAHXZ"); + SET(p_ios_fail, "?fail@ios@@QEBAHXZ"); + SET(p_ios_clear, "?clear@ios@@QEAAXH@Z"); + SET(p_ios_iword, "?iword@ios@@QEBAAEAJH@Z"); + SET(p_ios_pword, "?pword@ios@@QEBAAEAPEAXH@Z"); } else { p_operator_new = (void*)GetProcAddress(msvcrt, "??2@YAPAXI@Z"); @@ -262,7 +307,34 @@ SET(p_ios_assign, "??4ios@@IAEAAV0@ABV0@@Z"); SET(p_ios_init, "?init@ios@@IAEXPAVstreambuf@@@Z"); SET(p_ios_dtor, "??1ios@@UAE@XZ"); + SET(p_ios_clrlock, "?clrlock@ios@@QAAXXZ"); + SET(p_ios_setlock, "?setlock@ios@@QAAXXZ"); + SET(p_ios_lock, "?lock@ios@@QAAXXZ"); + SET(p_ios_unlock, "?unlock@ios@@QAAXXZ"); + SET(p_ios_lockbuf, "?lockbuf@ios@@QAAXXZ"); + SET(p_ios_unlockbuf, "?unlockbuf@ios@@QAAXXZ"); + SET(p_ios_flags_set, "?flags@ios@@QAEJJ@Z"); + SET(p_ios_flags_get, "?flags@ios@@QBEJXZ"); + SET(p_ios_setf, "?setf@ios@@QAEJJ@Z"); + SET(p_ios_setf_mask, "?setf@ios@@QAEJJJ@Z"); + SET(p_ios_unsetf, "?unsetf@ios@@QAEJJ@Z"); + SET(p_ios_good, "?good@ios@@QBEHXZ"); + SET(p_ios_bad, "?bad@ios@@QBEHXZ"); + SET(p_ios_eof, "?eof@ios@@QBEHXZ"); + SET(p_ios_fail, "?fail@ios@@QBEHXZ"); + SET(p_ios_clear, "?clear@ios@@QAEXH@Z"); + SET(p_ios_iword, "?iword@ios@@QBEAAJH@Z"); + SET(p_ios_pword, "?pword@ios@@QBEAAPAXH@Z"); } + SET(p_ios_static_lock, "?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A"); + SET(p_ios_lockc, "?lockc@ios@@KAXXZ"); + SET(p_ios_unlockc, "?unlockc@ios@@KAXXZ"); + SET(p_ios_maxbit, "?x_maxbit@ios@@0JA"); + SET(p_ios_bitalloc, "?bitalloc@ios@@SAJXZ"); + SET(p_ios_curindex, "?x_curindex@ios@@0HA"); + SET(p_ios_statebuf, "?x_statebuf@ios@@0PAJA"); + SET(p_ios_xalloc, "?xalloc@ios@@SAHXZ"); + SET(p_ios_fLockcInit, "?fLockcInit@ios@@0HA"); init_thiscall_thunk(); return TRUE; @@ -805,10 +877,39 @@ CloseHandle(thread); } +struct ios_lock_arg +{ + ios *ios_obj; + HANDLE lock; + HANDLE release[3]; +}; + +static DWORD WINAPI lock_ios(void *arg) +{ + struct ios_lock_arg *lock_arg = arg; + p_ios_lock(lock_arg->ios_obj); + p_ios_lockbuf(lock_arg->ios_obj); + p_ios_lockc(); + SetEvent(lock_arg->lock); + WaitForSingleObject(lock_arg->release[0], INFINITE); + p_ios_unlockc(); + WaitForSingleObject(lock_arg->release[1], INFINITE); + p_ios_unlockbuf(lock_arg->ios_obj); + WaitForSingleObject(lock_arg->release[2], INFINITE); + p_ios_unlock(lock_arg->ios_obj); + return 0; +} + static void test_ios(void) { ios ios_obj, ios_obj2; streambuf *psb; + struct ios_lock_arg lock_arg; + HANDLE thread; + BOOL locked; + LONG *pret, expected, ret; + void **pret2; + int i; memset(&ios_obj, 0xab, sizeof(ios)); memset(&ios_obj2, 0xab, sizeof(ios)); @@ -817,6 +918,7 @@ call_func1(p_streambuf_ctor, psb); /* constructor/destructor */ + ok(*p_ios_fLockcInit == 4, "expected 4 got %d\n", *p_ios_fLockcInit); call_func2(p_ios_sb_ctor, &ios_obj, NULL); ok(ios_obj.sb == NULL, "expected %p got %p\n", NULL, ios_obj.sb); ok(ios_obj.state == IOSTATE_badbit, "expected %x got %x\n", IOSTATE_badbit, ios_obj.state); @@ -830,23 +932,28 @@ ok(ios_obj.width == 0, "expected 0 got %d\n", ios_obj.width); ok(ios_obj.do_lock == -1, "expected -1 got %d\n", ios_obj.do_lock); ok(ios_obj.lock.LockCount == -1, "expected -1 got %d\n", ios_obj.lock.LockCount); + ok(*p_ios_fLockcInit == 5, "expected 5 got %d\n", *p_ios_fLockcInit); ios_obj.state = 0x8; call_func1(p_ios_dtor, &ios_obj); ok(ios_obj.state == IOSTATE_badbit, "expected %x got %x\n", IOSTATE_badbit, ios_obj.state); + ok(*p_ios_fLockcInit == 4, "expected 4 got %d\n", *p_ios_fLockcInit); ios_obj.state = 0x8; call_func2(p_ios_sb_ctor, &ios_obj, psb); ok(ios_obj.sb == psb, "expected %p got %p\n", psb, ios_obj.sb); ok(ios_obj.state == IOSTATE_goodbit, "expected %x got %x\n", IOSTATE_goodbit, ios_obj.state); ok(ios_obj.delbuf == 0, "expected 0 got %d\n", ios_obj.delbuf); + ok(*p_ios_fLockcInit == 5, "expected 5 got %d\n", *p_ios_fLockcInit); ios_obj.state = 0x8; call_func1(p_ios_dtor, &ios_obj); ok(ios_obj.sb == NULL, "expected %p got %p\n", NULL, ios_obj.sb); ok(ios_obj.state == IOSTATE_badbit, "expected %x got %x\n", IOSTATE_badbit, ios_obj.state); + ok(*p_ios_fLockcInit == 4, "expected 4 got %d\n", *p_ios_fLockcInit); ios_obj.sb = psb; ios_obj.state = 0x8; call_func1(p_ios_ctor, &ios_obj); ok(ios_obj.sb == NULL, "expected %p got %p\n", NULL, ios_obj.sb); ok(ios_obj.state == IOSTATE_badbit, "expected %x got %x\n", IOSTATE_badbit, ios_obj.state); + ok(*p_ios_fLockcInit == 5, "expected 5 got %d\n", *p_ios_fLockcInit); /* init */ ios_obj.state |= 0x8; @@ -861,7 +968,6 @@ call_func2(p_ios_init, &ios_obj, psb); ok(ios_obj.sb == psb, "expected %p got %p\n", psb, ios_obj.sb); ok(ios_obj.state == 0x8, "expected %x got %x\n", 0x8, ios_obj.state); - ios_obj.delbuf = 1; call_func1(p_ios_dtor, &ios_obj); /* copy constructor */ @@ -875,6 +981,7 @@ ok(ios_obj.fill == (char)0xab, "expected %d got %d\n", (char)0xab, ios_obj.fill); ok(ios_obj.width == (char)0xab, "expected %d got %d\n", (char)0xab, ios_obj.width); ok(ios_obj.do_lock == -1, "expected -1 got %d\n", ios_obj.do_lock); + ok(*p_ios_fLockcInit == 5, "expected 5 got %d\n", *p_ios_fLockcInit); /* assignment */ ios_obj.state = 0x8; @@ -895,9 +1002,156 @@ ok(ios_obj.fill == (char)0xab, "expected %d got %d\n", (char)0xab, ios_obj.fill); ok(ios_obj.width == (char)0xab, "expected %d got %d\n", (char)0xab, ios_obj.width); ok(ios_obj.do_lock == 2, "expected 2 got %d\n", ios_obj.do_lock); - ios_obj.delbuf = 0; + + /* locking */ + ios_obj.sb = psb; + ios_obj.do_lock = 1; + ios_obj.sb->do_lock = 0; + p_ios_clrlock(&ios_obj); + ok(ios_obj.do_lock == 1, "expected 1 got %d\n", ios_obj.do_lock); + ok(ios_obj.sb->do_lock == 1, "expected 1 got %d\n", ios_obj.sb->do_lock); + ios_obj.do_lock = 0; + p_ios_clrlock(&ios_obj); + ok(ios_obj.do_lock == 1, "expected 1 got %d\n", ios_obj.do_lock); + ok(ios_obj.sb->do_lock == 1, "expected 1 got %d\n", ios_obj.sb->do_lock); + p_ios_setlock(&ios_obj); + ok(ios_obj.do_lock == 0, "expected 0 got %d\n", ios_obj.do_lock); + ok(ios_obj.sb->do_lock == 0, "expected 0 got %d\n", ios_obj.sb->do_lock); + ios_obj.do_lock = -1; + p_ios_setlock(&ios_obj); + ok(ios_obj.do_lock == -2, "expected -2 got %d\n", ios_obj.do_lock); + ok(ios_obj.sb->do_lock == -1, "expected -1 got %d\n", ios_obj.sb->do_lock); + + lock_arg.ios_obj = &ios_obj; + lock_arg.lock = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(lock_arg.lock != NULL, "CreateEventW failed\n"); + lock_arg.release[0] = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(lock_arg.release[0] != NULL, "CreateEventW failed\n"); + lock_arg.release[1] = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(lock_arg.release[1] != NULL, "CreateEventW failed\n"); + lock_arg.release[2] = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(lock_arg.release[2] != NULL, "CreateEventW failed\n"); + thread = CreateThread(NULL, 0, lock_ios, (void*)&lock_arg, 0, NULL); + ok(thread != NULL, "CreateThread failed\n"); + WaitForSingleObject(lock_arg.lock, INFINITE); + + locked = TryEnterCriticalSection(&ios_obj.lock); + ok(locked == 0, "the ios object was not locked before\n"); + locked = TryEnterCriticalSection(&ios_obj.sb->lock); + ok(locked == 0, "the streambuf was not locked before\n"); + locked = TryEnterCriticalSection(p_ios_static_lock); + ok(locked == 0, "the static critical section was not locked before\n"); + + /* flags */ + ios_obj.flags = 0x8000; + ret = (LONG) call_func1(p_ios_flags_get, &ios_obj); + ok(ret == 0x8000, "expected %x got %x\n", 0x8000, ret); + ret = (LONG) call_func2(p_ios_flags_set, &ios_obj, 0x444); + ok(ret == 0x8000, "expected %x got %x\n", 0x8000, ret); + ok(ios_obj.flags == 0x444, "expected %x got %x\n", 0x444, ios_obj.flags); + ret = (LONG) call_func2(p_ios_flags_set, &ios_obj, 0); + ok(ret == 0x444, "expected %x got %x\n", 0x444, ret); + ok(ios_obj.flags == 0, "expected %x got %x\n", 0, ios_obj.flags); + + /* setf */ + ios_obj.do_lock = 0; + ios_obj.flags = 0x8400; + ret = (LONG) call_func2(p_ios_setf, &ios_obj, 0x444); + ok(ret == 0x8400, "expected %x got %x\n", 0x8400, ret); + ok(ios_obj.flags == 0x8444, "expected %x got %x\n", 0x8444, ios_obj.flags); + ret = (LONG) call_func3(p_ios_setf_mask, &ios_obj, 0x111, 0); + ok(ret == 0x8444, "expected %x got %x\n", 0x8444, ret); + ok(ios_obj.flags == 0x8444, "expected %x got %x\n", 0x8444, ios_obj.flags); + ret = (LONG) call_func3(p_ios_setf_mask, &ios_obj, 0x111, 0x105); + ok(ret == 0x8444, "expected %x got %x\n", 0x8444, ret); + ok(ios_obj.flags == 0x8541, "expected %x got %x\n", 0x8541, ios_obj.flags); + + /* unsetf */ + ret = (LONG) call_func2(p_ios_unsetf, &ios_obj, 0x1111); + ok(ret == 0x8541, "expected %x got %x\n", 0x8541, ret); + ok(ios_obj.flags == 0x8440, "expected %x got %x\n", 0x8440, ios_obj.flags); + ret = (LONG) call_func2(p_ios_unsetf, &ios_obj, 0x8008); + ok(ret == 0x8440, "expected %x got %x\n", 0x8440, ret); + ok(ios_obj.flags == 0x440, "expected %x got %x\n", 0x440, ios_obj.flags); + ios_obj.do_lock = -1; + + /* state */ + ios_obj.state = 0x8; + ret = (LONG) call_func1(p_ios_good, &ios_obj); + ok(ret == 0, "expected 0 got %d\n", ret); + ios_obj.state = IOSTATE_goodbit; + ret = (LONG) call_func1(p_ios_good, &ios_obj); + ok(ret == 1, "expected 1 got %d\n", ret); + ret = (LONG) call_func1(p_ios_bad, &ios_obj); + ok(ret == 0, "expected 0 got %d\n", ret); + ios_obj.state = (IOSTATE_eofbit|IOSTATE_badbit); + ret = (LONG) call_func1(p_ios_bad, &ios_obj); + ok(ret == IOSTATE_badbit, "expected 4 got %d\n", ret); + ret = (LONG) call_func1(p_ios_eof, &ios_obj); + ok(ret == IOSTATE_eofbit, "expected 1 got %d\n", ret); + ios_obj.state = 0x8; + ret = (LONG) call_func1(p_ios_eof, &ios_obj); + ok(ret == 0, "expected 0 got %d\n", ret); + ret = (LONG) call_func1(p_ios_fail, &ios_obj); + ok(ret == 0, "expected 0 got %d\n", ret); + ios_obj.state = IOSTATE_badbit; + ret = (LONG) call_func1(p_ios_fail, &ios_obj); + ok(ret == IOSTATE_badbit, "expected 4 got %d\n", ret); + ios_obj.state = (IOSTATE_eofbit|IOSTATE_failbit); + ret = (LONG) call_func1(p_ios_fail, &ios_obj); + ok(ret == IOSTATE_failbit, "expected 2 got %d\n", ret); + ios_obj.state = (IOSTATE_eofbit|IOSTATE_failbit|IOSTATE_badbit); + ret = (LONG) call_func1(p_ios_fail, &ios_obj); + ok(ret == (IOSTATE_failbit|IOSTATE_badbit), "expected 6 got %d\n", ret); + ios_obj.do_lock = 0; + call_func2(p_ios_clear, &ios_obj, 0); + ok(ios_obj.state == IOSTATE_goodbit, "expected 0 got %d\n", ios_obj.state); + call_func2(p_ios_clear, &ios_obj, 0x8|IOSTATE_eofbit); + ok(ios_obj.state == (0x8|IOSTATE_eofbit), "expected 9 got %d\n", ios_obj.state); + ios_obj.do_lock = -1; + + SetEvent(lock_arg.release[0]); + + /* bitalloc */ + expected = 0x10000; + for (i = 0; i < 20; i++) { + ret = p_ios_bitalloc(); + ok(ret == expected, "expected %x got %x\n", expected, ret); + ok(*p_ios_maxbit == expected, "expected %x got %x\n", expected, *p_ios_maxbit); + expected <<= 1; + } + + /* xalloc/pword/iword */ + ok(*p_ios_curindex == -1, "expected -1 got %d\n", *p_ios_curindex); + expected = 0; + for (i = 0; i < 8; i++) { + ret = p_ios_xalloc(); + ok(ret == expected, "expected %d got %d\n", expected, ret); + ok(*p_ios_curindex == expected, "expected %d got %d\n", expected, *p_ios_curindex); + pret = (LONG*) call_func2(p_ios_iword, &ios_obj, ret); + ok(pret == &p_ios_statebuf[ret], "expected %p got %p\n", &p_ios_statebuf[ret], pret); + ok(*pret == 0, "expected 0 got %d\n", *pret); + pret2 = (void**) call_func2(p_ios_pword, &ios_obj, ret); + ok(pret2 == (void**)&p_ios_statebuf[ret], "expected %p got %p\n", (void**)&p_ios_statebuf[ret], pret2); + expected++; + } + ret = p_ios_xalloc(); + ok(ret == -1, "expected -1 got %d\n", ret); + ok(*p_ios_curindex == 7, "expected 7 got %d\n", *p_ios_curindex); + + SetEvent(lock_arg.release[1]); + SetEvent(lock_arg.release[2]); + WaitForSingleObject(thread, INFINITE); + + ios_obj.delbuf = 1; call_func1(p_ios_dtor, &ios_obj); ok(ios_obj.state == IOSTATE_badbit, "expected %x got %x\n", IOSTATE_badbit, ios_obj.state); + ok(*p_ios_fLockcInit == 4, "expected 4 got %d\n", *p_ios_fLockcInit); + CloseHandle(lock_arg.lock); + CloseHandle(lock_arg.release[0]); + CloseHandle(lock_arg.release[1]); + CloseHandle(lock_arg.release[2]); + CloseHandle(thread); } START_TEST(msvcirt) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/msvcp90/ios.c wine-staging-1.7.48~ubuntu12.04.1/dlls/msvcp90/ios.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/msvcp90/ios.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/msvcp90/ios.c 2015-07-29 19:28:54.000000000 +0000 @@ -14202,7 +14202,7 @@ { WIN32_FILE_ATTRIBUTE_DATA fad; - TRACE("(%p)\n", path); + TRACE("(%s)\n", debugstr_a(path)); if(!GetFileAttributesExA(path, GetFileExInfoStandard, &fad)) return 0; if(fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) @@ -14218,7 +14218,7 @@ HANDLE h1, h2; int ret; BY_HANDLE_FILE_INFORMATION info1, info2; - TRACE("(%p %p)\n", path1, path2); + TRACE("(%s %s)\n", debugstr_a(path1), debugstr_a(path2)); h1 = CreateFileA(path1, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); @@ -14251,7 +14251,7 @@ /* ?_Current_get@sys@tr2@std@@YAPEADAEAY0BAE@D@Z */ char* __cdecl tr2_sys__Current_get(char *current_path) { - TRACE("(%p)\n", current_path); + TRACE("(%s)\n", debugstr_a(current_path)); if(!GetCurrentDirectoryA(MAX_PATH, current_path)) return NULL; @@ -14262,7 +14262,7 @@ /* ?_Current_set@sys@tr2@std@@YA_NPEBD@Z */ MSVCP_bool __cdecl tr2_sys__Current_set(char const* path) { - TRACE("(%p)\n", path); + TRACE("(%s)\n", debugstr_a(path)); return SetCurrentDirectoryA(path) != 0; } @@ -14270,7 +14270,7 @@ /* ?_Make_dir@sys@tr2@std@@YAHPEBD@Z */ int __cdecl tr2_sys__Make_dir(char const* path) { - TRACE("(%p)\n", path); + TRACE("(%s)\n", debugstr_a(path)); if(!CreateDirectoryA(path, NULL)) { if(GetLastError() == ERROR_ALREADY_EXISTS) @@ -14286,7 +14286,7 @@ /* ?_Remove_dir@sys@tr2@std@@YA_NPEBD@Z */ MSVCP_bool __cdecl tr2_sys__Remove_dir(char const* path) { - TRACE("(%p)\n", path); + TRACE("(%s)\n", debugstr_a(path)); return RemoveDirectoryA(path) != 0; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/msvcp90/locale.c wine-staging-1.7.48~ubuntu12.04.1/dlls/msvcp90/locale.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/msvcp90/locale.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/msvcp90/locale.c 2015-07-29 19:28:54.000000000 +0000 @@ -9665,38 +9665,79 @@ DEFINE_THISCALL_WRAPPER(time_get_char__Init, 8) void __thiscall time_get_char__Init(time_get_char *this, const _Locinfo *locinfo) { - FIXME("(%p %p) stub\n", this, locinfo); -} + const char *months; + const char *days; + int len; + + TRACE("(%p %p)\n", this, locinfo); + + days = _Locinfo__Getdays(locinfo); + len = strlen(days)+1; + this->days = MSVCRT_operator_new(len); + if(!this->days) + { + ERR("Out of memory\n"); + throw_exception(EXCEPTION_BAD_ALLOC, NULL); + } + memcpy((char*)this->days, days, len); + + months = _Locinfo__Getmonths(locinfo); + len = strlen(months)+1; + this->months = MSVCRT_operator_new(len); + if(!this->months) + { + MSVCRT_operator_delete((char*)this->days); + + ERR("Out of memory\n"); + throw_exception(EXCEPTION_BAD_ALLOC, NULL); + } + memcpy((char*)this->months, months, len); -/* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IAE@PBDI@Z */ -/* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IEAA@PEBD_K@Z */ -DEFINE_THISCALL_WRAPPER(time_get_char_ctor_name, 12) -time_get_char* __thiscall time_get_char_ctor_name(time_get_char *this, const char *name, unsigned int refs) -{ - FIXME("(%p %p %d) stub\n", this, name, refs); - this->facet.vtable = &MSVCP_time_get_char_vtable; - return NULL; + this->dateorder = _Locinfo__Getdateorder(locinfo); + _Locinfo__Getcvt(locinfo, &this->cvt); } /* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */ /* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */ DEFINE_THISCALL_WRAPPER(time_get_char_ctor_locinfo, 12) time_get_char* __thiscall time_get_char_ctor_locinfo(time_get_char *this, - const _Locinfo *locinfo, unsigned int refs) + const _Locinfo *locinfo, MSVCP_size_t refs) { - FIXME("(%p %p %d) stub\n", this, locinfo, refs); + TRACE("(%p %p %lu)\n", this, locinfo, refs); + locale_facet_ctor_refs(&this->facet, refs); this->facet.vtable = &MSVCP_time_get_char_vtable; - return NULL; + time_get_char__Init(this, locinfo); + return this; +} + +/* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IAE@PBDI@Z */ +/* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IEAA@PEBD_K@Z */ +DEFINE_THISCALL_WRAPPER(time_get_char_ctor_name, 12) +time_get_char* __thiscall time_get_char_ctor_name(time_get_char *this, const char *name, MSVCP_size_t refs) +{ + _Locinfo locinfo; + + TRACE("(%p %s %lu)\n", this, name, refs); + + _Locinfo_ctor_cstr(&locinfo, name); + time_get_char_ctor_locinfo(this, &locinfo, refs); + _Locinfo_dtor(&locinfo); + return this; } /* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@I@Z */ /* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@_K@Z */ DEFINE_THISCALL_WRAPPER(time_get_char_ctor_refs, 8) -time_get_char* __thiscall time_get_char_ctor_refs(time_get_char *this, unsigned int refs) +time_get_char* __thiscall time_get_char_ctor_refs(time_get_char *this, MSVCP_size_t refs) { - FIXME("(%p %d) stub\n", this, refs); - this->facet.vtable = &MSVCP_time_get_char_vtable; - return NULL; + _Locinfo locinfo; + + TRACE("(%p %lu)\n", this, refs); + + _Locinfo_ctor(&locinfo); + time_get_char_ctor_locinfo(this, &locinfo, refs); + _Locinfo_dtor(&locinfo); + return this; } /* ??_F?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAEXXZ */ @@ -9712,7 +9753,10 @@ DEFINE_THISCALL_WRAPPER(time_get_char__Tidy, 4) void __thiscall time_get_char__Tidy(time_get_char *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + + MSVCRT_operator_delete((char*)this->days); + MSVCRT_operator_delete((char*)this->months); } /* ??1?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MAE@XZ */ @@ -9720,7 +9764,9 @@ DEFINE_THISCALL_WRAPPER(time_get_char_dtor, 4) /* virtual */ void __thiscall time_get_char_dtor(time_get_char *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + + time_get_char__Tidy(this); } DEFINE_THISCALL_WRAPPER(time_get_char_vector_dtor, 8) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/msvcrt/file.c wine-staging-1.7.48~ubuntu12.04.1/dlls/msvcrt/file.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/msvcrt/file.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/msvcrt/file.c 2015-07-29 19:28:54.000000000 +0000 @@ -1197,8 +1197,6 @@ for(i=0; i #include "windef.h" #include "winbase.h" +#define USE_WS_PREFIX +#include "winsock2.h" +#include "ws2ipdef.h" +#include "iphlpapi.h" +#include "ifdef.h" +#include "netioapi.h" #include "initguid.h" #include "objbase.h" #include "ocidl.h" @@ -240,12 +246,67 @@ return S_OK; } +static BOOL map_address_6to4( const SOCKADDR_IN6 *addr6, SOCKADDR_IN *addr4 ) +{ + ULONG i; + + if (addr6->sin6_family != WS_AF_INET6) return FALSE; + + for (i = 0; i < 5; i++) + if (addr6->sin6_addr.u.Word[i]) return FALSE; + + if (addr6->sin6_addr.u.Word[5] != 0xffff) return FALSE; + + addr4->sin_family = WS_AF_INET; + addr4->sin_port = addr6->sin6_port; + addr4->sin_addr.S_un.S_addr = addr6->sin6_addr.u.Word[6] << 16 | addr6->sin6_addr.u.Word[7]; + memset( &addr4->sin_zero, 0, sizeof(addr4->sin_zero) ); + + return TRUE; +} + static HRESULT WINAPI cost_manager_GetDataPlanStatus( INetworkCostManager *iface, NLM_DATAPLAN_STATUS *pDataPlanStatus, NLM_SOCKADDR *pDestIPAddr) { + DWORD ret, index; + NET_LUID luid; + SOCKADDR *dst = (SOCKADDR *)pDestIPAddr; + SOCKADDR_IN addr4, *dst4; + FIXME( "%p, %p, %p\n", iface, pDataPlanStatus, pDestIPAddr ); - return E_NOTIMPL; + + if (!pDataPlanStatus) return E_POINTER; + + if (dst && ((dst->sa_family == WS_AF_INET && (dst4 = (SOCKADDR_IN *)dst)) || + ((dst->sa_family == WS_AF_INET6 && map_address_6to4( (const SOCKADDR_IN6 *)dst, &addr4 ) + && (dst4 = &addr4))))) + { + if ((ret = GetBestInterface( dst4->sin_addr.S_un.S_addr, &index ))) + return HRESULT_FROM_WIN32( ret ); + + if ((ret = ConvertInterfaceIndexToLuid( index, &luid ))) + return HRESULT_FROM_WIN32( ret ); + + if ((ret = ConvertInterfaceLuidToGuid( &luid, &pDataPlanStatus->InterfaceGuid ))) + return HRESULT_FROM_WIN32( ret ); + } + else + { + FIXME( "interface guid not found\n" ); + memset( &pDataPlanStatus->InterfaceGuid, 0, sizeof(pDataPlanStatus->InterfaceGuid) ); + } + + pDataPlanStatus->UsageData.UsageInMegabytes = NLM_UNKNOWN_DATAPLAN_STATUS; + memset( &pDataPlanStatus->UsageData.LastSyncTime, 0, sizeof(pDataPlanStatus->UsageData.LastSyncTime) ); + pDataPlanStatus->DataLimitInMegabytes = NLM_UNKNOWN_DATAPLAN_STATUS; + pDataPlanStatus->InboundBandwidthInKbps = NLM_UNKNOWN_DATAPLAN_STATUS; + pDataPlanStatus->OutboundBandwidthInKbps = NLM_UNKNOWN_DATAPLAN_STATUS; + memset( &pDataPlanStatus->NextBillingCycle, 0, sizeof(pDataPlanStatus->NextBillingCycle) ); + pDataPlanStatus->MaxTransferSizeInMegabytes = NLM_UNKNOWN_DATAPLAN_STATUS; + pDataPlanStatus->Reserved = 0; + + return S_OK; } static HRESULT WINAPI cost_manager_SetDestinationAddresses( @@ -489,7 +550,8 @@ if (!riid || !cp) return E_POINTER; - if (IsEqualGUID( riid, &IID_INetworkListManagerEvents )) + if (IsEqualGUID( riid, &IID_INetworkListManagerEvents ) || + IsEqualGUID( riid, &IID_INetworkCostManagerEvents )) return connection_point_create( cp, riid, iface ); FIXME( "interface %s not implemented\n", debugstr_guid(riid) ); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/netprofm/Makefile.in wine-staging-1.7.48~ubuntu12.04.1/dlls/netprofm/Makefile.in --- wine-staging-1.7.47~ubuntu12.04.1/dlls/netprofm/Makefile.in 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/netprofm/Makefile.in 2015-07-29 19:28:54.000000000 +0000 @@ -1,4 +1,5 @@ MODULE = netprofm.dll +IMPORTS = iphlpapi C_SRCS = \ list.c \ diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/netprofm/tests/list.c wine-staging-1.7.48~ubuntu12.04.1/dlls/netprofm/tests/list.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/netprofm/tests/list.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/netprofm/tests/list.c 2015-07-29 19:28:54.000000000 +0000 @@ -67,6 +67,7 @@ if (hr == S_OK) { DWORD cost; + NLM_DATAPLAN_STATUS status; hr = INetworkCostManager_GetCost( cost_mgr, NULL, NULL ); ok( hr == E_POINTER, "got %08x\n", hr ); @@ -76,6 +77,12 @@ ok( hr == S_OK, "got %08x\n", hr ); ok( cost != 0xdeadbeef, "cost not set\n" ); + hr = INetworkCostManager_GetDataPlanStatus( cost_mgr, NULL, NULL ); + ok( hr == E_POINTER, "got %08x\n", hr ); + + hr = INetworkCostManager_GetDataPlanStatus( cost_mgr, &status, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + INetworkCostManager_Release( cost_mgr ); } @@ -103,8 +110,12 @@ ok( hr == S_OK, "got %08x\n", hr ); ok( !memcmp( &iid, &IID_INetworkListManagerEvents, sizeof(iid) ), "Expected iid to be IID_INetworkListManagerEvents\n" ); - IConnectionPoint_Release( pt ); + + hr = IConnectionPointContainer_FindConnectionPoint( cpc, &IID_INetworkCostManagerEvents, &pt ); + ok( hr == S_OK || hr == CO_E_FAILEDTOIMPERSONATE, "got %08x\n", hr ); + if (hr == S_OK) IConnectionPoint_Release( pt ); + IConnectionPointContainer_Release( cpc ); INetworkListManager_Release( mgr ); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ntdll/loader.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ntdll/loader.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ntdll/loader.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ntdll/loader.c 2015-07-29 19:28:54.000000000 +0000 @@ -94,7 +94,7 @@ static HANDLE main_exe_file; static UINT tls_module_count; /* number of modules with TLS directory */ -static const IMAGE_TLS_DIRECTORY **tls_dirs; /* array of TLS directories */ +static IMAGE_TLS_DIRECTORY *tls_dirs; /* array of TLS directories */ LIST_ENTRY tls_links = { &tls_links, &tls_links }; static RTL_CRITICAL_SECTION loader_section; @@ -772,7 +772,12 @@ size = dir->EndAddressOfRawData - dir->StartAddressOfRawData; if (!size && !dir->SizeOfZeroFill && !dir->AddressOfCallBacks) return -1; - for (i = 0; i < tls_module_count; i++) if (!tls_dirs[i]) break; + for (i = 0; i < tls_module_count; i++) + { + if (!tls_dirs[i].StartAddressOfRawData && !tls_dirs[i].EndAddressOfRawData && + !tls_dirs[i].SizeOfZeroFill && !tls_dirs[i].AddressOfCallBacks) + break; + } TRACE( "module %p data %p-%p zerofill %u index %p callback %p flags %x -> slot %u\n", mod->BaseAddress, (void *)dir->StartAddressOfRawData, (void *)dir->EndAddressOfRawData, dir->SizeOfZeroFill, @@ -824,7 +829,7 @@ } *(DWORD *)dir->AddressOfIndex = i; - tls_dirs[i] = dir; + tls_dirs[i] = *dir; return i; } @@ -841,7 +846,7 @@ if (mod->TlsIndex == -1) return; assert( i < tls_module_count ); - tls_dirs[i] = NULL; + memset( &tls_dirs[i], 0, sizeof(tls_dirs[i]) ); } @@ -987,7 +992,7 @@ for (i = 0; i < tls_module_count; i++) { - const IMAGE_TLS_DIRECTORY *dir = tls_dirs[i]; + const IMAGE_TLS_DIRECTORY *dir = &tls_dirs[i]; if (!dir) continue; size = dir->EndAddressOfRawData - dir->StartAddressOfRawData; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ntdll/process.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ntdll/process.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ntdll/process.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ntdll/process.c 2015-07-29 19:28:54.000000000 +0000 @@ -21,11 +21,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" + #include #include #include #include #include +#ifdef HAVE_UNISTD_H +# include +#endif #include "ntstatus.h" #define WIN32_NO_STATUS @@ -60,7 +65,7 @@ self = !ret && reply->self; } SERVER_END_REQ; - if (self && handle) exit( exit_code ); + if (self && handle) _exit( exit_code ); return ret; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ntdll/rtl.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ntdll/rtl.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ntdll/rtl.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ntdll/rtl.c 2015-07-29 19:28:54.000000000 +0000 @@ -1489,7 +1489,7 @@ /****************************************************************************** * RtlDecompressFragment [NTDLL.@] */ -NTSTATUS RtlDecompressFragment(USHORT format, PUCHAR uncompressed, ULONG uncompressed_size, +NTSTATUS WINAPI RtlDecompressFragment(USHORT format, PUCHAR uncompressed, ULONG uncompressed_size, PUCHAR compressed, ULONG compressed_size, ULONG offset, PULONG final_size, PVOID workspace) { diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ntdll/tests/threadpool.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ntdll/tests/threadpool.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ntdll/tests/threadpool.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ntdll/tests/threadpool.c 2015-07-29 19:28:54.000000000 +0000 @@ -98,6 +98,51 @@ #undef NTDLL_GET_PROC +static DWORD CALLBACK rtl_work_cb(void *userdata) +{ + HANDLE semaphore = userdata; + trace("Running rtl_work callback\n"); + ReleaseSemaphore(semaphore, 1, NULL); + return 0; +} + +static void test_RtlQueueWorkItem(void) +{ + HANDLE semaphore; + NTSTATUS status; + DWORD result; + + semaphore = CreateSemaphoreA(NULL, 0, 1, NULL); + ok(semaphore != NULL, "CreateSemaphoreA failed %u\n", GetLastError()); + + status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_EXECUTEDEFAULT); + ok(!status, "RtlQueueWorkItem failed with status %x\n", status); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_EXECUTEINIOTHREAD); + ok(!status, "RtlQueueWorkItem failed with status %x\n", status); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_EXECUTEINPERSISTENTTHREAD); + ok(!status, "RtlQueueWorkItem failed with status %x\n", status); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_EXECUTELONGFUNCTION); + ok(!status, "RtlQueueWorkItem failed with status %x\n", status); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_TRANSFER_IMPERSONATION); + ok(!status, "RtlQueueWorkItem failed with status %x\n", status); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + CloseHandle(semaphore); +} + static void CALLBACK simple_cb(TP_CALLBACK_INSTANCE *instance, void *userdata) { HANDLE semaphore = userdata; @@ -1292,6 +1337,8 @@ START_TEST(threadpool) { + test_RtlQueueWorkItem(); + if (!init_threadpool()) return; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ntdll/threadpool.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ntdll/threadpool.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ntdll/threadpool.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ntdll/threadpool.c 2015-07-29 19:28:54.000000000 +0000 @@ -42,44 +42,28 @@ * Old thread pooling API */ -#define OLD_WORKER_TIMEOUT 30000 /* 30 seconds */ +struct rtl_work_item +{ + PRTL_WORK_ITEM_ROUTINE function; + PVOID context; +}; + #define EXPIRE_NEVER (~(ULONGLONG)0) #define TIMER_QUEUE_MAGIC 0x516d6954 /* TimQ */ -static RTL_CRITICAL_SECTION_DEBUG critsect_debug; static RTL_CRITICAL_SECTION_DEBUG critsect_compl_debug; static struct { - /* threadpool_cs must be held while modifying the following four elements */ - struct list work_item_list; - LONG num_workers; - LONG num_busy_workers; - LONG num_items_processed; - RTL_CONDITION_VARIABLE threadpool_cond; - RTL_CRITICAL_SECTION threadpool_cs; HANDLE compl_port; RTL_CRITICAL_SECTION threadpool_compl_cs; } old_threadpool = { - LIST_INIT(old_threadpool.work_item_list), /* work_item_list */ - 0, /* num_workers */ - 0, /* num_busy_workers */ - 0, /* num_items_processed */ - RTL_CONDITION_VARIABLE_INIT, /* threadpool_cond */ - { &critsect_debug, -1, 0, 0, 0, 0 }, /* threadpool_cs */ NULL, /* compl_port */ { &critsect_compl_debug, -1, 0, 0, 0, 0 }, /* threadpool_compl_cs */ }; -static RTL_CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &old_threadpool.threadpool_cs, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": threadpool_cs") } -}; - static RTL_CRITICAL_SECTION_DEBUG critsect_compl_debug = { 0, 0, &old_threadpool.threadpool_compl_cs, @@ -87,13 +71,6 @@ 0, 0, { (DWORD_PTR)(__FILE__ ": threadpool_compl_cs") } }; -struct work_item -{ - struct list entry; - PRTL_WORK_ITEM_ROUTINE function; - PVOID context; -}; - struct wait_work_item { HANDLE Object; @@ -364,47 +341,14 @@ return interlocked_xchg_add( dest, -1 ) - 1; } -static void WINAPI worker_thread_proc(void * param) +static void CALLBACK process_rtl_work_item( TP_CALLBACK_INSTANCE *instance, void *userdata ) { - struct list *item; - struct work_item *work_item_ptr, work_item; - LARGE_INTEGER timeout; - timeout.QuadPart = -(OLD_WORKER_TIMEOUT * (ULONGLONG)10000); + struct rtl_work_item *item = userdata; - RtlEnterCriticalSection( &old_threadpool.threadpool_cs ); - old_threadpool.num_workers++; - - for (;;) - { - if ((item = list_head( &old_threadpool.work_item_list ))) - { - work_item_ptr = LIST_ENTRY( item, struct work_item, entry ); - list_remove( &work_item_ptr->entry ); - old_threadpool.num_busy_workers++; - old_threadpool.num_items_processed++; - RtlLeaveCriticalSection( &old_threadpool.threadpool_cs ); - - /* copy item to stack and do the work */ - work_item = *work_item_ptr; - RtlFreeHeap( GetProcessHeap(), 0, work_item_ptr ); - TRACE("executing %p(%p)\n", work_item.function, work_item.context); - work_item.function( work_item.context ); + TRACE("executing %p(%p)\n", item->function, item->context); + item->function( item->context ); - RtlEnterCriticalSection( &old_threadpool.threadpool_cs ); - old_threadpool.num_busy_workers--; - } - else if (RtlSleepConditionVariableCS( &old_threadpool.threadpool_cond, - &old_threadpool.threadpool_cs, &timeout ) != STATUS_SUCCESS) - { - break; - } - } - - old_threadpool.num_workers--; - RtlLeaveCriticalSection( &old_threadpool.threadpool_cs ); - RtlExitUserThread( 0 ); - - /* never reached */ + RtlFreeHeap( GetProcessHeap(), 0, item ); } /*********************************************************************** @@ -413,9 +357,9 @@ * Queues a work item into a thread in the thread pool. * * PARAMS - * Function [I] Work function to execute. - * Context [I] Context to pass to the work function when it is executed. - * Flags [I] Flags. See notes. + * function [I] Work function to execute. + * context [I] Context to pass to the work function when it is executed. + * flags [I] Flags. See notes. * * RETURNS * Success: STATUS_SUCCESS. @@ -429,59 +373,26 @@ *|WT_EXECUTELONGFUNCTION - Hints that the execution can take a long time. *|WT_TRANSFER_IMPERSONATION - Executes the function with the current access token. */ -NTSTATUS WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE Function, PVOID Context, ULONG Flags) +NTSTATUS WINAPI RtlQueueWorkItem( PRTL_WORK_ITEM_ROUTINE function, PVOID context, ULONG flags ) { - HANDLE thread; + TP_CALLBACK_ENVIRON environment; + struct rtl_work_item *item; NTSTATUS status; - LONG items_processed; - struct work_item *work_item = RtlAllocateHeap(GetProcessHeap(), 0, sizeof(struct work_item)); - if (!work_item) + item = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*item) ); + if (!item) return STATUS_NO_MEMORY; - work_item->function = Function; - work_item->context = Context; - - if (Flags & ~WT_EXECUTELONGFUNCTION) - FIXME("Flags 0x%x not supported\n", Flags); - - RtlEnterCriticalSection( &old_threadpool.threadpool_cs ); - list_add_tail( &old_threadpool.work_item_list, &work_item->entry ); - status = (old_threadpool.num_workers > old_threadpool.num_busy_workers) ? - STATUS_SUCCESS : STATUS_UNSUCCESSFUL; - items_processed = old_threadpool.num_items_processed; - RtlLeaveCriticalSection( &old_threadpool.threadpool_cs ); - - /* FIXME: tune this algorithm to not be as aggressive with creating threads - * if WT_EXECUTELONGFUNCTION isn't specified */ - if (status == STATUS_SUCCESS) - RtlWakeConditionVariable( &old_threadpool.threadpool_cond ); - else - { - status = RtlCreateUserThread( GetCurrentProcess(), NULL, FALSE, NULL, 0, 0, - worker_thread_proc, NULL, &thread, NULL ); + memset( &environment, 0, sizeof(environment) ); + environment.Version = 1; + environment.u.s.LongFunction = (flags & WT_EXECUTELONGFUNCTION) != 0; + environment.u.s.Persistent = (flags & WT_EXECUTEINPERSISTENTTHREAD) != 0; - /* NOTE: we don't care if we couldn't create the thread if there is at - * least one other available to process the request */ - if (status == STATUS_SUCCESS) - NtClose( thread ); - else - { - RtlEnterCriticalSection( &old_threadpool.threadpool_cs ); - if (old_threadpool.num_workers > 0 || - old_threadpool.num_items_processed != items_processed) - { - status = STATUS_SUCCESS; - } - else - list_remove( &work_item->entry ); - RtlLeaveCriticalSection( &old_threadpool.threadpool_cs ); - - if (status != STATUS_SUCCESS) - RtlFreeHeap( GetProcessHeap(), 0, work_item ); - } - } + item->function = function; + item->context = context; + status = TpSimpleTryPost( process_rtl_work_item, item, &environment ); + if (status) RtlFreeHeap( GetProcessHeap(), 0, item ); return status; } @@ -1598,7 +1509,7 @@ struct waitqueue_bucket *bucket; NTSTATUS status; HANDLE thread; - assert( wait->type = TP_OBJECT_TYPE_WAIT ); + assert( wait->type == TP_OBJECT_TYPE_WAIT ); wait->u.wait.signaled = 0; wait->u.wait.bucket = NULL; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ntdll/virtual.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ntdll/virtual.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ntdll/virtual.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ntdll/virtual.c 2015-07-29 19:28:54.000000000 +0000 @@ -61,6 +61,12 @@ #define MAP_NORESERVE 0 #endif +#ifdef _WIN64 +#define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232) +#endif +#define DEFAULT_SECURITY_COOKIE_32 0xbb40e64e +#define DEFAULT_SECURITY_COOKIE_16 (DEFAULT_SECURITY_COOKIE_32 >> 16) + /* File view */ struct file_view { @@ -1053,6 +1059,36 @@ return status; } +/*********************************************************************** + * set_security_cookie + * + * Create a random security cookie for buffer overflow protection. Make + * sure it does not accidentally match the default cookie value. + */ +static void set_security_cookie(ULONG_PTR *cookie) +{ + static ULONG seed; + + if (!cookie) return; + if (!seed) seed = NtGetTickCount() ^ GetCurrentProcessId(); + while (1) + { + if (*cookie == DEFAULT_SECURITY_COOKIE_16) + *cookie = RtlRandom( &seed ) >> 16; /* leave the high word clear */ + else if (*cookie == DEFAULT_SECURITY_COOKIE_32) + *cookie = RtlRandom( &seed ); +#ifdef DEFAULT_SECURITY_COOKIE_64 + else if (*cookie == DEFAULT_SECURITY_COOKIE_64) + { + *cookie = RtlRandom( &seed ); + /* fill up, but keep the highest word clear */ + *cookie ^= (ULONG_PTR)RtlRandom( &seed ) << 16; + } +#endif + else + break; + } +} /*********************************************************************** * map_image @@ -1285,18 +1321,7 @@ loadcfg = RtlImageDirectoryEntryToData( (HMODULE)ptr, TRUE, IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG, &loadcfg_size ); if (loadcfg && loadcfg_size >= sizeof(*loadcfg)) - { - static ULONG seed; - ULONG_PTR *cookie = (ULONG_PTR *)loadcfg->SecurityCookie; - - if (!seed) seed = NtGetTickCount() ^ GetCurrentProcessId(); - if (cookie) - { - *cookie = RtlRandom( &seed ); - if (sizeof(ULONG_PTR) > sizeof(ULONG)) /* fill up, but keep the highest word clear */ - *cookie ^= (ULONG_PTR)RtlRandom( &seed ) << 16; - } - } + set_security_cookie((ULONG_PTR *)loadcfg->SecurityCookie); /* set the image protections */ diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ntoskrnl.exe/ntoskrnl.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ntoskrnl.exe/ntoskrnl.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ntoskrnl.exe/ntoskrnl.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ntoskrnl.exe/ntoskrnl.c 2015-07-29 19:28:54.000000000 +0000 @@ -1009,10 +1009,16 @@ */ NTSTATUS WINAPI IoGetDeviceObjectPointer( UNICODE_STRING *name, ACCESS_MASK access, PFILE_OBJECT *file, PDEVICE_OBJECT *device ) { + static DEVICE_OBJECT stub_device; + static DRIVER_OBJECT stub_driver; + FIXME( "stub: %s %x %p %p\n", debugstr_us(name), access, file, device ); + stub_device.StackSize = 0x80; /* minimum value to appease SecuROM 5.x */ + stub_device.DriverObject = &stub_driver; + *file = NULL; - *device = NULL; + *device = &stub_device; return STATUS_SUCCESS; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ole32/storage32.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ole32/storage32.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ole32/storage32.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ole32/storage32.c 2015-07-29 19:28:54.000000000 +0000 @@ -9183,7 +9183,10 @@ count = 0; r = IStream_Read( stm, str, len, &count ); if( FAILED( r ) ) + { + CoTaskMemFree( str ); return r; + } if( count != len ) { CoTaskMemFree( str ); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/qcap/tests/qcap.c wine-staging-1.7.48~ubuntu12.04.1/dlls/qcap/tests/qcap.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/qcap/tests/qcap.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/qcap/tests/qcap.c 2015-07-29 19:28:54.000000000 +0000 @@ -1850,6 +1850,145 @@ IBaseFilter_Release(avico); } +/* Outer IUnknown for COM aggregation tests */ +struct unk_impl { + IUnknown IUnknown_iface; + LONG ref; + IUnknown *inner_unk; +}; + +static inline struct unk_impl *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, struct unk_impl, IUnknown_iface); +} + +static HRESULT WINAPI unk_QueryInterface(IUnknown *iface, REFIID riid, void **ret_iface) +{ + struct unk_impl *This = impl_from_IUnknown(iface); + + return IUnknown_QueryInterface(This->inner_unk, riid, ret_iface); +} + +static ULONG WINAPI unk_AddRef(IUnknown *iface) +{ + struct unk_impl *This = impl_from_IUnknown(iface); + + return InterlockedIncrement(&This->ref); +} + +static ULONG WINAPI unk_Release(IUnknown *iface) +{ + struct unk_impl *This = impl_from_IUnknown(iface); + + return InterlockedDecrement(&This->ref); +} + +static const IUnknownVtbl unk_vtbl = +{ + unk_QueryInterface, + unk_AddRef, + unk_Release +}; + +static void test_COM_vfwcapture(void) +{ + struct unk_impl unk_obj = {{&unk_vtbl}, 19, NULL}; + IBaseFilter *bf; + IMediaFilter *mf; + IPersist *p; + IPersistPropertyBag *ppb; + IAMVfwCaptureDialogs *amvcd; + IAMFilterMiscFlags *amfmf; + ISpecifyPropertyPages *spp; + IUnknown *unk; + ULONG refcount; + HRESULT hr; + + /* COM aggregation */ + hr = CoCreateInstance(&CLSID_VfwCapture, &unk_obj.IUnknown_iface, CLSCTX_INPROC_SERVER, + &IID_IUnknown, (void**)&unk_obj.inner_unk); + ok(hr == S_OK, "VfwCapture create failed: %08x\n", hr); + hr = IUnknown_QueryInterface(unk_obj.inner_unk, &IID_IBaseFilter, (void**)&bf); + ok(hr == S_OK, "QueryInterface for IID_IBaseFilter failed: %08x\n", hr); + refcount = IBaseFilter_AddRef(bf); + ok(refcount == unk_obj.ref, "VfwCapture just pretends to support COM aggregation\n"); + refcount = IBaseFilter_Release(bf); + ok(refcount == unk_obj.ref, "VfwCapture just pretends to support COM aggregation\n"); + refcount = IBaseFilter_Release(bf); + ok(refcount == 19, "Refcount should be back at 19 but is %u\n", refcount); + IUnknown_Release(unk_obj.inner_unk); + + /* Invalid RIID */ + hr = CoCreateInstance(&CLSID_VfwCapture, NULL, CLSCTX_INPROC_SERVER, &IID_IClassFactory, + (void**)&bf); + ok(hr == E_NOINTERFACE, "VfwCapture create failed: %08x, expected E_NOINTERFACE\n", hr); + + /* Same refcount for all VfwCapture interfaces */ + hr = CoCreateInstance(&CLSID_VfwCapture, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, + (void**)&bf); + ok(hr == S_OK, "VfwCapture create failed: %08x, expected S_OK\n", hr); + refcount = IBaseFilter_AddRef(bf); + ok(refcount == 2, "refcount == %u, expected 2\n", refcount); + + hr = IBaseFilter_QueryInterface(bf, &IID_IMediaFilter, (void**)&mf); + ok(hr == S_OK, "QueryInterface for IID_IMediaFilter failed: %08x\n", hr); + refcount = IMediaFilter_AddRef(mf); + ok(refcount == 4, "refcount == %u, expected 4\n", refcount); + refcount = IMediaFilter_Release(mf); + + hr = IBaseFilter_QueryInterface(bf, &IID_IPersist, (void**)&p); + ok(hr == S_OK, "QueryInterface for IID_IPersist failed: %08x\n", hr); + refcount = IPersist_AddRef(p); + ok(refcount == 5, "refcount == %u, expected 5\n", refcount); + refcount = IPersist_Release(p); + + hr = IBaseFilter_QueryInterface(bf, &IID_IPersistPropertyBag, (void**)&ppb); + ok(hr == S_OK, "QueryInterface for IID_IPersistPropertyBag failed: %08x\n", hr); + refcount = IPersistPropertyBag_AddRef(ppb); + ok(refcount == 6, "refcount == %u, expected 6\n", refcount); + refcount = IPersistPropertyBag_Release(ppb); + + hr = IBaseFilter_QueryInterface(bf, &IID_IAMVfwCaptureDialogs, (void**)&amvcd); + todo_wine ok(hr == S_OK, "QueryInterface for IID_IAMVfwCaptureDialogs failed: %08x\n", hr); + if (hr == S_OK) { + refcount = IAMVfwCaptureDialogs_AddRef(amvcd); + ok(refcount == 7, "refcount == %u, expected 7\n", refcount); + refcount = IAMVfwCaptureDialogs_Release(amvcd); + } + + hr = IBaseFilter_QueryInterface(bf, &IID_IAMFilterMiscFlags, (void**)&amfmf); + todo_wine ok(hr == S_OK, "QueryInterface for IID_IAMFilterMiscFlags failed: %08x\n", hr); + if (hr == S_OK) { + refcount = IAMFilterMiscFlags_AddRef(amfmf); + ok(refcount == 8, "refcount == %u, expected 8\n", refcount); + refcount = IAMFilterMiscFlags_Release(amfmf); + } + + hr = IBaseFilter_QueryInterface(bf, &IID_ISpecifyPropertyPages, (void**)&spp); + todo_wine ok(hr == S_OK, "QueryInterface for IID_ISpecifyPropertyPages failed: %08x\n", hr); + if (hr == S_OK) { + refcount = ISpecifyPropertyPages_AddRef(spp); + ok(refcount == 9, "refcount == %u, expected 9\n", refcount); + refcount = ISpecifyPropertyPages_Release(spp); + } + + hr = IBaseFilter_QueryInterface(bf, &IID_IUnknown, (void**)&unk); + ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr); + refcount = IUnknown_AddRef(unk); + todo_wine ok(refcount == 10, "refcount == %u, expected 10\n", refcount); + refcount = IUnknown_Release(unk); + + /* Unsupported interfaces */ + hr = IBaseFilter_QueryInterface(bf, &IID_IAMStreamConfig, (void**)&unk); + todo_wine ok(hr == E_NOINTERFACE, "QueryInterface for IID_IAMStreamConfig failed: %08x\n", hr); + hr = IBaseFilter_QueryInterface(bf, &IID_IAMVideoProcAmp, (void**)&unk); + todo_wine ok(hr == E_NOINTERFACE, "QueryInterface for IID_IAMVideoProcAmp failed: %08x\n", hr); + hr = IBaseFilter_QueryInterface(bf, &IID_IOverlayNotify, (void**)&unk); + ok(hr == E_NOINTERFACE, "QueryInterface for IID_IOverlayNotify failed: %08x\n", hr); + + while (IBaseFilter_Release(bf)); +} + START_TEST(qcap) { if (SUCCEEDED(CoInitialize(NULL))) @@ -1862,6 +2001,7 @@ test_AviMux_QueryInterface(); test_AviMux(arg_c>2 ? arg_v[2] : NULL); test_AviCo(); + test_COM_vfwcapture(); CoUninitialize(); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/qcap/vfwcapture.c wine-staging-1.7.48~ubuntu12.04.1/dlls/qcap/vfwcapture.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/qcap/vfwcapture.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/qcap/vfwcapture.c 2015-07-29 19:28:54.000000000 +0000 @@ -57,17 +57,23 @@ typedef struct VfwCapture { + IUnknown IUnknown_inner; BaseFilter filter; IAMStreamConfig IAMStreamConfig_iface; IAMVideoProcAmp IAMVideoProcAmp_iface; IPersistPropertyBag IPersistPropertyBag_iface; - + IUnknown *outer_unk; BOOL init; Capture *driver_info; IPin * pOutputPin; } VfwCapture; +static inline VfwCapture *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, VfwCapture, IUnknown_inner); +} + static inline VfwCapture *impl_from_BaseFilter(BaseFilter *iface) { return CONTAINING_RECORD(iface, VfwCapture, filter); @@ -102,6 +108,94 @@ const IKsPropertySetVtbl * KSP_VT; } VfwPinImpl; + +/* VfwCapture inner IUnknown */ +static HRESULT WINAPI unknown_inner_QueryInterface(IUnknown *iface, REFIID riid, void **ret_iface) +{ + VfwCapture *This = impl_from_IUnknown(iface); + + TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ret_iface); + + *ret_iface = NULL; + + if (IsEqualIID(riid, &IID_IUnknown)) + *ret_iface = &This->IUnknown_inner; + else if (IsEqualIID(riid, &IID_IPersist) || IsEqualIID(riid, &IID_IMediaFilter) || + IsEqualIID(riid, &IID_IBaseFilter)) + *ret_iface = &This->filter.IBaseFilter_iface; + else if (IsEqualIID(riid, &IID_IPersistPropertyBag)) + *ret_iface = &This->IPersistPropertyBag_iface; + else if (IsEqualIID(riid, &IID_IAMFilterMiscFlags)) + FIXME("IAMFilterMiscFlags not supported yet!\n"); + else if (IsEqualIID(riid, &IID_ISpecifyPropertyPages)) + FIXME("ISpecifyPropertyPages not supported yet!\n"); + else if (IsEqualIID(riid, &IID_IAMVfwCaptureDialogs)) + FIXME("IAMVfwCaptureDialogs not supported yet!\n"); + else if (IsEqualIID(riid, &IID_IAMStreamConfig)) + *ret_iface = &This->IAMStreamConfig_iface; + else if (IsEqualIID(riid, &IID_IAMVideoProcAmp)) + *ret_iface = &This->IAMVideoProcAmp_iface; + else + WARN("(%p, %s, %p): not found\n", This, debugstr_guid(riid), ret_iface); + + if (!*ret_iface) + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown*)*ret_iface); + return S_OK; +} + +static ULONG WINAPI unknown_inner_AddRef(IUnknown *iface) +{ + VfwCapture *This = impl_from_IUnknown(iface); + ULONG ref = BaseFilterImpl_AddRef(&This->filter.IBaseFilter_iface); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI unknown_inner_Release(IUnknown *iface) +{ + VfwCapture *This = impl_from_IUnknown(iface); + ULONG ref = InterlockedDecrement(&This->filter.refCount); + + TRACE("(%p) ref=%d\n", This, ref); + + if (!ref) + { + IPin *conn = NULL; + + TRACE("destroying everything\n"); + if (This->init) + { + if (This->filter.state != State_Stopped) + qcap_driver_stop(This->driver_info, &This->filter.state); + qcap_driver_destroy(This->driver_info); + } + IPin_ConnectedTo(This->pOutputPin, &conn); + if (conn) + { + IPin_Disconnect(conn); + IPin_Disconnect(This->pOutputPin); + IPin_Release(conn); + } + IPin_Release(This->pOutputPin); + BaseFilter_Destroy(&This->filter); + CoTaskMemFree(This); + ObjectRefCount(FALSE); + } + + return ref; +} + +static const IUnknownVtbl unknown_inner_vtbl = +{ + unknown_inner_QueryInterface, + unknown_inner_AddRef, + unknown_inner_Release, +}; + static IPin* WINAPI VfwCapture_GetPin(BaseFilter *iface, int pos) { VfwCapture *This = impl_from_BaseFilter(iface); @@ -130,23 +224,24 @@ TRACE("%p - %p\n", pUnkOuter, phr); - *phr = CLASS_E_NOAGGREGATION; - if (pUnkOuter) - return NULL; *phr = E_OUTOFMEMORY; - pVfwCapture = CoTaskMemAlloc( sizeof(VfwCapture) ); - if (!pVfwCapture) return NULL; BaseFilter_Init(&pVfwCapture->filter, &VfwCapture_Vtbl, &CLSID_VfwCapture, (DWORD_PTR)(__FILE__ ": VfwCapture.csFilter"), &BaseFuncTable); + pVfwCapture->IUnknown_inner.lpVtbl = &unknown_inner_vtbl; pVfwCapture->IAMStreamConfig_iface.lpVtbl = &IAMStreamConfig_VTable; pVfwCapture->IAMVideoProcAmp_iface.lpVtbl = &IAMVideoProcAmp_VTable; pVfwCapture->IPersistPropertyBag_iface.lpVtbl = &IPersistPropertyBag_VTable; pVfwCapture->init = FALSE; + if (pUnkOuter) + pVfwCapture->outer_unk = pUnkOuter; + else + pVfwCapture->outer_unk = &pVfwCapture->IUnknown_inner; + hr = VfwPin_Construct(&pVfwCapture->filter.IBaseFilter_iface, &pVfwCapture->filter.csFilter, &pVfwCapture->pOutputPin); if (FAILED(hr)) @@ -158,86 +253,28 @@ ObjectRefCount(TRUE); *phr = S_OK; - return (IUnknown *)&pVfwCapture->filter.IBaseFilter_iface; + return &pVfwCapture->IUnknown_inner; } -static HRESULT WINAPI VfwCapture_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv) +static HRESULT WINAPI VfwCapture_QueryInterface(IBaseFilter *iface, REFIID riid, void **ret_iface) { VfwCapture *This = impl_from_IBaseFilter(iface); - TRACE("(%s, %p)\n", debugstr_guid(riid), ppv); - *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IPersist) || - IsEqualIID(riid, &IID_IMediaFilter) || - IsEqualIID(riid, &IID_IBaseFilter)) - { - *ppv = &This->filter.IBaseFilter_iface; - } - else if (IsEqualIID(riid, &IID_IAMStreamConfig)) - *ppv = &This->IAMStreamConfig_iface; - else if (IsEqualIID(riid, &IID_IAMVideoProcAmp)) - *ppv = &This->IAMVideoProcAmp_iface; - else if (IsEqualIID(riid, &IID_IPersistPropertyBag)) - *ppv = &This->IPersistPropertyBag_iface; - - if (!IsEqualIID(riid, &IID_IUnknown) && - !IsEqualIID(riid, &IID_IPersist) && - !IsEqualIID(riid, &IID_IPersistPropertyBag) && - !This->init) - { - FIXME("Capture system not initialised when looking for %s, " - "trying it on primary device now\n", debugstr_guid(riid)); - This->driver_info = qcap_driver_init( This->pOutputPin, 0 ); - if (!This->driver_info) - { - ERR("VfwCapture initialisation failed\n"); - return E_UNEXPECTED; - } - This->init = TRUE; - } + return IUnknown_QueryInterface(This->outer_unk, riid, ret_iface); +} - if (*ppv) - { - TRACE("Returning %s interface\n", debugstr_guid(riid)); - IUnknown_AddRef((IUnknown *)(*ppv)); - return S_OK; - } +static ULONG WINAPI VfwCapture_AddRef(IBaseFilter *iface) +{ + VfwCapture *This = impl_from_IBaseFilter(iface); - FIXME("No interface for %s!\n", debugstr_guid(riid)); - return E_NOINTERFACE; + return IUnknown_AddRef(This->outer_unk); } static ULONG WINAPI VfwCapture_Release(IBaseFilter * iface) { VfwCapture *This = impl_from_IBaseFilter(iface); - ULONG refCount = InterlockedDecrement(&This->filter.refCount); - - TRACE("%p->() New refcount: %d\n", This, refCount); - - if (!refCount) - { - BasePin *pin; - TRACE("destroying everything\n"); - if (This->init) - { - if (This->filter.state != State_Stopped) - qcap_driver_stop(This->driver_info, &This->filter.state); - qcap_driver_destroy(This->driver_info); - } - pin = (BasePin*) This->pOutputPin; - if (pin->pConnectedTo != NULL) - { - IPin_Disconnect(pin->pConnectedTo); - IPin_Disconnect(This->pOutputPin); - } - IPin_Release(This->pOutputPin); - BaseFilter_Destroy(&This->filter); - CoTaskMemFree(This); - ObjectRefCount(FALSE); - } - return refCount; + return IUnknown_Release(This->outer_unk); } /** IMediaFilter methods **/ @@ -275,7 +312,7 @@ static const IBaseFilterVtbl VfwCapture_Vtbl = { VfwCapture_QueryInterface, - BaseFilterImpl_AddRef, + VfwCapture_AddRef, VfwCapture_Release, BaseFilterImpl_GetClassID, VfwCapture_Stop, @@ -292,39 +329,26 @@ }; /* AMStreamConfig interface, we only need to implement {G,S}etFormat */ -static HRESULT WINAPI -AMStreamConfig_QueryInterface( IAMStreamConfig * iface, REFIID riid, LPVOID * ppv ) +static HRESULT WINAPI AMStreamConfig_QueryInterface(IAMStreamConfig *iface, REFIID riid, + void **ret_iface) { VfwCapture *This = impl_from_IAMStreamConfig(iface); - TRACE("%p --> %s\n", This, debugstr_guid(riid)); - - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IAMStreamConfig)) - { - IAMStreamConfig_AddRef(iface); - *ppv = iface; - return S_OK; - } - - FIXME("No interface for iid %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; + return IUnknown_QueryInterface(This->outer_unk, riid, ret_iface); } static ULONG WINAPI AMStreamConfig_AddRef( IAMStreamConfig * iface ) { VfwCapture *This = impl_from_IAMStreamConfig(iface); - TRACE("%p --> Forwarding to VfwCapture (%p)\n", iface, This); - return IUnknown_AddRef(&This->filter.IBaseFilter_iface); + return IUnknown_AddRef(This->outer_unk); } static ULONG WINAPI AMStreamConfig_Release( IAMStreamConfig * iface ) { VfwCapture *This = impl_from_IAMStreamConfig(iface); - TRACE("%p --> Forwarding to VfwCapture (%p)\n", iface, This); - return IUnknown_Release(&This->filter.IBaseFilter_iface); + return IUnknown_Release(This->outer_unk); } static HRESULT WINAPI @@ -407,34 +431,26 @@ AMStreamConfig_GetStreamCaps }; -static HRESULT WINAPI -AMVideoProcAmp_QueryInterface( IAMVideoProcAmp * iface, REFIID riid, - LPVOID * ppv ) +static HRESULT WINAPI AMVideoProcAmp_QueryInterface(IAMVideoProcAmp *iface, REFIID riid, + void **ret_iface) { - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IAMVideoProcAmp)) - { - *ppv = iface; - IAMVideoProcAmp_AddRef( iface ); - return S_OK; - } + VfwCapture *This = impl_from_IAMVideoProcAmp(iface); - FIXME("No interface for iid %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; + return IUnknown_QueryInterface(This->outer_unk, riid, ret_iface); } static ULONG WINAPI AMVideoProcAmp_AddRef(IAMVideoProcAmp * iface) { VfwCapture *This = impl_from_IAMVideoProcAmp(iface); - return IUnknown_AddRef(&This->filter.IBaseFilter_iface); + return IUnknown_AddRef(This->outer_unk); } static ULONG WINAPI AMVideoProcAmp_Release(IAMVideoProcAmp * iface) { VfwCapture *This = impl_from_IAMVideoProcAmp(iface); - return IUnknown_Release(&This->filter.IBaseFilter_iface); + return IUnknown_Release(This->outer_unk); } static HRESULT WINAPI @@ -475,45 +491,25 @@ AMVideoProcAmp_Get, }; -static HRESULT WINAPI -PPB_QueryInterface( IPersistPropertyBag * iface, REFIID riid, LPVOID * ppv ) +static HRESULT WINAPI PPB_QueryInterface(IPersistPropertyBag *iface, REFIID riid, void **ret_iface) { - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IPersist) || - IsEqualIID(riid, &IID_IPersistPropertyBag)) - { - IPersistPropertyBag_AddRef(iface); - *ppv = iface; - return S_OK; - } - if (IsEqualIID(riid, &IID_IBaseFilter)) - { - /* FIXME: native devenum asks for IBaseFilter, should we return it? */ - IPersistPropertyBag_AddRef(iface); - *ppv = iface; - return S_OK; - } + VfwCapture *This = impl_from_IPersistPropertyBag(iface); - FIXME("No interface for iid %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; + return IUnknown_QueryInterface(This->outer_unk, riid, ret_iface); } static ULONG WINAPI PPB_AddRef(IPersistPropertyBag * iface) { VfwCapture *This = impl_from_IPersistPropertyBag(iface); - TRACE("%p --> Forwarding to VfwCapture (%p)\n", iface, This); - - return IUnknown_AddRef(&This->filter.IBaseFilter_iface); + return IUnknown_AddRef(This->outer_unk); } static ULONG WINAPI PPB_Release(IPersistPropertyBag * iface) { VfwCapture *This = impl_from_IPersistPropertyBag(iface); - TRACE("%p --> Forwarding to VfwCapture (%p)\n", iface, This); - - return IUnknown_Release(&This->filter.IBaseFilter_iface); + return IUnknown_Release(This->outer_unk); } static HRESULT WINAPI diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/rpcrt4/ndr_clientserver.c wine-staging-1.7.48~ubuntu12.04.1/dlls/rpcrt4/ndr_clientserver.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/rpcrt4/ndr_clientserver.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/rpcrt4/ndr_clientserver.c 2015-07-29 19:28:54.000000000 +0000 @@ -120,6 +120,7 @@ pStubMsg->pPointerQueueState = NULL; pStubMsg->IgnoreEmbeddedPointers = 0; pStubMsg->PointerBufferMark = NULL; + pStubMsg->CorrDespIncrement = 0; pStubMsg->uFlags = 0; pStubMsg->UniquePtrCount = 0; pStubMsg->pfnAllocate = pStubDesc->pfnAllocate; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/rpcrt4/ndr_marshall.c wine-staging-1.7.48~ubuntu12.04.1/dlls/rpcrt4/ndr_marshall.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/rpcrt4/ndr_marshall.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/rpcrt4/ndr_marshall.c 2015-07-29 19:28:54.000000000 +0000 @@ -452,7 +452,7 @@ static inline PFORMAT_STRING SkipConformance(const PMIDL_STUB_MESSAGE pStubMsg, const PFORMAT_STRING pFormat) { - return pStubMsg->fHasNewCorrDesc ? pFormat + 6 : pFormat + 4; + return pFormat + 4 + pStubMsg->CorrDespIncrement; } static PFORMAT_STRING ReadConformance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) @@ -7206,7 +7206,11 @@ */ void WINAPI NdrCorrelationInitialize(PMIDL_STUB_MESSAGE pStubMsg, void *pMemory, ULONG CacheSize, ULONG Flags) { - FIXME("(%p, %p, %d, 0x%x): stub\n", pStubMsg, pMemory, CacheSize, Flags); + FIXME("(%p, %p, %d, 0x%x): semi-stub\n", pStubMsg, pMemory, CacheSize, Flags); + + if (pStubMsg->CorrDespIncrement == 0) + pStubMsg->CorrDespIncrement = 2; /* size of the normal (non-range) /robust payload */ + pStubMsg->fHasNewCorrDesc = TRUE; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/rpcrt4/ndr_stubless.c wine-staging-1.7.48~ubuntu12.04.1/dlls/rpcrt4/ndr_stubless.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/rpcrt4/ndr_stubless.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/rpcrt4/ndr_stubless.c 2015-07-29 19:28:54.000000000 +0000 @@ -736,6 +736,8 @@ { /* initialize extra correlation package */ NdrCorrelationInitialize(&stubMsg, NdrCorrCache, sizeof(NdrCorrCache), 0); + if (ext_flags.Unused & 0x2) /* has range on conformance */ + stubMsg.CorrDespIncrement = 12; } /* order of phases: @@ -1344,8 +1346,9 @@ if (ext_flags.HasNewCorrDesc) { /* initialize extra correlation package */ - FIXME("new correlation description not implemented\n"); - stubMsg.fHasNewCorrDesc = TRUE; + NdrCorrelationInitialize(&stubMsg, NdrCorrCache, sizeof(NdrCorrCache), 0); + if (ext_flags.Unused & 0x2) /* has range on conformance */ + stubMsg.CorrDespIncrement = 12; } } else @@ -1432,7 +1435,7 @@ if (ext_flags.HasNewCorrDesc) { /* free extra correlation package */ - /* NdrCorrelationFree(&stubMsg); */ + NdrCorrelationFree(&stubMsg); } if (Oif_flags.HasPipes) @@ -1619,6 +1622,8 @@ { /* initialize extra correlation package */ NdrCorrelationInitialize(pStubMsg, async_call_data->NdrCorrCache, sizeof(async_call_data->NdrCorrCache), 0); + if (ext_flags.Unused & 0x2) /* has range on conformance */ + pStubMsg->CorrDespIncrement = 12; } /* order of phases: diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/rpcrt4/tests/ndr_marshall.c wine-staging-1.7.48~ubuntu12.04.1/dlls/rpcrt4/tests/ndr_marshall.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/rpcrt4/tests/ndr_marshall.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/rpcrt4/tests/ndr_marshall.c 2015-07-29 19:28:54.000000000 +0000 @@ -1320,9 +1320,9 @@ ok(stubMsg.ReuseBuffer == 0 || broken(stubMsg.ReuseBuffer == 1), /* win2k */ "stubMsg.ReuseBuffer should have been set to zero instead of %d\n", stubMsg.ReuseBuffer); - ok(stubMsg.CorrDespIncrement == 0xcc || - stubMsg.CorrDespIncrement == 0, - "CorrDespIncrement should have been unset instead of 0x%x\n", stubMsg.CorrDespIncrement); + ok(stubMsg.CorrDespIncrement == 0 || + broken(stubMsg.CorrDespIncrement == 0xcc), /* <= Win 2003 */ + "CorrDespIncrement should have been set to zero instead of 0x%x\n", stubMsg.CorrDespIncrement); ok(stubMsg.FullPtrXlatTables == 0, "stubMsg.BufferLength should have been 0 instead of %p\n", stubMsg.FullPtrXlatTables); } @@ -2468,6 +2468,27 @@ ok(status == RPC_S_OK, "got %d\n", status); } +static void test_NdrCorrelationInitialize(void) +{ + MIDL_STUB_MESSAGE stub_msg; + BYTE buf[256]; + + memset( &stub_msg, 0, sizeof(stub_msg) ); + memset( buf, 0, sizeof(buf) ); + + NdrCorrelationInitialize( &stub_msg, buf, sizeof(buf), 0 ); + ok( stub_msg.CorrDespIncrement == 2 || + broken(stub_msg.CorrDespIncrement == 0), /* <= Win 2003 */ + "got %d\n", stub_msg.CorrDespIncrement ); + + memset( &stub_msg, 0, sizeof(stub_msg) ); + memset( buf, 0, sizeof(buf) ); + + stub_msg.CorrDespIncrement = 1; + NdrCorrelationInitialize( &stub_msg, buf, sizeof(buf), 0 ); + ok( stub_msg.CorrDespIncrement == 1, "got %d\n", stub_msg.CorrDespIncrement ); +} + START_TEST( ndr_marshall ) { determine_pointer_marshalling_style(); @@ -2489,4 +2510,5 @@ test_NdrMapCommAndFaultStatus(); test_NdrGetUserMarshalInfo(); test_MesEncodeFixedBufferHandleCreate(); + test_NdrCorrelationInitialize(); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/shell32/shell32_main.c wine-staging-1.7.48~ubuntu12.04.1/dlls/shell32/shell32_main.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/shell32/shell32_main.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/shell32/shell32_main.c 2015-07-29 19:28:54.000000000 +0000 @@ -1378,6 +1378,16 @@ } /*********************************************************************** + * GetCurrentProcessExplicitAppUserModelID (SHELL32.@) + */ +HRESULT WINAPI GetCurrentProcessExplicitAppUserModelID(PWSTR *appid) +{ + FIXME("%p: stub\n", appid); + *appid = NULL; + return E_NOTIMPL; +} + +/*********************************************************************** * SHSetUnreadMailCountW (SHELL32.@) */ HRESULT WINAPI SHSetUnreadMailCountW(LPCWSTR mailaddress, DWORD count, LPCWSTR executecommand) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/shell32/shell32.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/shell32/shell32.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/shell32/shell32.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/shell32/shell32.spec 2015-07-29 19:28:54.000000000 +0000 @@ -310,6 +310,7 @@ @ stdcall FindExecutableW(wstr wstr ptr) @ stub FixupOptionalComponents @ stdcall FreeIconList(long) +@ stdcall GetCurrentProcessExplicitAppUserModelID(ptr) @ stdcall InitNetworkAddressControl() @ stub InternalExtractIconListA @ stub InternalExtractIconListW diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/shell32/shlexec.c wine-staging-1.7.48~ubuntu12.04.1/dlls/shell32/shlexec.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/shell32/shlexec.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/shell32/shlexec.c 2015-07-29 19:28:54.000000000 +0000 @@ -1423,11 +1423,10 @@ return rslt; } -static BOOL SHELL_translate_idlist( LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters, DWORD parametersLen, LPWSTR wszApplicationName, DWORD dwApplicationNameLen ) +static void SHELL_translate_idlist( LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters, DWORD parametersLen, LPWSTR wszApplicationName, DWORD dwApplicationNameLen ) { static const WCHAR wExplorer[] = {'e','x','p','l','o','r','e','r','.','e','x','e',0}; WCHAR buffer[MAX_PATH]; - BOOL appKnownSingular = FALSE; /* last chance to translate IDList: now also allow CLSID paths */ if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW(sei->lpIDList, buffer, sizeof(buffer)/sizeof(WCHAR)))) { @@ -1441,7 +1440,6 @@ ERR("application len exceeds buffer size (%i > %i), truncating\n", lstrlenW(wExplorer) + 1, dwApplicationNameLen); lstrcpynW(wszApplicationName, wExplorer, dwApplicationNameLen); - appKnownSingular = TRUE; sei->fMask &= ~SEE_MASK_INVOKEIDLIST; } else { @@ -1461,12 +1459,10 @@ buffer, target, sei->lpIDList, NULL, &resultLen); if (resultLen > dwApplicationNameLen) ERR("Argify buffer not large enough... truncating\n"); - appKnownSingular = FALSE; } sei->fMask &= ~SEE_MASK_INVOKEIDLIST; } } - return appKnownSingular; } static UINT_PTR SHELL_quote_and_execute( LPCWSTR wcmd, LPCWSTR wszParameters, LPCWSTR wszKeyname, LPCWSTR wszApplicationName, LPWSTR env, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc ) @@ -1558,7 +1554,6 @@ */ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) { - static const WCHAR wSpace[] = {' ',0}; static const WCHAR wWww[] = {'w','w','w',0}; static const WCHAR wHttp[] = {'h','t','t','p',':','/','/',0}; static const DWORD unsupportedFlags = @@ -1574,12 +1569,10 @@ DWORD wcmdLen = sizeof(wcmdBuffer) / sizeof(WCHAR); DWORD len; SHELLEXECUTEINFOW sei_tmp; /* modifiable copy of SHELLEXECUTEINFO struct */ - WCHAR wfileName[MAX_PATH]; WCHAR *env; WCHAR wszKeyname[256]; LPCWSTR lpFile; UINT_PTR retval = SE_ERR_NOASSOC; - BOOL appKnownSingular = FALSE; /* make a local copy of the LPSHELLEXECUTEINFO structure and work with this from now on */ sei_tmp = *sei; @@ -1599,15 +1592,13 @@ wszApplicationName = HeapAlloc(GetProcessHeap(), 0, dwApplicationNameLen*sizeof(WCHAR)); *wszApplicationName = '\0'; } - else if (*sei_tmp.lpFile == '\"') + else if (*sei_tmp.lpFile == '\"' && sei_tmp.lpFile[(len = strlenW(sei_tmp.lpFile))-1] == '\"') { - DWORD l = strlenW(sei_tmp.lpFile+1); - if(l >= dwApplicationNameLen) dwApplicationNameLen = l+1; + if(len-1 >= dwApplicationNameLen) dwApplicationNameLen = len; wszApplicationName = HeapAlloc(GetProcessHeap(), 0, dwApplicationNameLen*sizeof(WCHAR)); - memcpy(wszApplicationName, sei_tmp.lpFile+1, (l+1)*sizeof(WCHAR)); - if (wszApplicationName[l-1] == '\"') - wszApplicationName[l-1] = '\0'; - appKnownSingular = TRUE; + memcpy(wszApplicationName, sei_tmp.lpFile+1, len*sizeof(WCHAR)); + if(len > 2) + wszApplicationName[len-2] = '\0'; TRACE("wszApplicationName=%s\n",debugstr_w(wszApplicationName)); } else { DWORD l = strlenW(sei_tmp.lpFile)+1; @@ -1678,7 +1669,6 @@ } SHGetPathFromIDListW(sei_tmp.lpIDList, wszApplicationName); - appKnownSingular = TRUE; TRACE("-- idlist=%p (%s)\n", sei_tmp.lpIDList, debugstr_w(wszApplicationName)); } @@ -1710,10 +1700,10 @@ /* Has the IDList not yet been translated? */ if (sei_tmp.fMask & SEE_MASK_IDLIST) { - appKnownSingular = SHELL_translate_idlist( &sei_tmp, wszParameters, - parametersLen, - wszApplicationName, - dwApplicationNameLen ); + SHELL_translate_idlist( &sei_tmp, wszParameters, + parametersLen, + wszApplicationName, + dwApplicationNameLen ); } /* convert file URLs */ @@ -1746,7 +1736,6 @@ HeapFree(GetProcessHeap(), 0, wszApplicationName); dwApplicationNameLen = len + 1; wszApplicationName = buf; - /* appKnownSingular unmodified */ sei_tmp.lpFile = wszApplicationName; } @@ -1770,72 +1759,9 @@ /* Else, try to execute the filename */ TRACE("execute:%s,%s,%s\n", debugstr_w(wszApplicationName), debugstr_w(wszParameters), debugstr_w(wszDir)); - - /* separate out command line arguments from executable file name */ - if (!*sei_tmp.lpParameters && !appKnownSingular) { - /* If the executable path is quoted, handle the rest of the command line as parameters. */ - if (sei_tmp.lpFile[0] == '"') { - LPWSTR src = wszApplicationName/*sei_tmp.lpFile*/ + 1; - LPWSTR dst = wfileName; - LPWSTR end; - - /* copy the unquoted executable path to 'wfileName' */ - while(*src && *src!='"') - *dst++ = *src++; - - *dst = '\0'; - - if (*src == '"') { - end = ++src; - - while(isspace(*src)) - ++src; - } else - end = src; - - /* copy the parameter string to 'wszParameters' */ - strcpyW(wszParameters, src); - - /* terminate previous command string after the quote character */ - *end = '\0'; - lpFile = wfileName; - } - else - { - /* If the executable name is not quoted, we have to use this search loop here, - that in CreateProcess() is not sufficient because it does not handle shell links. */ - WCHAR buffer[MAX_PATH], xlpFile[MAX_PATH]; - LPWSTR space, s; - - LPWSTR beg = wszApplicationName/*sei_tmp.lpFile*/; - for(s=beg; (space=strchrW(s, ' ')); s=space+1) { - int idx = space-sei_tmp.lpFile; - memcpy(buffer, sei_tmp.lpFile, idx * sizeof(WCHAR)); - buffer[idx] = '\0'; - - /*FIXME This finds directory paths if the targeted file name contains spaces. */ - if (SearchPathW(*sei_tmp.lpDirectory? sei_tmp.lpDirectory: NULL, buffer, wszExe, sizeof(xlpFile)/sizeof(xlpFile[0]), xlpFile, NULL)) - { - /* separate out command from parameter string */ - LPCWSTR p = space + 1; - - while(isspaceW(*p)) - ++p; - - strcpyW(wszParameters, p); - *space = '\0'; - - break; - } - } - - lpFile = sei_tmp.lpFile; - } - } else - lpFile = sei_tmp.lpFile; - + lpFile = sei_tmp.lpFile; wcmd = wcmdBuffer; - len = lstrlenW(wszApplicationName) + 1; + len = lstrlenW(wszApplicationName) + 3; if (sei_tmp.lpParameters[0]) len += 1 + lstrlenW(wszParameters); if (len > wcmdLen) @@ -1843,10 +1769,15 @@ wcmd = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); wcmdLen = len; } - strcpyW(wcmd, wszApplicationName); + wcmd[0] = '\"'; + len = lstrlenW(wszApplicationName); + memcpy(wcmd+1, wszApplicationName, len * sizeof(WCHAR)); + len++; + wcmd[len++] = '\"'; + wcmd[len] = 0; if (sei_tmp.lpParameters[0]) { - strcatW(wcmd, wSpace); - strcatW(wcmd, wszParameters); + wcmd[len++] = ' '; + strcpyW(wcmd+len, wszParameters); } retval = execfunc(wcmd, NULL, FALSE, &sei_tmp, sei); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/shell32/tests/appbar.c wine-staging-1.7.48~ubuntu12.04.1/dlls/shell32/tests/appbar.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/shell32/tests/appbar.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/shell32/tests/appbar.c 2015-07-29 19:28:54.000000000 +0000 @@ -29,6 +29,7 @@ static const CHAR testwindow_class[] = "testwindow"; static HMONITOR (WINAPI *pMonitorFromWindow)(HWND, DWORD); +static HRESULT (WINAPI *pGetCurrentProcessExplicitAppUserModelID)(PWSTR*); typedef BOOL (*boolean_function)(void); @@ -430,15 +431,39 @@ return; } +static void test_GetCurrentProcessExplicitAppUserModelID(void) +{ + WCHAR *appid; + HRESULT hr; + + if (!pGetCurrentProcessExplicitAppUserModelID) + { + win_skip("GetCurrentProcessExplicitAppUserModelID() is not supported.\n"); + return; + } + +if (0) /* crashes on native */ + hr = pGetCurrentProcessExplicitAppUserModelID(NULL); + + appid = (void*)0xdeadbeef; + hr = pGetCurrentProcessExplicitAppUserModelID(&appid); +todo_wine + ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(appid == NULL, "got %p\n", appid); +} + START_TEST(appbar) { - HMODULE huser32; + HMODULE huser32, hshell32; huser32 = GetModuleHandleA("user32.dll"); + hshell32 = GetModuleHandleA("shell32.dll"); pMonitorFromWindow = (void*)GetProcAddress(huser32, "MonitorFromWindow"); + pGetCurrentProcessExplicitAppUserModelID = (void*)GetProcAddress(hshell32, "GetCurrentProcessExplicitAppUserModelID"); register_testwindow_class(); test_setpos(); test_appbarget(); + test_GetCurrentProcessExplicitAppUserModelID(); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/shell32/tests/shlexec.c wine-staging-1.7.48~ubuntu12.04.1/dlls/shell32/tests/shlexec.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/shell32/tests/shlexec.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/shell32/tests/shlexec.c 2015-07-29 19:28:54.000000000 +0000 @@ -902,9 +902,11 @@ {"QuotedUpperL", "%s\\test file.shlexec", 0x0, 33}, /* Test file masked due to space */ - {NULL, "%s\\masked file.shlexec", 0x1, 33}, + {NULL, "%s\\masked file.shlexec", 0x0, 33}, /* Test if quoting prevents the masking */ {NULL, "%s\\masked file.shlexec", 0x40, 33}, + /* Test with incorrect quote */ + {NULL, "\"%s\\masked file.shlexec", 0x0, SE_ERR_FNF}, {NULL, NULL, 0} }; @@ -933,7 +935,7 @@ /* existing "drawback_file.noassoc" prevents finding "drawback_file.noassoc foo.shlexec" on wine */ sprintf(fileA, "%s\\drawback_file.noassoc foo.shlexec", tmpdir); rc=shell_execute(NULL, fileA, NULL, NULL); - todo_wine ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc); + ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc); /* if quoted, existing "drawback_file.noassoc" not prevents finding "drawback_file.noassoc foo.shlexec" on wine */ sprintf(fileA, "\"%s\\drawback_file.noassoc foo.shlexec\"", tmpdir); @@ -1542,18 +1544,10 @@ } if (rc > 32) rc=33; - if ((test->todo & 0x1)==0) - { - ok(rc==test->rc || - broken(quotedfile && rc == SE_ERR_FNF), /* NT4 */ - "%s failed: rc=%ld err=%u\n", shell_call, - rc, GetLastError()); - } - else todo_wine - { - ok(rc==test->rc, "%s failed: rc=%ld err=%u\n", shell_call, - rc, GetLastError()); - } + ok(rc==test->rc || + broken(quotedfile && rc == SE_ERR_FNF), /* NT4 */ + "%s failed: rc=%ld err=%u\n", shell_call, + rc, GetLastError()); if (rc == 33) { const char* verb; @@ -2122,6 +2116,15 @@ { win_skip("Skipping shellexecute of file with unassociated extension\n"); } + + /* test combining executable and parameters */ + sprintf(filename, "%s shlexec \"%s\" Exec", argv0, child_file); + rc = shell_execute(NULL, filename, NULL, NULL); + ok(rc == SE_ERR_FNF, "%s returned %lu\n", shell_call, rc); + + sprintf(filename, "\"%s\" shlexec \"%s\" Exec", argv0, child_file); + rc = shell_execute(NULL, filename, NULL, NULL); + ok(rc == SE_ERR_FNF, "%s returned %lu\n", shell_call, rc); } typedef struct diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/listbox.c wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/listbox.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/listbox.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/listbox.c 2015-07-29 19:28:54.000000000 +0000 @@ -319,7 +319,8 @@ ScrollWindowEx( descr->self, 0, diff, NULL, NULL, 0, NULL, SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN ); } - if (!scroll) InvalidateRect( descr->self, NULL, TRUE ); + else + InvalidateRect( descr->self, NULL, TRUE ); descr->top_item = index; LISTBOX_UpdateScroll( descr ); return LB_OKAY; @@ -2854,7 +2855,7 @@ case LB_SETCURSEL: if (IS_MULTISELECT(descr)) return LB_ERR; - LISTBOX_SetCaretIndex( descr, wParam, FALSE ); + LISTBOX_SetCaretIndex( descr, wParam, TRUE ); ret = LISTBOX_SetSelection( descr, wParam, TRUE, FALSE ); if (ret != LB_ERR) ret = descr->selected_item; return ret; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/misc.c wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/misc.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/misc.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/misc.c 2015-07-29 19:28:54.000000000 +0000 @@ -717,7 +717,16 @@ HPOWERNOTIFY WINAPI RegisterPowerSettingNotification(HANDLE recipient, const GUID *guid, DWORD flags) { FIXME("(%p,%s,%x): stub\n", recipient, debugstr_guid(guid), flags); - return NULL; + return (HPOWERNOTIFY)0xdeadbeef; +} + +/********************************************************************** + * UnregisterPowerSettingNotification [USER32.@] + */ +BOOL WINAPI UnregisterPowerSettingNotification(HPOWERNOTIFY handle) +{ + FIXME("(%p): stub\n", handle); + return TRUE; } /********************************************************************** diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/sysparams.c wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/sysparams.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/sysparams.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/sysparams.c 2015-07-29 19:28:54.000000000 +0000 @@ -621,6 +621,20 @@ return display_dpi; } +static INT CALLBACK real_fontname_proc(const LOGFONTW *lf, const TEXTMETRICW *ntm, DWORD type, LPARAM lparam) +{ + const ENUMLOGFONTW *elf = (const ENUMLOGFONTW *)lf; + LOGFONTW *lfW = (LOGFONTW *)lparam; + + lstrcpynW(lfW->lfFaceName, elf->elfFullName, LF_FACESIZE); + return 0; +} + +static void get_real_fontname(LOGFONTW *lf) +{ + EnumFontFamiliesExW(get_display_dc(), lf, real_fontname_proc, (LPARAM)lf, 0); +} + /* adjust some of the raw values found in the registry */ static void normalize_nonclientmetrics( NONCLIENTMETRICSW *pncm) { @@ -633,10 +647,16 @@ /* adjust some heights to the corresponding font */ get_text_metr_size( get_display_dc(), &pncm->lfMenuFont, &tm, NULL); pncm->iMenuHeight = max( pncm->iMenuHeight, 2 + tm.tmHeight + tm.tmExternalLeading ); + get_real_fontname( &pncm->lfMenuFont ); get_text_metr_size( get_display_dc(), &pncm->lfCaptionFont, &tm, NULL); pncm->iCaptionHeight = max( pncm->iCaptionHeight, 2 + tm.tmHeight); + get_real_fontname( &pncm->lfCaptionFont ); get_text_metr_size( get_display_dc(), &pncm->lfSmCaptionFont, &tm, NULL); pncm->iSmCaptionHeight = max( pncm->iSmCaptionHeight, 2 + tm.tmHeight); + get_real_fontname( &pncm->lfSmCaptionFont ); + + get_real_fontname( &pncm->lfStatusFont ); + get_real_fontname( &pncm->lfMessageFont ); } static BOOL CALLBACK enum_monitors( HMONITOR monitor, HDC hdc, LPRECT rect, LPARAM lp ) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/tests/listbox.c wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/tests/listbox.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/tests/listbox.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/tests/listbox.c 2015-07-29 19:28:54.000000000 +0000 @@ -349,7 +349,7 @@ ok(exp.caret == got.caret, "expected caret %d, got %d\n", exp.caret, got.caret); \ ok(exp.selcount == got.selcount, "expected selcount %d, got %d\n", exp.selcount, got.selcount); -static void test_selection(void) +static void test_LB_SELITEMRANGE(void) { static const struct listbox_stat test_nosel = { 0, LB_ERR, 0, 0 }; static const struct listbox_stat test_1 = { 0, LB_ERR, 0, 2 }; @@ -429,6 +429,34 @@ DestroyWindow(hLB); } +static void test_LB_SETCURSEL(void) +{ + HWND parent, hLB; + INT ret; + + trace("testing LB_SETCURSEL\n"); + + parent = create_parent(); + assert(parent); + + hLB = create_listbox(LBS_NOINTEGRALHEIGHT | WS_CHILD, parent); + assert(hLB); + + SendMessageA(hLB, LB_SETITEMHEIGHT, 0, 32); + + ret = SendMessageA(hLB, LB_SETCURSEL, 2, 0); + ok(ret == 2, "LB_SETCURSEL returned %d instead of 2\n", ret); + ret = GetScrollPos(hLB, SB_VERT); + ok(ret == 0, "expected vscroll 0, got %d\n", ret); + + ret = SendMessageA(hLB, LB_SETCURSEL, 3, 0); + ok(ret == 3, "LB_SETCURSEL returned %d instead of 3\n", ret); + ret = GetScrollPos(hLB, SB_VERT); + ok(ret == 1, "expected vscroll 1, got %d\n", ret); + + DestroyWindow(hLB); +} + static void test_listbox_height(void) { HWND hList; @@ -1766,7 +1794,8 @@ check_item_height(); test_ownerdraw(); - test_selection(); + test_LB_SELITEMRANGE(); + test_LB_SETCURSEL(); test_listbox_height(); test_itemfrompoint(); test_listbox_item_data(); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/tests/msg.c wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/tests/msg.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/tests/msg.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/tests/msg.c 2015-07-29 19:28:54.000000000 +0000 @@ -3209,7 +3209,7 @@ { 0 } }; /* ShowWindow(SW_RESTORE) for a not visible MDI child window */ -static const struct message WmRestoreMDIchildInisibleSeq[] = { +static const struct message WmRestoreMDIchildInvisibleSeq[] = { { HCBT_MINMAX, hook|lparam, 0, SW_RESTORE }, { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED|SWP_STATECHANGED }, { WM_NCCALCSIZE, sent|wparam, 1 }, @@ -3537,7 +3537,7 @@ ok_sequence(WmHideChildSeq, "ShowWindow(SW_HIDE):MDI child", FALSE); ShowWindow(mdi_child2, SW_RESTORE); - ok_sequence(WmRestoreMDIchildInisibleSeq, "ShowWindow(SW_RESTORE):invisible MDI child", FALSE); + ok_sequence(WmRestoreMDIchildInvisibleSeq, "ShowWindow(SW_RESTORE):invisible MDI child", FALSE); flush_sequence(); ok(GetWindowLongA(mdi_child2, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n"); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/tests/sysparams.c wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/tests/sysparams.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/tests/sysparams.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/tests/sysparams.c 2015-07-29 19:28:54.000000000 +0000 @@ -2650,6 +2650,23 @@ ok( !( exp1 != act && exp2 != act && exp3 != act),"GetSystemMetrics(%s): expected %d or %d or %d actual %d\n", #i, exp1, exp2, exp3, act);\ } +static INT CALLBACK enum_all_fonts_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lparam) +{ + return lstrcmpiA(elf->lfFaceName, (const char *)lparam); +} + +static BOOL is_font_enumerated(const char *name) +{ + HDC hdc = CreateCompatibleDC(0); + BOOL ret = FALSE; + + if (!EnumFontFamiliesA(hdc, NULL, enum_all_fonts_proc, (LPARAM)name)) + ret = TRUE; + + DeleteDC(hdc); + return ret; +} + static void test_GetSystemMetrics( void) { TEXTMETRICA tmMenuFont; @@ -2691,6 +2708,13 @@ win_skip("SPI_GETNONCLIENTMETRICS is not available\n"); return; } + + ok(is_font_enumerated(ncm.lfCaptionFont.lfFaceName), "font %s should be enumerated\n", ncm.lfCaptionFont.lfFaceName); + ok(is_font_enumerated(ncm.lfSmCaptionFont.lfFaceName), "font %s should be enumerated\n", ncm.lfSmCaptionFont.lfFaceName); + ok(is_font_enumerated(ncm.lfMenuFont.lfFaceName), "font %s should be enumerated\n", ncm.lfMenuFont.lfFaceName); + ok(is_font_enumerated(ncm.lfStatusFont.lfFaceName), "font %s should be enumerated\n", ncm.lfStatusFont.lfFaceName); + ok(is_font_enumerated(ncm.lfMessageFont.lfFaceName), "font %s should be enumerated\n", ncm.lfMessageFont.lfFaceName); + /* CaptionWidth from the registry may have different value of iCaptionWidth * from the non client metrics (observed on WinXP) */ CaptionWidthfromreg = metricfromreg( diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/tests/win.c wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/tests/win.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/tests/win.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/tests/win.c 2015-07-29 19:28:54.000000000 +0000 @@ -717,6 +717,13 @@ CloseHandle( handle ); } +static struct wm_gettext_override_data +{ + BOOL enabled; /* when 1 bypasses default procedure */ + char *buff; /* expected text buffer pointer */ + WCHAR *buffW; /* same, for W test */ +} g_wm_gettext_override; + static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) @@ -798,6 +805,13 @@ break; case WM_GETTEXT: num_gettext_msgs++; + if (g_wm_gettext_override.enabled) + { + char *text = (char*)lparam; + ok(g_wm_gettext_override.buff == text, "expected buffer %p, got %p\n", g_wm_gettext_override.buff, text); + ok(*text == 0, "expected empty string buffer %x\n", *text); + return 0; + } break; case WM_SETTEXT: num_settext_msgs++; @@ -807,6 +821,25 @@ return DefWindowProcA(hwnd, msg, wparam, lparam); } +static LRESULT WINAPI main_window_procW(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + switch (msg) + { + case WM_GETTEXT: + num_gettext_msgs++; + if (g_wm_gettext_override.enabled) + { + WCHAR *text = (WCHAR*)lparam; + ok(g_wm_gettext_override.buffW == text, "expected buffer %p, got %p\n", g_wm_gettext_override.buffW, text); + ok(*text == 0, "expected empty string buffer %x\n", *text); + return 0; + } + break; + } + + return DefWindowProcA(hwnd, msg, wparam, lparam); +} + static LRESULT WINAPI tool_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) @@ -832,8 +865,11 @@ return DefWindowProcA(hwnd, msg, wparam, lparam); } +static const WCHAR mainclassW[] = {'M','a','i','n','W','i','n','d','o','w','C','l','a','s','s','W',0}; + static BOOL RegisterWindowClasses(void) { + WNDCLASSW clsW; WNDCLASSA cls; cls.style = CS_DBLCLKS; @@ -849,6 +885,19 @@ if(!RegisterClassA(&cls)) return FALSE; + clsW.style = CS_DBLCLKS; + clsW.lpfnWndProc = main_window_procW; + clsW.cbClsExtra = 0; + clsW.cbWndExtra = 0; + clsW.hInstance = GetModuleHandleA(0); + clsW.hIcon = 0; + clsW.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); + clsW.hbrBackground = GetStockObject(WHITE_BRUSH); + clsW.lpszMenuName = NULL; + clsW.lpszClassName = mainclassW; + + if(!RegisterClassW(&clsW)) return FALSE; + cls.style = 0; cls.lpfnWndProc = tool_window_procA; cls.cbClsExtra = 0; @@ -5726,11 +5775,12 @@ static void test_gettext(void) { DWORD tid, num_msgs; + WCHAR bufW[32]; HANDLE thread; BOOL success; char buf[32]; INT buf_len; - HWND hwnd; + HWND hwnd, hwnd2; LRESULT r; MSG msg; @@ -5745,6 +5795,68 @@ ok( !strcmp(buf, "caption"), "got wrong window text '%s'\n", buf ); ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs ); + /* other process window */ + strcpy( buf, "a" ); + buf_len = GetWindowTextA( GetDesktopWindow(), buf, sizeof(buf) ); + ok( buf_len == 0, "expected a nonempty window text\n" ); + ok( *buf == 0, "got wrong window text '%s'\n", buf ); + + strcpy( buf, "blah" ); + buf_len = GetWindowTextA( GetDesktopWindow(), buf, 0 ); + ok( buf_len == 0, "expected a nonempty window text\n" ); + ok( !strcmp(buf, "blah"), "got wrong window text '%s'\n", buf ); + + bufW[0] = 0xcc; + buf_len = GetWindowTextW( GetDesktopWindow(), bufW, 0 ); + ok( buf_len == 0, "expected a nonempty window text\n" ); + ok( bufW[0] == 0xcc, "got %x\n", bufW[0] ); + + g_wm_gettext_override.enabled = TRUE; + + num_gettext_msgs = 0; + memset( buf, 0xcc, sizeof(buf) ); + g_wm_gettext_override.buff = buf; + buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) ); + ok( buf_len == 0, "got %d\n", buf_len ); + ok( *buf == 0, "got %x\n", *buf ); + ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs ); + + num_gettext_msgs = 0; + strcpy( buf, "blah" ); + g_wm_gettext_override.buff = buf; + buf_len = GetWindowTextA( hwnd, buf, 0 ); + ok( buf_len == 0, "got %d\n", buf_len ); + ok( !strcmp(buf, "blah"), "got %s\n", buf ); + ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs ); + + g_wm_gettext_override.enabled = FALSE; + + /* same for W window */ + hwnd2 = CreateWindowExW( 0, mainclassW, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, NULL ); + ok( hwnd2 != 0, "CreateWindowExA error %d\n", GetLastError() ); + + g_wm_gettext_override.enabled = TRUE; + + num_gettext_msgs = 0; + memset( bufW, 0xcc, sizeof(bufW) ); + g_wm_gettext_override.buffW = bufW; + buf_len = GetWindowTextW( hwnd2, bufW, sizeof(bufW)/sizeof(WCHAR) ); + ok( buf_len == 0, "got %d\n", buf_len ); + ok( *bufW == 0, "got %x\n", *bufW ); + ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs ); + + num_gettext_msgs = 0; + memset( bufW, 0xcc, sizeof(bufW) ); + g_wm_gettext_override.buffW = bufW; + buf_len = GetWindowTextW( hwnd2, bufW, 0 ); + ok( buf_len == 0, "got %d\n", buf_len ); + ok( *bufW == 0xcccc, "got %x\n", *bufW ); + ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs ); + + g_wm_gettext_override.enabled = FALSE; + + DestroyWindow( hwnd2 ); + /* test WM_GETTEXT */ num_gettext_msgs = 0; memset( buf, 0, sizeof(buf) ); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/user32.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/user32.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/user32.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/user32.spec 2015-07-29 19:28:54.000000000 +0000 @@ -736,6 +736,7 @@ @ stdcall UnregisterDeviceNotification(long) @ stdcall UnregisterHotKey(long long) # @ stub UnregisterMessagePumpHook +@ stdcall UnregisterPowerSettingNotification(ptr) # @ stub UnregisterUserApiHook @ stdcall UpdateLayeredWindow(long long ptr ptr long ptr long ptr long) @ stdcall UpdateLayeredWindowIndirect(long ptr) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/win.c wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/win.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/user32/win.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/user32/win.c 2015-07-29 19:28:54.000000000 +0000 @@ -2676,13 +2676,15 @@ { WCHAR *buffer; - if (!lpString) return 0; + if (!lpString || nMaxCount <= 0) return 0; if (WIN_IsCurrentProcess( hwnd )) + { + lpString[0] = 0; return (INT)SendMessageA( hwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString ); + } /* when window belongs to other process, don't send a message */ - if (nMaxCount <= 0) return 0; if (!(buffer = HeapAlloc( GetProcessHeap(), 0, nMaxCount * sizeof(WCHAR) ))) return 0; get_server_window_text( hwnd, buffer, nMaxCount ); if (!WideCharToMultiByte( CP_ACP, 0, buffer, -1, lpString, nMaxCount, NULL, NULL )) @@ -2721,13 +2723,15 @@ */ INT WINAPI GetWindowTextW( HWND hwnd, LPWSTR lpString, INT nMaxCount ) { - if (!lpString) return 0; + if (!lpString || nMaxCount <= 0) return 0; if (WIN_IsCurrentProcess( hwnd )) + { + lpString[0] = 0; return (INT)SendMessageW( hwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString ); + } /* when window belongs to other process, don't send a message */ - if (nMaxCount <= 0) return 0; get_server_window_text( hwnd, lpString, nMaxCount ); return strlenW(lpString); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/vcomp/main.c wine-staging-1.7.48~ubuntu12.04.1/dlls/vcomp/main.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/vcomp/main.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/vcomp/main.c 2015-07-29 19:28:54.000000000 +0000 @@ -3,6 +3,8 @@ * vcomp implementation * * Copyright 2011 Austin English + * Copyright 2012 Dan Kegel + * Copyright 2015 Sebastian Lackner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,15 +22,358 @@ */ #include "config.h" +#include "wine/port.h" #include +#include #include "windef.h" #include "winbase.h" #include "wine/debug.h" +#include "wine/list.h" WINE_DEFAULT_DEBUG_CHANNEL(vcomp); +static struct list vcomp_idle_threads = LIST_INIT(vcomp_idle_threads); +static DWORD vcomp_context_tls = TLS_OUT_OF_INDEXES; +static HMODULE vcomp_module; +static int vcomp_max_threads; +static int vcomp_num_threads; +static BOOL vcomp_nested_fork = FALSE; + +static RTL_CRITICAL_SECTION vcomp_section; +static RTL_CRITICAL_SECTION_DEBUG critsect_debug = +{ + 0, 0, &vcomp_section, + { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": vcomp_section") } +}; +static RTL_CRITICAL_SECTION vcomp_section = { &critsect_debug, -1, 0, 0, 0, 0 }; + +struct vcomp_thread_data +{ + struct vcomp_team_data *team; + struct vcomp_task_data *task; + int thread_num; + BOOL parallel; + int fork_threads; + + /* only used for concurrent tasks */ + struct list entry; + CONDITION_VARIABLE cond; + + /* section */ + unsigned int section; +}; + +struct vcomp_team_data +{ + CONDITION_VARIABLE cond; + int num_threads; + int finished_threads; + + /* callback arguments */ + int nargs; + void *wrapper; + __ms_va_list valist; + + /* barrier */ + unsigned int barrier; + int barrier_count; +}; + +struct vcomp_task_data +{ + /* section */ + unsigned int section; + int num_sections; + int section_index; +}; + +#if defined(__i386__) + +extern void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args); +__ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper, + "pushl %ebp\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") + __ASM_CFI(".cfi_rel_offset %ebp,0\n\t") + "movl %esp,%ebp\n\t" + __ASM_CFI(".cfi_def_cfa_register %ebp\n\t") + "pushl %esi\n\t" + __ASM_CFI(".cfi_rel_offset %esi,-4\n\t") + "pushl %edi\n\t" + __ASM_CFI(".cfi_rel_offset %edi,-8\n\t") + "movl 12(%ebp),%edx\n\t" + "movl %esp,%edi\n\t" + "shll $2,%edx\n\t" + "jz 1f\n\t" + "subl %edx,%edi\n\t" + "andl $~15,%edi\n\t" + "movl %edi,%esp\n\t" + "movl 12(%ebp),%ecx\n\t" + "movl 16(%ebp),%esi\n\t" + "cld\n\t" + "rep; movsl\n" + "1:\tcall *8(%ebp)\n\t" + "leal -8(%ebp),%esp\n\t" + "popl %edi\n\t" + __ASM_CFI(".cfi_same_value %edi\n\t") + "popl %esi\n\t" + __ASM_CFI(".cfi_same_value %esi\n\t") + "popl %ebp\n\t" + __ASM_CFI(".cfi_def_cfa %esp,4\n\t") + __ASM_CFI(".cfi_same_value %ebp\n\t") + "ret" ) + +#elif defined(__x86_64__) + +extern void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args); +__ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper, + "pushq %rbp\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset 8\n\t") + __ASM_CFI(".cfi_rel_offset %rbp,0\n\t") + "movq %rsp,%rbp\n\t" + __ASM_CFI(".cfi_def_cfa_register %rbp\n\t") + "pushq %rsi\n\t" + __ASM_CFI(".cfi_rel_offset %rsi,-8\n\t") + "pushq %rdi\n\t" + __ASM_CFI(".cfi_rel_offset %rdi,-16\n\t") + "movq %rcx,%rax\n\t" + "movq $4,%rcx\n\t" + "cmp %rcx,%rdx\n\t" + "cmovgq %rdx,%rcx\n\t" + "leaq 0(,%rcx,8),%rdx\n\t" + "subq %rdx,%rsp\n\t" + "andq $~15,%rsp\n\t" + "movq %rsp,%rdi\n\t" + "movq %r8,%rsi\n\t" + "rep; movsq\n\t" + "movq 0(%rsp),%rcx\n\t" + "movq 8(%rsp),%rdx\n\t" + "movq 16(%rsp),%r8\n\t" + "movq 24(%rsp),%r9\n\t" + "callq *%rax\n\t" + "leaq -16(%rbp),%rsp\n\t" + "popq %rdi\n\t" + __ASM_CFI(".cfi_same_value %rdi\n\t") + "popq %rsi\n\t" + __ASM_CFI(".cfi_same_value %rsi\n\t") + __ASM_CFI(".cfi_def_cfa_register %rsp\n\t") + "popq %rbp\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") + __ASM_CFI(".cfi_same_value %rbp\n\t") + "ret") + +#else + +static void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args) +{ + ERR("Not implemented for this architecture\n"); +} + +#endif + +static inline struct vcomp_thread_data *vcomp_get_thread_data(void) +{ + return (struct vcomp_thread_data *)TlsGetValue(vcomp_context_tls); +} + +static inline void vcomp_set_thread_data(struct vcomp_thread_data *thread_data) +{ + TlsSetValue(vcomp_context_tls, thread_data); +} + +static struct vcomp_thread_data *vcomp_init_thread_data(void) +{ + struct vcomp_thread_data *thread_data = vcomp_get_thread_data(); + struct + { + struct vcomp_thread_data thread; + struct vcomp_task_data task; + } *data; + + if (thread_data) return thread_data; + if (!(data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data)))) + { + ERR("could not create thread data\n"); + ExitProcess(1); + } + + data->task.section = 0; + + thread_data = &data->thread; + thread_data->team = NULL; + thread_data->task = &data->task; + thread_data->thread_num = 0; + thread_data->parallel = FALSE; + thread_data->fork_threads = 0; + thread_data->section = 1; + + vcomp_set_thread_data(thread_data); + return thread_data; +} + +static void vcomp_free_thread_data(void) +{ + struct vcomp_thread_data *thread_data = vcomp_get_thread_data(); + if (!thread_data) return; + + HeapFree(GetProcessHeap(), 0, thread_data); + vcomp_set_thread_data(NULL); +} + +void CDECL _vcomp_atomic_add_i4(int *dest, int val) +{ + interlocked_xchg_add(dest, val); +} + +void CDECL _vcomp_atomic_and_i4(int *dest, int val) +{ + int old; + do old = *dest; while (interlocked_cmpxchg(dest, old & val, old) != old); +} + +void CDECL _vcomp_atomic_div_i4(int *dest, int val) +{ + int old; + do old = *dest; while (interlocked_cmpxchg(dest, old / val, old) != old); +} + +void CDECL _vcomp_atomic_div_ui4(unsigned int *dest, unsigned int val) +{ + unsigned int old; + do old = *dest; while (interlocked_cmpxchg((int *)dest, old / val, old) != old); +} + +void CDECL _vcomp_atomic_mul_i4(int *dest, int val) +{ + int old; + do old = *dest; while (interlocked_cmpxchg(dest, old * val, old) != old); +} + +void CDECL _vcomp_atomic_or_i4(int *dest, int val) +{ + int old; + do old = *dest; while (interlocked_cmpxchg(dest, old | val, old) != old); +} + +void CDECL _vcomp_atomic_shl_i4(int *dest, int val) +{ + int old; + do old = *dest; while (interlocked_cmpxchg(dest, old << val, old) != old); +} + +void CDECL _vcomp_atomic_shr_i4(int *dest, int val) +{ + int old; + do old = *dest; while (interlocked_cmpxchg(dest, old >> val, old) != old); +} + +void CDECL _vcomp_atomic_shr_ui4(unsigned int *dest, unsigned int val) +{ + unsigned int old; + do old = *dest; while (interlocked_cmpxchg((int *)dest, old >> val, old) != old); +} + +void CDECL _vcomp_atomic_sub_i4(int *dest, int val) +{ + interlocked_xchg_add(dest, -val); +} + +void CDECL _vcomp_atomic_xor_i4(int *dest, int val) +{ + int old; + do old = *dest; while (interlocked_cmpxchg(dest, old ^ val, old) != old); +} + +void CDECL _vcomp_atomic_add_r4(float *dest, float val) +{ + int old, new; + do + { + old = *(int *)dest; + *(float *)&new = *(float *)&old + val; + } + while (interlocked_cmpxchg((int *)dest, new, old) != old); +} + +void CDECL _vcomp_atomic_div_r4(float *dest, float val) +{ + int old, new; + do + { + old = *(int *)dest; + *(float *)&new = *(float *)&old / val; + } + while (interlocked_cmpxchg((int *)dest, new, old) != old); +} + +void CDECL _vcomp_atomic_mul_r4(float *dest, float val) +{ + int old, new; + do + { + old = *(int *)dest; + *(float *)&new = *(float *)&old * val; + } + while (interlocked_cmpxchg((int *)dest, new, old) != old); +} + +void CDECL _vcomp_atomic_sub_r4(float *dest, float val) +{ + int old, new; + do + { + old = *(int *)dest; + *(float *)&new = *(float *)&old - val; + } + while (interlocked_cmpxchg((int *)dest, new, old) != old); +} + +void CDECL _vcomp_atomic_add_r8(double *dest, double val) +{ + LONG64 old, new; + do + { + old = *(LONG64 *)dest; + *(double *)&new = *(double *)&old + val; + } + while (interlocked_cmpxchg64((LONG64 *)dest, new, old) != old); +} + +void CDECL _vcomp_atomic_div_r8(double *dest, double val) +{ + LONG64 old, new; + do + { + old = *(LONG64 *)dest; + *(double *)&new = *(double *)&old / val; + } + while (interlocked_cmpxchg64((LONG64 *)dest, new, old) != old); +} + +void CDECL _vcomp_atomic_mul_r8(double *dest, double val) +{ + LONG64 old, new; + do + { + old = *(LONG64 *)dest; + *(double *)&new = *(double *)&old * val; + } + while (interlocked_cmpxchg64((LONG64 *)dest, new, old) != old); +} + +void CDECL _vcomp_atomic_sub_r8(double *dest, double val) +{ + LONG64 old, new; + do + { + old = *(LONG64 *)dest; + *(double *)&new = *(double *)&old - val; + } + while (interlocked_cmpxchg64((LONG64 *)dest, new, old) != old); +} + int CDECL omp_get_dynamic(void) { TRACE("stub\n"); @@ -37,14 +382,14 @@ int CDECL omp_get_max_threads(void) { - TRACE("stub\n"); - return 1; + TRACE("()\n"); + return vcomp_max_threads; } int CDECL omp_get_nested(void) { TRACE("stub\n"); - return 0; + return vcomp_nested_fork; } int CDECL omp_get_num_procs(void) @@ -55,14 +400,15 @@ int CDECL omp_get_num_threads(void) { - TRACE("stub\n"); - return 1; + struct vcomp_team_data *team_data = vcomp_init_thread_data()->team; + TRACE("()\n"); + return team_data ? team_data->num_threads : 1; } int CDECL omp_get_thread_num(void) { - TRACE("stub\n"); - return 0; + TRACE("()\n"); + return vcomp_init_thread_data()->thread_num; } /* Time in seconds since "some time in the past" */ @@ -78,22 +424,47 @@ void CDECL omp_set_nested(int nested) { - TRACE("(%d): stub\n", nested); + TRACE("(%d)\n", nested); + vcomp_nested_fork = (nested != 0); } void CDECL omp_set_num_threads(int num_threads) { - TRACE("(%d): stub\n", num_threads); + TRACE("(%d)\n", num_threads); + if (num_threads >= 1) + vcomp_num_threads = num_threads; } void CDECL _vcomp_barrier(void) { - TRACE("stub\n"); + struct vcomp_team_data *team_data = vcomp_init_thread_data()->team; + + TRACE("()\n"); + + if (!team_data) + return; + + EnterCriticalSection(&vcomp_section); + if (++team_data->barrier_count >= team_data->num_threads) + { + team_data->barrier++; + team_data->barrier_count = 0; + WakeAllConditionVariable(&team_data->cond); + } + else + { + unsigned int barrier = team_data->barrier; + while (team_data->barrier == barrier) + SleepConditionVariableCS(&team_data->cond, &vcomp_section, INFINITE); + } + LeaveCriticalSection(&vcomp_section); } void CDECL _vcomp_set_num_threads(int num_threads) { - TRACE("(%d): stub\n", num_threads); + TRACE("(%d)\n", num_threads); + if (num_threads >= 1) + vcomp_init_thread_data()->fork_threads = num_threads; } int CDECL _vcomp_single_begin(int flags) @@ -107,17 +478,366 @@ TRACE("stub\n"); } -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +void CDECL _vcomp_sections_init(int n) { - TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); + struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); + struct vcomp_task_data *task_data = thread_data->task; + + TRACE("(%d)\n", n); - switch (fdwReason) + EnterCriticalSection(&vcomp_section); + thread_data->section++; + if ((int)(thread_data->section - task_data->section) > 0) + { + task_data->section = thread_data->section; + task_data->num_sections = n; + task_data->section_index = 0; + } + LeaveCriticalSection(&vcomp_section); +} + +int CDECL _vcomp_sections_next(void) +{ + struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); + struct vcomp_task_data *task_data = thread_data->task; + int i = -1; + + TRACE("()\n"); + + EnterCriticalSection(&vcomp_section); + if (thread_data->section == task_data->section && + task_data->section_index != task_data->num_sections) + { + i = task_data->section_index++; + } + LeaveCriticalSection(&vcomp_section); + return i; +} + +void CDECL _vcomp_for_static_simple_init(unsigned int first, unsigned int last, int step, + BOOL increment, unsigned int *begin, unsigned int *end) +{ + unsigned int iterations, per_thread, remaining; + struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); + struct vcomp_team_data *team_data = thread_data->team; + int num_threads = team_data ? team_data->num_threads : 1; + int thread_num = thread_data->thread_num; + + TRACE("(%u, %u, %d, %u, %p, %p)\n", first, last, step, increment, begin, end); + + if (num_threads == 1) + { + *begin = first; + *end = last; + return; + } + + if (step <= 0) + { + *begin = 0; + *end = increment ? -1 : 1; + return; + } + + if (increment) + iterations = 1 + (last - first) / step; + else + { + iterations = 1 + (first - last) / step; + step *= -1; + } + + per_thread = iterations / num_threads; + remaining = iterations - per_thread * num_threads; + + if (thread_num < remaining) + per_thread++; + else if (per_thread) + first += remaining * step; + else + { + *begin = first; + *end = first - step; + return; + } + + *begin = first + per_thread * thread_num * step; + *end = *begin + (per_thread - 1) * step; +} + +void CDECL _vcomp_for_static_init(int first, int last, int step, int chunksize, unsigned int *loops, + int *begin, int *end, int *next, int *lastchunk) +{ + unsigned int iterations, num_chunks, per_thread, remaining; + struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); + struct vcomp_team_data *team_data = thread_data->team; + int num_threads = team_data ? team_data->num_threads : 1; + int thread_num = thread_data->thread_num; + + TRACE("(%d, %d, %d, %d, %p, %p, %p, %p, %p)\n", + first, last, step, chunksize, loops, begin, end, next, lastchunk); + + if (num_threads == 1 && chunksize != 1) + { + *loops = 1; + *begin = first; + *end = last; + *next = 0; + *lastchunk = first; + return; + } + + if (first == last) + { + *loops = !thread_num; + if (!thread_num) + { + *begin = first; + *end = last; + *next = 0; + *lastchunk = first; + } + return; + } + + if (step <= 0) + { + *loops = 0; + return; + } + + if (first < last) + iterations = 1 + (last - first) / step; + else + { + iterations = 1 + (first - last) / step; + step *= -1; + } + + if (chunksize < 1) + chunksize = 1; + + num_chunks = ((DWORD64)iterations + chunksize - 1) / chunksize; + per_thread = num_chunks / num_threads; + remaining = num_chunks - per_thread * num_threads; + + *loops = per_thread + (thread_num < remaining); + *begin = first + thread_num * chunksize * step; + *end = *begin + (chunksize - 1) * step; + *next = chunksize * num_threads * step; + *lastchunk = first + (num_chunks - 1) * chunksize * step; +} + +void CDECL _vcomp_for_static_end(void) +{ + TRACE("()\n"); + /* nothing to do here */ +} + +int CDECL omp_in_parallel(void) +{ + TRACE("()\n"); + return vcomp_init_thread_data()->parallel; +} + +static DWORD WINAPI _vcomp_fork_worker(void *param) +{ + struct vcomp_thread_data *thread_data = param; + vcomp_set_thread_data(thread_data); + + TRACE("starting worker thread for %p\n", thread_data); + + EnterCriticalSection(&vcomp_section); + for (;;) + { + struct vcomp_team_data *team = thread_data->team; + if (team != NULL) + { + LeaveCriticalSection(&vcomp_section); + _vcomp_fork_call_wrapper(team->wrapper, team->nargs, team->valist); + EnterCriticalSection(&vcomp_section); + + thread_data->team = NULL; + list_remove(&thread_data->entry); + list_add_tail(&vcomp_idle_threads, &thread_data->entry); + if (++team->finished_threads >= team->num_threads) + WakeAllConditionVariable(&team->cond); + } + + if (!SleepConditionVariableCS(&thread_data->cond, &vcomp_section, 5000) && + GetLastError() == ERROR_TIMEOUT && !thread_data->team) + { + break; + } + } + list_remove(&thread_data->entry); + LeaveCriticalSection(&vcomp_section); + + TRACE("terminating worker thread for %p\n", thread_data); + + HeapFree(GetProcessHeap(), 0, thread_data); + vcomp_set_thread_data(NULL); + FreeLibraryAndExitThread(vcomp_module, 0); + return 0; +} + +void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) +{ + struct vcomp_thread_data *prev_thread_data = vcomp_init_thread_data(); + struct vcomp_thread_data thread_data; + struct vcomp_team_data team_data; + struct vcomp_task_data task_data; + int num_threads; + + TRACE("(%d, %d, %p, ...)\n", ifval, nargs, wrapper); + + if (prev_thread_data->parallel && !vcomp_nested_fork) + ifval = FALSE; + + if (!ifval) + num_threads = 1; + else if (prev_thread_data->fork_threads) + num_threads = prev_thread_data->fork_threads; + else + num_threads = vcomp_num_threads; + + InitializeConditionVariable(&team_data.cond); + team_data.num_threads = 1; + team_data.finished_threads = 0; + team_data.nargs = nargs; + team_data.wrapper = wrapper; + __ms_va_start(team_data.valist, wrapper); + team_data.barrier = 0; + team_data.barrier_count = 0; + + task_data.section = 0; + + thread_data.team = &team_data; + thread_data.task = &task_data; + thread_data.thread_num = 0; + thread_data.parallel = ifval || prev_thread_data->parallel; + thread_data.fork_threads = 0; + thread_data.section = 1; + list_init(&thread_data.entry); + InitializeConditionVariable(&thread_data.cond); + + if (num_threads > 1) + { + struct list *ptr; + EnterCriticalSection(&vcomp_section); + + /* reuse existing threads (if any) */ + while (team_data.num_threads < num_threads && (ptr = list_head(&vcomp_idle_threads))) + { + struct vcomp_thread_data *data = LIST_ENTRY(ptr, struct vcomp_thread_data, entry); + data->team = &team_data; + data->task = &task_data; + data->thread_num = team_data.num_threads++; + data->parallel = thread_data.parallel; + data->fork_threads = 0; + data->section = 1; + list_remove(&data->entry); + list_add_tail(&thread_data.entry, &data->entry); + WakeAllConditionVariable(&data->cond); + } + + /* spawn additional threads */ + while (team_data.num_threads < num_threads) + { + struct vcomp_thread_data *data; + HMODULE module; + HANDLE thread; + + data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data)); + if (!data) break; + + data->team = &team_data; + data->task = &task_data; + data->thread_num = team_data.num_threads; + data->parallel = thread_data.parallel; + data->fork_threads = 0; + data->section = 1; + InitializeConditionVariable(&data->cond); + + thread = CreateThread(NULL, 0, _vcomp_fork_worker, data, 0, NULL); + if (!thread) + { + HeapFree(GetProcessHeap(), 0, data); + break; + } + + GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, + (const WCHAR *)vcomp_module, &module); + team_data.num_threads++; + list_add_tail(&thread_data.entry, &data->entry); + CloseHandle(thread); + } + + LeaveCriticalSection(&vcomp_section); + } + + vcomp_set_thread_data(&thread_data); + _vcomp_fork_call_wrapper(team_data.wrapper, team_data.nargs, team_data.valist); + vcomp_set_thread_data(prev_thread_data); + prev_thread_data->fork_threads = 0; + + if (team_data.num_threads > 1) + { + EnterCriticalSection(&vcomp_section); + + team_data.finished_threads++; + while (team_data.finished_threads < team_data.num_threads) + SleepConditionVariableCS(&team_data.cond, &vcomp_section, INFINITE); + + LeaveCriticalSection(&vcomp_section); + assert(list_empty(&thread_data.entry)); + } + + __ms_va_end(team_data.valist); +} + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) +{ + TRACE("(%p, %d, %p)\n", instance, reason, reserved); + + switch (reason) { case DLL_WINE_PREATTACH: return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hinstDLL); + { + SYSTEM_INFO sysinfo; + + if ((vcomp_context_tls = TlsAlloc()) == TLS_OUT_OF_INDEXES) + { + ERR("Failed to allocate TLS index\n"); + return FALSE; + } + + GetSystemInfo(&sysinfo); + vcomp_module = instance; + vcomp_max_threads = sysinfo.dwNumberOfProcessors; + vcomp_num_threads = sysinfo.dwNumberOfProcessors; + break; + } + + case DLL_PROCESS_DETACH: + { + if (reserved) break; + if (vcomp_context_tls != TLS_OUT_OF_INDEXES) + { + vcomp_free_thread_data(); + TlsFree(vcomp_context_tls); + } + break; + } + + case DLL_THREAD_DETACH: + { + vcomp_free_thread_data(); break; + } } return TRUE; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/vcomp/tests/Makefile.in wine-staging-1.7.48~ubuntu12.04.1/dlls/vcomp/tests/Makefile.in --- wine-staging-1.7.47~ubuntu12.04.1/dlls/vcomp/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/vcomp/tests/Makefile.in 2015-07-29 19:28:54.000000000 +0000 @@ -0,0 +1,4 @@ +TESTDLL = vcomp.dll + +C_SRCS = \ + vcomp.c diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/vcomp/tests/vcomp.c wine-staging-1.7.48~ubuntu12.04.1/dlls/vcomp/tests/vcomp.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/vcomp/tests/vcomp.c 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/vcomp/tests/vcomp.c 2015-07-29 19:28:54.000000000 +0000 @@ -0,0 +1,1010 @@ +/* + * Unit test suite for vcomp + * + * Copyright 2012 Dan Kegel + * Copyright 2015 Sebastian Lackner + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "wine/test.h" + +static char vcomp_manifest_file[MAX_PATH]; +static HANDLE vcomp_actctx_hctx; +static ULONG_PTR vcomp_actctx_cookie; +static HMODULE vcomp_handle; + +static HANDLE (WINAPI *pCreateActCtxA)(ACTCTXA*); +static BOOL (WINAPI *pActivateActCtx)(HANDLE, ULONG_PTR*); +static BOOL (WINAPI *pDeactivateActCtx)(DWORD, ULONG_PTR); +static VOID (WINAPI *pReleaseActCtx)(HANDLE); + +static void (CDECL *p_vcomp_atomic_add_i4)(int *dest, int val); +static void (CDECL *p_vcomp_atomic_add_r4)(float *dest, float val); +static void (CDECL *p_vcomp_atomic_add_r8)(double *dest, double val); +static void (CDECL *p_vcomp_atomic_and_i4)(int *dest, int val); +static void (CDECL *p_vcomp_atomic_div_i4)(int *dest, int val); +static void (CDECL *p_vcomp_atomic_div_r4)(float *dest, float val); +static void (CDECL *p_vcomp_atomic_div_r8)(double *dest, double val); +static void (CDECL *p_vcomp_atomic_div_ui4)(unsigned int *dest, unsigned int val); +static void (CDECL *p_vcomp_atomic_mul_i4)(int *dest, int val); +static void (CDECL *p_vcomp_atomic_mul_r4)(float *dest, float val); +static void (CDECL *p_vcomp_atomic_mul_r8)(double *dest, double val); +static void (CDECL *p_vcomp_atomic_or_i4)(int *dest, int val); +static void (CDECL *p_vcomp_atomic_shl_i4)(int *dest, int val); +static void (CDECL *p_vcomp_atomic_shr_i4)(int *dest, int val); +static void (CDECL *p_vcomp_atomic_shr_ui4)(unsigned int *dest, unsigned int val); +static void (CDECL *p_vcomp_atomic_sub_i4)(int *dest, int val); +static void (CDECL *p_vcomp_atomic_sub_r4)(float *dest, float val); +static void (CDECL *p_vcomp_atomic_sub_r8)(double *dest, double val); +static void (CDECL *p_vcomp_atomic_xor_i4)(int *dest, int val); +static void (CDECL *p_vcomp_barrier)(void); +static void (CDECL *p_vcomp_for_static_end)(void); +static void (CDECL *p_vcomp_for_static_init)(int first, int last, int step, int chunksize, unsigned int *loops, + int *begin, int *end, int *next, int *lastchunk); +static void (CDECL *p_vcomp_for_static_simple_init)(unsigned int first, unsigned int last, int step, + BOOL increment, unsigned int *begin, unsigned int *end); +static void (WINAPIV *p_vcomp_fork)(BOOL ifval, int nargs, void *wrapper, ...); +static void (CDECL *p_vcomp_sections_init)(int n); +static int (CDECL *p_vcomp_sections_next)(void); +static void (CDECL *p_vcomp_set_num_threads)(int num_threads); +static int (CDECL *pomp_get_max_threads)(void); +static int (CDECL *pomp_get_nested)(void); +static int (CDECL *pomp_get_num_threads)(void); +static int (CDECL *pomp_get_thread_num)(void); +static int (CDECL *pomp_in_parallel)(void); +static void (CDECL *pomp_set_nested)(int nested); +static void (CDECL *pomp_set_num_threads)(int num_threads); + +#ifdef __i386__ +#define ARCH "x86" +#elif defined(__x86_64__) +#define ARCH "amd64" +#else +#define ARCH "none" +#endif + +static const char vcomp_manifest[] = + "\n" + "\n" + " \n" + "Wine vcomp test suite\n" + "\n" + " \n" + " \n" + " \n" + "\n" + "\n"; + +#undef ARCH + +static void create_vcomp_manifest(void) +{ + char temp_path[MAX_PATH]; + HMODULE kernel32; + DWORD written; + ACTCTXA ctx; + HANDLE file; + + kernel32 = GetModuleHandleA("kernel32.dll"); + pCreateActCtxA = (void *)GetProcAddress(kernel32, "CreateActCtxA"); + pActivateActCtx = (void *)GetProcAddress(kernel32, "ActivateActCtx"); + pDeactivateActCtx = (void *)GetProcAddress(kernel32, "DeactivateActCtx"); + pReleaseActCtx = (void *)GetProcAddress(kernel32, "ReleaseActCtx"); + if (!pCreateActCtxA) return; + + if (!GetTempPathA(sizeof(temp_path), temp_path) || + !GetTempFileNameA(temp_path, "vcomp", 0, vcomp_manifest_file)) + { + ok(0, "failed to create manifest file\n"); + return; + } + + file = CreateFileA(vcomp_manifest_file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); + if (file == INVALID_HANDLE_VALUE) + { + ok(0, "failed to open manifest file\n"); + return; + } + + if (!WriteFile(file, vcomp_manifest, sizeof(vcomp_manifest) - 1, &written, NULL)) + written = 0; + CloseHandle(file); + + if (written != sizeof(vcomp_manifest) - 1) + { + ok(0, "failed to write manifest file\n"); + DeleteFileA(vcomp_manifest_file); + return; + } + + memset(&ctx, 0, sizeof(ctx)); + ctx.cbSize = sizeof(ctx); + ctx.lpSource = vcomp_manifest_file; + vcomp_actctx_hctx = pCreateActCtxA(&ctx); + if (!vcomp_actctx_hctx) + { + ok(0, "failed to create activation context\n"); + DeleteFileA(vcomp_manifest_file); + return; + } + + if (!pActivateActCtx(vcomp_actctx_hctx, &vcomp_actctx_cookie)) + { + win_skip("failed to activate context\n"); + pReleaseActCtx(vcomp_actctx_hctx); + DeleteFileA(vcomp_manifest_file); + vcomp_actctx_hctx = NULL; + } +} + +static void release_vcomp(void) +{ + if (vcomp_handle) + FreeLibrary(vcomp_handle); + + if (vcomp_actctx_hctx) + { + pDeactivateActCtx(0, vcomp_actctx_cookie); + pReleaseActCtx(vcomp_actctx_hctx); + DeleteFileA(vcomp_manifest_file); + } +} + +#define VCOMP_GET_PROC(func) \ + do \ + { \ + p ## func = (void *)GetProcAddress(vcomp_handle, #func); \ + if (!p ## func) trace("Failed to get address for %s\n", #func); \ + } \ + while (0) + +static BOOL init_vcomp(void) +{ + create_vcomp_manifest(); + + vcomp_handle = LoadLibraryA("vcomp.dll"); + if (!vcomp_handle) + { + win_skip("vcomp.dll not installed\n"); + release_vcomp(); + return FALSE; + } + + VCOMP_GET_PROC(_vcomp_atomic_add_i4); + VCOMP_GET_PROC(_vcomp_atomic_add_r4); + VCOMP_GET_PROC(_vcomp_atomic_add_r8); + VCOMP_GET_PROC(_vcomp_atomic_and_i4); + VCOMP_GET_PROC(_vcomp_atomic_div_i4); + VCOMP_GET_PROC(_vcomp_atomic_div_r4); + VCOMP_GET_PROC(_vcomp_atomic_div_r8); + VCOMP_GET_PROC(_vcomp_atomic_div_ui4); + VCOMP_GET_PROC(_vcomp_atomic_mul_i4); + VCOMP_GET_PROC(_vcomp_atomic_mul_r4); + VCOMP_GET_PROC(_vcomp_atomic_mul_r8); + VCOMP_GET_PROC(_vcomp_atomic_or_i4); + VCOMP_GET_PROC(_vcomp_atomic_shl_i4); + VCOMP_GET_PROC(_vcomp_atomic_shr_i4); + VCOMP_GET_PROC(_vcomp_atomic_shr_ui4); + VCOMP_GET_PROC(_vcomp_atomic_sub_i4); + VCOMP_GET_PROC(_vcomp_atomic_sub_r4); + VCOMP_GET_PROC(_vcomp_atomic_sub_r8); + VCOMP_GET_PROC(_vcomp_atomic_xor_i4); + VCOMP_GET_PROC(_vcomp_barrier); + VCOMP_GET_PROC(_vcomp_for_static_end); + VCOMP_GET_PROC(_vcomp_for_static_init); + VCOMP_GET_PROC(_vcomp_for_static_simple_init); + VCOMP_GET_PROC(_vcomp_fork); + VCOMP_GET_PROC(_vcomp_sections_init); + VCOMP_GET_PROC(_vcomp_sections_next); + VCOMP_GET_PROC(_vcomp_set_num_threads); + VCOMP_GET_PROC(omp_get_max_threads); + VCOMP_GET_PROC(omp_get_nested); + VCOMP_GET_PROC(omp_get_num_threads); + VCOMP_GET_PROC(omp_get_thread_num); + VCOMP_GET_PROC(omp_in_parallel); + VCOMP_GET_PROC(omp_set_nested); + VCOMP_GET_PROC(omp_set_num_threads); + + return TRUE; +} + +#undef VCOMP_GET_PROC + +static void CDECL num_threads_cb2(int parallel, LONG *count) +{ + int is_parallel = pomp_in_parallel(); + ok(is_parallel == parallel, "expected %d, got %d\n", parallel, is_parallel); + + InterlockedIncrement(count); +} + +static void CDECL num_threads_cb(BOOL nested, int parallel, int nested_threads, LONG *count) +{ + int is_parallel, num_threads, thread_num; + LONG thread_count; + + InterlockedIncrement(count); + p_vcomp_barrier(); + + num_threads = pomp_get_num_threads(); + ok(num_threads == *count, "expected num_threads == %d, got %d\n", *count, num_threads); + thread_num = pomp_get_thread_num(); + ok(thread_num >= 0 && thread_num < num_threads, + "expected thread_num in range [0, %d], got %d\n", num_threads - 1, thread_num); + + is_parallel = pomp_in_parallel(); + ok(is_parallel == parallel, "expected %d, got %d\n", parallel, is_parallel); + + thread_count = 0; + p_vcomp_fork(TRUE, 2, num_threads_cb2, TRUE, &thread_count); + if (nested) + ok(thread_count == nested_threads, "expected %d threads, got %d\n", nested_threads, thread_count); + else + ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + + is_parallel = pomp_in_parallel(); + ok(is_parallel == parallel, "expected %d, got %d\n", parallel, is_parallel); + + thread_count = 0; + p_vcomp_fork(FALSE, 2, num_threads_cb2, parallel, &thread_count); + ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + + is_parallel = pomp_in_parallel(); + ok(is_parallel == parallel, "expected %d, got %d\n", parallel, is_parallel); + + p_vcomp_set_num_threads(4); + thread_count = 0; + p_vcomp_fork(TRUE, 2, num_threads_cb2, TRUE, &thread_count); + if (nested) + ok(thread_count == 4, "expected 4 threads, got %d\n", thread_count); + else + ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + + is_parallel = pomp_in_parallel(); + ok(is_parallel == parallel, "expected %d, got %d\n", parallel, is_parallel); +} + +static void test_omp_get_num_threads(BOOL nested) +{ + int is_nested, is_parallel, max_threads, num_threads, thread_num; + LONG thread_count; + + pomp_set_nested(nested); + is_nested = pomp_get_nested(); + ok(is_nested == nested, "expected %d, got %d\n", nested, is_nested); + + max_threads = pomp_get_max_threads(); + ok(max_threads >= 1, "expected max_threads >= 1, got %d\n", max_threads); + thread_num = pomp_get_thread_num(); + ok(thread_num == 0, "expected thread_num == 0, got %d\n", thread_num); + + is_parallel = pomp_in_parallel(); + ok(is_parallel == FALSE, "expected FALSE, got %d\n", is_parallel); + + num_threads = pomp_get_num_threads(); + ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); + thread_count = 0; + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, max_threads, &thread_count); + ok(thread_count == max_threads, "expected %d threads, got %d\n", max_threads, thread_count); + + is_parallel = pomp_in_parallel(); + ok(is_parallel == FALSE, "expected FALSE, got %d\n", is_parallel); + + num_threads = pomp_get_num_threads(); + ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); + thread_count = 0; + p_vcomp_fork(FALSE, 4, num_threads_cb, TRUE, FALSE, max_threads, &thread_count); + ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + + is_parallel = pomp_in_parallel(); + ok(is_parallel == FALSE, "expected FALSE, got %d\n", is_parallel); + + pomp_set_num_threads(1); + num_threads = pomp_get_num_threads(); + ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); + thread_count = 0; + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 1, &thread_count); + ok(thread_count == 1, "expected 1 thread, got %d\n", thread_count); + + is_parallel = pomp_in_parallel(); + ok(is_parallel == FALSE, "expected FALSE, got %d\n", is_parallel); + + pomp_set_num_threads(2); + num_threads = pomp_get_num_threads(); + ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); + thread_count = 0; + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 2, &thread_count); + ok(thread_count == 2, "expected 2 threads, got %d\n", thread_count); + + pomp_set_num_threads(4); + num_threads = pomp_get_num_threads(); + ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); + thread_count = 0; + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 4, &thread_count); + ok(thread_count == 4, "expected 4 threads, got %d\n", thread_count); + + p_vcomp_set_num_threads(8); + num_threads = pomp_get_num_threads(); + ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); + thread_count = 0; + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 4, &thread_count); + ok(thread_count == 8, "expected 8 threads, got %d\n", thread_count); + thread_count = 0; + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 4, &thread_count); + ok(thread_count == 4, "expected 4 threads, got %d\n", thread_count); + + p_vcomp_set_num_threads(0); + num_threads = pomp_get_num_threads(); + ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); + thread_count = 0; + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 4, &thread_count); + ok(thread_count == 4, "expected 4 threads, got %d\n", thread_count); + + pomp_set_num_threads(0); + num_threads = pomp_get_num_threads(); + ok(num_threads == 1, "expected num_threads == 1, got %d\n", num_threads); + thread_count = 0; + p_vcomp_fork(TRUE, 4, num_threads_cb, nested, TRUE, 4, &thread_count); + ok(thread_count == 4, "expected 4 threads, got %d\n", thread_count); + + pomp_set_num_threads(max_threads); + pomp_set_nested(FALSE); +} + +static void CDECL fork_ptr_cb(LONG *a, LONG *b, LONG *c, LONG *d, LONG *e) +{ + InterlockedIncrement(a); + InterlockedIncrement(b); + InterlockedIncrement(c); + InterlockedIncrement(d); + InterlockedIncrement(e); +} + +static void CDECL fork_uintptr_cb(UINT_PTR a, UINT_PTR b, UINT_PTR c, UINT_PTR d, UINT_PTR e) +{ + ok(a == 1, "expected a == 1, got %p\n", (void *)a); + ok(b == MAXUINT_PTR - 2, "expected b == MAXUINT_PTR - 2, got %p\n", (void *)b); + ok(c == 3, "expected c == 3, got %p\n", (void *)c); + ok(d == MAXUINT_PTR - 4, "expected d == MAXUINT_PTR - 4, got %p\n", (void *)d); + ok(e == 5, "expected e == 5, got %p\n", (void *)e); +} + +static void CDECL fork_float_cb(float a, float b, float c, float d, float e) +{ + ok(1.4999 < a && a < 1.5001, "expected a == 1.5, got %f\n", a); + ok(2.4999 < b && b < 2.5001, "expected b == 2.5, got %f\n", b); + ok(3.4999 < c && c < 3.5001, "expected c == 3.5, got %f\n", c); + ok(4.4999 < d && d < 4.5001, "expected d == 4.5, got %f\n", d); + ok(5.4999 < e && e < 5.5001, "expected e == 5.5, got %f\n", e); +} + +static void test_vcomp_fork(void) +{ + LONG a, b, c, d, e; + int max_threads = pomp_get_max_threads(); + pomp_set_num_threads(4); + + a = 0; b = 1; c = 2; d = 3; e = 4; + p_vcomp_fork(FALSE, 5, fork_ptr_cb, &a, &b, &c, &d, &e); + ok(a == 1, "expected a == 1, got %d\n", a); + ok(b == 2, "expected b == 2, got %d\n", b); + ok(c == 3, "expected c == 3, got %d\n", c); + ok(d == 4, "expected d == 4, got %d\n", d); + ok(e == 5, "expected e == 5, got %d\n", e); + + a = 0; b = 1; c = 2; d = 3; e = 4; + p_vcomp_fork(TRUE, 5, fork_ptr_cb, &a, &b, &c, &d, &e); + ok(a == 4, "expected a == 4, got %d\n", a); + ok(b == 5, "expected b == 5, got %d\n", b); + ok(c == 6, "expected c == 6, got %d\n", c); + ok(d == 7, "expected d == 7, got %d\n", d); + ok(e == 8, "expected e == 8, got %d\n", e); + + p_vcomp_fork(TRUE, 5, fork_uintptr_cb, (UINT_PTR)1, (UINT_PTR)(MAXUINT_PTR - 2), + (UINT_PTR)3, (UINT_PTR)(MAXUINT_PTR - 4), (UINT_PTR)5); + + if (sizeof(int) < sizeof(void *)) + skip("skipping float test on x86_64\n"); + else + { + void (CDECL *func)(BOOL, int, void *, float, float, float, float, float) = (void *)p_vcomp_fork; + func(TRUE, 5, fork_float_cb, 1.5f, 2.5f, 3.5f, 4.5f, 5.5f); + } + + pomp_set_num_threads(max_threads); +} + +static void CDECL section_cb(LONG *a, LONG *b, LONG *c) +{ + int i; + + p_vcomp_sections_init(20); + while ((i = p_vcomp_sections_next()) != -1) + { + InterlockedIncrement(a); + Sleep(1); + } + + p_vcomp_sections_init(30); + while ((i = p_vcomp_sections_next()) != -1) + { + InterlockedIncrement(b); + Sleep(1); + } + + p_vcomp_sections_init(40); + while ((i = p_vcomp_sections_next()) != -1) + { + InterlockedIncrement(c); + Sleep(1); + } +} + +static void test_vcomp_sections_init(void) +{ + LONG a, b, c; + int max_threads = pomp_get_max_threads(); + int i; + +if (0) +{ + /* calling _vcomp_sections_next without prior _vcomp_sections_init + * returns uninitialized memory on Windows. */ + i = p_vcomp_sections_next(); + ok(i == -1, "expected -1, got %d\n", i); +} + + a = b = c = 0; + section_cb(&a, &b, &c); + ok(a == 20, "expected a == 20, got %d\n", a); + ok(b == 30, "expected b == 30, got %d\n", b); + ok(c == 40, "expected c == 40, got %d\n", c); + + for (i = 1; i <= 4; i++) + { + pomp_set_num_threads(i); + + a = b = c = 0; + p_vcomp_fork(TRUE, 3, section_cb, &a, &b, &c); + ok(a == 20, "expected a == 20, got %d\n", a); + ok(b == 30, "expected b == 30, got %d\n", b); + ok(c == 40, "expected c == 40, got %d\n", c); + + a = b = c = 0; + p_vcomp_fork(FALSE, 3, section_cb, &a, &b, &c); + ok(a == 20, "expected a == 20, got %d\n", a); + ok(b == 30, "expected b == 30, got %d\n", b); + ok(c == 40, "expected c == 40, got %d\n", c); + } + + pomp_set_num_threads(max_threads); +} + +static void my_for_static_simple_init(unsigned int first, unsigned int last, int step, + BOOL increment, unsigned int *begin, unsigned int *end) +{ + unsigned int iterations, per_thread, remaining; + int num_threads = pomp_get_num_threads(); + int thread_num = pomp_get_thread_num(); + + if (num_threads == 1) + { + *begin = first; + *end = last; + return; + } + + if (step <= 0) + { + *begin = 0; + *end = increment ? -1 : 1; + return; + } + + if (increment) + iterations = 1 + (last - first) / step; + else + { + iterations = 1 + (first - last) / step; + step *= -1; + } + + per_thread = iterations / num_threads; + remaining = iterations - per_thread * num_threads; + + if (thread_num < remaining) + per_thread++; + else if (per_thread) + first += remaining * step; + else + { + *begin = first; + *end = first - step; + return; + } + + *begin = first + per_thread * thread_num * step; + *end = *begin + (per_thread - 1) * step; +} + + +static void CDECL for_static_simple_cb(void) +{ + static const struct + { + unsigned int first; + unsigned int last; + int step; + } + tests[] = + { + { 0, 0, 1 }, /* 0 */ + { 0, 1, 1 }, + { 0, 2, 1 }, + { 0, 3, 1 }, + { 0, 100, 0 }, + { 0, 100, 1 }, + { 0, 100, 2 }, + { 0, 100, 3 }, + { 0, 100, -1 }, + { 0, 100, -2 }, + { 0, 100, -3 }, /* 10 */ + { 0, 100, 10 }, + { 0, 100, 50 }, + { 0, 100, 100 }, + { 0, 100, 150 }, + { 0, 0x80000000, 1 }, + { 0, 0xfffffffe, 1 }, + { 0, 0xffffffff, 1 }, + { 50, 50, 0 }, + { 50, 50, 1 }, + { 50, 50, 2 }, /* 20 */ + { 50, 50, 3 }, + { 50, 50, -1 }, + { 50, 50, -2 }, + { 50, 50, -3 }, + { 100, 200, 1 }, + { 100, 200, 5 }, + { 100, 200, 10 }, + { 100, 200, 50 }, + { 100, 200, 100 }, + { 100, 200, 150 }, /* 30 */ + }; + int num_threads = pomp_get_num_threads(); + int thread_num = pomp_get_thread_num(); + int i; + + for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) + { + unsigned int my_begin, my_end, begin, end; + + begin = end = 0xdeadbeef; + my_for_static_simple_init(tests[i].first, tests[i].last, tests[i].step, FALSE, &my_begin, &my_end); + p_vcomp_for_static_simple_init(tests[i].first, tests[i].last, tests[i].step, FALSE, &begin, &end); + + ok(begin == my_begin, "test %d, thread %d/%d: expected begin == %u, got %u\n", + i, thread_num, num_threads, my_begin, end); + ok(end == my_end, "test %d, thread %d/%d: expected end == %u, got %u\n", + i, thread_num, num_threads, my_end, end); + + p_vcomp_for_static_end(); + p_vcomp_barrier(); + + begin = end = 0xdeadbeef; + my_for_static_simple_init(tests[i].first, tests[i].last, tests[i].step, TRUE, &my_begin, &my_end); + p_vcomp_for_static_simple_init(tests[i].first, tests[i].last, tests[i].step, TRUE, &begin, &end); + + ok(begin == my_begin, "test %d, thread %d/%d: expected begin == %u, got %u\n", + i, thread_num, num_threads, my_begin, end); + ok(end == my_end, "test %d, thread %d/%d: expected end == %u, got %u\n", + i, thread_num, num_threads, my_end, end); + + p_vcomp_for_static_end(); + p_vcomp_barrier(); + + if (tests[i].first == tests[i].last) continue; + + begin = end = 0xdeadbeef; + my_for_static_simple_init(tests[i].last, tests[i].first, tests[i].step, FALSE, &my_begin, &my_end); + p_vcomp_for_static_simple_init(tests[i].last, tests[i].first, tests[i].step, FALSE, &begin, &end); + + ok(begin == my_begin, "test %d, thread %d/%d: expected begin == %u, got %u\n", + i, thread_num, num_threads, my_begin, end); + ok(end == my_end, "test %d, thread %d/%d: expected end == %u, got %u\n", + i, thread_num, num_threads, my_end, end); + + p_vcomp_for_static_end(); + p_vcomp_barrier(); + + begin = end = 0xdeadbeef; + my_for_static_simple_init(tests[i].last, tests[i].first, tests[i].step, TRUE, &my_begin, &my_end); + p_vcomp_for_static_simple_init(tests[i].last, tests[i].first, tests[i].step, TRUE, &begin, &end); + + ok(begin == my_begin, "test %d, thread %d/%d: expected begin == %u, got %u\n", + i, thread_num, num_threads, my_begin, end); + ok(end == my_end, "test %d, thread %d/%d: expected end == %u, got %u\n", + i, thread_num, num_threads, my_end, end); + + p_vcomp_for_static_end(); + p_vcomp_barrier(); + } +} + +static void test_vcomp_for_static_simple_init(void) +{ + int max_threads = pomp_get_max_threads(); + int i; + + for_static_simple_cb(); + + for (i = 1; i <= 4; i++) + { + pomp_set_num_threads(i); + p_vcomp_fork(TRUE, 0, for_static_simple_cb); + p_vcomp_fork(FALSE, 0, for_static_simple_cb); + } + + pomp_set_num_threads(max_threads); +} + +#define VCOMP_FOR_STATIC_BROKEN_LOOP 1 +#define VCOMP_FOR_STATIC_BROKEN_NEXT 2 + +DWORD CDECL my_for_static_init(int first, int last, int step, int chunksize, unsigned int *loops, + int *begin, int *end, int *next, int *lastchunk) +{ + unsigned int iterations, num_chunks, per_thread, remaining; + int num_threads = pomp_get_num_threads(); + int thread_num = pomp_get_thread_num(); + + if (num_threads == 1 && chunksize != 1) + { + *loops = 1; + *begin = first; + *end = last; + *next = 0; + *lastchunk = first; + return 0; + } + + if (first == last) + { + *loops = !thread_num; + if (!thread_num) + { + /* The value in *next on Windows is either uninitialized, or contains + * garbage. The value shouldn't matter for *loops <= 1, so no need to + * reproduce that. */ + *begin = first; + *end = last; + *next = 0; + *lastchunk = first; + } + return thread_num ? 0 : VCOMP_FOR_STATIC_BROKEN_NEXT; + } + + if (step <= 0) + { + /* The total number of iterations depends on the number of threads here, + * which doesn't make any sense. This is most likely a bug in the Windows + * implementation. */ + return VCOMP_FOR_STATIC_BROKEN_LOOP; + } + + if (first < last) + iterations = 1 + (last - first) / step; + else + { + iterations = 1 + (first - last) / step; + step *= -1; + } + + if (chunksize < 1) + chunksize = 1; + + num_chunks = ((DWORD64)iterations + chunksize - 1) / chunksize; + per_thread = num_chunks / num_threads; + remaining = num_chunks - per_thread * num_threads; + + *loops = per_thread + (thread_num < remaining); + *begin = first + thread_num * chunksize * step; + *end = *begin + (chunksize - 1) * step; + *next = chunksize * num_threads * step; + *lastchunk = first + (num_chunks - 1) * chunksize * step; + return 0; +} + +static void CDECL for_static_cb(void) +{ + static const struct + { + int first; + int last; + int step; + int chunksize; + } + tests[] = + { + { 0, 0, 1, 1 }, /* 0 */ + { 0, 1, 1, 1 }, + { 0, 2, 1, 1 }, + { 0, 3, 1, 1 }, + { 0, 100, 1, 0 }, + { 0, 100, 1, 1 }, + { 0, 100, 1, 5 }, + { 0, 100, 1, 10 }, + { 0, 100, 1, 50 }, + { 0, 100, 1, 100 }, + { 0, 100, 1, 150 }, /* 10 */ + { 0, 100, 3, 0 }, + { 0, 100, 3, 1 }, + { 0, 100, 3, 5 }, + { 0, 100, 3, 10 }, + { 0, 100, 3, 50 }, + { 0, 100, 3, 100 }, + { 0, 100, 3, 150 }, + { 0, 100, 5, 1 }, + { 0, 100, -3, 0 }, + { 0, 100, -3, 1 }, /* 20 */ + { 0, 100, -3, 5 }, + { 0, 100, -3, 10 }, + { 0, 100, -3, 50 }, + { 0, 100, -3, 100 }, + { 0, 100, -3, 150 }, + { 0, 100, 10, 1 }, + { 0, 100, 50, 1 }, + { 0, 100, 100, 1 }, + { 0, 100, 150, 1 }, + { 0, 0x10000000, 1, 123 }, /* 30 */ + { 0, 0x20000000, 1, 123 }, + { 0, 0x40000000, 1, 123 }, + { 0, -0x80000000, 1, 123 }, + { 50, 50, 1, 1 }, + { 50, 50, 1, 2 }, + { 50, 50, 1, -1 }, + { 50, 50, 1, -2 }, + { 50, 50, 2, 1 }, + { 50, 50, 3, 1 }, + { 100, 200, 3, 1 }, /* 40 */ + { 100, 200, 3, -1 }, + { 0x7ffffffe, -0x80000000, 1, 123 }, + { 0x7fffffff, -0x80000000, 1, 123 }, + }; + int num_threads = pomp_get_num_threads(); + int thread_num = pomp_get_thread_num(); + int i; + + for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) + { + int my_begin, my_end, my_next, my_lastchunk; + int begin, end, next, lastchunk; + unsigned int my_loops, loops; + DWORD broken_flags; + + my_loops = my_begin = my_end = my_next = my_lastchunk = 0xdeadbeef; + loops = begin = end = next = lastchunk = 0xdeadbeef; + broken_flags = my_for_static_init(tests[i].first, tests[i].last, tests[i].step, tests[i].chunksize, + &my_loops, &my_begin, &my_end, &my_next, &my_lastchunk); + p_vcomp_for_static_init(tests[i].first, tests[i].last, tests[i].step, tests[i].chunksize, + &loops, &begin, &end, &next, &lastchunk); + + if (broken_flags & VCOMP_FOR_STATIC_BROKEN_LOOP) + { + ok(loops == 0 || loops == 1, "test %d, thread %d/%d: expected loops == 0 or 1, got %u\n", + i, thread_num, num_threads, loops); + } + else + { + ok(loops == my_loops, "test %d, thread %d/%d: expected loops == %u, got %u\n", + i, thread_num, num_threads, my_loops, loops); + ok(begin == my_begin, "test %d, thread %d/%d: expected begin == %d, got %d\n", + i, thread_num, num_threads, my_begin, begin); + ok(end == my_end, "test %d, thread %d/%d: expected end == %d, got %d\n", + i, thread_num, num_threads, my_end, end); + ok(next == my_next || broken(broken_flags & VCOMP_FOR_STATIC_BROKEN_NEXT), + "test %d, thread %d/%d: expected next == %d, got %d\n", i, thread_num, num_threads, my_next, next); + ok(lastchunk == my_lastchunk, "test %d, thread %d/%d: expected lastchunk == %d, got %d\n", + i, thread_num, num_threads, my_lastchunk, lastchunk); + } + + p_vcomp_for_static_end(); + p_vcomp_barrier(); + + if (tests[i].first == tests[i].last) continue; + + my_loops = my_begin = my_end = my_next = my_lastchunk = 0xdeadbeef; + loops = begin = end = next = lastchunk = 0xdeadbeef; + broken_flags = my_for_static_init(tests[i].last, tests[i].first, tests[i].step, tests[i].chunksize, + &my_loops, &my_begin, &my_end, &my_next, &my_lastchunk); + p_vcomp_for_static_init(tests[i].last, tests[i].first, tests[i].step, tests[i].chunksize, + &loops, &begin, &end, &next, &lastchunk); + + if (broken_flags & VCOMP_FOR_STATIC_BROKEN_LOOP) + { + ok(loops == 0 || loops == 1, "test %d, thread %d/%d: expected loops == 0 or 1, got %u\n", + i, thread_num, num_threads, loops); + } + else + { + ok(loops == my_loops, "test %d, thread %d/%d: expected loops == %u, got %u\n", + i, thread_num, num_threads, my_loops, loops); + ok(begin == my_begin, "test %d, thread %d/%d: expected begin == %d, got %d\n", + i, thread_num, num_threads, my_begin, begin); + ok(end == my_end, "test %d, thread %d/%d: expected end == %d, got %d\n", + i, thread_num, num_threads, my_end, end); + ok(next == my_next || broken(broken_flags & VCOMP_FOR_STATIC_BROKEN_NEXT), + "test %d, thread %d/%d: expected next == %d, got %d\n", i, thread_num, num_threads, my_next, next); + ok(lastchunk == my_lastchunk, "test %d, thread %d/%d: expected lastchunk == %d, got %d\n", + i, thread_num, num_threads, my_lastchunk, lastchunk); + } + + p_vcomp_for_static_end(); + p_vcomp_barrier(); + } +} + +#undef VCOMP_FOR_STATIC_BROKEN_LOOP +#undef VCOMP_FOR_STATIC_BROKEN_NEXT + +static void test_vcomp_for_static_init(void) +{ + int max_threads = pomp_get_max_threads(); + int i; + + for_static_cb(); + + for (i = 1; i <= 4; i++) + { + pomp_set_num_threads(i); + p_vcomp_fork(TRUE, 0, for_static_cb); + p_vcomp_fork(FALSE, 0, for_static_cb); + } + + pomp_set_num_threads(max_threads); +} + +static void test_atomic_integer32(void) +{ + struct + { + void (CDECL *func)(int *, int); + int v1, v2, expected; + } + tests1[] = + { + { p_vcomp_atomic_add_i4, 0x11223344, 0x77665544, -0x77777778 }, + { p_vcomp_atomic_and_i4, 0x11223344, 0x77665544, 0x11221144 }, + { p_vcomp_atomic_div_i4, 0x77665544, 0x11223344, 6 }, + { p_vcomp_atomic_div_i4, 0x77665544, -0x11223344, -6 }, + { p_vcomp_atomic_mul_i4, 0x11223344, 0x77665544, -0xecccdf0 }, + { p_vcomp_atomic_mul_i4, 0x11223344, -0x77665544, 0xecccdf0 }, + { p_vcomp_atomic_or_i4, 0x11223344, 0x77665544, 0x77667744 }, + { p_vcomp_atomic_shl_i4, 0x11223344, 3, -0x76ee65e0 }, + { p_vcomp_atomic_shl_i4, 0x11223344, 35, -0x76ee65e0 }, + { p_vcomp_atomic_shl_i4, -0x11223344, 3, 0x76ee65e0 }, + { p_vcomp_atomic_shr_i4, 0x11223344, 3, 0x2244668 }, + { p_vcomp_atomic_shr_i4, 0x11223344, 35, 0x2244668 }, + { p_vcomp_atomic_shr_i4, -0x11223344, 3, -0x2244669 }, + { p_vcomp_atomic_sub_i4, 0x11223344, 0x77665544, -0x66442200 }, + { p_vcomp_atomic_xor_i4, 0x11223344, 0x77665544, 0x66446600 }, + }; + struct + { + void (CDECL *func)(unsigned int *, unsigned int); + unsigned int v1, v2, expected; + } + tests2[] = + { + { p_vcomp_atomic_div_ui4, 0x77665544, 0x11223344, 6 }, + { p_vcomp_atomic_div_ui4, 0x77665544, 0xeeddccbc, 0 }, + { p_vcomp_atomic_shr_ui4, 0x11223344, 3, 0x2244668 }, + { p_vcomp_atomic_shr_ui4, 0x11223344, 35, 0x2244668 }, + { p_vcomp_atomic_shr_ui4, 0xeeddccbc, 3, 0x1ddbb997 }, + }; + int i; + + for (i = 0; i < sizeof(tests1)/sizeof(tests1[0]); i++) + { + int val = tests1[i].v1; + tests1[i].func(&val, tests1[i].v2); + ok(val == tests1[i].expected, "test %d: expected val == %d, got %d\n", i, tests1[i].expected, val); + } + for (i = 0; i < sizeof(tests2)/sizeof(tests2[0]); i++) + { + unsigned int val = tests2[i].v1; + tests2[i].func(&val, tests2[i].v2); + ok(val == tests2[i].expected, "test %d: expected val == %u, got %u\n", i, tests2[i].expected, val); + } +} + +static void test_atomic_float(void) +{ + struct + { + void (CDECL *func)(float *, float); + float v1, v2, expected; + } + tests[] = + { + { p_vcomp_atomic_add_r4, 42.0, 17.0, 42.0 + 17.0 }, + { p_vcomp_atomic_div_r4, 42.0, 17.0, 42.0 / 17.0 }, + { p_vcomp_atomic_mul_r4, 42.0, 17.0, 42.0 * 17.0 }, + { p_vcomp_atomic_sub_r4, 42.0, 17.0, 42.0 - 17.0 }, + }; + int i; + + for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) + { + float val = tests[i].v1; + tests[i].func(&val, tests[i].v2); + ok(tests[i].expected - 0.001 < val && val < tests[i].expected + 0.001, + "test %d: expected val == %f, got %f\n", i, tests[i].expected, val); + } +} + +static void test_atomic_double(void) +{ + struct + { + void (CDECL *func)(double *, double); + double v1, v2, expected; + } + tests[] = + { + { p_vcomp_atomic_add_r8, 42.0, 17.0, 42.0 + 17.0 }, + { p_vcomp_atomic_div_r8, 42.0, 17.0, 42.0 / 17.0 }, + { p_vcomp_atomic_mul_r8, 42.0, 17.0, 42.0 * 17.0 }, + { p_vcomp_atomic_sub_r8, 42.0, 17.0, 42.0 - 17.0 }, + }; + int i; + + for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) + { + double val = tests[i].v1; + tests[i].func(&val, tests[i].v2); + ok(tests[i].expected - 0.001 < val && val < tests[i].expected + 0.001, + "test %d: expected val == %f, got %f\n", i, tests[i].expected, val); + } +} + +START_TEST(vcomp) +{ + if (!init_vcomp()) + return; + + test_omp_get_num_threads(FALSE); + test_omp_get_num_threads(TRUE); + test_vcomp_fork(); + test_vcomp_sections_init(); + test_vcomp_for_static_simple_init(); + test_vcomp_for_static_init(); + test_atomic_integer32(); + test_atomic_float(); + test_atomic_double(); + + release_vcomp(); +} diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/vcomp/vcomp.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/vcomp/vcomp.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/vcomp/vcomp.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/vcomp/vcomp.spec 2015-07-29 19:28:54.000000000 +0000 @@ -1,54 +1,54 @@ @ stub _vcomp_atomic_add_i1 @ stub _vcomp_atomic_add_i2 -@ stub _vcomp_atomic_add_i4 +@ cdecl _vcomp_atomic_add_i4(ptr long) @ stub _vcomp_atomic_add_i8 -@ stub _vcomp_atomic_add_r4 -@ stub _vcomp_atomic_add_r8 +@ cdecl _vcomp_atomic_add_r4(ptr float) +@ cdecl _vcomp_atomic_add_r8(ptr double) @ stub _vcomp_atomic_and_i1 @ stub _vcomp_atomic_and_i2 -@ stub _vcomp_atomic_and_i4 +@ cdecl _vcomp_atomic_and_i4(ptr long) @ stub _vcomp_atomic_and_i8 @ stub _vcomp_atomic_div_i1 @ stub _vcomp_atomic_div_i2 -@ stub _vcomp_atomic_div_i4 +@ cdecl _vcomp_atomic_div_i4(ptr long) @ stub _vcomp_atomic_div_i8 -@ stub _vcomp_atomic_div_r4 -@ stub _vcomp_atomic_div_r8 +@ cdecl _vcomp_atomic_div_r4(ptr float) +@ cdecl _vcomp_atomic_div_r8(ptr double) @ stub _vcomp_atomic_div_ui1 @ stub _vcomp_atomic_div_ui2 -@ stub _vcomp_atomic_div_ui4 +@ cdecl _vcomp_atomic_div_ui4(ptr long) @ stub _vcomp_atomic_div_ui8 @ stub _vcomp_atomic_mul_i1 @ stub _vcomp_atomic_mul_i2 -@ stub _vcomp_atomic_mul_i4 +@ cdecl _vcomp_atomic_mul_i4(ptr long) @ stub _vcomp_atomic_mul_i8 -@ stub _vcomp_atomic_mul_r4 -@ stub _vcomp_atomic_mul_r8 +@ cdecl _vcomp_atomic_mul_r4(ptr float) +@ cdecl _vcomp_atomic_mul_r8(ptr double) @ stub _vcomp_atomic_or_i1 @ stub _vcomp_atomic_or_i2 -@ stub _vcomp_atomic_or_i4 +@ cdecl _vcomp_atomic_or_i4(ptr long) @ stub _vcomp_atomic_or_i8 @ stub _vcomp_atomic_shl_i1 @ stub _vcomp_atomic_shl_i2 -@ stub _vcomp_atomic_shl_i4 +@ cdecl _vcomp_atomic_shl_i4(ptr long) @ stub _vcomp_atomic_shl_i8 @ stub _vcomp_atomic_shr_i1 @ stub _vcomp_atomic_shr_i2 -@ stub _vcomp_atomic_shr_i4 +@ cdecl _vcomp_atomic_shr_i4(ptr long) @ stub _vcomp_atomic_shr_i8 @ stub _vcomp_atomic_shr_ui1 @ stub _vcomp_atomic_shr_ui2 -@ stub _vcomp_atomic_shr_ui4 +@ cdecl _vcomp_atomic_shr_ui4(ptr long) @ stub _vcomp_atomic_shr_ui8 @ stub _vcomp_atomic_sub_i1 @ stub _vcomp_atomic_sub_i2 -@ stub _vcomp_atomic_sub_i4 +@ cdecl _vcomp_atomic_sub_i4(ptr long) @ stub _vcomp_atomic_sub_i8 -@ stub _vcomp_atomic_sub_r4 -@ stub _vcomp_atomic_sub_r8 +@ cdecl _vcomp_atomic_sub_r4(ptr float) +@ cdecl _vcomp_atomic_sub_r8(ptr double) @ stub _vcomp_atomic_xor_i1 @ stub _vcomp_atomic_xor_i2 -@ stub _vcomp_atomic_xor_i4 +@ cdecl _vcomp_atomic_xor_i4(ptr long) @ stub _vcomp_atomic_xor_i8 @ cdecl _vcomp_barrier() @ stub _vcomp_copyprivate_broadcast @@ -59,12 +59,12 @@ @ stub _vcomp_for_dynamic_init_i8 @ stub _vcomp_for_dynamic_next @ stub _vcomp_for_dynamic_next_i8 -@ stub _vcomp_for_static_end -@ stub _vcomp_for_static_init +@ cdecl _vcomp_for_static_end() +@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) @ stub _vcomp_for_static_init_i8 -@ stub _vcomp_for_static_simple_init +@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) @ stub _vcomp_for_static_simple_init_i8 -@ stub _vcomp_fork +@ varargs _vcomp_fork(long long ptr) @ stub _vcomp_get_thread_num @ stub _vcomp_leave_critsect @ stub _vcomp_master_barrier @@ -83,8 +83,8 @@ @ stub _vcomp_reduction_u2 @ stub _vcomp_reduction_u4 @ stub _vcomp_reduction_u8 -@ stub _vcomp_sections_init -@ stub _vcomp_sections_next +@ cdecl _vcomp_sections_init(long) +@ cdecl _vcomp_sections_next() @ cdecl _vcomp_set_num_threads(long) @ cdecl _vcomp_single_begin(long) @ cdecl _vcomp_single_end() @@ -98,7 +98,7 @@ @ cdecl omp_get_thread_num() @ stub omp_get_wtick @ cdecl omp_get_wtime() -@ stub omp_in_parallel +@ cdecl omp_in_parallel() @ stub omp_init_lock @ stub omp_init_nest_lock @ cdecl omp_set_dynamic(long) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/vcomp100/vcomp100.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/vcomp100/vcomp100.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/vcomp100/vcomp100.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/vcomp100/vcomp100.spec 2015-07-29 19:28:54.000000000 +0000 @@ -1,54 +1,54 @@ @ stub _vcomp_atomic_add_i1 @ stub _vcomp_atomic_add_i2 -@ stub _vcomp_atomic_add_i4 +@ cdecl _vcomp_atomic_add_i4(ptr long) vcomp._vcomp_atomic_add_i4 @ stub _vcomp_atomic_add_i8 -@ stub _vcomp_atomic_add_r4 -@ stub _vcomp_atomic_add_r8 +@ cdecl _vcomp_atomic_add_r4(ptr float) vcomp._vcomp_atomic_add_r4 +@ cdecl _vcomp_atomic_add_r8(ptr double) vcomp._vcomp_atomic_add_r8 @ stub _vcomp_atomic_and_i1 @ stub _vcomp_atomic_and_i2 -@ stub _vcomp_atomic_and_i4 +@ cdecl _vcomp_atomic_and_i4(ptr long) vcomp._vcomp_atomic_and_i4 @ stub _vcomp_atomic_and_i8 @ stub _vcomp_atomic_div_i1 @ stub _vcomp_atomic_div_i2 -@ stub _vcomp_atomic_div_i4 +@ cdecl _vcomp_atomic_div_i4(ptr long) vcomp._vcomp_atomic_div_i4 @ stub _vcomp_atomic_div_i8 -@ stub _vcomp_atomic_div_r4 -@ stub _vcomp_atomic_div_r8 +@ cdecl _vcomp_atomic_div_r4(ptr float) vcomp._vcomp_atomic_div_r4 +@ cdecl _vcomp_atomic_div_r8(ptr double) vcomp._vcomp_atomic_div_r8 @ stub _vcomp_atomic_div_ui1 @ stub _vcomp_atomic_div_ui2 -@ stub _vcomp_atomic_div_ui4 +@ cdecl _vcomp_atomic_div_ui4(ptr long) vcomp._vcomp_atomic_div_ui4 @ stub _vcomp_atomic_div_ui8 @ stub _vcomp_atomic_mul_i1 @ stub _vcomp_atomic_mul_i2 -@ stub _vcomp_atomic_mul_i4 +@ cdecl _vcomp_atomic_mul_i4(ptr long) vcomp._vcomp_atomic_mul_i4 @ stub _vcomp_atomic_mul_i8 -@ stub _vcomp_atomic_mul_r4 -@ stub _vcomp_atomic_mul_r8 +@ cdecl _vcomp_atomic_mul_r4(ptr float) vcomp._vcomp_atomic_mul_r4 +@ cdecl _vcomp_atomic_mul_r8(ptr double) vcomp._vcomp_atomic_mul_r8 @ stub _vcomp_atomic_or_i1 @ stub _vcomp_atomic_or_i2 -@ stub _vcomp_atomic_or_i4 +@ cdecl _vcomp_atomic_or_i4(ptr long) vcomp._vcomp_atomic_or_i4 @ stub _vcomp_atomic_or_i8 @ stub _vcomp_atomic_shl_i1 @ stub _vcomp_atomic_shl_i2 -@ stub _vcomp_atomic_shl_i4 +@ cdecl _vcomp_atomic_shl_i4(ptr long) vcomp._vcomp_atomic_shl_i4 @ stub _vcomp_atomic_shl_i8 @ stub _vcomp_atomic_shr_i1 @ stub _vcomp_atomic_shr_i2 -@ stub _vcomp_atomic_shr_i4 +@ cdecl _vcomp_atomic_shr_i4(ptr long) vcomp._vcomp_atomic_shr_i4 @ stub _vcomp_atomic_shr_i8 @ stub _vcomp_atomic_shr_ui1 @ stub _vcomp_atomic_shr_ui2 -@ stub _vcomp_atomic_shr_ui4 +@ cdecl _vcomp_atomic_shr_ui4(ptr long) vcomp._vcomp_atomic_shr_ui4 @ stub _vcomp_atomic_shr_ui8 @ stub _vcomp_atomic_sub_i1 @ stub _vcomp_atomic_sub_i2 -@ stub _vcomp_atomic_sub_i4 +@ cdecl _vcomp_atomic_sub_i4(ptr long) vcomp._vcomp_atomic_sub_i4 @ stub _vcomp_atomic_sub_i8 -@ stub _vcomp_atomic_sub_r4 -@ stub _vcomp_atomic_sub_r8 +@ cdecl _vcomp_atomic_sub_r4(ptr float) vcomp._vcomp_atomic_sub_r4 +@ cdecl _vcomp_atomic_sub_r8(ptr double) vcomp._vcomp_atomic_sub_r8 @ stub _vcomp_atomic_xor_i1 @ stub _vcomp_atomic_xor_i2 -@ stub _vcomp_atomic_xor_i4 +@ cdecl _vcomp_atomic_xor_i4(ptr long) vcomp._vcomp_atomic_xor_i4 @ stub _vcomp_atomic_xor_i8 @ cdecl _vcomp_barrier() vcomp._vcomp_barrier @ stub _vcomp_copyprivate_broadcast @@ -59,12 +59,12 @@ @ stub _vcomp_for_dynamic_init_i8 @ stub _vcomp_for_dynamic_next @ stub _vcomp_for_dynamic_next_i8 -@ stub _vcomp_for_static_end -@ stub _vcomp_for_static_init +@ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end +@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init @ stub _vcomp_for_static_init_i8 -@ stub _vcomp_for_static_simple_init +@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init @ stub _vcomp_for_static_simple_init_i8 -@ stub _vcomp_fork +@ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork @ stub _vcomp_get_thread_num @ stub _vcomp_leave_critsect @ stub _vcomp_master_barrier @@ -83,8 +83,8 @@ @ stub _vcomp_reduction_u2 @ stub _vcomp_reduction_u4 @ stub _vcomp_reduction_u8 -@ stub _vcomp_sections_init -@ stub _vcomp_sections_next +@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init +@ cdecl _vcomp_sections_next() vcomp._vcomp_sections_next @ cdecl _vcomp_set_num_threads(long) vcomp._vcomp_set_num_threads @ cdecl _vcomp_single_begin(long) vcomp._vcomp_single_begin @ cdecl _vcomp_single_end() vcomp._vcomp_single_end @@ -98,7 +98,7 @@ @ cdecl omp_get_thread_num() vcomp.omp_get_thread_num @ stub omp_get_wtick @ cdecl omp_get_wtime() vcomp.omp_get_wtime -@ stub omp_in_parallel +@ cdecl omp_in_parallel() vcomp.omp_in_parallel @ stub omp_init_lock @ stub omp_init_nest_lock @ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/vcomp90/vcomp90.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/vcomp90/vcomp90.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/vcomp90/vcomp90.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/vcomp90/vcomp90.spec 2015-07-29 19:28:54.000000000 +0000 @@ -1,54 +1,54 @@ @ stub _vcomp_atomic_add_i1 @ stub _vcomp_atomic_add_i2 -@ stub _vcomp_atomic_add_i4 +@ cdecl _vcomp_atomic_add_i4(ptr long) vcomp._vcomp_atomic_add_i4 @ stub _vcomp_atomic_add_i8 -@ stub _vcomp_atomic_add_r4 -@ stub _vcomp_atomic_add_r8 +@ cdecl _vcomp_atomic_add_r4(ptr float) vcomp._vcomp_atomic_add_r4 +@ cdecl _vcomp_atomic_add_r8(ptr double) vcomp._vcomp_atomic_add_r8 @ stub _vcomp_atomic_and_i1 @ stub _vcomp_atomic_and_i2 -@ stub _vcomp_atomic_and_i4 +@ cdecl _vcomp_atomic_and_i4(ptr long) vcomp._vcomp_atomic_and_i4 @ stub _vcomp_atomic_and_i8 @ stub _vcomp_atomic_div_i1 @ stub _vcomp_atomic_div_i2 -@ stub _vcomp_atomic_div_i4 +@ cdecl _vcomp_atomic_div_i4(ptr long) vcomp._vcomp_atomic_div_i4 @ stub _vcomp_atomic_div_i8 -@ stub _vcomp_atomic_div_r4 -@ stub _vcomp_atomic_div_r8 +@ cdecl _vcomp_atomic_div_r4(ptr float) vcomp._vcomp_atomic_div_r4 +@ cdecl _vcomp_atomic_div_r8(ptr double) vcomp._vcomp_atomic_div_r8 @ stub _vcomp_atomic_div_ui1 @ stub _vcomp_atomic_div_ui2 -@ stub _vcomp_atomic_div_ui4 +@ cdecl _vcomp_atomic_div_ui4(ptr long) vcomp._vcomp_atomic_div_ui4 @ stub _vcomp_atomic_div_ui8 @ stub _vcomp_atomic_mul_i1 @ stub _vcomp_atomic_mul_i2 -@ stub _vcomp_atomic_mul_i4 +@ cdecl _vcomp_atomic_mul_i4(ptr long) vcomp._vcomp_atomic_mul_i4 @ stub _vcomp_atomic_mul_i8 -@ stub _vcomp_atomic_mul_r4 -@ stub _vcomp_atomic_mul_r8 +@ cdecl _vcomp_atomic_mul_r4(ptr float) vcomp._vcomp_atomic_mul_r4 +@ cdecl _vcomp_atomic_mul_r8(ptr double) vcomp._vcomp_atomic_mul_r8 @ stub _vcomp_atomic_or_i1 @ stub _vcomp_atomic_or_i2 -@ stub _vcomp_atomic_or_i4 +@ cdecl _vcomp_atomic_or_i4(ptr long) vcomp._vcomp_atomic_or_i4 @ stub _vcomp_atomic_or_i8 @ stub _vcomp_atomic_shl_i1 @ stub _vcomp_atomic_shl_i2 -@ stub _vcomp_atomic_shl_i4 +@ cdecl _vcomp_atomic_shl_i4(ptr long) vcomp._vcomp_atomic_shl_i4 @ stub _vcomp_atomic_shl_i8 @ stub _vcomp_atomic_shr_i1 @ stub _vcomp_atomic_shr_i2 -@ stub _vcomp_atomic_shr_i4 +@ cdecl _vcomp_atomic_shr_i4(ptr long) vcomp._vcomp_atomic_shr_i4 @ stub _vcomp_atomic_shr_i8 @ stub _vcomp_atomic_shr_ui1 @ stub _vcomp_atomic_shr_ui2 -@ stub _vcomp_atomic_shr_ui4 +@ cdecl _vcomp_atomic_shr_ui4(ptr long) vcomp._vcomp_atomic_shr_ui4 @ stub _vcomp_atomic_shr_ui8 @ stub _vcomp_atomic_sub_i1 @ stub _vcomp_atomic_sub_i2 -@ stub _vcomp_atomic_sub_i4 +@ cdecl _vcomp_atomic_sub_i4(ptr long) vcomp._vcomp_atomic_sub_i4 @ stub _vcomp_atomic_sub_i8 -@ stub _vcomp_atomic_sub_r4 -@ stub _vcomp_atomic_sub_r8 +@ cdecl _vcomp_atomic_sub_r4(ptr float) vcomp._vcomp_atomic_sub_r4 +@ cdecl _vcomp_atomic_sub_r8(ptr double) vcomp._vcomp_atomic_sub_r8 @ stub _vcomp_atomic_xor_i1 @ stub _vcomp_atomic_xor_i2 -@ stub _vcomp_atomic_xor_i4 +@ cdecl _vcomp_atomic_xor_i4(ptr long) vcomp._vcomp_atomic_xor_i4 @ stub _vcomp_atomic_xor_i8 @ cdecl _vcomp_barrier() vcomp._vcomp_barrier @ stub _vcomp_copyprivate_broadcast @@ -59,12 +59,12 @@ @ stub _vcomp_for_dynamic_init_i8 @ stub _vcomp_for_dynamic_next @ stub _vcomp_for_dynamic_next_i8 -@ stub _vcomp_for_static_end -@ stub _vcomp_for_static_init +@ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end +@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init @ stub _vcomp_for_static_init_i8 -@ stub _vcomp_for_static_simple_init +@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init @ stub _vcomp_for_static_simple_init_i8 -@ stub _vcomp_fork +@ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork @ stub _vcomp_get_thread_num @ stub _vcomp_leave_critsect @ stub _vcomp_master_barrier @@ -83,8 +83,8 @@ @ stub _vcomp_reduction_u2 @ stub _vcomp_reduction_u4 @ stub _vcomp_reduction_u8 -@ stub _vcomp_sections_init -@ stub _vcomp_sections_next +@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init +@ cdecl _vcomp_sections_next() vcomp._vcomp_sections_next @ cdecl _vcomp_set_num_threads(long) vcomp._vcomp_set_num_threads @ cdecl _vcomp_single_begin(long) vcomp._vcomp_single_begin @ cdecl _vcomp_single_end() vcomp._vcomp_single_end @@ -98,7 +98,7 @@ @ cdecl omp_get_thread_num() vcomp.omp_get_thread_num @ stub omp_get_wtick @ cdecl omp_get_wtime() vcomp.omp_get_wtime -@ stub omp_in_parallel +@ cdecl omp_in_parallel() vcomp.omp_in_parallel @ stub omp_init_lock @ stub omp_init_nest_lock @ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wbemprox/service.c wine-staging-1.7.48~ubuntu12.04.1/dlls/wbemprox/service.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wbemprox/service.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wbemprox/service.c 2015-07-29 19:28:54.000000000 +0000 @@ -69,11 +69,11 @@ goto done; } if (!ControlService( service, control, &status )) error = map_error( GetLastError() ); + CloseServiceHandle( service ); done: set_variant( VT_UI4, error, NULL, retval ); - CloseServiceHandle( service ); - CloseServiceHandle( manager ); + if (manager) CloseServiceHandle( manager ); return S_OK; } @@ -183,11 +183,11 @@ goto done; } if (!StartServiceW( service, 0, NULL )) error = map_error( GetLastError() ); + CloseServiceHandle( service ); done: set_variant( VT_UI4, error, NULL, retval ); - CloseServiceHandle( service ); - CloseServiceHandle( manager ); + if (manager) CloseServiceHandle( manager ); return S_OK; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/webservices/main.c wine-staging-1.7.48~ubuntu12.04.1/dlls/webservices/main.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/webservices/main.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/webservices/main.c 2015-07-29 19:28:54.000000000 +0000 @@ -18,16 +18,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include -#define COBJMACROS - #include "windef.h" #include "winbase.h" -#include "initguid.h" -#include "wincodec.h" +#include "webservices.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(webservices); @@ -47,3 +42,13 @@ return TRUE; } + +/************************************************************************** + * WsCreateError [webservices.@] + */ +HRESULT WINAPI WsCreateError(const WS_ERROR_PROPERTY *properties, ULONG count, WS_ERROR **error) +{ + FIXME("%p %u %p: stub\n", properties, count, error); + if (error) *error = NULL; + return E_NOTIMPL; +} diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/webservices/webservices.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/webservices/webservices.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/webservices/webservices.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/webservices/webservices.spec 2015-07-29 19:28:54.000000000 +0000 @@ -22,7 +22,7 @@ @ stub WsCopyNode @ stub WsCreateChannel @ stub WsCreateChannelForListener -@ stub WsCreateError +@ stdcall WsCreateError(ptr long ptr) @ stub WsCreateFaultFromError @ stub WsCreateHeap @ stub WsCreateListener diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/windowscodecs/gifformat.c wine-staging-1.7.48~ubuntu12.04.1/dlls/windowscodecs/gifformat.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/windowscodecs/gifformat.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/windowscodecs/gifformat.c 2015-07-29 19:28:54.000000000 +0000 @@ -1055,10 +1055,13 @@ if (ref == 0) { - IStream_Release(This->stream); + if (This->stream) + { + IStream_Release(This->stream); + DGifCloseFile(This->gif); + } This->lock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->lock); - DGifCloseFile(This->gif); HeapFree(GetProcessHeap(), 0, This); } @@ -1435,6 +1438,7 @@ This->IWICBitmapDecoder_iface.lpVtbl = &GifDecoder_Vtbl; This->IWICMetadataBlockReader_iface.lpVtbl = &GifDecoder_BlockVtbl; + This->stream = NULL; This->ref = 1; This->initialized = FALSE; This->gif = NULL; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/windowscodecs/tests/gifformat.c wine-staging-1.7.48~ubuntu12.04.1/dlls/windowscodecs/tests/gifformat.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/windowscodecs/tests/gifformat.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/windowscodecs/tests/gifformat.c 2015-07-29 19:28:54.000000000 +0000 @@ -80,15 +80,12 @@ static IWICImagingFactory *factory; -static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size) +static IStream *create_stream(const void *image_data, UINT image_size) { HGLOBAL hmem; BYTE *data; HRESULT hr; - IWICBitmapDecoder *decoder = NULL; IStream *stream; - GUID format; - LONG refcount; hmem = GlobalAlloc(0, image_size); data = GlobalLock(hmem); @@ -98,6 +95,20 @@ hr = CreateStreamOnHGlobal(hmem, TRUE, &stream); ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr); + return stream; +} + +static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size) +{ + HRESULT hr; + IWICBitmapDecoder *decoder; + IStream *stream; + GUID format; + LONG refcount; + + stream = create_stream(image_data, image_size); + if (!stream) return NULL; + hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder); ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr); @@ -402,6 +413,83 @@ IWICBitmapDecoder_Release(decoder); } +static const char gif_with_trailer_1[] = { +/* LSD */'G','I','F','8','7','a',0x01,0x00,0x01,0x00,0x80,0x00,0x00, +/* palette */0xff,0xff,0xff,0xff,0xff,0xff, +/* IMD */0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00, +/* image data */0x02,0x02,0x44,0x01,0x00,0x3b +}; +static const char gif_with_trailer_2[] = { +/* LSD */'G','I','F','8','7','a',0x01,0x00,0x01,0x00,0x00,0x00,0x00, +/* IMD */0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00, +/* image data */0x02,0x02,0x44,0x3b +}; +static const char gif_without_trailer_1[] = { +/* LSD */'G','I','F','8','7','a',0x01,0x00,0x01,0x00,0x80,0x00,0x00, +/* palette */0xff,0xff,0xff,0xff,0xff,0xff, +/* IMD */0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00, +/* image data */0x02,0x02,0x44,0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef +}; + +static const char gif_without_trailer_2[] = { +/* LSD */'G','I','F','8','7','a',0x01,0x00,0x01,0x00,0x00,0x00,0x00, +/* IMD */0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00, +/* image data */0x02,0x02,0x44,0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef +}; + +static void test_truncated_gif(void) +{ + HRESULT hr; + IStream *stream; + IWICBitmapDecoder *decoder; + GUID format; + + stream = create_stream(gif_with_trailer_1, sizeof(gif_with_trailer_1)); + if (!stream) return; + + hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder); + ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr); + hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format); + ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_ContainerFormatGif), + "wrong container format %s\n", wine_dbgstr_guid(&format)); + IWICBitmapDecoder_Release(decoder); + IStream_Release(stream); + + stream = create_stream(gif_with_trailer_2, sizeof(gif_with_trailer_2)); + if (!stream) return; + hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder); + ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr); + hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format); + ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_ContainerFormatGif), + "wrong container format %s\n", wine_dbgstr_guid(&format)); + IWICBitmapDecoder_Release(decoder); + IStream_Release(stream); + + stream = create_stream(gif_without_trailer_1, sizeof(gif_without_trailer_1)); + if (!stream) return; + hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder); + ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr); + hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format); + ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_ContainerFormatGif), + "wrong container format %s\n", wine_dbgstr_guid(&format)); + IWICBitmapDecoder_Release(decoder); + IStream_Release(stream); + + stream = create_stream(gif_without_trailer_2, sizeof(gif_without_trailer_2)); + if (!stream) return; + hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder); + ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr); + hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format); + ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_ContainerFormatGif), + "wrong container format %s\n", wine_dbgstr_guid(&format)); + IWICBitmapDecoder_Release(decoder); + IStream_Release(stream); +} + START_TEST(gifformat) { HRESULT hr; @@ -428,6 +516,7 @@ test_global_gif_palette_2frames(); test_local_gif_palette(); test_gif_frame_sizes(); + test_truncated_gif(); IWICImagingFactory_Release(factory); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/windowscodecs/tests/tiffformat.c wine-staging-1.7.48~ubuntu12.04.1/dlls/windowscodecs/tests/tiffformat.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/windowscodecs/tests/tiffformat.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/windowscodecs/tests/tiffformat.c 2015-07-29 19:28:54.000000000 +0000 @@ -92,6 +92,48 @@ { 900, 3 }, { 0x11, 0x22, 0x33, 0 } }; + +static const struct tiff_8bpp_alpha +{ + USHORT byte_order; + USHORT version; + ULONG dir_offset; + USHORT number_of_entries; + struct IFD_entry entry[15]; + ULONG next_IFD; + struct IFD_rational res; + BYTE pixel_data[8]; +} tiff_8bpp_alpha = +{ +#ifdef WORDS_BIGENDIAN + 'M' | 'M' << 8, +#else + 'I' | 'I' << 8, +#endif + 42, + FIELD_OFFSET(struct tiff_8bpp_alpha, number_of_entries), + 15, + { + { 0xff, IFD_SHORT, 1, 0 }, /* SUBFILETYPE */ + { 0x100, IFD_LONG, 1, 2 }, /* IMAGEWIDTH */ + { 0x101, IFD_LONG, 1, 2 }, /* IMAGELENGTH */ + { 0x102, IFD_SHORT, 2, MAKELONG(8, 8) }, /* BITSPERSAMPLE */ + { 0x103, IFD_SHORT, 1, 1 }, /* COMPRESSION: XP doesn't accept IFD_LONG here */ + { 0x106, IFD_SHORT, 1, 1 }, /* PHOTOMETRIC */ + { 0x111, IFD_LONG, 1, FIELD_OFFSET(struct tiff_8bpp_alpha, pixel_data) }, /* STRIPOFFSETS */ + { 0x115, IFD_SHORT, 1, 2 }, /* SAMPLESPERPIXEL */ + { 0x116, IFD_LONG, 1, 2 }, /* ROWSPERSTRIP */ + { 0x117, IFD_LONG, 1, 8 }, /* STRIPBYTECOUNT */ + { 0x11a, IFD_RATIONAL, 1, FIELD_OFFSET(struct tiff_8bpp_alpha, res) }, + { 0x11b, IFD_RATIONAL, 1, FIELD_OFFSET(struct tiff_8bpp_alpha, res) }, + { 0x11c, IFD_SHORT, 1, 1 }, /* PLANARCONFIGURATION */ + { 0x128, IFD_SHORT, 1, 2 }, /* RESOLUTIONUNIT */ + { 0x152, IFD_SHORT, 1, 1 } /* EXTRASAMPLES: 1 - Associated alpha with pre-multiplied color */ + }, + 0, + { 96, 1 }, + { 0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88 } +}; #include "poppack.h" static IWICImagingFactory *factory; @@ -264,6 +306,66 @@ IStream_Release(stream); } +static void test_tiff_8bpp_alpha(void) +{ + HRESULT hr; + IWICBitmapDecoder *decoder; + IWICBitmapFrameDecode *frame; + UINT frame_count, width, height, i; + double dpi_x, dpi_y; + IWICPalette *palette; + GUID format; + WICRect rc; + BYTE data[16]; + static const BYTE expected_data[16] = { 0x11,0x11,0x11,0x22,0x33,0x33,0x33,0x44, + 0x55,0x55,0x55,0x66,0x77,0x77,0x77,0x88 }; + + decoder = create_decoder(&tiff_8bpp_alpha, sizeof(tiff_8bpp_alpha)); + ok(decoder != 0, "Failed to load TIFF image data\n"); + + hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count); + ok(hr == S_OK, "GetFrameCount error %#x\n", hr); + ok(frame_count == 1, "expected 1, got %u\n", frame_count); + + hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); + ok(hr == S_OK, "GetFrame error %#x\n", hr); + + hr = IWICBitmapFrameDecode_GetSize(frame, &width, &height); + ok(hr == S_OK, "GetSize error %#x\n", hr); + ok(width == 2, "expected 2, got %u\n", width); + ok(height == 2, "expected 2, got %u\n", height); + + hr = IWICBitmapFrameDecode_GetResolution(frame, &dpi_x, &dpi_y); + ok(hr == S_OK, "GetResolution error %#x\n", hr); + ok(dpi_x == 96.0, "expected 96.0, got %f\n", dpi_x); + ok(dpi_y == 96.0, "expected 96.0, got %f\n", dpi_y); + + hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); + ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppPBGRA), + "got wrong format %s\n", wine_dbgstr_guid(&format)); + + hr = IWICImagingFactory_CreatePalette(factory, &palette); + ok(hr == S_OK, "CreatePalette error %#x\n", hr); + hr = IWICBitmapFrameDecode_CopyPalette(frame, palette); + ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, + "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %#x\n", hr); + IWICPalette_Release(palette); + + rc.X = 0; + rc.Y = 0; + rc.Width = 2; + rc.Height = 2; + hr = IWICBitmapFrameDecode_CopyPixels(frame, &rc, 8, sizeof(data), data); + ok(hr == S_OK, "CopyPixels error %#x\n", hr); + + for (i = 0; i < sizeof(data); i++) + ok(data[i] == expected_data[i], "%u: expected %02x, got %02x\n", i, expected_data[i], data[i]); + + IWICBitmapFrameDecode_Release(frame); + IWICBitmapDecoder_Release(decoder); +} + START_TEST(tiffformat) { HRESULT hr; @@ -277,6 +379,7 @@ test_tiff_palette(); test_QueryCapability(); + test_tiff_8bpp_alpha(); IWICImagingFactory_Release(factory); CoUninitialize(); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/windowscodecs/tiffformat.c wine-staging-1.7.48~ubuntu12.04.1/dlls/windowscodecs/tiffformat.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/windowscodecs/tiffformat.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/windowscodecs/tiffformat.c 2015-07-29 19:28:54.000000000 +0000 @@ -236,7 +236,7 @@ const WICPixelFormatGUID *format; int bps; int samples; - int bpp; + int bpp, source_bpp; int planar; int indexed; int reverse_bgr; @@ -326,23 +326,63 @@ decode_info->invert_grayscale = 1; /* fall through */ case 1: /* BlackIsZero */ - if (samples != 1) + if (samples == 2) + { + ret = pTIFFGetField(tiff, TIFFTAG_EXTRASAMPLES, &extra_sample_count, &extra_samples); + if (!ret) + { + extra_sample_count = 1; + extra_sample = 0; + extra_samples = &extra_sample; + } + } + else if (samples != 1) { - FIXME("unhandled grayscale sample count %u\n", samples); + FIXME("unhandled %dbpp sample count %u\n", bps, samples); return E_FAIL; } - decode_info->bpp = bps; + decode_info->bpp = bps * samples; + decode_info->source_bpp = decode_info->bpp; switch (bps) { case 1: + if (samples != 1) + { + FIXME("unhandled 1bpp sample count %u\n", samples); + return E_FAIL; + } decode_info->format = &GUID_WICPixelFormatBlackWhite; break; case 4: + if (samples != 1) + { + FIXME("unhandled 4bpp grayscale sample count %u\n", samples); + return E_FAIL; + } decode_info->format = &GUID_WICPixelFormat4bppGray; break; case 8: - decode_info->format = &GUID_WICPixelFormat8bppGray; + if (samples == 1) + decode_info->format = &GUID_WICPixelFormat8bppGray; + else + { + decode_info->bpp = 32; + + switch(extra_samples[0]) + { + case 1: /* Associated (pre-multiplied) alpha data */ + decode_info->format = &GUID_WICPixelFormat32bppPBGRA; + break; + case 0: /* Unspecified data */ + case 2: /* Unassociated alpha data */ + decode_info->format = &GUID_WICPixelFormat32bppBGRA; + break; + default: + FIXME("unhandled extra sample type %u\n", extra_samples[0]); + return E_FAIL; + } + } break; default: FIXME("unhandled greyscale bit count %u\n", bps); @@ -943,6 +983,22 @@ hr = E_FAIL; } + /* 8bpp grayscale with extra alpha */ + if (hr == S_OK && This->decode_info.source_bpp == 16 && This->decode_info.samples == 2 && This->decode_info.bpp == 32) + { + BYTE *src; + DWORD *dst, count = This->decode_info.tile_width * This->decode_info.tile_height; + + src = This->cached_tile + This->decode_info.tile_width * This->decode_info.tile_height * 2 - 2; + dst = (DWORD *)(This->cached_tile + This->decode_info.tile_size - 4); + + while (count--) + { + *dst-- = src[0] | (src[0] << 8) | (src[0] << 16) | (src[1] << 24); + src -= 2; + } + } + if (hr == S_OK && This->decode_info.reverse_bgr) { if (This->decode_info.bps == 8) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/windowscodecs/ungif.c wine-staging-1.7.48~ubuntu12.04.1/dlls/windowscodecs/ungif.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/windowscodecs/ungif.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/windowscodecs/ungif.c 2015-07-29 19:28:54.000000000 +0000 @@ -53,8 +53,10 @@ #include #include "windef.h" #include "winbase.h" - #include "ungif.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); static void *ungif_alloc( size_t sz ) { @@ -491,7 +493,10 @@ * image until empty block (size 0) detected. We use GetCodeNext. */ do if (DGifGetCodeNext(GifFile, &Dummy) == GIF_ERROR) - return GIF_ERROR; + { + WARN("GIF is not properly terminated\n"); + break; + } while (Dummy != NULL) ; } return GIF_OK; @@ -927,9 +932,17 @@ Extensions->Function = Function; - /* Create an extension block with our data */ - if (AddExtensionBlock(Extensions, ExtData[0], &ExtData[1]) == GIF_ERROR) - return (GIF_ERROR); + if (ExtData) + { + /* Create an extension block with our data */ + if (AddExtensionBlock(Extensions, ExtData[0], &ExtData[1]) == GIF_ERROR) + return (GIF_ERROR); + } + else /* Empty extension block */ + { + if (AddExtensionBlock(Extensions, 0, NULL) == GIF_ERROR) + return (GIF_ERROR); + } while (ExtData != NULL) { int Len; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/arb_program_shader.c wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/arb_program_shader.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/arb_program_shader.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/arb_program_shader.c 2015-07-29 19:28:54.000000000 +0000 @@ -5871,6 +5871,11 @@ caps->MaxSimultaneousTextures = min(gl_info->limits.fragment_samplers, 8); } +static DWORD arbfp_get_emul_mask(const struct wined3d_gl_info *gl_info) +{ + return GL_EXT_EMUL_ARB_MULTITEXTURE | GL_EXT_EMUL_EXT_FOG_COORD; +} + static void state_texfactor_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -6871,6 +6876,7 @@ const struct fragment_pipeline arbfp_fragment_pipeline = { arbfp_enable, arbfp_get_caps, + arbfp_get_emul_mask, arbfp_alloc, arbfp_free, arbfp_alloc_context_data, diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/ati_fragment_shader.c wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/ati_fragment_shader.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/ati_fragment_shader.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/ati_fragment_shader.c 2015-07-29 19:28:54.000000000 +0000 @@ -1310,6 +1310,11 @@ caps->MaxSimultaneousTextures = 6; } +static DWORD atifs_get_emul_mask(const struct wined3d_gl_info *gl_info) +{ + return GL_EXT_EMUL_ARB_MULTITEXTURE | GL_EXT_EMUL_EXT_FOG_COORD; +} + static void *atifs_alloc(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv) { struct atifs_private_data *priv; @@ -1386,6 +1391,7 @@ const struct fragment_pipeline atifs_fragment_pipeline = { atifs_enable, atifs_get_caps, + atifs_get_emul_mask, atifs_alloc, atifs_free, atifs_alloc_context_data, diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/context.c wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/context.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/context.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/context.c 2015-07-29 19:28:54.000000000 +0000 @@ -1735,6 +1735,15 @@ gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ALIGNMENT, 1); checkGLcall("glPixelStorei(GL_UNPACK_ALIGNMENT, device->surface_alignment);"); + if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + { + GLuint vao; + + GL_EXTCALL(glGenVertexArrays(1, &vao)); + GL_EXTCALL(glBindVertexArray(vao)); + checkGLcall("creating VAO"); + } + if (gl_info->supported[ARB_VERTEX_BLEND]) { /* Direct3D always uses n-1 weights for n world matrices and uses diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/device.c wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/device.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/device.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/device.c 2015-07-29 19:28:54.000000000 +0000 @@ -1272,10 +1272,9 @@ { stream->stride = stride; stream->offset = offset; + wined3d_buffer_incref(buffer); } - if (buffer) - wined3d_buffer_incref(buffer); if (!device->recording) wined3d_cs_emit_set_stream_source(device->cs, stream_idx, buffer, offset, stride); if (prev_buffer) @@ -3908,6 +3907,80 @@ } } +void CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *device, + struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, + unsigned int dst_y, unsigned int dst_z, struct wined3d_resource *src_resource, + unsigned int src_sub_resource_idx, const struct wined3d_box *src_box) +{ + struct wined3d_surface *dst_surface, *src_surface; + struct wined3d_texture *dst_texture, *src_texture; + struct wined3d_resource *tmp; + RECT dst_rect, src_rect; + HRESULT hr; + + TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, " + "src_resource %p, src_sub_resource_idx %u, src_box %p.\n", + device, dst_resource, dst_sub_resource_idx, dst_x, dst_y, dst_z, + src_resource, src_sub_resource_idx, src_box); + + if (src_resource == dst_resource && src_sub_resource_idx == dst_sub_resource_idx) + { + WARN("Source and destination are the same sub-resource.\n"); + return; + } + + if (src_resource->type != dst_resource->type) + { + WARN("Resource types (%s / %s) don't match.\n", + debug_d3dresourcetype(dst_resource->type), + debug_d3dresourcetype(src_resource->type)); + return; + } + + if (src_resource->format->id != dst_resource->format->id) + { + WARN("Resource formats (%s / %s) don't match.\n", + debug_d3dformat(dst_resource->format->id), + debug_d3dformat(src_resource->format->id)); + return; + } + + if (dst_resource->type != WINED3D_RTYPE_TEXTURE) + { + FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(dst_resource->type)); + return; + } + + dst_texture = wined3d_texture_from_resource(dst_resource); + if (!(tmp = wined3d_texture_get_sub_resource(dst_texture, dst_sub_resource_idx))) + { + WARN("Invalid dst_sub_resource_idx %u.\n", dst_sub_resource_idx); + return; + } + dst_surface = surface_from_resource(tmp); + + src_texture = wined3d_texture_from_resource(src_resource); + if (!(tmp = wined3d_texture_get_sub_resource(src_texture, src_sub_resource_idx))) + { + WARN("Invalid src_sub_resource_idx %u.\n", src_sub_resource_idx); + return; + } + src_surface = surface_from_resource(tmp); + + dst_rect.left = dst_x; + dst_rect.top = dst_y; + dst_rect.right = dst_x + (src_box->right - src_box->left); + dst_rect.bottom = dst_y + (src_box->bottom - src_box->top); + + src_rect.left = src_box->left; + src_rect.top = src_box->top; + src_rect.right = src_box->right; + src_rect.bottom = src_box->bottom; + + if (FAILED(hr = wined3d_surface_blt(dst_surface, &dst_rect, src_surface, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) + ERR("Failed to blit, hr %#x.\n", hr); +} + HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view, const RECT *rect, const struct wined3d_color *color) { diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/directx.c wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/directx.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/directx.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/directx.c 2015-07-29 19:28:54.000000000 +0000 @@ -250,19 +250,21 @@ GL_NEAREST, GL_NEAREST, GL_LINEAR, }; -struct wined3d_caps_gl_ctx -{ - HDC dc; - HWND wnd; - HGLRC gl_ctx; - HDC restore_dc; - HGLRC restore_gl_ctx; -}; - static void wined3d_caps_gl_ctx_destroy(const struct wined3d_caps_gl_ctx *ctx) { + const struct wined3d_gl_info *gl_info = ctx->gl_info; + TRACE("Destroying caps GL context.\n"); + /* Both glDeleteProgram and glDeleteBuffers silently ignore 0 IDs but + * this function might be called before the relevant function pointers + * in gl_info are initialized. */ + if (ctx->test_program_id || ctx->test_vbo) + { + GL_EXTCALL(glDeleteProgram(ctx->test_program_id)); + GL_EXTCALL(glDeleteBuffers(1, &ctx->test_vbo)); + } + if (!wglMakeCurrent(NULL, NULL)) ERR("Failed to disable caps GL context.\n"); @@ -309,7 +311,7 @@ return TRUE; } -static BOOL wined3d_caps_gl_ctx_create(struct wined3d_caps_gl_ctx *ctx) +static BOOL wined3d_caps_gl_ctx_create(struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *ctx) { PIXELFORMATDESCRIPTOR pfd; int iPixelFormat; @@ -367,6 +369,7 @@ goto fail; } + ctx->gl_info = &adapter->gl_info; return TRUE; fail: @@ -2898,6 +2901,7 @@ USE_GL_FUNC(glBeginQuery) /* OpenGL 1.5 */ USE_GL_FUNC(glBindAttribLocation) /* OpenGL 2.0 */ USE_GL_FUNC(glBindBuffer) /* OpenGL 1.5 */ + USE_GL_FUNC(glBindVertexArray) /* OpenGL 3.0 */ USE_GL_FUNC(glBlendColor) /* OpenGL 1.4 */ USE_GL_FUNC(glBlendEquation) /* OpenGL 1.4 */ USE_GL_FUNC(glBlendEquationSeparate) /* OpenGL 2.0 */ @@ -2916,6 +2920,7 @@ USE_GL_FUNC(glDeleteProgram) /* OpenGL 2.0 */ USE_GL_FUNC(glDeleteQueries) /* OpenGL 1.5 */ USE_GL_FUNC(glDeleteShader) /* OpenGL 2.0 */ + USE_GL_FUNC(glDeleteVertexArrays) /* OpenGL 3.0 */ USE_GL_FUNC(glDetachShader) /* OpenGL 2.0 */ USE_GL_FUNC(glDisableVertexAttribArray) /* OpenGL 2.0 */ USE_GL_FUNC(glDrawArraysInstanced) /* OpenGL 3.1 */ @@ -2925,6 +2930,7 @@ USE_GL_FUNC(glEndQuery) /* OpenGL 1.5 */ USE_GL_FUNC(glGenBuffers) /* OpenGL 1.5 */ USE_GL_FUNC(glGenQueries) /* OpenGL 1.5 */ + USE_GL_FUNC(glGenVertexArrays) /* OpenGL 3.0 */ USE_GL_FUNC(glGetActiveUniform) /* OpenGL 2.0 */ USE_GL_FUNC(glGetAttachedShaders) /* OpenGL 2.0 */ USE_GL_FUNC(glGetAttribLocation) /* OpenGL 2.0 */ @@ -3342,6 +3348,82 @@ /* Context activation is done by the caller. */ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter) { + static const struct + { + enum wined3d_gl_extension extension; + DWORD min_gl_version; + } + core_extensions[] = + { + {EXT_TEXTURE3D, MAKEDWORD_VERSION(1, 2)}, + {ARB_MULTISAMPLE, MAKEDWORD_VERSION(1, 3)}, + {ARB_MULTITEXTURE, MAKEDWORD_VERSION(1, 3)}, + {ARB_TEXTURE_BORDER_CLAMP, MAKEDWORD_VERSION(1, 3)}, + {ARB_TEXTURE_COMPRESSION, MAKEDWORD_VERSION(1, 3)}, + {ARB_TEXTURE_CUBE_MAP, MAKEDWORD_VERSION(1, 3)}, + {ARB_DEPTH_TEXTURE, MAKEDWORD_VERSION(1, 4)}, + {ARB_POINT_PARAMETERS, MAKEDWORD_VERSION(1, 4)}, + {ARB_SHADOW, MAKEDWORD_VERSION(1, 4)}, + {ARB_TEXTURE_MIRRORED_REPEAT, MAKEDWORD_VERSION(1, 4)}, + {EXT_BLEND_COLOR, MAKEDWORD_VERSION(1, 4)}, + {EXT_BLEND_FUNC_SEPARATE, MAKEDWORD_VERSION(1, 4)}, + {EXT_BLEND_MINMAX, MAKEDWORD_VERSION(1, 4)}, + {EXT_BLEND_SUBTRACT, MAKEDWORD_VERSION(1, 4)}, + {EXT_STENCIL_WRAP, MAKEDWORD_VERSION(1, 4)}, + {NV_POINT_SPRITE, MAKEDWORD_VERSION(1, 4)}, + {ARB_OCCLUSION_QUERY, MAKEDWORD_VERSION(1, 5)}, + {ARB_VERTEX_BUFFER_OBJECT, MAKEDWORD_VERSION(1, 5)}, + {ARB_DRAW_BUFFERS, MAKEDWORD_VERSION(2, 0)}, + {ARB_FRAGMENT_SHADER, MAKEDWORD_VERSION(2, 0)}, + {ARB_SHADING_LANGUAGE_100, MAKEDWORD_VERSION(2, 0)}, + {ARB_TEXTURE_NON_POWER_OF_TWO, MAKEDWORD_VERSION(2, 0)}, + {ARB_VERTEX_SHADER, MAKEDWORD_VERSION(2, 0)}, + {EXT_BLEND_EQUATION_SEPARATE, MAKEDWORD_VERSION(2, 0)}, + {ARB_PIXEL_BUFFER_OBJECT, MAKEDWORD_VERSION(2, 1)}, + {EXT_TEXTURE_SRGB, MAKEDWORD_VERSION(2, 1)}, + {ARB_COLOR_BUFFER_FLOAT, MAKEDWORD_VERSION(3, 0)}, + {ARB_DEPTH_BUFFER_FLOAT, MAKEDWORD_VERSION(3, 0)}, + {ARB_FRAMEBUFFER_OBJECT, MAKEDWORD_VERSION(3, 0)}, + {ARB_FRAMEBUFFER_SRGB, MAKEDWORD_VERSION(3, 0)}, + {ARB_HALF_FLOAT_PIXEL, MAKEDWORD_VERSION(3, 0)}, + {ARB_HALF_FLOAT_VERTEX, MAKEDWORD_VERSION(3, 0)}, + {ARB_MAP_BUFFER_RANGE, MAKEDWORD_VERSION(3, 0)}, + {ARB_TEXTURE_COMPRESSION_RGTC, MAKEDWORD_VERSION(3, 0)}, + {ARB_TEXTURE_FLOAT, MAKEDWORD_VERSION(3, 0)}, + {ARB_TEXTURE_RG, MAKEDWORD_VERSION(3, 0)}, + {EXT_DRAW_BUFFERS2, MAKEDWORD_VERSION(3, 0)}, + /* We don't want to enable EXT_GPU_SHADER4: even though similar + * functionality is available in core GL 3.0 / GLSL 1.30, it's different + * enough that reusing the same flag for the new features hurts more + * than it helps. */ + /* EXT_framebuffer_object, EXT_framebuffer_blit, + * EXT_framebuffer_multisample and EXT_packed_depth_stencil + * are integrated into ARB_framebuffer_object. */ + + {ARB_DRAW_INSTANCED, MAKEDWORD_VERSION(3, 1)}, + {ARB_UNIFORM_BUFFER_OBJECT, MAKEDWORD_VERSION(3, 1)}, + {EXT_TEXTURE_SNORM, MAKEDWORD_VERSION(3, 1)}, + /* We don't need or want GL_ARB_texture_rectangle (core in 3.1). */ + + {ARB_DRAW_ELEMENTS_BASE_VERTEX, MAKEDWORD_VERSION(3, 2)}, + /* ARB_geometry_shader4 exposes a somewhat different API compared to 3.2 + * core geometry shaders so it's not really correct to expose the + * extension for core-only support. */ + {ARB_PROVOKING_VERTEX, MAKEDWORD_VERSION(3, 2)}, + {ARB_SYNC, MAKEDWORD_VERSION(3, 2)}, + {ARB_VERTEX_ARRAY_BGRA, MAKEDWORD_VERSION(3, 2)}, + + {ARB_BLEND_FUNC_EXTENDED, MAKEDWORD_VERSION(3, 3)}, + {ARB_INSTANCED_ARRAYS, MAKEDWORD_VERSION(3, 3)}, + {ARB_SAMPLER_OBJECTS, MAKEDWORD_VERSION(3, 3)}, + {ARB_SHADER_BIT_ENCODING, MAKEDWORD_VERSION(3, 3)}, + {ARB_TIMER_QUERY, MAKEDWORD_VERSION(3, 3)}, + + {ARB_MAP_BUFFER_ALIGNMENT, MAKEDWORD_VERSION(4, 2)}, + + {ARB_DEBUG_OUTPUT, MAKEDWORD_VERSION(4, 3)}, + {ARB_INTERNALFORMAT_QUERY2, MAKEDWORD_VERSION(4, 3)}, + }; struct wined3d_driver_info *driver_info = &adapter->driver_info; const char *gl_vendor_str, *gl_renderer_str, *gl_version_str; struct wined3d_gl_info *gl_info = &adapter->gl_info; @@ -3352,9 +3434,9 @@ const char *WGL_Extensions = NULL; enum wined3d_gl_vendor gl_vendor; enum wined3d_pci_device device; - DWORD gl_version; + DWORD gl_version, gl_ext_emul_mask; HDC hdc; - unsigned int i; + unsigned int i, j; GLint context_profile = 0; TRACE("adapter %p.\n", adapter); @@ -3429,30 +3511,25 @@ parse_extension_string(gl_info, WGL_Extensions, wgl_extension_map, sizeof(wgl_extension_map) / sizeof(*wgl_extension_map)); - if (!gl_info->supported[EXT_TEXTURE3D] && gl_version >= MAKEDWORD_VERSION(1, 2)) + for (i = 0; i < ARRAY_SIZE(core_extensions); ++i) { - TRACE("GL CORE: GL_EXT_texture3D support.\n"); - gl_info->supported[EXT_TEXTURE3D] = TRUE; - } - - if (!gl_info->supported[NV_POINT_SPRITE] && gl_version >= MAKEDWORD_VERSION(1, 4)) - { - TRACE("GL CORE: GL_NV_point_sprite support.\n"); - gl_info->supported[NV_POINT_SPRITE] = TRUE; - } - - if ((!gl_info->supported[EXT_BLEND_MINMAX] || !gl_info->supported[EXT_BLEND_SUBTRACT]) - && gl_version >= MAKEDWORD_VERSION(1, 4)) - { - TRACE("GL CORE: GL_EXT_blend_minmax / GL_EXT_blend_subtract support.\n"); - gl_info->supported[EXT_BLEND_MINMAX] = TRUE; - gl_info->supported[EXT_BLEND_SUBTRACT] = TRUE; - } + if (!gl_info->supported[core_extensions[i].extension] + && gl_version >= core_extensions[i].min_gl_version) + { + for (j = 0; j < ARRAY_SIZE(gl_extension_map); ++j) + if (gl_extension_map[j].extension == core_extensions[i].extension) + break; - if (!gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] && gl_version >= MAKEDWORD_VERSION(2, 0)) - { - TRACE("GL CORE: GL_ARB_texture_non_power_of_two support.\n"); - gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] = TRUE; + if (j < ARRAY_SIZE(gl_extension_map)) + { + TRACE("GL CORE: %s support.\n", gl_extension_map[j].extension_string); + gl_info->supported[core_extensions[i].extension] = TRUE; + } + else + { + FIXME("GL extension %u not in the GL extensions map.\n", core_extensions[i].extension); + } + } } if (gl_info->supported[EXT_BLEND_MINMAX] || gl_info->supported[EXT_BLEND_SUBTRACT]) @@ -3717,9 +3794,23 @@ for (i = 0; i < gl_info->limits.buffers; ++i) adapter->d3d_info.valid_rt_mask |= (1 << i); + if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + { + GLuint vao; + + GL_EXTCALL(glGenVertexArrays(1, &vao)); + GL_EXTCALL(glBindVertexArray(vao)); + checkGLcall("creating VAO"); + } + fixup_extensions(gl_info, gl_renderer_str, gl_vendor, card_vendor, device); init_driver_info(driver_info, card_vendor, device); - add_gl_compat_wrappers(gl_info); + gl_ext_emul_mask = adapter->vertex_pipe->vp_get_emul_mask(gl_info) + | adapter->fragment_pipe->get_emul_mask(gl_info); + if (gl_ext_emul_mask & GL_EXT_EMUL_ARB_MULTITEXTURE) + install_gl_compat_wrapper(gl_info, ARB_MULTITEXTURE); + if (gl_ext_emul_mask & GL_EXT_EMUL_EXT_FOG_COORD) + install_gl_compat_wrapper(gl_info, EXT_FOG_COORD); return TRUE; } @@ -5757,7 +5848,7 @@ TRACE("Allocated LUID %08x:%08x for adapter %p.\n", adapter->luid.HighPart, adapter->luid.LowPart, adapter); - if (!wined3d_caps_gl_ctx_create(&caps_gl_ctx)) + if (!wined3d_caps_gl_ctx_create(adapter, &caps_gl_ctx)) { ERR("Failed to get a GL context for adapter %p.\n", adapter); return FALSE; @@ -5804,7 +5895,7 @@ return FALSE; } - if (!wined3d_adapter_init_format_info(adapter)) + if (!wined3d_adapter_init_format_info(adapter, &caps_gl_ctx)) { ERR("Failed to initialize GL format info.\n"); wined3d_caps_gl_ctx_destroy(&caps_gl_ctx); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/gl_compat.c wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/gl_compat.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/gl_compat.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/gl_compat.c 2015-07-29 19:28:54.000000000 +0000 @@ -260,21 +260,18 @@ } static void (WINE_GLAPI *old_fogcoord_glVertex4f) (GLfloat x, GLfloat y, GLfloat z, GLfloat w) = NULL; -static void (WINE_GLAPI *old_fogcoord_glVertex4fv) (const GLfloat *pos) = NULL; -static void (WINE_GLAPI *old_fogcoord_glVertex3f) (GLfloat x, GLfloat y, GLfloat z) = NULL; -static void (WINE_GLAPI *old_fogcoord_glVertex3fv) (const GLfloat *pos) = NULL; static void (WINE_GLAPI *old_fogcoord_glColor4f) (GLfloat r, GLfloat g, GLfloat b, GLfloat a) = NULL; -static void (WINE_GLAPI *old_fogcoord_glColor4fv) (const GLfloat *color) = NULL; -static void (WINE_GLAPI *old_fogcoord_glColor3f) (GLfloat r, GLfloat g, GLfloat b) = NULL; -static void (WINE_GLAPI *old_fogcoord_glColor3fv) (const GLfloat *color) = NULL; -static void (WINE_GLAPI *old_fogcoord_glColor4ub) (GLubyte r, GLubyte g, GLubyte b, GLubyte a) = NULL; -static void (WINE_GLAPI *old_fogcoord_glFogCoordfEXT) (GLfloat f) = NULL; -static void (WINE_GLAPI *old_fogcoord_glFogCoorddEXT) (GLdouble f) = NULL; -static void (WINE_GLAPI *old_fogcoord_glFogCoordfvEXT) (const GLfloat *f) = NULL; -static void (WINE_GLAPI *old_fogcoord_glFogCoorddvEXT) (const GLdouble *f) = NULL; static void WINE_GLAPI wine_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { struct wined3d_context *ctx = context_get_current(); + + /* This can be called from draw_test_quad() and at that point there is no + * wined3d_context current. */ + if (!ctx) + { + old_fogcoord_glVertex4f(x, y, z, w); + return; + } if(ctx->gl_fog_source == GL_FOG_COORDINATE_EXT && ctx->fog_enabled) { GLfloat c[4] = {ctx->color[0], ctx->color[1], ctx->color[2], ctx->color[3]}; GLfloat i; @@ -305,6 +302,14 @@ static void WINE_GLAPI wine_glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) { struct wined3d_context *ctx = context_get_current(); + + /* This can be called from draw_test_quad() and at that point there is no + * wined3d_context current. */ + if (!ctx) + { + old_fogcoord_glColor4f(r, g, b, a); + return; + } ctx->color[0] = r; ctx->color[1] = g; ctx->color[2] = b; @@ -347,198 +352,117 @@ /* End GL_EXT_fog_coord emulation */ -void add_gl_compat_wrappers(struct wined3d_gl_info *gl_info) +void install_gl_compat_wrapper(struct wined3d_gl_info *gl_info, enum wined3d_gl_extension ext) { - if (!gl_info->supported[ARB_MULTITEXTURE]) + switch (ext) { - TRACE("Applying GL_ARB_multitexture emulation hooks\n"); - gl_info->gl_ops.ext.p_glActiveTexture = wine_glActiveTexture; - gl_info->gl_ops.ext.p_glClientActiveTextureARB = wine_glClientActiveTextureARB; - gl_info->gl_ops.ext.p_glMultiTexCoord1fARB = wine_glMultiTexCoord1fARB; - gl_info->gl_ops.ext.p_glMultiTexCoord1fvARB = wine_glMultiTexCoord1fvARB; - gl_info->gl_ops.ext.p_glMultiTexCoord2fARB = wine_glMultiTexCoord2fARB; - gl_info->gl_ops.ext.p_glMultiTexCoord2fvARB = wine_glMultiTexCoord2fvARB; - gl_info->gl_ops.ext.p_glMultiTexCoord3fARB = wine_glMultiTexCoord3fARB; - gl_info->gl_ops.ext.p_glMultiTexCoord3fvARB = wine_glMultiTexCoord3fvARB; - gl_info->gl_ops.ext.p_glMultiTexCoord4fARB = wine_glMultiTexCoord4fARB; - gl_info->gl_ops.ext.p_glMultiTexCoord4fvARB = wine_glMultiTexCoord4fvARB; - gl_info->gl_ops.ext.p_glMultiTexCoord2svARB = wine_glMultiTexCoord2svARB; - gl_info->gl_ops.ext.p_glMultiTexCoord4svARB = wine_glMultiTexCoord4svARB; - if(old_multitex_glGetIntegerv) { - FIXME("GL_ARB_multitexture glGetIntegerv hook already applied\n"); - } else { + case ARB_MULTITEXTURE: + if (gl_info->supported[ARB_MULTITEXTURE]) + return; + if (gl_info->gl_ops.ext.p_glActiveTexture == wine_glActiveTexture) + { + FIXME("ARB_multitexture emulation hooks already applied.\n"); + return; + } + TRACE("Applying GL_ARB_multitexture emulation hooks.\n"); + gl_info->gl_ops.ext.p_glActiveTexture = wine_glActiveTexture; + gl_info->gl_ops.ext.p_glClientActiveTextureARB = wine_glClientActiveTextureARB; + gl_info->gl_ops.ext.p_glMultiTexCoord1fARB = wine_glMultiTexCoord1fARB; + gl_info->gl_ops.ext.p_glMultiTexCoord1fvARB = wine_glMultiTexCoord1fvARB; + gl_info->gl_ops.ext.p_glMultiTexCoord2fARB = wine_glMultiTexCoord2fARB; + gl_info->gl_ops.ext.p_glMultiTexCoord2fvARB = wine_glMultiTexCoord2fvARB; + gl_info->gl_ops.ext.p_glMultiTexCoord3fARB = wine_glMultiTexCoord3fARB; + gl_info->gl_ops.ext.p_glMultiTexCoord3fvARB = wine_glMultiTexCoord3fvARB; + gl_info->gl_ops.ext.p_glMultiTexCoord4fARB = wine_glMultiTexCoord4fARB; + gl_info->gl_ops.ext.p_glMultiTexCoord4fvARB = wine_glMultiTexCoord4fvARB; + gl_info->gl_ops.ext.p_glMultiTexCoord2svARB = wine_glMultiTexCoord2svARB; + gl_info->gl_ops.ext.p_glMultiTexCoord4svARB = wine_glMultiTexCoord4svARB; old_multitex_glGetIntegerv = gl_info->gl_ops.gl.p_glGetIntegerv; gl_info->gl_ops.gl.p_glGetIntegerv = wine_glGetIntegerv; - } - if(old_multitex_glGetFloatv) { - FIXME("GL_ARB_multitexture glGetGloatv hook already applied\n"); - } else { old_multitex_glGetFloatv = gl_info->gl_ops.gl.p_glGetFloatv; gl_info->gl_ops.gl.p_glGetFloatv = wine_glGetFloatv; - } - if(old_multitex_glGetDoublev) { - FIXME("GL_ARB_multitexture glGetDoublev hook already applied\n"); - } else { old_multitex_glGetDoublev = gl_info->gl_ops.gl.p_glGetDoublev; gl_info->gl_ops.gl.p_glGetDoublev = wine_glGetDoublev; - } - gl_info->supported[ARB_MULTITEXTURE] = TRUE; - } + gl_info->supported[ARB_MULTITEXTURE] = TRUE; + return; + + case EXT_FOG_COORD: + /* This emulation isn't perfect. There are a number of potential problems, but they should + * not matter in practise: + * + * Fog vs fragment shader: If we are using GL_ARB_fragment_program with the fog option, the + * glDisable(GL_FOG) here won't matter. However, if we have GL_ARB_fragment_program, it is pretty + * unlikely that we don't have GL_EXT_fog_coord. Besides, we probably have GL_ARB_vertex_program + * too, which would allow fog coord emulation in a fixed function vertex pipeline replacement. + * + * Fog vs texture: We apply the fog in the vertex color. An app could set up texturing settings which + * ignore the vertex color, thus effectively disabling our fog. However, in D3D this type of fog is + * a per-vertex fog too, so the apps shouldn't do that. + * + * Fog vs lighting: The app could in theory use D3DFOG_NONE table and D3DFOG_NONE vertex fog with + * untransformed vertices. That enables lighting and fog coords at the same time, and the lighting + * calculations could affect the already blended in fog color. There's nothing we can do against that, + * but most apps using fog color do their own lighting too and often even use RHW vertices. So live + * with it. + */ + if (gl_info->supported[EXT_FOG_COORD]) + return; + if (gl_info->gl_ops.gl.p_glFogi == wine_glFogi) + { + FIXME("EXT_fog_coord emulation hooks already applied.\n"); + return; + } + TRACE("Applying GL_ARB_fog_coord emulation hooks\n"); + + /* This probably means that the implementation doesn't advertise the extension, but implicitly supports + * it via the GL core version, or someone messed around in the extension table in directx.c. Add version- + * dependent loading for this extension if we ever hit this situation + */ + if (gl_info->supported[ARB_FRAGMENT_PROGRAM]) + { + FIXME("GL implementation supports GL_ARB_fragment_program but not GL_EXT_fog_coord\n"); + FIXME("The fog coord emulation will most likely fail\n"); + } + else if (gl_info->supported[ARB_FRAGMENT_SHADER]) + { + FIXME("GL implementation supports GL_ARB_fragment_shader but not GL_EXT_fog_coord\n"); + FIXME("The fog coord emulation will most likely fail\n"); + } - if (!gl_info->supported[EXT_FOG_COORD]) - { - /* This emulation isn't perfect. There are a number of potential problems, but they should - * not matter in practise: - * - * Fog vs fragment shader: If we are using GL_ARB_fragment_program with the fog option, the - * glDisable(GL_FOG) here won't matter. However, if we have GL_ARB_fragment_program, it is pretty - * unlikely that we don't have GL_EXT_fog_coord. Besides, we probably have GL_ARB_vertex_program - * too, which would allow fog coord emulation in a fixed function vertex pipeline replacement. - * - * Fog vs texture: We apply the fog in the vertex color. An app could set up texturing settings which - * ignore the vertex color, thus effectively disabling our fog. However, in D3D this type of fog is - * a per-vertex fog too, so the apps shouldn't do that. - * - * Fog vs lighting: The app could in theory use D3DFOG_NONE table and D3DFOG_NONE vertex fog with - * untransformed vertices. That enables lighting and fog coords at the same time, and the lighting - * calculations could affect the already blended in fog color. There's nothing we can do against that, - * but most apps using fog color do their own lighting too and often even use RHW vertices. So live - * with it. - */ - TRACE("Applying GL_ARB_fog_coord emulation hooks\n"); - - /* This probably means that the implementation doesn't advertise the extension, but implicitly supports - * it via the GL core version, or someone messed around in the extension table in directx.c. Add version- - * dependent loading for this extension if we ever hit this situation - */ - if (gl_info->supported[ARB_FRAGMENT_PROGRAM]) - { - FIXME("GL implementation supports GL_ARB_fragment_program but not GL_EXT_fog_coord\n"); - FIXME("The fog coord emulation will most likely fail\n"); - } - else if (gl_info->supported[ARB_FRAGMENT_SHADER]) - { - FIXME("GL implementation supports GL_ARB_fragment_shader but not GL_EXT_fog_coord\n"); - FIXME("The fog coord emulation will most likely fail\n"); - } - - if(old_fogcoord_glFogi) { - FIXME("GL_EXT_fogcoord glFogi hook already applied\n"); - } else { old_fogcoord_glFogi = gl_info->gl_ops.gl.p_glFogi; gl_info->gl_ops.gl.p_glFogi = wine_glFogi; - } - if(old_fogcoord_glFogiv) { - FIXME("GL_EXT_fogcoord glFogiv hook already applied\n"); - } else { old_fogcoord_glFogiv = gl_info->gl_ops.gl.p_glFogiv; gl_info->gl_ops.gl.p_glFogiv = wine_glFogiv; - } - if(old_fogcoord_glFogf) { - FIXME("GL_EXT_fogcoord glFogf hook already applied\n"); - } else { old_fogcoord_glFogf = gl_info->gl_ops.gl.p_glFogf; gl_info->gl_ops.gl.p_glFogf = wine_glFogf; - } - if(old_fogcoord_glFogfv) { - FIXME("GL_EXT_fogcoord glFogfv hook already applied\n"); - } else { old_fogcoord_glFogfv = gl_info->gl_ops.gl.p_glFogfv; gl_info->gl_ops.gl.p_glFogfv = wine_glFogfv; - } - if(old_fogcoord_glEnable) { - FIXME("GL_EXT_fogcoord glEnable hook already applied\n"); - } else { old_fogcoord_glEnable = glEnableWINE; glEnableWINE = wine_glEnable; - } - if(old_fogcoord_glDisable) { - FIXME("GL_EXT_fogcoord glDisable hook already applied\n"); - } else { old_fogcoord_glDisable = glDisableWINE; glDisableWINE = wine_glDisable; - } - if(old_fogcoord_glVertex4f) { - FIXME("GL_EXT_fogcoord glVertex4f hook already applied\n"); - } else { old_fogcoord_glVertex4f = gl_info->gl_ops.gl.p_glVertex4f; gl_info->gl_ops.gl.p_glVertex4f = wine_glVertex4f; - } - if(old_fogcoord_glVertex4fv) { - FIXME("GL_EXT_fogcoord glVertex4fv hook already applied\n"); - } else { - old_fogcoord_glVertex4fv = gl_info->gl_ops.gl.p_glVertex4fv; gl_info->gl_ops.gl.p_glVertex4fv = wine_glVertex4fv; - } - if(old_fogcoord_glVertex3f) { - FIXME("GL_EXT_fogcoord glVertex3f hook already applied\n"); - } else { - old_fogcoord_glVertex3f = gl_info->gl_ops.gl.p_glVertex3f; gl_info->gl_ops.gl.p_glVertex3f = wine_glVertex3f; - } - if(old_fogcoord_glVertex3fv) { - FIXME("GL_EXT_fogcoord glVertex3fv hook already applied\n"); - } else { - old_fogcoord_glVertex3fv = gl_info->gl_ops.gl.p_glVertex3fv; gl_info->gl_ops.gl.p_glVertex3fv = wine_glVertex3fv; - } - if(old_fogcoord_glColor4f) { - FIXME("GL_EXT_fogcoord glColor4f hook already applied\n"); - } else { old_fogcoord_glColor4f = gl_info->gl_ops.gl.p_glColor4f; gl_info->gl_ops.gl.p_glColor4f = wine_glColor4f; - } - if(old_fogcoord_glColor4fv) { - FIXME("GL_EXT_fogcoord glColor4fv hook already applied\n"); - } else { - old_fogcoord_glColor4fv = gl_info->gl_ops.gl.p_glColor4fv; gl_info->gl_ops.gl.p_glColor4fv = wine_glColor4fv; - } - if(old_fogcoord_glColor3f) { - FIXME("GL_EXT_fogcoord glColor3f hook already applied\n"); - } else { - old_fogcoord_glColor3f = gl_info->gl_ops.gl.p_glColor3f; gl_info->gl_ops.gl.p_glColor3f = wine_glColor3f; - } - if(old_fogcoord_glColor3fv) { - FIXME("GL_EXT_fogcoord glColor3fv hook already applied\n"); - } else { - old_fogcoord_glColor3fv = gl_info->gl_ops.gl.p_glColor3fv; gl_info->gl_ops.gl.p_glColor3fv = wine_glColor3fv; - } - if(old_fogcoord_glColor4ub) { - FIXME("GL_EXT_fogcoord glColor4ub hook already applied\n"); - } else { - old_fogcoord_glColor4ub = gl_info->gl_ops.gl.p_glColor4ub; gl_info->gl_ops.gl.p_glColor4ub = wine_glColor4ub; - } - if(old_fogcoord_glFogCoordfEXT) { - FIXME("GL_EXT_fogcoord glFogCoordfEXT hook already applied\n"); - } else { - old_fogcoord_glFogCoordfEXT = gl_info->gl_ops.ext.p_glFogCoordfEXT; gl_info->gl_ops.ext.p_glFogCoordfEXT = wine_glFogCoordfEXT; - } - if(old_fogcoord_glFogCoordfvEXT) { - FIXME("GL_EXT_fogcoord glFogCoordfvEXT hook already applied\n"); - } else { - old_fogcoord_glFogCoordfvEXT = gl_info->gl_ops.ext.p_glFogCoordfvEXT; gl_info->gl_ops.ext.p_glFogCoordfvEXT = wine_glFogCoordfvEXT; - } - if(old_fogcoord_glFogCoorddEXT) { - FIXME("GL_EXT_fogcoord glFogCoorddEXT hook already applied\n"); - } else { - old_fogcoord_glFogCoorddEXT = gl_info->gl_ops.ext.p_glFogCoorddEXT; gl_info->gl_ops.ext.p_glFogCoorddEXT = wine_glFogCoorddEXT; - } - if(old_fogcoord_glFogCoorddvEXT) { - FIXME("GL_EXT_fogcoord glFogCoorddvEXT hook already applied\n"); - } else { - old_fogcoord_glFogCoorddvEXT = gl_info->gl_ops.ext.p_glFogCoorddvEXT; gl_info->gl_ops.ext.p_glFogCoorddvEXT = wine_glFogCoorddvEXT; - } - gl_info->supported[EXT_FOG_COORD] = TRUE; + gl_info->supported[EXT_FOG_COORD] = TRUE; + return; + + default: + FIXME("Extension %u emulation not supported.\n", ext); } } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/glsl_shader.c wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/glsl_shader.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/glsl_shader.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/glsl_shader.c 2015-07-29 19:28:54.000000000 +0000 @@ -333,7 +333,7 @@ } /* Context activation is done by the caller. */ -static void print_glsl_info_log(const struct wined3d_gl_info *gl_info, GLuint id, BOOL program) +void print_glsl_info_log(const struct wined3d_gl_info *gl_info, GLuint id, BOOL program) { int length = 0; char *log; @@ -453,7 +453,7 @@ } /* Context activation is done by the caller. */ -static void shader_glsl_validate_link(const struct wined3d_gl_info *gl_info, GLuint program) +void shader_glsl_validate_link(const struct wined3d_gl_info *gl_info, GLuint program) { GLint tmp; @@ -7742,6 +7742,13 @@ caps->raster_caps = WINED3DPRASTERCAPS_FOGRANGE; } +static DWORD glsl_vertex_pipe_vp_get_emul_mask(const struct wined3d_gl_info *gl_info) +{ + if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + return GL_EXT_EMUL_ARB_MULTITEXTURE; + return 0; +} + static void *glsl_vertex_pipe_vp_alloc(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv) { struct shader_glsl_priv *priv; @@ -8121,6 +8128,7 @@ { glsl_vertex_pipe_vp_enable, glsl_vertex_pipe_vp_get_caps, + glsl_vertex_pipe_vp_get_emul_mask, glsl_vertex_pipe_vp_alloc, glsl_vertex_pipe_vp_free, glsl_vertex_pipe_vp_states, @@ -8167,6 +8175,13 @@ caps->MaxSimultaneousTextures = min(gl_info->limits.fragment_samplers, 8); } +static DWORD glsl_fragment_pipe_get_emul_mask(const struct wined3d_gl_info *gl_info) +{ + if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + return GL_EXT_EMUL_ARB_MULTITEXTURE; + return 0; +} + static void *glsl_fragment_pipe_alloc(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv) { struct shader_glsl_priv *priv; @@ -8446,6 +8461,7 @@ { glsl_fragment_pipe_enable, glsl_fragment_pipe_get_caps, + glsl_fragment_pipe_get_emul_mask, glsl_fragment_pipe_alloc, glsl_fragment_pipe_free, glsl_fragment_pipe_alloc_context_data, diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/nvidia_texture_shader.c wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/nvidia_texture_shader.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/nvidia_texture_shader.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/nvidia_texture_shader.c 2015-07-29 19:28:54.000000000 +0000 @@ -738,6 +738,11 @@ caps->MaxSimultaneousTextures = gl_info->limits.textures; } +static DWORD nvrc_fragment_get_emul_mask(const struct wined3d_gl_info *gl_info) +{ + return GL_EXT_EMUL_ARB_MULTITEXTURE | GL_EXT_EMUL_EXT_FOG_COORD; +} + static void *nvrc_fragment_alloc(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv) { return shader_priv; @@ -924,6 +929,7 @@ const struct fragment_pipeline nvts_fragment_pipeline = { nvts_enable, nvrc_fragment_get_caps, + nvrc_fragment_get_emul_mask, nvrc_fragment_alloc, nvrc_fragment_free, nvrc_context_alloc, @@ -935,6 +941,7 @@ const struct fragment_pipeline nvrc_fragment_pipeline = { nvrc_enable, nvrc_fragment_get_caps, + nvrc_fragment_get_emul_mask, nvrc_fragment_alloc, nvrc_fragment_free, nvrc_context_alloc, diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/state.c wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/state.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/state.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/state.c 2015-07-29 19:28:54.000000000 +0000 @@ -5582,10 +5582,16 @@ caps->raster_caps |= WINED3DPRASTERCAPS_FOGRANGE; } +static DWORD vp_ffp_get_emul_mask(const struct wined3d_gl_info *gl_info) +{ + return GL_EXT_EMUL_ARB_MULTITEXTURE | GL_EXT_EMUL_EXT_FOG_COORD; +} + const struct wined3d_vertex_pipe_ops ffp_vertex_pipe = { ffp_enable, vp_ffp_get_caps, + vp_ffp_get_emul_mask, ffp_alloc, ffp_free, vp_ffp_states, @@ -5632,6 +5638,11 @@ caps->MaxSimultaneousTextures = gl_info->limits.textures; } +static DWORD ffp_fragment_get_emul_mask(const struct wined3d_gl_info *gl_info) +{ + return GL_EXT_EMUL_ARB_MULTITEXTURE | GL_EXT_EMUL_EXT_FOG_COORD; +} + static BOOL ffp_color_fixup_supported(struct color_fixup_desc fixup) { if (TRACE_ON(d3d)) @@ -5663,6 +5674,7 @@ const struct fragment_pipeline ffp_fragment_pipeline = { ffp_enable, ffp_fragment_get_caps, + ffp_fragment_get_emul_mask, ffp_alloc, ffp_free, ffp_none_context_alloc, @@ -5685,10 +5697,16 @@ memset(caps, 0, sizeof(*caps)); } +static DWORD vp_none_get_emul_mask(const struct wined3d_gl_info *gl_info) +{ + return 0; +} + const struct wined3d_vertex_pipe_ops none_vertex_pipe = { none_enable, vp_none_get_caps, + vp_none_get_emul_mask, none_alloc, none_free, NULL, @@ -5699,6 +5717,11 @@ memset(caps, 0, sizeof(*caps)); } +static DWORD fp_none_get_emul_mask(const struct wined3d_gl_info *gl_info) +{ + return 0; +} + static BOOL fp_none_color_fixup_supported(struct color_fixup_desc fixup) { return is_identity_fixup(fixup); @@ -5708,6 +5731,7 @@ { none_enable, fp_none_get_caps, + fp_none_get_emul_mask, none_alloc, none_free, ffp_none_context_alloc, diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/utils.c wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/utils.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/utils.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/utils.c 2015-07-29 19:28:54.000000000 +0000 @@ -1557,13 +1557,133 @@ while (gl_info->gl_ops.gl.p_glGetError()); } +static void draw_test_quad(struct wined3d_caps_gl_ctx *ctx, const struct wined3d_vec3 *geometry, + const struct wined3d_color *color) +{ + const struct wined3d_gl_info *gl_info = ctx->gl_info; + static const struct wined3d_vec3 default_geometry[] = + { + {-1.0f, -1.0f, 0.0f}, + { 1.0f, -1.0f, 0.0f}, + {-1.0f, 1.0f, 0.0f}, + { 1.0f, 1.0f, 0.0f}, + }; + static const char vs_core_header[] = + "#version 150\n" + "in vec4 pos;\n" + "in vec4 color;\n" + "out vec4 out_color;\n" + "\n"; + static const char vs_legacy_header[] = + "#version 120\n" + "attribute vec4 pos;\n" + "attribute vec4 color;\n" + "varying vec4 out_color;\n" + "\n"; + static const char vs_body[] = + "void main()\n" + "{\n" + " gl_Position = pos;\n" + " out_color = color;\n" + "}\n"; + static const char fs_core[] = + "#version 150\n" + "in vec4 out_color;\n" + "out vec4 fragment_color;\n" + "\n" + "void main()\n" + "{\n" + " fragment_color = out_color;\n" + "}\n"; + static const char fs_legacy[] = + "#version 120\n" + "varying vec4 out_color;\n" + "\n" + "void main()\n" + "{\n" + " gl_FragData[0] = out_color;\n" + "}\n"; + const char *source[2]; + GLuint vs_id, fs_id; + unsigned int i; + + if (!geometry) + geometry = default_geometry; + + if (!gl_info->supported[ARB_VERTEX_BUFFER_OBJECT] || !gl_info->supported[ARB_VERTEX_SHADER] + || !gl_info->supported[ARB_FRAGMENT_SHADER]) + { + gl_info->gl_ops.gl.p_glDisable(GL_LIGHTING); + gl_info->gl_ops.gl.p_glMatrixMode(GL_MODELVIEW); + gl_info->gl_ops.gl.p_glLoadIdentity(); + gl_info->gl_ops.gl.p_glMatrixMode(GL_PROJECTION); + gl_info->gl_ops.gl.p_glLoadIdentity(); + + gl_info->gl_ops.gl.p_glBegin(GL_TRIANGLE_STRIP); + gl_info->gl_ops.gl.p_glColor4f(color->r, color->g, color->b, color->a); + for (i = 0; i < 4; ++i) + gl_info->gl_ops.gl.p_glVertex3fv(&geometry[i].x); + gl_info->gl_ops.gl.p_glEnd(); + checkGLcall("Drawing a quad"); + return; + } + + if (!ctx->test_vbo) + GL_EXTCALL(glGenBuffers(1, &ctx->test_vbo)); + GL_EXTCALL(glBindBuffer(GL_ARRAY_BUFFER, ctx->test_vbo)); + GL_EXTCALL(glBufferData(GL_ARRAY_BUFFER, sizeof(struct wined3d_vec3) * 4, geometry, GL_STREAM_DRAW)); + GL_EXTCALL(glVertexAttribPointer(0, 3, GL_FLOAT, FALSE, 0, NULL)); + GL_EXTCALL(glVertexAttrib4f(1, color->r, color->g, color->b, color->a)); + GL_EXTCALL(glEnableVertexAttribArray(0)); + GL_EXTCALL(glDisableVertexAttribArray(1)); + + if (!ctx->test_program_id) + { + ctx->test_program_id = GL_EXTCALL(glCreateProgram()); + + vs_id = GL_EXTCALL(glCreateShader(GL_VERTEX_SHADER)); + source[0] = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] ? vs_legacy_header : vs_core_header; + source[1] = vs_body; + GL_EXTCALL(glShaderSource(vs_id, 2, source, NULL)); + GL_EXTCALL(glAttachShader(ctx->test_program_id, vs_id)); + GL_EXTCALL(glDeleteShader(vs_id)); + + fs_id = GL_EXTCALL(glCreateShader(GL_FRAGMENT_SHADER)); + source[0] = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] ? fs_legacy : fs_core; + GL_EXTCALL(glShaderSource(fs_id, 1, source, NULL)); + GL_EXTCALL(glAttachShader(ctx->test_program_id, fs_id)); + GL_EXTCALL(glDeleteShader(fs_id)); + + GL_EXTCALL(glBindAttribLocation(ctx->test_program_id, 0, "pos")); + GL_EXTCALL(glBindAttribLocation(ctx->test_program_id, 1, "color")); + + GL_EXTCALL(glCompileShader(vs_id)); + print_glsl_info_log(gl_info, vs_id, FALSE); + GL_EXTCALL(glCompileShader(fs_id)); + print_glsl_info_log(gl_info, fs_id, FALSE); + GL_EXTCALL(glLinkProgram(ctx->test_program_id)); + shader_glsl_validate_link(gl_info, ctx->test_program_id); + } + GL_EXTCALL(glUseProgram(ctx->test_program_id)); + + gl_info->gl_ops.gl.p_glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + GL_EXTCALL(glUseProgram(0)); + GL_EXTCALL(glDisableVertexAttribArray(0)); + GL_EXTCALL(glBindBuffer(GL_ARRAY_BUFFER, 0)); + checkGLcall("Drawing a quad"); +} + /* Context activation is done by the caller. */ -static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined3d_format *format) +static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_format *format) { /* Check if the default internal format is supported as a frame buffer * target, otherwise fall back to the render target internal. * * Try to stick to the standard format if possible, this limits precision differences. */ + static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 1.0f}; + static const struct wined3d_color half_transparent_red = {1.0f, 0.0f, 0.0f, 0.5f}; + const struct wined3d_gl_info *gl_info = ctx->gl_info; GLenum status, rt_internal = format->rtInternal; GLuint object, color_rb; enum wined3d_gl_resource_type type; @@ -1697,32 +1817,13 @@ gl_info->gl_ops.gl.p_glViewport(0, 0, 16, 1); else gl_info->gl_ops.gl.p_glViewport(0, 0, 16, 16); - gl_info->gl_ops.gl.p_glDisable(GL_LIGHTING); - gl_info->gl_ops.gl.p_glMatrixMode(GL_MODELVIEW); - gl_info->gl_ops.gl.p_glLoadIdentity(); - gl_info->gl_ops.gl.p_glMatrixMode(GL_PROJECTION); - gl_info->gl_ops.gl.p_glLoadIdentity(); - gl_info->gl_ops.gl.p_glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - /* Draw a full-black quad */ - gl_info->gl_ops.gl.p_glBegin(GL_TRIANGLE_STRIP); - gl_info->gl_ops.gl.p_glColor4f(0.0f, 0.0f, 0.0f, 1.0f); - gl_info->gl_ops.gl.p_glVertex3f(-1.0f, -1.0f, 0.0f); - gl_info->gl_ops.gl.p_glVertex3f(1.0f, -1.0f, 0.0f); - gl_info->gl_ops.gl.p_glVertex3f(-1.0f, 1.0f, 0.0f); - gl_info->gl_ops.gl.p_glVertex3f(1.0f, 1.0f, 0.0f); - gl_info->gl_ops.gl.p_glEnd(); + draw_test_quad(ctx, NULL, &black); gl_info->gl_ops.gl.p_glEnable(GL_BLEND); - /* Draw a half-transparent red quad */ - gl_info->gl_ops.gl.p_glBegin(GL_TRIANGLE_STRIP); - gl_info->gl_ops.gl.p_glColor4f(1.0f, 0.0f, 0.0f, 0.5f); - gl_info->gl_ops.gl.p_glVertex3f(-1.0f, -1.0f, 0.0f); - gl_info->gl_ops.gl.p_glVertex3f(1.0f, -1.0f, 0.0f); - gl_info->gl_ops.gl.p_glVertex3f(-1.0f, 1.0f, 0.0f); - gl_info->gl_ops.gl.p_glVertex3f(1.0f, 1.0f, 0.0f); - gl_info->gl_ops.gl.p_glEnd(); + + draw_test_quad(ctx, NULL, &half_transparent_red); gl_info->gl_ops.gl.p_glDisable(GL_BLEND); @@ -1868,8 +1969,9 @@ } /* Context activation is done by the caller. */ -static void init_format_fbo_compat_info(struct wined3d_gl_info *gl_info) +static void init_format_fbo_compat_info(struct wined3d_caps_gl_ctx *ctx) { + const struct wined3d_gl_info *gl_info = ctx->gl_info; unsigned int i, type; GLuint fbo; @@ -2002,7 +2104,7 @@ if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { TRACE("Checking if format %s is supported as FBO color attachment...\n", debug_d3dformat(format->id)); - check_fbo_compat(gl_info, format); + check_fbo_compat(ctx, format); } else { @@ -2273,7 +2375,8 @@ /* This was already handled by init_format_texture_info(). */ return; - if(wined3d_settings.offscreen_rendering_mode != ORM_FBO) + if (wined3d_settings.offscreen_rendering_mode != ORM_FBO + || !gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) { WARN("No FBO support, or no FBO ORM, guessing filter info from GL caps\n"); if (vendor == HW_VENDOR_NVIDIA && gl_info->supported[ARB_TEXTURE_FLOAT]) @@ -2582,7 +2685,7 @@ } /* Context activation is done by the caller. */ -BOOL wined3d_adapter_init_format_info(struct wined3d_adapter *adapter) +BOOL wined3d_adapter_init_format_info(struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *ctx) { struct wined3d_gl_info *gl_info = &adapter->gl_info; @@ -2593,7 +2696,7 @@ if (!init_format_vertex_info(gl_info)) goto fail; apply_format_fixups(adapter, gl_info); - init_format_fbo_compat_info(gl_info); + init_format_fbo_compat_info(ctx); init_format_filter_info(gl_info, adapter->driver_info.vendor); return TRUE; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/wined3d_private.h wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/wined3d_private.h --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/wined3d_private.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/wined3d_private.h 2015-07-29 19:28:54.000000000 +0000 @@ -1287,10 +1287,14 @@ DWORD MaxSimultaneousTextures; }; +#define GL_EXT_EMUL_ARB_MULTITEXTURE 0x00000001 +#define GL_EXT_EMUL_EXT_FOG_COORD 0x00000002 + struct fragment_pipeline { void (*enable_extension)(const struct wined3d_gl_info *gl_info, BOOL enable); void (*get_caps)(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps); + DWORD (*get_emul_mask)(const struct wined3d_gl_info *gl_info); void *(*alloc_private)(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv); void (*free_private)(struct wined3d_device *device); BOOL (*allocate_context_data)(struct wined3d_context *context); @@ -1316,6 +1320,7 @@ { void (*vp_enable)(const struct wined3d_gl_info *gl_info, BOOL enable); void (*vp_get_caps)(const struct wined3d_gl_info *gl_info, struct wined3d_vertex_caps *caps); + DWORD (*vp_get_emul_mask)(const struct wined3d_gl_info *gl_info); void *(*vp_alloc)(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv); void (*vp_free)(struct wined3d_device *device); const struct StateEntryTemplate *vp_states; @@ -1794,11 +1799,25 @@ const struct blit_shader *blitter; }; -BOOL wined3d_adapter_init_format_info(struct wined3d_adapter *adapter) DECLSPEC_HIDDEN; +struct wined3d_caps_gl_ctx +{ + HDC dc; + HWND wnd; + HGLRC gl_ctx; + HDC restore_dc; + HGLRC restore_gl_ctx; + + const struct wined3d_gl_info *gl_info; + GLuint test_vbo; + GLuint test_program_id; +}; + +BOOL wined3d_adapter_init_format_info(struct wined3d_adapter *adapter, + struct wined3d_caps_gl_ctx *ctx) DECLSPEC_HIDDEN; UINT64 adapter_adjust_memory(struct wined3d_adapter *adapter, INT64 amount) DECLSPEC_HIDDEN; BOOL initPixelFormatsNoGL(struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; -extern void add_gl_compat_wrappers(struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; +void install_gl_compat_wrapper(struct wined3d_gl_info *gl_info, enum wined3d_gl_extension ext) DECLSPEC_HIDDEN; enum projection_types { @@ -3103,6 +3122,9 @@ WORD num_consts; }; +void print_glsl_info_log(const struct wined3d_gl_info *gl_info, GLuint id, BOOL program) DECLSPEC_HIDDEN; +void shader_glsl_validate_link(const struct wined3d_gl_info *gl_info, GLuint program) DECLSPEC_HIDDEN; + struct wined3d_palette { LONG ref; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/wined3d.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/wined3d.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wined3d/wined3d.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wined3d/wined3d.spec 2015-07-29 19:28:54.000000000 +0000 @@ -38,6 +38,7 @@ @ cdecl wined3d_device_clear(ptr long ptr long ptr float long) @ cdecl wined3d_device_clear_rendertarget_view(ptr ptr ptr ptr) @ cdecl wined3d_device_copy_resource(ptr ptr ptr) +@ cdecl wined3d_device_copy_sub_resource_region(ptr ptr long long long long ptr long ptr) @ cdecl wined3d_device_create(ptr long long ptr long long ptr ptr) @ cdecl wined3d_device_decref(ptr) @ cdecl wined3d_device_draw_indexed_primitive(ptr long long) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/winemac.drv/window.c wine-staging-1.7.48~ubuntu12.04.1/dlls/winemac.drv/window.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/winemac.drv/window.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/winemac.drv/window.c 2015-07-29 19:28:54.000000000 +0000 @@ -1274,6 +1274,8 @@ if (!(data = get_win_data(hwnd))) return; + if (hwnd == GetCapture()) macdrv_SetCapture(0, 0); + if (data->gl_view) macdrv_dispose_view(data->gl_view); destroy_cocoa_window(data); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/winex11.drv/keyboard.c wine-staging-1.7.48~ubuntu12.04.1/dlls/winex11.drv/keyboard.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/winex11.drv/keyboard.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/winex11.drv/keyboard.c 2015-07-29 19:28:54.000000000 +0000 @@ -1233,6 +1233,7 @@ WORD vkey; BOOL pressed; } modifiers[6]; /* VK_LSHIFT through VK_RMENU are contiguous */ + BOOL lwin_pressed = FALSE, rwin_pressed = FALSE; if (!get_async_key_state( keystate )) return; @@ -1264,6 +1265,12 @@ if (!modifiers[m].vkey) modifiers[m].vkey = vkey; if (event->xkeymap.key_vector[i] & (1<xkeymap.key_vector[i] & (1<xkeymap.key_vector[i] & (1<hwnd, GWL_STYLE ); if (style & WS_MINIMIZE) - new_state |= data->net_wm_state & (1 << NET_WM_STATE_FULLSCREEN); + new_state |= data->net_wm_state & ((1 << NET_WM_STATE_FULLSCREEN)|(1 << NET_WM_STATE_MAXIMIZED)); if (is_window_rect_fullscreen( &data->whole_rect )) { if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/winhttp/request.c wine-staging-1.7.48~ubuntu12.04.1/dlls/winhttp/request.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/winhttp/request.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/winhttp/request.c 2015-07-29 19:28:54.000000000 +0000 @@ -217,6 +217,11 @@ } case WAIT_OBJECT_0 + 1: TRACE("exiting\n"); + CloseHandle( request->task_cancel ); + CloseHandle( request->task_wait ); + request->task_cs.DebugInfo->Spare[0] = 0; + DeleteCriticalSection( &request->task_cs ); + request->hdr.vtbl->destroy( &request->hdr ); return 0; default: diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/winhttp/session.c wine-staging-1.7.48~ubuntu12.04.1/dlls/winhttp/session.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/winhttp/session.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/winhttp/session.c 2015-07-29 19:28:54.000000000 +0000 @@ -98,6 +98,8 @@ TRACE("%p\n", session); + if (session->unload_event) SetEvent( session->unload_event ); + LIST_FOR_EACH_SAFE( item, next, &session->cookie_cache ) { domain = LIST_ENTRY( item, domain_t, entry ); @@ -199,6 +201,10 @@ case WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH: FIXME("WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH: 0x%x\n", *(DWORD *)buffer); return TRUE; + case WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT: + TRACE("WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT: %p\n", *(HANDLE *)buffer); + session->unload_event = *(HANDLE *)buffer; + return TRUE; default: FIXME("unimplemented option %u\n", option); set_last_error( ERROR_INVALID_PARAMETER ); @@ -561,13 +567,13 @@ if (request->task_thread) { + /* Signal to the task proc to quit. It will call + this again when it does. */ + HANDLE thread = request->task_thread; + request->task_thread = 0; SetEvent( request->task_cancel ); - WaitForSingleObject( request->task_thread, INFINITE ); - CloseHandle( request->task_thread ); - CloseHandle( request->task_cancel ); - CloseHandle( request->task_wait ); - request->task_cs.DebugInfo->Spare[0] = 0; - DeleteCriticalSection( &request->task_cs ); + CloseHandle( thread ); + return; } release_object( &request->connect->hdr ); @@ -2038,8 +2044,6 @@ if (netconn_set_timeout( &request->netconn, TRUE, send )) ret = FALSE; if (netconn_set_timeout( &request->netconn, FALSE, receive )) ret = FALSE; } - - release_object( &request->hdr ); break; case WINHTTP_HANDLE_TYPE_SESSION: @@ -2057,10 +2061,10 @@ break; default: - release_object( hdr ); set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE ); - return FALSE; + ret = FALSE; } + release_object( hdr ); return ret; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/winhttp/tests/notification.c wine-staging-1.7.48~ubuntu12.04.1/dlls/winhttp/tests/notification.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/winhttp/tests/notification.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/winhttp/tests/notification.c 2015-07-29 19:28:54.000000000 +0000 @@ -158,9 +158,9 @@ static void test_connection_cache( void ) { - HANDLE ses, con, req; + HANDLE ses, con, req, event; DWORD size, status; - BOOL ret; + BOOL ret, unload = TRUE; struct info info, *context = &info; info.test = cache_test; @@ -171,6 +171,14 @@ ses = WinHttpOpen( user_agent, 0, NULL, NULL, 0 ); ok(ses != NULL, "failed to open session %u\n", GetLastError()); + event = CreateEventW( NULL, FALSE, FALSE, NULL ); + ret = WinHttpSetOption( ses, WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT, &event, sizeof(event) ); + if (!ret) + { + win_skip("Unload event not supported\n"); + unload = FALSE; + } + WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); @@ -236,15 +244,33 @@ setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); + + if (unload) + { + status = WaitForSingleObject( event, 0 ); + ok(status == WAIT_TIMEOUT, "got %08x\n", status); + } + WinHttpCloseHandle( ses ); Sleep(2000); /* make sure connection is evicted from cache */ + if (unload) + { + status = WaitForSingleObject( event, 0 ); + ok(status == WAIT_OBJECT_0, "got %08x\n", status); + } info.index = 0; ses = WinHttpOpen( user_agent, 0, NULL, NULL, 0 ); ok(ses != NULL, "failed to open session %u\n", GetLastError()); + if (unload) + { + ret = WinHttpSetOption( ses, WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT, &event, sizeof(event) ); + ok(ret, "failed to set unload option\n"); + } + WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); @@ -311,9 +337,23 @@ done: WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); + + if (unload) + { + status = WaitForSingleObject( event, 0 ); + ok(status == WAIT_TIMEOUT, "got %08x\n", status); + } + WinHttpCloseHandle( ses ); Sleep(2000); /* make sure connection is evicted from cache */ + if (unload) + { + status = WaitForSingleObject( event, 0 ); + ok(status == WAIT_OBJECT_0, "got %08x\n", status); + } + + CloseHandle( event ); } static const struct notification redirect_test[] = @@ -433,9 +473,9 @@ static void test_async( void ) { - HANDLE ses, con, req; + HANDLE ses, con, req, event; DWORD size, status; - BOOL ret; + BOOL ret, unload = TRUE; struct info info, *context = &info; char buffer[1024]; @@ -447,6 +487,14 @@ ses = WinHttpOpen( user_agent, 0, NULL, NULL, WINHTTP_FLAG_ASYNC ); ok(ses != NULL, "failed to open session %u\n", GetLastError()); + event = CreateEventW( NULL, FALSE, FALSE, NULL ); + ret = WinHttpSetOption( ses, WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT, &event, sizeof(event) ); + if (!ret) + { + win_skip("Unload event not supported\n"); + unload = FALSE; + } + WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); @@ -501,9 +549,22 @@ setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); + + if (unload) + { + status = WaitForSingleObject( event, 0 ); + ok(status == WAIT_TIMEOUT, "got %08x\n", status); + } WinHttpCloseHandle( ses ); WaitForSingleObject( info.wait, INFINITE ); + + if (unload) + { + status = WaitForSingleObject( event, 2000 ); + ok(status == WAIT_OBJECT_0, "got %08x\n", status); + } + CloseHandle( event ); CloseHandle( info.wait ); } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/winhttp/winhttp_private.h wine-staging-1.7.48~ubuntu12.04.1/dlls/winhttp/winhttp_private.h --- wine-staging-1.7.47~ubuntu12.04.1/dlls/winhttp/winhttp_private.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/winhttp/winhttp_private.h 2015-07-29 19:28:54.000000000 +0000 @@ -110,6 +110,7 @@ LPWSTR proxy_username; LPWSTR proxy_password; struct list cookie_cache; + HANDLE unload_event; } session_t; typedef struct diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/wininet/tests/http.c wine-staging-1.7.48~ubuntu12.04.1/dlls/wininet/tests/http.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/wininet/tests/http.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/wininet/tests/http.c 2015-07-29 19:28:54.000000000 +0000 @@ -2888,7 +2888,7 @@ data_len = sizeof(data); memset(data, 'a', sizeof(data)); ret = HttpSendRequestA(request, connection, ~0u, data, data_len); - ok(ret, "HttpSendRequest failed\n"); + ok(ret, "HttpSendRequest failed: %u\n", GetLastError()); status = 0; size = sizeof(status); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/winsta/main.c wine-staging-1.7.48~ubuntu12.04.1/dlls/winsta/main.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/winsta/main.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/winsta/main.c 2015-07-29 19:28:54.000000000 +0000 @@ -23,6 +23,7 @@ #include "winbase.h" #include "winternl.h" #include "wine/debug.h" +#include "winsta.h" WINE_DEFAULT_DEBUG_CHANNEL(winsta); @@ -68,7 +69,7 @@ } BOOLEAN WINAPI WinStationGetAllProcesses( HANDLE server, ULONG level, - ULONG *process_count, void *info ) + ULONG *process_count, PTS_ALL_PROCESSES_INFO *info ) { FIXME( "%p %u %p %p\n", server, level, process_count, info ); *process_count = 0; @@ -76,10 +77,10 @@ return FALSE; } -BOOL WINAPI WinStationGetProcessSid( PVOID a, HANDLE server, DWORD process_id, PFILETIME process_start_time, - PBYTE process_user_sid, PDWORD sid_size) +BOOLEAN WINAPI WinStationGetProcessSid( HANDLE server, ULONG process_id, FILETIME *process_start_time, + PVOID process_user_sid, PULONG sid_size ) { - FIXME( "(%p, %p, %d, %p, %p, %p): stub\n", a, server, process_id, process_start_time, process_user_sid, sid_size); + FIXME( "(%p, %d, %p, %p, %p): stub\n", server, process_id, process_start_time, process_user_sid, sid_size); SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); return FALSE; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/winsta/winsta.h wine-staging-1.7.48~ubuntu12.04.1/dlls/winsta/winsta.h --- wine-staging-1.7.47~ubuntu12.04.1/dlls/winsta/winsta.h 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/winsta/winsta.h 2015-07-29 19:28:54.000000000 +0000 @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2015 Austin English + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef _WINSTA_H +#define _WINSTA_H + +#define WINSTATIONNAME_LENGTH 32 +typedef WCHAR WINSTATIONNAME[WINSTATIONNAME_LENGTH + 1]; + +typedef enum _WINSTATIONSTATECLASS +{ + State_Active, + State_Connected, + State_ConnectQuery, + State_Shadow, + State_Disconnected, + State_Idle, + State_Listen, + State_Reset, + State_Down, + State_Init +} WINSTATIONSTATECLASS; + +typedef struct _SESSIONIDW +{ + union + { + ULONG SessionId; + ULONG LogonId; + } DUMMYUNIONNAME; + WINSTATIONNAME WinStationName; + WINSTATIONSTATECLASS State; +} SESSIONIDW, *PSESSIONIDW; + +typedef struct _TS_SYS_PROCESS_INFORMATION +{ + ULONG NextEntryOffset; + ULONG NumberOfThreads; + LARGE_INTEGER SpareLi1; + LARGE_INTEGER SpareLi2; + LARGE_INTEGER SpareLi3; + LARGE_INTEGER CreateTime; + LARGE_INTEGER UserTime; + LARGE_INTEGER KernelTime; + UNICODE_STRING ImageName; + LONG BasePriority; + ULONG UniqueProcessId; + ULONG InheritedFromUniqueProcessId; + ULONG HandleCount; + ULONG SessionId; + ULONG SpareUl3; + SIZE_T PeakVirtualSize; + SIZE_T VirtualSize; + ULONG PageFaultCount; + ULONG PeakWorkingSetSize; + ULONG WorkingSetSize; + SIZE_T QuotaPeakPagedPoolUsage; + SIZE_T QuotaPagedPoolUsage; + SIZE_T QuotaPeakNonPagedPoolUsage; + SIZE_T QuotaNonPagedPoolUsage; + SIZE_T PagefileUsage; + SIZE_T PeakPagefileUsage; + SIZE_T PrivatePageCount; +} TS_SYS_PROCESS_INFORMATION, *PTS_SYS_PROCESS_INFORMATION; + +typedef struct _TS_ALL_PROCESSES_INFO +{ + PTS_SYS_PROCESS_INFORMATION pTsProcessInfo; + DWORD SizeOfSid; +#ifdef MIDL_PASS + [size_is(SizeOfSid)] PBYTE pSid; +#else + PBYTE pSid; +#endif +} TS_ALL_PROCESSES_INFO, *PTS_ALL_PROCESSES_INFO; + +BOOLEAN WINAPI WinStationEnumerateW(HANDLE,PSESSIONIDW *,PULONG); +BOOLEAN WINAPI WinStationGetAllProcesses(HANDLE,ULONG,PULONG,PTS_ALL_PROCESSES_INFO *); +BOOLEAN WINAPI WinStationGetProcessSid(HANDLE,ULONG,FILETIME *,PVOID,PULONG); +BOOLEAN WINAPI WinStationQueryInformationW(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG); +BOOLEAN WINAPI WinStationRegisterConsoleNotification(HANDLE,HWND,ULONG); + +#endif /* _WINSTA_H */ diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/winsta/winsta.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/winsta/winsta.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/winsta/winsta.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/winsta/winsta.spec 2015-07-29 19:28:54.000000000 +0000 @@ -39,7 +39,7 @@ @ stub WinStationGetLanAdapterNameA @ stub WinStationGetLanAdapterNameW @ stub WinStationGetMachinePolicy -@ stdcall WinStationGetProcessSid(ptr ptr long ptr ptr ptr) +@ stdcall WinStationGetProcessSid(ptr long ptr ptr ptr) @ stub WinStationGetTermSrvCountersValue @ stub WinStationInstallLicense @ stub WinStationIsHelpAssistantSession diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/ws2_32/socket.c wine-staging-1.7.48~ubuntu12.04.1/dlls/ws2_32/socket.c --- wine-staging-1.7.47~ubuntu12.04.1/dlls/ws2_32/socket.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/ws2_32/socket.c 2015-07-29 19:28:54.000000000 +0000 @@ -7663,12 +7663,14 @@ case WS_AF_INET6: { struct WS_sockaddr_in6 *sockaddr6 = (LPSOCKADDR_IN6) sockaddr; + size_t slen; buffer[0] = 0; if (len < sizeof(SOCKADDR_IN6)) return SOCKET_ERROR; if ((sockaddr6->sin6_port)) strcpy(buffer, "["); - if (!WS_inet_ntop(WS_AF_INET6, &sockaddr6->sin6_addr, buffer+strlen(buffer), sizeof(buffer))) + slen = strlen(buffer); + if (!WS_inet_ntop(WS_AF_INET6, &sockaddr6->sin6_addr, &buffer[slen], sizeof(buffer) - slen)) { SetLastError(WSAEINVAL); return SOCKET_ERROR; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/xinput1_3/xinput1_3.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/xinput1_3/xinput1_3.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/xinput1_3/xinput1_3.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/xinput1_3/xinput1_3.spec 2015-07-29 19:28:54.000000000 +0000 @@ -1,4 +1,4 @@ -1 stdcall DllMain(long long ptr) +1 stdcall -private DllMain(long long ptr) 2 stdcall XInputGetState(long ptr) 3 stdcall XInputSetState(long ptr) 4 stdcall XInputGetCapabilities(long long ptr) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/dlls/xinput1_4/xinput1_4.spec wine-staging-1.7.48~ubuntu12.04.1/dlls/xinput1_4/xinput1_4.spec --- wine-staging-1.7.47~ubuntu12.04.1/dlls/xinput1_4/xinput1_4.spec 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/dlls/xinput1_4/xinput1_4.spec 2015-07-29 19:28:54.000000000 +0000 @@ -1,4 +1,4 @@ -1 stdcall DllMain(long long ptr) +1 stdcall -private DllMain(long long ptr) 2 stdcall XInputGetState(long ptr) xinput1_3.XInputGetState 3 stdcall XInputSetState(long ptr) xinput1_3.XInputSetState 4 stdcall XInputGetCapabilities(long long ptr) xinput1_3.XInputGetCapabilities diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/axextend.idl wine-staging-1.7.48~ubuntu12.04.1/include/axextend.idl --- wine-staging-1.7.47~ubuntu12.04.1/include/axextend.idl 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/axextend.idl 2015-07-29 19:28:54.000000000 +0000 @@ -1258,3 +1258,23 @@ HRESULT CreatedFilter( [in] IBaseFilter *pFil); }; + +[ + local, + object, + uuid(d8d715a0-6e5e-11d0-b3f0-00aa003761c5), + pointer_default(unique) +] +interface IAMVfwCaptureDialogs : IUnknown +{ + HRESULT HasDialog( + [in] int dialog); + HRESULT ShowDialog( + [in] int dialog, + [in] HWND hwnd); + HRESULT SendDriverMessage( + [in] int dialog, + [in] int msg, + [in] long data1, + [in] long data2); +}; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/d3dx9mesh.h wine-staging-1.7.48~ubuntu12.04.1/include/d3dx9mesh.h --- wine-staging-1.7.47~ubuntu12.04.1/include/d3dx9mesh.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/d3dx9mesh.h 2015-07-29 19:28:54.000000000 +0000 @@ -836,11 +836,11 @@ HRESULT WINAPI D3DXSplitMesh(ID3DXMesh *mesh_in, const DWORD *adjacency_in, const DWORD max_size, const DWORD flags, DWORD *mesh_out_count, ID3DXBuffer **mesh_out, ID3DXBuffer **adjacency_out, ID3DXBuffer **face_remap_out, ID3DXBuffer **vertex_remap_out); -HRESULT WINAPI D3DXTesselateNPatches(ID3DXMesh *mesh_in, const DWORD *adjacency_in, float segment_count, +HRESULT WINAPI D3DXTessellateNPatches(ID3DXMesh *mesh_in, const DWORD *adjacency_in, float segment_count, BOOL quad_interp, ID3DXMesh **mesh_out, ID3DXBuffer **adjacency_out); -HRESULT WINAPI D3DXTesselateRectPatch(struct IDirect3DVertexBuffer9 *buffer, const float *segment_count, +HRESULT WINAPI D3DXTessellateRectPatch(struct IDirect3DVertexBuffer9 *buffer, const float *segment_count, const D3DVERTEXELEMENT9 *declaration, const D3DRECTPATCH_INFO *patch_info, struct ID3DXMesh *mesh); -HRESULT WINAPI D3DXTesselateTriPatch(struct IDirect3DVertexBuffer9 *buffer, const float *segment_count, +HRESULT WINAPI D3DXTessellateTriPatch(struct IDirect3DVertexBuffer9 *buffer, const float *segment_count, const D3DVERTEXELEMENT9 *declaration, const D3DTRIPATCH_INFO *patch_info, struct ID3DXMesh *mesh); HRESULT WINAPI D3DXTriPatchSize(const FLOAT *segment_count, DWORD *num_triangles, DWORD *num_vertices); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/davclnt.h wine-staging-1.7.48~ubuntu12.04.1/include/davclnt.h --- wine-staging-1.7.47~ubuntu12.04.1/include/davclnt.h 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/davclnt.h 2015-07-29 19:28:54.000000000 +0000 @@ -0,0 +1,72 @@ +/* + * Copyright 2015 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_DAVCLNT_H +#define __WINE_DAVCLNT_H + +#define OPAQUE_HANDLE DWORD + +#define DAV_AUTHN_SCHEME_BASIC 0x00000001 +#define DAV_AUTHN_SCHEME_NTLM 0x00000002 +#define DAV_AUTHN_SCHEME_PASSPORT 0x00000004 +#define DAV_AUTHN_SCHEME_DIGEST 0x00000008 +#define DAV_AUTHN_SCHEME_NEGOTIATE 0x00000010 +#define DAV_AUTHN_SCHEME_CERT 0x00010000 +#define DAV_AUTHN_SCHEME_FBA 0x00100000 + +typedef enum +{ + DefaultBehavior, + RetryRequest, + CancelRequest +} AUTHNEXTSTEP; + +typedef struct _DAV_CALLBACK_AUTH_BLOB +{ + PVOID pBuffer; + ULONG ulSize; + ULONG ulType; +} DAV_CALLBACK_AUTH_BLOB, *PDAV_CALLBACK_AUTH_BLOB; + +typedef struct _DAV_CALLBACK_AUTH_UNP +{ + LPWSTR pszUserName; + ULONG ulUserNameLength; + LPWSTR pszPassword; + ULONG ulPasswordLength; +} DAV_CALLBACK_AUTH_UNP, *PDAV_CALLBACK_AUTH_UNP; + +typedef struct _DAV_CALLBACK_CRED +{ + DAV_CALLBACK_AUTH_BLOB AuthBlob; + DAV_CALLBACK_AUTH_UNP UNPBlob; + BOOL bAuthBlobValid; + BOOL bSave; +} DAV_CALLBACK_CRED, *PDAV_CALLBACK_CRED; + +typedef DWORD (*PFNDAVAUTHCALLBACK_FREECRED) + (PVOID); + +typedef DWORD (*PFNDAVAUTHCALLBACK) + (LPWSTR,LPWSTR,DWORD,DWORD,PDAV_CALLBACK_CRED,AUTHNEXTSTEP*,PFNDAVAUTHCALLBACK_FREECRED*); + +DWORD WINAPI DavGetHTTPFromUNCPath(LPCWSTR,LPWSTR,LPDWORD); +OPAQUE_HANDLE WINAPI DavRegisterAuthCallback(PFNDAVAUTHCALLBACK,ULONG); +VOID WINAPI DavUnregisterAuthCallback(OPAQUE_HANDLE); + +#endif /* __WINE_DAVCLNT_H */ diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/inspectable.idl wine-staging-1.7.48~ubuntu12.04.1/include/inspectable.idl --- wine-staging-1.7.47~ubuntu12.04.1/include/inspectable.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/inspectable.idl 2015-07-29 19:28:54.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * Copyright 2015 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "wtypes.idl"; +import "unknwn.idl"; +import "hstring.idl"; + +typedef [v1_enum] enum TrustLevel { + BaseTrust, + PartialTrust, + FullTrust +} TrustLevel; + +[ + object, + uuid(af86e2e0-b12d-4c6a-9c5a-d7aa65101e90), + pointer_default(unique) +] +interface IInspectable : IUnknown +{ + HRESULT GetIids([out] ULONG *iidCount, [out, size_is(,*iidCount)] IID **iids); + HRESULT GetRuntimeClassName([out] HSTRING *className); + HRESULT GetTrustLevel([out] TrustLevel *trustLevel); +} + +typedef [unique] IInspectable *LPINSPECTABLE; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/ipifcons.h wine-staging-1.7.48~ubuntu12.04.1/include/ipifcons.h --- wine-staging-1.7.47~ubuntu12.04.1/include/ipifcons.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/ipifcons.h 2015-07-29 19:28:54.000000000 +0000 @@ -227,6 +227,8 @@ #define MIB_IF_TYPE_LOOPBACK 24 #define MIB_IF_TYPE_SLIP 28 +typedef ULONG IFTYPE; + #define MIB_IF_ADMIN_STATUS_UP 1 #define MIB_IF_ADMIN_STATUS_DOWN 2 #define MIB_IF_ADMIN_STATUS_TESTING 3 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/Makefile.in wine-staging-1.7.48~ubuntu12.04.1/include/Makefile.in --- wine-staging-1.7.47~ubuntu12.04.1/include/Makefile.in 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/Makefile.in 2015-07-29 19:28:54.000000000 +0000 @@ -62,6 +62,7 @@ indexsrv.idl \ inputscope.idl \ inseng.idl \ + inspectable.idl \ mediaobj.idl \ metahost.idl \ mimeinfo.idl \ @@ -236,6 +237,7 @@ d3dx9shape.h \ d3dx9tex.h \ d3dx9xof.h \ + davclnt.h \ dbccmd.idl \ dbcses.idl \ dbdsad.idl \ @@ -474,6 +476,7 @@ msxmldid.h \ nb30.h \ ndrtypes.h \ + netioapi.h \ nldef.h \ npapi.h \ nspapi.h \ @@ -596,6 +599,7 @@ vsstyle.h \ vssym32.h \ vswriter.h \ + webservices.h \ werapi.h \ wfext.h \ wia.h \ diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/msi.h wine-staging-1.7.48~ubuntu12.04.1/include/msi.h --- wine-staging-1.7.47~ubuntu12.04.1/include/msi.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/msi.h 2015-07-29 19:28:54.000000000 +0000 @@ -703,6 +703,7 @@ UINT WINAPI MsiBeginTransactionW(LPCWSTR, DWORD, MSIHANDLE *, HANDLE *); #define MsiBeginTransaction WINELIB_NAME_AW(MsiBeginTransaction) +UINT WINAPI MsiJoinTransaction(MSIHANDLE, DWORD, HANDLE *); UINT WINAPI MsiEndTransaction(DWORD); /* Non Unicode */ diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/ndrtypes.h wine-staging-1.7.48~ubuntu12.04.1/include/ndrtypes.h --- wine-staging-1.7.47~ubuntu12.04.1/include/ndrtypes.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/ndrtypes.h 2015-07-29 19:28:54.000000000 +0000 @@ -83,7 +83,11 @@ * routine @ NotifyIndex. */ unsigned char HasNotify2 : 1; /* 0x10 - should call MIDL [notify_flag] routine @ * NotifyIndex. */ - unsigned char Unused : 3; + + /* The following bits are in fact used by midl but haven't yet been + named in the SDK. */ + unsigned char Unused : 3; /* 0x20 - has complex return */ + /* 0x40 - has range on conformance */ } INTERPRETER_OPT_FLAGS2, *PINTERPRETER_OPT_FLAGS2; /* Win2000 extensions */ diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/netioapi.h wine-staging-1.7.48~ubuntu12.04.1/include/netioapi.h --- wine-staging-1.7.47~ubuntu12.04.1/include/netioapi.h 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/netioapi.h 2015-07-29 19:28:54.000000000 +0000 @@ -0,0 +1,90 @@ +/* + * Copyright 2015 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_NETIOAPI_H +#define __WINE_NETIOAPI_H + +#include + +typedef struct _MIB_IF_ROW2 +{ + NET_LUID InterfaceLuid; + NET_IFINDEX InterfaceIndex; + GUID InterfaceGuid; + WCHAR Alias[IF_MAX_STRING_SIZE + 1]; + WCHAR Description[IF_MAX_STRING_SIZE + 1]; + ULONG PhysicalAddressLength; + UCHAR PhysicalAddress[IF_MAX_PHYS_ADDRESS_LENGTH]; + UCHAR PermanentPhysicalAddress[IF_MAX_PHYS_ADDRESS_LENGTH]; + ULONG Mtu; + IFTYPE Type; + TUNNEL_TYPE TunnelType; + NDIS_MEDIUM MediaType; + NDIS_PHYSICAL_MEDIUM PhysicalMediumType; + NET_IF_ACCESS_TYPE AccessType; + NET_IF_DIRECTION_TYPE DirectionType; + struct + { + BOOLEAN HardwareInterface : 1; + BOOLEAN FilterInterface : 1; + BOOLEAN ConnectorPresent : 1; + BOOLEAN NotAuthenticated : 1; + BOOLEAN NotMediaConnected : 1; + BOOLEAN Paused : 1; + BOOLEAN LowPower : 1; + BOOLEAN EndPointInterface : 1; + } InterfaceAndOperStatusFlags; + IF_OPER_STATUS OperStatus; + NET_IF_ADMIN_STATUS AdminStatus; + NET_IF_MEDIA_CONNECT_STATE MediaConnectState; + NET_IF_NETWORK_GUID NetworkGuid; + NET_IF_CONNECTION_TYPE ConnectionType; + ULONG64 TransmitLinkSpeed; + ULONG64 ReceiveLinkSpeed; + ULONG64 InOctets; + ULONG64 InUcastPkts; + ULONG64 InNUcastPkts; + ULONG64 InDiscards; + ULONG64 InErrors; + ULONG64 InUnknownProtos; + ULONG64 InUcastOctets; + ULONG64 InMulticastOctets; + ULONG64 InBroadcastOctets; + ULONG64 OutOctets; + ULONG64 OutUcastPkts; + ULONG64 OutNUcastPkts; + ULONG64 OutDiscards; + ULONG64 OutErrors; + ULONG64 OutUcastOctets; + ULONG64 OutMulticastOctets; + ULONG64 OutBroadcastOctets; + ULONG64 OutQLen; +} MIB_IF_ROW2, *PMIB_IF_ROW2; + +DWORD WINAPI ConvertInterfaceGuidToLuid(const GUID*,NET_LUID*); +DWORD WINAPI ConvertInterfaceIndexToLuid(NET_IFINDEX,NET_LUID*); +DWORD WINAPI ConvertInterfaceLuidToGuid(const NET_LUID*,GUID*); +DWORD WINAPI ConvertInterfaceLuidToIndex(const NET_LUID*,NET_IFINDEX*); +DWORD WINAPI ConvertInterfaceLuidToNameA(const NET_LUID*,char*,SIZE_T); +DWORD WINAPI ConvertInterfaceLuidToNameW(const NET_LUID*,WCHAR*,SIZE_T); +DWORD WINAPI ConvertInterfaceNameToLuidA(const char*,NET_LUID*); +DWORD WINAPI ConvertInterfaceNameToLuidW(const WCHAR*,NET_LUID*); +void WINAPI FreeMibTable(void*); +DWORD WINAPI GetIfEntry2(MIB_IF_ROW2*); + +#endif /* __WINE_NETIOAPI_H */ diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/netlistmgr.idl wine-staging-1.7.48~ubuntu12.04.1/include/netlistmgr.idl --- wine-staging-1.7.47~ubuntu12.04.1/include/netlistmgr.idl 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/netlistmgr.idl 2015-07-29 19:28:54.000000000 +0000 @@ -68,6 +68,8 @@ BYTE data[128]; } NLM_SOCKADDR; +const UINT32 NLM_UNKNOWN_DATAPLAN_STATUS = 0xffffffff; + typedef struct NLM_USAGE_DATA { DWORD UsageInMegabytes; @@ -108,6 +110,21 @@ } [ + object, + pointer_default(unique), + uuid(dcb00009-570f-4a9b-8d69-199fdba5723b) +] +interface INetworkCostManagerEvents : IUnknown +{ + HRESULT CostChanged( + [in] DWORD newCost, + [in, unique] NLM_SOCKADDR *pDestAddr); + + HRESULT DataPlanStatusChanged( + [in, unique] NLM_SOCKADDR *pDestAddr); +} + +[ dual, object, oleautomation, diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/ntddndis.h wine-staging-1.7.48~ubuntu12.04.1/include/ntddndis.h --- wine-staging-1.7.47~ubuntu12.04.1/include/ntddndis.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/ntddndis.h 2015-07-29 19:28:54.000000000 +0000 @@ -165,6 +165,56 @@ typedef int NDIS_STATUS, *PNDIS_STATUS; #endif +typedef enum _NDIS_MEDIUM +{ + NdisMedium802_3, + NdisMedium802_5, + NdisMediumFddi, + NdisMediumWan, + NdisMediumLocalTalk, + NdisMediumDix, + NdisMediumArcnetRaw, + NdisMediumArcnet878_2, + NdisMediumAtm, + NdisMediumWirelessWan, + NdisMediumIrda, + NdisMediumBpc, + NdisMediumCoWan, + NdisMedium1394, + NdisMediumInfiniBand, + NdisMediumTunnel, + NdisMediumNative802_11, + NdisMediumLoopback, + NdisMediumWiMAX, + NdisMediumIP, + NdisMediumMax +} NDIS_MEDIUM, *PNDIS_MEDIUM; + +typedef enum _NDIS_PHYSICAL_MEDIUM +{ + NdisPhysicalMediumUnspecified, + NdisPhysicalMediumWirelessLan, + NdisPhysicalMediumCableModem, + NdisPhysicalMediumPhoneLine, + NdisPhysicalMediumPowerLine, + NdisPhysicalMediumDSL, + NdisPhysicalMediumFibreChannel, + NdisPhysicalMedium1394, + NdisPhysicalMediumWirelessWan, + NdisPhysicalMediumNative802_11, + NdisPhysicalMediumBluetooth, + NdisPhysicalMediumInfiniband, + NdisPhysicalMediumWiMax, + NdisPhysicalMediumUWB, + NdisPhysicalMedium802_3, + NdisPhysicalMedium802_5, + NdisPhysicalMediumIrda, + NdisPhysicalMediumWiredWAN, + NdisPhysicalMediumWiredCoWan, + NdisPhysicalMediumOther, + NdisPhysicalMediumMax +} NDIS_PHYSICAL_MEDIUM, *PNDIS_PHYSICAL_MEDIUM; + #ifdef __cplusplus } #endif diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/webservices.h wine-staging-1.7.48~ubuntu12.04.1/include/webservices.h --- wine-staging-1.7.47~ubuntu12.04.1/include/webservices.h 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/webservices.h 2015-07-29 19:28:54.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * Copyright 2015 Nikolay Sivov for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_WEBSERVICES_H +#define __WINE_WEBSERVICES_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +typedef struct _WS_ERROR WS_ERROR; + +typedef enum { + WS_ERROR_PROPERTY_STRING_COUNT, + WS_ERROR_PROPERTY_ORIGINAL_ERROR_CODE, + WS_ERROR_PROPERTY_LANGID +} WS_ERROR_PROPERTY_ID; + +typedef struct _WS_ERROR_PROPERTY { + WS_ERROR_PROPERTY_ID id; + void *value; + ULONG valueSize; +} WS_ERROR_PROPERTY; + +HRESULT WINAPI WsCreateError(const WS_ERROR_PROPERTY*, ULONG, WS_ERROR**); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __WINE_WEBSERVICES_H */ diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/wincodec.idl wine-staging-1.7.48~ubuntu12.04.1/include/wincodec.idl --- wine-staging-1.7.47~ubuntu12.04.1/include/wincodec.idl 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/wincodec.idl 2015-07-29 19:28:54.000000000 +0000 @@ -220,23 +220,6 @@ typedef UINT32 WICColor; -cpp_quote("#define WINCODEC_ERR_WRONGSTATE 0x88982f04") -cpp_quote("#define WINCODEC_ERR_VALUEOUTOFRANGE 0x88982f05") -cpp_quote("#define WINCODEC_ERR_NOTINITIALIZED 0x88982f0c") -cpp_quote("#define WINCODEC_ERR_ALREADYLOCKED 0x88982f0d") -cpp_quote("#define WINCODEC_ERR_PROPERTYNOTFOUND 0x88982f40") -cpp_quote("#define WINCODEC_ERR_CODECNOTHUMBNAIL 0x88982f44") -cpp_quote("#define WINCODEC_ERR_PALETTEUNAVAILABLE 0x88982f45") -cpp_quote("#define WINCODEC_ERR_COMPONENTNOTFOUND 0x88982f50") -cpp_quote("#define WINCODEC_ERR_BADIMAGE 0x88982f60") -cpp_quote("#define WINCODEC_ERR_FRAMEMISSING 0x88982f62") -cpp_quote("#define WINCODEC_ERR_BADMETADATAHEADER 0x88982f63") -cpp_quote("#define WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT 0x88982f80") -cpp_quote("#define WINCODEC_ERR_UNSUPPORTEDOPERATION 0x88982f81") -cpp_quote("#define WINCODEC_ERR_INSUFFICIENTBUFFER 0x88982f8c") -cpp_quote("#define WINCODEC_ERR_PROPERTYUNEXPECTEDTYPE 0x88982f8e") -cpp_quote("#define WINCODEC_ERR_WIN32ERROR 0x88982f94") - interface IWICPalette; [ diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/wine/wined3d.h wine-staging-1.7.48~ubuntu12.04.1/include/wine/wined3d.h --- wine-staging-1.7.47~ubuntu12.04.1/include/wine/wined3d.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/wine/wined3d.h 2015-07-29 19:28:54.000000000 +0000 @@ -2137,6 +2137,10 @@ struct wined3d_rendertarget_view *view, const RECT *rect, const struct wined3d_color *color); void __cdecl wined3d_device_copy_resource(struct wined3d_device *device, struct wined3d_resource *dst_resource, struct wined3d_resource *src_resource); +void __cdecl wined3d_device_copy_sub_resource_region(struct wined3d_device *device, + struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, + unsigned int dst_y, unsigned int dst_z, struct wined3d_resource *src_resource, + unsigned int src_sub_resource_idx, const struct wined3d_box *src_box); HRESULT __cdecl wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, HWND focus_window, DWORD behaviour_flags, BYTE surface_alignment, struct wined3d_device_parent *device_parent, struct wined3d_device **device); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/winerror.h wine-staging-1.7.48~ubuntu12.04.1/include/winerror.h --- wine-staging-1.7.47~ubuntu12.04.1/include/winerror.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/winerror.h 2015-07-29 19:28:54.000000000 +0000 @@ -2995,6 +2995,47 @@ #define SCARD_W_CACHE_ITEM_STALE _HRESULT_TYPEDEF_(0x80100071) #define SCARD_W_CACHE_ITEM_TOO_BIG _HRESULT_TYPEDEF_(0x80100072) +#define WINCODEC_ERR_WRONGSTATE _HRESULT_TYPEDEF_(0x88982f04) +#define WINCODEC_ERR_VALUEOUTOFRANGE _HRESULT_TYPEDEF_(0x88982f05) +#define WINCODEC_ERR_UNKNOWNIMAGEFORMAT _HRESULT_TYPEDEF_(0x88982f07) +#define WINCODEC_ERR_UNSUPPORTEDVERSION _HRESULT_TYPEDEF_(0x88982f0b) +#define WINCODEC_ERR_NOTINITIALIZED _HRESULT_TYPEDEF_(0x88982f0c) +#define WINCODEC_ERR_ALREADYLOCKED _HRESULT_TYPEDEF_(0x88982f0d) +#define WINCODEC_ERR_PROPERTYNOTFOUND _HRESULT_TYPEDEF_(0x88982f40) +#define WINCODEC_ERR_PROPERTYNOTSUPPORTED _HRESULT_TYPEDEF_(0x88982f41) +#define WINCODEC_ERR_PROPERTYSIZE _HRESULT_TYPEDEF_(0x88982f42) +#define WINCODEC_ERR_CODECPRESENT _HRESULT_TYPEDEF_(0x88982f43) +#define WINCODEC_ERR_CODECNOTHUMBNAIL _HRESULT_TYPEDEF_(0x88982f44) +#define WINCODEC_ERR_PALETTEUNAVAILABLE _HRESULT_TYPEDEF_(0x88982f45) +#define WINCODEC_ERR_CODECTOOMANYSCANLINES _HRESULT_TYPEDEF_(0x88982f46) +#define WINCODEC_ERR_INTERNALERROR _HRESULT_TYPEDEF_(0x88982f48) +#define WINCODEC_ERR_SOURCERECTDOESNOTMATCHDIMENSIONS _HRESULT_TYPEDEF_(0x88982f49) +#define WINCODEC_ERR_COMPONENTNOTFOUND _HRESULT_TYPEDEF_(0x88982f50) +#define WINCODEC_ERR_IMAGESIZEOUTOFRANGE _HRESULT_TYPEDEF_(0x88982f51) +#define WINCODEC_ERR_TOOMUCHMETADATA _HRESULT_TYPEDEF_(0x88982f52) +#define WINCODEC_ERR_BADIMAGE _HRESULT_TYPEDEF_(0x88982f60) +#define WINCODEC_ERR_BADHEADER _HRESULT_TYPEDEF_(0x88982f61) +#define WINCODEC_ERR_FRAMEMISSING _HRESULT_TYPEDEF_(0x88982f62) +#define WINCODEC_ERR_BADMETADATAHEADER _HRESULT_TYPEDEF_(0x88982f63) +#define WINCODEC_ERR_BADSTREAMDATA _HRESULT_TYPEDEF_(0x88982f70) +#define WINCODEC_ERR_STREAMWRITE _HRESULT_TYPEDEF_(0x88982f71) +#define WINCODEC_ERR_STREAMREAD _HRESULT_TYPEDEF_(0x88982f72) +#define WINCODEC_ERR_STREAMNOTAVAILABLE _HRESULT_TYPEDEF_(0x88982f73) +#define WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT _HRESULT_TYPEDEF_(0x88982f80) +#define WINCODEC_ERR_UNSUPPORTEDOPERATION _HRESULT_TYPEDEF_(0x88982f81) +#define WINCODEC_ERR_INVALIDREGISTRATION _HRESULT_TYPEDEF_(0x88982f8a) +#define WINCODEC_ERR_COMPONENTINITIALIZEFAILURE _HRESULT_TYPEDEF_(0x88982f8b) +#define WINCODEC_ERR_INSUFFICIENTBUFFER _HRESULT_TYPEDEF_(0x88982f8c) +#define WINCODEC_ERR_DUPLICATEMETADATAPRESENT _HRESULT_TYPEDEF_(0x88982f8d) +#define WINCODEC_ERR_PROPERTYUNEXPECTEDTYPE _HRESULT_TYPEDEF_(0x88982f8e) +#define WINCODEC_ERR_UNEXPECTEDSIZE _HRESULT_TYPEDEF_(0x88982f8f) +#define WINCODEC_ERR_INVALIDQUERYREQUEST _HRESULT_TYPEDEF_(0x88982f90) +#define WINCODEC_ERR_UNEXPECTEDMETADATATYPE _HRESULT_TYPEDEF_(0x88982f91) +#define WINCODEC_ERR_REQUESTONLYVALIDATMETADATAROOT _HRESULT_TYPEDEF_(0x88982f92) +#define WINCODEC_ERR_INVALIDQUERYCHARACTER _HRESULT_TYPEDEF_(0x88982f93) +#define WINCODEC_ERR_WIN32ERROR _HRESULT_TYPEDEF_(0x88982f94) +#define WINCODEC_ERR_INVALIDPROGRESSIVELEVEL _HRESULT_TYPEDEF_(0x88982f95) + #define DWRITE_E_FILEFORMAT _HRESULT_TYPEDEF_(0x88985000) #define DWRITE_E_UNEXPECTED _HRESULT_TYPEDEF_(0x88985001) #define DWRITE_E_NOFONT _HRESULT_TYPEDEF_(0x88985002) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/winnt.h wine-staging-1.7.48~ubuntu12.04.1/include/winnt.h --- wine-staging-1.7.47~ubuntu12.04.1/include/winnt.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/winnt.h 2015-07-29 19:28:54.000000000 +0000 @@ -2335,6 +2335,12 @@ __asm__(".byte 0x65\n\tmovq (0x30),%0" : "=r" (teb)); return teb; } +#elif defined(__x86_64__) && defined(_MSC_VER) +#pragma intrinsic(__readgsqword) +static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) +{ + return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self)); +} #else extern struct _TEB * WINAPI NtCurrentTeb(void); #endif diff -Nru wine-staging-1.7.47~ubuntu12.04.1/include/winuser.h wine-staging-1.7.48~ubuntu12.04.1/include/winuser.h --- wine-staging-1.7.47~ubuntu12.04.1/include/winuser.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/include/winuser.h 2015-07-29 19:28:54.000000000 +0000 @@ -4027,6 +4027,7 @@ #define UnregisterClass WINELIB_NAME_AW(UnregisterClass) WINUSERAPI BOOL WINAPI UnregisterDeviceNotification(HDEVNOTIFY); WINUSERAPI BOOL WINAPI UnregisterHotKey(HWND,INT); +WINUSERAPI BOOL WINAPI UnregisterPowerSettingNotification(HPOWERNOTIFY); WINUSERAPI BOOL WINAPI UpdateWindow(HWND); WINUSERAPI BOOL WINAPI UserHandleGrantAccess(HANDLE,HANDLE,BOOL); WINUSERAPI UINT WINAPI UserRealizePalette(HDC); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/loader/wine.inf.in wine-staging-1.7.48~ubuntu12.04.1/loader/wine.inf.in --- wine-staging-1.7.47~ubuntu12.04.1/loader/wine.inf.in 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/loader/wine.inf.in 2015-07-29 19:28:54.000000000 +0000 @@ -490,6 +490,7 @@ HKLM,%CurrentVersionNT%\Image File Execution Options,,16 HKLM,%CurrentVersionNT%\Language Pack,,16 HKLM,%CurrentVersionNT%\NetworkCards,,16 +HKLM,%CurrentVersionNT%\OpenGLDrivers,,16 HKLM,%CurrentVersionNT%\Perflib,,16 HKLM,%CurrentVersionNT%\Ports,,16 HKLM,%CurrentVersionNT%\Print,,16 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/amstream-GetMultiMediaStream/0001-amstream-Implement-IAMMediaStream-GetMultiMediaStrea.patch wine-staging-1.7.48~ubuntu12.04.1/patches/amstream-GetMultiMediaStream/0001-amstream-Implement-IAMMediaStream-GetMultiMediaStrea.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/amstream-GetMultiMediaStream/0001-amstream-Implement-IAMMediaStream-GetMultiMediaStrea.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/amstream-GetMultiMediaStream/0001-amstream-Implement-IAMMediaStream-GetMultiMediaStrea.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,88 @@ +From 4d0e6bbc00bd49b8dcfce494bd7380c49f58f92b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Tue, 28 Jul 2015 18:21:20 +0200 +Subject: amstream: Implement IAMMediaStream::GetMultiMediaStream. + +--- + dlls/amstream/mediastream.c | 40 ++++++++++++++++++++++++++++++++-------- + 1 file changed, 32 insertions(+), 8 deletions(-) + +diff --git a/dlls/amstream/mediastream.c b/dlls/amstream/mediastream.c +index 947be1e..e4e15d7 100644 +--- a/dlls/amstream/mediastream.c ++++ b/dlls/amstream/mediastream.c +@@ -110,9 +110,15 @@ static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_GetMultiMediaStre + { + DirectDrawMediaStreamImpl *This = impl_from_DirectDrawMediaStream_IAMMediaStream(iface); + +- FIXME("(%p/%p)->(%p) stub!\n", This, iface, multi_media_stream); ++ TRACE("(%p/%p)->(%p) stub!\n", This, iface, multi_media_stream); + +- return S_FALSE; ++ if (!multi_media_stream) ++ return E_POINTER; ++ ++ IMultiMediaStream_AddRef(This->parent); ++ *multi_media_stream = This->parent; ++ ++ return S_OK; + } + + static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_GetInformation(IAMMediaStream *iface, +@@ -271,9 +277,15 @@ static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetMultiM + { + DirectDrawMediaStreamImpl *This = impl_from_IDirectDrawMediaStream(iface); + +- FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppMultiMediaStream); ++ TRACE("(%p/%p)->(%p) stub!\n", This, iface, ppMultiMediaStream); + +- return S_FALSE; ++ if (!ppMultiMediaStream) ++ return E_POINTER; ++ ++ IMultiMediaStream_AddRef(This->parent); ++ *ppMultiMediaStream = This->parent; ++ ++ return S_OK; + } + + static HRESULT WINAPI DirectDrawMediaStreamImpl_IDirectDrawMediaStream_GetInformation(IDirectDrawMediaStream *iface, +@@ -511,9 +523,15 @@ static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_GetMultiMediaStream(IA + { + AudioMediaStreamImpl *This = impl_from_AudioMediaStream_IAMMediaStream(iface); + +- FIXME("(%p/%p)->(%p) stub!\n", This, iface, multi_media_stream); ++ TRACE("(%p/%p)->(%p)\n", This, iface, multi_media_stream); + +- return S_FALSE; ++ if (!multi_media_stream) ++ return E_POINTER; ++ ++ IMultiMediaStream_AddRef(This->parent); ++ *multi_media_stream = This->parent; ++ ++ return S_OK; + } + + static HRESULT WINAPI AudioMediaStreamImpl_IAMMediaStream_GetInformation(IAMMediaStream *iface, +@@ -672,9 +690,15 @@ static HRESULT WINAPI AudioMediaStreamImpl_IAudioMediaStream_GetMultiMediaStream + { + AudioMediaStreamImpl *This = impl_from_IAudioMediaStream(iface); + +- FIXME("(%p/%p)->(%p) stub!\n", iface, This, multimedia_stream); ++ TRACE("(%p/%p)->(%p)\n", iface, This, multimedia_stream); + +- return S_FALSE; ++ if (!multimedia_stream) ++ return E_POINTER; ++ ++ IMultiMediaStream_AddRef(This->parent); ++ *multimedia_stream = This->parent; ++ ++ return S_OK; + } + + static HRESULT WINAPI AudioMediaStreamImpl_IAudioMediaStream_GetInformation(IAudioMediaStream *iface, +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/amstream-GetMultiMediaStream/definition wine-staging-1.7.48~ubuntu12.04.1/patches/amstream-GetMultiMediaStream/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/amstream-GetMultiMediaStream/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/amstream-GetMultiMediaStream/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [37090] Implement AMStream GetMultiMediaStream functions diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/comctl32-LoadIconMetric/0001-comctl32-Implement-LoadIconMetric-function.patch wine-staging-1.7.48~ubuntu12.04.1/patches/comctl32-LoadIconMetric/0001-comctl32-Implement-LoadIconMetric-function.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/comctl32-LoadIconMetric/0001-comctl32-Implement-LoadIconMetric-function.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/comctl32-LoadIconMetric/0001-comctl32-Implement-LoadIconMetric-function.patch 2015-07-29 19:51:42.000000000 +0000 @@ -1,30 +1,20 @@ -From 3e8d16b07793f5794702e31dc08a55a71f46fa1f Mon Sep 17 00:00:00 2001 +From 74254e3904454c5d088bf400d3d58107aa2b138b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 7 Aug 2014 01:41:25 +0200 Subject: comctl32: Implement LoadIconMetric function. +Changes by Alistair Leslie-Hughes: +* Moved LoadIconMetric to commctrl.c +* Changed INT, PCWSTR type +* Added function to include/commctrl.h --- - dlls/comctl32/Makefile.in | 1 + dlls/comctl32/comctl32.spec | 1 + - dlls/comctl32/icon.c | 68 +++++++++++++++++++++++++++++++++++++++++++++ - include/commctrl.h | 6 ++++ - 4 files changed, 76 insertions(+) - create mode 100644 dlls/comctl32/icon.c + dlls/comctl32/commctrl.c | 40 ++++++++++++++++++++++++++++++++++++++++ + include/commctrl.h | 7 +++++++ + 3 files changed, 48 insertions(+) -diff --git a/dlls/comctl32/Makefile.in b/dlls/comctl32/Makefile.in -index e63f0ac..af49017 100644 ---- a/dlls/comctl32/Makefile.in -+++ b/dlls/comctl32/Makefile.in -@@ -16,6 +16,7 @@ C_SRCS = \ - flatsb.c \ - header.c \ - hotkey.c \ -+ icon.c \ - imagelist.c \ - ipaddress.c \ - listview.c \ diff --git a/dlls/comctl32/comctl32.spec b/dlls/comctl32/comctl32.spec -index 0bd8b13..2b96891 100644 +index 1e92e5f..e61dfbf 100644 --- a/dlls/comctl32/comctl32.spec +++ b/dlls/comctl32/comctl32.spec @@ -88,6 +88,7 @@ @@ -35,56 +25,36 @@ 381 stdcall -ordinal LoadIconWithScaleDown(ptr wstr long long ptr) 382 stdcall -noname SmoothScrollWindow(ptr) 383 stub -noname DoReaderMode -diff --git a/dlls/comctl32/icon.c b/dlls/comctl32/icon.c -new file mode 100644 -index 0000000..a664e2c ---- /dev/null -+++ b/dlls/comctl32/icon.c -@@ -0,0 +1,68 @@ -+/* -+ * Comctl32 Icon functions -+ * +diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c +index e18c27d..462ecf8 100644 +--- a/dlls/comctl32/commctrl.c ++++ b/dlls/comctl32/commctrl.c +@@ -3,6 +3,7 @@ + * + * Copyright 1997 Dimitrie O. Paun + * Copyright 1998,2000 Eric Kohl + * Copyright 2014 Michael Müller -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#include -+#include -+#include "windef.h" -+#include "winbase.h" -+#include "wingdi.h" -+#include "winuser.h" -+#include "winnls.h" -+#include "commctrl.h" -+#include "comctl32.h" -+#include "wine/debug.h" -+ -+WINE_DEFAULT_DEBUG_CHANNEL(commctrl); + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -1646,3 +1647,42 @@ HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE hinst, PCWSTR name, int cx, int c + FIXME("stub: %p %s %d %d %p\n", hinst, wine_dbgstr_w(name), cx, cy, icon); + return E_NOTIMPL; + } + -+HRESULT WINAPI -+LoadIconMetric (HINSTANCE hinst, PCWSTR name, INT size, HICON *icon) ++/*********************************************************************** ++ * LoadIconMetric [COMCTL32.@] ++ */ ++HRESULT WINAPI LoadIconMetric(HINSTANCE hinst, const WCHAR *name, int size, HICON *icon) +{ -+ INT width, height; ++ int width, height; + + TRACE("(%p %s %d %p)\n", hinst, debugstr_w(name), size, icon); + + if (!icon) + return E_INVALIDARG; + -+ /* windows sets it to zero in a case of failure */ ++ /* Windows sets it to zero in a case of failure. */ + *icon = NULL; + + if (!name) @@ -92,40 +62,42 @@ + + if (size == LIM_SMALL) + { -+ width = GetSystemMetrics( SM_CXSMICON ); -+ height = GetSystemMetrics( SM_CYSMICON ); ++ width = GetSystemMetrics(SM_CXSMICON); ++ height = GetSystemMetrics(SM_CYSMICON); + } + else if (size == LIM_LARGE) + { -+ width = GetSystemMetrics( SM_CXICON ); -+ height = GetSystemMetrics( SM_CYICON ); ++ width = GetSystemMetrics(SM_CXICON); ++ height = GetSystemMetrics(SM_CYICON); + } + else + return E_INVALIDARG; + -+ *icon = LoadImageW( hinst, name, IMAGE_ICON, width, height, LR_SHARED ); ++ /* FIXME: This doesn't seem to work properly yet with file names. */ ++ *icon = LoadImageW(hinst, name, IMAGE_ICON, width, height, 0); + if (*icon) + return S_OK; + + return HRESULT_FROM_WIN32(GetLastError()); +} diff --git a/include/commctrl.h b/include/commctrl.h -index 0bcaeb6..525f356 100644 +index 0bcaeb6..662dca1 100644 --- a/include/commctrl.h +++ b/include/commctrl.h -@@ -1374,6 +1374,12 @@ typedef struct tagTBADDBITMAP { - #define HIST_ADDTOFAVORITES 3 - #define HIST_VIEWTREE 4 +@@ -42,6 +42,13 @@ BOOL WINAPI InitCommonControlsEx (const INITCOMMONCONTROLSEX*); + LANGID WINAPI GetMUILanguage (VOID); + VOID WINAPI InitMUILanguage (LANGID uiLang); +enum _LI_METRIC +{ -+ LIM_SMALL, -+ LIM_LARGE, ++ LIM_SMALL, ++ LIM_LARGE +}; + - typedef struct tagTBSAVEPARAMSA { - HKEY hkr; - LPCSTR pszSubKey; ++HRESULT WINAPI LoadIconMetric(HINSTANCE, const WCHAR *, int, HICON *); + HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE, PCWSTR, int, int, HICON *); + + #define COMCTL32_VERSION 5 /* dll version */ -- -2.1.3 +2.4.5 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/comctl32-LoadIconMetric/0002-comctl32-tests-Add-tests-for-LoadIconMetric-function.patch wine-staging-1.7.48~ubuntu12.04.1/patches/comctl32-LoadIconMetric/0002-comctl32-tests-Add-tests-for-LoadIconMetric-function.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/comctl32-LoadIconMetric/0002-comctl32-tests-Add-tests-for-LoadIconMetric-function.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/comctl32-LoadIconMetric/0002-comctl32-tests-Add-tests-for-LoadIconMetric-function.patch 2015-07-29 19:51:42.000000000 +0000 @@ -1,14 +1,18 @@ -From 12e3dc5ffa57a18e67e8e30dd5c15e3dc0727e19 Mon Sep 17 00:00:00 2001 +From 54e59f6203fc4e8ce1a3855f51de9ba179bf7ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 7 Aug 2014 01:54:28 +0200 Subject: comctl32/tests: Add tests for LoadIconMetric function. +Changes by Alistair Leslie-Hughes: +* Changed PCWSTR, CHAR, INT +* Changed LoadIconMetric to pLoadIconMetric + (caused a compile error since it's in the header). --- - dlls/comctl32/tests/misc.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 84 insertions(+) + dlls/comctl32/tests/misc.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 60 insertions(+) diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c -index 69a7db4..55ea14a 100644 +index 280b46c..3d2231e 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -20,6 +20,7 @@ @@ -23,99 +27,75 @@ static INT (WINAPI * pStr_GetPtrW)(LPCWSTR, LPWSTR, INT); static BOOL (WINAPI * pStr_SetPtrW)(LPWSTR, LPCWSTR); -+static HRESULT (WINAPI * LoadIconMetric)(HINSTANCE, PCWSTR, INT, HICON*); ++static HRESULT (WINAPI * pLoadIconMetric)(HINSTANCE, const WCHAR *, int, HICON *); + static HMODULE hComctl32 = 0; #define COMCTL32_GET_PROC(ordinal, func) \ -@@ -205,6 +208,86 @@ static void test_TaskDialogIndirect(void) +@@ -205,6 +208,62 @@ static void test_TaskDialogIndirect(void) ok(ptr == ptr2, "got wrong pointer for ordinal 345, %p expected %p\n", ptr2, ptr); } +static void test_LoadIconMetric(void) +{ -+ static const WCHAR nonExistingFile[] = {'d','o','e','s','n','o','t','e','x','i','s','t','.','i','c','o','\0'}; -+ HINSTANCE hinst; -+ void *ptr; -+ HICON icon; ++ static const WCHAR non_existing_fileW[] = {'n','o','n','e','x','i','s','t','i','n','g','.','i','c','o','\0'}; + HRESULT result; + ICONINFO info; -+ BOOL res; -+ INT bytes; ++ HICON icon; + BITMAP bmp; ++ void *ptr; ++ int bytes; ++ BOOL res; + -+ hinst = LoadLibraryA("comctl32.dll"); -+ -+ LoadIconMetric = (void *)GetProcAddress(hinst, "LoadIconMetric"); -+ if (!LoadIconMetric) ++ pLoadIconMetric = (void *)GetProcAddress(hComctl32, "LoadIconMetric"); ++ if (!pLoadIconMetric) + { + win_skip("LoadIconMetric not exported by name\n"); + return; + } + -+ ptr = GetProcAddress(hinst, (const CHAR*)380); -+ ok(ptr == LoadIconMetric, "got wrong pointer for ordinal 380, %p expected %p\n", -+ ptr, LoadIconMetric); ++ ptr = GetProcAddress(hComctl32, (const char *)380); ++ ok(ptr == pLoadIconMetric, "got wrong pointer for ordinal 380, %p expected %p\n", ++ ptr, pLoadIconMetric); + -+ result = LoadIconMetric(NULL, (PCWSTR)IDI_APPLICATION, LIM_SMALL, &icon); -+ ok(result == S_OK, "Expected S_OK, got %x\n", result); -+ if (result == S_OK) -+ { -+ res = GetIconInfo(icon, &info); -+ ok(res, "Failed to get icon info\n"); -+ if (res && info.hbmColor) -+ { -+ bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); -+ ok(bytes > 0, "Failed to get bitmap info for icon\n"); -+ if (bytes > 0) -+ { -+ ok(bmp.bmWidth == GetSystemMetrics( SM_CXSMICON ), "Wrong icon width\n"); -+ ok(bmp.bmHeight == GetSystemMetrics( SM_CYSMICON ), "Wrong icon height\n"); -+ } -+ } -+ DestroyIcon(icon); -+ } -+ -+ result = LoadIconMetric(NULL, (PCWSTR)IDI_APPLICATION, LIM_LARGE, &icon); -+ ok(result == S_OK, "Expected S_OK, got %x\n", result); -+ if (result == S_OK) -+ { -+ res = GetIconInfo(icon, &info); -+ ok(res, "Failed to get icon info\n"); -+ if (res && info.hbmColor) -+ { -+ bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); -+ ok(bytes > 0, "Failed to get bitmap info for icon\n"); -+ if (bytes > 0) -+ { -+ ok(bmp.bmWidth == GetSystemMetrics( SM_CXICON ), "Wrong icon width\n"); -+ ok(bmp.bmHeight == GetSystemMetrics( SM_CYICON ), "Wrong icon height\n"); -+ } -+ } -+ DestroyIcon(icon); -+ } -+ -+ result = LoadIconMetric(NULL, (PCWSTR)IDI_APPLICATION, 0x100, &icon); ++ result = pLoadIconMetric(NULL, MAKEINTRESOURCEW(IDI_APPLICATION), 0x100, &icon); + ok(result == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", result); -+ if (result == S_OK) DestroyIcon(icon); + + icon = (HICON)0x1234; -+ result = LoadIconMetric(NULL, NULL, LIM_LARGE, &icon); ++ result = pLoadIconMetric(NULL, NULL, LIM_LARGE, &icon); + ok(result == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", result); -+ ok(icon == (HICON)0, "Expected 0x0, got %p\n", icon); -+ if (result == S_OK) DestroyIcon(icon); ++ ok(icon == NULL, "Expected NULL, got %p\n", icon); + -+ result = LoadIconMetric(NULL, nonExistingFile, LIM_LARGE, &icon); ++ result = pLoadIconMetric(NULL, non_existing_fileW, LIM_LARGE, &icon); + ok(result == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), -+ "Expected 80070715, got %x\n", result); -+ if (result == S_OK) DestroyIcon(icon); ++ "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", result); ++ ++ result = pLoadIconMetric(NULL, MAKEINTRESOURCEW(IDI_APPLICATION), LIM_SMALL, &icon); ++ ok(result == S_OK, "Expected S_OK, got %x\n", result); ++ res = GetIconInfo(icon, &info); ++ ok(res, "Failed to get icon info, error %d\n", GetLastError()); ++ bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); ++ ok(bytes > 0, "Failed to get bitmap info for icon\n"); ++ ok(bmp.bmWidth == GetSystemMetrics(SM_CXSMICON), "Wrong icon width\n"); ++ ok(bmp.bmHeight == GetSystemMetrics(SM_CYSMICON), "Wrong icon height\n"); ++ DestroyIcon(icon); ++ ++ result = pLoadIconMetric(NULL, MAKEINTRESOURCEW(IDI_APPLICATION), LIM_LARGE, &icon); ++ ok(result == S_OK, "Expected S_OK, got %x\n", result); ++ res = GetIconInfo(icon, &info); ++ ok(res, "Failed to get icon info, error %d\n", GetLastError()); ++ bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); ++ ok(bytes > 0, "Failed to get bitmap info for icon\n"); ++ ok(bmp.bmWidth == GetSystemMetrics(SM_CXICON), "Wrong icon width\n"); ++ ok(bmp.bmHeight == GetSystemMetrics(SM_CYICON), "Wrong icon height\n"); ++ DestroyIcon(icon); +} + + START_TEST(misc) { ULONG_PTR ctx_cookie; -@@ -220,6 +303,7 @@ START_TEST(misc) +@@ -220,6 +279,7 @@ START_TEST(misc) return; test_TaskDialogIndirect(); @@ -124,5 +104,5 @@ unload_v6_module(ctx_cookie, hCtx); } -- -1.8.3.2 +2.4.5 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/configure-Crosscompiling/0001-configure.ac-Search-for-otool-using-AC_CHECK_TOOL.patch wine-staging-1.7.48~ubuntu12.04.1/patches/configure-Crosscompiling/0001-configure.ac-Search-for-otool-using-AC_CHECK_TOOL.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/configure-Crosscompiling/0001-configure.ac-Search-for-otool-using-AC_CHECK_TOOL.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/configure-Crosscompiling/0001-configure.ac-Search-for-otool-using-AC_CHECK_TOOL.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -From c6b2b1df5a754ac292ee66d091d7892e8252c5c3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sun, 21 Jun 2015 20:00:18 +0200 -Subject: configure.ac: Search for otool using AC_CHECK_TOOL. (v2) - -This is necessary to allow using otool from custom host toolchains like i686-apple-darwin12-otool. ---- - aclocal.m4 | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/aclocal.m4 b/aclocal.m4 -index 3d43721..f7a12f1 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -42,6 +42,7 @@ dnl Usage: WINE_PATH_PKG_CONFIG - dnl - AC_DEFUN([WINE_PATH_SONAME_TOOLS], - [AC_PATH_PROG(LDD,ldd,true,/sbin:/usr/sbin:$PATH) -+AC_CHECK_TOOL(OTOOL,otool,otool) - AC_CHECK_TOOL(READELF,[readelf],true)]) - - AC_DEFUN([WINE_PATH_PKG_CONFIG], -@@ -62,7 +63,7 @@ LIBS="-l$1 $5 $LIBS" - AC_LINK_IFELSE([AC_LANG_CALL([], [$2])], - [case "$LIBEXT" in - dll) AS_VAR_SET(ac_Lib,[`$ac_cv_path_LDD conftest.exe | grep "$1" | sed -e "s/dll.*/dll/"';2,$d'`]) ;; -- dylib) AS_VAR_SET(ac_Lib,[`otool -L conftest$ac_exeext | grep "ac_lib_pattern\\.[[0-9A-Za-z.]]*dylib" | sed -e "s/^.*\/\(ac_lib_pattern\.[[0-9A-Za-z.]]*dylib\).*$/\1/"';2,$d'`]) ;; -+ dylib) AS_VAR_SET(ac_Lib,[`$OTOOL -L conftest$ac_exeext | grep "ac_lib_pattern\\.[[0-9A-Za-z.]]*dylib" | sed -e "s/^.*\/\(ac_lib_pattern\.[[0-9A-Za-z.]]*dylib\).*$/\1/"';2,$d'`]) ;; - *) AS_VAR_SET(ac_Lib,[`$READELF -d conftest$ac_exeext | grep "NEEDED.*ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\\m4_dquote(\\(ac_lib_pattern\\.$LIBEXT[[^ ]]*\\)\\).*$/\1/"';2,$d'`]) - AS_VAR_IF([ac_Lib],[], - [AS_VAR_SET(ac_Lib,[`$LDD conftest$ac_exeext | grep "ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\(ac_lib_pattern\.$LIBEXT[[^ ]]*\).*$/\1/"';2,$d'`])]) ;; --- -2.4.4 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/configure-Crosscompiling/0002-configure.ac-Remove-check-for-strength-reduce-bug.patch wine-staging-1.7.48~ubuntu12.04.1/patches/configure-Crosscompiling/0002-configure.ac-Remove-check-for-strength-reduce-bug.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/configure-Crosscompiling/0002-configure.ac-Remove-check-for-strength-reduce-bug.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/configure-Crosscompiling/0002-configure.ac-Remove-check-for-strength-reduce-bug.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -From eb555bcc219bdd332d0bff45aa66c26f7a846307 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sun, 21 Jun 2015 20:04:34 +0200 -Subject: configure.ac: Remove check for strength-reduce bug. - -This was bug was fixed in gcc-2.7.2.1 which was released 19 years ago. -When cross compiling, the configure check currently assumes that the bug -is present, which produces a lot of noise with non-gcc compilers. ---- - configure.ac | 16 ---------------- - 1 file changed, 16 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 3587a12..fa6a542 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1788,22 +1788,6 @@ if test "x${GCC}" = "xyes" - then - EXTRACFLAGS="-Wall -pipe" - -- dnl Check for strength-reduce bug -- AC_CACHE_CHECK( [for gcc strength-reduce bug], ac_cv_c_gcc_strength_bug, -- AC_RUN_IFELSE([AC_LANG_PROGRAM([[int L[[4]] = {0,1,2,3};]], --[[static int Array[[3]]; -- unsigned int B = 3; -- int i; -- for(i=0; i -Date: Sat, 30 May 2015 17:08:18 +0200 -Subject: ws2_32: Fix uninitialized memory access in do_poll (Coverity). - ---- - dlls/ws2_32/socket.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c -index fdf68a3..60c6ec5 100644 ---- a/dlls/ws2_32/socket.c -+++ b/dlls/ws2_32/socket.c -@@ -4794,7 +4794,7 @@ static int do_poll(struct pollfd *pollfds, int count, int timeout) - struct timeval tv1, tv2; - int ret, torig = timeout; - -- if (timeout > 0) gettimeofday( &tv1, 0 ); -+ if (timeout >= 0) gettimeofday( &tv1, 0 ); - - while ((ret = poll( pollfds, count, timeout )) < 0) - { --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dcompiler_43-D3DCompile/0001-d3dcompiler_43-Add-D3DCompileFromFile-stub.-try-3.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dcompiler_43-D3DCompile/0001-d3dcompiler_43-Add-D3DCompileFromFile-stub.-try-3.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dcompiler_43-D3DCompile/0001-d3dcompiler_43-Add-D3DCompileFromFile-stub.-try-3.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dcompiler_43-D3DCompile/0001-d3dcompiler_43-Add-D3DCompileFromFile-stub.-try-3.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,57 @@ +From 13f3dd44fe48a06d9b8dafd4b499383cf17ff3e9 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Thu, 23 Jul 2015 19:09:32 +1000 +Subject: d3dcompiler_43: Add D3DCompileFromFile stub. (try 3) + +--- + dlls/d3dcompiler_43/compiler.c | 9 +++++++++ + dlls/d3dcompiler_46/d3dcompiler_46.spec | 2 +- + dlls/d3dcompiler_47/d3dcompiler_47.spec | 2 +- + 3 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c +index 114b4c1..5dce856 100644 +--- a/dlls/d3dcompiler_43/compiler.c ++++ b/dlls/d3dcompiler_43/compiler.c +@@ -763,3 +763,12 @@ HRESULT WINAPI D3DDisassemble(const void *data, SIZE_T size, UINT flags, const c + data, size, flags, comments, disassembly); + return E_NOTIMPL; + } ++ ++HRESULT WINAPI D3DCompileFromFile(const WCHAR *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *includes, ++ const char *entrypoint, const char *target, UINT flags1, UINT flags2, ID3DBlob **code, ID3DBlob **errors) ++{ ++ FIXME("filename %s, defines %p, includes %p, entrypoint %s, target %s, flags1 %x, flags2 %x, code %p, errors %p\n", ++ debugstr_w(filename), defines, includes, debugstr_a(entrypoint), debugstr_a(target), flags1, flags2, code, errors); ++ ++ return E_NOTIMPL; ++} +diff --git a/dlls/d3dcompiler_46/d3dcompiler_46.spec b/dlls/d3dcompiler_46/d3dcompiler_46.spec +index 5811b40..e36a8c0 100644 +--- a/dlls/d3dcompiler_46/d3dcompiler_46.spec ++++ b/dlls/d3dcompiler_46/d3dcompiler_46.spec +@@ -1,7 +1,7 @@ + @ stdcall D3DAssemble(ptr long str ptr ptr long ptr ptr) + @ stdcall D3DCompile(ptr long str ptr ptr str str long long ptr ptr) + @ stub D3DCompile2 +-@ stub D3DCompileFromFile ++@ stdcall D3DCompileFromFile(wstr ptr ptr str str long long ptr ptr) + @ stub D3DCompressShaders + @ stdcall D3DCreateBlob(long ptr) + @ stub D3DDecompressShaders +diff --git a/dlls/d3dcompiler_47/d3dcompiler_47.spec b/dlls/d3dcompiler_47/d3dcompiler_47.spec +index 40ad977..a0df93e 100644 +--- a/dlls/d3dcompiler_47/d3dcompiler_47.spec ++++ b/dlls/d3dcompiler_47/d3dcompiler_47.spec +@@ -1,7 +1,7 @@ + @ stdcall D3DAssemble(ptr long str ptr ptr long ptr ptr) + @ stdcall D3DCompile(ptr long str ptr ptr str str long long ptr ptr) + @ stub D3DCompile2 +-@ stub D3DCompileFromFile ++@ stdcall D3DCompileFromFile(wstr ptr ptr str str long long ptr ptr) + @ stub D3DCompressShaders + @ stdcall D3DCreateBlob(long ptr) + @ stub D3DCreateFunctionLinkingGraph +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dcompiler_43-D3DCompile/0002-d3dcompiler_43-Implement-semi-stub-for-D3DCompile2.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dcompiler_43-D3DCompile/0002-d3dcompiler_43-Implement-semi-stub-for-D3DCompile2.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dcompiler_43-D3DCompile/0002-d3dcompiler_43-Implement-semi-stub-for-D3DCompile2.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dcompiler_43-D3DCompile/0002-d3dcompiler_43-Implement-semi-stub-for-D3DCompile2.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,90 @@ +From 8e9d8ee497c06533082707f091339a20f2af5be1 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Wed, 29 Jul 2015 17:58:02 +0200 +Subject: d3dcompiler_43: Implement semi-stub for D3DCompile2. + +--- + dlls/d3dcompiler_43/compiler.c | 28 ++++++++++++++++++++++++---- + dlls/d3dcompiler_46/d3dcompiler_46.spec | 2 +- + dlls/d3dcompiler_47/d3dcompiler_47.spec | 2 +- + 3 files changed, 26 insertions(+), 6 deletions(-) + +diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c +index 5dce856..33ef916 100644 +--- a/dlls/d3dcompiler_43/compiler.c ++++ b/dlls/d3dcompiler_43/compiler.c +@@ -692,16 +692,23 @@ static HRESULT compile_shader(const char *preproc_shader, const char *target, co + return S_OK; + } + +-HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename, ++HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filename, + const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, +- const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages) ++ const char *target, UINT sflags, UINT eflags, UINT secondary_flags, ++ const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader, ++ ID3DBlob **error_messages) + { + HRESULT hr; + + TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s,\n" +- "target %s, sflags %#x, eflags %#x, shader %p, error_messages %p\n", ++ "target %s, sflags %#x, eflags %#x, secondary_flags %#x, secondary_data %p,\n" ++ "secondary_data_size %lu, shader %p, error_messages %p\n", + data, data_size, debugstr_a(filename), defines, include, debugstr_a(entrypoint), +- debugstr_a(target), sflags, eflags, shader, error_messages); ++ debugstr_a(target), sflags, eflags, secondary_flags, secondary_data, ++ secondary_data_size, shader, error_messages); ++ ++ if (secondary_data) ++ FIXME("secondary data not implemented yet\n"); + + if (shader) *shader = NULL; + if (error_messages) *error_messages = NULL; +@@ -717,6 +724,19 @@ HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filena + return hr; + } + ++HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename, ++ const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, ++ const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages) ++{ ++ TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s,\n" ++ "target %s, sflags %#x, eflags %#x, shader %p, error_messages %p\n", ++ data, data_size, debugstr_a(filename), defines, include, debugstr_a(entrypoint), ++ debugstr_a(target), sflags, eflags, shader, error_messages); ++ ++ return D3DCompile2(data, data_size, filename, defines, include, entrypoint, target, sflags, ++ eflags, 0, NULL, 0, shader, error_messages); ++} ++ + HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename, + const D3D_SHADER_MACRO *defines, ID3DInclude *include, + ID3DBlob **shader, ID3DBlob **error_messages) +diff --git a/dlls/d3dcompiler_46/d3dcompiler_46.spec b/dlls/d3dcompiler_46/d3dcompiler_46.spec +index e36a8c0..1b145c8a 100644 +--- a/dlls/d3dcompiler_46/d3dcompiler_46.spec ++++ b/dlls/d3dcompiler_46/d3dcompiler_46.spec +@@ -1,6 +1,6 @@ + @ stdcall D3DAssemble(ptr long str ptr ptr long ptr ptr) + @ stdcall D3DCompile(ptr long str ptr ptr str str long long ptr ptr) +-@ stub D3DCompile2 ++@ stdcall D3DCompile2(ptr long str ptr ptr str str long long long ptr long ptr ptr) + @ stdcall D3DCompileFromFile(wstr ptr ptr str str long long ptr ptr) + @ stub D3DCompressShaders + @ stdcall D3DCreateBlob(long ptr) +diff --git a/dlls/d3dcompiler_47/d3dcompiler_47.spec b/dlls/d3dcompiler_47/d3dcompiler_47.spec +index a0df93e..efa4767 100644 +--- a/dlls/d3dcompiler_47/d3dcompiler_47.spec ++++ b/dlls/d3dcompiler_47/d3dcompiler_47.spec +@@ -1,6 +1,6 @@ + @ stdcall D3DAssemble(ptr long str ptr ptr long ptr ptr) + @ stdcall D3DCompile(ptr long str ptr ptr str str long long ptr ptr) +-@ stub D3DCompile2 ++@ stdcall D3DCompile2(ptr long str ptr ptr str str long long long ptr long ptr ptr) + @ stdcall D3DCompileFromFile(wstr ptr ptr str str long long ptr ptr) + @ stub D3DCompressShaders + @ stdcall D3DCreateBlob(long ptr) +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dcompiler_43-D3DCompile/definition wine-staging-1.7.48~ubuntu12.04.1/patches/d3dcompiler_43-D3DCompile/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dcompiler_43-D3DCompile/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dcompiler_43-D3DCompile/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Add stubs for D3DCompile2 and D3DCompileFromFile diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/0001-d3dx10_43-Add-ID3DX10ThreadPump-interface.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/0001-d3dx10_43-Add-ID3DX10ThreadPump-interface.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/0001-d3dx10_43-Add-ID3DX10ThreadPump-interface.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/0001-d3dx10_43-Add-ID3DX10ThreadPump-interface.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,98 @@ +From f6d41cfa9447e79a432628db4c4d51eef49dd2ed Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 15 Jul 2015 13:37:50 +1000 +Subject: d3dx10_43: Add ID3DX10ThreadPump interface. + +--- + include/Makefile.in | 1 + + include/d3dx10core.idl | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 67 insertions(+) + create mode 100644 include/d3dx10core.idl + +diff --git a/include/Makefile.in b/include/Makefile.in +index b524326..e0c1561 100644 +--- a/include/Makefile.in ++++ b/include/Makefile.in +@@ -32,6 +32,7 @@ PUBLIC_IDL_H_SRCS = \ + d3d11_1.idl \ + d3d11sdklayers.idl \ + d3dcommon.idl \ ++ d3dx10core.idl \ + ddstream.idl \ + devicetopology.idl \ + dimm.idl \ +diff --git a/include/d3dx10core.idl b/include/d3dx10core.idl +new file mode 100644 +index 0000000..d352670 +--- /dev/null ++++ b/include/d3dx10core.idl +@@ -0,0 +1,66 @@ ++/* ++ * Copyright 2015 Alistair Leslie-Hughes ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++import "oaidl.idl"; ++import "ocidl.idl"; ++import "dxgi.idl"; ++import "d3dcommon.idl"; ++ ++[ ++ object, ++ local, ++ pointer_default(unique) ++] ++interface ID3DX10DataLoader ++{ ++ HRESULT Load(); ++ HRESULT Decompress([out] void **data, [in] SIZE_T *bytes); ++ HRESULT Destroy(); ++}; ++ ++[ ++ object, ++ local, ++ pointer_default(unique) ++] ++interface ID3DX10DataProcessor ++{ ++ HRESULT Process([in] void *data, [in] SIZE_T bytes); ++ HRESULT CreateDeviceObject([out] void **dataobject); ++ HRESULT Destroy(); ++}; ++ ++ ++[ ++ object, ++ local, ++ pointer_default(unique), ++ uuid(C93FECFA-6967-478a-ABBC-402D90621FCB) ++] ++interface ID3DX10ThreadPump : IUnknown ++{ ++ HRESULT AddWorkItem([in] ID3DX10DataLoader *loader, [in] ID3DX10DataProcessor *processor, ++ [in] HRESULT *result, [out] void **object); ++ UINT GetWorkItemCount(); ++ ++ HRESULT WaitForAllItems(); ++ HRESULT ProcessDeviceWorkItems([in] UINT count); ++ ++ HRESULT PurgeAllItems(); ++ HRESULT GetQueueStatus([in] UINT *queue, [in] UINT *processqueue, [in] UINT *devicequeue); ++}; +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/0002-d3dx10_43-Add-D3DX10CreateEffectFromFileA-W-stubs.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/0002-d3dx10_43-Add-D3DX10CreateEffectFromFileA-W-stubs.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/0002-d3dx10_43-Add-D3DX10CreateEffectFromFileA-W-stubs.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/0002-d3dx10_43-Add-D3DX10CreateEffectFromFileA-W-stubs.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,81 @@ +From 800e3ab9e59fb324fd8168f20a8139171794f4c8 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 15 Jul 2015 12:19:50 +1000 +Subject: d3dx10_43: Add D3DX10CreateEffectFromFileA/W stubs. + +--- + dlls/d3dx10_43/d3dx10_43.spec | 4 ++-- + dlls/d3dx10_43/d3dx10_43_main.c | 31 +++++++++++++++++++++++++++++++ + 2 files changed, 33 insertions(+), 2 deletions(-) + +diff --git a/dlls/d3dx10_43/d3dx10_43.spec b/dlls/d3dx10_43/d3dx10_43.spec +index 363d007..5bc871b 100644 +--- a/dlls/d3dx10_43/d3dx10_43.spec ++++ b/dlls/d3dx10_43/d3dx10_43.spec +@@ -20,8 +20,8 @@ + @ stub D3DX10CreateAsyncTextureProcessor(ptr ptr ptr) + @ stub D3DX10CreateDevice(ptr long long long ptr) + @ stub D3DX10CreateDeviceAndSwapChain(ptr long long long ptr ptr ptr) +-@ stub D3DX10CreateEffectFromFileA(str ptr ptr str long long ptr ptr ptr ptr ptr ptr) +-@ stub D3DX10CreateEffectFromFileW(wstr ptr ptr str long long ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DX10CreateEffectFromFileA(str ptr ptr str long long ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DX10CreateEffectFromFileW(wstr ptr ptr str long long ptr ptr ptr ptr ptr ptr) + @ stub D3DX10CreateEffectFromMemory(ptr long str ptr ptr str long long ptr ptr ptr ptr ptr ptr) + @ stub D3DX10CreateEffectFromResourceA(long str str ptr ptr str long long ptr ptr ptr ptr ptr ptr) + @ stub D3DX10CreateEffectFromResourceW(long wstr wstr ptr ptr str long long ptr ptr ptr ptr ptr ptr) +diff --git a/dlls/d3dx10_43/d3dx10_43_main.c b/dlls/d3dx10_43/d3dx10_43_main.c +index b3f9341..1b505fa 100644 +--- a/dlls/d3dx10_43/d3dx10_43_main.c ++++ b/dlls/d3dx10_43/d3dx10_43_main.c +@@ -21,6 +21,8 @@ + + #include "config.h" + #include "wine/port.h" ++#include "wine/debug.h" ++#include "wine/unicode.h" + + #include + +@@ -32,6 +34,9 @@ + #include "objbase.h" + + #include "d3d10.h" ++#include "d3dx10core.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(d3dx); + + BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) + { +@@ -59,3 +64,29 @@ BOOL WINAPI D3DX10CheckVersion(UINT d3dsdkvers, UINT d3dxsdkvers) + + return FALSE; + } ++ ++HRESULT WINAPI D3DX10CreateEffectFromFileA(const char *filename, const D3D10_SHADER_MACRO *defines, ++ ID3D10Include *include, const char *profile, UINT hlslflags, UINT fxflags, ID3D10Device *device, ++ ID3D10EffectPool *effectpool, ID3DX10ThreadPump *pump, ID3D10Effect **effect, ID3D10Blob **errors, ++ HRESULT *hresult) ++{ ++ FIXME("filename %s, defines %p, include %p, profile %s, hlslflags %#x, fxflags %#x, " ++ "device %p, effectpool %p, pump %p, effect %p, errors %p, hresult %p\n", ++ debugstr_a(filename), defines, include, debugstr_a(profile), hlslflags, fxflags, ++ device, effectpool, pump, effect, errors, hresult); ++ ++ return E_NOTIMPL; ++} ++ ++HRESULT WINAPI D3DX10CreateEffectFromFileW(const WCHAR *filename, const D3D10_SHADER_MACRO *defines, ++ ID3D10Include *include, const char *profile, UINT hlslflags, UINT fxflags, ID3D10Device *device, ++ ID3D10EffectPool *effectpool, ID3DX10ThreadPump *pump, ID3D10Effect **effect, ID3D10Blob **errors, ++ HRESULT *hresult) ++{ ++ FIXME("filename %s, defines %p, include %p, profile %s, hlslflags %#x, fxflags %#x, " ++ "device %p, effectpool %p, pump %p, effect %p, errors %p, hresult %p\n", ++ debugstr_w(filename), defines, include, debugstr_a(profile), hlslflags, fxflags, device, ++ effectpool, pump, effect, errors, hresult); ++ ++ return E_NOTIMPL; ++} +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/0003-d3dx10_43-Added-D3DX10CreateEffectFromMemory-stub.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/0003-d3dx10_43-Added-D3DX10CreateEffectFromMemory-stub.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/0003-d3dx10_43-Added-D3DX10CreateEffectFromMemory-stub.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/0003-d3dx10_43-Added-D3DX10CreateEffectFromMemory-stub.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,47 @@ +From 810bfdf3e2b0d08279d066e8fa2f0af194e63de4 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 22 Jul 2015 14:20:34 +1000 +Subject: d3dx10_43: Added D3DX10CreateEffectFromMemory stub. + +--- + dlls/d3dx10_43/d3dx10_43.spec | 2 +- + dlls/d3dx10_43/d3dx10_43_main.c | 13 +++++++++++++ + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/dlls/d3dx10_43/d3dx10_43.spec b/dlls/d3dx10_43/d3dx10_43.spec +index 5bc871b..ada1fa0 100644 +--- a/dlls/d3dx10_43/d3dx10_43.spec ++++ b/dlls/d3dx10_43/d3dx10_43.spec +@@ -22,7 +22,7 @@ + @ stub D3DX10CreateDeviceAndSwapChain(ptr long long long ptr ptr ptr) + @ stdcall D3DX10CreateEffectFromFileA(str ptr ptr str long long ptr ptr ptr ptr ptr ptr) + @ stdcall D3DX10CreateEffectFromFileW(wstr ptr ptr str long long ptr ptr ptr ptr ptr ptr) +-@ stub D3DX10CreateEffectFromMemory(ptr long str ptr ptr str long long ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DX10CreateEffectFromMemory(ptr long str ptr ptr str long long ptr ptr ptr ptr ptr ptr) + @ stub D3DX10CreateEffectFromResourceA(long str str ptr ptr str long long ptr ptr ptr ptr ptr ptr) + @ stub D3DX10CreateEffectFromResourceW(long wstr wstr ptr ptr str long long ptr ptr ptr ptr ptr ptr) + @ stub D3DX10CreateEffectPoolFromFileA(str ptr ptr str long long ptr ptr ptr ptr ptr) +diff --git a/dlls/d3dx10_43/d3dx10_43_main.c b/dlls/d3dx10_43/d3dx10_43_main.c +index 1b505fa..0e4c580 100644 +--- a/dlls/d3dx10_43/d3dx10_43_main.c ++++ b/dlls/d3dx10_43/d3dx10_43_main.c +@@ -90,3 +90,16 @@ HRESULT WINAPI D3DX10CreateEffectFromFileW(const WCHAR *filename, const D3D10_SH + + return E_NOTIMPL; + } ++ ++HRESULT WINAPI D3DX10CreateEffectFromMemory(const void *data, SIZE_T datasize, const char *filename, ++ const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *profile, UINT hlslflags, ++ UINT fxflags, ID3D10Device *device, ID3D10EffectPool *effectpool, ID3DX10ThreadPump *pump, ++ ID3D10Effect **effect, ID3D10Blob **errors, HRESULT *hresult) ++{ ++ FIXME("data %p, datasize %lu, filename %s, defines %p, include %p, profile %s, hlslflags %#x, fxflags %#x, " ++ "device %p, effectpool %p, pump %p, effect %p, errors %p, hresult %p\n", ++ data, datasize, debugstr_a(filename), defines, include, debugstr_a(profile), hlslflags, fxflags, device, ++ effectpool, pump, effect, errors, hresult); ++ ++ return E_NOTIMPL; ++} +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/definition wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx10_43-D3DX10CreateEffectFromFile/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [27739] Add stubs for d3dx10_43.D3DX10CreateEffectFromFileA/W diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_33-Share_Source/0001-d3dx9_33-Share-the-source-with-d3dx9_36.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_33-Share_Source/0001-d3dx9_33-Share-the-source-with-d3dx9_36.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_33-Share_Source/0001-d3dx9_33-Share-the-source-with-d3dx9_36.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_33-Share_Source/0001-d3dx9_33-Share-the-source-with-d3dx9_36.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,750 @@ +From ee0c88cdf8f9daad656c55790e4ca8c3fcddd2a9 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 13 Jul 2015 20:38:04 +1000 +Subject: d3dx9_33: Share the source with d3dx9_36 + +--- + dlls/d3dx9_33/Makefile.in | 20 +- + dlls/d3dx9_33/d3dx9_33.spec | 666 +++++++++++++++++++++--------------------- + dlls/d3dx9_33/d3dx9_33_main.c | 19 ++ + 3 files changed, 370 insertions(+), 335 deletions(-) + +diff --git a/dlls/d3dx9_33/Makefile.in b/dlls/d3dx9_33/Makefile.in +index 0934eab..c3c1ed4 100644 +--- a/dlls/d3dx9_33/Makefile.in ++++ b/dlls/d3dx9_33/Makefile.in +@@ -1,7 +1,23 @@ + MODULE = d3dx9_33.dll +-IMPORTS = d3d9 ++IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d ++PARENTSRC = ../d3dx9_36 + + C_SRCS = \ +- d3dx9_33_main.c ++ core.c \ ++ d3dx9_33_main.c \ ++ effect.c \ ++ font.c \ ++ line.c \ ++ math.c \ ++ mesh.c \ ++ render.c \ ++ shader.c \ ++ skin.c \ ++ sprite.c \ ++ surface.c \ ++ texture.c \ ++ util.c \ ++ volume.c \ ++ xfile.c + + RC_SRCS = version.rc +diff --git a/dlls/d3dx9_33/d3dx9_33.spec b/dlls/d3dx9_33/d3dx9_33.spec +index 35cb0b6..d0f1f5c 100644 +--- a/dlls/d3dx9_33/d3dx9_33.spec ++++ b/dlls/d3dx9_33/d3dx9_33.spec +@@ -1,334 +1,334 @@ +-@ stdcall D3DXAssembleShader(ptr long ptr ptr long ptr ptr) d3dx9_36.D3DXAssembleShader +-@ stdcall D3DXAssembleShaderFromFileA(str ptr ptr long ptr ptr) d3dx9_36.D3DXAssembleShaderFromFileA +-@ stdcall D3DXAssembleShaderFromFileW(wstr ptr ptr long ptr ptr) d3dx9_36.D3DXAssembleShaderFromFileW +-@ stdcall D3DXAssembleShaderFromResourceA(long str ptr ptr long ptr ptr) d3dx9_36.D3DXAssembleShaderFromResourceA +-@ stdcall D3DXAssembleShaderFromResourceW(long wstr ptr ptr long ptr ptr) d3dx9_36.D3DXAssembleShaderFromResourceW +-@ stdcall D3DXBoxBoundProbe(ptr ptr ptr ptr) d3dx9_36.D3DXBoxBoundProbe +-@ stdcall D3DXCheckCubeTextureRequirements(ptr ptr ptr long ptr ptr) d3dx9_36.D3DXCheckCubeTextureRequirements +-@ stdcall D3DXCheckTextureRequirements(ptr ptr ptr ptr long ptr ptr) d3dx9_36.D3DXCheckTextureRequirements ++@ stdcall D3DXAssembleShader(ptr long ptr ptr long ptr ptr) ++@ stdcall D3DXAssembleShaderFromFileA(str ptr ptr long ptr ptr) ++@ stdcall D3DXAssembleShaderFromFileW(wstr ptr ptr long ptr ptr) ++@ stdcall D3DXAssembleShaderFromResourceA(long str ptr ptr long ptr ptr) ++@ stdcall D3DXAssembleShaderFromResourceW(long wstr ptr ptr long ptr ptr) ++@ stdcall D3DXBoxBoundProbe(ptr ptr ptr ptr) ++@ stdcall D3DXCheckCubeTextureRequirements(ptr ptr ptr long ptr ptr) ++@ stdcall D3DXCheckTextureRequirements(ptr ptr ptr ptr long ptr ptr) + @ stdcall D3DXCheckVersion(long long) +-@ stdcall D3DXCheckVolumeTextureRequirements(ptr ptr ptr ptr ptr long ptr ptr) d3dx9_36.D3DXCheckVolumeTextureRequirements +-@ stdcall D3DXCleanMesh(long ptr ptr ptr ptr ptr) d3dx9_36.D3DXCleanMesh +-@ stdcall D3DXColorAdjustContrast(ptr ptr float) d3dx9_36.D3DXColorAdjustContrast +-@ stdcall D3DXColorAdjustSaturation(ptr ptr float) d3dx9_36.D3DXColorAdjustSaturation +-@ stdcall D3DXCompileShader(ptr long ptr ptr str str long ptr ptr ptr) d3dx9_36.D3DXCompileShader +-@ stdcall D3DXCompileShaderFromFileA(str ptr ptr str str long ptr ptr ptr) d3dx9_36.D3DXCompileShaderFromFileA +-@ stdcall D3DXCompileShaderFromFileW(wstr ptr ptr str str long ptr ptr ptr) d3dx9_36.D3DXCompileShaderFromFileW +-@ stdcall D3DXCompileShaderFromResourceA(ptr str ptr ptr str str long ptr ptr ptr) d3dx9_36.D3DXCompileShaderFromResourceA +-@ stdcall D3DXCompileShaderFromResourceW(ptr wstr ptr ptr str str long ptr ptr ptr) d3dx9_36.D3DXCompileShaderFromResourceW +-@ stdcall D3DXComputeBoundingBox(ptr long long ptr ptr) d3dx9_36.D3DXComputeBoundingBox +-@ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr) d3dx9_36.D3DXComputeBoundingSphere +-@ stdcall D3DXComputeIMTFromPerVertexSignal(ptr ptr long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerVertexSignal +-@ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal +-@ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal +-@ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap +-@ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals +-@ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent +-@ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +-@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx +-@ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes +-@ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip +-@ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips +-@ stdcall D3DXCreateAnimationController(long long long long ptr) d3dx9_36.D3DXCreateAnimationController +-@ stdcall D3DXCreateBox(ptr float float float ptr ptr) d3dx9_36.D3DXCreateBox +-@ stdcall D3DXCreateBuffer(long ptr) d3dx9_36.D3DXCreateBuffer +-@ stdcall D3DXCreateCompressedAnimationSet(ptr long long ptr long ptr ptr) d3dx9_36.D3DXCreateCompressedAnimationSet +-@ stdcall D3DXCreateCubeTexture(ptr long long long long long ptr) d3dx9_36.D3DXCreateCubeTexture +-@ stdcall D3DXCreateCubeTextureFromFileA(ptr ptr ptr) d3dx9_36.D3DXCreateCubeTextureFromFileA +-@ stdcall D3DXCreateCubeTextureFromFileExA(ptr ptr long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateCubeTextureFromFileExA +-@ stdcall D3DXCreateCubeTextureFromFileExW(ptr ptr long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateCubeTextureFromFileExW +-@ stdcall D3DXCreateCubeTextureFromFileInMemory(ptr ptr long ptr) d3dx9_36.D3DXCreateCubeTextureFromFileInMemory +-@ stdcall D3DXCreateCubeTextureFromFileInMemoryEx(ptr ptr long long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateCubeTextureFromFileInMemoryEx +-@ stdcall D3DXCreateCubeTextureFromFileW(ptr ptr ptr) d3dx9_36.D3DXCreateCubeTextureFromFileW +-@ stdcall D3DXCreateCubeTextureFromResourceA(ptr long ptr ptr) d3dx9_36.D3DXCreateCubeTextureFromResourceA +-@ stdcall D3DXCreateCubeTextureFromResourceExA(ptr long long long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateCubeTextureFromResourceExA +-@ stdcall D3DXCreateCubeTextureFromResourceExW(ptr long long long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateCubeTextureFromResourceExW +-@ stdcall D3DXCreateCubeTextureFromResourceW(ptr long ptr ptr) d3dx9_36.D3DXCreateCubeTextureFromResourceW +-@ stdcall D3DXCreateCylinder(ptr long long long long long ptr ptr) d3dx9_36.D3DXCreateCylinder +-@ stdcall D3DXCreateEffect(ptr ptr long ptr ptr long ptr ptr ptr) d3dx9_36.D3DXCreateEffect +-@ stdcall D3DXCreateEffectCompiler(ptr long ptr ptr long ptr ptr) d3dx9_36.D3DXCreateEffectCompiler +-@ stdcall D3DXCreateEffectCompilerFromFileA(str ptr ptr long ptr ptr) d3dx9_36.D3DXCreateEffectCompilerFromFileA +-@ stdcall D3DXCreateEffectCompilerFromFileW(wstr ptr ptr long ptr ptr) d3dx9_36.D3DXCreateEffectCompilerFromFileW +-@ stdcall D3DXCreateEffectCompilerFromResourceA(long str ptr ptr long ptr ptr) d3dx9_36.D3DXCreateEffectCompilerFromResourceA +-@ stdcall D3DXCreateEffectCompilerFromResourceW(long wstr ptr ptr long ptr ptr) d3dx9_36.D3DXCreateEffectCompilerFromResourceW +-@ stdcall D3DXCreateEffectEx(ptr ptr long ptr ptr str long ptr ptr ptr) d3dx9_36.D3DXCreateEffectEx +-@ stdcall D3DXCreateEffectFromFileA(ptr str ptr ptr long ptr ptr ptr) d3dx9_36.D3DXCreateEffectFromFileA +-@ stdcall D3DXCreateEffectFromFileExA(ptr str ptr ptr str long ptr ptr ptr) d3dx9_36.D3DXCreateEffectFromFileExA +-@ stdcall D3DXCreateEffectFromFileExW(ptr str ptr ptr str long ptr ptr ptr) d3dx9_36.D3DXCreateEffectFromFileExW +-@ stdcall D3DXCreateEffectFromFileW(ptr wstr ptr ptr long ptr ptr ptr) d3dx9_36.D3DXCreateEffectFromFileW +-@ stdcall D3DXCreateEffectFromResourceA(ptr long str ptr ptr long ptr ptr ptr) d3dx9_36.D3DXCreateEffectFromResourceA +-@ stdcall D3DXCreateEffectFromResourceExA(ptr long str ptr ptr str long ptr ptr ptr) d3dx9_36.D3DXCreateEffectFromResourceExA +-@ stdcall D3DXCreateEffectFromResourceExW(ptr long str ptr ptr str long ptr ptr ptr) d3dx9_36.D3DXCreateEffectFromResourceExW +-@ stdcall D3DXCreateEffectFromResourceW(ptr long wstr ptr ptr long ptr ptr ptr) d3dx9_36.D3DXCreateEffectFromResourceW +-@ stdcall D3DXCreateEffectPool(ptr) d3dx9_36.D3DXCreateEffectPool +-@ stdcall D3DXCreateFontA(ptr long long long long long long long long long str ptr) d3dx9_36.D3DXCreateFontA +-@ stdcall D3DXCreateFontIndirectA(ptr ptr ptr) d3dx9_36.D3DXCreateFontIndirectA +-@ stdcall D3DXCreateFontIndirectW(ptr ptr ptr) d3dx9_36.D3DXCreateFontIndirectW +-@ stdcall D3DXCreateFontW(ptr long long long long long long long long long wstr ptr) d3dx9_36.D3DXCreateFontW +-@ stdcall D3DXCreateFragmentLinker(ptr long ptr) d3dx9_36.D3DXCreateFragmentLinker +-@ stdcall D3DXCreateKeyframedAnimationSet(ptr long long long long ptr ptr) d3dx9_36.D3DXCreateKeyframedAnimationSet +-@ stdcall D3DXCreateLine(ptr ptr) d3dx9_36.D3DXCreateLine +-@ stdcall D3DXCreateMatrixStack(long ptr) d3dx9_36.D3DXCreateMatrixStack +-@ stdcall D3DXCreateMesh(long long long ptr ptr ptr) d3dx9_36.D3DXCreateMesh +-@ stdcall D3DXCreateMeshFVF(long long long long ptr ptr) d3dx9_36.D3DXCreateMeshFVF +-@ stdcall D3DXCreateNPatchMesh(ptr ptr) d3dx9_36.D3DXCreateNPatchMesh +-@ stdcall D3DXCreatePMeshFromStream(ptr long ptr ptr ptr ptr ptr) d3dx9_36.D3DXCreatePMeshFromStream +-@ stdcall D3DXCreatePatchMesh(ptr long long long ptr ptr ptr) d3dx9_36.D3DXCreatePatchMesh +-@ stdcall D3DXCreatePolygon(ptr float long ptr ptr) d3dx9_36.D3DXCreatePolygon +-@ stdcall D3DXCreatePRTBuffer(long long long ptr) d3dx9_36.D3DXCreatePRTBuffer +-@ stdcall D3DXCreatePRTBufferTex(long long long long ptr) d3dx9_36.D3DXCreatePRTBufferTex +-@ stdcall D3DXCreatePRTCompBuffer(long long long ptr ptr ptr ptr) d3dx9_36.D3DXCreatePRTCompBuffer +-@ stdcall D3DXCreatePRTEngine(ptr ptr long ptr ptr) d3dx9_36.D3DXCreatePRTEngine +-@ stdcall D3DXCreateRenderToEnvMap(ptr long long long long long ptr) d3dx9_36.D3DXCreateRenderToEnvMap +-@ stdcall D3DXCreateRenderToSurface(ptr long long long long long ptr) d3dx9_36.D3DXCreateRenderToSurface +-@ stdcall D3DXCreateSPMesh(ptr ptr ptr ptr ptr) d3dx9_36.D3DXCreateSPMesh +-@ stdcall D3DXCreateSkinInfo(long ptr long ptr) d3dx9_36.D3DXCreateSkinInfo +-@ stdcall D3DXCreateSkinInfoFromBlendedMesh(ptr long ptr ptr) d3dx9_36.D3DXCreateSkinInfoFromBlendedMesh +-@ stdcall D3DXCreateSkinInfoFVF(long long long ptr) d3dx9_36.D3DXCreateSkinInfoFVF +-@ stdcall D3DXCreateSphere(ptr float long long ptr ptr) d3dx9_36.D3DXCreateSphere +-@ stdcall D3DXCreateSprite(ptr ptr) d3dx9_36.D3DXCreateSprite +-@ stdcall D3DXCreateTeapot(ptr ptr ptr) d3dx9_36.D3DXCreateTeapot +-@ stdcall D3DXCreateTextA(ptr long str float float ptr ptr ptr) d3dx9_36.D3DXCreateTextA +-@ stdcall D3DXCreateTextW(ptr long wstr float float ptr ptr ptr) d3dx9_36.D3DXCreateTextW +-@ stdcall D3DXCreateTexture(ptr long long long long long long ptr) d3dx9_36.D3DXCreateTexture +-@ stdcall D3DXCreateTextureFromFileA(ptr str ptr) d3dx9_36.D3DXCreateTextureFromFileA +-@ stdcall D3DXCreateTextureFromFileExA(ptr str long long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateTextureFromFileExA +-@ stdcall D3DXCreateTextureFromFileExW(ptr wstr long long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateTextureFromFileExW +-@ stdcall D3DXCreateTextureFromFileInMemory(ptr ptr long ptr) d3dx9_36.D3DXCreateTextureFromFileInMemory +-@ stdcall D3DXCreateTextureFromFileInMemoryEx(ptr ptr long long long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateTextureFromFileInMemoryEx +-@ stdcall D3DXCreateTextureFromFileW(ptr wstr ptr) d3dx9_36.D3DXCreateTextureFromFileW +-@ stdcall D3DXCreateTextureFromResourceA(ptr ptr str ptr) d3dx9_36.D3DXCreateTextureFromResourceA +-@ stdcall D3DXCreateTextureFromResourceExA(ptr ptr str long long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateTextureFromResourceExA +-@ stdcall D3DXCreateTextureFromResourceExW(ptr ptr wstr long long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateTextureFromResourceExW +-@ stdcall D3DXCreateTextureFromResourceW(ptr ptr wstr ptr) d3dx9_36.D3DXCreateTextureFromResourceW +-@ stdcall D3DXCreateTextureGutterHelper(long long ptr long ptr) d3dx9_36.D3DXCreateTextureGutterHelper +-@ stdcall D3DXCreateTextureShader(ptr ptr) d3dx9_36.D3DXCreateTextureShader +-@ stdcall D3DXCreateTorus(ptr long long long long ptr ptr) d3dx9_36.D3DXCreateTorus +-@ stdcall D3DXCreateVolumeTexture(ptr long long long long long long long ptr) d3dx9_36.D3DXCreateVolumeTexture +-@ stdcall D3DXCreateVolumeTextureFromFileA(ptr ptr ptr) d3dx9_36.D3DXCreateVolumeTextureFromFileA +-@ stdcall D3DXCreateVolumeTextureFromFileExA(ptr ptr long long long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateVolumeTextureFromFileExA +-@ stdcall D3DXCreateVolumeTextureFromFileExW(ptr ptr long long long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateVolumeTextureFromFileExW +-@ stdcall D3DXCreateVolumeTextureFromFileInMemory(ptr ptr long ptr) d3dx9_36.D3DXCreateVolumeTextureFromFileInMemory +-@ stdcall D3DXCreateVolumeTextureFromFileInMemoryEx(ptr ptr long long long long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateVolumeTextureFromFileInMemoryEx +-@ stdcall D3DXCreateVolumeTextureFromFileW(ptr ptr ptr) d3dx9_36.D3DXCreateVolumeTextureFromFileW +-@ stdcall D3DXCreateVolumeTextureFromResourceA(ptr long ptr ptr) d3dx9_36.D3DXCreateVolumeTextureFromResourceA +-@ stdcall D3DXCreateVolumeTextureFromResourceExA(ptr long ptr long long long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateVolumeTextureFromResourceExA +-@ stdcall D3DXCreateVolumeTextureFromResourceExW(ptr long ptr long long long long long long long long long long ptr ptr ptr) d3dx9_36.D3DXCreateVolumeTextureFromResourceExW +-@ stdcall D3DXCreateVolumeTextureFromResourceW(ptr long ptr ptr) d3dx9_36.D3DXCreateVolumeTextureFromResourceW +-@ stdcall D3DXDebugMute(long) d3dx9_36.D3DXDebugMute +-@ stdcall D3DXDeclaratorFromFVF(long ptr) d3dx9_36.D3DXDeclaratorFromFVF +-@ stdcall D3DXDisassembleEffect(ptr long ptr) d3dx9_36.D3DXDisassembleEffect +-@ stdcall D3DXDisassembleShader(ptr long str ptr) d3dx9_36.D3DXDisassembleShader +-@ stdcall D3DXFileCreate(ptr) d3dx9_36.D3DXFileCreate +-@ stdcall D3DXFillCubeTexture(ptr ptr ptr) d3dx9_36.D3DXFillCubeTexture +-@ stdcall D3DXFillCubeTextureTX(ptr ptr) d3dx9_36.D3DXFillCubeTextureTX +-@ stdcall D3DXFillTexture(ptr ptr ptr) d3dx9_36.D3DXFillTexture +-@ stdcall D3DXFillTextureTX(ptr ptr) d3dx9_36.D3DXFillTextureTX +-@ stdcall D3DXFillVolumeTexture(ptr ptr ptr) d3dx9_36.D3DXFillVolumeTexture +-@ stdcall D3DXFillVolumeTextureTX(ptr ptr) d3dx9_36.D3DXFillVolumeTextureTX +-@ stdcall D3DXFilterTexture(ptr ptr long long) d3dx9_36.D3DXFilterTexture +-@ stdcall D3DXFindShaderComment(ptr long ptr ptr) d3dx9_36.D3DXFindShaderComment +-@ stdcall D3DXFloat16To32Array(ptr ptr long) d3dx9_36.D3DXFloat16To32Array +-@ stdcall D3DXFloat32To16Array(ptr ptr long) d3dx9_36.D3DXFloat32To16Array +-@ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild +-@ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere +-@ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind +-@ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices +-@ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices +-@ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +-@ stdcall D3DXFVFFromDeclarator(ptr ptr) d3dx9_36.D3DXFVFFromDeclarator +-@ stdcall D3DXGatherFragments(ptr long ptr ptr long ptr ptr) d3dx9_36.D3DXGatherFragments +-@ stdcall D3DXGatherFragmentsFromFileA(ptr ptr ptr long ptr ptr) d3dx9_36.D3DXGatherFragmentsFromFileA +-@ stdcall D3DXGatherFragmentsFromFileW(ptr ptr ptr long ptr ptr) d3dx9_36.D3DXGatherFragmentsFromFileW +-@ stdcall D3DXGatherFragmentsFromResourceA(long ptr ptr ptr long ptr ptr) d3dx9_36.D3DXGatherFragmentsFromResourceA +-@ stdcall D3DXGatherFragmentsFromResourceW(long ptr ptr ptr long ptr ptr) d3dx9_36.D3DXGatherFragmentsFromResourceW +-@ stdcall D3DXGenerateOutputDecl(ptr ptr) d3dx9_36.D3DXGenerateOutputDecl +-@ stdcall D3DXGeneratePMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXGeneratePMesh +-@ stdcall D3DXGetDeclLength(ptr) d3dx9_36.D3DXGetDeclLength +-@ stdcall D3DXGetDeclVertexSize(ptr long) d3dx9_36.D3DXGetDeclVertexSize +-@ stdcall D3DXGetDriverLevel(ptr) d3dx9_36.D3DXGetDriverLevel +-@ stdcall D3DXGetFVFVertexSize(long) d3dx9_36.D3DXGetFVFVertexSize +-@ stdcall D3DXGetImageInfoFromFileA(str ptr) d3dx9_36.D3DXGetImageInfoFromFileA +-@ stdcall D3DXGetImageInfoFromFileInMemory(ptr long ptr) d3dx9_36.D3DXGetImageInfoFromFileInMemory +-@ stdcall D3DXGetImageInfoFromFileW(wstr ptr) d3dx9_36.D3DXGetImageInfoFromFileW +-@ stdcall D3DXGetImageInfoFromResourceA(long str ptr) d3dx9_36.D3DXGetImageInfoFromResourceA +-@ stdcall D3DXGetImageInfoFromResourceW(long wstr ptr) d3dx9_36.D3DXGetImageInfoFromResourceW +-@ stdcall D3DXGetPixelShaderProfile(ptr) d3dx9_36.D3DXGetPixelShaderProfile +-@ stdcall D3DXGetShaderConstantTable(ptr ptr) d3dx9_36.D3DXGetShaderConstantTable +-@ stdcall D3DXGetShaderInputSemantics(ptr ptr ptr) d3dx9_36.D3DXGetShaderInputSemantics +-@ stdcall D3DXGetShaderOutputSemantics(ptr ptr ptr) d3dx9_36.D3DXGetShaderOutputSemantics +-@ stdcall D3DXGetShaderSamplers(ptr ptr ptr) d3dx9_36.D3DXGetShaderSamplers +-@ stdcall D3DXGetShaderSize(ptr) d3dx9_36.D3DXGetShaderSize +-@ stdcall D3DXGetShaderVersion(ptr) d3dx9_36.D3DXGetShaderVersion +-@ stdcall D3DXGetVertexShaderProfile(ptr) d3dx9_36.D3DXGetVertexShaderProfile +-@ stdcall D3DXIntersect(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXIntersect +-@ stdcall D3DXIntersectSubset(ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXIntersectSubset +-@ stdcall D3DXIntersectTri(ptr ptr ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXIntersectTri +-@ stdcall D3DXLoadMeshFromXA(str long ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXLoadMeshFromXA +-@ stdcall D3DXLoadMeshFromXInMemory(ptr long long ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXLoadMeshFromXInMemory +-@ stdcall D3DXLoadMeshFromXResource(long str str long ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXLoadMeshFromXResource +-@ stdcall D3DXLoadMeshFromXW(wstr long ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXLoadMeshFromXW +-@ stdcall D3DXLoadMeshFromXof(ptr long ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXLoadMeshFromXof +-@ stdcall D3DXLoadMeshHierarchyFromXA(str long ptr ptr ptr ptr ptr) d3dx9_36.D3DXLoadMeshHierarchyFromXA +-@ stdcall D3DXLoadMeshHierarchyFromXInMemory(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXLoadMeshHierarchyFromXInMemory +-@ stdcall D3DXLoadMeshHierarchyFromXW(wstr long ptr ptr ptr ptr ptr) d3dx9_36.D3DXLoadMeshHierarchyFromXW +-@ stdcall D3DXLoadPatchMeshFromXof(ptr long ptr ptr ptr long ptr) d3dx9_36.D3DXLoadPatchMeshFromXof +-@ stdcall D3DXLoadPRTBufferFromFileA(ptr ptr) d3dx9_36.D3DXLoadPRTBufferFromFileA +-@ stdcall D3DXLoadPRTBufferFromFileW(ptr ptr) d3dx9_36.D3DXLoadPRTBufferFromFileW +-@ stdcall D3DXLoadPRTCompBufferFromFileA(ptr ptr) d3dx9_36.D3DXLoadPRTCompBufferFromFileA +-@ stdcall D3DXLoadPRTCompBufferFromFileW(ptr ptr) d3dx9_36.D3DXLoadPRTCompBufferFromFileW +-@ stdcall D3DXLoadSkinMeshFromXof(ptr long ptr ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXLoadSkinMeshFromXof +-@ stdcall D3DXLoadSurfaceFromFileA(ptr ptr ptr str ptr long long ptr) d3dx9_36.D3DXLoadSurfaceFromFileA +-@ stdcall D3DXLoadSurfaceFromFileInMemory(ptr ptr ptr ptr long ptr long long ptr) d3dx9_36.D3DXLoadSurfaceFromFileInMemory +-@ stdcall D3DXLoadSurfaceFromFileW(ptr ptr ptr wstr ptr long long ptr) d3dx9_36.D3DXLoadSurfaceFromFileW +-@ stdcall D3DXLoadSurfaceFromMemory(ptr ptr ptr ptr long long ptr ptr long long) d3dx9_36.D3DXLoadSurfaceFromMemory +-@ stdcall D3DXLoadSurfaceFromResourceA(ptr ptr ptr ptr str ptr long long ptr) d3dx9_36.D3DXLoadSurfaceFromResourceA +-@ stdcall D3DXLoadSurfaceFromResourceW(ptr ptr ptr ptr wstr ptr long long ptr) d3dx9_36.D3DXLoadSurfaceFromResourceW +-@ stdcall D3DXLoadSurfaceFromSurface(ptr ptr ptr ptr ptr ptr long long) d3dx9_36.D3DXLoadSurfaceFromSurface +-@ stdcall D3DXLoadVolumeFromFileA(ptr ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXLoadVolumeFromFileA +-@ stdcall D3DXLoadVolumeFromFileInMemory(ptr ptr ptr ptr long ptr long long ptr) d3dx9_36.D3DXLoadVolumeFromFileInMemory +-@ stdcall D3DXLoadVolumeFromFileW(ptr ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXLoadVolumeFromFileW +-@ stdcall D3DXLoadVolumeFromMemory(ptr ptr ptr ptr long long long ptr ptr long long) d3dx9_36.D3DXLoadVolumeFromMemory +-@ stdcall D3DXLoadVolumeFromResourceA(ptr ptr ptr long ptr ptr long long ptr) d3dx9_36.D3DXLoadVolumeFromResourceA +-@ stdcall D3DXLoadVolumeFromResourceW(ptr ptr ptr long ptr ptr long long ptr) d3dx9_36.D3DXLoadVolumeFromResourceW +-@ stdcall D3DXLoadVolumeFromVolume(ptr ptr ptr ptr ptr ptr long long) d3dx9_36.D3DXLoadVolumeFromVolume +-@ stdcall D3DXMatrixAffineTransformation(ptr float ptr ptr ptr) d3dx9_36.D3DXMatrixAffineTransformation +-@ stdcall D3DXMatrixAffineTransformation2D(ptr float ptr float ptr) d3dx9_36.D3DXMatrixAffineTransformation2D +-@ stdcall D3DXMatrixDecompose(ptr ptr ptr ptr) d3dx9_36.D3DXMatrixDecompose +-@ stdcall D3DXMatrixDeterminant(ptr) d3dx9_36.D3DXMatrixDeterminant +-@ stdcall D3DXMatrixInverse(ptr ptr ptr) d3dx9_36.D3DXMatrixInverse +-@ stdcall D3DXMatrixLookAtLH(ptr ptr ptr ptr) d3dx9_36.D3DXMatrixLookAtLH +-@ stdcall D3DXMatrixLookAtRH(ptr ptr ptr ptr) d3dx9_36.D3DXMatrixLookAtRH +-@ stdcall D3DXMatrixMultiply(ptr ptr ptr) d3dx9_36.D3DXMatrixMultiply +-@ stdcall D3DXMatrixMultiplyTranspose(ptr ptr ptr) d3dx9_36.D3DXMatrixMultiplyTranspose +-@ stdcall D3DXMatrixOrthoLH(ptr float float float float) d3dx9_36.D3DXMatrixOrthoLH +-@ stdcall D3DXMatrixOrthoOffCenterLH(ptr float float float float float float) d3dx9_36.D3DXMatrixOrthoOffCenterLH +-@ stdcall D3DXMatrixOrthoOffCenterRH(ptr float float float float float float) d3dx9_36.D3DXMatrixOrthoOffCenterRH +-@ stdcall D3DXMatrixOrthoRH(ptr float float float float) d3dx9_36.D3DXMatrixOrthoRH +-@ stdcall D3DXMatrixPerspectiveFovLH(ptr float float float float) d3dx9_36.D3DXMatrixPerspectiveFovLH +-@ stdcall D3DXMatrixPerspectiveFovRH(ptr float float float float) d3dx9_36.D3DXMatrixPerspectiveFovRH +-@ stdcall D3DXMatrixPerspectiveLH(ptr float float float float) d3dx9_36.D3DXMatrixPerspectiveLH +-@ stdcall D3DXMatrixPerspectiveOffCenterLH(ptr float float float float float float) d3dx9_36.D3DXMatrixPerspectiveOffCenterLH +-@ stdcall D3DXMatrixPerspectiveOffCenterRH(ptr float float float float float float) d3dx9_36.D3DXMatrixPerspectiveOffCenterRH +-@ stdcall D3DXMatrixPerspectiveRH(ptr float float float float) d3dx9_36.D3DXMatrixPerspectiveRH +-@ stdcall D3DXMatrixReflect(ptr ptr) d3dx9_36.D3DXMatrixReflect +-@ stdcall D3DXMatrixRotationAxis(ptr ptr float) d3dx9_36.D3DXMatrixRotationAxis +-@ stdcall D3DXMatrixRotationQuaternion(ptr ptr) d3dx9_36.D3DXMatrixRotationQuaternion +-@ stdcall D3DXMatrixRotationX(ptr float) d3dx9_36.D3DXMatrixRotationX +-@ stdcall D3DXMatrixRotationY(ptr float) d3dx9_36.D3DXMatrixRotationY +-@ stdcall D3DXMatrixRotationYawPitchRoll(ptr float float float) d3dx9_36.D3DXMatrixRotationYawPitchRoll +-@ stdcall D3DXMatrixRotationZ(ptr float) d3dx9_36.D3DXMatrixRotationZ +-@ stdcall D3DXMatrixScaling(ptr float float float) d3dx9_36.D3DXMatrixScaling +-@ stdcall D3DXMatrixShadow(ptr ptr ptr) d3dx9_36.D3DXMatrixShadow +-@ stdcall D3DXMatrixTransformation(ptr ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXMatrixTransformation +-@ stdcall D3DXMatrixTransformation2D(ptr ptr float ptr ptr float ptr) d3dx9_36.D3DXMatrixTransformation2D +-@ stdcall D3DXMatrixTranslation(ptr float float float) d3dx9_36.D3DXMatrixTranslation +-@ stdcall D3DXMatrixTranspose(ptr ptr) d3dx9_36.D3DXMatrixTranspose +-@ stdcall D3DXOptimizeFaces(ptr long long long ptr) d3dx9_36.D3DXOptimizeFaces +-@ stdcall D3DXOptimizeVertices(ptr long long long ptr) d3dx9_36.D3DXOptimizeVertices +-@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr) d3dx9_36.D3DXPlaneFromPointNormal +-@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr) d3dx9_36.D3DXPlaneFromPoints +-@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr) d3dx9_36.D3DXPlaneIntersectLine +-@ stdcall D3DXPlaneNormalize(ptr ptr) d3dx9_36.D3DXPlaneNormalize +-@ stdcall D3DXPlaneTransform(ptr ptr ptr) d3dx9_36.D3DXPlaneTransform +-@ stdcall D3DXPlaneTransformArray(ptr long ptr long ptr long) d3dx9_36.D3DXPlaneTransformArray +-@ stdcall D3DXPreprocessShader(ptr long ptr ptr ptr ptr) d3dx9_36.D3DXPreprocessShader +-@ stdcall D3DXPreprocessShaderFromFileA(str ptr ptr ptr ptr) d3dx9_36.D3DXPreprocessShaderFromFileA +-@ stdcall D3DXPreprocessShaderFromFileW(wstr ptr ptr ptr ptr) d3dx9_36.D3DXPreprocessShaderFromFileW +-@ stdcall D3DXPreprocessShaderFromResourceA(long str ptr ptr ptr ptr) d3dx9_36.D3DXPreprocessShaderFromResourceA +-@ stdcall D3DXPreprocessShaderFromResourceW(long wstr ptr ptr ptr ptr) d3dx9_36.D3DXPreprocessShaderFromResourceW +-@ stdcall D3DXQuaternionBaryCentric(ptr ptr ptr ptr float float) d3dx9_36.D3DXQuaternionBaryCentric +-@ stdcall D3DXQuaternionExp(ptr ptr) d3dx9_36.D3DXQuaternionExp +-@ stdcall D3DXQuaternionInverse(ptr ptr) d3dx9_36.D3DXQuaternionInverse +-@ stdcall D3DXQuaternionLn(ptr ptr) d3dx9_36.D3DXQuaternionLn +-@ stdcall D3DXQuaternionMultiply(ptr ptr ptr) d3dx9_36.D3DXQuaternionMultiply +-@ stdcall D3DXQuaternionNormalize(ptr ptr) d3dx9_36.D3DXQuaternionNormalize +-@ stdcall D3DXQuaternionRotationAxis(ptr ptr float) d3dx9_36.D3DXQuaternionRotationAxis +-@ stdcall D3DXQuaternionRotationMatrix(ptr ptr) d3dx9_36.D3DXQuaternionRotationMatrix +-@ stdcall D3DXQuaternionRotationYawPitchRoll(ptr float float float) d3dx9_36.D3DXQuaternionRotationYawPitchRoll +-@ stdcall D3DXQuaternionSlerp(ptr ptr ptr float) d3dx9_36.D3DXQuaternionSlerp +-@ stdcall D3DXQuaternionSquad(ptr ptr ptr ptr ptr float) d3dx9_36.D3DXQuaternionSquad +-@ stdcall D3DXQuaternionSquadSetup(ptr ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXQuaternionSquadSetup +-@ stdcall D3DXQuaternionToAxisAngle(ptr ptr ptr) d3dx9_36.D3DXQuaternionToAxisAngle +-@ stdcall D3DXRectPatchSize(ptr ptr ptr) d3dx9_36.D3DXRectPatchSize +-@ stdcall D3DXSaveMeshHierarchyToFileA(ptr long ptr ptr ptr) d3dx9_36.D3DXSaveMeshHierarchyToFileA +-@ stdcall D3DXSaveMeshHierarchyToFileW(ptr long ptr ptr ptr) d3dx9_36.D3DXSaveMeshHierarchyToFileW +-@ stdcall D3DXSaveMeshToXA(ptr ptr ptr ptr ptr long long) d3dx9_36.D3DXSaveMeshToXA +-@ stdcall D3DXSaveMeshToXW(ptr ptr ptr ptr ptr long long) d3dx9_36.D3DXSaveMeshToXW +-@ stdcall D3DXSavePRTBufferToFileA(ptr ptr) d3dx9_36.D3DXSavePRTBufferToFileA +-@ stdcall D3DXSavePRTBufferToFileW(ptr ptr) d3dx9_36.D3DXSavePRTBufferToFileW +-@ stdcall D3DXSavePRTCompBufferToFileA(ptr ptr) d3dx9_36.D3DXSavePRTCompBufferToFileA +-@ stdcall D3DXSavePRTCompBufferToFileW(ptr ptr) d3dx9_36.D3DXSavePRTCompBufferToFileW +-@ stdcall D3DXSaveSurfaceToFileA(ptr long ptr ptr ptr) d3dx9_36.D3DXSaveSurfaceToFileA +-@ stdcall D3DXSaveSurfaceToFileInMemory(ptr long ptr ptr ptr) d3dx9_36.D3DXSaveSurfaceToFileInMemory +-@ stdcall D3DXSaveSurfaceToFileW(ptr long ptr ptr ptr) d3dx9_36.D3DXSaveSurfaceToFileW +-@ stdcall D3DXSaveTextureToFileA(ptr long ptr ptr) d3dx9_36.D3DXSaveTextureToFileA +-@ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) d3dx9_36.D3DXSaveTextureToFileInMemory +-@ stdcall D3DXSaveTextureToFileW(ptr long ptr ptr) d3dx9_36.D3DXSaveTextureToFileW +-@ stdcall D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) d3dx9_36.D3DXSaveVolumeToFileA +-@ stdcall D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) d3dx9_36.D3DXSaveVolumeToFileInMemory +-@ stdcall D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) d3dx9_36.D3DXSaveVolumeToFileW +-@ stdcall D3DXSHAdd(ptr long ptr ptr) d3dx9_36.D3DXSHAdd +-@ stdcall D3DXSHDot(long ptr ptr) d3dx9_36.D3DXSHDot +-@ stdcall D3DXSHEvalConeLight(long ptr float float float float ptr ptr ptr) d3dx9_36.D3DXSHEvalConeLight +-@ stdcall D3DXSHEvalDirection(ptr long ptr) d3dx9_36.D3DXSHEvalDirection +-@ stdcall D3DXSHEvalDirectionalLight(long ptr float float float ptr ptr ptr) d3dx9_36.D3DXSHEvalDirectionalLight +-@ stdcall D3DXSHEvalHemisphereLight(long ptr int128 int128 ptr ptr ptr) d3dx9_36.D3DXSHEvalHemisphereLight +-@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr) d3dx9_36.D3DXSHEvalSphericalLight +-@ stdcall D3DXSHMultiply2(ptr ptr ptr) d3dx9_36.D3DXSHMultiply2 +-@ stdcall D3DXSHMultiply3(ptr ptr ptr) d3dx9_36.D3DXSHMultiply3 +-@ stdcall D3DXSHMultiply4(ptr ptr ptr) d3dx9_36.D3DXSHMultiply4 +-@ stdcall D3DXSHMultiply5(ptr ptr ptr) d3dx9_36.D3DXSHMultiply5 +-@ stdcall D3DXSHMultiply6(ptr ptr ptr) d3dx9_36.D3DXSHMultiply6 +-@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr) d3dx9_36.D3DXSHProjectCubeMap +-@ stdcall D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSHPRTCompSplitMeshSC +-@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster +-@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate +-@ stdcall D3DXSHRotateZ(ptr long float ptr) d3dx9_36.D3DXSHRotateZ +-@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale +-@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh +-@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe +-@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches +-@ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch +-@ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch +-@ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +-@ stdcall D3DXUVAtlasCreate(ptr long long long long long long ptr ptr ptr ptr long ptr long ptr ptr ptr ptr ptr) d3dx9_36.D3DXUVAtlasCreate +-@ stdcall D3DXUVAtlasPack(ptr long long long long ptr ptr long ptr long ptr) d3dx9_36.D3DXUVAtlasPack +-@ stdcall D3DXUVAtlasPartition(ptr long long long ptr ptr ptr ptr long ptr long ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXUVAtlasPartition +-@ stdcall D3DXValidMesh(ptr ptr ptr) d3dx9_36.D3DXValidMesh +-@ stdcall D3DXValidPatchMesh(ptr ptr ptr ptr) d3dx9_36.D3DXValidPatchMesh +-@ stdcall D3DXVec2BaryCentric(ptr ptr ptr ptr float float) d3dx9_36.D3DXVec2BaryCentric +-@ stdcall D3DXVec2CatmullRom(ptr ptr ptr ptr ptr float) d3dx9_36.D3DXVec2CatmullRom +-@ stdcall D3DXVec2Hermite(ptr ptr ptr ptr ptr float) d3dx9_36.D3DXVec2Hermite +-@ stdcall D3DXVec2Normalize(ptr ptr) d3dx9_36.D3DXVec2Normalize +-@ stdcall D3DXVec2Transform(ptr ptr ptr) d3dx9_36.D3DXVec2Transform +-@ stdcall D3DXVec2TransformArray(ptr long ptr long ptr long) d3dx9_36.D3DXVec2TransformArray +-@ stdcall D3DXVec2TransformCoord(ptr ptr ptr) d3dx9_36.D3DXVec2TransformCoord +-@ stdcall D3DXVec2TransformCoordArray(ptr long ptr long ptr long) d3dx9_36.D3DXVec2TransformCoordArray +-@ stdcall D3DXVec2TransformNormal(ptr ptr ptr) d3dx9_36.D3DXVec2TransformNormal +-@ stdcall D3DXVec2TransformNormalArray(ptr long ptr long ptr long) d3dx9_36.D3DXVec2TransformNormalArray +-@ stdcall D3DXVec3BaryCentric(ptr ptr ptr ptr float float) d3dx9_36.D3DXVec3BaryCentric +-@ stdcall D3DXVec3CatmullRom(ptr ptr ptr ptr ptr float) d3dx9_36.D3DXVec3CatmullRom +-@ stdcall D3DXVec3Hermite(ptr ptr ptr ptr ptr float) d3dx9_36.D3DXVec3Hermite +-@ stdcall D3DXVec3Normalize(ptr ptr) d3dx9_36.D3DXVec3Normalize +-@ stdcall D3DXVec3Project(ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXVec3Project +-@ stdcall D3DXVec3ProjectArray(ptr long ptr long ptr ptr ptr ptr long) d3dx9_36.D3DXVec3ProjectArray +-@ stdcall D3DXVec3Transform(ptr ptr ptr) d3dx9_36.D3DXVec3Transform +-@ stdcall D3DXVec3TransformArray(ptr long ptr long ptr long) d3dx9_36.D3DXVec3TransformArray +-@ stdcall D3DXVec3TransformCoord(ptr ptr ptr) d3dx9_36.D3DXVec3TransformCoord +-@ stdcall D3DXVec3TransformCoordArray(ptr long ptr long ptr long) d3dx9_36.D3DXVec3TransformCoordArray +-@ stdcall D3DXVec3TransformNormal(ptr ptr ptr) d3dx9_36.D3DXVec3TransformNormal +-@ stdcall D3DXVec3TransformNormalArray(ptr long ptr long ptr long) d3dx9_36.D3DXVec3TransformNormalArray +-@ stdcall D3DXVec3Unproject(ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXVec3Unproject +-@ stdcall D3DXVec3UnprojectArray(ptr long ptr long ptr ptr ptr ptr long) d3dx9_36.D3DXVec3UnprojectArray +-@ stdcall D3DXVec4BaryCentric(ptr ptr ptr ptr float float) d3dx9_36.D3DXVec4BaryCentric +-@ stdcall D3DXVec4CatmullRom(ptr ptr ptr ptr ptr float) d3dx9_36.D3DXVec4CatmullRom +-@ stdcall D3DXVec4Cross(ptr ptr ptr ptr) d3dx9_36.D3DXVec4Cross +-@ stdcall D3DXVec4Hermite(ptr ptr ptr ptr ptr float) d3dx9_36.D3DXVec4Hermite +-@ stdcall D3DXVec4Normalize(ptr ptr) d3dx9_36.D3DXVec4Normalize +-@ stdcall D3DXVec4Transform(ptr ptr ptr) d3dx9_36.D3DXVec4Transform +-@ stdcall D3DXVec4TransformArray(ptr long ptr long ptr long) d3dx9_36.D3DXVec4TransformArray +-@ stdcall D3DXWeldVertices(ptr long ptr ptr ptr ptr ptr) d3dx9_36.D3DXWeldVertices ++@ stdcall D3DXCheckVolumeTextureRequirements(ptr ptr ptr ptr ptr long ptr ptr) ++@ stdcall D3DXCleanMesh(long ptr ptr ptr ptr ptr) ++@ stdcall D3DXColorAdjustContrast(ptr ptr float) ++@ stdcall D3DXColorAdjustSaturation(ptr ptr float) ++@ stdcall D3DXCompileShader(ptr long ptr ptr str str long ptr ptr ptr) ++@ stdcall D3DXCompileShaderFromFileA(str ptr ptr str str long ptr ptr ptr) ++@ stdcall D3DXCompileShaderFromFileW(wstr ptr ptr str str long ptr ptr ptr) ++@ stdcall D3DXCompileShaderFromResourceA(ptr str ptr ptr str str long ptr ptr ptr) ++@ stdcall D3DXCompileShaderFromResourceW(ptr wstr ptr ptr str str long ptr ptr ptr) ++@ stdcall D3DXComputeBoundingBox(ptr long long ptr ptr) ++@ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr) ++@ stub D3DXComputeIMTFromPerVertexSignal(ptr ptr long long long ptr ptr ptr) ++@ stub D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) ++@ stub D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) ++@ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) ++@ stdcall D3DXComputeNormals(ptr ptr) ++@ stub D3DXComputeTangent(ptr long long long long ptr) ++@ stub D3DXComputeTangentFrame(ptr long) ++@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) ++@ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) ++@ stub D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) ++@ stub D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) ++@ stub D3DXCreateAnimationController(long long long long ptr) ++@ stdcall D3DXCreateBox(ptr float float float ptr ptr) ++@ stdcall D3DXCreateBuffer(long ptr) ++@ stub D3DXCreateCompressedAnimationSet(ptr long long ptr long ptr ptr) ++@ stdcall D3DXCreateCubeTexture(ptr long long long long long ptr) ++@ stdcall D3DXCreateCubeTextureFromFileA(ptr ptr ptr) ++@ stdcall D3DXCreateCubeTextureFromFileExA(ptr ptr long long long long long long long long ptr ptr ptr) ++@ stdcall D3DXCreateCubeTextureFromFileExW(ptr ptr long long long long long long long long ptr ptr ptr) ++@ stdcall D3DXCreateCubeTextureFromFileInMemory(ptr ptr long ptr) ++@ stdcall D3DXCreateCubeTextureFromFileInMemoryEx(ptr ptr long long long long long long long long long ptr ptr ptr) ++@ stdcall D3DXCreateCubeTextureFromFileW(ptr ptr ptr) ++@ stub D3DXCreateCubeTextureFromResourceA(ptr long ptr ptr) ++@ stub D3DXCreateCubeTextureFromResourceExA(ptr long long long long long long long long long long ptr ptr ptr) ++@ stub D3DXCreateCubeTextureFromResourceExW(ptr long long long long long long long long long long ptr ptr ptr) ++@ stub D3DXCreateCubeTextureFromResourceW(ptr long ptr ptr) ++@ stdcall D3DXCreateCylinder(ptr long long long long long ptr ptr) ++@ stdcall D3DXCreateEffect(ptr ptr long ptr ptr long ptr ptr ptr) ++@ stdcall D3DXCreateEffectCompiler(ptr long ptr ptr long ptr ptr) ++@ stdcall D3DXCreateEffectCompilerFromFileA(str ptr ptr long ptr ptr) ++@ stdcall D3DXCreateEffectCompilerFromFileW(wstr ptr ptr long ptr ptr) ++@ stdcall D3DXCreateEffectCompilerFromResourceA(long str ptr ptr long ptr ptr) ++@ stdcall D3DXCreateEffectCompilerFromResourceW(long wstr ptr ptr long ptr ptr) ++@ stdcall D3DXCreateEffectEx(ptr ptr long ptr ptr str long ptr ptr ptr) ++@ stdcall D3DXCreateEffectFromFileA(ptr str ptr ptr long ptr ptr ptr) ++@ stdcall D3DXCreateEffectFromFileExA(ptr str ptr ptr str long ptr ptr ptr) ++@ stdcall D3DXCreateEffectFromFileExW(ptr str ptr ptr str long ptr ptr ptr) ++@ stdcall D3DXCreateEffectFromFileW(ptr wstr ptr ptr long ptr ptr ptr) ++@ stdcall D3DXCreateEffectFromResourceA(ptr long str ptr ptr long ptr ptr ptr) ++@ stdcall D3DXCreateEffectFromResourceExA(ptr long str ptr ptr str long ptr ptr ptr) ++@ stdcall D3DXCreateEffectFromResourceExW(ptr long str ptr ptr str long ptr ptr ptr) ++@ stdcall D3DXCreateEffectFromResourceW(ptr long wstr ptr ptr long ptr ptr ptr) ++@ stdcall D3DXCreateEffectPool(ptr) ++@ stdcall D3DXCreateFontA(ptr long long long long long long long long long str ptr) ++@ stdcall D3DXCreateFontIndirectA(ptr ptr ptr) ++@ stdcall D3DXCreateFontIndirectW(ptr ptr ptr) ++@ stdcall D3DXCreateFontW(ptr long long long long long long long long long wstr ptr) ++@ stub D3DXCreateFragmentLinker(ptr long ptr) ++@ stub D3DXCreateKeyframedAnimationSet(ptr long long long long ptr ptr) ++@ stdcall D3DXCreateLine(ptr ptr) ++@ stdcall D3DXCreateMatrixStack(long ptr) ++@ stdcall D3DXCreateMesh(long long long ptr ptr ptr) ++@ stdcall D3DXCreateMeshFVF(long long long long ptr ptr) ++@ stub D3DXCreateNPatchMesh(ptr ptr) ++@ stub D3DXCreatePMeshFromStream(ptr long ptr ptr ptr ptr ptr) ++@ stub D3DXCreatePatchMesh(ptr long long long ptr ptr ptr) ++@ stdcall D3DXCreatePolygon(ptr float long ptr ptr) ++@ stub D3DXCreatePRTBuffer(long long long ptr) ++@ stub D3DXCreatePRTBufferTex(long long long long ptr) ++@ stub D3DXCreatePRTCompBuffer(long long long ptr ptr ptr ptr) ++@ stub D3DXCreatePRTEngine(ptr ptr long ptr ptr) ++@ stdcall D3DXCreateRenderToEnvMap(ptr long long long long long ptr) ++@ stdcall D3DXCreateRenderToSurface(ptr long long long long long ptr) ++@ stub D3DXCreateSPMesh(ptr ptr ptr ptr ptr) ++@ stdcall D3DXCreateSkinInfo(long ptr long ptr) ++@ stub D3DXCreateSkinInfoFromBlendedMesh(ptr long ptr ptr) ++@ stdcall D3DXCreateSkinInfoFVF(long long long ptr) ++@ stdcall D3DXCreateSphere(ptr float long long ptr ptr) ++@ stdcall D3DXCreateSprite(ptr ptr) ++@ stdcall D3DXCreateTeapot(ptr ptr ptr) ++@ stdcall D3DXCreateTextA(ptr long str float float ptr ptr ptr) ++@ stdcall D3DXCreateTextW(ptr long wstr float float ptr ptr ptr) ++@ stdcall D3DXCreateTexture(ptr long long long long long long ptr) ++@ stdcall D3DXCreateTextureFromFileA(ptr str ptr) ++@ stdcall D3DXCreateTextureFromFileExA(ptr str long long long long long long long long long ptr ptr ptr) ++@ stdcall D3DXCreateTextureFromFileExW(ptr wstr long long long long long long long long long ptr ptr ptr) ++@ stdcall D3DXCreateTextureFromFileInMemory(ptr ptr long ptr) ++@ stdcall D3DXCreateTextureFromFileInMemoryEx(ptr ptr long long long long long long long long long long ptr ptr ptr) ++@ stdcall D3DXCreateTextureFromFileW(ptr wstr ptr) ++@ stdcall D3DXCreateTextureFromResourceA(ptr ptr str ptr) ++@ stdcall D3DXCreateTextureFromResourceExA(ptr ptr str long long long long long long long long long ptr ptr ptr) ++@ stdcall D3DXCreateTextureFromResourceExW(ptr ptr wstr long long long long long long long long long ptr ptr ptr) ++@ stdcall D3DXCreateTextureFromResourceW(ptr ptr wstr ptr) ++@ stub D3DXCreateTextureGutterHelper(long long ptr long ptr) ++@ stub D3DXCreateTextureShader(ptr ptr) ++@ stdcall D3DXCreateTorus(ptr long long long long ptr ptr) ++@ stdcall D3DXCreateVolumeTexture(ptr long long long long long long long ptr) ++@ stdcall D3DXCreateVolumeTextureFromFileA(ptr ptr ptr) ++@ stdcall D3DXCreateVolumeTextureFromFileExA(ptr ptr long long long long long long long long long long ptr ptr ptr) ++@ stdcall D3DXCreateVolumeTextureFromFileExW(ptr ptr long long long long long long long long long long ptr ptr ptr) ++@ stdcall D3DXCreateVolumeTextureFromFileInMemory(ptr ptr long ptr) ++@ stdcall D3DXCreateVolumeTextureFromFileInMemoryEx(ptr ptr long long long long long long long long long long long ptr ptr ptr) ++@ stdcall D3DXCreateVolumeTextureFromFileW(ptr ptr ptr) ++@ stub D3DXCreateVolumeTextureFromResourceA(ptr long ptr ptr) ++@ stub D3DXCreateVolumeTextureFromResourceExA(ptr long ptr long long long long long long long long long long ptr ptr ptr) ++@ stub D3DXCreateVolumeTextureFromResourceExW(ptr long ptr long long long long long long long long long long ptr ptr ptr) ++@ stub D3DXCreateVolumeTextureFromResourceW(ptr long ptr ptr) ++@ stdcall D3DXDebugMute(long) ++@ stdcall D3DXDeclaratorFromFVF(long ptr) ++@ stdcall D3DXDisassembleEffect(ptr long ptr) ++@ stdcall D3DXDisassembleShader(ptr long str ptr) ++@ stdcall D3DXFileCreate(ptr) ++@ stdcall D3DXFillCubeTexture(ptr ptr ptr) ++@ stub D3DXFillCubeTextureTX(ptr ptr) ++@ stdcall D3DXFillTexture(ptr ptr ptr) ++@ stub D3DXFillTextureTX(ptr ptr) ++@ stdcall D3DXFillVolumeTexture(ptr ptr ptr) ++@ stub D3DXFillVolumeTextureTX(ptr ptr) ++@ stdcall D3DXFilterTexture(ptr ptr long long) ++@ stdcall D3DXFindShaderComment(ptr long ptr ptr) ++@ stdcall D3DXFloat16To32Array(ptr ptr long) ++@ stdcall D3DXFloat32To16Array(ptr ptr long) ++@ stub D3DXFrameAppendChild(ptr ptr) ++@ stub D3DXFrameCalculateBoundingSphere(ptr ptr ptr) ++@ stdcall D3DXFrameDestroy(ptr ptr) ++@ stdcall D3DXFrameFind(ptr str) ++@ stub D3DXFrameNumNamedMatrices(ptr) ++@ stub D3DXFrameRegisterNamedMatrices(ptr ptr) ++@ stdcall D3DXFresnelTerm(float float) ++@ stdcall D3DXFVFFromDeclarator(ptr ptr) ++@ stub D3DXGatherFragments(ptr long ptr ptr long ptr ptr) ++@ stub D3DXGatherFragmentsFromFileA(ptr ptr ptr long ptr ptr) ++@ stub D3DXGatherFragmentsFromFileW(ptr ptr ptr long ptr ptr) ++@ stub D3DXGatherFragmentsFromResourceA(long ptr ptr ptr long ptr ptr) ++@ stub D3DXGatherFragmentsFromResourceW(long ptr ptr ptr long ptr ptr) ++@ stub D3DXGenerateOutputDecl(ptr ptr) ++@ stub D3DXGeneratePMesh(ptr ptr ptr ptr long long ptr) ++@ stdcall D3DXGetDeclLength(ptr) ++@ stdcall D3DXGetDeclVertexSize(ptr long) ++@ stdcall D3DXGetDriverLevel(ptr) ++@ stdcall D3DXGetFVFVertexSize(long) ++@ stdcall D3DXGetImageInfoFromFileA(str ptr) ++@ stdcall D3DXGetImageInfoFromFileInMemory(ptr long ptr) ++@ stdcall D3DXGetImageInfoFromFileW(wstr ptr) ++@ stdcall D3DXGetImageInfoFromResourceA(long str ptr) ++@ stdcall D3DXGetImageInfoFromResourceW(long wstr ptr) ++@ stdcall D3DXGetPixelShaderProfile(ptr) ++@ stdcall D3DXGetShaderConstantTable(ptr ptr) ++@ stub D3DXGetShaderInputSemantics(ptr ptr ptr) ++@ stub D3DXGetShaderOutputSemantics(ptr ptr ptr) ++@ stdcall D3DXGetShaderSamplers(ptr ptr ptr) ++@ stdcall D3DXGetShaderSize(ptr) ++@ stdcall D3DXGetShaderVersion(ptr) ++@ stdcall D3DXGetVertexShaderProfile(ptr) ++@ stdcall D3DXIntersect(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) ++@ stub D3DXIntersectSubset(ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DXIntersectTri(ptr ptr ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DXLoadMeshFromXA(str long ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DXLoadMeshFromXInMemory(ptr long long ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DXLoadMeshFromXResource(long str str long ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DXLoadMeshFromXW(wstr long ptr ptr ptr ptr ptr ptr) ++@ stub D3DXLoadMeshFromXof(ptr long ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DXLoadMeshHierarchyFromXA(str long ptr ptr ptr ptr ptr) ++@ stdcall D3DXLoadMeshHierarchyFromXInMemory(ptr long long ptr ptr ptr ptr ptr) ++@ stdcall D3DXLoadMeshHierarchyFromXW(wstr long ptr ptr ptr ptr ptr) ++@ stub D3DXLoadPatchMeshFromXof(ptr long ptr ptr ptr long ptr) ++@ stub D3DXLoadPRTBufferFromFileA(ptr ptr) ++@ stub D3DXLoadPRTBufferFromFileW(ptr ptr) ++@ stub D3DXLoadPRTCompBufferFromFileA(ptr ptr) ++@ stub D3DXLoadPRTCompBufferFromFileW(ptr ptr) ++@ stdcall D3DXLoadSkinMeshFromXof(ptr long ptr ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DXLoadSurfaceFromFileA(ptr ptr ptr str ptr long long ptr) ++@ stdcall D3DXLoadSurfaceFromFileInMemory(ptr ptr ptr ptr long ptr long long ptr) ++@ stdcall D3DXLoadSurfaceFromFileW(ptr ptr ptr wstr ptr long long ptr) ++@ stdcall D3DXLoadSurfaceFromMemory(ptr ptr ptr ptr long long ptr ptr long long) ++@ stdcall D3DXLoadSurfaceFromResourceA(ptr ptr ptr ptr str ptr long long ptr) ++@ stdcall D3DXLoadSurfaceFromResourceW(ptr ptr ptr ptr wstr ptr long long ptr) ++@ stdcall D3DXLoadSurfaceFromSurface(ptr ptr ptr ptr ptr ptr long long) ++@ stdcall D3DXLoadVolumeFromFileA(ptr ptr ptr ptr ptr long long ptr) ++@ stdcall D3DXLoadVolumeFromFileInMemory(ptr ptr ptr ptr long ptr long long ptr) ++@ stdcall D3DXLoadVolumeFromFileW(ptr ptr ptr ptr ptr long long ptr) ++@ stdcall D3DXLoadVolumeFromMemory(ptr ptr ptr ptr long long long ptr ptr long long) ++@ stub D3DXLoadVolumeFromResourceA(ptr ptr ptr long ptr ptr long long ptr) ++@ stub D3DXLoadVolumeFromResourceW(ptr ptr ptr long ptr ptr long long ptr) ++@ stdcall D3DXLoadVolumeFromVolume(ptr ptr ptr ptr ptr ptr long long) ++@ stdcall D3DXMatrixAffineTransformation(ptr float ptr ptr ptr) ++@ stdcall D3DXMatrixAffineTransformation2D(ptr float ptr float ptr) ++@ stdcall D3DXMatrixDecompose(ptr ptr ptr ptr) ++@ stdcall D3DXMatrixDeterminant(ptr) ++@ stdcall D3DXMatrixInverse(ptr ptr ptr) ++@ stdcall D3DXMatrixLookAtLH(ptr ptr ptr ptr) ++@ stdcall D3DXMatrixLookAtRH(ptr ptr ptr ptr) ++@ stdcall D3DXMatrixMultiply(ptr ptr ptr) ++@ stdcall D3DXMatrixMultiplyTranspose(ptr ptr ptr) ++@ stdcall D3DXMatrixOrthoLH(ptr float float float float) ++@ stdcall D3DXMatrixOrthoOffCenterLH(ptr float float float float float float) ++@ stdcall D3DXMatrixOrthoOffCenterRH(ptr float float float float float float) ++@ stdcall D3DXMatrixOrthoRH(ptr float float float float) ++@ stdcall D3DXMatrixPerspectiveFovLH(ptr float float float float) ++@ stdcall D3DXMatrixPerspectiveFovRH(ptr float float float float) ++@ stdcall D3DXMatrixPerspectiveLH(ptr float float float float) ++@ stdcall D3DXMatrixPerspectiveOffCenterLH(ptr float float float float float float) ++@ stdcall D3DXMatrixPerspectiveOffCenterRH(ptr float float float float float float) ++@ stdcall D3DXMatrixPerspectiveRH(ptr float float float float) ++@ stdcall D3DXMatrixReflect(ptr ptr) ++@ stdcall D3DXMatrixRotationAxis(ptr ptr float) ++@ stdcall D3DXMatrixRotationQuaternion(ptr ptr) ++@ stdcall D3DXMatrixRotationX(ptr float) ++@ stdcall D3DXMatrixRotationY(ptr float) ++@ stdcall D3DXMatrixRotationYawPitchRoll(ptr float float float) ++@ stdcall D3DXMatrixRotationZ(ptr float) ++@ stdcall D3DXMatrixScaling(ptr float float float) ++@ stdcall D3DXMatrixShadow(ptr ptr ptr) ++@ stdcall D3DXMatrixTransformation(ptr ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DXMatrixTransformation2D(ptr ptr float ptr ptr float ptr) ++@ stdcall D3DXMatrixTranslation(ptr float float float) ++@ stdcall D3DXMatrixTranspose(ptr ptr) ++@ stdcall D3DXOptimizeFaces(ptr long long long ptr) ++@ stub D3DXOptimizeVertices(ptr long long long ptr) ++@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr) ++@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr) ++@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr) ++@ stdcall D3DXPlaneNormalize(ptr ptr) ++@ stdcall D3DXPlaneTransform(ptr ptr ptr) ++@ stdcall D3DXPlaneTransformArray(ptr long ptr long ptr long) ++@ stdcall D3DXPreprocessShader(ptr long ptr ptr ptr ptr) ++@ stdcall D3DXPreprocessShaderFromFileA(str ptr ptr ptr ptr) ++@ stdcall D3DXPreprocessShaderFromFileW(wstr ptr ptr ptr ptr) ++@ stdcall D3DXPreprocessShaderFromResourceA(long str ptr ptr ptr ptr) ++@ stdcall D3DXPreprocessShaderFromResourceW(long wstr ptr ptr ptr ptr) ++@ stdcall D3DXQuaternionBaryCentric(ptr ptr ptr ptr float float) ++@ stdcall D3DXQuaternionExp(ptr ptr) ++@ stdcall D3DXQuaternionInverse(ptr ptr) ++@ stdcall D3DXQuaternionLn(ptr ptr) ++@ stdcall D3DXQuaternionMultiply(ptr ptr ptr) ++@ stdcall D3DXQuaternionNormalize(ptr ptr) ++@ stdcall D3DXQuaternionRotationAxis(ptr ptr float) ++@ stdcall D3DXQuaternionRotationMatrix(ptr ptr) ++@ stdcall D3DXQuaternionRotationYawPitchRoll(ptr float float float) ++@ stdcall D3DXQuaternionSlerp(ptr ptr ptr float) ++@ stdcall D3DXQuaternionSquad(ptr ptr ptr ptr ptr float) ++@ stdcall D3DXQuaternionSquadSetup(ptr ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DXQuaternionToAxisAngle(ptr ptr ptr) ++@ stub D3DXRectPatchSize(ptr ptr ptr) ++@ stub D3DXSaveMeshHierarchyToFileA(ptr long ptr ptr ptr) ++@ stub D3DXSaveMeshHierarchyToFileW(ptr long ptr ptr ptr) ++@ stub D3DXSaveMeshToXA(ptr ptr ptr ptr ptr long long) ++@ stub D3DXSaveMeshToXW(ptr ptr ptr ptr ptr long long) ++@ stub D3DXSavePRTBufferToFileA(ptr ptr) ++@ stub D3DXSavePRTBufferToFileW(ptr ptr) ++@ stub D3DXSavePRTCompBufferToFileA(ptr ptr) ++@ stub D3DXSavePRTCompBufferToFileW(ptr ptr) ++@ stdcall D3DXSaveSurfaceToFileA(ptr long ptr ptr ptr) ++@ stdcall D3DXSaveSurfaceToFileInMemory(ptr long ptr ptr ptr) ++@ stdcall D3DXSaveSurfaceToFileW(ptr long ptr ptr ptr) ++@ stdcall D3DXSaveTextureToFileA(ptr long ptr ptr) ++@ stdcall D3DXSaveTextureToFileInMemory(ptr long ptr ptr) ++@ stdcall D3DXSaveTextureToFileW(ptr long ptr ptr) ++@ stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) ++@ stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) ++@ stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) ++@ stdcall D3DXSHAdd(ptr long ptr ptr) ++@ stdcall D3DXSHDot(long ptr ptr) ++@ stdcall D3DXSHEvalConeLight(long ptr float float float float ptr ptr ptr) ++@ stdcall D3DXSHEvalDirection(ptr long ptr) ++@ stdcall D3DXSHEvalDirectionalLight(long ptr float float float ptr ptr ptr) ++@ stdcall D3DXSHEvalHemisphereLight(long ptr int128 int128 ptr ptr ptr) ++@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr) ++@ stdcall D3DXSHMultiply2(ptr ptr ptr) ++@ stdcall D3DXSHMultiply3(ptr ptr ptr) ++@ stdcall D3DXSHMultiply4(ptr ptr ptr) ++@ stub D3DXSHMultiply5(ptr ptr ptr) ++@ stub D3DXSHMultiply6(ptr ptr ptr) ++@ stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr) ++@ stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr) ++@ stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) ++@ stdcall D3DXSHRotate(ptr long ptr ptr) ++@ stdcall D3DXSHRotateZ(ptr long float ptr) ++@ stdcall D3DXSHScale(ptr long ptr float) ++@ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) ++@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) ++@ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) ++@ stub D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) ++@ stub D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) ++@ stub D3DXTriPatchSize(ptr ptr ptr) ++@ stub D3DXUVAtlasCreate(ptr long long long long long long ptr ptr ptr ptr long ptr long ptr ptr ptr ptr ptr) ++@ stub D3DXUVAtlasPack(ptr long long long long ptr ptr long ptr long ptr) ++@ stub D3DXUVAtlasPartition(ptr long long long ptr ptr ptr ptr long ptr long ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DXValidMesh(ptr ptr ptr) ++@ stub D3DXValidPatchMesh(ptr ptr ptr ptr) ++@ stdcall D3DXVec2BaryCentric(ptr ptr ptr ptr float float) ++@ stdcall D3DXVec2CatmullRom(ptr ptr ptr ptr ptr float) ++@ stdcall D3DXVec2Hermite(ptr ptr ptr ptr ptr float) ++@ stdcall D3DXVec2Normalize(ptr ptr) ++@ stdcall D3DXVec2Transform(ptr ptr ptr) ++@ stdcall D3DXVec2TransformArray(ptr long ptr long ptr long) ++@ stdcall D3DXVec2TransformCoord(ptr ptr ptr) ++@ stdcall D3DXVec2TransformCoordArray(ptr long ptr long ptr long) ++@ stdcall D3DXVec2TransformNormal(ptr ptr ptr) ++@ stdcall D3DXVec2TransformNormalArray(ptr long ptr long ptr long) ++@ stdcall D3DXVec3BaryCentric(ptr ptr ptr ptr float float) ++@ stdcall D3DXVec3CatmullRom(ptr ptr ptr ptr ptr float) ++@ stdcall D3DXVec3Hermite(ptr ptr ptr ptr ptr float) ++@ stdcall D3DXVec3Normalize(ptr ptr) ++@ stdcall D3DXVec3Project(ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DXVec3ProjectArray(ptr long ptr long ptr ptr ptr ptr long) ++@ stdcall D3DXVec3Transform(ptr ptr ptr) ++@ stdcall D3DXVec3TransformArray(ptr long ptr long ptr long) ++@ stdcall D3DXVec3TransformCoord(ptr ptr ptr) ++@ stdcall D3DXVec3TransformCoordArray(ptr long ptr long ptr long) ++@ stdcall D3DXVec3TransformNormal(ptr ptr ptr) ++@ stdcall D3DXVec3TransformNormalArray(ptr long ptr long ptr long) ++@ stdcall D3DXVec3Unproject(ptr ptr ptr ptr ptr ptr) ++@ stdcall D3DXVec3UnprojectArray(ptr long ptr long ptr ptr ptr ptr long) ++@ stdcall D3DXVec4BaryCentric(ptr ptr ptr ptr float float) ++@ stdcall D3DXVec4CatmullRom(ptr ptr ptr ptr ptr float) ++@ stdcall D3DXVec4Cross(ptr ptr ptr ptr) ++@ stdcall D3DXVec4Hermite(ptr ptr ptr ptr ptr float) ++@ stdcall D3DXVec4Normalize(ptr ptr) ++@ stdcall D3DXVec4Transform(ptr ptr ptr) ++@ stdcall D3DXVec4TransformArray(ptr long ptr long ptr long) ++@ stdcall D3DXWeldVertices(ptr long ptr ptr ptr ptr ptr) +diff --git a/dlls/d3dx9_33/d3dx9_33_main.c b/dlls/d3dx9_33/d3dx9_33_main.c +index 1b65a84..92f1772 100644 +--- a/dlls/d3dx9_33/d3dx9_33_main.c ++++ b/dlls/d3dx9_33/d3dx9_33_main.c +@@ -21,6 +21,7 @@ + + #include "config.h" + #include "wine/port.h" ++#include "initguid.h" + + #include + +@@ -59,3 +60,21 @@ BOOL WINAPI D3DXCheckVersion(UINT d3dsdkvers, UINT d3dxsdkvers) + else + return FALSE; + } ++ ++/*********************************************************************** ++ * D3DXDebugMute ++ * Returns always FALSE for us. ++ */ ++BOOL WINAPI D3DXDebugMute(BOOL mute) ++{ ++ return FALSE; ++} ++ ++/*********************************************************************** ++ * D3DXGetDriverLevel. ++ * Returns always 900 (DX 9) for us ++ */ ++UINT WINAPI D3DXGetDriverLevel(struct IDirect3DDevice9 *device) ++{ ++ return 900; ++} +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_33-Share_Source/definition wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_33-Share_Source/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_33-Share_Source/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_33-Share_Source/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,4 @@ +Fixes: [21817] Share source of d3dx9_36 with d3dx9_33 to avoid Wine DLL forwards +Apply-After: dlls/d3dx9_33/* +Depends: d3dx9_36-D3DXStubs +Depends: d3dx9_36-DXTn diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0001-d3dx9_36-Add-stub-for-D3DXComputeTangentFrameEx.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0001-d3dx9_36-Add-stub-for-D3DXComputeTangentFrameEx.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0001-d3dx9_36-Add-stub-for-D3DXComputeTangentFrameEx.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0001-d3dx9_36-Add-stub-for-D3DXComputeTangentFrameEx.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,320 +0,0 @@ -From 9b5a18d6eb150dfacbee644e7abebc4019232a9c Mon Sep 17 00:00:00 2001 -From: Christian Costa -Date: Sat, 20 Dec 2014 15:40:10 +0100 -Subject: d3dx9_36: Add stub for D3DXComputeTangentFrameEx. - ---- - dlls/d3dx9_24/d3dx9_24.spec | 2 +- - dlls/d3dx9_25/d3dx9_25.spec | 2 +- - dlls/d3dx9_26/d3dx9_26.spec | 2 +- - dlls/d3dx9_27/d3dx9_27.spec | 2 +- - dlls/d3dx9_28/d3dx9_28.spec | 2 +- - dlls/d3dx9_29/d3dx9_29.spec | 2 +- - dlls/d3dx9_30/d3dx9_30.spec | 2 +- - dlls/d3dx9_31/d3dx9_31.spec | 2 +- - dlls/d3dx9_32/d3dx9_32.spec | 2 +- - dlls/d3dx9_33/d3dx9_33.spec | 2 +- - dlls/d3dx9_34/d3dx9_34.spec | 2 +- - dlls/d3dx9_35/d3dx9_35.spec | 2 +- - dlls/d3dx9_36/d3dx9_36.spec | 2 +- - dlls/d3dx9_36/mesh.c | 20 ++++++++++++++++++++ - dlls/d3dx9_37/d3dx9_37.spec | 2 +- - dlls/d3dx9_38/d3dx9_38.spec | 2 +- - dlls/d3dx9_39/d3dx9_39.spec | 2 +- - dlls/d3dx9_40/d3dx9_40.spec | 2 +- - dlls/d3dx9_41/d3dx9_41.spec | 2 +- - dlls/d3dx9_42/d3dx9_42.spec | 2 +- - dlls/d3dx9_43/d3dx9_43.spec | 2 +- - 21 files changed, 40 insertions(+), 20 deletions(-) - -diff --git a/dlls/d3dx9_24/d3dx9_24.spec b/dlls/d3dx9_24/d3dx9_24.spec -index 0e9068c..ed77889 100644 ---- a/dlls/d3dx9_24/d3dx9_24.spec -+++ b/dlls/d3dx9_24/d3dx9_24.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_25/d3dx9_25.spec b/dlls/d3dx9_25/d3dx9_25.spec -index 0111580..2aead3d 100644 ---- a/dlls/d3dx9_25/d3dx9_25.spec -+++ b/dlls/d3dx9_25/d3dx9_25.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_26/d3dx9_26.spec b/dlls/d3dx9_26/d3dx9_26.spec -index b41f0c4..b1e5e7d 100644 ---- a/dlls/d3dx9_26/d3dx9_26.spec -+++ b/dlls/d3dx9_26/d3dx9_26.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_27/d3dx9_27.spec b/dlls/d3dx9_27/d3dx9_27.spec -index b41f0c4..b1e5e7d 100644 ---- a/dlls/d3dx9_27/d3dx9_27.spec -+++ b/dlls/d3dx9_27/d3dx9_27.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_28/d3dx9_28.spec b/dlls/d3dx9_28/d3dx9_28.spec -index e24b04a..2bc8b0b 100644 ---- a/dlls/d3dx9_28/d3dx9_28.spec -+++ b/dlls/d3dx9_28/d3dx9_28.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_29/d3dx9_29.spec b/dlls/d3dx9_29/d3dx9_29.spec -index e24b04a..2bc8b0b 100644 ---- a/dlls/d3dx9_29/d3dx9_29.spec -+++ b/dlls/d3dx9_29/d3dx9_29.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_30/d3dx9_30.spec b/dlls/d3dx9_30/d3dx9_30.spec -index 61ddf29..f182dc8 100644 ---- a/dlls/d3dx9_30/d3dx9_30.spec -+++ b/dlls/d3dx9_30/d3dx9_30.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_31/d3dx9_31.spec b/dlls/d3dx9_31/d3dx9_31.spec -index 5ddacc7..cf09a03 100644 ---- a/dlls/d3dx9_31/d3dx9_31.spec -+++ b/dlls/d3dx9_31/d3dx9_31.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_32/d3dx9_32.spec b/dlls/d3dx9_32/d3dx9_32.spec -index 7415ad6..e0cc67b 100644 ---- a/dlls/d3dx9_32/d3dx9_32.spec -+++ b/dlls/d3dx9_32/d3dx9_32.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_33/d3dx9_33.spec b/dlls/d3dx9_33/d3dx9_33.spec -index 7415ad6..e0cc67b 100644 ---- a/dlls/d3dx9_33/d3dx9_33.spec -+++ b/dlls/d3dx9_33/d3dx9_33.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_34/d3dx9_34.spec b/dlls/d3dx9_34/d3dx9_34.spec -index 7415ad6..e0cc67b 100644 ---- a/dlls/d3dx9_34/d3dx9_34.spec -+++ b/dlls/d3dx9_34/d3dx9_34.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_35/d3dx9_35.spec b/dlls/d3dx9_35/d3dx9_35.spec -index 7415ad6..e0cc67b 100644 ---- a/dlls/d3dx9_35/d3dx9_35.spec -+++ b/dlls/d3dx9_35/d3dx9_35.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec -index 13f0d99..54f57c9 100644 ---- a/dlls/d3dx9_36/d3dx9_36.spec -+++ b/dlls/d3dx9_36/d3dx9_36.spec -@@ -26,7 +26,7 @@ - @ stub D3DXComputeNormals(ptr ptr) - @ stub D3DXComputeTangent(ptr long long long long ptr) - @ stub D3DXComputeTangentFrame(ptr long) --@ stub D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) - @ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) - @ stub D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) - @ stub D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) -diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c -index 6f268f2..39ee53b 100644 ---- a/dlls/d3dx9_36/mesh.c -+++ b/dlls/d3dx9_36/mesh.c -@@ -7234,3 +7234,23 @@ HRESULT WINAPI D3DXOptimizeFaces(const void *indices, UINT num_faces, - error: - return hr; - } -+ -+/************************************************************************* -+ * D3DXComputeTangentFrameEx (D3DX9_36.@) -+ */ -+HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *Mesh, DWORD TextureInSemantic, DWORD TextureInIndex, -+ DWORD UPartialOutSemantic, DWORD UPartialOutIndex, DWORD VPartialOutSemantic, DWORD VPartialOutIndex, -+ DWORD NormalOutSemantic, DWORD NormalOutIndex, DWORD options, const DWORD *adjacency, -+ FLOAT PartialEdgeThreshold, FLOAT SingularPointThreshold, FLOAT NormalEdgeThreshold, -+ ID3DXMesh **MeshOut, ID3DXBuffer **VertexMapping) -+{ -+ FIXME("Mesh %p, TextureInSemantic %u, TextureInIndex %u, UPartialOutSemantic %u, UPartialOutIndex %u, " -+ "VPartialOutSemantic %u, VPartialOutIndex %u, NormalOutSemantic %u, NormalOutIndex %u, " -+ "options %x, adjacency %p, PartialEdgeThreshold %f, SingularPointThreshold %f, NormalEdgeThreshold %f, " -+ "MeshOut %p, VertexMapping %p stub.\n", -+ Mesh, TextureInSemantic, TextureInIndex, UPartialOutSemantic, UPartialOutIndex, VPartialOutSemantic, -+ VPartialOutIndex, NormalOutSemantic, NormalOutIndex, options, adjacency, PartialEdgeThreshold, -+ SingularPointThreshold, NormalEdgeThreshold, MeshOut, VertexMapping); -+ -+ return E_NOTIMPL; -+} -diff --git a/dlls/d3dx9_37/d3dx9_37.spec b/dlls/d3dx9_37/d3dx9_37.spec -index cc5d8fe..2200281 100644 ---- a/dlls/d3dx9_37/d3dx9_37.spec -+++ b/dlls/d3dx9_37/d3dx9_37.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_38/d3dx9_38.spec b/dlls/d3dx9_38/d3dx9_38.spec -index cc5d8fe..2200281 100644 ---- a/dlls/d3dx9_38/d3dx9_38.spec -+++ b/dlls/d3dx9_38/d3dx9_38.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_39/d3dx9_39.spec b/dlls/d3dx9_39/d3dx9_39.spec -index cc5d8fe..2200281 100644 ---- a/dlls/d3dx9_39/d3dx9_39.spec -+++ b/dlls/d3dx9_39/d3dx9_39.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_40/d3dx9_40.spec b/dlls/d3dx9_40/d3dx9_40.spec -index cc5d8fe..2200281 100644 ---- a/dlls/d3dx9_40/d3dx9_40.spec -+++ b/dlls/d3dx9_40/d3dx9_40.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_41/d3dx9_41.spec b/dlls/d3dx9_41/d3dx9_41.spec -index cc5d8fe..2200281 100644 ---- a/dlls/d3dx9_41/d3dx9_41.spec -+++ b/dlls/d3dx9_41/d3dx9_41.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_42/d3dx9_42.spec b/dlls/d3dx9_42/d3dx9_42.spec -index cc5d8fe..2200281 100644 ---- a/dlls/d3dx9_42/d3dx9_42.spec -+++ b/dlls/d3dx9_42/d3dx9_42.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -diff --git a/dlls/d3dx9_43/d3dx9_43.spec b/dlls/d3dx9_43/d3dx9_43.spec -index 0cb9e31..40406a4 100644 ---- a/dlls/d3dx9_43/d3dx9_43.spec -+++ b/dlls/d3dx9_43/d3dx9_43.spec -@@ -26,7 +26,7 @@ - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx -+@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) d3dx9_36.D3DXComputeTangentFrameEx - @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes - @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip - @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0001-d3dx9_36-Implement-D3DXComputeNormals.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0001-d3dx9_36-Implement-D3DXComputeNormals.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0001-d3dx9_36-Implement-D3DXComputeNormals.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0001-d3dx9_36-Implement-D3DXComputeNormals.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,49 @@ +From eddb306156f3f71f93bea0efe268ef5bdc95db7f Mon Sep 17 00:00:00 2001 +From: Christian Costa +Date: Wed, 31 Dec 2014 18:22:26 +0100 +Subject: d3dx9_36: Implement D3DXComputeNormals. + +--- + dlls/d3dx9_36/d3dx9_36.spec | 2 +- + dlls/d3dx9_36/mesh.c | 12 ++++++++++++ + 2 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec +index 575d0ca..0c24882b 100644 +--- a/dlls/d3dx9_36/d3dx9_36.spec ++++ b/dlls/d3dx9_36/d3dx9_36.spec +@@ -23,7 +23,7 @@ + @ stub D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) + @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) + @ stub D3DXComputeNormalMap(ptr ptr ptr long long long) +-@ stub D3DXComputeNormals(ptr ptr) ++@ stdcall D3DXComputeNormals(ptr ptr) + @ stub D3DXComputeTangent(ptr long long long long ptr) + @ stub D3DXComputeTangentFrame(ptr long) + @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) +diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c +index 4aeac26..29250cc 100644 +--- a/dlls/d3dx9_36/mesh.c ++++ b/dlls/d3dx9_36/mesh.c +@@ -7256,6 +7256,18 @@ HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *mesh, DWORD texture_in_seman + } + + /************************************************************************* ++ * D3DXComputeNormals (D3DX9_36.@) ++ */ ++HRESULT WINAPI D3DXComputeNormals(ID3DXBaseMesh *mesh, const DWORD *adjacency) ++{ ++ TRACE("mesh %p, adjacency %p.\n", mesh, adjacency); ++ ++ return D3DXComputeTangentFrameEx((ID3DXMesh *)mesh, D3DX_DEFAULT, 0, D3DX_DEFAULT, 0, D3DX_DEFAULT, 0, ++ D3DDECLUSAGE_NORMAL, 0, D3DXTANGENT_GENERATE_IN_PLACE | D3DXTANGENT_CALCULATE_NORMALS, ++ adjacency, -1.01f, -0.01f, -1.01f, NULL, NULL); ++} ++ ++/************************************************************************* + * D3DXIntersect (D3DX9_36.@) + */ + HRESULT WINAPI D3DXIntersect(ID3DXBaseMesh *mesh, const D3DXVECTOR3 *ray_pos, const D3DXVECTOR3 *ray_dir, +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0002-d3dx9_36-Add-stub-for-D3DXComputeNormalMap.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0002-d3dx9_36-Add-stub-for-D3DXComputeNormalMap.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0002-d3dx9_36-Add-stub-for-D3DXComputeNormalMap.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0002-d3dx9_36-Add-stub-for-D3DXComputeNormalMap.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,315 @@ +From 0716f14fd6b059f299494ff53d56ee2325ce1cdf Mon Sep 17 00:00:00 2001 +From: Christian Costa +Date: Wed, 31 Dec 2014 18:45:24 +0100 +Subject: d3dx9_36: Add stub for D3DXComputeNormalMap. + +--- + dlls/d3dx9_24/d3dx9_24.spec | 2 +- + dlls/d3dx9_25/d3dx9_25.spec | 2 +- + dlls/d3dx9_26/d3dx9_26.spec | 2 +- + dlls/d3dx9_27/d3dx9_27.spec | 2 +- + dlls/d3dx9_28/d3dx9_28.spec | 2 +- + dlls/d3dx9_29/d3dx9_29.spec | 2 +- + dlls/d3dx9_30/d3dx9_30.spec | 2 +- + dlls/d3dx9_31/d3dx9_31.spec | 2 +- + dlls/d3dx9_32/d3dx9_32.spec | 2 +- + dlls/d3dx9_33/d3dx9_33.spec | 2 +- + dlls/d3dx9_34/d3dx9_34.spec | 2 +- + dlls/d3dx9_35/d3dx9_35.spec | 2 +- + dlls/d3dx9_36/d3dx9_36.spec | 2 +- + dlls/d3dx9_36/mesh.c | 12 ++++++++++++ + dlls/d3dx9_37/d3dx9_37.spec | 2 +- + dlls/d3dx9_38/d3dx9_38.spec | 2 +- + dlls/d3dx9_39/d3dx9_39.spec | 2 +- + dlls/d3dx9_40/d3dx9_40.spec | 2 +- + dlls/d3dx9_41/d3dx9_41.spec | 2 +- + dlls/d3dx9_42/d3dx9_42.spec | 2 +- + dlls/d3dx9_43/d3dx9_43.spec | 2 +- + 21 files changed, 32 insertions(+), 20 deletions(-) + +diff --git a/dlls/d3dx9_24/d3dx9_24.spec b/dlls/d3dx9_24/d3dx9_24.spec +index 0dcca42..d54c3f4 100644 +--- a/dlls/d3dx9_24/d3dx9_24.spec ++++ b/dlls/d3dx9_24/d3dx9_24.spec +@@ -18,7 +18,7 @@ + @ stdcall D3DXCompileShaderFromResourceW(ptr wstr ptr ptr str str long ptr ptr ptr) d3dx9_36.D3DXCompileShaderFromResourceW + @ stdcall D3DXComputeBoundingBox(ptr long long ptr ptr) d3dx9_36.D3DXComputeBoundingBox + @ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr) d3dx9_36.D3DXComputeBoundingSphere +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_25/d3dx9_25.spec b/dlls/d3dx9_25/d3dx9_25.spec +index 7975803..699c212 100644 +--- a/dlls/d3dx9_25/d3dx9_25.spec ++++ b/dlls/d3dx9_25/d3dx9_25.spec +@@ -18,7 +18,7 @@ + @ stdcall D3DXCompileShaderFromResourceW(ptr wstr ptr ptr str str long ptr ptr ptr) d3dx9_36.D3DXCompileShaderFromResourceW + @ stdcall D3DXComputeBoundingBox(ptr long long ptr ptr) d3dx9_36.D3DXComputeBoundingBox + @ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr) d3dx9_36.D3DXComputeBoundingSphere +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_26/d3dx9_26.spec b/dlls/d3dx9_26/d3dx9_26.spec +index 1d7b802..827a3f3 100644 +--- a/dlls/d3dx9_26/d3dx9_26.spec ++++ b/dlls/d3dx9_26/d3dx9_26.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_27/d3dx9_27.spec b/dlls/d3dx9_27/d3dx9_27.spec +index 1d7b802..827a3f3 100644 +--- a/dlls/d3dx9_27/d3dx9_27.spec ++++ b/dlls/d3dx9_27/d3dx9_27.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_28/d3dx9_28.spec b/dlls/d3dx9_28/d3dx9_28.spec +index 083667c..c602d1d 100644 +--- a/dlls/d3dx9_28/d3dx9_28.spec ++++ b/dlls/d3dx9_28/d3dx9_28.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_29/d3dx9_29.spec b/dlls/d3dx9_29/d3dx9_29.spec +index 083667c..c602d1d 100644 +--- a/dlls/d3dx9_29/d3dx9_29.spec ++++ b/dlls/d3dx9_29/d3dx9_29.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_30/d3dx9_30.spec b/dlls/d3dx9_30/d3dx9_30.spec +index eb39c0f..bb28fad 100644 +--- a/dlls/d3dx9_30/d3dx9_30.spec ++++ b/dlls/d3dx9_30/d3dx9_30.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_31/d3dx9_31.spec b/dlls/d3dx9_31/d3dx9_31.spec +index 1667a51..2cfa618 100644 +--- a/dlls/d3dx9_31/d3dx9_31.spec ++++ b/dlls/d3dx9_31/d3dx9_31.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_32/d3dx9_32.spec b/dlls/d3dx9_32/d3dx9_32.spec +index f1c4b62..1889a47 100644 +--- a/dlls/d3dx9_32/d3dx9_32.spec ++++ b/dlls/d3dx9_32/d3dx9_32.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_33/d3dx9_33.spec b/dlls/d3dx9_33/d3dx9_33.spec +index f1c4b62..1889a47 100644 +--- a/dlls/d3dx9_33/d3dx9_33.spec ++++ b/dlls/d3dx9_33/d3dx9_33.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_34/d3dx9_34.spec b/dlls/d3dx9_34/d3dx9_34.spec +index f1c4b62..1889a47 100644 +--- a/dlls/d3dx9_34/d3dx9_34.spec ++++ b/dlls/d3dx9_34/d3dx9_34.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_35/d3dx9_35.spec b/dlls/d3dx9_35/d3dx9_35.spec +index f1c4b62..1889a47 100644 +--- a/dlls/d3dx9_35/d3dx9_35.spec ++++ b/dlls/d3dx9_35/d3dx9_35.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec +index 0c24882b..e3bb568 100644 +--- a/dlls/d3dx9_36/d3dx9_36.spec ++++ b/dlls/d3dx9_36/d3dx9_36.spec +@@ -22,7 +22,7 @@ + @ stub D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) + @ stub D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) + @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) +-@ stub D3DXComputeNormalMap(ptr ptr ptr long long long) ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) + @ stdcall D3DXComputeNormals(ptr ptr) + @ stub D3DXComputeTangent(ptr long long long long ptr) + @ stub D3DXComputeTangentFrame(ptr long) +diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c +index 29250cc..2647ace 100644 +--- a/dlls/d3dx9_36/mesh.c ++++ b/dlls/d3dx9_36/mesh.c +@@ -7268,6 +7268,18 @@ HRESULT WINAPI D3DXComputeNormals(ID3DXBaseMesh *mesh, const DWORD *adjacency) + } + + /************************************************************************* ++ * D3DXComputeNormalMap (D3DX9_36.@) ++ */ ++HRESULT WINAPI D3DXComputeNormalMap(IDirect3DTexture9 *texture, IDirect3DTexture9 *src_texture, ++ const PALETTEENTRY *src_palette, DWORD flags, DWORD channel, FLOAT amplitude) ++{ ++ FIXME("texture %p, src_texture %p, src_palette %p, flags %#x, channel %u, amplitude %f stub.\n", ++ texture, src_texture, src_palette, flags, channel, amplitude); ++ ++ return D3D_OK; ++} ++ ++/************************************************************************* + * D3DXIntersect (D3DX9_36.@) + */ + HRESULT WINAPI D3DXIntersect(ID3DXBaseMesh *mesh, const D3DXVECTOR3 *ray_pos, const D3DXVECTOR3 *ray_dir, +diff --git a/dlls/d3dx9_37/d3dx9_37.spec b/dlls/d3dx9_37/d3dx9_37.spec +index 324855e..f5508c2 100644 +--- a/dlls/d3dx9_37/d3dx9_37.spec ++++ b/dlls/d3dx9_37/d3dx9_37.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_38/d3dx9_38.spec b/dlls/d3dx9_38/d3dx9_38.spec +index 324855e..f5508c2 100644 +--- a/dlls/d3dx9_38/d3dx9_38.spec ++++ b/dlls/d3dx9_38/d3dx9_38.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_39/d3dx9_39.spec b/dlls/d3dx9_39/d3dx9_39.spec +index 324855e..f5508c2 100644 +--- a/dlls/d3dx9_39/d3dx9_39.spec ++++ b/dlls/d3dx9_39/d3dx9_39.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_40/d3dx9_40.spec b/dlls/d3dx9_40/d3dx9_40.spec +index 324855e..f5508c2 100644 +--- a/dlls/d3dx9_40/d3dx9_40.spec ++++ b/dlls/d3dx9_40/d3dx9_40.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_41/d3dx9_41.spec b/dlls/d3dx9_41/d3dx9_41.spec +index 324855e..f5508c2 100644 +--- a/dlls/d3dx9_41/d3dx9_41.spec ++++ b/dlls/d3dx9_41/d3dx9_41.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_42/d3dx9_42.spec b/dlls/d3dx9_42/d3dx9_42.spec +index 324855e..f5508c2 100644 +--- a/dlls/d3dx9_42/d3dx9_42.spec ++++ b/dlls/d3dx9_42/d3dx9_42.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +diff --git a/dlls/d3dx9_43/d3dx9_43.spec b/dlls/d3dx9_43/d3dx9_43.spec +index 9da1640..21d2cb4 100644 +--- a/dlls/d3dx9_43/d3dx9_43.spec ++++ b/dlls/d3dx9_43/d3dx9_43.spec +@@ -22,7 +22,7 @@ + @ stdcall D3DXComputeIMTFromPerVertexSignal(ptr ptr long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerVertexSignal + @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal + @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture +-@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap ++@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap + @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals + @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent + @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0002-d3dx9_36-Add-stub-for-D3DXIntersect.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0002-d3dx9_36-Add-stub-for-D3DXIntersect.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0002-d3dx9_36-Add-stub-for-D3DXIntersect.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0002-d3dx9_36-Add-stub-for-D3DXIntersect.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -From dee29ce2f8e464e88a3235e3691f6891082a2fdb Mon Sep 17 00:00:00 2001 -From: Christian Costa -Date: Sat, 20 Dec 2014 16:28:58 +0100 -Subject: d3dx9_36: Add stub for D3DXIntersect. - ---- - dlls/d3dx9_36/d3dx9_36.spec | 2 +- - dlls/d3dx9_36/mesh.c | 12 ++++++++++++ - 2 files changed, 13 insertions(+), 1 deletion(-) - -diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec -index 54f57c9..be5f819 100644 ---- a/dlls/d3dx9_36/d3dx9_36.spec -+++ b/dlls/d3dx9_36/d3dx9_36.spec -@@ -165,7 +165,7 @@ - @ stdcall D3DXGetShaderSize(ptr) - @ stdcall D3DXGetShaderVersion(ptr) - @ stdcall D3DXGetVertexShaderProfile(ptr) --@ stub D3DXIntersect(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) -+@ stdcall D3DXIntersect(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) - @ stub D3DXIntersectSubset(ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr) - @ stdcall D3DXIntersectTri(ptr ptr ptr ptr ptr ptr ptr ptr) - @ stdcall D3DXLoadMeshFromXA(str long ptr ptr ptr ptr ptr ptr) -diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c -index 39ee53b..5e6d267 100644 ---- a/dlls/d3dx9_36/mesh.c -+++ b/dlls/d3dx9_36/mesh.c -@@ -7254,3 +7254,15 @@ HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *Mesh, DWORD TextureInSemanti - - return E_NOTIMPL; - } -+ -+/************************************************************************* -+ * D3DXIntersect (D3DX9_36.@) -+ */ -+HRESULT WINAPI D3DXIntersect(ID3DXBaseMesh *Mesh, const D3DXVECTOR3 *RayPos, const D3DXVECTOR3 *RayDir, BOOL *Hit, -+ DWORD *FaceIndex, FLOAT *U, FLOAT *V, FLOAT *Dist, ID3DXBuffer **AllHits, DWORD *CountOfHits) -+{ -+ FIXME("Mesh %p, RayPos %p, RayDir %p, Hit %p, FaceIndex %p, U %p, V %p, Dist %p, AllHits %p, CountOfHits %p stub.\n", -+ Mesh, RayPos, RayDir, Hit, FaceIndex, U, V, Dist, AllHits, CountOfHits); -+ -+ return E_NOTIMPL; -+} --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0003-d3dx9_36-Add-D3DXFrameFind-stub.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0003-d3dx9_36-Add-D3DXFrameFind-stub.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0003-d3dx9_36-Add-D3DXFrameFind-stub.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0003-d3dx9_36-Add-D3DXFrameFind-stub.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,309 @@ +From 9a06378123e28e76159fc9ac2b199abdedbda30a Mon Sep 17 00:00:00 2001 +From: Andrey Gusev +Date: Wed, 1 Apr 2015 20:59:49 +0300 +Subject: d3dx9_36: Add D3DXFrameFind stub. + +--- + dlls/d3dx9_24/d3dx9_24.spec | 2 +- + dlls/d3dx9_25/d3dx9_25.spec | 2 +- + dlls/d3dx9_26/d3dx9_26.spec | 2 +- + dlls/d3dx9_27/d3dx9_27.spec | 2 +- + dlls/d3dx9_28/d3dx9_28.spec | 2 +- + dlls/d3dx9_29/d3dx9_29.spec | 2 +- + dlls/d3dx9_30/d3dx9_30.spec | 2 +- + dlls/d3dx9_31/d3dx9_31.spec | 2 +- + dlls/d3dx9_32/d3dx9_32.spec | 2 +- + dlls/d3dx9_33/d3dx9_33.spec | 2 +- + dlls/d3dx9_34/d3dx9_34.spec | 2 +- + dlls/d3dx9_35/d3dx9_35.spec | 2 +- + dlls/d3dx9_36/d3dx9_36.spec | 2 +- + dlls/d3dx9_36/mesh.c | 6 ++++++ + dlls/d3dx9_37/d3dx9_37.spec | 2 +- + dlls/d3dx9_38/d3dx9_38.spec | 2 +- + dlls/d3dx9_39/d3dx9_39.spec | 2 +- + dlls/d3dx9_40/d3dx9_40.spec | 2 +- + dlls/d3dx9_41/d3dx9_41.spec | 2 +- + dlls/d3dx9_42/d3dx9_42.spec | 2 +- + dlls/d3dx9_43/d3dx9_43.spec | 2 +- + 21 files changed, 26 insertions(+), 20 deletions(-) + +diff --git a/dlls/d3dx9_24/d3dx9_24.spec b/dlls/d3dx9_24/d3dx9_24.spec +index d54c3f4..c79e778 100644 +--- a/dlls/d3dx9_24/d3dx9_24.spec ++++ b/dlls/d3dx9_24/d3dx9_24.spec +@@ -131,7 +131,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_25/d3dx9_25.spec b/dlls/d3dx9_25/d3dx9_25.spec +index 699c212..8244c77 100644 +--- a/dlls/d3dx9_25/d3dx9_25.spec ++++ b/dlls/d3dx9_25/d3dx9_25.spec +@@ -131,7 +131,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_26/d3dx9_26.spec b/dlls/d3dx9_26/d3dx9_26.spec +index 827a3f3..5b8528b 100644 +--- a/dlls/d3dx9_26/d3dx9_26.spec ++++ b/dlls/d3dx9_26/d3dx9_26.spec +@@ -135,7 +135,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_27/d3dx9_27.spec b/dlls/d3dx9_27/d3dx9_27.spec +index 827a3f3..5b8528b 100644 +--- a/dlls/d3dx9_27/d3dx9_27.spec ++++ b/dlls/d3dx9_27/d3dx9_27.spec +@@ -135,7 +135,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_28/d3dx9_28.spec b/dlls/d3dx9_28/d3dx9_28.spec +index c602d1d..c62b334 100644 +--- a/dlls/d3dx9_28/d3dx9_28.spec ++++ b/dlls/d3dx9_28/d3dx9_28.spec +@@ -135,7 +135,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_29/d3dx9_29.spec b/dlls/d3dx9_29/d3dx9_29.spec +index c602d1d..c62b334 100644 +--- a/dlls/d3dx9_29/d3dx9_29.spec ++++ b/dlls/d3dx9_29/d3dx9_29.spec +@@ -135,7 +135,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_30/d3dx9_30.spec b/dlls/d3dx9_30/d3dx9_30.spec +index bb28fad..365bd5b 100644 +--- a/dlls/d3dx9_30/d3dx9_30.spec ++++ b/dlls/d3dx9_30/d3dx9_30.spec +@@ -135,7 +135,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_31/d3dx9_31.spec b/dlls/d3dx9_31/d3dx9_31.spec +index 2cfa618..5133705 100644 +--- a/dlls/d3dx9_31/d3dx9_31.spec ++++ b/dlls/d3dx9_31/d3dx9_31.spec +@@ -134,7 +134,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_32/d3dx9_32.spec b/dlls/d3dx9_32/d3dx9_32.spec +index 1889a47..b93865b 100644 +--- a/dlls/d3dx9_32/d3dx9_32.spec ++++ b/dlls/d3dx9_32/d3dx9_32.spec +@@ -134,7 +134,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_33/d3dx9_33.spec b/dlls/d3dx9_33/d3dx9_33.spec +index 1889a47..b93865b 100644 +--- a/dlls/d3dx9_33/d3dx9_33.spec ++++ b/dlls/d3dx9_33/d3dx9_33.spec +@@ -134,7 +134,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_34/d3dx9_34.spec b/dlls/d3dx9_34/d3dx9_34.spec +index 1889a47..b93865b 100644 +--- a/dlls/d3dx9_34/d3dx9_34.spec ++++ b/dlls/d3dx9_34/d3dx9_34.spec +@@ -134,7 +134,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_35/d3dx9_35.spec b/dlls/d3dx9_35/d3dx9_35.spec +index 1889a47..b93865b 100644 +--- a/dlls/d3dx9_35/d3dx9_35.spec ++++ b/dlls/d3dx9_35/d3dx9_35.spec +@@ -134,7 +134,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec +index e3bb568..ea7e74c 100644 +--- a/dlls/d3dx9_36/d3dx9_36.spec ++++ b/dlls/d3dx9_36/d3dx9_36.spec +@@ -135,7 +135,7 @@ + @ stub D3DXFrameAppendChild(ptr ptr) + @ stub D3DXFrameCalculateBoundingSphere(ptr ptr ptr) + @ stdcall D3DXFrameDestroy(ptr ptr) +-@ stub D3DXFrameFind(ptr ptr) ++@ stdcall D3DXFrameFind(ptr str) + @ stub D3DXFrameNumNamedMatrices(ptr) + @ stub D3DXFrameRegisterNamedMatrices(ptr ptr) + @ stdcall D3DXFresnelTerm(float float) +diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c +index 2647ace..02931c7 100644 +--- a/dlls/d3dx9_36/mesh.c ++++ b/dlls/d3dx9_36/mesh.c +@@ -4044,6 +4044,12 @@ HRESULT WINAPI D3DXFrameDestroy(D3DXFRAME *frame, ID3DXAllocateHierarchy *alloc_ + return D3D_OK; + } + ++D3DXFRAME* WINAPI D3DXFrameFind(const D3DXFRAME *frame_root, const char *name) ++{ ++ FIXME("frame_root %p, name %s stub.\n", frame_root, debugstr_a(name)); ++ return NULL; ++} ++ + HRESULT WINAPI D3DXLoadMeshFromXA(const char *filename, DWORD options, struct IDirect3DDevice9 *device, + struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, + DWORD *num_materials, struct ID3DXMesh **mesh) +diff --git a/dlls/d3dx9_37/d3dx9_37.spec b/dlls/d3dx9_37/d3dx9_37.spec +index f5508c2..9a5ed88 100644 +--- a/dlls/d3dx9_37/d3dx9_37.spec ++++ b/dlls/d3dx9_37/d3dx9_37.spec +@@ -135,7 +135,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_38/d3dx9_38.spec b/dlls/d3dx9_38/d3dx9_38.spec +index f5508c2..9a5ed88 100644 +--- a/dlls/d3dx9_38/d3dx9_38.spec ++++ b/dlls/d3dx9_38/d3dx9_38.spec +@@ -135,7 +135,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_39/d3dx9_39.spec b/dlls/d3dx9_39/d3dx9_39.spec +index f5508c2..9a5ed88 100644 +--- a/dlls/d3dx9_39/d3dx9_39.spec ++++ b/dlls/d3dx9_39/d3dx9_39.spec +@@ -135,7 +135,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_40/d3dx9_40.spec b/dlls/d3dx9_40/d3dx9_40.spec +index f5508c2..9a5ed88 100644 +--- a/dlls/d3dx9_40/d3dx9_40.spec ++++ b/dlls/d3dx9_40/d3dx9_40.spec +@@ -135,7 +135,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_41/d3dx9_41.spec b/dlls/d3dx9_41/d3dx9_41.spec +index f5508c2..9a5ed88 100644 +--- a/dlls/d3dx9_41/d3dx9_41.spec ++++ b/dlls/d3dx9_41/d3dx9_41.spec +@@ -135,7 +135,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_42/d3dx9_42.spec b/dlls/d3dx9_42/d3dx9_42.spec +index f5508c2..9a5ed88 100644 +--- a/dlls/d3dx9_42/d3dx9_42.spec ++++ b/dlls/d3dx9_42/d3dx9_42.spec +@@ -135,7 +135,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +diff --git a/dlls/d3dx9_43/d3dx9_43.spec b/dlls/d3dx9_43/d3dx9_43.spec +index 21d2cb4..122dff4 100644 +--- a/dlls/d3dx9_43/d3dx9_43.spec ++++ b/dlls/d3dx9_43/d3dx9_43.spec +@@ -133,7 +133,7 @@ + @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild + @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere + @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy +-@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind ++@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind + @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices + @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices + @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0003-d3dx9_36-Implement-D3DXComputeNormals.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0003-d3dx9_36-Implement-D3DXComputeNormals.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0003-d3dx9_36-Implement-D3DXComputeNormals.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0003-d3dx9_36-Implement-D3DXComputeNormals.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -From ab64c3a7500e2ccccc0549c6ab1ed04746696ffb Mon Sep 17 00:00:00 2001 -From: Christian Costa -Date: Wed, 31 Dec 2014 18:22:26 +0100 -Subject: d3dx9_36: Implement D3DXComputeNormals. - ---- - dlls/d3dx9_36/d3dx9_36.spec | 2 +- - dlls/d3dx9_36/mesh.c | 12 ++++++++++++ - 2 files changed, 13 insertions(+), 1 deletion(-) - -diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec -index be5f819..4a473e6 100644 ---- a/dlls/d3dx9_36/d3dx9_36.spec -+++ b/dlls/d3dx9_36/d3dx9_36.spec -@@ -23,7 +23,7 @@ - @ stub D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) - @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) - @ stub D3DXComputeNormalMap(ptr ptr ptr long long long) --@ stub D3DXComputeNormals(ptr ptr) -+@ stdcall D3DXComputeNormals(ptr ptr) - @ stub D3DXComputeTangent(ptr long long long long ptr) - @ stub D3DXComputeTangentFrame(ptr long) - @ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr) -diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c -index 5e6d267..7c9d0e1 100644 ---- a/dlls/d3dx9_36/mesh.c -+++ b/dlls/d3dx9_36/mesh.c -@@ -7256,6 +7256,18 @@ HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *Mesh, DWORD TextureInSemanti - } - - /************************************************************************* -+ * D3DXComputeNormals (D3DX9_36.@) -+ */ -+HRESULT WINAPI D3DXComputeNormals(ID3DXBaseMesh *mesh, const DWORD *adjacency) -+{ -+ TRACE("mesh %p, adjacency %p.\n", mesh, adjacency); -+ -+ return D3DXComputeTangentFrameEx((ID3DXMesh *)mesh, D3DX_DEFAULT, 0, D3DX_DEFAULT, 0, D3DX_DEFAULT, 0, -+ D3DDECLUSAGE_NORMAL, 0, D3DXTANGENT_GENERATE_IN_PLACE | D3DXTANGENT_CALCULATE_NORMALS, -+ adjacency, -1.01f, -0.01f, -1.01f, NULL, NULL); -+} -+ -+/************************************************************************* - * D3DXIntersect (D3DX9_36.@) - */ - HRESULT WINAPI D3DXIntersect(ID3DXBaseMesh *Mesh, const D3DXVECTOR3 *RayPos, const D3DXVECTOR3 *RayDir, BOOL *Hit, --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0004-d3dx9_36-Add-D3DXTessellateNPatches-stub.-try-2.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0004-d3dx9_36-Add-D3DXTessellateNPatches-stub.-try-2.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0004-d3dx9_36-Add-D3DXTessellateNPatches-stub.-try-2.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0004-d3dx9_36-Add-D3DXTessellateNPatches-stub.-try-2.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,309 @@ +From b00b47a38266dfa4a96767015478a9284cf2a0cf Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Tue, 28 Jul 2015 19:28:49 +1000 +Subject: d3dx9_36: Add D3DXTessellateNPatches stub. (try 2) + +--- + dlls/d3dx9_24/d3dx9_24.spec | 2 +- + dlls/d3dx9_25/d3dx9_25.spec | 2 +- + dlls/d3dx9_26/d3dx9_26.spec | 2 +- + dlls/d3dx9_27/d3dx9_27.spec | 2 +- + dlls/d3dx9_28/d3dx9_28.spec | 2 +- + dlls/d3dx9_29/d3dx9_29.spec | 2 +- + dlls/d3dx9_30/d3dx9_30.spec | 2 +- + dlls/d3dx9_31/d3dx9_31.spec | 2 +- + dlls/d3dx9_32/d3dx9_32.spec | 2 +- + dlls/d3dx9_33/d3dx9_33.spec | 2 +- + dlls/d3dx9_34/d3dx9_34.spec | 2 +- + dlls/d3dx9_35/d3dx9_35.spec | 2 +- + dlls/d3dx9_36/d3dx9_36.spec | 2 +- + dlls/d3dx9_36/mesh.c | 9 +++++++++ + dlls/d3dx9_37/d3dx9_37.spec | 2 +- + dlls/d3dx9_38/d3dx9_38.spec | 2 +- + dlls/d3dx9_39/d3dx9_39.spec | 2 +- + dlls/d3dx9_40/d3dx9_40.spec | 2 +- + dlls/d3dx9_41/d3dx9_41.spec | 2 +- + dlls/d3dx9_42/d3dx9_42.spec | 2 +- + dlls/d3dx9_43/d3dx9_43.spec | 2 +- + 21 files changed, 29 insertions(+), 20 deletions(-) + +diff --git a/dlls/d3dx9_24/d3dx9_24.spec b/dlls/d3dx9_24/d3dx9_24.spec +index c79e778..3249685 100644 +--- a/dlls/d3dx9_24/d3dx9_24.spec ++++ b/dlls/d3dx9_24/d3dx9_24.spec +@@ -280,7 +280,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_25/d3dx9_25.spec b/dlls/d3dx9_25/d3dx9_25.spec +index 8244c77..f901a99 100644 +--- a/dlls/d3dx9_25/d3dx9_25.spec ++++ b/dlls/d3dx9_25/d3dx9_25.spec +@@ -280,7 +280,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_26/d3dx9_26.spec b/dlls/d3dx9_26/d3dx9_26.spec +index 5b8528b..e6a2196 100644 +--- a/dlls/d3dx9_26/d3dx9_26.spec ++++ b/dlls/d3dx9_26/d3dx9_26.spec +@@ -284,7 +284,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_27/d3dx9_27.spec b/dlls/d3dx9_27/d3dx9_27.spec +index 5b8528b..e6a2196 100644 +--- a/dlls/d3dx9_27/d3dx9_27.spec ++++ b/dlls/d3dx9_27/d3dx9_27.spec +@@ -284,7 +284,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_28/d3dx9_28.spec b/dlls/d3dx9_28/d3dx9_28.spec +index c62b334..b1ae88e 100644 +--- a/dlls/d3dx9_28/d3dx9_28.spec ++++ b/dlls/d3dx9_28/d3dx9_28.spec +@@ -289,7 +289,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_29/d3dx9_29.spec b/dlls/d3dx9_29/d3dx9_29.spec +index c62b334..b1ae88e 100644 +--- a/dlls/d3dx9_29/d3dx9_29.spec ++++ b/dlls/d3dx9_29/d3dx9_29.spec +@@ -289,7 +289,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_30/d3dx9_30.spec b/dlls/d3dx9_30/d3dx9_30.spec +index 365bd5b..c2035e2 100644 +--- a/dlls/d3dx9_30/d3dx9_30.spec ++++ b/dlls/d3dx9_30/d3dx9_30.spec +@@ -289,7 +289,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_31/d3dx9_31.spec b/dlls/d3dx9_31/d3dx9_31.spec +index 5133705..0c5976e 100644 +--- a/dlls/d3dx9_31/d3dx9_31.spec ++++ b/dlls/d3dx9_31/d3dx9_31.spec +@@ -286,7 +286,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_32/d3dx9_32.spec b/dlls/d3dx9_32/d3dx9_32.spec +index b93865b..35cb0b6 100644 +--- a/dlls/d3dx9_32/d3dx9_32.spec ++++ b/dlls/d3dx9_32/d3dx9_32.spec +@@ -291,7 +291,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_33/d3dx9_33.spec b/dlls/d3dx9_33/d3dx9_33.spec +index b93865b..35cb0b6 100644 +--- a/dlls/d3dx9_33/d3dx9_33.spec ++++ b/dlls/d3dx9_33/d3dx9_33.spec +@@ -291,7 +291,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_34/d3dx9_34.spec b/dlls/d3dx9_34/d3dx9_34.spec +index b93865b..35cb0b6 100644 +--- a/dlls/d3dx9_34/d3dx9_34.spec ++++ b/dlls/d3dx9_34/d3dx9_34.spec +@@ -291,7 +291,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_35/d3dx9_35.spec b/dlls/d3dx9_35/d3dx9_35.spec +index b93865b..35cb0b6 100644 +--- a/dlls/d3dx9_35/d3dx9_35.spec ++++ b/dlls/d3dx9_35/d3dx9_35.spec +@@ -291,7 +291,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec +index ea7e74c..3b8da67 100644 +--- a/dlls/d3dx9_36/d3dx9_36.spec ++++ b/dlls/d3dx9_36/d3dx9_36.spec +@@ -293,7 +293,7 @@ + @ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) + @ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) +-@ stub D3DXTessellateNPatches(ptr ptr long long ptr ptr) ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) + @ stub D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) + @ stub D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) + @ stub D3DXTriPatchSize(ptr ptr ptr) +diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c +index 02931c7..4e3a49e 100644 +--- a/dlls/d3dx9_36/mesh.c ++++ b/dlls/d3dx9_36/mesh.c +@@ -7296,3 +7296,12 @@ HRESULT WINAPI D3DXIntersect(ID3DXBaseMesh *mesh, const D3DXVECTOR3 *ray_pos, co + + return E_NOTIMPL; + } ++ ++HRESULT WINAPI D3DXTessellateNPatches(ID3DXMesh *mesh, const DWORD *adjacency_in, float num_segs, ++ BOOL quadratic_normals, ID3DXMesh **mesh_out, ID3DXBuffer **adjacency_out) ++{ ++ FIXME("mesh %p, adjacency_in %p, num_segs %f, quadratic_normals %d, mesh_out %p, adjacency_out %p stub.\n", ++ mesh, adjacency_in, num_segs, quadratic_normals, mesh_out, adjacency_out); ++ ++ return E_NOTIMPL; ++} +diff --git a/dlls/d3dx9_37/d3dx9_37.spec b/dlls/d3dx9_37/d3dx9_37.spec +index 9a5ed88..33ea299 100644 +--- a/dlls/d3dx9_37/d3dx9_37.spec ++++ b/dlls/d3dx9_37/d3dx9_37.spec +@@ -293,7 +293,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_38/d3dx9_38.spec b/dlls/d3dx9_38/d3dx9_38.spec +index 9a5ed88..33ea299 100644 +--- a/dlls/d3dx9_38/d3dx9_38.spec ++++ b/dlls/d3dx9_38/d3dx9_38.spec +@@ -293,7 +293,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_39/d3dx9_39.spec b/dlls/d3dx9_39/d3dx9_39.spec +index 9a5ed88..33ea299 100644 +--- a/dlls/d3dx9_39/d3dx9_39.spec ++++ b/dlls/d3dx9_39/d3dx9_39.spec +@@ -293,7 +293,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_40/d3dx9_40.spec b/dlls/d3dx9_40/d3dx9_40.spec +index 9a5ed88..33ea299 100644 +--- a/dlls/d3dx9_40/d3dx9_40.spec ++++ b/dlls/d3dx9_40/d3dx9_40.spec +@@ -293,7 +293,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_41/d3dx9_41.spec b/dlls/d3dx9_41/d3dx9_41.spec +index 9a5ed88..33ea299 100644 +--- a/dlls/d3dx9_41/d3dx9_41.spec ++++ b/dlls/d3dx9_41/d3dx9_41.spec +@@ -293,7 +293,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_42/d3dx9_42.spec b/dlls/d3dx9_42/d3dx9_42.spec +index 9a5ed88..33ea299 100644 +--- a/dlls/d3dx9_42/d3dx9_42.spec ++++ b/dlls/d3dx9_42/d3dx9_42.spec +@@ -293,7 +293,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +diff --git a/dlls/d3dx9_43/d3dx9_43.spec b/dlls/d3dx9_43/d3dx9_43.spec +index 122dff4..1a3cbea 100644 +--- a/dlls/d3dx9_43/d3dx9_43.spec ++++ b/dlls/d3dx9_43/d3dx9_43.spec +@@ -286,7 +286,7 @@ + @ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh + @ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe + @ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh +-@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx9_36.D3DXTessellateNPatches ++@ stdcall D3DXTessellateNPatches(ptr ptr float long ptr ptr) d3dx9_36.D3DXTessellateNPatches + @ stdcall D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateRectPatch + @ stdcall D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) d3dx9_36.D3DXTessellateTriPatch + @ stdcall D3DXTriPatchSize(ptr ptr ptr) d3dx9_36.D3DXTriPatchSize +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0004-d3dx9_36-Add-stub-for-D3DXComputeNormalMap.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0004-d3dx9_36-Add-stub-for-D3DXComputeNormalMap.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0004-d3dx9_36-Add-stub-for-D3DXComputeNormalMap.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0004-d3dx9_36-Add-stub-for-D3DXComputeNormalMap.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,315 +0,0 @@ -From c2fd16d732f2e94b02a53966ab2a0704466438a3 Mon Sep 17 00:00:00 2001 -From: Christian Costa -Date: Wed, 31 Dec 2014 18:45:24 +0100 -Subject: d3dx9_36: Add stub for D3DXComputeNormalMap. - ---- - dlls/d3dx9_24/d3dx9_24.spec | 2 +- - dlls/d3dx9_25/d3dx9_25.spec | 2 +- - dlls/d3dx9_26/d3dx9_26.spec | 2 +- - dlls/d3dx9_27/d3dx9_27.spec | 2 +- - dlls/d3dx9_28/d3dx9_28.spec | 2 +- - dlls/d3dx9_29/d3dx9_29.spec | 2 +- - dlls/d3dx9_30/d3dx9_30.spec | 2 +- - dlls/d3dx9_31/d3dx9_31.spec | 2 +- - dlls/d3dx9_32/d3dx9_32.spec | 2 +- - dlls/d3dx9_33/d3dx9_33.spec | 2 +- - dlls/d3dx9_34/d3dx9_34.spec | 2 +- - dlls/d3dx9_35/d3dx9_35.spec | 2 +- - dlls/d3dx9_36/d3dx9_36.spec | 2 +- - dlls/d3dx9_36/mesh.c | 12 ++++++++++++ - dlls/d3dx9_37/d3dx9_37.spec | 2 +- - dlls/d3dx9_38/d3dx9_38.spec | 2 +- - dlls/d3dx9_39/d3dx9_39.spec | 2 +- - dlls/d3dx9_40/d3dx9_40.spec | 2 +- - dlls/d3dx9_41/d3dx9_41.spec | 2 +- - dlls/d3dx9_42/d3dx9_42.spec | 2 +- - dlls/d3dx9_43/d3dx9_43.spec | 2 +- - 21 files changed, 32 insertions(+), 20 deletions(-) - -diff --git a/dlls/d3dx9_24/d3dx9_24.spec b/dlls/d3dx9_24/d3dx9_24.spec -index 0dcca42..d54c3f4 100644 ---- a/dlls/d3dx9_24/d3dx9_24.spec -+++ b/dlls/d3dx9_24/d3dx9_24.spec -@@ -18,7 +18,7 @@ - @ stdcall D3DXCompileShaderFromResourceW(ptr wstr ptr ptr str str long ptr ptr ptr) d3dx9_36.D3DXCompileShaderFromResourceW - @ stdcall D3DXComputeBoundingBox(ptr long long ptr ptr) d3dx9_36.D3DXComputeBoundingBox - @ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr) d3dx9_36.D3DXComputeBoundingSphere --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_25/d3dx9_25.spec b/dlls/d3dx9_25/d3dx9_25.spec -index 7975803..699c212 100644 ---- a/dlls/d3dx9_25/d3dx9_25.spec -+++ b/dlls/d3dx9_25/d3dx9_25.spec -@@ -18,7 +18,7 @@ - @ stdcall D3DXCompileShaderFromResourceW(ptr wstr ptr ptr str str long ptr ptr ptr) d3dx9_36.D3DXCompileShaderFromResourceW - @ stdcall D3DXComputeBoundingBox(ptr long long ptr ptr) d3dx9_36.D3DXComputeBoundingBox - @ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr) d3dx9_36.D3DXComputeBoundingSphere --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_26/d3dx9_26.spec b/dlls/d3dx9_26/d3dx9_26.spec -index 1d7b802..827a3f3 100644 ---- a/dlls/d3dx9_26/d3dx9_26.spec -+++ b/dlls/d3dx9_26/d3dx9_26.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_27/d3dx9_27.spec b/dlls/d3dx9_27/d3dx9_27.spec -index 1d7b802..827a3f3 100644 ---- a/dlls/d3dx9_27/d3dx9_27.spec -+++ b/dlls/d3dx9_27/d3dx9_27.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_28/d3dx9_28.spec b/dlls/d3dx9_28/d3dx9_28.spec -index 083667c..c602d1d 100644 ---- a/dlls/d3dx9_28/d3dx9_28.spec -+++ b/dlls/d3dx9_28/d3dx9_28.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_29/d3dx9_29.spec b/dlls/d3dx9_29/d3dx9_29.spec -index 083667c..c602d1d 100644 ---- a/dlls/d3dx9_29/d3dx9_29.spec -+++ b/dlls/d3dx9_29/d3dx9_29.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_30/d3dx9_30.spec b/dlls/d3dx9_30/d3dx9_30.spec -index eb39c0f..bb28fad 100644 ---- a/dlls/d3dx9_30/d3dx9_30.spec -+++ b/dlls/d3dx9_30/d3dx9_30.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_31/d3dx9_31.spec b/dlls/d3dx9_31/d3dx9_31.spec -index 1667a51..2cfa618 100644 ---- a/dlls/d3dx9_31/d3dx9_31.spec -+++ b/dlls/d3dx9_31/d3dx9_31.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_32/d3dx9_32.spec b/dlls/d3dx9_32/d3dx9_32.spec -index f1c4b62..1889a47 100644 ---- a/dlls/d3dx9_32/d3dx9_32.spec -+++ b/dlls/d3dx9_32/d3dx9_32.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_33/d3dx9_33.spec b/dlls/d3dx9_33/d3dx9_33.spec -index f1c4b62..1889a47 100644 ---- a/dlls/d3dx9_33/d3dx9_33.spec -+++ b/dlls/d3dx9_33/d3dx9_33.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_34/d3dx9_34.spec b/dlls/d3dx9_34/d3dx9_34.spec -index f1c4b62..1889a47 100644 ---- a/dlls/d3dx9_34/d3dx9_34.spec -+++ b/dlls/d3dx9_34/d3dx9_34.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_35/d3dx9_35.spec b/dlls/d3dx9_35/d3dx9_35.spec -index f1c4b62..1889a47 100644 ---- a/dlls/d3dx9_35/d3dx9_35.spec -+++ b/dlls/d3dx9_35/d3dx9_35.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec -index 0c24882b..e3bb568 100644 ---- a/dlls/d3dx9_36/d3dx9_36.spec -+++ b/dlls/d3dx9_36/d3dx9_36.spec -@@ -22,7 +22,7 @@ - @ stub D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) - @ stub D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) - @ stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) --@ stub D3DXComputeNormalMap(ptr ptr ptr long long long) -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) - @ stdcall D3DXComputeNormals(ptr ptr) - @ stub D3DXComputeTangent(ptr long long long long ptr) - @ stub D3DXComputeTangentFrame(ptr long) -diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c -index c42b7d5..d643b15 100644 ---- a/dlls/d3dx9_36/mesh.c -+++ b/dlls/d3dx9_36/mesh.c -@@ -7268,6 +7268,18 @@ HRESULT WINAPI D3DXComputeNormals(ID3DXBaseMesh *mesh, const DWORD *adjacency) - } - - /************************************************************************* -+ * D3DXComputeNormalMap (D3DX9_36.@) -+ */ -+HRESULT WINAPI D3DXComputeNormalMap(IDirect3DTexture9 *texture, IDirect3DTexture9 *src_texture, -+ const PALETTEENTRY *src_palette, DWORD flags, DWORD channel, FLOAT amplitude) -+{ -+ FIXME("texture %p, src_texture %p, src_palette %p, flags %#x, channel %u, amplitude %f stub.\n", -+ texture, src_texture, src_palette, flags, channel, amplitude); -+ -+ return D3D_OK; -+} -+ -+/************************************************************************* - * D3DXIntersect (D3DX9_36.@) - */ - HRESULT WINAPI D3DXIntersect(ID3DXBaseMesh *Mesh, const D3DXVECTOR3 *RayPos, const D3DXVECTOR3 *RayDir, BOOL *Hit, -diff --git a/dlls/d3dx9_37/d3dx9_37.spec b/dlls/d3dx9_37/d3dx9_37.spec -index 324855e..f5508c2 100644 ---- a/dlls/d3dx9_37/d3dx9_37.spec -+++ b/dlls/d3dx9_37/d3dx9_37.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_38/d3dx9_38.spec b/dlls/d3dx9_38/d3dx9_38.spec -index 324855e..f5508c2 100644 ---- a/dlls/d3dx9_38/d3dx9_38.spec -+++ b/dlls/d3dx9_38/d3dx9_38.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_39/d3dx9_39.spec b/dlls/d3dx9_39/d3dx9_39.spec -index 324855e..f5508c2 100644 ---- a/dlls/d3dx9_39/d3dx9_39.spec -+++ b/dlls/d3dx9_39/d3dx9_39.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_40/d3dx9_40.spec b/dlls/d3dx9_40/d3dx9_40.spec -index 324855e..f5508c2 100644 ---- a/dlls/d3dx9_40/d3dx9_40.spec -+++ b/dlls/d3dx9_40/d3dx9_40.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_41/d3dx9_41.spec b/dlls/d3dx9_41/d3dx9_41.spec -index 324855e..f5508c2 100644 ---- a/dlls/d3dx9_41/d3dx9_41.spec -+++ b/dlls/d3dx9_41/d3dx9_41.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_42/d3dx9_42.spec b/dlls/d3dx9_42/d3dx9_42.spec -index 324855e..f5508c2 100644 ---- a/dlls/d3dx9_42/d3dx9_42.spec -+++ b/dlls/d3dx9_42/d3dx9_42.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerTexelSignal(ptr long ptr long long long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerTexelSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame -diff --git a/dlls/d3dx9_43/d3dx9_43.spec b/dlls/d3dx9_43/d3dx9_43.spec -index 9da1640..21d2cb4 100644 ---- a/dlls/d3dx9_43/d3dx9_43.spec -+++ b/dlls/d3dx9_43/d3dx9_43.spec -@@ -22,7 +22,7 @@ - @ stdcall D3DXComputeIMTFromPerVertexSignal(ptr ptr long long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromPerVertexSignal - @ stdcall D3DXComputeIMTFromSignal(ptr long long long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromSignal - @ stdcall D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr) d3dx9_36.D3DXComputeIMTFromTexture --@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long long) d3dx9_36.D3DXComputeNormalMap -+@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float) d3dx9_36.D3DXComputeNormalMap - @ stdcall D3DXComputeNormals(ptr ptr) d3dx9_36.D3DXComputeNormals - @ stdcall D3DXComputeTangent(ptr long long long long ptr) d3dx9_36.D3DXComputeTangent - @ stdcall D3DXComputeTangentFrame(ptr long) d3dx9_36.D3DXComputeTangentFrame --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0005-d3dx9_36-Add-D3DXFrameFind-stub.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0005-d3dx9_36-Add-D3DXFrameFind-stub.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0005-d3dx9_36-Add-D3DXFrameFind-stub.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/0005-d3dx9_36-Add-D3DXFrameFind-stub.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,309 +0,0 @@ -From 6befe7a7b9230a78055fd539d3016c335b6d10ac Mon Sep 17 00:00:00 2001 -From: Andrey Gusev -Date: Wed, 1 Apr 2015 20:59:49 +0300 -Subject: d3dx9_36: Add D3DXFrameFind stub. - ---- - dlls/d3dx9_24/d3dx9_24.spec | 2 +- - dlls/d3dx9_25/d3dx9_25.spec | 2 +- - dlls/d3dx9_26/d3dx9_26.spec | 2 +- - dlls/d3dx9_27/d3dx9_27.spec | 2 +- - dlls/d3dx9_28/d3dx9_28.spec | 2 +- - dlls/d3dx9_29/d3dx9_29.spec | 2 +- - dlls/d3dx9_30/d3dx9_30.spec | 2 +- - dlls/d3dx9_31/d3dx9_31.spec | 2 +- - dlls/d3dx9_32/d3dx9_32.spec | 2 +- - dlls/d3dx9_33/d3dx9_33.spec | 2 +- - dlls/d3dx9_34/d3dx9_34.spec | 2 +- - dlls/d3dx9_35/d3dx9_35.spec | 2 +- - dlls/d3dx9_36/d3dx9_36.spec | 2 +- - dlls/d3dx9_36/mesh.c | 6 ++++++ - dlls/d3dx9_37/d3dx9_37.spec | 2 +- - dlls/d3dx9_38/d3dx9_38.spec | 2 +- - dlls/d3dx9_39/d3dx9_39.spec | 2 +- - dlls/d3dx9_40/d3dx9_40.spec | 2 +- - dlls/d3dx9_41/d3dx9_41.spec | 2 +- - dlls/d3dx9_42/d3dx9_42.spec | 2 +- - dlls/d3dx9_43/d3dx9_43.spec | 2 +- - 21 files changed, 26 insertions(+), 20 deletions(-) - -diff --git a/dlls/d3dx9_24/d3dx9_24.spec b/dlls/d3dx9_24/d3dx9_24.spec -index d54c3f4..c79e778 100644 ---- a/dlls/d3dx9_24/d3dx9_24.spec -+++ b/dlls/d3dx9_24/d3dx9_24.spec -@@ -131,7 +131,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_25/d3dx9_25.spec b/dlls/d3dx9_25/d3dx9_25.spec -index 699c212..8244c77 100644 ---- a/dlls/d3dx9_25/d3dx9_25.spec -+++ b/dlls/d3dx9_25/d3dx9_25.spec -@@ -131,7 +131,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_26/d3dx9_26.spec b/dlls/d3dx9_26/d3dx9_26.spec -index 827a3f3..5b8528b 100644 ---- a/dlls/d3dx9_26/d3dx9_26.spec -+++ b/dlls/d3dx9_26/d3dx9_26.spec -@@ -135,7 +135,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_27/d3dx9_27.spec b/dlls/d3dx9_27/d3dx9_27.spec -index 827a3f3..5b8528b 100644 ---- a/dlls/d3dx9_27/d3dx9_27.spec -+++ b/dlls/d3dx9_27/d3dx9_27.spec -@@ -135,7 +135,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_28/d3dx9_28.spec b/dlls/d3dx9_28/d3dx9_28.spec -index c602d1d..c62b334 100644 ---- a/dlls/d3dx9_28/d3dx9_28.spec -+++ b/dlls/d3dx9_28/d3dx9_28.spec -@@ -135,7 +135,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_29/d3dx9_29.spec b/dlls/d3dx9_29/d3dx9_29.spec -index c602d1d..c62b334 100644 ---- a/dlls/d3dx9_29/d3dx9_29.spec -+++ b/dlls/d3dx9_29/d3dx9_29.spec -@@ -135,7 +135,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_30/d3dx9_30.spec b/dlls/d3dx9_30/d3dx9_30.spec -index bb28fad..365bd5b 100644 ---- a/dlls/d3dx9_30/d3dx9_30.spec -+++ b/dlls/d3dx9_30/d3dx9_30.spec -@@ -135,7 +135,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_31/d3dx9_31.spec b/dlls/d3dx9_31/d3dx9_31.spec -index 2cfa618..5133705 100644 ---- a/dlls/d3dx9_31/d3dx9_31.spec -+++ b/dlls/d3dx9_31/d3dx9_31.spec -@@ -134,7 +134,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_32/d3dx9_32.spec b/dlls/d3dx9_32/d3dx9_32.spec -index 1889a47..b93865b 100644 ---- a/dlls/d3dx9_32/d3dx9_32.spec -+++ b/dlls/d3dx9_32/d3dx9_32.spec -@@ -134,7 +134,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_33/d3dx9_33.spec b/dlls/d3dx9_33/d3dx9_33.spec -index 1889a47..b93865b 100644 ---- a/dlls/d3dx9_33/d3dx9_33.spec -+++ b/dlls/d3dx9_33/d3dx9_33.spec -@@ -134,7 +134,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_34/d3dx9_34.spec b/dlls/d3dx9_34/d3dx9_34.spec -index 1889a47..b93865b 100644 ---- a/dlls/d3dx9_34/d3dx9_34.spec -+++ b/dlls/d3dx9_34/d3dx9_34.spec -@@ -134,7 +134,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_35/d3dx9_35.spec b/dlls/d3dx9_35/d3dx9_35.spec -index 1889a47..b93865b 100644 ---- a/dlls/d3dx9_35/d3dx9_35.spec -+++ b/dlls/d3dx9_35/d3dx9_35.spec -@@ -134,7 +134,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec -index e3bb568..ea7e74c 100644 ---- a/dlls/d3dx9_36/d3dx9_36.spec -+++ b/dlls/d3dx9_36/d3dx9_36.spec -@@ -135,7 +135,7 @@ - @ stub D3DXFrameAppendChild(ptr ptr) - @ stub D3DXFrameCalculateBoundingSphere(ptr ptr ptr) - @ stdcall D3DXFrameDestroy(ptr ptr) --@ stub D3DXFrameFind(ptr ptr) -+@ stdcall D3DXFrameFind(ptr str) - @ stub D3DXFrameNumNamedMatrices(ptr) - @ stub D3DXFrameRegisterNamedMatrices(ptr ptr) - @ stdcall D3DXFresnelTerm(float float) -diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c -index d643b15..e09c240 100644 ---- a/dlls/d3dx9_36/mesh.c -+++ b/dlls/d3dx9_36/mesh.c -@@ -4044,6 +4044,12 @@ HRESULT WINAPI D3DXFrameDestroy(D3DXFRAME *frame, ID3DXAllocateHierarchy *alloc_ - return D3D_OK; - } - -+D3DXFRAME* WINAPI D3DXFrameFind(const D3DXFRAME *frame_root, const char *name) -+{ -+ FIXME("frame_root %p, name %s stub.\n", frame_root, debugstr_a(name)); -+ return NULL; -+} -+ - HRESULT WINAPI D3DXLoadMeshFromXA(const char *filename, DWORD options, struct IDirect3DDevice9 *device, - struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, - DWORD *num_materials, struct ID3DXMesh **mesh) -diff --git a/dlls/d3dx9_37/d3dx9_37.spec b/dlls/d3dx9_37/d3dx9_37.spec -index f5508c2..9a5ed88 100644 ---- a/dlls/d3dx9_37/d3dx9_37.spec -+++ b/dlls/d3dx9_37/d3dx9_37.spec -@@ -135,7 +135,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_38/d3dx9_38.spec b/dlls/d3dx9_38/d3dx9_38.spec -index f5508c2..9a5ed88 100644 ---- a/dlls/d3dx9_38/d3dx9_38.spec -+++ b/dlls/d3dx9_38/d3dx9_38.spec -@@ -135,7 +135,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_39/d3dx9_39.spec b/dlls/d3dx9_39/d3dx9_39.spec -index f5508c2..9a5ed88 100644 ---- a/dlls/d3dx9_39/d3dx9_39.spec -+++ b/dlls/d3dx9_39/d3dx9_39.spec -@@ -135,7 +135,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_40/d3dx9_40.spec b/dlls/d3dx9_40/d3dx9_40.spec -index f5508c2..9a5ed88 100644 ---- a/dlls/d3dx9_40/d3dx9_40.spec -+++ b/dlls/d3dx9_40/d3dx9_40.spec -@@ -135,7 +135,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_41/d3dx9_41.spec b/dlls/d3dx9_41/d3dx9_41.spec -index f5508c2..9a5ed88 100644 ---- a/dlls/d3dx9_41/d3dx9_41.spec -+++ b/dlls/d3dx9_41/d3dx9_41.spec -@@ -135,7 +135,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_42/d3dx9_42.spec b/dlls/d3dx9_42/d3dx9_42.spec -index f5508c2..9a5ed88 100644 ---- a/dlls/d3dx9_42/d3dx9_42.spec -+++ b/dlls/d3dx9_42/d3dx9_42.spec -@@ -135,7 +135,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm -diff --git a/dlls/d3dx9_43/d3dx9_43.spec b/dlls/d3dx9_43/d3dx9_43.spec -index 21d2cb4..122dff4 100644 ---- a/dlls/d3dx9_43/d3dx9_43.spec -+++ b/dlls/d3dx9_43/d3dx9_43.spec -@@ -133,7 +133,7 @@ - @ stdcall D3DXFrameAppendChild(ptr ptr) d3dx9_36.D3DXFrameAppendChild - @ stdcall D3DXFrameCalculateBoundingSphere(ptr ptr ptr) d3dx9_36.D3DXFrameCalculateBoundingSphere - @ stdcall D3DXFrameDestroy(ptr ptr) d3dx9_36.D3DXFrameDestroy --@ stdcall D3DXFrameFind(ptr ptr) d3dx9_36.D3DXFrameFind -+@ stdcall D3DXFrameFind(ptr str) d3dx9_36.D3DXFrameFind - @ stdcall D3DXFrameNumNamedMatrices(ptr) d3dx9_36.D3DXFrameNumNamedMatrices - @ stdcall D3DXFrameRegisterNamedMatrices(ptr ptr) d3dx9_36.D3DXFrameRegisterNamedMatrices - @ stdcall D3DXFresnelTerm(float float) d3dx9_36.D3DXFresnelTerm --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/definition wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-D3DXStubs/definition 2015-07-29 19:51:42.000000000 +0000 @@ -1,6 +1,7 @@ -Fixes: [31984] Add stub for D3DXComputeTangentFrameEx -Fixes: Add stub for D3DXIntersect +# Fixes: [31984] Add stub for D3DXComputeTangentFrameEx +# Fixes: Add stub for D3DXIntersect Fixes: [26379] Support for D3DXComputeNormals Fixes: Add stub for D3DXComputeNormalMap Fixes: [38334] Add stub for D3DXFrameFind +Fixes: Add stub for D3DXTessellateNPatches Category: stable diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-DrawText/0001-d3dx9_36-Implement-ID3DXFontImpl_DrawText.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-DrawText/0001-d3dx9_36-Implement-ID3DXFontImpl_DrawText.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-DrawText/0001-d3dx9_36-Implement-ID3DXFontImpl_DrawText.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-DrawText/0001-d3dx9_36-Implement-ID3DXFontImpl_DrawText.patch 2015-07-29 19:51:42.000000000 +0000 @@ -1,4 +1,4 @@ -From 4d6d770eb49046728e4262f796b1d1dd597d288d Mon Sep 17 00:00:00 2001 +From e8e425059101d8c719a8aea674f1c1da3d9a1085 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Sun, 26 May 2013 19:42:08 +0200 Subject: d3dx9_36: Implement ID3DXFontImpl_DrawText. @@ -21,7 +21,7 @@ 1 file changed, 210 insertions(+), 19 deletions(-) diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c -index dd1243e..368c784 100644 +index dd1243e..7152dab 100644 --- a/dlls/d3dx9_36/font.c +++ b/dlls/d3dx9_36/font.c @@ -36,8 +36,29 @@ struct d3dx_font @@ -97,7 +97,7 @@ iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color); - return 1; + -+ if (!string || !count) ++ if (!string || count <= 0) + return 0; + + countW = MultiByteToWideChar(CP_ACP, 0, string, count, NULL, 0); @@ -124,7 +124,7 @@ iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color); - return 1; + -+ if (!string || !count) ++ if (!string || count <= 0) + return 0; + + /* Strip terminating NULL characters */ @@ -329,5 +329,5 @@ return D3D_OK; } -- -2.2.1 +2.4.5 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-Dummy_Skininfo/0001-d3dx9_36-Return-dummy-skininfo-interface-in-D3DXLoad.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-Dummy_Skininfo/0001-d3dx9_36-Return-dummy-skininfo-interface-in-D3DXLoad.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-Dummy_Skininfo/0001-d3dx9_36-Return-dummy-skininfo-interface-in-D3DXLoad.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-Dummy_Skininfo/0001-d3dx9_36-Return-dummy-skininfo-interface-in-D3DXLoad.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,81 @@ +From 95b6016b7cfb62a70ec9bbcc39117f68259aa93b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Tue, 28 Jul 2015 17:26:09 +0200 +Subject: d3dx9_36: Return dummy skininfo interface in D3DXLoadSkinMeshFromXof + when skin information is unavailable. + +--- + dlls/d3dx9_36/d3dx9_36_private.h | 2 ++ + dlls/d3dx9_36/mesh.c | 7 +++++++ + dlls/d3dx9_36/skin.c | 22 +++++++++++++++++++++- + 3 files changed, 30 insertions(+), 1 deletion(-) + +diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h +index 79f3b76..b6707f6 100644 +--- a/dlls/d3dx9_36/d3dx9_36_private.h ++++ b/dlls/d3dx9_36/d3dx9_36_private.h +@@ -110,4 +110,6 @@ const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r) DECLSPEC_HIDDEN; + void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, + const void *indata, D3DXPARAMETER_TYPE intype) DECLSPEC_HIDDEN; + ++HRESULT create_dummy_skin(ID3DXSkinInfo **iface) DECLSPEC_HIDDEN; ++ + #endif /* __WINE_D3DX9_36_PRIVATE_H */ +diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c +index 4aeac26..3cd85a3 100644 +--- a/dlls/d3dx9_36/mesh.c ++++ b/dlls/d3dx9_36/mesh.c +@@ -3334,6 +3334,13 @@ static HRESULT parse_mesh(ID3DXFileData *filedata, struct mesh_data *mesh_data, + goto end; + } + ++ if ((provide_flags & PROVIDE_SKININFO) && !mesh_data->skin_info) ++ { ++ hr = create_dummy_skin(&mesh_data->skin_info); ++ if (FAILED(hr)) ++ goto end; ++ } ++ + hr = D3D_OK; + + end: +diff --git a/dlls/d3dx9_36/skin.c b/dlls/d3dx9_36/skin.c +index 9b93af6..3d68829 100644 +--- a/dlls/d3dx9_36/skin.c ++++ b/dlls/d3dx9_36/skin.c +@@ -92,7 +92,7 @@ static ULONG WINAPI d3dx9_skin_info_Release(ID3DXSkinInfo *iface) + HeapFree(GetProcessHeap(), 0, skin->bones[i].vertices); + HeapFree(GetProcessHeap(), 0, skin->bones[i].weights); + } +- HeapFree(GetProcessHeap(), 0, skin->bones); ++ if (skin->bones) HeapFree(GetProcessHeap(), 0, skin->bones); + HeapFree(GetProcessHeap(), 0, skin); + } + +@@ -493,3 +493,23 @@ HRESULT WINAPI D3DXCreateSkinInfoFVF(DWORD num_vertices, DWORD fvf, DWORD num_bo + + return D3DXCreateSkinInfo(num_vertices, declaration, num_bones, skin_info); + } ++ ++HRESULT create_dummy_skin(ID3DXSkinInfo **iface) ++{ ++ static const D3DVERTEXELEMENT9 empty_declaration = D3DDECL_END(); ++ struct d3dx9_skin_info *object = NULL; ++ ++ object = HeapAlloc(GetProcessHeap(), 0, sizeof(*object)); ++ if (!object) return E_OUTOFMEMORY; ++ ++ object->ID3DXSkinInfo_iface.lpVtbl = &d3dx9_skin_info_vtbl; ++ object->ref = 1; ++ object->num_vertices = 0; ++ object->num_bones = 0; ++ object->vertex_declaration[0] = empty_declaration; ++ object->fvf = 0; ++ object->bones = NULL; ++ ++ *iface = &object->ID3DXSkinInfo_iface; ++ return D3D_OK; ++} +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-Dummy_Skininfo/0002-d3dx9_36-tests-Add-initial-tests-for-dummy-skininfo-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-Dummy_Skininfo/0002-d3dx9_36-tests-Add-initial-tests-for-dummy-skininfo-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-Dummy_Skininfo/0002-d3dx9_36-tests-Add-initial-tests-for-dummy-skininfo-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-Dummy_Skininfo/0002-d3dx9_36-tests-Add-initial-tests-for-dummy-skininfo-.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,164 @@ +From f54e1b037a6d3ecb97623d930e71d14d1309ba2f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Tue, 28 Jul 2015 17:34:40 +0200 +Subject: d3dx9_36/tests: Add initial tests for dummy skininfo interface. + +--- + dlls/d3dx9_36/tests/mesh.c | 127 +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 127 insertions(+) + +diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c +index dac0f60..62e7113 100644 +--- a/dlls/d3dx9_36/tests/mesh.c ++++ b/dlls/d3dx9_36/tests/mesh.c +@@ -25,6 +25,9 @@ + #include + #include "wine/test.h" + #include "d3dx9.h" ++#include "initguid.h" ++#include "rmxftmpl.h" ++#include "rmxfguid.h" + + #ifndef NAN + /* From wine/port.h */ +@@ -2433,6 +2436,129 @@ cleanup: + if (wnd) DestroyWindow(wnd); + } + ++static ID3DXFileData *get_mesh_data(const char *memory, SIZE_T length) ++{ ++ D3DXF_FILELOADMEMORY source; ++ ID3DXFileEnumObject *enumobj = NULL; ++ ID3DXFileData *filedata = NULL; ++ ID3DXFileData *ret = NULL; ++ ID3DXFile *d3dxfile = NULL; ++ SIZE_T i, nb_children; ++ HRESULT hr; ++ GUID guid; ++ ++ hr = D3DXFileCreate(&d3dxfile); ++ if (FAILED(hr)) return NULL; ++ ++ hr = d3dxfile->lpVtbl->RegisterTemplates(d3dxfile, D3DRM_XTEMPLATES, D3DRM_XTEMPLATE_BYTES); ++ if (FAILED(hr)) goto cleanup; ++ ++ source.lpMemory = (void *)memory; ++ source.dSize = length; ++ ++ hr = d3dxfile->lpVtbl->CreateEnumObject(d3dxfile, &source, D3DXF_FILELOAD_FROMMEMORY, &enumobj); ++ if (FAILED(hr)) goto cleanup; ++ ++ hr = enumobj->lpVtbl->GetChildren(enumobj, &nb_children); ++ if (FAILED(hr)) goto cleanup; ++ ++ for (i = 0; i < nb_children; i++) ++ { ++ hr = enumobj->lpVtbl->GetChild(enumobj, i, &filedata); ++ if (FAILED(hr)) goto cleanup; ++ ++ hr = filedata->lpVtbl->GetType(filedata, &guid); ++ if (SUCCEEDED(hr) && IsEqualGUID(&guid, &TID_D3DRMMesh)) ++ { ++ ret = filedata; ++ break; ++ } ++ else ++ filedata->lpVtbl->Release(filedata); ++ } ++ ++cleanup: ++ if (enumobj) enumobj->lpVtbl->Release(enumobj); ++ if (d3dxfile) d3dxfile->lpVtbl->Release(d3dxfile); ++ ++ return ret; ++} ++ ++static void D3DXLoadSkinMeshFromXofTest(void) ++{ ++ static const char simple_xfile[] = ++ "xof 0303txt 0032" ++ "Mesh {" ++ "3;" ++ "0.0; 0.0; 0.0;," ++ "0.0; 1.0; 0.0;," ++ "1.0; 1.0; 0.0;;" ++ "1;" ++ "3; 0, 1, 2;;" ++ "}"; ++ ID3DXBuffer *adjacency, *materials, *effects; ++ D3DPRESENT_PARAMETERS d3dpp; ++ IDirect3DDevice9 *device; ++ ID3DXFileData *filedata; ++ ID3DXSkinInfo *skininfo; ++ ID3DXMesh *mesh; ++ IDirect3D9 *d3d; ++ DWORD mat_count; ++ HRESULT hr; ++ HWND hwnd; ++ ++ if (!(hwnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0, ++ 640, 480, NULL, NULL, NULL, NULL))) ++ { ++ skip("Couldn't create application window\n"); ++ return; ++ } ++ ++ d3d = Direct3DCreate9(D3D_SDK_VERSION); ++ if (!d3d) ++ { ++ skip("Couldn't create IDirect3D9 object\n"); ++ DestroyWindow(hwnd); ++ return; ++ } ++ ++ ZeroMemory(&d3dpp, sizeof(d3dpp)); ++ d3dpp.Windowed = TRUE; ++ d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; ++ ++ hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); ++ IDirect3D9_Release(d3d); ++ if (FAILED(hr)) ++ { ++ skip("Failed to create IDirect3DDevice9 object %#x\n", hr); ++ DestroyWindow(hwnd); ++ return; ++ } ++ ++ filedata = get_mesh_data(simple_xfile, sizeof(simple_xfile) - 1); ++ ok(filedata != NULL, "Failed to load mesh data\n"); ++ ++ adjacency = materials = effects = NULL; ++ skininfo = NULL; ++ mesh = NULL; ++ ++ hr = D3DXLoadSkinMeshFromXof(filedata, 0, device, &adjacency, &materials, &effects, &mat_count, &skininfo, &mesh); ++ ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr); ++ ok(skininfo != NULL, "Expected non-null skininfo\n"); ++ ++ /* FIXME: Add additional tests for skininfo interface. */ ++ ++ if (adjacency) adjacency->lpVtbl->Release(adjacency); ++ if (materials) materials->lpVtbl->Release(materials); ++ if (effects) effects->lpVtbl->Release(effects); ++ if (skininfo) skininfo->lpVtbl->Release(skininfo); ++ if (mesh) mesh->lpVtbl->Release(mesh); ++ ++ filedata->lpVtbl->Release(filedata); ++ IDirect3DDevice9_Release(device); ++ DestroyWindow(hwnd); ++} ++ + static BOOL compute_box(struct mesh *mesh, float width, float height, float depth) + { + unsigned int i, face; +@@ -10613,6 +10739,7 @@ START_TEST(mesh) + D3DXCreateMeshTest(); + D3DXCreateMeshFVFTest(); + D3DXLoadMeshTest(); ++ D3DXLoadSkinMeshFromXofTest(); + D3DXCreateBoxTest(); + D3DXCreatePolygonTest(); + D3DXCreateSphereTest(); +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-Dummy_Skininfo/definition wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-Dummy_Skininfo/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-Dummy_Skininfo/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-Dummy_Skininfo/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [33904] Return dummy ID3DXSkinInfo interface when skinning info not present diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-GetShaderSemantics/0001-d3dx9_36-Implement-D3DXGetShaderInputSemantics-tests.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-GetShaderSemantics/0001-d3dx9_36-Implement-D3DXGetShaderInputSemantics-tests.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-GetShaderSemantics/0001-d3dx9_36-Implement-D3DXGetShaderInputSemantics-tests.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-GetShaderSemantics/0001-d3dx9_36-Implement-D3DXGetShaderInputSemantics-tests.patch 2015-07-29 19:51:42.000000000 +0000 @@ -1,15 +1,15 @@ -From b514784351ed8c2bc33cb0238ab81b4eedf29308 Mon Sep 17 00:00:00 2001 +From f791fc56711cd4860b405604af4b30b0efc22f52 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Sat, 5 Apr 2014 14:02:07 +0200 -Subject: d3dx9_36: Implement D3DXGetShaderInputSemantics + tests. (rev 2) +Subject: d3dx9_36: Implement D3DXGetShaderInputSemantics + tests. (rev 3) Fixes bug 22682. --- dlls/d3dx9_36/d3dx9_36.spec | 2 +- - dlls/d3dx9_36/shader.c | 95 ++++++++++++++++++++++++++++++++++++++++++++ - dlls/d3dx9_36/tests/shader.c | 86 +++++++++++++++++++++++++++++++++++++++ + dlls/d3dx9_36/shader.c | 92 ++++++++++++++++++++++++++++++++++++++++++++ + dlls/d3dx9_36/tests/shader.c | 86 +++++++++++++++++++++++++++++++++++++++++ include/d3dx9shader.h | 1 + - 4 files changed, 183 insertions(+), 1 deletion(-) + 4 files changed, 180 insertions(+), 1 deletion(-) diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec index 15d693c..9b55d21 100644 @@ -25,7 +25,7 @@ @ stdcall D3DXGetShaderSamplers(ptr ptr ptr) @ stdcall D3DXGetShaderSize(ptr) diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c -index c66936d..62aaa5b 100644 +index cdc470b..fecc3ee 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -1,6 +1,7 @@ @@ -36,12 +36,12 @@ * Copyright 2011 Travis Athougies * * This library is free software; you can redistribute it and/or -@@ -2132,3 +2133,97 @@ HRESULT WINAPI D3DXDisassembleShader(const DWORD *shader, BOOL colorcode, const +@@ -2130,3 +2131,94 @@ HRESULT WINAPI D3DXDisassembleShader(const DWORD *shader, BOOL colorcode, const FIXME("%p %d %s %p: stub\n", shader, colorcode, debugstr_a(comments), disassembly); return E_OUTOFMEMORY; } + -+const DWORD* skip_instruction(const DWORD *byte_code, UINT shader_model) ++static const DWORD* skip_instruction(const DWORD *byte_code, UINT shader_model) +{ + TRACE("Shader model %u\n", shader_model); + @@ -67,7 +67,7 @@ + return byte_code; +} + -+static UINT get_shader_semantics(const DWORD *byte_code, D3DXSEMANTIC *semantics, BOOL input) ++static UINT get_shader_semantics(const DWORD *byte_code, D3DXSEMANTIC *semantics, DWORD type) +{ + const DWORD *ptr = byte_code; + UINT shader_model = (*ptr >> 8) & 0xff; @@ -94,7 +94,7 @@ + TRACE("D3DSIO_DCL param1: %#x, param2: %#x, usage: %u, usage_index: %u, reg_type: %u\n", + param1, param2, usage, usage_index, reg_type); + -+ if (input && (reg_type == D3DSPR_INPUT)) ++ if (reg_type == type) + { + if (semantics) + { @@ -103,10 +103,7 @@ + } + i++; + } -+ else -+ { -+ /* FIXME: Support for output semantics */ -+ } ++ + ptr++; + } + else @@ -127,7 +124,7 @@ + if (!byte_code) + return D3DERR_INVALIDCALL; + -+ nb_semantics = get_shader_semantics(byte_code, semantics, TRUE); ++ nb_semantics = get_shader_semantics(byte_code, semantics, D3DSPR_INPUT); + + if (count) + *count = nb_semantics; @@ -262,5 +259,5 @@ HRESULT WINAPI D3DXAssembleShaderFromFileA(const char *filename, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages); -- -2.3.0 +2.4.5 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-GetShaderSemantics/0002-d3dx9_36-Implement-D3DXGetShaderOutputSemantics.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-GetShaderSemantics/0002-d3dx9_36-Implement-D3DXGetShaderOutputSemantics.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-GetShaderSemantics/0002-d3dx9_36-Implement-D3DXGetShaderOutputSemantics.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-GetShaderSemantics/0002-d3dx9_36-Implement-D3DXGetShaderOutputSemantics.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -From a3f87586958bbc1c1bb2df30b7605705254f7655 Mon Sep 17 00:00:00 2001 -From: Christian Costa -Date: Tue, 10 Feb 2015 00:45:05 +0100 -Subject: d3dx9_36: Implement D3DXGetShaderOutputSemantics. - ---- - dlls/d3dx9_36/d3dx9_36.spec | 2 +- - dlls/d3dx9_36/shader.c | 27 +++++++++++++++++++++------ - 2 files changed, 22 insertions(+), 7 deletions(-) - -diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec -index 1fb2aaf..13b1684 100644 ---- a/dlls/d3dx9_36/d3dx9_36.spec -+++ b/dlls/d3dx9_36/d3dx9_36.spec -@@ -160,7 +160,7 @@ - @ stdcall D3DXGetShaderConstantTable(ptr ptr) - @ stdcall D3DXGetShaderConstantTableEx(ptr long ptr) - @ stdcall D3DXGetShaderInputSemantics(ptr ptr ptr) --@ stub D3DXGetShaderOutputSemantics(ptr ptr ptr) -+@ stdcall D3DXGetShaderOutputSemantics(ptr ptr ptr) - @ stdcall D3DXGetShaderSamplers(ptr ptr ptr) - @ stdcall D3DXGetShaderSize(ptr) - @ stdcall D3DXGetShaderVersion(ptr) -diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c -index 63852d0..c3f02d2 100644 ---- a/dlls/d3dx9_36/shader.c -+++ b/dlls/d3dx9_36/shader.c -@@ -2166,7 +2166,7 @@ static UINT get_shader_semantics(const DWORD *byte_code, D3DXSEMANTIC *semantics - { - if (*ptr & (1 << 31)) - { -- FIXME("Opcode expected\n"); -+ FIXME("Opcode expected but got %#x\n", *ptr); - return 0; - } - else if ((*ptr & D3DSI_OPCODE_MASK) == D3DSIO_DCL) -@@ -2180,7 +2180,7 @@ static UINT get_shader_semantics(const DWORD *byte_code, D3DXSEMANTIC *semantics - TRACE("D3DSIO_DCL param1: %#x, param2: %#x, usage: %u, usage_index: %u, reg_type: %u\n", - param1, param2, usage, usage_index, reg_type); - -- if (input && (reg_type == D3DSPR_INPUT)) -+ if ((input && (reg_type == D3DSPR_INPUT)) || (!input && (reg_type == D3DSPR_OUTPUT))) - { - if (semantics) - { -@@ -2189,10 +2189,7 @@ static UINT get_shader_semantics(const DWORD *byte_code, D3DXSEMANTIC *semantics - } - i++; - } -- else -- { -- /* FIXME: Support for output semantics */ -- } -+ - ptr++; - } - else -@@ -2220,3 +2217,21 @@ HRESULT WINAPI D3DXGetShaderInputSemantics(const DWORD *byte_code, D3DXSEMANTIC - - return D3D_OK; - } -+ -+ -+HRESULT WINAPI D3DXGetShaderOutputSemantics(const DWORD *byte_code, D3DXSEMANTIC *semantics, UINT *count) -+{ -+ UINT nb_semantics; -+ -+ TRACE("byte_code %p, semantics %p, count %p\n", byte_code, semantics, count); -+ -+ if (!byte_code) -+ return D3DERR_INVALIDCALL; -+ -+ nb_semantics = get_shader_semantics(byte_code, semantics, FALSE); -+ -+ if (count) -+ *count = nb_semantics; -+ -+ return D3D_OK; -+} --- -2.2.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-GetShaderSemantics/0002-d3dx9_36-Implement-D3DXGetShaderOutputSemantics.-rev.patch wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-GetShaderSemantics/0002-d3dx9_36-Implement-D3DXGetShaderOutputSemantics.-rev.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/d3dx9_36-GetShaderSemantics/0002-d3dx9_36-Implement-D3DXGetShaderOutputSemantics.-rev.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/d3dx9_36-GetShaderSemantics/0002-d3dx9_36-Implement-D3DXGetShaderOutputSemantics.-rev.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,140 @@ +From f16ccf29286616feb69533c178cfccf2709184d6 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 8 Jul 2015 10:55:03 +1000 +Subject: d3dx9_36: Implement D3DXGetShaderOutputSemantics. (rev 2) + +--- + dlls/d3dx9_36/d3dx9_36.spec | 2 +- + dlls/d3dx9_36/shader.c | 20 +++++++++++++++- + dlls/d3dx9_36/tests/shader.c | 54 ++++++++++++++++++++++++++++++++++++++++++++ + include/d3dx9shader.h | 1 + + 4 files changed, 75 insertions(+), 2 deletions(-) + +diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec +index 9b55d21..4ae1384 100644 +--- a/dlls/d3dx9_36/d3dx9_36.spec ++++ b/dlls/d3dx9_36/d3dx9_36.spec +@@ -160,7 +160,7 @@ + @ stdcall D3DXGetShaderConstantTable(ptr ptr) + @ stdcall D3DXGetShaderConstantTableEx(ptr long ptr) + @ stdcall D3DXGetShaderInputSemantics(ptr ptr ptr) +-@ stub D3DXGetShaderOutputSemantics(ptr ptr ptr) ++@ stdcall D3DXGetShaderOutputSemantics(ptr ptr ptr) + @ stdcall D3DXGetShaderSamplers(ptr ptr ptr) + @ stdcall D3DXGetShaderSize(ptr) + @ stdcall D3DXGetShaderVersion(ptr) +diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c +index fecc3ee..07e3ff1 100644 +--- a/dlls/d3dx9_36/shader.c ++++ b/dlls/d3dx9_36/shader.c +@@ -2171,7 +2171,7 @@ static UINT get_shader_semantics(const DWORD *byte_code, D3DXSEMANTIC *semantics + { + if (*ptr & (1 << 31)) + { +- FIXME("Opcode expected\n"); ++ FIXME("Opcode expected but got %#x\n", *ptr); + return 0; + } + else if ((*ptr & D3DSI_OPCODE_MASK) == D3DSIO_DCL) +@@ -2222,3 +2222,21 @@ HRESULT WINAPI D3DXGetShaderInputSemantics(const DWORD *byte_code, D3DXSEMANTIC + + return D3D_OK; + } ++ ++ ++HRESULT WINAPI D3DXGetShaderOutputSemantics(const DWORD *byte_code, D3DXSEMANTIC *semantics, UINT *count) ++{ ++ UINT nb_semantics; ++ ++ TRACE("byte_code %p, semantics %p, count %p\n", byte_code, semantics, count); ++ ++ if (!byte_code) ++ return D3DERR_INVALIDCALL; ++ ++ nb_semantics = get_shader_semantics(byte_code, semantics, D3DSPR_OUTPUT); ++ ++ if (count) ++ *count = nb_semantics; ++ ++ return D3D_OK; ++} +diff --git a/dlls/d3dx9_36/tests/shader.c b/dlls/d3dx9_36/tests/shader.c +index 728cd86..62de9fb 100644 +--- a/dlls/d3dx9_36/tests/shader.c ++++ b/dlls/d3dx9_36/tests/shader.c +@@ -6572,6 +6572,60 @@ static void test_get_shader_semantics(void) + ok(semantics[1].UsageIndex == 0, "Got %u, expected 0\n", semantics[0].UsageIndex); + ok(semantics[2].Usage == D3DDECLUSAGE_TEXCOORD, "Got %u, expected %u\n", semantics[2].Usage, D3DDECLUSAGE_TEXCOORD); + ok(semantics[2].UsageIndex == 1, "Got %u, expected 1\n", semantics[0].UsageIndex); ++ ++ /* Test D3DXGetShaderOutputSemantics */ ++ ++ /* Check wrong parameters */ ++ ret = D3DXGetShaderOutputSemantics(NULL, NULL, NULL); ++ ok(ret == D3DERR_INVALIDCALL, "Returned %#x, expected %#x\n", ret, D3DERR_INVALIDCALL); ++ ret = D3DXGetShaderOutputSemantics(NULL, NULL, &count); ++ ok(ret == D3DERR_INVALIDCALL, "Returned %#x, expected %#x\n", ret, D3DERR_INVALIDCALL); ++ ret = D3DXGetShaderOutputSemantics(NULL, semantics, NULL); ++ ok(ret == D3DERR_INVALIDCALL, "Returned %#x, expected %#x\n", ret, D3DERR_INVALIDCALL); ++ ret = D3DXGetShaderOutputSemantics(NULL, semantics, &count); ++ ok(ret == D3DERR_INVALIDCALL, "Returned %#x, expected %#x\n", ret, D3DERR_INVALIDCALL); ++if (0) ++{ ++ /* Crashes on wvistau64 */ ++ ret = D3DXGetShaderOutputSemantics(semantics_vs11, NULL, NULL); ++ ok(ret == D3D_OK, "Failed with %#x\n", ret); ++} ++ ++ /* Check null semantics pointer */ ++ count = 0xdeadbeef; ++ ret = D3DXGetShaderOutputSemantics(semantics_vs11, NULL, &count); ++ ok(ret == D3D_OK, "Failed with %#x\n", ret); ++ ok(count == 1, "Got %u, expected 1\n", count); ++ ++ /* Check null count pointer */ ++if (0) ++{ ++ /* Crashes on wvistau64 */ ++ memset(semantics, 0xcc, sizeof(semantics)); ++ ret = D3DXGetShaderOutputSemantics(semantics_vs11, semantics, NULL); ++ ok(ret == D3D_OK, "Failed with %#x\n", ret); ++ ok(semantics[0].Usage == D3DDECLUSAGE_COLOR, "Got %u, expected %u\n", semantics[0].Usage, D3DDECLUSAGE_COLOR); ++ ok(semantics[0].UsageIndex == 0, "Got %u, expected 0\n", semantics[0].UsageIndex); ++} ++ ++ /* Check with vs11 shader */ ++ count = 0xdeadbeef; ++ memset(semantics, 0xcc, sizeof(semantics)); ++ ret = D3DXGetShaderOutputSemantics(semantics_vs11, semantics, &count); ++ ok(ret == D3D_OK, "Failed with %#x\n", ret); ++ ok(count == 1, "Got %u, expected 1\n", count); ++ todo_wine ++ ok(semantics[0].Usage == D3DDECLUSAGE_TEXCOORD, "Got %u, expected %u\n", semantics[0].Usage, D3DDECLUSAGE_TEXCOORD); ++ ok(semantics[0].UsageIndex == 0, "Got %u, expected 0\n", semantics[0].UsageIndex); ++ ++ /* Check with vs30 shader */ ++ count = 0xdeadbeef; ++ memset(semantics, 0xcc, sizeof(semantics)); ++ ret = D3DXGetShaderOutputSemantics(semantics_vs30, semantics, &count); ++ ok(ret == D3D_OK, "Failed with %#x\n", ret); ++ ok(count == 1, "Got %u, expected 1\n", count); ++ ok(semantics[0].Usage == D3DDECLUSAGE_COLOR, "Got %u, expected %u\n", semantics[0].Usage, D3DDECLUSAGE_COLOR); ++ ok(semantics[0].UsageIndex == 0, "Got %u, expected 0\n", semantics[0].UsageIndex); + } + + START_TEST(shader) +diff --git a/include/d3dx9shader.h b/include/d3dx9shader.h +index f565432..056033b 100644 +--- a/include/d3dx9shader.h ++++ b/include/d3dx9shader.h +@@ -316,6 +316,7 @@ const char * WINAPI D3DXGetVertexShaderProfile(struct IDirect3DDevice9 *device); + HRESULT WINAPI D3DXFindShaderComment(const DWORD *byte_code, DWORD fourcc, const void **data, UINT *size); + HRESULT WINAPI D3DXGetShaderSamplers(const DWORD *byte_code, const char **samplers, UINT *count); + HRESULT WINAPI D3DXGetShaderInputSemantics(const DWORD *byte_code, D3DXSEMANTIC *semantics, UINT *count); ++HRESULT WINAPI D3DXGetShaderOuputSemantics(const DWORD *byte_code, D3DXSEMANTIC *semantics, UINT *count); + + HRESULT WINAPI D3DXAssembleShaderFromFileA(const char *filename, const D3DXMACRO *defines, + ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages); +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/dbghelp-UnDecorateSymbolNameW/0001-dbghelp-Implement-UnDecorateSymbolNameW.patch wine-staging-1.7.48~ubuntu12.04.1/patches/dbghelp-UnDecorateSymbolNameW/0001-dbghelp-Implement-UnDecorateSymbolNameW.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/dbghelp-UnDecorateSymbolNameW/0001-dbghelp-Implement-UnDecorateSymbolNameW.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/dbghelp-UnDecorateSymbolNameW/0001-dbghelp-Implement-UnDecorateSymbolNameW.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,114 @@ +From 03999c58b169eac57f724f830e147f095a99989c Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 28 Jul 2015 22:58:03 +0200 +Subject: dbghelp: Implement UnDecorateSymbolNameW. + +--- + dlls/dbghelp/dbghelp.spec | 4 ++-- + dlls/dbghelp/symbol.c | 61 +++++++++++++++++++++++++++++++++++++---------- + 2 files changed, 50 insertions(+), 15 deletions(-) + +diff --git a/dlls/dbghelp/dbghelp.spec b/dlls/dbghelp/dbghelp.spec +index 4772358..6004f95 100644 +--- a/dlls/dbghelp/dbghelp.spec ++++ b/dlls/dbghelp/dbghelp.spec +@@ -183,8 +183,8 @@ + @ stdcall SymUnDName64(ptr str long) + @ stdcall SymUnloadModule(long long) + @ stdcall SymUnloadModule64(long int64) +-@ stdcall UnDecorateSymbolName(str str long long) +-@ stub UnDecorateSymbolNameW ++@ stdcall UnDecorateSymbolName(str ptr long long) ++@ stdcall UnDecorateSymbolNameW(wstr ptr long long) + @ stdcall UnmapDebugInformation(ptr) + @ stdcall WinDbgExtensionDllInit(ptr long long) + #@ stub block +diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c +index cbe232b..d4624ae 100644 +--- a/dlls/dbghelp/symbol.c ++++ b/dlls/dbghelp/symbol.c +@@ -1751,21 +1751,13 @@ BOOL WINAPI SymUnDName64(PIMAGEHLP_SYMBOL64 sym, PSTR UnDecName, DWORD UnDecName + + static void * CDECL und_alloc(size_t len) { return HeapAlloc(GetProcessHeap(), 0, len); } + static void CDECL und_free (void* ptr) { HeapFree(GetProcessHeap(), 0, ptr); } +- +-/*********************************************************************** +- * UnDecorateSymbolName (DBGHELP.@) +- */ +-DWORD WINAPI UnDecorateSymbolName(PCSTR DecoratedName, PSTR UnDecoratedName, +- DWORD UndecoratedLength, DWORD Flags) ++static char * CDECL und_name(char *buffer, const char *mangled, int buflen, unsigned short int flags) + { + /* undocumented from msvcrt */ + static HANDLE hMsvcrt; + static char* (CDECL *p_undname)(char*, const char*, int, void* (CDECL*)(size_t), void (CDECL*)(void*), unsigned short); + static const WCHAR szMsvcrt[] = {'m','s','v','c','r','t','.','d','l','l',0}; + +- TRACE("(%s, %p, %d, 0x%08x)\n", +- debugstr_a(DecoratedName), UnDecoratedName, UndecoratedLength, Flags); +- + if (!p_undname) + { + if (!hMsvcrt) hMsvcrt = LoadLibraryW(szMsvcrt); +@@ -1773,11 +1765,54 @@ DWORD WINAPI UnDecorateSymbolName(PCSTR DecoratedName, PSTR UnDecoratedName, + if (!p_undname) return 0; + } + +- if (!UnDecoratedName) return 0; +- if (!p_undname(UnDecoratedName, DecoratedName, UndecoratedLength, +- und_alloc, und_free, Flags)) ++ return p_undname(buffer, mangled, buflen, und_alloc, und_free, flags); ++} ++ ++/*********************************************************************** ++ * UnDecorateSymbolName (DBGHELP.@) ++ */ ++DWORD WINAPI UnDecorateSymbolName(PCSTR decorated_name, PSTR undecorated_name, ++ DWORD undecorated_length, DWORD flags) ++{ ++ TRACE("(%s, %p, %d, 0x%08x)\n", ++ debugstr_a(decorated_name), undecorated_name, undecorated_length, flags); ++ ++ if (!undecorated_name) ++ return 0; ++ if (!und_name(undecorated_name, decorated_name, undecorated_length, flags)) + return 0; +- return strlen(UnDecoratedName); ++ return strlen(undecorated_name); ++} ++ ++/*********************************************************************** ++ * UnDecorateSymbolNameW (DBGHELP.@) ++ */ ++DWORD WINAPI UnDecorateSymbolNameW(PCWSTR decorated_name, PWSTR undecorated_name, ++ DWORD undecorated_length, DWORD flags) ++{ ++ char *buf, *ptr; ++ int len; ++ ++ TRACE("(%s, %p, %d, 0x%08x)\n", ++ debugstr_w(decorated_name), undecorated_name, undecorated_length, flags); ++ ++ if (!undecorated_name) ++ return 0; ++ ++ len = WideCharToMultiByte(CP_ACP, 0, decorated_name, -1, NULL, 0, NULL, NULL); ++ if (!(buf = HeapAlloc(GetProcessHeap(), 0, len))) ++ return 0; ++ WideCharToMultiByte(CP_ACP, 0, decorated_name, -1, buf, len, NULL, NULL); ++ ++ ptr = und_name(NULL, buf, 0, flags); ++ HeapFree(GetProcessHeap(), 0, buf); ++ if (!ptr) ++ return 0; ++ ++ MultiByteToWideChar(CP_ACP, 0, ptr, -1, undecorated_name, undecorated_length); ++ undecorated_name[undecorated_length - 1] = 0; ++ HeapFree(GetProcessHeap(), 0, ptr); ++ return strlenW(undecorated_name); + } + + #define WILDCHAR(x) (-(x)) +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/dbghelp-UnDecorateSymbolNameW/definition wine-staging-1.7.48~ubuntu12.04.1/patches/dbghelp-UnDecorateSymbolNameW/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/dbghelp-UnDecorateSymbolNameW/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/dbghelp-UnDecorateSymbolNameW/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [38828] Implement dbghelp.UnDecorateSymbolNameW diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ddraw-Rendering_Targets/0001-ddraw-Create-rendering-targets-in-video-memory-if-po.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ddraw-Rendering_Targets/0001-ddraw-Create-rendering-targets-in-video-memory-if-po.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ddraw-Rendering_Targets/0001-ddraw-Create-rendering-targets-in-video-memory-if-po.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ddraw-Rendering_Targets/0001-ddraw-Create-rendering-targets-in-video-memory-if-po.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,195 @@ +From c65a572b8835af9ee1f4c7533b1c89f0c22fc95f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Wed, 29 Jul 2015 17:09:50 +0200 +Subject: ddraw: Create rendering targets in video memory if possible. + +Based on a patch by Henri Verbeet. +--- + dlls/ddraw/ddraw.c | 6 +++--- + dlls/ddraw/ddraw_private.h | 3 ++- + dlls/ddraw/device.c | 23 ++++++++++++++--------- + dlls/ddraw/surface.c | 21 +++++++++++++++++++-- + 4 files changed, 38 insertions(+), 15 deletions(-) + +diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c +index b3caba2..6dc8c2d 100644 +--- a/dlls/ddraw/ddraw.c ++++ b/dlls/ddraw/ddraw.c +@@ -4065,7 +4065,7 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid, + TRACE("iface %p, riid %s, surface %p, device %p.\n", iface, debugstr_guid(riid), surface, device); + + wined3d_mutex_lock(); +- if (SUCCEEDED(hr = d3d_device_create(ddraw, target, (IUnknown *)surface, 7, &object, NULL))) ++ if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, target, (IUnknown *)surface, 7, &object, NULL))) + { + *device = &object->IDirect3DDevice7_iface; + } +@@ -4094,7 +4094,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid, + return CLASS_E_NOAGGREGATION; + + wined3d_mutex_lock(); +- if (SUCCEEDED(hr = d3d_device_create(ddraw, surface_impl, (IUnknown *)surface, 3, &device_impl, NULL))) ++ if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, surface_impl, (IUnknown *)surface, 3, &device_impl, NULL))) + { + *device = &device_impl->IDirect3DDevice3_iface; + } +@@ -4120,7 +4120,7 @@ static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid, + iface, debugstr_guid(riid), surface, device); + + wined3d_mutex_lock(); +- if (SUCCEEDED(hr = d3d_device_create(ddraw, surface_impl, (IUnknown *)surface, 2, &device_impl, NULL))) ++ if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, surface_impl, (IUnknown *)surface, 2, &device_impl, NULL))) + { + *device = &device_impl->IDirect3DDevice2_iface; + } +diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h +index bb0a3f8..73c7e68 100644 +--- a/dlls/ddraw/ddraw_private.h ++++ b/dlls/ddraw/ddraw_private.h +@@ -298,6 +298,7 @@ struct d3d_device + IUnknown IUnknown_inner; + LONG ref; + UINT version; ++ BOOL hw; + + IUnknown *outer_unknown; + struct wined3d_device *wined3d_device; +@@ -340,7 +341,7 @@ struct d3d_device + D3DMATRIXHANDLE world, proj, view; + }; + +-HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUnknown *rt_iface, ++HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface, + UINT version, struct d3d_device **device, IUnknown *outer_unknown) DECLSPEC_HIDDEN; + enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device *device) DECLSPEC_HIDDEN; + +diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c +index 408eb24..bb8534a 100644 +--- a/dlls/ddraw/device.c ++++ b/dlls/ddraw/device.c +@@ -1857,7 +1857,7 @@ static HRESULT d3d_device7_SetRenderTarget(IDirect3DDevice7 *iface, + return DDERR_INVALIDCAPS; + } + +- if (!(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) ++ if (device->hw && !(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) + { + WARN("Surface %p is not in video memory.\n", target_impl); + wined3d_mutex_unlock(); +@@ -1933,7 +1933,7 @@ static HRESULT WINAPI d3d_device3_SetRenderTarget(IDirect3DDevice3 *iface, + return DDERR_INVALIDPIXELFORMAT; + } + +- if (!(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) ++ if (device->hw && !(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) + { + WARN("Surface %p is not in video memory.\n", target_impl); + IDirectDrawSurface4_AddRef(target); +@@ -1982,7 +1982,7 @@ static HRESULT WINAPI d3d_device2_SetRenderTarget(IDirect3DDevice2 *iface, + return DDERR_INVALIDPIXELFORMAT; + } + +- if (!(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) ++ if (device->hw && !(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) + { + WARN("Surface %p is not in video memory.\n", target_impl); + IDirectDrawSurface_AddRef(target); +@@ -6777,7 +6777,7 @@ enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device + return WINED3D_ZB_TRUE; + } + +-static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, ++static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, BOOL hw, + struct ddraw_surface *target, IUnknown *rt_iface, UINT version, IUnknown *outer_unknown) + { + static const D3DMATRIX ident = +@@ -6800,6 +6800,7 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, + device->IUnknown_inner.lpVtbl = &d3d_device_inner_vtbl; + device->ref = 1; + device->version = version; ++ device->hw = hw; + + if (outer_unknown) + device->outer_unknown = outer_unknown; +@@ -6850,14 +6851,18 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, + return D3D_OK; + } + +-HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUnknown *rt_iface, ++HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface, + UINT version, struct d3d_device **device, IUnknown *outer_unknown) + { + struct d3d_device *object; ++ BOOL hw = TRUE; + HRESULT hr; + +- TRACE("ddraw %p, target %p, version %u, device %p, outer_unknown %p.\n", +- ddraw, target, version, device, outer_unknown); ++ TRACE("ddraw %p, guid %s, target %p, version %u, device %p, outer_unknown %p.\n", ++ ddraw, debugstr_guid(guid), target, version, device, outer_unknown); ++ ++ if (IsEqualGUID(guid, &IID_IDirect3DRGBDevice)) ++ hw = FALSE; + + if (!(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE) + || (target->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)) +@@ -6872,7 +6877,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn + return DDERR_NOPALETTEATTACHED; + } + +- if (!(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) ++ if (hw && !(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) + { + WARN("Surface %p is not in video memory.\n", target); + return D3DERR_SURFACENOTINVIDMEM; +@@ -6899,7 +6904,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn + return DDERR_OUTOFMEMORY; + } + +- if (FAILED(hr = d3d_device_init(object, ddraw, target, rt_iface, version, outer_unknown))) ++ if (FAILED(hr = d3d_device_init(object, ddraw, hw, target, rt_iface, version, outer_unknown))) + { + WARN("Failed to initialize device, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); +diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c +index 77a3d44..ca84719 100644 +--- a/dlls/ddraw/surface.c ++++ b/dlls/ddraw/surface.c +@@ -211,7 +211,7 @@ static HRESULT WINAPI ddraw_surface7_QueryInterface(IDirectDrawSurface7 *iface, + { + HRESULT hr; + +- if (FAILED(hr = d3d_device_create(This->ddraw, This, (IUnknown *)&This->IDirectDrawSurface_iface, ++ if (FAILED(hr = d3d_device_create(This->ddraw, riid, This, (IUnknown *)&This->IDirectDrawSurface_iface, + 1, &This->device1, (IUnknown *)&This->IDirectDrawSurface_iface))) + { + This->device1 = NULL; +@@ -5935,7 +5935,24 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ + + if (desc->ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY) + { +- wined3d_desc.pool = WINED3D_POOL_SYSTEM_MEM; ++ /* ++ * The ddraw RGB device allows to use system memory surfaces as rendering target. ++ * This does not cause problems because the RGB device does software rasterization ++ * though it will fail with hardware accelerated ddraw. In order to be partially ++ * compatible with games requesting explicitly the RGB device, we ignore the ++ * specified location and try to create rendering targets in video memory if ++ * possible. ++ */ ++ if ((desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) && ++ SUCCEEDED(hr = wined3d_check_device_format(ddraw->wined3d, WINED3DADAPTER_DEFAULT, ++ WINED3D_DEVICE_TYPE_HAL, mode.format_id, WINED3DUSAGE_RENDERTARGET, ++ WINED3D_RTYPE_SURFACE, wined3d_desc.format))) ++ { ++ FIXME("Application wants to create rendering target in system memory, using video memory instead\n"); ++ wined3d_desc.usage |= WINED3DUSAGE_RENDERTARGET; ++ } ++ else ++ wined3d_desc.pool = WINED3D_POOL_SYSTEM_MEM; + } + else + { +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ddraw-Rendering_Targets/definition wine-staging-1.7.48~ubuntu12.04.1/patches/ddraw-Rendering_Targets/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/ddraw-Rendering_Targets/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ddraw-Rendering_Targets/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [34906] Use video memory for rendering targets if possible diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/dwrite-VDMX/0001-dwrite-Avoid-dereferencing-NULL-pointer-for-fonts-wi.patch wine-staging-1.7.48~ubuntu12.04.1/patches/dwrite-VDMX/0001-dwrite-Avoid-dereferencing-NULL-pointer-for-fonts-wi.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/dwrite-VDMX/0001-dwrite-Avoid-dereferencing-NULL-pointer-for-fonts-wi.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/dwrite-VDMX/0001-dwrite-Avoid-dereferencing-NULL-pointer-for-fonts-wi.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From ef42bee07f37038aa690ddf8c164c7fff8512a25 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 12 Jul 2015 03:36:20 +0200 -Subject: dwrite: Avoid dereferencing NULL pointer for fonts without VDMX. - ---- - dlls/dwrite/opentype.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c -index 63e1b74..8d90c04 100644 ---- a/dlls/dwrite/opentype.c -+++ b/dlls/dwrite/opentype.c -@@ -1347,7 +1347,7 @@ static const struct VDMX_group *find_vdmx_group(const struct VDMX_Header *hdr) - BOOL opentype_get_vdmx_size(const void *data, INT emsize, UINT16 *ascent, UINT16 *descent) - { - const struct VDMX_Header *hdr = (const struct VDMX_Header*)data; -- const struct VDMX_group *group = find_vdmx_group(hdr); -+ const struct VDMX_group *group; - const struct VDMX_vTable *tables; - WORD recs, i; - --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/gdi32-Default_Palette/definition wine-staging-1.7.48~ubuntu12.04.1/patches/gdi32-Default_Palette/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/gdi32-Default_Palette/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/gdi32-Default_Palette/definition 2015-07-29 19:51:42.000000000 +0000 @@ -1 +1 @@ -Fixes: Return default palette entries from GetSystemPaletteEntries for non-palette-based devices +Fixes: [36895] Return default palette entries from GetSystemPaletteEntries for non-palette-based devices diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/gdiplus-GdipCreateEffect/0001-gdiplus-Add-GdipCreateEffect-stub.patch wine-staging-1.7.48~ubuntu12.04.1/patches/gdiplus-GdipCreateEffect/0001-gdiplus-Add-GdipCreateEffect-stub.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/gdiplus-GdipCreateEffect/0001-gdiplus-Add-GdipCreateEffect-stub.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/gdiplus-GdipCreateEffect/0001-gdiplus-Add-GdipCreateEffect-stub.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,198 @@ +From 87d78ae794d77d40f2e08b037d9985e332bb5d68 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Thu, 23 Jul 2015 19:08:33 +1000 +Subject: gdiplus: Add GdipCreateEffect stub + +Based on patch by David Hedberg + +Fixes https://bugs.winehq.org/show_bug.cgi?id=32163 +--- + dlls/gdiplus/gdiplus.spec | 2 +- + dlls/gdiplus/image.c | 18 ++++++++++++++++++ + dlls/gdiplus/tests/image.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + include/Makefile.in | 1 + + include/gdiplus.h | 2 ++ + include/gdipluseffects.h | 37 +++++++++++++++++++++++++++++++++++++ + 6 files changed, 101 insertions(+), 1 deletion(-) + create mode 100644 include/gdipluseffects.h + +diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec +index 9701ee0..3937443 100644 +--- a/dlls/gdiplus/gdiplus.spec ++++ b/dlls/gdiplus/gdiplus.spec +@@ -610,7 +610,7 @@ + 610 stdcall GdipFindFirstImageItem(ptr ptr) + 611 stub GdipFindNextImageItem + 612 stdcall GdipGetImageItemData(ptr ptr) +-613 stub GdipCreateEffect ++613 stdcall GdipCreateEffect(ptr ptr) + 614 stdcall GdipDeleteEffect(ptr) + 615 stub GdipGetEffectParameterSize + 616 stub GdipGetEffectParameters +diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c +index 23c465e..042835a 100644 +--- a/dlls/gdiplus/image.c ++++ b/dlls/gdiplus/image.c +@@ -5008,6 +5008,24 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi + return retval; + } + ++/***************************************************************************** ++ * GdipCreateEffect [GDIPLUS.@] ++ */ ++GpStatus WINGDIPAPI GdipCreateEffect(const GUID guid, CGpEffect **effect) ++{ ++ FIXME("(%s, %p): stub\n", debugstr_guid(&guid), effect); ++ ++ if(!effect) ++ return InvalidParameter; ++ ++ *effect = NULL; ++ ++ return NotImplemented; ++} ++ ++/***************************************************************************** ++ * GdipDeleteEffect [GDIPLUS.@] ++ */ + GpStatus WINGDIPAPI GdipDeleteEffect(CGpEffect *effect) + { + FIXME("(%p): stub\n", effect); +diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c +index 1335d97..51b99a3 100644 +--- a/dlls/gdiplus/tests/image.c ++++ b/dlls/gdiplus/tests/image.c +@@ -4629,6 +4629,47 @@ static void test_supported_encoders(void) + GdipDisposeImage((GpImage *)bm); + } + ++static void test_createeffect(void) ++{ ++ static const GUID noneffect = { 0xcd0c3d4b, 0xe15e, 0x4cf2, { 0x9e, 0xa8, 0x6e, 0x1d, 0x65, 0x48, 0xc5, 0xa5 } }; ++ GpStatus (WINAPI *pGdipCreateEffect)( const GUID guid, CGpEffect **effect); ++ GpStatus (WINAPI *pGdipDeleteEffect)( CGpEffect *effect); ++ GpStatus stat; ++ CGpEffect *effect; ++ HMODULE mod = GetModuleHandleA("gdiplus.dll"); ++ int i; ++ const GUID effectlist[] = ++ {BlurEffectGuid, SharpenEffectGuid, ColorMatrixEffectGuid, ColorLUTEffectGuid, ++ BrightnessContrastEffectGuid, HueSaturationLightnessEffectGuid, LevelsEffectGuid, ++ TintEffectGuid, ColorBalanceEffectGuid, RedEyeCorrectionEffectGuid, ColorCurveEffectGuid}; ++ ++ pGdipCreateEffect = (void*)GetProcAddress( mod, "GdipCreateEffect"); ++ pGdipDeleteEffect = (void*)GetProcAddress( mod, "GdipDeleteEffect"); ++ if(!pGdipCreateEffect || !pGdipDeleteEffect) ++ { ++ /* GdipCreateEffect/GdipDeleteEffect was introduced in Windows Vista. */ ++ win_skip("GDIPlus version 1.1 not available\n"); ++ return; ++ } ++ ++ stat = pGdipCreateEffect(BlurEffectGuid, NULL); ++ expect(InvalidParameter, stat); ++ ++ stat = pGdipCreateEffect(noneffect, &effect); ++ todo_wine expect(Win32Error, stat); ++ ++ for(i=0; i < sizeof(effectlist) / sizeof(GUID); i++) ++ { ++ stat = pGdipCreateEffect(effectlist[i], &effect); ++ todo_wine expect(Ok, stat); ++ if(stat == Ok) ++ { ++ stat = pGdipDeleteEffect(effect); ++ expect(Ok, stat); ++ } ++ } ++} ++ + START_TEST(image) + { + struct GdiplusStartupInput gdiplusStartupInput; +@@ -4683,6 +4724,7 @@ START_TEST(image) + test_remaptable(); + test_colorkey(); + test_dispose(); ++ test_createeffect(); + + GdiplusShutdown(gdiplusToken); + } +diff --git a/include/Makefile.in b/include/Makefile.in +index f829712..6d986c1 100644 +--- a/include/Makefile.in ++++ b/include/Makefile.in +@@ -339,6 +339,7 @@ SRCDIR_INCLUDES = \ + gdiplus.h \ + gdipluscolor.h \ + gdipluscolormatrix.h \ ++ gdipluseffects.h \ + gdiplusenums.h \ + gdiplusflat.h \ + gdiplusgpstubs.h \ +diff --git a/include/gdiplus.h b/include/gdiplus.h +index f063b3e..e85343b 100644 +--- a/include/gdiplus.h ++++ b/include/gdiplus.h +@@ -37,6 +37,7 @@ namespace Gdiplus + #include "gdipluscolor.h" + #include "gdipluscolormatrix.h" + #include "gdiplusgpstubs.h" ++#include "gdipluseffects.h" + + namespace DllExports + { +@@ -57,6 +58,7 @@ namespace Gdiplus + #include "gdipluscolor.h" + #include "gdipluscolormatrix.h" + #include "gdiplusgpstubs.h" ++#include "gdipluseffects.h" + + #include "gdiplusflat.h" + +diff --git a/include/gdipluseffects.h b/include/gdipluseffects.h +new file mode 100644 +index 0000000..6e2c983 +--- /dev/null ++++ b/include/gdipluseffects.h +@@ -0,0 +1,37 @@ ++/* ++ * Copyright (C) 2015 Alistair Leslie-Hughes ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef _GDIPLUSEFFECTS_H ++#define _GDIPLUSEFFECTS_H ++ ++DEFINE_GUID(BlurEffectGuid, 0x633c80a4, 0x1843, 0x482b, 0x9e, 0xf2, 0xbe, 0x28, 0x34, 0xc5, 0xfd, 0xd4); ++DEFINE_GUID(SharpenEffectGuid, 0x63cbf3ee, 0xc526, 0x402c, 0x8f, 0x71, 0x62, 0xc5, 0x40, 0xbf, 0x51, 0x42); ++DEFINE_GUID(ColorMatrixEffectGuid, 0x718f2615, 0x7933, 0x40e3, 0xa5, 0x11, 0x5f, 0x68, 0xfe, 0x14, 0xdd, 0x74); ++DEFINE_GUID(ColorLUTEffectGuid, 0xa7ce72a9, 0x0f7f, 0x40d7, 0xb3, 0xcc, 0xd0, 0xc0, 0x2d, 0x5c, 0x32, 0x12); ++DEFINE_GUID(BrightnessContrastEffectGuid, 0xd3a1dbe1, 0x8ec4, 0x4c17, 0x9f, 0x4c, 0xea, 0x97, 0xad, 0x1c, 0x34, 0x3d); ++DEFINE_GUID(HueSaturationLightnessEffectGuid, 0x8b2dd6c3, 0xeb07, 0x4d87, 0xa5, 0xf0, 0x71, 0x08, 0xe2, 0x6a, 0x9c, 0x5f); ++DEFINE_GUID(LevelsEffectGuid, 0x99c354ec, 0x2a31, 0x4f3a, 0x8c, 0x34, 0x17, 0xa8, 0x03, 0xb3, 0x3a, 0x25); ++DEFINE_GUID(TintEffectGuid, 0x1077af00, 0x2848, 0x4441, 0x94, 0x89, 0x44, 0xad, 0x4c, 0x2d, 0x7a, 0x2c); ++DEFINE_GUID(ColorBalanceEffectGuid, 0x537e597d, 0x251e, 0x48da, 0x96, 0x64, 0x29, 0xca, 0x49, 0x6b, 0x70, 0xf8); ++DEFINE_GUID(RedEyeCorrectionEffectGuid, 0x74d29d05, 0x69a4, 0x4266, 0x95, 0x49, 0x3c, 0xc5, 0x28, 0x36, 0xb6, 0x32); ++DEFINE_GUID(ColorCurveEffectGuid, 0xdd6a0022, 0x58e4, 0x4a67, 0x9d, 0x9b, 0xd4, 0x8e, 0xb8, 0x81, 0xa5, 0x3d); ++ ++GpStatus WINGDIPAPI GdipCreateEffect(const GUID guid, CGpEffect **effect); ++GpStatus WINGDIPAPI GdipDeleteEffect(CGpEffect *effect); ++ ++#endif +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/gdiplus-GdipCreateEffect/0001-gdiplus-Add-stub-for-GdipCreateEffect.patch wine-staging-1.7.48~ubuntu12.04.1/patches/gdiplus-GdipCreateEffect/0001-gdiplus-Add-stub-for-GdipCreateEffect.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/gdiplus-GdipCreateEffect/0001-gdiplus-Add-stub-for-GdipCreateEffect.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/gdiplus-GdipCreateEffect/0001-gdiplus-Add-stub-for-GdipCreateEffect.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -From d3a2292073b81e25e2c1571cea63022c4c396a67 Mon Sep 17 00:00:00 2001 -From: David Hedberg -Date: Fri, 27 Feb 2015 01:17:01 +0100 -Subject: gdiplus: Add stub for GdipCreateEffect. - ---- - dlls/gdiplus/gdiplus.spec | 2 +- - dlls/gdiplus/image.c | 7 +++++++ - 2 files changed, 8 insertions(+), 1 deletion(-) - -diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec -index cee3ea6..bbe6c4c 100644 ---- a/dlls/gdiplus/gdiplus.spec -+++ b/dlls/gdiplus/gdiplus.spec -@@ -610,7 +610,7 @@ - 610 stdcall GdipFindFirstImageItem(ptr ptr) - 611 stub GdipFindNextImageItem - 612 stdcall GdipGetImageItemData(ptr ptr) --613 stub GdipCreateEffect -+613 stdcall GdipCreateEffect(ptr ptr) - 614 stdcall GdipDeleteEffect(ptr) - 615 stub GdipGetEffectParameterSize - 616 stub GdipGetEffectParameters -diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c -index e6921f5..d3f22dc 100644 ---- a/dlls/gdiplus/image.c -+++ b/dlls/gdiplus/image.c -@@ -137,6 +137,13 @@ static INT ipicture_pixel_width(IPicture *pic) - return x; - } - -+GpStatus WINGDIPAPI GdipCreateEffect(const GUID guid, CGpEffect **effect) -+{ -+ FIXME("(%s, %p): stub\n", debugstr_guid(&guid), effect); -+ *effect = NULL; -+ return NotImplemented; -+} -+ - GpStatus WINGDIPAPI GdipBitmapApplyEffect(GpBitmap* bitmap, CGpEffect* effect, - RECT* roi, BOOL useAuxData, VOID** auxData, INT* auxDataSize) - { --- -2.3.0 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/gdiplus-GIF_Encoder/0001-gdiplus-Forward-GIF-encoder-requests-to-windowscodec.patch wine-staging-1.7.48~ubuntu12.04.1/patches/gdiplus-GIF_Encoder/0001-gdiplus-Forward-GIF-encoder-requests-to-windowscodec.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/gdiplus-GIF_Encoder/0001-gdiplus-Forward-GIF-encoder-requests-to-windowscodec.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/gdiplus-GIF_Encoder/0001-gdiplus-Forward-GIF-encoder-requests-to-windowscodec.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,151 +0,0 @@ -From 5a9241dd76874080df0938618a2fbbb022250791 Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Tue, 9 Jun 2015 05:46:41 +0200 -Subject: gdiplus: Forward GIF encoder requests to windowscodecs. - ---- - dlls/gdiplus/image.c | 10 ++++-- - dlls/gdiplus/tests/image.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 94 insertions(+), 2 deletions(-) - -diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c -index 86802a5..1d2d6fa 100644 ---- a/dlls/gdiplus/image.c -+++ b/dlls/gdiplus/image.c -@@ -4401,6 +4401,12 @@ static GpStatus encode_image_jpeg(GpImage *image, IStream* stream, - return encode_image_wic(image, stream, &GUID_ContainerFormatJpeg, params); - } - -+static GpStatus encode_image_gif(GpImage *image, IStream* stream, -+ GDIPCONST CLSID* clsid, GDIPCONST EncoderParameters* params) -+{ -+ return encode_image_wic(image, stream, &CLSID_WICGifEncoder, params); -+} -+ - /***************************************************************************** - * GdipSaveImageToStream [GDIPLUS.@] - */ -@@ -4611,14 +4617,14 @@ static const struct image_codec codecs[NUM_CODECS] = { - /* FormatDescription */ gif_format, - /* FilenameExtension */ gif_extension, - /* MimeType */ gif_mimetype, -- /* Flags */ ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, -+ /* Flags */ ImageCodecFlagsDecoder | ImageCodecFlagsEncoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, - /* Version */ 1, - /* SigCount */ 2, - /* SigSize */ 6, - /* SigPattern */ gif_sig_pattern, - /* SigMask */ gif_sig_mask, - }, -- NULL, -+ encode_image_gif, - decode_image_gif, - select_frame_gif - }, -diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c -index 63fc96e..8a85828 100644 ---- a/dlls/gdiplus/tests/image.c -+++ b/dlls/gdiplus/tests/image.c -@@ -4544,6 +4544,91 @@ static void test_CloneBitmapArea(void) - GdipDisposeImage((GpImage *)bitmap); - } - -+static BOOL get_encoder_clsid(LPCWSTR mime, GUID *format, CLSID *clsid) -+{ -+ GpStatus status; -+ UINT n_codecs, info_size, i; -+ ImageCodecInfo *info; -+ BOOL ret = FALSE; -+ -+ status = GdipGetImageEncodersSize(&n_codecs, &info_size); -+ expect(Ok, status); -+ -+ info = GdipAlloc(info_size); -+ -+ status = GdipGetImageEncoders(n_codecs, info_size, info); -+ expect(Ok, status); -+ -+ for (i = 0; i < n_codecs; i++) -+ { -+ if (!lstrcmpW(info[i].MimeType, mime)) -+ { -+ *format = info[i].FormatID; -+ *clsid = info[i].Clsid; -+ ret = TRUE; -+ break; -+ } -+ } -+ -+ GdipFree(info); -+ return ret; -+} -+ -+static void test_supported_encoders(void) -+{ -+ static const WCHAR bmp_mimetype[] = {'i', 'm', 'a','g', 'e', '/', 'b', 'm', 'p', 0}; -+ static const WCHAR jpeg_mimetype[] = {'i','m','a','g','e','/','j','p','e','g', 0}; -+ static const WCHAR gif_mimetype[] = {'i','m','a','g','e','/','g','i','f', 0}; -+ static const WCHAR tiff_mimetype[] = {'i','m','a','g','e','/','t','i','f','f', 0}; -+ static const WCHAR png_mimetype[] = {'i','m','a','g','e','/','p','n','g', 0}; -+ static const struct test_data -+ { -+ LPCWSTR mime; -+ const GUID *format; -+ BOOL todo; -+ } td[] = -+ { -+ { bmp_mimetype, &ImageFormatBMP, FALSE }, -+ { jpeg_mimetype, &ImageFormatJPEG, FALSE }, -+ { gif_mimetype, &ImageFormatGIF, TRUE }, -+ { tiff_mimetype, &ImageFormatTIFF, FALSE }, -+ { png_mimetype, &ImageFormatPNG, FALSE } -+ }; -+ GUID format, clsid; -+ BOOL ret; -+ HRESULT hr; -+ GpStatus status; -+ GpBitmap *bm; -+ IStream *stream; -+ HGLOBAL hmem; -+ int i; -+ -+ status = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat24bppRGB, NULL, &bm); -+ ok(status == Ok, "GdipCreateBitmapFromScan0 error %d\n", status); -+ -+ for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) -+ { -+ ret = get_encoder_clsid(td[i].mime, &format, &clsid); -+ ok(ret, "%s encoder is not in the list\n", wine_dbgstr_w(td[i].mime)); -+ expect_guid(td[i].format, &format, __LINE__, FALSE); -+ -+ hmem = GlobalAlloc(GMEM_MOVEABLE | GMEM_NODISCARD, 16); -+ -+ hr = CreateStreamOnHGlobal(hmem, TRUE, &stream); -+ ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr); -+ -+ status = GdipSaveImageToStream((GpImage *)bm, stream, &clsid, NULL); -+ if (td[i].todo) -+ todo_wine ok(status == Ok, "GdipSaveImageToStream error %d\n", status); -+ else -+ ok(status == Ok, "GdipSaveImageToStream error %d\n", status); -+ -+ IStream_Release(stream); -+ } -+ -+ GdipDisposeImage((GpImage *)bm); -+} -+ - START_TEST(image) - { - struct GdiplusStartupInput gdiplusStartupInput; -@@ -4556,6 +4641,7 @@ START_TEST(image) - - GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); - -+ test_supported_encoders(); - test_CloneBitmapArea(); - test_ARGB_conversion(); - test_DrawImage_scale(); --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/gdiplus-GIF_Encoder/definition wine-staging-1.7.48~ubuntu12.04.1/patches/gdiplus-GIF_Encoder/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/gdiplus-GIF_Encoder/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/gdiplus-GIF_Encoder/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [34356] Forward GIF encoder requests to windowscodecs diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/kernel32-InsertMode/0001-kernel32-Set-console-InsertMode-immediately.patch wine-staging-1.7.48~ubuntu12.04.1/patches/kernel32-InsertMode/0001-kernel32-Set-console-InsertMode-immediately.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/kernel32-InsertMode/0001-kernel32-Set-console-InsertMode-immediately.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/kernel32-InsertMode/0001-kernel32-Set-console-InsertMode-immediately.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -From 1f127d55e0e6d473e6fe5069f2957f9db71fdc23 Mon Sep 17 00:00:00 2001 -From: Hugh McMaster -Date: Mon, 8 Jun 2015 22:22:21 +1000 -Subject: kernel32: Set console InsertMode immediately. - ---- - dlls/kernel32/editline.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/dlls/kernel32/editline.c b/dlls/kernel32/editline.c -index 7664b55..3c2e8de 100644 ---- a/dlls/kernel32/editline.c -+++ b/dlls/kernel32/editline.c -@@ -987,6 +987,10 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, BOOL can_pos_cursor) - } - } - -+ if (GetConsoleMode(hConsoleIn, &mode)) -+ ctx.insert = (mode & (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS)) == -+ (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS) ? 1 : 0; -+ - if (func) - (func)(&ctx); - else if (!(ir.Event.KeyEvent.dwControlKeyState & LEFT_ALT_PRESSED)) --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/kernel32-InsertMode/definition wine-staging-1.7.48~ubuntu12.04.1/patches/kernel32-InsertMode/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/kernel32-InsertMode/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/kernel32-InsertMode/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: Ensure console InsertMode changes take effect immediately diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/kernel32-LocaleNameToLCID/0001-kernel32-Silence-repeated-LocaleNameToLCID-unsupport.patch wine-staging-1.7.48~ubuntu12.04.1/patches/kernel32-LocaleNameToLCID/0001-kernel32-Silence-repeated-LocaleNameToLCID-unsupport.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/kernel32-LocaleNameToLCID/0001-kernel32-Silence-repeated-LocaleNameToLCID-unsupport.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/kernel32-LocaleNameToLCID/0001-kernel32-Silence-repeated-LocaleNameToLCID-unsupport.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,39 @@ +From 92cb03fb619558c2193475843fbde619f517469d Mon Sep 17 00:00:00 2001 +From: Jarkko Korpi +Date: Wed, 15 Jul 2015 02:38:25 +0300 +Subject: kernel32: Silence repeated LocaleNameToLCID unsupported flags + message. + +--- + dlls/kernel32/locale.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c +index eaf1183..74f77dd 100644 +--- a/dlls/kernel32/locale.c ++++ b/dlls/kernel32/locale.c +@@ -1093,8 +1093,10 @@ LANGID WINAPI GetSystemDefaultUILanguage(void) + LCID WINAPI LocaleNameToLCID( LPCWSTR name, DWORD flags ) + { + struct locale_name locale_name; ++ static int once; + +- if (flags) FIXME( "unsupported flags %x\n", flags ); ++ if (flags && !once++) ++ FIXME( "unsupported flags %x\n", flags ); + + if (name == LOCALE_NAME_USER_DEFAULT) + return GetUserDefaultLCID(); +@@ -1124,7 +1126,8 @@ LCID WINAPI LocaleNameToLCID( LPCWSTR name, DWORD flags ) + */ + INT WINAPI LCIDToLocaleName( LCID lcid, LPWSTR name, INT count, DWORD flags ) + { +- if (flags) FIXME( "unsupported flags %x\n", flags ); ++ static int once; ++ if (flags && !once++) FIXME( "unsupported flags %x\n", flags ); + + return GetLocaleInfoW( lcid, LOCALE_SNAME | LOCALE_NOUSEROVERRIDE, name, count ); + } +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/kernel32-LocaleNameToLCID/definition wine-staging-1.7.48~ubuntu12.04.1/patches/kernel32-LocaleNameToLCID/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/kernel32-LocaleNameToLCID/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/kernel32-LocaleNameToLCID/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [30076] Silence repeated LocaleNameToLCID/LCIDToLocaleName unsupported flags FIXMEs diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/kernel32-SetFileCompletionNotificationModes/0001-kernel32-Fake-success-in-SetFileCompletionNotificati.patch wine-staging-1.7.48~ubuntu12.04.1/patches/kernel32-SetFileCompletionNotificationModes/0001-kernel32-Fake-success-in-SetFileCompletionNotificati.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/kernel32-SetFileCompletionNotificationModes/0001-kernel32-Fake-success-in-SetFileCompletionNotificati.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/kernel32-SetFileCompletionNotificationModes/0001-kernel32-Fake-success-in-SetFileCompletionNotificati.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,26 @@ +From 479993311ae3467ba359b76057744dec56fa2fea Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 26 Jul 2015 20:54:23 +0200 +Subject: kernel32: Fake success in SetFileCompletionNotificationModes. + +--- + dlls/kernel32/file.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c +index e43829e..569ed22 100644 +--- a/dlls/kernel32/file.c ++++ b/dlls/kernel32/file.c +@@ -1046,8 +1046,7 @@ BOOL WINAPI SetEndOfFile( HANDLE hFile ) + BOOL WINAPI SetFileCompletionNotificationModes( HANDLE handle, UCHAR flags ) + { + FIXME("%p %x - stub\n", handle, flags); +- SetLastError(ERROR_CALL_NOT_IMPLEMENTED); +- return FALSE; ++ return TRUE; + } + + +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/kernel32-SetFileCompletionNotificationModes/definition wine-staging-1.7.48~ubuntu12.04.1/patches/kernel32-SetFileCompletionNotificationModes/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/kernel32-SetFileCompletionNotificationModes/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/kernel32-SetFileCompletionNotificationModes/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [38960] Fake success in kernel32.SetFileCompletionNotificationModes diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/mscoree-CorValidateImage/0001-mscoree-Implement-_CorValidateImage.patch wine-staging-1.7.48~ubuntu12.04.1/patches/mscoree-CorValidateImage/0001-mscoree-Implement-_CorValidateImage.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/mscoree-CorValidateImage/0001-mscoree-Implement-_CorValidateImage.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/mscoree-CorValidateImage/0001-mscoree-Implement-_CorValidateImage.patch 2015-07-29 19:51:42.000000000 +0000 @@ -1,14 +1,14 @@ -From 8a95b2a4647c5a92cc2f91b3baaaf2b9756176b1 Mon Sep 17 00:00:00 2001 +From 9a13889280aaedf1219b4f41000fd02f343a4a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 2 Apr 2015 02:38:29 +0200 -Subject: mscoree: Implement _CorValidateImage. +Subject: mscoree: Implement _CorValidateImage. (v2) --- dlls/mscoree/mscoree_main.c | 74 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/dlls/mscoree/mscoree_main.c b/dlls/mscoree/mscoree_main.c -index 8b46fd5..3644a18 100644 +index 8b46fd5..327fcb9 100644 --- a/dlls/mscoree/mscoree_main.c +++ b/dlls/mscoree/mscoree_main.c @@ -21,11 +21,14 @@ @@ -49,7 +49,7 @@ + if (!cliheader || size < sizeof(*cliheader)) + return STATUS_INVALID_IMAGE_FORMAT; + -+#ifdef __x86_64__ ++#ifdef _WIN64 + if (cliheader->Flags & COMIMAGE_FLAGS_32BITREQUIRED) + return STATUS_INVALID_IMAGE_FORMAT; + @@ -105,5 +105,5 @@ HRESULT WINAPI GetCORSystemDirectory(LPWSTR pbuffer, DWORD cchBuffer, DWORD *dwLength) -- -2.3.5 +2.4.5 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-CLI_Images/0001-ntdll-Load-CLI-.NET-images-in-the-same-way-as-Window.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-CLI_Images/0001-ntdll-Load-CLI-.NET-images-in-the-same-way-as-Window.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-CLI_Images/0001-ntdll-Load-CLI-.NET-images-in-the-same-way-as-Window.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-CLI_Images/0001-ntdll-Load-CLI-.NET-images-in-the-same-way-as-Window.patch 2015-07-29 19:51:42.000000000 +0000 @@ -1,4 +1,4 @@ -From 16bb8ba07739f3c189920cdbf56f87aa520456c0 Mon Sep 17 00:00:00 2001 +From f4024fac3fba56c007fa873a66271eef4f6c31ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Wed, 1 Apr 2015 04:34:20 +0200 Subject: ntdll: Load CLI/.NET images in the same way as Windows XP and above. @@ -9,7 +9,7 @@ 2 files changed, 133 insertions(+), 10 deletions(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c -index 2c8074b..5810080 100644 +index 1cd6e47..4d985d4 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -1079,16 +1079,11 @@ static inline DWORD call_process_entry( PEB *peb, LPTHREAD_START_ROUTINE entry ) @@ -33,11 +33,11 @@ ERR( "%s doesn't have an entry point, it cannot be executed\n", debugstr_w(peb->ProcessParameters->ImagePathName.Buffer) ); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 9810f07..18f20fe 100644 +index bef0ab1..2dd8ad0 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -97,6 +97,10 @@ static UINT tls_module_count; /* number of modules with TLS directory */ - static const IMAGE_TLS_DIRECTORY **tls_dirs; /* array of TLS directories */ + static IMAGE_TLS_DIRECTORY *tls_dirs; /* array of TLS directories */ LIST_ENTRY tls_links = { &tls_links, &tls_links }; +static HRESULT (WINAPI *p_CorValidateImage)(PVOID* ImageBase, LPCWSTR FileName); @@ -126,7 +126,7 @@ * get_modref * * Looks for the referenced HMODULE in the current process -@@ -863,6 +939,10 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path ) +@@ -868,6 +944,10 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path ) if (!(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS)) return STATUS_SUCCESS; /* already done */ wm->ldr.Flags &= ~LDR_DONT_RESOLVE_REFS; @@ -137,7 +137,7 @@ wm->ldr.TlsIndex = alloc_tls_slot( &wm->ldr ); if (!(imports = RtlImageDirectoryEntryToData( wm->ldr.BaseAddress, TRUE, -@@ -1058,8 +1138,43 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved +@@ -1063,8 +1143,43 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved BOOL retv = FALSE; /* Skip calls for modules loaded with special load flags */ @@ -182,7 +182,7 @@ if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.BaseAddress, reason ); if (!entry || !(wm->ldr.Flags & LDR_IMAGE_IS_DLL)) return STATUS_SUCCESS; -@@ -2865,7 +2980,20 @@ static void load_global_options(void) +@@ -2870,7 +2985,20 @@ static void load_global_options(void) */ static void start_process( void *kernel_start ) { @@ -205,5 +205,5 @@ /****************************************************************** -- -2.3.3 +2.4.5 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Coverity/0001-ntdll-Fix-incorrect-assignment-in-assert-statement-C.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Coverity/0001-ntdll-Fix-incorrect-assignment-in-assert-statement-C.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Coverity/0001-ntdll-Fix-incorrect-assignment-in-assert-statement-C.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Coverity/0001-ntdll-Fix-incorrect-assignment-in-assert-statement-C.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From 4ffe94b77e7f50263d8e3ae5f3466a757f9d9d4e Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 11 Jul 2015 15:28:27 +0200 -Subject: ntdll: Fix incorrect assignment in assert statement (Coverity). - ---- - dlls/ntdll/threadpool.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c -index a4e0619..23091f3 100644 ---- a/dlls/ntdll/threadpool.c -+++ b/dlls/ntdll/threadpool.c -@@ -1598,7 +1598,7 @@ static NTSTATUS tp_waitqueue_lock( struct threadpool_object *wait ) - struct waitqueue_bucket *bucket; - NTSTATUS status; - HANDLE thread; -- assert( wait->type = TP_OBJECT_TYPE_WAIT ); -+ assert( wait->type == TP_OBJECT_TYPE_WAIT ); - - wait->u.wait.signaled = 0; - wait->u.wait.bucket = NULL; --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-DllRedirects/0005-ntdll-Implement-loader-redirection-scheme.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-DllRedirects/0005-ntdll-Implement-loader-redirection-scheme.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-DllRedirects/0005-ntdll-Implement-loader-redirection-scheme.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-DllRedirects/0005-ntdll-Implement-loader-redirection-scheme.patch 2015-07-29 19:51:42.000000000 +0000 @@ -1,4 +1,4 @@ -From ea4f613ec5b7e4cdc5cb9d850f66c194af9eb5e6 Mon Sep 17 00:00:00 2001 +From a76e0d5f4e8211975ede9f1bf65522a31114112a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 13 Dec 2014 05:34:48 +0100 Subject: ntdll: Implement loader redirection scheme. @@ -8,10 +8,10 @@ 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index e1444d2..c392f72 100644 +index 0486517..7877f04 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -87,6 +87,7 @@ struct builtin_load_info +@@ -85,6 +85,7 @@ struct builtin_load_info { const WCHAR *load_path; const WCHAR *filename; @@ -19,7 +19,7 @@ NTSTATUS status; WINE_MODREF *wm; }; -@@ -112,7 +113,8 @@ static WINE_MODREF *cached_modref; +@@ -110,7 +111,8 @@ static WINE_MODREF *cached_modref; static WINE_MODREF *current_modref; static WINE_MODREF *last_failed_modref; @@ -29,7 +29,7 @@ static NTSTATUS process_attach( WINE_MODREF *wm, LPVOID lpReserved ); static FARPROC find_ordinal_export( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports, DWORD exp_size, DWORD ordinal, LPCWSTR load_path ); -@@ -438,7 +440,7 @@ static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWS +@@ -436,7 +438,7 @@ static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWS if (!(wm = find_basename_module( mod_name ))) { TRACE( "delay loading %s for '%s'\n", debugstr_w(mod_name), forward ); @@ -38,7 +38,7 @@ !(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS)) { if (process_attach( wm, NULL ) != STATUS_SUCCESS) -@@ -587,7 +589,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d +@@ -585,7 +587,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d { ascii_to_unicode( buffer, name, len ); buffer[len] = 0; @@ -47,7 +47,7 @@ } else /* need to allocate a larger buffer */ { -@@ -595,7 +597,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d +@@ -593,7 +595,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d if (!ptr) return NULL; ascii_to_unicode( ptr, name, len ); ptr[len] = 0; @@ -56,7 +56,7 @@ RtlFreeHeap( GetProcessHeap(), 0, ptr ); } -@@ -906,7 +908,7 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path ) +@@ -909,7 +911,7 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path ) * Allocate a WINE_MODREF structure and add it to the process list * The loader_section must be locked while calling this function. */ @@ -65,7 +65,7 @@ { WINE_MODREF *wm; const WCHAR *p; -@@ -929,7 +931,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename ) +@@ -932,7 +934,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename ) wm->ldr.TimeDateStamp = 0; wm->ldr.ActivationContext = 0; @@ -74,7 +74,7 @@ if ((p = strrchrW( wm->ldr.FullDllName.Buffer, '\\' ))) p++; else p = wm->ldr.FullDllName.Buffer; RtlInitUnicodeString( &wm->ldr.BaseDllName, p ); -@@ -1546,7 +1548,7 @@ static void load_builtin_callback( void *module, const char *filename ) +@@ -1549,7 +1551,7 @@ static void load_builtin_callback( void *module, const char *filename ) return; } @@ -83,7 +83,7 @@ RtlFreeHeap( GetProcessHeap(), 0, fullname ); if (!wm) { -@@ -1602,8 +1604,8 @@ static void load_builtin_callback( void *module, const char *filename ) +@@ -1605,8 +1607,8 @@ static void load_builtin_callback( void *module, const char *filename ) /****************************************************************************** * load_native_dll (internal) */ @@ -94,7 +94,7 @@ { void *module; HANDLE mapping; -@@ -1627,7 +1629,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file, +@@ -1630,7 +1632,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file, /* create the MODREF */ @@ -103,7 +103,7 @@ { status = STATUS_NO_MEMORY; goto done; -@@ -1689,8 +1691,8 @@ done: +@@ -1692,8 +1694,8 @@ done: /*********************************************************************** * load_builtin_dll */ @@ -114,7 +114,7 @@ { char error[256], dllname[MAX_PATH]; const WCHAR *name, *p; -@@ -1710,6 +1712,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file, +@@ -1713,6 +1715,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file, */ info.load_path = load_path; info.filename = NULL; @@ -122,7 +122,7 @@ info.status = STATUS_SUCCESS; info.wm = NULL; -@@ -2028,14 +2031,14 @@ overflow: +@@ -2153,14 +2156,14 @@ overflow: return STATUS_BUFFER_TOO_SMALL; } @@ -137,9 +137,9 @@ +static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, LPCWSTR fakemodule, + DWORD flags, WINE_MODREF** pwm ) { + BOOL data = flags & (LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE); enum loadorder loadorder; - WCHAR buffer[32]; -@@ -2072,6 +2075,25 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ +@@ -2198,6 +2201,25 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ } main_exe = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress ); @@ -165,7 +165,7 @@ loadorder = get_load_order( main_exe ? main_exe->ldr.BaseDllName.Buffer : NULL, filename ); if (handle && is_fake_dll( handle )) -@@ -2094,22 +2116,22 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ +@@ -2220,22 +2242,22 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ if (!handle) nts = STATUS_DLL_NOT_FOUND; else { @@ -193,7 +193,7 @@ if (nts == STATUS_SUCCESS && loadorder == LO_DEFAULT && (MODULE_InitDLL( *pwm, DLL_WINE_PREATTACH, NULL ) != STATUS_SUCCESS)) { -@@ -2119,7 +2141,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ +@@ -2245,7 +2267,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ nts = STATUS_DLL_NOT_FOUND; } if (nts == STATUS_DLL_NOT_FOUND && loadorder != LO_BUILTIN) @@ -202,7 +202,7 @@ break; } -@@ -2152,7 +2174,7 @@ NTSTATUS WINAPI DECLSPEC_HOTPATCH LdrLoadDll(LPCWSTR path_name, DWORD flags, +@@ -2278,7 +2300,7 @@ NTSTATUS WINAPI DECLSPEC_HOTPATCH LdrLoadDll(LPCWSTR path_name, DWORD flags, RtlEnterCriticalSection( &loader_section ); if (!path_name) path_name = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; @@ -211,7 +211,7 @@ if (nts == STATUS_SUCCESS && !(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS)) { -@@ -3115,7 +3137,7 @@ void __wine_process_init(void) +@@ -3241,7 +3263,7 @@ void __wine_process_init(void) /* setup the load callback and create ntdll modref */ wine_dll_set_callback( load_builtin_callback ); @@ -221,5 +221,5 @@ MESSAGE( "wine: could not load kernel32.dll, status %x\n", status ); exit(1); -- -1.9.1 +2.4.5 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-DllRedirects/definition wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-DllRedirects/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-DllRedirects/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-DllRedirects/definition 2015-07-29 19:51:42.000000000 +0000 @@ -1,2 +1,3 @@ Fixes: Support for loader dll redirections +Depends: ntdll-Loader_Machine_Type Category: stable diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Loader_Machine_Type/0001-ntdll-Check-architecture-before-loading-module.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Loader_Machine_Type/0001-ntdll-Check-architecture-before-loading-module.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Loader_Machine_Type/0001-ntdll-Check-architecture-before-loading-module.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Loader_Machine_Type/0001-ntdll-Check-architecture-before-loading-module.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,206 @@ +From a9e0627c59b5ddf2f91d5ceea61a0401afc27ce4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 18 Jul 2015 04:52:55 +0200 +Subject: ntdll: Check architecture before loading module. + +--- + dlls/ntdll/loader.c | 139 +++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 131 insertions(+), 8 deletions(-) + +diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c +index bef0ab1..0486517 100644 +--- a/dlls/ntdll/loader.c ++++ b/dlls/ntdll/loader.c +@@ -1911,6 +1911,108 @@ done: + return status; + } + ++#if defined(__i386__) ++#define CURRENT_ARCH IMAGE_FILE_MACHINE_I386 ++#elif defined(__x86_64__) ++#define CURRENT_ARCH IMAGE_FILE_MACHINE_AMD64 ++#elif defined(__arm__) ++#define CURRENT_ARCH IMAGE_FILE_MACHINE_ARM ++#elif defined(__aarch64__) ++#define CURRENT_ARCH IMAGE_FILE_MACHINE_ARM64 ++#endif ++ ++/*********************************************************************** ++ * get_machine_type (internal) ++ * ++ * Determines the machine type of a module. Based on the code in ++ * dlls/kernel32/module.c. ++ */ ++static WORD get_machine_type( HANDLE hfile ) ++{ ++ union ++ { ++ struct ++ { ++ unsigned char magic[4]; ++ unsigned char class; ++ unsigned char data; ++ unsigned char version; ++ unsigned char ignored[9]; ++ unsigned short type; ++ unsigned short machine; ++ } elf; ++ struct ++ { ++ unsigned int magic; ++ unsigned int cputype; ++ unsigned int cpusubtype; ++ unsigned int filetype; ++ } macho; ++ IMAGE_DOS_HEADER mz; ++ } header; ++ ++ IO_STATUS_BLOCK io; ++ LARGE_INTEGER offset; ++ ++ /* Seek to the start of the file and read the header information. */ ++ offset.QuadPart = 0; ++ if (NtReadFile( hfile, 0, NULL, 0, &io, &header, sizeof(header), &offset, NULL )) return 0; ++ if (io.Information < sizeof(header)) return 0; ++ ++ if (!memcmp( header.elf.magic, "\177ELF", 4 )) ++ { ++#ifdef WORDS_BIGENDIAN ++ if (header.elf.data == 1) ++#else ++ if (header.elf.data == 2) ++#endif ++ { ++ header.elf.machine = RtlUshortByteSwap( header.elf.machine ); ++ } ++ ++ switch(header.elf.machine) ++ { ++ case 3: return IMAGE_FILE_MACHINE_I386; ++ case 20: return IMAGE_FILE_MACHINE_POWERPC; ++ case 40: return IMAGE_FILE_MACHINE_ARMNT; ++ case 50: return IMAGE_FILE_MACHINE_IA64; ++ case 62: return IMAGE_FILE_MACHINE_AMD64; ++ case 183: return IMAGE_FILE_MACHINE_ARM64; ++ default: return 0; ++ } ++ } ++ /* Mach-o File with Endian set to Big Endian or Little Endian */ ++ else if (header.macho.magic == 0xfeedface || header.macho.magic == 0xcefaedfe || ++ header.macho.magic == 0xfeedfacf || header.macho.magic == 0xcffaedfe) ++ { ++ if (header.macho.magic == 0xcefaedfe || header.macho.magic == 0xcffaedfe) ++ header.macho.cputype = RtlUlongByteSwap( header.macho.cputype ); ++ ++ switch(header.macho.cputype) ++ { ++ case 0x00000007: return IMAGE_FILE_MACHINE_I386; ++ case 0x01000007: return IMAGE_FILE_MACHINE_AMD64; ++ case 0x0000000c: return IMAGE_FILE_MACHINE_ARMNT; ++ case 0x0100000c: return IMAGE_FILE_MACHINE_ARM64; ++ case 0x00000012: return IMAGE_FILE_MACHINE_POWERPC; ++ default: return 0; ++ } ++ } ++ /* Not ELF, try DOS */ ++ else if (header.mz.e_magic == IMAGE_DOS_SIGNATURE) ++ { ++ IMAGE_NT_HEADERS32 ext_header; ++ ++ offset.QuadPart = header.mz.e_lfanew; ++ if (NtReadFile( hfile, 0, NULL, 0, &io, &ext_header, sizeof(ext_header), &offset, NULL )) return 0; ++ if (io.Information < sizeof(ext_header)) return 0; ++ ++ if (!memcmp( &ext_header.Signature, "PE\0\0", 4 )) ++ return ext_header.FileHeader.Machine; ++ } ++ ++ return 0; ++} + + /*********************************************************************** + * find_dll_file +@@ -1918,7 +2020,8 @@ done: + * Find the file (or already loaded module) for a given dll name. + */ + static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, +- WCHAR *filename, ULONG *size, WINE_MODREF **pwm, HANDLE *handle ) ++ WCHAR *filename, ULONG *size, WINE_MODREF **pwm, HANDLE *handle, ++ BOOL check_arch) + { + OBJECT_ATTRIBUTES attr; + IO_STATUS_BLOCK io; +@@ -1964,12 +2067,15 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, + + if (RtlDetermineDosPathNameType_U( libname ) == RELATIVE_PATH) + { +- /* we need to search for it */ +- len = RtlDosSearchPath_U( load_path, libname, NULL, *size, filename, &file_part ); +- if (len) ++ while (load_path) + { ++ /* we need to search for it */ ++ len = RtlDosSearchPath_U( load_path, libname, NULL, *size, filename, &file_part ); ++ if (!len) break; ++ + if (len >= *size) goto overflow; +- if ((*pwm = find_fullname_module( filename )) || !handle) goto found; ++ if ((*pwm = find_fullname_module( filename ))) goto found; ++ if (!handle) goto next; + + if (!RtlDosPathNameToNtPathName_U( filename, &nt_name, NULL, NULL )) + { +@@ -1983,7 +2089,23 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + if (NtOpenFile( handle, GENERIC_READ, &attr, &io, FILE_SHARE_READ|FILE_SHARE_DELETE, FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FILE )) *handle = 0; +- goto found; ++ #ifdef CURRENT_ARCH ++ if (*handle && check_arch) ++ { ++ WORD machine_type = get_machine_type( *handle ); ++ if (machine_type && machine_type != CURRENT_ARCH) ++ { ++ FIXME( "skipping %s because of wrong architecture\n", debugstr_w(filename) ); ++ NtClose( *handle ); ++ *handle = 0; ++ } ++ } ++ #endif ++ if (*handle) goto found; ++ ++ next: ++ load_path = strchrW(load_path, ';'); ++ if (load_path) load_path++; + } + + /* not found */ +@@ -2040,6 +2162,7 @@ overflow: + */ + static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_MODREF** pwm ) + { ++ BOOL data = flags & (LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE); + enum loadorder loadorder; + WCHAR buffer[32]; + WCHAR *filename; +@@ -2055,7 +2178,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ + size = sizeof(buffer); + for (;;) + { +- nts = find_dll_file( load_path, libname, filename, &size, pwm, &handle ); ++ nts = find_dll_file( load_path, libname, filename, &size, pwm, &handle, !data ); + if (nts == STATUS_SUCCESS) break; + if (filename != buffer) RtlFreeHeap( GetProcessHeap(), 0, filename ); + if (nts != STATUS_BUFFER_TOO_SMALL) return nts; +@@ -2192,7 +2315,7 @@ NTSTATUS WINAPI LdrGetDllHandle( LPCWSTR load_path, ULONG flags, const UNICODE_S + size = sizeof(buffer); + for (;;) + { +- status = find_dll_file( load_path, name->Buffer, filename, &size, &wm, NULL ); ++ status = find_dll_file( load_path, name->Buffer, filename, &size, &wm, NULL, TRUE ); + if (filename != buffer) RtlFreeHeap( GetProcessHeap(), 0, filename ); + if (status != STATUS_BUFFER_TOO_SMALL) break; + /* grow the buffer and retry */ +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Loader_Machine_Type/definition wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Loader_Machine_Type/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Loader_Machine_Type/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Loader_Machine_Type/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [38021] Check architecture before trying to load libraries diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Revert_Security_Cookie/0001-Revert-ntdll-Randomize-security-cookie-when-availabl.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Revert_Security_Cookie/0001-Revert-ntdll-Randomize-security-cookie-when-availabl.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Revert_Security_Cookie/0001-Revert-ntdll-Randomize-security-cookie-when-availabl.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Revert_Security_Cookie/0001-Revert-ntdll-Randomize-security-cookie-when-availabl.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -From 2322a6e69849a1537724b0fe7dd08a3edea83e0c Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Fri, 10 Jul 2015 20:40:01 +0200 -Subject: Revert "ntdll: Randomize security cookie when available." - -This reverts commit 7e1c886fbfd362376b6aebe5381ab7d4433c3371. ---- - dlls/ntdll/virtual.c | 20 -------------------- - 1 file changed, 20 deletions(-) - -diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c -index 410e060..bc3f7cd 100644 ---- a/dlls/ntdll/virtual.c -+++ b/dlls/ntdll/virtual.c -@@ -1067,8 +1067,6 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz - IMAGE_SECTION_HEADER sections[96]; - IMAGE_SECTION_HEADER *sec; - IMAGE_DATA_DIRECTORY *imports; -- IMAGE_LOAD_CONFIG_DIRECTORY *loadcfg; -- ULONG loadcfg_size; - NTSTATUS status = STATUS_CONFLICTING_ADDRESSES; - int i; - off_t pos; -@@ -1280,24 +1278,6 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz - } - } - -- /* randomize security cookie */ -- -- loadcfg = RtlImageDirectoryEntryToData( (HMODULE)ptr, TRUE, -- IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG, &loadcfg_size ); -- if (loadcfg && loadcfg_size >= sizeof(*loadcfg)) -- { -- static ULONG seed; -- ULONG_PTR *cookie = (ULONG_PTR *)loadcfg->SecurityCookie; -- -- if (!seed) seed = NtGetTickCount() ^ GetCurrentProcessId(); -- if (cookie) -- { -- *cookie = RtlRandom( &seed ); -- if (sizeof(ULONG_PTR) > sizeof(ULONG)) /* fill up, but keep the highest word clear */ -- *cookie ^= (ULONG_PTR)RtlRandom( &seed ) << 16; -- } -- } -- - /* set the image protections */ - - VIRTUAL_SetProt( view, ptr, ROUND_SIZE( 0, header_size ), VPROT_COMMITTED | VPROT_READ ); --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Revert_Security_Cookie/definition wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Revert_Security_Cookie/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Revert_Security_Cookie/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Revert_Security_Cookie/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -# Fixes: [38897] Revert patch causing crash in Word Viewer when opening docx files -Fixes: [38895] Revert patch causing crash in IrfanView when using the WebP plugin diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Security_Cookie/0001-ntdll-Handle-partial-image-load-config-structs.-try-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Security_Cookie/0001-ntdll-Handle-partial-image-load-config-structs.-try-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Security_Cookie/0001-ntdll-Handle-partial-image-load-config-structs.-try-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Security_Cookie/0001-ntdll-Handle-partial-image-load-config-structs.-try-.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,39 @@ +From 85b9819021a4e4b8f31050f5e894eb36b56e8cba Mon Sep 17 00:00:00 2001 +From: Martin Storsjo +Date: Thu, 23 Jul 2015 10:36:06 +0300 +Subject: ntdll: Handle partial image load config structs. (try 3) + +Some DLLs have a struct that only is large enough to contain the fields +that are relevant. Don't require the full struct to be available; +only make sure that it is large enough to contain the SecurityCookie +field. + +This fixes loading ucrtbase.dll (from the redistributable visual +studio 2015 c++ runtime), which requires the security cookie to be +initialized. The 32 bit version of this DLL had loadcfg_size == 64, +where offsetof(IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie) == 60. +That is, SecurityCookie is the last field included in the struct in +that case. + +This fixes loading ucrtbase.dll. +--- + dlls/ntdll/virtual.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c +index ff947da..479ca79 100644 +--- a/dlls/ntdll/virtual.c ++++ b/dlls/ntdll/virtual.c +@@ -1320,7 +1320,8 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz + + loadcfg = RtlImageDirectoryEntryToData( (HMODULE)ptr, TRUE, + IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG, &loadcfg_size ); +- if (loadcfg && loadcfg_size >= sizeof(*loadcfg)) ++ if (loadcfg && ++ loadcfg_size >= offsetof(IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie) + sizeof(loadcfg->SecurityCookie)) + set_security_cookie((ULONG_PTR *)loadcfg->SecurityCookie); + + /* set the image protections */ +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Security_Cookie/0002-ntdll-Validate-SecurityCookie-pointer-before-derefer.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Security_Cookie/0002-ntdll-Validate-SecurityCookie-pointer-before-derefer.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Security_Cookie/0002-ntdll-Validate-SecurityCookie-pointer-before-derefer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Security_Cookie/0002-ntdll-Validate-SecurityCookie-pointer-before-derefer.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,30 @@ +From e365fdbc966b3aab4dbfced4c651965cc8cd9c23 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 21 Jul 2015 20:33:47 +0200 +Subject: ntdll: Validate SecurityCookie pointer before dereferencing. + +--- + dlls/ntdll/virtual.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c +index 479ca79..2fd8198 100644 +--- a/dlls/ntdll/virtual.c ++++ b/dlls/ntdll/virtual.c +@@ -1320,9 +1320,11 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz + + loadcfg = RtlImageDirectoryEntryToData( (HMODULE)ptr, TRUE, + IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG, &loadcfg_size ); +- if (loadcfg && +- loadcfg_size >= offsetof(IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie) + sizeof(loadcfg->SecurityCookie)) ++ if (loadcfg && loadcfg_size >= offsetof(IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie) + sizeof(loadcfg->SecurityCookie) && ++ (ULONG_PTR)ptr <= loadcfg->SecurityCookie && loadcfg->SecurityCookie <= (ULONG_PTR)ptr + total_size - sizeof(ULONG_PTR)) ++ { + set_security_cookie((ULONG_PTR *)loadcfg->SecurityCookie); ++ } + + /* set the image protections */ + +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Security_Cookie/definition wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Security_Cookie/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Security_Cookie/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Security_Cookie/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,2 @@ +Fixes: Fix loading of libraries with incomplete IMAGE_LOAD_CONFIG_DIRECTORY struct +Fixes: [38949] Fix security cookie handling for UPX compressed executables diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Threading/0002-ntdll-Avoid-deadlock-by-using-_exit-in-NtTerminatePr.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Threading/0002-ntdll-Avoid-deadlock-by-using-_exit-in-NtTerminatePr.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Threading/0002-ntdll-Avoid-deadlock-by-using-_exit-in-NtTerminatePr.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Threading/0002-ntdll-Avoid-deadlock-by-using-_exit-in-NtTerminatePr.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -From c16a0e4ac4e504a66a3337c0487da33100aab0a5 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Wed, 25 Feb 2015 21:33:36 +0100 -Subject: ntdll: Avoid deadlock by using _exit() in NtTerminateProcess. - -Other threads are killed with SIGQUIT, so there is no guarantee that we can -terminate properly with exit(). ---- - dlls/ntdll/process.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c -index 3ac8d52..d20e107 100644 ---- a/dlls/ntdll/process.c -+++ b/dlls/ntdll/process.c -@@ -21,11 +21,16 @@ - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -+#include "config.h" -+ - #include - #include - #include - #include - #include -+#ifdef HAVE_UNISTD_H -+# include -+#endif - - #include "ntstatus.h" - #define WIN32_NO_STATUS -@@ -60,7 +65,7 @@ NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code ) - self = !ret && reply->self; - } - SERVER_END_REQ; -- if (self && handle) exit( exit_code ); -+ if (self && handle) _exit( exit_code ); - return ret; - } - --- -2.3.0 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Threadpool/0001-ntdll-Mark-newly-spawned-worker-threads-as-busy-to-a.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Threadpool/0001-ntdll-Mark-newly-spawned-worker-threads-as-busy-to-a.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Threadpool/0001-ntdll-Mark-newly-spawned-worker-threads-as-busy-to-a.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Threadpool/0001-ntdll-Mark-newly-spawned-worker-threads-as-busy-to-a.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,66 @@ +From b6b846e842cf3d526dfe7b0a4a3f61a6139ab587 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Wed, 29 Jul 2015 20:57:24 +0200 +Subject: ntdll: Mark newly spawned worker threads as busy to avoid problems + with long-running tasks. + +--- + dlls/ntdll/threadpool.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c +index ad4951f..8605a22 100644 +--- a/dlls/ntdll/threadpool.c ++++ b/dlls/ntdll/threadpool.c +@@ -379,6 +379,8 @@ NTSTATUS WINAPI RtlQueueWorkItem( PRTL_WORK_ITEM_ROUTINE function, PVOID context + struct rtl_work_item *item; + NTSTATUS status; + ++ TRACE( "%p %p %u\n", function, context, flags ); ++ + item = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*item) ); + if (!item) + return STATUS_NO_MEMORY; +@@ -1716,6 +1718,7 @@ static NTSTATUS tp_threadpool_lock( struct threadpool **out, TP_CALLBACK_ENVIRON + { + interlocked_inc( &pool->refcount ); + pool->num_workers++; ++ pool->num_busy_workers++; + NtClose( thread ); + } + } +@@ -1915,6 +1918,7 @@ static void tp_object_submit( struct threadpool_object *object, BOOL signaled ) + { + interlocked_inc( &pool->refcount ); + pool->num_workers++; ++ pool->num_busy_workers++; + NtClose( thread ); + } + } +@@ -2070,6 +2074,7 @@ static void CALLBACK threadpool_worker_proc( void *param ) + TRACE( "starting worker thread for pool %p\n", pool ); + + RtlEnterCriticalSection( &pool->cs ); ++ pool->num_busy_workers--; + for (;;) + { + while ((ptr = list_head( &pool->pool ))) +@@ -2412,6 +2417,7 @@ NTSTATUS WINAPI TpCallbackMayRunLong( TP_CALLBACK_INSTANCE *instance ) + { + interlocked_inc( &pool->refcount ); + pool->num_workers++; ++ pool->num_busy_workers++; + NtClose( thread ); + } + } +@@ -2699,6 +2705,7 @@ BOOL WINAPI TpSetPoolMinThreads( TP_POOL *pool, DWORD minimum ) + + interlocked_inc( &this->refcount ); + this->num_workers++; ++ this->num_busy_workers++; + NtClose( thread ); + } + +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Threadpool/definition wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Threadpool/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-Threadpool/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-Threadpool/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Avoid race-conditions with long running threadpool tasks diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0001-server-Use-a-separate-wineserver-call-to-fetch-threa.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0001-server-Use-a-separate-wineserver-call-to-fetch-threa.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0001-server-Use-a-separate-wineserver-call-to-fetch-threa.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0001-server-Use-a-separate-wineserver-call-to-fetch-threa.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,95 @@ +From e2a835f8bd13694cf23c833548f0f55eabdca09a Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Mon, 27 Jul 2015 18:30:53 +0200 +Subject: server: Use a separate wineserver call to fetch thread times. + (resend) + +Changes in v2: + * I saw that we already pass the entry point in init_thread() to the wineserver, + so no need to change wineserver calls. Patch 2 and 3 have been merged because + the code looks much easier now. + +No changes in this patch. +--- + dlls/ntdll/thread.c | 6 ++---- + server/protocol.def | 11 +++++++++-- + server/thread.c | 14 +++++++++++++- + 3 files changed, 24 insertions(+), 7 deletions(-) + +diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c +index 3696c8e..2781827 100644 +--- a/dlls/ntdll/thread.c ++++ b/dlls/ntdll/thread.c +@@ -962,12 +962,10 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, + case ThreadTimes: + { + KERNEL_USER_TIMES kusrt; +- /* We need to do a server call to get the creation time or exit time */ +- /* This works on any thread */ +- SERVER_START_REQ( get_thread_info ) ++ ++ SERVER_START_REQ( get_thread_times ) + { + req->handle = wine_server_obj_handle( handle ); +- req->tid_in = 0; + status = wine_server_call( req ); + if (status == STATUS_SUCCESS) + { +diff --git a/server/protocol.def b/server/protocol.def +index 0ff1a6b..3d7f7be 100644 +--- a/server/protocol.def ++++ b/server/protocol.def +@@ -842,14 +842,21 @@ struct rawinput_device + thread_id_t tid; /* server thread id */ + client_ptr_t teb; /* thread teb pointer */ + affinity_t affinity; /* thread affinity mask */ +- timeout_t creation_time; /* thread creation time */ +- timeout_t exit_time; /* thread exit time */ + int exit_code; /* thread exit code */ + int priority; /* thread priority level */ + int last; /* last thread in process */ + @END + + ++/* Retrieve information about thread times */ ++@REQ(get_thread_times) ++ obj_handle_t handle; /* thread handle */ ++@REPLY ++ timeout_t creation_time; /* thread creation time */ ++ timeout_t exit_time; /* thread exit time */ ++@END ++ ++ + /* Set a thread information */ + @REQ(set_thread_info) + obj_handle_t handle; /* thread handle */ +diff --git a/server/thread.c b/server/thread.c +index 8471651..b8c73c6 100644 +--- a/server/thread.c ++++ b/server/thread.c +@@ -1374,9 +1374,21 @@ DECL_HANDLER(get_thread_info) + reply->exit_code = (thread->state == TERMINATED) ? thread->exit_code : STATUS_PENDING; + reply->priority = thread->priority; + reply->affinity = thread->affinity; ++ reply->last = thread->process->running_threads == 1; ++ ++ release_object( thread ); ++ } ++} ++ ++/* fetch information about thread times */ ++DECL_HANDLER(get_thread_times) ++{ ++ struct thread *thread; ++ ++ if ((thread = get_thread_from_handle( req->handle, THREAD_QUERY_INFORMATION ))) ++ { + reply->creation_time = thread->creation_time; + reply->exit_time = thread->exit_time; +- reply->last = thread->process->running_threads == 1; + + release_object( thread ); + } +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0002-ntdll-Implement-ThreadQuerySetWin32StartAddress-info.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0002-ntdll-Implement-ThreadQuerySetWin32StartAddress-info.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0002-ntdll-Implement-ThreadQuerySetWin32StartAddress-info.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0002-ntdll-Implement-ThreadQuerySetWin32StartAddress-info.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,111 @@ +From 11c840163c21b92b8e67844f18ade51f0f6905e0 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Mon, 27 Jul 2015 18:31:11 +0200 +Subject: ntdll: Implement ThreadQuerySetWin32StartAddress info class in + NtSetInformationThread. (v2) + +This implements the pre-Vista version, where the entry point can be changed. +--- + dlls/ntdll/thread.c | 16 ++++++++++++++-- + server/protocol.def | 8 +++++--- + server/thread.c | 4 ++++ + server/thread.h | 1 + + 4 files changed, 24 insertions(+), 5 deletions(-) + +diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c +index 2781827..3e95fd4 100644 +--- a/dlls/ntdll/thread.c ++++ b/dlls/ntdll/thread.c +@@ -1203,14 +1203,26 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class, + case ThreadHideFromDebugger: + /* pretend the call succeeded to satisfy some code protectors */ + return STATUS_SUCCESS; +- ++ case ThreadQuerySetWin32StartAddress: ++ { ++ const PRTL_THREAD_START_ROUTINE *entry = data; ++ if (length != sizeof(PRTL_THREAD_START_ROUTINE)) return STATUS_INVALID_PARAMETER; ++ SERVER_START_REQ( set_thread_info ) ++ { ++ req->handle = wine_server_obj_handle( handle ); ++ req->mask = SET_THREAD_INFO_ENTRYPOINT; ++ req->entry_point = wine_server_client_ptr( *entry ); ++ status = wine_server_call( req ); ++ } ++ SERVER_END_REQ; ++ } ++ return status; + case ThreadBasicInformation: + case ThreadTimes: + case ThreadPriority: + case ThreadDescriptorTableEntry: + case ThreadEnableAlignmentFaultFixup: + case ThreadEventPair_Reusable: +- case ThreadQuerySetWin32StartAddress: + case ThreadPerformanceCount: + case ThreadAmILastThread: + case ThreadIdealProcessor: +diff --git a/server/protocol.def b/server/protocol.def +index 3d7f7be..47cedff 100644 +--- a/server/protocol.def ++++ b/server/protocol.def +@@ -864,10 +864,12 @@ struct rawinput_device + int priority; /* priority class */ + affinity_t affinity; /* affinity mask */ + obj_handle_t token; /* impersonation token */ ++ client_ptr_t entry_point; /* thread entry point */ + @END +-#define SET_THREAD_INFO_PRIORITY 0x01 +-#define SET_THREAD_INFO_AFFINITY 0x02 +-#define SET_THREAD_INFO_TOKEN 0x04 ++#define SET_THREAD_INFO_PRIORITY 0x01 ++#define SET_THREAD_INFO_AFFINITY 0x02 ++#define SET_THREAD_INFO_TOKEN 0x04 ++#define SET_THREAD_INFO_ENTRYPOINT 0x08 + + + /* Retrieve information about a module */ +diff --git a/server/thread.c b/server/thread.c +index b8c73c6..f020908 100644 +--- a/server/thread.c ++++ b/server/thread.c +@@ -175,6 +175,7 @@ static inline void init_thread_structure( struct thread *thread ) + thread->context = NULL; + thread->suspend_context = NULL; + thread->teb = 0; ++ thread->entry_point = 0; + thread->debug_ctx = NULL; + thread->debug_event = NULL; + thread->debug_break = 0; +@@ -497,6 +498,8 @@ static void set_thread_info( struct thread *thread, + } + if (req->mask & SET_THREAD_INFO_TOKEN) + security_set_thread_token( thread, req->token ); ++ if (req->mask & SET_THREAD_INFO_ENTRYPOINT) ++ thread->entry_point = req->entry_point; + } + + /* stop a thread (at the Unix level) */ +@@ -1284,6 +1287,7 @@ DECL_HANDLER(init_thread) + current->unix_pid = req->unix_pid; + current->unix_tid = req->unix_tid; + current->teb = req->teb; ++ current->entry_point = req->entry; + + if (!process->peb) /* first thread, initialize the process too */ + { +diff --git a/server/thread.h b/server/thread.h +index 996d95b..2821991 100644 +--- a/server/thread.h ++++ b/server/thread.h +@@ -79,6 +79,7 @@ struct thread + context_t *context; /* current context if in an exception handler */ + context_t *suspend_context; /* current context if suspended */ + client_ptr_t teb; /* TEB address (in client address space) */ ++ client_ptr_t entry_point; /* entry point (in client address space) */ + affinity_t affinity; /* affinity mask */ + int priority; /* priority level */ + int suspend; /* suspend count */ +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0003-ntdll-Implement-ThreadQuerySetWin32StartAddress-info.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0003-ntdll-Implement-ThreadQuerySetWin32StartAddress-info.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0003-ntdll-Implement-ThreadQuerySetWin32StartAddress-info.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0003-ntdll-Implement-ThreadQuerySetWin32StartAddress-info.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,74 @@ +From f9566dfc2af3bcef3d3164daaea612ad141b5c33 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Mon, 27 Jul 2015 18:31:33 +0200 +Subject: ntdll: Implement ThreadQuerySetWin32StartAddress info class in + NtQueryInformationThread. (resend) + +No changes in this patch. +--- + dlls/ntdll/thread.c | 18 +++++++++++++++++- + server/protocol.def | 1 + + server/thread.c | 1 + + 3 files changed, 19 insertions(+), 1 deletion(-) + +diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c +index 3e95fd4..0a8a7b9 100644 +--- a/dlls/ntdll/thread.c ++++ b/dlls/ntdll/thread.c +@@ -1086,12 +1086,28 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, + SERVER_END_REQ; + return status; + } ++ case ThreadQuerySetWin32StartAddress: ++ { ++ SERVER_START_REQ( get_thread_info ) ++ { ++ req->handle = wine_server_obj_handle( handle ); ++ req->tid_in = 0; ++ status = wine_server_call( req ); ++ if (status == STATUS_SUCCESS) ++ { ++ PRTL_THREAD_START_ROUTINE entry = wine_server_get_ptr( reply->entry_point ); ++ if (data) memcpy( data, &entry, min( length, sizeof(entry) ) ); ++ if (ret_len) *ret_len = min( length, sizeof(entry) ); ++ } ++ } ++ SERVER_END_REQ; ++ return status; ++ } + case ThreadPriority: + case ThreadBasePriority: + case ThreadImpersonationToken: + case ThreadEnableAlignmentFaultFixup: + case ThreadEventPair_Reusable: +- case ThreadQuerySetWin32StartAddress: + case ThreadZeroTlsCell: + case ThreadPerformanceCount: + case ThreadIdealProcessor: +diff --git a/server/protocol.def b/server/protocol.def +index 47cedff..3e25e40 100644 +--- a/server/protocol.def ++++ b/server/protocol.def +@@ -841,6 +841,7 @@ struct rawinput_device + process_id_t pid; /* server process id */ + thread_id_t tid; /* server thread id */ + client_ptr_t teb; /* thread teb pointer */ ++ client_ptr_t entry_point; /* thread entry point */ + affinity_t affinity; /* thread affinity mask */ + int exit_code; /* thread exit code */ + int priority; /* thread priority level */ +diff --git a/server/thread.c b/server/thread.c +index f020908..981bcc1 100644 +--- a/server/thread.c ++++ b/server/thread.c +@@ -1375,6 +1375,7 @@ DECL_HANDLER(get_thread_info) + reply->pid = get_process_id( thread->process ); + reply->tid = get_thread_id( thread ); + reply->teb = thread->teb; ++ reply->entry_point = thread->entry_point; + reply->exit_code = (thread->state == TERMINATED) ? thread->exit_code : STATUS_PENDING; + reply->priority = thread->priority; + reply->affinity = thread->affinity; +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0004-ntdll-tests-Add-tests-for-ThreadQuerySetWin32StartAd.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0004-ntdll-tests-Add-tests-for-ThreadQuerySetWin32StartAd.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0004-ntdll-tests-Add-tests-for-ThreadQuerySetWin32StartAd.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/0004-ntdll-tests-Add-tests-for-ThreadQuerySetWin32StartAd.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,91 @@ +From 02ac0105e7d1a8142e5773e436424496314993c6 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Mon, 27 Jul 2015 18:31:47 +0200 +Subject: ntdll/tests: Add tests for ThreadQuerySetWin32StartAddress info + class. (resend) + +No changes, so the tests should still pass. ;) +--- + dlls/ntdll/tests/info.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 60 insertions(+) + +diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c +index 5fff490..83e8757 100644 +--- a/dlls/ntdll/tests/info.c ++++ b/dlls/ntdll/tests/info.c +@@ -1695,6 +1695,61 @@ static void test_NtGetCurrentProcessorNumber(void) + ok(status == STATUS_SUCCESS, "got 0x%x (expected STATUS_SUCCESS)\n", status); + } + ++static DWORD WINAPI start_address_thread(void *arg) ++{ ++ PRTL_THREAD_START_ROUTINE entry; ++ NTSTATUS status; ++ DWORD ret; ++ ++ entry = NULL; ++ ret = 0xdeadbeef; ++ status = pNtQueryInformationThread(GetCurrentThread(), ThreadQuerySetWin32StartAddress, ++ &entry, sizeof(entry), &ret); ++ ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status); ++ ok(ret == sizeof(entry), "NtQueryInformationThread returned %u bytes\n", ret); ++ ok(entry == (void *)start_address_thread, "expected %p, got %p\n", start_address_thread, entry); ++ return 0; ++} ++ ++static void test_thread_start_address(void) ++{ ++ PRTL_THREAD_START_ROUTINE entry; ++ NTSTATUS status; ++ HANDLE thread; ++ DWORD ret; ++ ++ entry = NULL; ++ ret = 0xdeadbeef; ++ status = pNtQueryInformationThread(GetCurrentThread(), ThreadQuerySetWin32StartAddress, ++ &entry, sizeof(entry), &ret); ++ ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status); ++ ok(ret == sizeof(entry), "NtQueryInformationThread returned %u bytes\n", ret); ++ ok(entry != NULL, "expected non-NULL entry point\n"); ++ ++ entry = (void *)0xdeadbeef; ++ status = pNtSetInformationThread(GetCurrentThread(), ThreadQuerySetWin32StartAddress, ++ &entry, sizeof(entry)); ++ ok(status == STATUS_SUCCESS || status == STATUS_INVALID_PARAMETER, /* >= Vista */ ++ "expected STATUS_SUCCESS or STATUS_INVALID_PARAMETER, got %08x\n", status); ++ ++ if (status == STATUS_SUCCESS) ++ { ++ entry = NULL; ++ ret = 0xdeadbeef; ++ status = pNtQueryInformationThread(GetCurrentThread(), ThreadQuerySetWin32StartAddress, ++ &entry, sizeof(entry), &ret); ++ ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status); ++ ok(ret == sizeof(entry), "NtQueryInformationThread returned %u bytes\n", ret); ++ ok(entry == (void *)0xdeadbeef, "expected 0xdeadbeef, got %p\n", entry); ++ } ++ ++ thread = CreateThread(NULL, 0, start_address_thread, NULL, 0, NULL); ++ ok(thread != INVALID_HANDLE_VALUE, "CreateThread failed with %d\n", GetLastError()); ++ ret = WaitForSingleObject(thread, 1000); ++ ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret); ++ CloseHandle(thread); ++} ++ + START_TEST(info) + { + char **argv; +@@ -1820,5 +1875,10 @@ START_TEST(info) + + trace("Starting test_affinity()\n"); + test_affinity(); ++ ++ trace("Starting test_NtGetCurrentProcessorNumber()\n"); + test_NtGetCurrentProcessorNumber(); ++ ++ trace("Starting test_thread_start_address()\n"); ++ test_thread_start_address(); + } +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/definition wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadQuerySetWin32StartAddress/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [8277] Add support for ThreadQuerySetWin32StartAddress info class diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadTime/0001-ntdll-Return-correct-values-in-GetThreadTimes-for-al.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadTime/0001-ntdll-Return-correct-values-in-GetThreadTimes-for-al.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadTime/0001-ntdll-Return-correct-values-in-GetThreadTimes-for-al.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadTime/0001-ntdll-Return-correct-values-in-GetThreadTimes-for-al.patch 2015-07-29 19:51:42.000000000 +0000 @@ -1,17 +1,17 @@ -From c23803e1776618f98732081302d225f0e5b54cb3 Mon Sep 17 00:00:00 2001 +From 13b20600cb2924b63ecf7c0b37db45fd7c26a8ce Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 7 Nov 2014 03:26:18 +0100 Subject: ntdll: Return correct values in GetThreadTimes() for all threads. Based on a patch by Ray Hinchliffe . --- - dlls/ntdll/thread.c | 86 ++++++++++++++++++++++++++++++++++++++++------------- - server/protocol.def | 11 +++++++ - server/thread.c | 16 ++++++++++ - 3 files changed, 93 insertions(+), 20 deletions(-) + dlls/ntdll/thread.c | 82 ++++++++++++++++++++++++++++++++++++++++++----------- + server/protocol.def | 2 ++ + server/thread.c | 2 ++ + 3 files changed, 69 insertions(+), 17 deletions(-) diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 3696c8e..eab1a53 100644 +index 95b7add..a3b1cb0 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -23,6 +23,8 @@ @@ -23,22 +23,18 @@ #include #ifdef HAVE_SYS_MMAN_H #include -@@ -962,47 +964,91 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, +@@ -963,7 +965,10 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, case ThreadTimes: { KERNEL_USER_TIMES kusrt; -- /* We need to do a server call to get the creation time or exit time */ + int unix_pid, unix_tid; -+ + + /* We need to do a server call to get the creation time, exit time, PID and TID */ - /* This works on any thread */ -- SERVER_START_REQ( get_thread_info ) -+ SERVER_START_REQ( get_thread_times ) ++ /* This works on any thread */ + SERVER_START_REQ( get_thread_times ) { req->handle = wine_server_obj_handle( handle ); -- req->tid_in = 0; - status = wine_server_call( req ); - if (status == STATUS_SUCCESS) +@@ -972,36 +977,79 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, { kusrt.CreateTime.QuadPart = reply->creation_time; kusrt.ExitTime.QuadPart = reply->exit_time; @@ -136,54 +132,31 @@ if (ret_len) *ret_len = min( length, sizeof(kusrt) ); } diff --git a/server/protocol.def b/server/protocol.def -index 2cd8272..6fd0e45 100644 +index 15735e0..967bc81 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -790,6 +790,17 @@ struct rawinput_device - #define SET_PROCESS_INFO_AFFINITY 0x02 - - -+/* Retrieve information about thread times */ -+@REQ(get_thread_times) -+ obj_handle_t handle; /* thread handle */ -+@REPLY -+ timeout_t creation_time; /* thread creation time */ -+ timeout_t exit_time; /* thread exit time */ +@@ -856,6 +856,8 @@ struct rawinput_device + @REPLY + timeout_t creation_time; /* thread creation time */ + timeout_t exit_time; /* thread exit time */ + int unix_pid; /* thread native pid */ + int unix_tid; /* thread native pid */ -+@END -+ -+ - /* Retrieve information about a thread */ - @REQ(get_thread_info) - obj_handle_t handle; /* thread handle */ + @END + + diff --git a/server/thread.c b/server/thread.c -index 906b79d..8877e40 100644 +index 902848e..f2b0853 100644 --- a/server/thread.c +++ b/server/thread.c -@@ -1354,6 +1354,22 @@ DECL_HANDLER(open_thread) - } - } - -+/* fetch information about thread times */ -+DECL_HANDLER(get_thread_times) -+{ -+ struct thread *thread; -+ -+ if ((thread = get_thread_from_handle( req->handle, THREAD_QUERY_INFORMATION ))) -+ { -+ reply->creation_time = thread->creation_time; -+ reply->exit_time = thread->exit_time; +@@ -1394,6 +1394,8 @@ DECL_HANDLER(get_thread_times) + { + reply->creation_time = thread->creation_time; + reply->exit_time = thread->exit_time; + reply->unix_pid = thread->unix_pid; + reply->unix_tid = thread->unix_tid; -+ -+ release_object( thread ); -+ } -+} -+ - /* fetch information about a thread */ - DECL_HANDLER(get_thread_info) - { + + release_object( thread ); + } -- -2.3.2 +2.4.5 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadTime/definition wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadTime/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntdll-ThreadTime/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntdll-ThreadTime/definition 2015-07-29 19:51:42.000000000 +0000 @@ -1 +1,2 @@ Fixes: [20230] Return correct values for GetThreadTimes function +Depends: ntdll-ThreadQuerySetWin32StartAddress diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntoskrnl-Stubs/0018-ntoskrnl.exe-Improve-IoGetDeviceObjectPointer-stub-t.patch wine-staging-1.7.48~ubuntu12.04.1/patches/ntoskrnl-Stubs/0018-ntoskrnl.exe-Improve-IoGetDeviceObjectPointer-stub-t.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntoskrnl-Stubs/0018-ntoskrnl.exe-Improve-IoGetDeviceObjectPointer-stub-t.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntoskrnl-Stubs/0018-ntoskrnl.exe-Improve-IoGetDeviceObjectPointer-stub-t.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -From 61970080c0dc917618c2884ceeeb1ef664705292 Mon Sep 17 00:00:00 2001 -From: "Erich E. Hoover" -Date: Sun, 14 Jun 2015 18:58:20 -0600 -Subject: ntoskrnl.exe: Improve IoGetDeviceObjectPointer stub to appease - SecuROM 5.x. - ---- - dlls/ntoskrnl.exe/ntoskrnl.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c -index 2051939..57352e4 100644 ---- a/dlls/ntoskrnl.exe/ntoskrnl.c -+++ b/dlls/ntoskrnl.exe/ntoskrnl.c -@@ -884,10 +884,16 @@ NTSTATUS WINAPI IoGetDeviceInterfaces( const GUID *InterfaceClassGuid, - */ - NTSTATUS WINAPI IoGetDeviceObjectPointer( UNICODE_STRING *name, ACCESS_MASK access, PFILE_OBJECT *file, PDEVICE_OBJECT *device ) - { -+ static DEVICE_OBJECT stub_device; -+ static DRIVER_OBJECT stub_driver; -+ - FIXME( "stub: %s %x %p %p\n", debugstr_us(name), access, file, device ); - -+ stub_device.StackSize = 0x80; /* minimum value to appease SecuROM 5.x */ -+ stub_device.DriverObject = &stub_driver; -+ - *file = NULL; -- *device = NULL; -+ *device = &stub_device; - - return STATUS_SUCCESS; - } --- -2.4.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/ntoskrnl-Stubs/definition wine-staging-1.7.48~ubuntu12.04.1/patches/ntoskrnl-Stubs/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/ntoskrnl-Stubs/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/ntoskrnl-Stubs/definition 2015-07-29 19:51:42.000000000 +0000 @@ -11,4 +11,4 @@ Fixes: Implement ntoskrnl.KeInitializeMutex Fixes: [38103] Process Hacker 2.x needs ntoskrnl.ProbeForRead Fixes: Add stub for ntoskrnl.PsRemoveLoadImageNotifyRoutine -Fixes: [21448] SecuROM 5.x media validation fails +# Fixes: [21448] SecuROM 5.x media validation fails diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/openal32-EFX_Extension/0001-openal32-Export-EFX-extension-functions.patch wine-staging-1.7.48~ubuntu12.04.1/patches/openal32-EFX_Extension/0001-openal32-Export-EFX-extension-functions.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/openal32-EFX_Extension/0001-openal32-Export-EFX-extension-functions.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/openal32-EFX_Extension/0001-openal32-Export-EFX-extension-functions.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,184 @@ +From 4853f2c3b243c55f20a4f403cc9e2407a051d1c6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Tue, 28 Jul 2015 05:44:11 +0200 +Subject: openal32: Export EFX extension functions. + +--- + dlls/openal32/openal.c | 44 ++++++++++++++++++++++---------------------- + dlls/openal32/openal32.spec | 23 +++++++++++++++++++++++ + 2 files changed, 45 insertions(+), 22 deletions(-) + +diff --git a/dlls/openal32/openal.c b/dlls/openal32/openal.c +index 5a4e1e7..d266f12 100644 +--- a/dlls/openal32/openal.c ++++ b/dlls/openal32/openal.c +@@ -647,113 +647,113 @@ ALvoid CDECL wine_alSpeedOfSound(ALfloat value) + } + + /* OpenAL EFX extension functions */ +-static ALvoid CDECL wine_alGenFilters(ALsizei n, ALuint* filters) ++ALvoid CDECL wine_alGenFilters(ALsizei n, ALuint* filters) + { + alGenFilters(n, filters); + } + +-static ALvoid CDECL wine_alDeleteFilters(ALsizei n, const ALuint* filters) ++ALvoid CDECL wine_alDeleteFilters(ALsizei n, const ALuint* filters) + { + alDeleteFilters(n, filters); + } + +-static ALboolean CDECL wine_alIsFilter(ALuint fid) ++ALboolean CDECL wine_alIsFilter(ALuint fid) + { + return alIsFilter(fid); + } + +-static ALvoid CDECL wine_alFilterf(ALuint fid, ALenum param, ALfloat value) ++ALvoid CDECL wine_alFilterf(ALuint fid, ALenum param, ALfloat value) + { + alFilterf(fid, param, value); + } + +-static ALvoid CDECL wine_alFilterfv(ALuint fid, ALenum param, const ALfloat* values) ++ALvoid CDECL wine_alFilterfv(ALuint fid, ALenum param, const ALfloat* values) + { + alFilterfv(fid, param, values); + } + +-static ALvoid CDECL wine_alFilteri(ALuint fid, ALenum param, ALint value) ++ALvoid CDECL wine_alFilteri(ALuint fid, ALenum param, ALint value) + { + alFilteri(fid, param, value); + } + +-static ALvoid CDECL wine_alFilteriv(ALuint fid, ALenum param, const ALint* values) ++ALvoid CDECL wine_alFilteriv(ALuint fid, ALenum param, const ALint* values) + { + alFilteriv(fid, param, values); + } + +-static ALvoid CDECL wine_alGetFilterf(ALuint fid, ALenum param, ALfloat* value) ++ALvoid CDECL wine_alGetFilterf(ALuint fid, ALenum param, ALfloat* value) + { + alGetFilterf(fid, param, value); + } + +-static ALvoid CDECL wine_alGetFilterfv(ALuint fid, ALenum param, ALfloat* values) ++ALvoid CDECL wine_alGetFilterfv(ALuint fid, ALenum param, ALfloat* values) + { + alGetFilterfv(fid, param, values); + } + +-static ALvoid CDECL wine_alGetFilteri(ALuint fid, ALenum param, ALint* value) ++ALvoid CDECL wine_alGetFilteri(ALuint fid, ALenum param, ALint* value) + { + alGetFilteri(fid, param, value); + } + +-static ALvoid CDECL wine_alGetFilteriv(ALuint fid, ALenum param, ALint* values) ++ALvoid CDECL wine_alGetFilteriv(ALuint fid, ALenum param, ALint* values) + { + alGetFilteriv(fid, param, values); + } + + +-static ALvoid CDECL wine_alGenEffects(ALsizei n, ALuint* effects) ++ALvoid CDECL wine_alGenEffects(ALsizei n, ALuint* effects) + { + alGenEffects(n, effects); + } + +-static ALvoid CDECL wine_alDeleteEffects(ALsizei n, const ALuint* effects) ++ALvoid CDECL wine_alDeleteEffects(ALsizei n, const ALuint* effects) + { + alDeleteEffects(n, effects); + } + +-static ALboolean CDECL wine_alIsEffect(ALuint eid) ++ALboolean CDECL wine_alIsEffect(ALuint eid) + { + return alIsEffect(eid); + } + +-static ALvoid CDECL wine_alEffectf(ALuint eid, ALenum param, ALfloat value) ++ALvoid CDECL wine_alEffectf(ALuint eid, ALenum param, ALfloat value) + { + alEffectf(eid, param, value); + } + +-static ALvoid CDECL wine_alEffectfv(ALuint eid, ALenum param, const ALfloat* values) ++ALvoid CDECL wine_alEffectfv(ALuint eid, ALenum param, const ALfloat* values) + { + alEffectfv(eid, param, values); + } + +-static ALvoid CDECL wine_alEffecti(ALuint eid, ALenum param, ALint value) ++ALvoid CDECL wine_alEffecti(ALuint eid, ALenum param, ALint value) + { + alEffecti(eid, param, value); + } + +-static ALvoid CDECL wine_alEffectiv(ALuint eid, ALenum param, const ALint* values) ++ALvoid CDECL wine_alEffectiv(ALuint eid, ALenum param, const ALint* values) + { + alEffectiv(eid, param, values); + } + +-static ALvoid CDECL wine_alGetEffectf(ALuint eid, ALenum param, ALfloat* value) ++ALvoid CDECL wine_alGetEffectf(ALuint eid, ALenum param, ALfloat* value) + { + alGetEffectf(eid, param, value); + } + +-static ALvoid CDECL wine_alGetEffectfv(ALuint eid, ALenum param, ALfloat* values) ++ALvoid CDECL wine_alGetEffectfv(ALuint eid, ALenum param, ALfloat* values) + { + alGetEffectfv(eid, param, values); + } + +-static ALvoid CDECL wine_alGetEffecti(ALuint eid, ALenum param, ALint* value) ++ALvoid CDECL wine_alGetEffecti(ALuint eid, ALenum param, ALint* value) + { + alGetEffecti(eid, param, value); + } + +-static ALvoid CDECL wine_alGetEffectiv(ALuint eid, ALenum param, ALint* values) ++ALvoid CDECL wine_alGetEffectiv(ALuint eid, ALenum param, ALint* values) + { + alGetEffectiv(eid, param, values); + } +diff --git a/dlls/openal32/openal32.spec b/dlls/openal32/openal32.spec +index 0094fc2..b5f7b8a 100644 +--- a/dlls/openal32/openal32.spec ++++ b/dlls/openal32/openal32.spec +@@ -95,3 +95,26 @@ + @ cdecl alGetBuffer3f(long long ptr ptr ptr) wine_alGetBuffer3f + @ cdecl alGetBuffer3i(long long ptr ptr ptr) wine_alGetBuffer3i + @ cdecl alSpeedOfSound(long) wine_alSpeedOfSound ++# OpenAL EFX extension ++@ cdecl alGenFilters(long ptr) wine_alGenFilters ++@ cdecl alDeleteFilters(long ptr) wine_alDeleteFilters ++@ cdecl alIsFilter(long) wine_alIsFilter ++@ cdecl alFilterf(long long float) wine_alFilterf ++@ cdecl alFilterfv(long long ptr) wine_alFilterfv ++@ cdecl alFilteri(long long long) wine_alFilteri ++@ cdecl alFilteriv(long long ptr) wine_alFilteriv ++@ cdecl alGetFilterf(long long ptr) wine_alGetFilterf ++@ cdecl alGetFilterfv(long long ptr) wine_alGetFilterfv ++@ cdecl alGetFilteri(long long ptr) wine_alGetFilteri ++@ cdecl alGetFilteriv(long long ptr) wine_alGetFilteriv ++@ cdecl alGenEffects(long ptr) wine_alGenEffects ++@ cdecl alDeleteEffects(long ptr) wine_alDeleteEffects ++@ cdecl alIsEffect(long) wine_alIsEffect ++@ cdecl alEffectf(long long float) wine_alEffectf ++@ cdecl alEffectfv(long long ptr) wine_alEffectfv ++@ cdecl alEffecti(long long long) wine_alEffecti ++@ cdecl alEffectiv(long long ptr) wine_alEffectiv ++@ cdecl alGetEffectf(long long ptr) wine_alGetEffectf ++@ cdecl alGetEffectfv(long long ptr) wine_alGetEffectfv ++@ cdecl alGetEffecti(long long ptr) wine_alGetEffecti ++@ cdecl alGetEffectiv(long long ptr) wine_alGetEffectiv +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/openal32-EFX_Extension/definition wine-staging-1.7.48~ubuntu12.04.1/patches/openal32-EFX_Extension/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/openal32-EFX_Extension/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/openal32-EFX_Extension/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [38972] Export additional OpenAL32 functions diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/patchinstall.sh wine-staging-1.7.48~ubuntu12.04.1/patches/patchinstall.sh --- wine-staging-1.7.47~ubuntu12.04.1/patches/patchinstall.sh 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/patchinstall.sh 2015-07-29 19:51:42.000000000 +0000 @@ -51,11 +51,11 @@ # Show version information version() { - echo "Wine Staging 1.7.47" + echo "Wine Staging 1.7.48" echo "Copyright (C) 2014-2015 the Wine Staging project authors." echo "" echo "Patchset to be applied on upstream Wine:" - echo " commit 744f7b69bf4692265588e10650090ca2f5129ccd" + echo " commit 797c037bff2f7621f5b3d632bd899349529d6b2b" echo "" } @@ -76,29 +76,32 @@ patch_enable_all () { enable_Compiler_Warnings="$1" - enable_Coverity="$1" enable_Exagear="$1" enable_Pipelight="$1" enable_Staging="$1" enable_advapi32_LsaLookupSids="$1" + enable_amstream_GetMultiMediaStream="$1" enable_browseui_Progress_Dialog="$1" enable_combase_String="$1" enable_comctl32_LoadIconMetric="$1" enable_configure_Absolute_RPATH="$1" - enable_configure_Crosscompiling="$1" enable_crypt32_CMS_Certificates="$1" enable_d3d9_DesktopWindow="$1" enable_d3d9_Skip_Tests="$1" enable_d3d9_Surface_Refcount="$1" + enable_d3dcompiler_43_D3DCompile="$1" + enable_d3dx10_43_D3DX10CreateEffectFromFile="$1" enable_d3dx9_24_ID3DXEffect="$1" enable_d3dx9_25_ID3DXEffect="$1" enable_d3dx9_26_ID3DXEffect="$1" + enable_d3dx9_33_Share_Source="$1" enable_d3dx9_36_AnimationController="$1" enable_d3dx9_36_CloneEffect="$1" enable_d3dx9_36_D3DXStubs="$1" enable_d3dx9_36_DDS="$1" enable_d3dx9_36_DXTn="$1" enable_d3dx9_36_DrawText="$1" + enable_d3dx9_36_Dummy_Skininfo="$1" enable_d3dx9_36_Filter_Warnings="$1" enable_d3dx9_36_FindNextValidTechnique="$1" enable_d3dx9_36_GetShaderSemantics="$1" @@ -106,13 +109,14 @@ enable_d3dx9_36_Texture_Align="$1" enable_d3dx9_36_UpdateSkinnedMesh="$1" enable_dbghelp_Debug_Symbols="$1" + enable_dbghelp_UnDecorateSymbolNameW="$1" enable_ddraw_EnumSurfaces="$1" enable_ddraw_IDirect3DTexture2_Load="$1" + enable_ddraw_Rendering_Targets="$1" enable_ddraw_d3d_execute_buffer="$1" enable_dinput_Events="$1" enable_dsound_EAX="$1" enable_dsound_Fast_Mixer="$1" - enable_dwrite_VDMX="$1" enable_dxgi_GetDesc="$1" enable_dxva2_Video_Decoder="$1" enable_fltmgr_Stub_SYS="$1" @@ -120,7 +124,6 @@ enable_gdi32_Default_Palette="$1" enable_gdi32_MaxPixelFormats="$1" enable_gdi32_MultiMonitor="$1" - enable_gdiplus_GIF_Encoder="$1" enable_gdiplus_GdipCreateEffect="$1" enable_imagehlp_BindImageEx="$1" enable_imagehlp_ImageLoad="$1" @@ -131,10 +134,11 @@ enable_kernel32_CopyFileEx="$1" enable_kernel32_GetFinalPathNameByHandle="$1" enable_kernel32_GetLogicalProcessorInformationEx="$1" - enable_kernel32_InsertMode="$1" + enable_kernel32_LocaleNameToLCID="$1" enable_kernel32_Named_Pipe="$1" enable_kernel32_NeedCurrentDirectoryForExePath="$1" enable_kernel32_Profile="$1" + enable_kernel32_SetFileCompletionNotificationModes="$1" enable_kernel32_SetFileInformationByHandle="$1" enable_kernel32_TimezoneInformation_Registry="$1" enable_kernel32_VerifyVersionInfo="$1" @@ -152,7 +156,6 @@ enable_ntdll_APC_Start_Process="$1" enable_ntdll_Activation_Context="$1" enable_ntdll_CLI_Images="$1" - enable_ntdll_Coverity="$1" enable_ntdll_DOS_Attributes="$1" enable_ntdll_DeviceType_Systemroot="$1" enable_ntdll_DllRedirects="$1" @@ -166,14 +169,17 @@ enable_ntdll_Heap_FreeLists="$1" enable_ntdll_Hide_Wine_Exports="$1" enable_ntdll_Junction_Points="$1" + enable_ntdll_Loader_Machine_Type="$1" enable_ntdll_NtQueryEaFile="$1" enable_ntdll_NtQuerySection="$1" enable_ntdll_NtSetLdtEntries="$1" enable_ntdll_Pipe_SpecialCharacters="$1" - enable_ntdll_Revert_Security_Cookie="$1" enable_ntdll_RtlIpStringToAddress="$1" + enable_ntdll_Security_Cookie="$1" + enable_ntdll_ThreadQuerySetWin32StartAddress="$1" enable_ntdll_ThreadTime="$1" enable_ntdll_Threading="$1" + enable_ntdll_Threadpool="$1" enable_ntdll_User_Shared_Data="$1" enable_ntdll_WRITECOPY="$1" enable_ntdll_WinSqm="$1" @@ -184,6 +190,7 @@ enable_nvcuda_CUDA_Support="$1" enable_nvcuvid_CUDA_Video_Support="$1" enable_nvencodeapi_Video_Encoder="$1" + enable_openal32_EFX_Extension="$1" enable_opengl32_Revert_Disable_Ext="$1" enable_quartz_MediaSeeking_Positions="$1" enable_rasapi32_RasEnumDevicesA="$1" @@ -205,10 +212,10 @@ enable_server_OpenProcess="$1" enable_server_PeekMessage="$1" enable_server_Realtime_Priority="$1" + enable_server_Registry_Timestamp="$1" enable_server_RootDirectory_File="$1" enable_server_Shared_Memory="$1" enable_server_Stored_ACLs="$1" - enable_server_Unexpected_Wakeup="$1" enable_setupapi_SetupDiSelectBestCompatDrv="$1" enable_setupapi_SetupDiSetDeviceInstallParamsW="$1" enable_setupapi_SetupPromptForDisk="$1" @@ -218,7 +225,6 @@ enable_shell32_Icons="$1" enable_shell32_Placeholder_Icons="$1" enable_shell32_Progress_Dialog="$1" - enable_shell32_Quoted_ShellExecute="$1" enable_shell32_RunDLL_CallEntry16="$1" enable_shell32_Run_Dialog="$1" enable_shell32_SHCreateSessionKey="$1" @@ -240,9 +246,6 @@ enable_wbemdisp_ISWbemSecurity="$1" enable_wbemdisp_Timeout="$1" enable_wiaservc_IEnumWIA_DEV_INFO="$1" - enable_widl_Buffer_Overflow="$1" - enable_windowscodecs_GIF_Decoder="$1" - enable_windowscodecs_TIFF_Decoder="$1" enable_wine_inf_Performance="$1" enable_wine_inf_ProfileList_UserSID="$1" enable_wineboot_HKEY_DYN_DATA="$1" @@ -251,11 +254,12 @@ enable_winecfg_Libraries="$1" enable_winecfg_Staging="$1" enable_winecfg_Unmounted_Devices="$1" - enable_wineconsole_Insert_Mode="$1" + enable_wineconsole_Forward_Exitcode="$1" enable_wined3d_Accounting="$1" enable_wined3d_CSMT_Helper="$1" enable_wined3d_CSMT_Main="$1" enable_wined3d_DXTn="$1" + enable_wined3d_Geforce_425M="$1" enable_wined3d_MESA_GPU_Info="$1" enable_wined3d_Multisampling="$1" enable_wined3d_Revert_PixelFormat="$1" @@ -302,9 +306,6 @@ Compiler_Warnings) enable_Compiler_Warnings="$2" ;; - Coverity) - enable_Coverity="$2" - ;; Exagear) enable_Exagear="$2" ;; @@ -317,6 +318,9 @@ advapi32-LsaLookupSids) enable_advapi32_LsaLookupSids="$2" ;; + amstream-GetMultiMediaStream) + enable_amstream_GetMultiMediaStream="$2" + ;; browseui-Progress_Dialog) enable_browseui_Progress_Dialog="$2" ;; @@ -332,9 +336,6 @@ configure-Absolute_RPATH) enable_configure_Absolute_RPATH="$2" ;; - configure-Crosscompiling) - enable_configure_Crosscompiling="$2" - ;; crypt32-CMS_Certificates) enable_crypt32_CMS_Certificates="$2" ;; @@ -347,6 +348,12 @@ d3d9-Surface_Refcount) enable_d3d9_Surface_Refcount="$2" ;; + d3dcompiler_43-D3DCompile) + enable_d3dcompiler_43_D3DCompile="$2" + ;; + d3dx10_43-D3DX10CreateEffectFromFile) + enable_d3dx10_43_D3DX10CreateEffectFromFile="$2" + ;; d3dx9_24-ID3DXEffect) enable_d3dx9_24_ID3DXEffect="$2" ;; @@ -356,6 +363,9 @@ d3dx9_26-ID3DXEffect) enable_d3dx9_26_ID3DXEffect="$2" ;; + d3dx9_33-Share_Source) + enable_d3dx9_33_Share_Source="$2" + ;; d3dx9_36-AnimationController) enable_d3dx9_36_AnimationController="$2" ;; @@ -374,6 +384,9 @@ d3dx9_36-DrawText) enable_d3dx9_36_DrawText="$2" ;; + d3dx9_36-Dummy_Skininfo) + enable_d3dx9_36_Dummy_Skininfo="$2" + ;; d3dx9_36-Filter_Warnings) enable_d3dx9_36_Filter_Warnings="$2" ;; @@ -395,12 +408,18 @@ dbghelp-Debug_Symbols) enable_dbghelp_Debug_Symbols="$2" ;; + dbghelp-UnDecorateSymbolNameW) + enable_dbghelp_UnDecorateSymbolNameW="$2" + ;; ddraw-EnumSurfaces) enable_ddraw_EnumSurfaces="$2" ;; ddraw-IDirect3DTexture2_Load) enable_ddraw_IDirect3DTexture2_Load="$2" ;; + ddraw-Rendering_Targets) + enable_ddraw_Rendering_Targets="$2" + ;; ddraw-d3d_execute_buffer) enable_ddraw_d3d_execute_buffer="$2" ;; @@ -413,9 +432,6 @@ dsound-Fast_Mixer) enable_dsound_Fast_Mixer="$2" ;; - dwrite-VDMX) - enable_dwrite_VDMX="$2" - ;; dxgi-GetDesc) enable_dxgi_GetDesc="$2" ;; @@ -437,9 +453,6 @@ gdi32-MultiMonitor) enable_gdi32_MultiMonitor="$2" ;; - gdiplus-GIF_Encoder) - enable_gdiplus_GIF_Encoder="$2" - ;; gdiplus-GdipCreateEffect) enable_gdiplus_GdipCreateEffect="$2" ;; @@ -470,8 +483,8 @@ kernel32-GetLogicalProcessorInformationEx) enable_kernel32_GetLogicalProcessorInformationEx="$2" ;; - kernel32-InsertMode) - enable_kernel32_InsertMode="$2" + kernel32-LocaleNameToLCID) + enable_kernel32_LocaleNameToLCID="$2" ;; kernel32-Named_Pipe) enable_kernel32_Named_Pipe="$2" @@ -482,6 +495,9 @@ kernel32-Profile) enable_kernel32_Profile="$2" ;; + kernel32-SetFileCompletionNotificationModes) + enable_kernel32_SetFileCompletionNotificationModes="$2" + ;; kernel32-SetFileInformationByHandle) enable_kernel32_SetFileInformationByHandle="$2" ;; @@ -533,9 +549,6 @@ ntdll-CLI_Images) enable_ntdll_CLI_Images="$2" ;; - ntdll-Coverity) - enable_ntdll_Coverity="$2" - ;; ntdll-DOS_Attributes) enable_ntdll_DOS_Attributes="$2" ;; @@ -575,6 +588,9 @@ ntdll-Junction_Points) enable_ntdll_Junction_Points="$2" ;; + ntdll-Loader_Machine_Type) + enable_ntdll_Loader_Machine_Type="$2" + ;; ntdll-NtQueryEaFile) enable_ntdll_NtQueryEaFile="$2" ;; @@ -587,18 +603,24 @@ ntdll-Pipe_SpecialCharacters) enable_ntdll_Pipe_SpecialCharacters="$2" ;; - ntdll-Revert_Security_Cookie) - enable_ntdll_Revert_Security_Cookie="$2" - ;; ntdll-RtlIpStringToAddress) enable_ntdll_RtlIpStringToAddress="$2" ;; + ntdll-Security_Cookie) + enable_ntdll_Security_Cookie="$2" + ;; + ntdll-ThreadQuerySetWin32StartAddress) + enable_ntdll_ThreadQuerySetWin32StartAddress="$2" + ;; ntdll-ThreadTime) enable_ntdll_ThreadTime="$2" ;; ntdll-Threading) enable_ntdll_Threading="$2" ;; + ntdll-Threadpool) + enable_ntdll_Threadpool="$2" + ;; ntdll-User_Shared_Data) enable_ntdll_User_Shared_Data="$2" ;; @@ -629,6 +651,9 @@ nvencodeapi-Video_Encoder) enable_nvencodeapi_Video_Encoder="$2" ;; + openal32-EFX_Extension) + enable_openal32_EFX_Extension="$2" + ;; opengl32-Revert_Disable_Ext) enable_opengl32_Revert_Disable_Ext="$2" ;; @@ -692,6 +717,9 @@ server-Realtime_Priority) enable_server_Realtime_Priority="$2" ;; + server-Registry_Timestamp) + enable_server_Registry_Timestamp="$2" + ;; server-RootDirectory_File) enable_server_RootDirectory_File="$2" ;; @@ -701,9 +729,6 @@ server-Stored_ACLs) enable_server_Stored_ACLs="$2" ;; - server-Unexpected_Wakeup) - enable_server_Unexpected_Wakeup="$2" - ;; setupapi-SetupDiSelectBestCompatDrv) enable_setupapi_SetupDiSelectBestCompatDrv="$2" ;; @@ -731,9 +756,6 @@ shell32-Progress_Dialog) enable_shell32_Progress_Dialog="$2" ;; - shell32-Quoted_ShellExecute) - enable_shell32_Quoted_ShellExecute="$2" - ;; shell32-RunDLL_CallEntry16) enable_shell32_RunDLL_CallEntry16="$2" ;; @@ -797,15 +819,6 @@ wiaservc-IEnumWIA_DEV_INFO) enable_wiaservc_IEnumWIA_DEV_INFO="$2" ;; - widl-Buffer_Overflow) - enable_widl_Buffer_Overflow="$2" - ;; - windowscodecs-GIF_Decoder) - enable_windowscodecs_GIF_Decoder="$2" - ;; - windowscodecs-TIFF_Decoder) - enable_windowscodecs_TIFF_Decoder="$2" - ;; wine.inf-Performance) enable_wine_inf_Performance="$2" ;; @@ -830,8 +843,8 @@ winecfg-Unmounted_Devices) enable_winecfg_Unmounted_Devices="$2" ;; - wineconsole-Insert_Mode) - enable_wineconsole_Insert_Mode="$2" + wineconsole-Forward_Exitcode) + enable_wineconsole_Forward_Exitcode="$2" ;; wined3d-Accounting) enable_wined3d_Accounting="$2" @@ -845,6 +858,9 @@ wined3d-DXTn) enable_wined3d_DXTn="$2" ;; + wined3d-Geforce_425M) + enable_wined3d_Geforce_425M="$2" + ;; wined3d-MESA_GPU_Info) enable_wined3d_MESA_GPU_Info="$2" ;; @@ -1439,9 +1455,6 @@ if test "$enable_server_Delete_On_Close" -gt 1; then abort "Patchset server-Delete_On_Close disabled, but category-stable depends on that." fi - if test "$enable_server_Unexpected_Wakeup" -gt 1; then - abort "Patchset server-Unexpected_Wakeup disabled, but category-stable depends on that." - fi if test "$enable_setupapi_SetupDiSetDeviceInstallParamsW" -gt 1; then abort "Patchset setupapi-SetupDiSetDeviceInstallParamsW disabled, but category-stable depends on that." fi @@ -1460,9 +1473,6 @@ if test "$enable_user32_WndProc" -gt 1; then abort "Patchset user32-WndProc disabled, but category-stable depends on that." fi - if test "$enable_windowscodecs_GIF_Decoder" -gt 1; then - abort "Patchset windowscodecs-GIF_Decoder disabled, but category-stable depends on that." - fi if test "$enable_wine_inf_Performance" -gt 1; then abort "Patchset wine.inf-Performance disabled, but category-stable depends on that." fi @@ -1573,14 +1583,12 @@ enable_server_ClipCursor=1 enable_server_CreateProcess_ACLs=1 enable_server_Delete_On_Close=1 - enable_server_Unexpected_Wakeup=1 enable_setupapi_SetupDiSetDeviceInstallParamsW=1 enable_shell32_RunDLL_CallEntry16=1 enable_shell32_SHFileOperation=1 enable_urlmon_CoInternetSetFeatureEnabled=1 enable_user32_DrawTextExW=1 enable_user32_WndProc=1 - enable_windowscodecs_GIF_Decoder=1 enable_wine_inf_Performance=1 enable_wine_inf_ProfileList_UserSID=1 enable_wineboot_HKEY_DYN_DATA=1 @@ -1748,6 +1756,13 @@ enable_ws2_32_WriteWatches=1 fi +if test "$enable_ntdll_ThreadTime" -eq 1; then + if test "$enable_ntdll_ThreadQuerySetWin32StartAddress" -gt 1; then + abort "Patchset ntdll-ThreadQuerySetWin32StartAddress disabled, but ntdll-ThreadTime depends on that." + fi + enable_ntdll_ThreadQuerySetWin32StartAddress=1 +fi + if test "$enable_ntdll_Junction_Points" -eq 1; then if test "$enable_ntdll_Fix_Free" -gt 1; then abort "Patchset ntdll-Fix_Free disabled, but ntdll-Junction_Points depends on that." @@ -1759,6 +1774,13 @@ enable_ntdll_NtQueryEaFile=1 fi +if test "$enable_ntdll_DllRedirects" -eq 1; then + if test "$enable_ntdll_Loader_Machine_Type" -gt 1; then + abort "Patchset ntdll-Loader_Machine_Type disabled, but ntdll-DllRedirects depends on that." + fi + enable_ntdll_Loader_Machine_Type=1 +fi + if test "$enable_ntdll_CLI_Images" -eq 1; then if test "$enable_mscoree_CorValidateImage" -gt 1; then abort "Patchset mscoree-CorValidateImage disabled, but ntdll-CLI_Images depends on that." @@ -1812,6 +1834,17 @@ enable_d3dx9_36_DXTn=1 fi +if test "$enable_d3dx9_33_Share_Source" -eq 1; then + if test "$enable_d3dx9_36_D3DXStubs" -gt 1; then + abort "Patchset d3dx9_36-D3DXStubs disabled, but d3dx9_33-Share_Source depends on that." + fi + if test "$enable_d3dx9_36_DXTn" -gt 1; then + abort "Patchset d3dx9_36-DXTn disabled, but d3dx9_33-Share_Source depends on that." + fi + enable_d3dx9_36_D3DXStubs=1 + enable_d3dx9_36_DXTn=1 +fi + if test "$enable_d3dx9_36_DXTn" -eq 1; then if test "$enable_wined3d_DXTn" -gt 1; then abort "Patchset wined3d-DXTn disabled, but d3dx9_36-DXTn depends on that." @@ -1879,18 +1912,6 @@ ) >> "$patchlist" fi -# Patchset Coverity -# | -# | Modified files: -# | * dlls/ws2_32/socket.c -# | -if test "$enable_Coverity" -eq 1; then - patch_apply Coverity/0001-ws2_32-Fix-uninitialized-memory-access-in-do_poll-Co.patch - ( - echo '+ { "Sebastian Lackner", "ws2_32: Fix uninitialized memory access in do_poll (Coverity).", 1 },'; - ) >> "$patchlist" -fi - # Patchset ws2_32-WriteWatches # | # | Modified files: @@ -2055,6 +2076,21 @@ ) >> "$patchlist" fi +# Patchset amstream-GetMultiMediaStream +# | +# | This patchset fixes the following Wine bugs: +# | * [#37090] Implement AMStream GetMultiMediaStream functions +# | +# | Modified files: +# | * dlls/amstream/mediastream.c +# | +if test "$enable_amstream_GetMultiMediaStream" -eq 1; then + patch_apply amstream-GetMultiMediaStream/0001-amstream-Implement-IAMMediaStream-GetMultiMediaStrea.patch + ( + echo '+ { "Michael Müller", "amstream: Implement IAMMediaStream::GetMultiMediaStream.", 1 },'; + ) >> "$patchlist" +fi + # Patchset browseui-Progress_Dialog # | # | Modified files: @@ -2088,8 +2124,7 @@ # | * [#35375] Support for LoadIconMetric # | # | Modified files: -# | * dlls/comctl32/Makefile.in, dlls/comctl32/comctl32.spec, dlls/comctl32/icon.c, dlls/comctl32/tests/misc.c, -# | include/commctrl.h +# | * dlls/comctl32/comctl32.spec, dlls/comctl32/commctrl.c, dlls/comctl32/tests/misc.c, include/commctrl.h # | if test "$enable_comctl32_LoadIconMetric" -eq 1; then patch_apply comctl32-LoadIconMetric/0001-comctl32-Implement-LoadIconMetric-function.patch @@ -2115,20 +2150,6 @@ ) >> "$patchlist" fi -# Patchset configure-Crosscompiling -# | -# | Modified files: -# | * aclocal.m4, configure.ac -# | -if test "$enable_configure_Crosscompiling" -eq 1; then - patch_apply configure-Crosscompiling/0001-configure.ac-Search-for-otool-using-AC_CHECK_TOOL.patch - patch_apply configure-Crosscompiling/0002-configure.ac-Remove-check-for-strength-reduce-bug.patch - ( - echo '+ { "Michael Müller", "configure.ac: Search for otool using AC_CHECK_TOOL.", 2 },'; - echo '+ { "Michael Müller", "configure.ac: Remove check for strength-reduce bug.", 1 },'; - ) >> "$patchlist" -fi - # Patchset crypt32-CMS_Certificates # | # | This patchset fixes the following Wine bugs: @@ -2183,6 +2204,39 @@ ) >> "$patchlist" fi +# Patchset d3dcompiler_43-D3DCompile +# | +# | Modified files: +# | * dlls/d3dcompiler_43/compiler.c, dlls/d3dcompiler_46/d3dcompiler_46.spec, dlls/d3dcompiler_47/d3dcompiler_47.spec +# | +if test "$enable_d3dcompiler_43_D3DCompile" -eq 1; then + patch_apply d3dcompiler_43-D3DCompile/0001-d3dcompiler_43-Add-D3DCompileFromFile-stub.-try-3.patch + patch_apply d3dcompiler_43-D3DCompile/0002-d3dcompiler_43-Implement-semi-stub-for-D3DCompile2.patch + ( + echo '+ { "Alistair Leslie-Hughes", "d3dcompiler_43: Add D3DCompileFromFile stub.", 3 },'; + echo '+ { "Sebastian Lackner", "d3dcompiler_43: Implement semi-stub for D3DCompile2.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset d3dx10_43-D3DX10CreateEffectFromFile +# | +# | This patchset fixes the following Wine bugs: +# | * [#27739] Add stubs for d3dx10_43.D3DX10CreateEffectFromFileA/W +# | +# | Modified files: +# | * dlls/d3dx10_43/d3dx10_43.spec, dlls/d3dx10_43/d3dx10_43_main.c, include/Makefile.in, include/d3dx10core.idl +# | +if test "$enable_d3dx10_43_D3DX10CreateEffectFromFile" -eq 1; then + patch_apply d3dx10_43-D3DX10CreateEffectFromFile/0001-d3dx10_43-Add-ID3DX10ThreadPump-interface.patch + patch_apply d3dx10_43-D3DX10CreateEffectFromFile/0002-d3dx10_43-Add-D3DX10CreateEffectFromFileA-W-stubs.patch + patch_apply d3dx10_43-D3DX10CreateEffectFromFile/0003-d3dx10_43-Added-D3DX10CreateEffectFromMemory-stub.patch + ( + echo '+ { "Alistair Leslie-Hughes", "d3dx10_43: Add ID3DX10ThreadPump interface.", 1 },'; + echo '+ { "Alistair Leslie-Hughes", "d3dx10_43: Add D3DX10CreateEffectFromFileA/W stubs.", 1 },'; + echo '+ { "Alistair Leslie-Hughes", "d3dx10_43: Added D3DX10CreateEffectFromMemory stub.", 1 },'; + ) >> "$patchlist" +fi + # Patchset d3dx9_25-ID3DXEffect # | # | This patchset fixes the following Wine bugs: @@ -2266,6 +2320,48 @@ ) >> "$patchlist" fi +# Patchset d3dx9_36-D3DXStubs +# | +# | This patchset fixes the following Wine bugs: +# | * [#26379] Support for D3DXComputeNormals +# | * [#38334] Add stub for D3DXFrameFind +# | +# | Modified files: +# | * dlls/d3dx9_24/d3dx9_24.spec, dlls/d3dx9_25/d3dx9_25.spec, dlls/d3dx9_26/d3dx9_26.spec, dlls/d3dx9_27/d3dx9_27.spec, +# | dlls/d3dx9_28/d3dx9_28.spec, dlls/d3dx9_29/d3dx9_29.spec, dlls/d3dx9_30/d3dx9_30.spec, dlls/d3dx9_31/d3dx9_31.spec, +# | dlls/d3dx9_32/d3dx9_32.spec, dlls/d3dx9_33/d3dx9_33.spec, dlls/d3dx9_34/d3dx9_34.spec, dlls/d3dx9_35/d3dx9_35.spec, +# | dlls/d3dx9_36/d3dx9_36.spec, dlls/d3dx9_36/mesh.c, dlls/d3dx9_37/d3dx9_37.spec, dlls/d3dx9_38/d3dx9_38.spec, +# | dlls/d3dx9_39/d3dx9_39.spec, dlls/d3dx9_40/d3dx9_40.spec, dlls/d3dx9_41/d3dx9_41.spec, dlls/d3dx9_42/d3dx9_42.spec, +# | dlls/d3dx9_43/d3dx9_43.spec +# | +if test "$enable_d3dx9_36_D3DXStubs" -eq 1; then + patch_apply d3dx9_36-D3DXStubs/0001-d3dx9_36-Implement-D3DXComputeNormals.patch + patch_apply d3dx9_36-D3DXStubs/0002-d3dx9_36-Add-stub-for-D3DXComputeNormalMap.patch + patch_apply d3dx9_36-D3DXStubs/0003-d3dx9_36-Add-D3DXFrameFind-stub.patch + patch_apply d3dx9_36-D3DXStubs/0004-d3dx9_36-Add-D3DXTessellateNPatches-stub.-try-2.patch + ( + echo '+ { "Christian Costa", "d3dx9_36: Implement D3DXComputeNormals.", 1 },'; + echo '+ { "Christian Costa", "d3dx9_36: Add stub for D3DXComputeNormalMap.", 1 },'; + echo '+ { "Andrey Gusev", "d3dx9_36: Add D3DXFrameFind stub.", 1 },'; + echo '+ { "Alistair Leslie-Hughes", "d3dx9_36: Add D3DXTessellateNPatches stub.", 2 },'; + ) >> "$patchlist" +fi + +# Patchset d3dx9_33-Share_Source +# | +# | This patchset fixes the following Wine bugs: +# | * [#21817] Share source of d3dx9_36 with d3dx9_33 to avoid Wine DLL forwards +# | +# | Modified files: +# | * dlls/d3dx9_33/Makefile.in, dlls/d3dx9_33/d3dx9_33.spec, dlls/d3dx9_33/d3dx9_33_main.c +# | +if test "$enable_d3dx9_33_Share_Source" -eq 1; then + patch_apply d3dx9_33-Share_Source/0001-d3dx9_33-Share-the-source-with-d3dx9_36.patch + ( + echo '+ { "Alistair Leslie-Hughes", "d3dx9_33: Share the source with d3dx9_36.", 1 },'; + ) >> "$patchlist" +fi + # Patchset d3dx9_36-AnimationController # | # | Modified files: @@ -2290,36 +2386,6 @@ ) >> "$patchlist" fi -# Patchset d3dx9_36-D3DXStubs -# | -# | This patchset fixes the following Wine bugs: -# | * [#31984] Add stub for D3DXComputeTangentFrameEx -# | * [#26379] Support for D3DXComputeNormals -# | * [#38334] Add stub for D3DXFrameFind -# | -# | Modified files: -# | * dlls/d3dx9_24/d3dx9_24.spec, dlls/d3dx9_25/d3dx9_25.spec, dlls/d3dx9_26/d3dx9_26.spec, dlls/d3dx9_27/d3dx9_27.spec, -# | dlls/d3dx9_28/d3dx9_28.spec, dlls/d3dx9_29/d3dx9_29.spec, dlls/d3dx9_30/d3dx9_30.spec, dlls/d3dx9_31/d3dx9_31.spec, -# | dlls/d3dx9_32/d3dx9_32.spec, dlls/d3dx9_33/d3dx9_33.spec, dlls/d3dx9_34/d3dx9_34.spec, dlls/d3dx9_35/d3dx9_35.spec, -# | dlls/d3dx9_36/d3dx9_36.spec, dlls/d3dx9_36/mesh.c, dlls/d3dx9_37/d3dx9_37.spec, dlls/d3dx9_38/d3dx9_38.spec, -# | dlls/d3dx9_39/d3dx9_39.spec, dlls/d3dx9_40/d3dx9_40.spec, dlls/d3dx9_41/d3dx9_41.spec, dlls/d3dx9_42/d3dx9_42.spec, -# | dlls/d3dx9_43/d3dx9_43.spec -# | -if test "$enable_d3dx9_36_D3DXStubs" -eq 1; then - patch_apply d3dx9_36-D3DXStubs/0001-d3dx9_36-Add-stub-for-D3DXComputeTangentFrameEx.patch - patch_apply d3dx9_36-D3DXStubs/0002-d3dx9_36-Add-stub-for-D3DXIntersect.patch - patch_apply d3dx9_36-D3DXStubs/0003-d3dx9_36-Implement-D3DXComputeNormals.patch - patch_apply d3dx9_36-D3DXStubs/0004-d3dx9_36-Add-stub-for-D3DXComputeNormalMap.patch - patch_apply d3dx9_36-D3DXStubs/0005-d3dx9_36-Add-D3DXFrameFind-stub.patch - ( - echo '+ { "Christian Costa", "d3dx9_36: Add stub for D3DXComputeTangentFrameEx.", 1 },'; - echo '+ { "Christian Costa", "d3dx9_36: Add stub for D3DXIntersect.", 1 },'; - echo '+ { "Christian Costa", "d3dx9_36: Implement D3DXComputeNormals.", 1 },'; - echo '+ { "Christian Costa", "d3dx9_36: Add stub for D3DXComputeNormalMap.", 1 },'; - echo '+ { "Andrey Gusev", "d3dx9_36: Add D3DXFrameFind stub.", 1 },'; - ) >> "$patchlist" -fi - # Patchset d3dx9_36-DDS # | # | This patchset fixes the following Wine bugs: @@ -2356,6 +2422,23 @@ ) >> "$patchlist" fi +# Patchset d3dx9_36-Dummy_Skininfo +# | +# | This patchset fixes the following Wine bugs: +# | * [#33904] Return dummy ID3DXSkinInfo interface when skinning info not present +# | +# | Modified files: +# | * dlls/d3dx9_36/d3dx9_36_private.h, dlls/d3dx9_36/mesh.c, dlls/d3dx9_36/skin.c, dlls/d3dx9_36/tests/mesh.c +# | +if test "$enable_d3dx9_36_Dummy_Skininfo" -eq 1; then + patch_apply d3dx9_36-Dummy_Skininfo/0001-d3dx9_36-Return-dummy-skininfo-interface-in-D3DXLoad.patch + patch_apply d3dx9_36-Dummy_Skininfo/0002-d3dx9_36-tests-Add-initial-tests-for-dummy-skininfo-.patch + ( + echo '+ { "Michael Müller", "d3dx9_36: Return dummy skininfo interface in D3DXLoadSkinMeshFromXof when skin information is unavailable.", 1 },'; + echo '+ { "Michael Müller", "d3dx9_36/tests: Add initial tests for dummy skininfo interface.", 1 },'; + ) >> "$patchlist" +fi + # Patchset d3dx9_36-Filter_Warnings # | # | This patchset fixes the following Wine bugs: @@ -2396,10 +2479,10 @@ # | if test "$enable_d3dx9_36_GetShaderSemantics" -eq 1; then patch_apply d3dx9_36-GetShaderSemantics/0001-d3dx9_36-Implement-D3DXGetShaderInputSemantics-tests.patch - patch_apply d3dx9_36-GetShaderSemantics/0002-d3dx9_36-Implement-D3DXGetShaderOutputSemantics.patch + patch_apply d3dx9_36-GetShaderSemantics/0002-d3dx9_36-Implement-D3DXGetShaderOutputSemantics.-rev.patch ( - echo '+ { "Christian Costa", "d3dx9_36: Implement D3DXGetShaderInputSemantics + tests.", 2 },'; - echo '+ { "Christian Costa", "d3dx9_36: Implement D3DXGetShaderOutputSemantics.", 1 },'; + echo '+ { "Christian Costa", "d3dx9_36: Implement D3DXGetShaderInputSemantics + tests.", 3 },'; + echo '+ { "Alistair Leslie-Hughes", "d3dx9_36: Implement D3DXGetShaderOutputSemantics.", 2 },'; ) >> "$patchlist" fi @@ -2454,6 +2537,21 @@ ) >> "$patchlist" fi +# Patchset dbghelp-UnDecorateSymbolNameW +# | +# | This patchset fixes the following Wine bugs: +# | * [#38828] Implement dbghelp.UnDecorateSymbolNameW +# | +# | Modified files: +# | * dlls/dbghelp/dbghelp.spec, dlls/dbghelp/symbol.c +# | +if test "$enable_dbghelp_UnDecorateSymbolNameW" -eq 1; then + patch_apply dbghelp-UnDecorateSymbolNameW/0001-dbghelp-Implement-UnDecorateSymbolNameW.patch + ( + echo '+ { "Sebastian Lackner", "dbghelp: Implement UnDecorateSymbolNameW.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ddraw-EnumSurfaces # | # | This patchset fixes the following Wine bugs: @@ -2485,6 +2583,21 @@ ) >> "$patchlist" fi +# Patchset ddraw-Rendering_Targets +# | +# | This patchset fixes the following Wine bugs: +# | * [#34906] Use video memory for rendering targets if possible +# | +# | Modified files: +# | * dlls/ddraw/ddraw.c, dlls/ddraw/ddraw_private.h, dlls/ddraw/device.c, dlls/ddraw/surface.c +# | +if test "$enable_ddraw_Rendering_Targets" -eq 1; then + patch_apply ddraw-Rendering_Targets/0001-ddraw-Create-rendering-targets-in-video-memory-if-po.patch + ( + echo '+ { "Michael Müller", "ddraw: Create rendering targets in video memory if possible.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ddraw-d3d_execute_buffer # | # | Modified files: @@ -2580,18 +2693,6 @@ ) >> "$patchlist" fi -# Patchset dwrite-VDMX -# | -# | Modified files: -# | * dlls/dwrite/opentype.c -# | -if test "$enable_dwrite_VDMX" -eq 1; then - patch_apply dwrite-VDMX/0001-dwrite-Avoid-dereferencing-NULL-pointer-for-fonts-wi.patch - ( - echo '+ { "Sebastian Lackner", "dwrite: Avoid dereferencing NULL pointer for fonts without VDMX.", 1 },'; - ) >> "$patchlist" -fi - # Patchset dxgi-GetDesc # | # | This patchset fixes the following Wine bugs: @@ -2701,6 +2802,9 @@ # Patchset gdi32-Default_Palette # | +# | This patchset fixes the following Wine bugs: +# | * [#36895] Return default palette entries from GetSystemPaletteEntries for non-palette-based devices +# | # | Modified files: # | * dlls/gdi32/palette.c, dlls/gdi32/tests/palette.c # | @@ -2746,33 +2850,19 @@ ) >> "$patchlist" fi -# Patchset gdiplus-GIF_Encoder -# | -# | This patchset fixes the following Wine bugs: -# | * [#34356] Forward GIF encoder requests to windowscodecs -# | -# | Modified files: -# | * dlls/gdiplus/image.c, dlls/gdiplus/tests/image.c -# | -if test "$enable_gdiplus_GIF_Encoder" -eq 1; then - patch_apply gdiplus-GIF_Encoder/0001-gdiplus-Forward-GIF-encoder-requests-to-windowscodec.patch - ( - echo '+ { "Dmitry Timoshkov", "gdiplus: Forward GIF encoder requests to windowscodecs.", 1 },'; - ) >> "$patchlist" -fi - # Patchset gdiplus-GdipCreateEffect # | # | This patchset fixes the following Wine bugs: # | * [#32163] Add stub for gdiplus.GdipCreateEffect # | # | Modified files: -# | * dlls/gdiplus/gdiplus.spec, dlls/gdiplus/image.c +# | * dlls/gdiplus/gdiplus.spec, dlls/gdiplus/image.c, dlls/gdiplus/tests/image.c, include/Makefile.in, include/gdiplus.h, +# | include/gdipluseffects.h # | if test "$enable_gdiplus_GdipCreateEffect" -eq 1; then - patch_apply gdiplus-GdipCreateEffect/0001-gdiplus-Add-stub-for-GdipCreateEffect.patch + patch_apply gdiplus-GdipCreateEffect/0001-gdiplus-Add-GdipCreateEffect-stub.patch ( - echo '+ { "David Hedberg", "gdiplus: Add stub for GdipCreateEffect.", 1 },'; + echo '+ { "Alistair Leslie-Hughes", "gdiplus: Add GdipCreateEffect stub.", 1 },'; ) >> "$patchlist" fi @@ -2859,6 +2949,18 @@ ) >> "$patchlist" fi +# Patchset kernel32-SetFileInformationByHandle +# | +# | Modified files: +# | * include/winbase.h +# | +if test "$enable_kernel32_SetFileInformationByHandle" -eq 1; then + patch_apply kernel32-SetFileInformationByHandle/0001-include-Declare-a-couple-more-file-information-class.patch + ( + echo '+ { "Michael Müller", "include: Declare a couple more file information class structures.", 1 },'; + ) >> "$patchlist" +fi + # Patchset server-File_Permissions # | # | Modified files: @@ -2922,18 +3024,6 @@ ) >> "$patchlist" fi -# Patchset kernel32-SetFileInformationByHandle -# | -# | Modified files: -# | * include/winbase.h -# | -if test "$enable_kernel32_SetFileInformationByHandle" -eq 1; then - patch_apply kernel32-SetFileInformationByHandle/0001-include-Declare-a-couple-more-file-information-class.patch - ( - echo '+ { "Michael Müller", "include: Declare a couple more file information class structures.", 1 },'; - ) >> "$patchlist" -fi - # Patchset kernel32-CopyFileEx # | # | This patchset fixes the following Wine bugs: @@ -2978,15 +3068,18 @@ ) >> "$patchlist" fi -# Patchset kernel32-InsertMode +# Patchset kernel32-LocaleNameToLCID +# | +# | This patchset fixes the following Wine bugs: +# | * [#30076] Silence repeated LocaleNameToLCID/LCIDToLocaleName unsupported flags FIXMEs # | # | Modified files: -# | * dlls/kernel32/editline.c +# | * dlls/kernel32/locale.c # | -if test "$enable_kernel32_InsertMode" -eq 1; then - patch_apply kernel32-InsertMode/0001-kernel32-Set-console-InsertMode-immediately.patch +if test "$enable_kernel32_LocaleNameToLCID" -eq 1; then + patch_apply kernel32-LocaleNameToLCID/0001-kernel32-Silence-repeated-LocaleNameToLCID-unsupport.patch ( - echo '+ { "Hugh McMaster", "kernel32: Set console InsertMode immediately.", 1 },'; + echo '+ { "Jarkko Korpi", "kernel32: Silence repeated LocaleNameToLCID unsupported flags message.", 1 },'; ) >> "$patchlist" fi @@ -3098,6 +3191,21 @@ ) >> "$patchlist" fi +# Patchset kernel32-SetFileCompletionNotificationModes +# | +# | This patchset fixes the following Wine bugs: +# | * [#38960] Fake success in kernel32.SetFileCompletionNotificationModes +# | +# | Modified files: +# | * dlls/kernel32/file.c +# | +if test "$enable_kernel32_SetFileCompletionNotificationModes" -eq 1; then + patch_apply kernel32-SetFileCompletionNotificationModes/0001-kernel32-Fake-success-in-SetFileCompletionNotificati.patch + ( + echo '+ { "Sebastian Lackner", "kernel32: Fake success in SetFileCompletionNotificationModes.", 1 },'; + ) >> "$patchlist" +fi + # Patchset kernel32-TimezoneInformation_Registry # | # | Modified files: @@ -3227,7 +3335,7 @@ if test "$enable_mscoree_CorValidateImage" -eq 1; then patch_apply mscoree-CorValidateImage/0001-mscoree-Implement-_CorValidateImage.patch ( - echo '+ { "Michael Müller", "mscoree: Implement _CorValidateImage.", 1 },'; + echo '+ { "Michael Müller", "mscoree: Implement _CorValidateImage.", 2 },'; ) >> "$patchlist" fi @@ -3329,18 +3437,6 @@ ) >> "$patchlist" fi -# Patchset ntdll-Coverity -# | -# | Modified files: -# | * dlls/ntdll/threadpool.c -# | -if test "$enable_ntdll_Coverity" -eq 1; then - patch_apply ntdll-Coverity/0001-ntdll-Fix-incorrect-assignment-in-assert-statement-C.patch - ( - echo '+ { "Sebastian Lackner", "ntdll: Fix incorrect assignment in assert statement (Coverity).", 1 },'; - ) >> "$patchlist" -fi - # Patchset ntdll-DOS_Attributes # | # | This patchset fixes the following Wine bugs: @@ -3384,6 +3480,21 @@ ) >> "$patchlist" fi +# Patchset ntdll-Loader_Machine_Type +# | +# | This patchset fixes the following Wine bugs: +# | * [#38021] Check architecture before trying to load libraries +# | +# | Modified files: +# | * dlls/ntdll/loader.c +# | +if test "$enable_ntdll_Loader_Machine_Type" -eq 1; then + patch_apply ntdll-Loader_Machine_Type/0001-ntdll-Check-architecture-before-loading-module.patch + ( + echo '+ { "Michael Müller", "ntdll: Check architecture before loading module.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ntdll-DllRedirects # | # | Modified files: @@ -3602,21 +3713,6 @@ ) >> "$patchlist" fi -# Patchset ntdll-Revert_Security_Cookie -# | -# | This patchset fixes the following Wine bugs: -# | * [#38895] Revert patch causing crash in IrfanView when using the WebP plugin -# | -# | Modified files: -# | * dlls/ntdll/virtual.c -# | -if test "$enable_ntdll_Revert_Security_Cookie" -eq 1; then - patch_apply ntdll-Revert_Security_Cookie/0001-Revert-ntdll-Randomize-security-cookie-when-availabl.patch - ( - echo '+ { "Sebastian Lackner", "Revert \"ntdll: Randomize security cookie when available.\".", 1 },'; - ) >> "$patchlist" -fi - # Patchset ntdll-RtlIpStringToAddress # | # | Modified files: @@ -3635,6 +3731,44 @@ ) >> "$patchlist" fi +# Patchset ntdll-Security_Cookie +# | +# | This patchset fixes the following Wine bugs: +# | * [#38949] Fix security cookie handling for UPX compressed executables +# | +# | Modified files: +# | * dlls/ntdll/virtual.c +# | +if test "$enable_ntdll_Security_Cookie" -eq 1; then + patch_apply ntdll-Security_Cookie/0001-ntdll-Handle-partial-image-load-config-structs.-try-.patch + patch_apply ntdll-Security_Cookie/0002-ntdll-Validate-SecurityCookie-pointer-before-derefer.patch + ( + echo '+ { "Martin Storsjo", "ntdll: Handle partial image load config structs.", 3 },'; + echo '+ { "Sebastian Lackner", "ntdll: Validate SecurityCookie pointer before dereferencing.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset ntdll-ThreadQuerySetWin32StartAddress +# | +# | This patchset fixes the following Wine bugs: +# | * [#8277] Add support for ThreadQuerySetWin32StartAddress info class +# | +# | Modified files: +# | * dlls/ntdll/tests/info.c, dlls/ntdll/thread.c, server/protocol.def, server/thread.c, server/thread.h +# | +if test "$enable_ntdll_ThreadQuerySetWin32StartAddress" -eq 1; then + patch_apply ntdll-ThreadQuerySetWin32StartAddress/0001-server-Use-a-separate-wineserver-call-to-fetch-threa.patch + patch_apply ntdll-ThreadQuerySetWin32StartAddress/0002-ntdll-Implement-ThreadQuerySetWin32StartAddress-info.patch + patch_apply ntdll-ThreadQuerySetWin32StartAddress/0003-ntdll-Implement-ThreadQuerySetWin32StartAddress-info.patch + patch_apply ntdll-ThreadQuerySetWin32StartAddress/0004-ntdll-tests-Add-tests-for-ThreadQuerySetWin32StartAd.patch + ( + echo '+ { "Sebastian Lackner", "server: Use a separate wineserver call to fetch thread times.", 1 },'; + echo '+ { "Sebastian Lackner", "ntdll: Implement ThreadQuerySetWin32StartAddress info class in NtSetInformationThread.", 2 },'; + echo '+ { "Sebastian Lackner", "ntdll: Implement ThreadQuerySetWin32StartAddress info class in NtQueryInformationThread.", 1 },'; + echo '+ { "Sebastian Lackner", "ntdll/tests: Add tests for ThreadQuerySetWin32StartAddress info class.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ntdll-ThreadTime # | # | This patchset fixes the following Wine bugs: @@ -3653,14 +3787,24 @@ # Patchset ntdll-Threading # | # | Modified files: -# | * dlls/ntdll/process.c, dlls/ntdll/thread.c +# | * dlls/ntdll/thread.c # | if test "$enable_ntdll_Threading" -eq 1; then patch_apply ntdll-Threading/0001-ntdll-Fix-race-condition-when-threads-are-killed-dur.patch - patch_apply ntdll-Threading/0002-ntdll-Avoid-deadlock-by-using-_exit-in-NtTerminatePr.patch ( echo '+ { "Sebastian Lackner", "ntdll: Fix race-condition when threads are killed during shutdown.", 1 },'; - echo '+ { "Sebastian Lackner", "ntdll: Avoid deadlock by using _exit() in NtTerminateProcess.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset ntdll-Threadpool +# | +# | Modified files: +# | * dlls/ntdll/threadpool.c +# | +if test "$enable_ntdll_Threadpool" -eq 1; then + patch_apply ntdll-Threadpool/0001-ntdll-Mark-newly-spawned-worker-threads-as-busy-to-a.patch + ( + echo '+ { "Sebastian Lackner", "ntdll: Mark newly spawned worker threads as busy to avoid problems with long-running tasks.", 1 },'; ) >> "$patchlist" fi @@ -3728,7 +3872,6 @@ # | # | This patchset fixes the following Wine bugs: # | * [#38103] Process Hacker 2.x needs ntoskrnl.ProbeForRead -# | * [#21448] SecuROM 5.x media validation fails # | # | Modified files: # | * dlls/ntoskrnl.exe/ntoskrnl.c, dlls/ntoskrnl.exe/ntoskrnl.exe.spec, include/ddk/wdm.h @@ -3751,7 +3894,6 @@ patch_apply ntoskrnl-Stubs/0015-ntoskrnl.exe-Add-stub-for-ProbeForRead.patch patch_apply ntoskrnl-Stubs/0016-ntoskrnl.exe-Add-stub-for-ProbeForWrite.patch patch_apply ntoskrnl-Stubs/0017-ntoskrnl.exe-Add-stub-for-PsRemoveLoadImageNotifyRou.patch - patch_apply ntoskrnl-Stubs/0018-ntoskrnl.exe-Improve-IoGetDeviceObjectPointer-stub-t.patch ( echo '+ { "Austin English", "ntoskrnl.exe: add KeWaitForMultipleObjects stub.", 1 },'; echo '+ { "Alexander Morozov", "ntoskrnl.exe: Add stub for IoGetAttachedDeviceReference.", 1 },'; @@ -3770,7 +3912,6 @@ echo '+ { "Austin English", "ntoskrnl.exe: Add stub for ProbeForRead.", 1 },'; echo '+ { "Sebastian Lackner", "ntoskrnl.exe: Add stub for ProbeForWrite.", 1 },'; echo '+ { "Michael Müller", "ntoskrnl.exe: Add stub for PsRemoveLoadImageNotifyRoutine.", 1 },'; - echo '+ { "Erich E. Hoover", "ntoskrnl.exe: Improve IoGetDeviceObjectPointer stub to appease SecuROM 5.x.", 1 },'; ) >> "$patchlist" fi @@ -3881,6 +4022,21 @@ ) >> "$patchlist" fi +# Patchset openal32-EFX_Extension +# | +# | This patchset fixes the following Wine bugs: +# | * [#38972] Export additional OpenAL32 functions +# | +# | Modified files: +# | * dlls/openal32/openal.c, dlls/openal32/openal32.spec +# | +if test "$enable_openal32_EFX_Extension" -eq 1; then + patch_apply openal32-EFX_Extension/0001-openal32-Export-EFX-extension-functions.patch + ( + echo '+ { "Michael Müller", "openal32: Export EFX extension functions.", 1 },'; + ) >> "$patchlist" +fi + # Patchset opengl32-Revert_Disable_Ext # | # | This patchset fixes the following Wine bugs: @@ -4133,13 +4289,11 @@ # Patchset server-JobObjects # | # | Modified files: -# | * dlls/kernel32/tests/process.c, dlls/ntdll/sync.c, server/process.c +# | * dlls/ntdll/sync.c # | if test "$enable_server_JobObjects" -eq 1; then - patch_apply server-JobObjects/0001-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch - patch_apply server-JobObjects/0002-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch + patch_apply server-JobObjects/0001-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch ( - echo '+ { "Andrew Cook", "server: Implement JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.", 1 },'; echo '+ { "Sebastian Lackner", "ntdll: Implement NtQueryInformationJobObject stub function.", 1 },'; ) >> "$patchlist" fi @@ -4191,6 +4345,21 @@ ) >> "$patchlist" fi +# Patchset server-Registry_Timestamp +# | +# | This patchset fixes the following Wine bugs: +# | * [#38927] Store registry timestamps with nanoseconds precision +# | +# | Modified files: +# | * server/registry.c +# | +if test "$enable_server_Registry_Timestamp" -eq 1; then + patch_apply server-Registry_Timestamp/0001-server-Increase-precision-when-saving-loading-regist.patch + ( + echo '+ { "Michael Müller", "server: Increase precision when saving / loading registry modification date.", 1 },'; + ) >> "$patchlist" +fi + # Patchset server-Shared_Memory # | # | Modified files: @@ -4222,20 +4391,6 @@ ) >> "$patchlist" fi -# Patchset server-Unexpected_Wakeup -# | -# | Modified files: -# | * dlls/kernel32/tests/sync.c, server/thread.c -# | -if test "$enable_server_Unexpected_Wakeup" -eq 1; then - patch_apply server-Unexpected_Wakeup/0001-server-Avoid-sending-unexpected-wakeup-with-uninitia.patch - patch_apply server-Unexpected_Wakeup/0002-kernel32-tests-Repeat-test-for-SignalObjectAndWait-m.patch - ( - echo '+ { "Sebastian Lackner", "server: Avoid sending unexpected wakeup with uninitialized cookie value.", 1 },'; - echo '+ { "Sebastian Lackner", "kernel32/tests: Repeat test for SignalObjectAndWait multiple times to test wineserver wakeup cookie management.", 1 },'; - ) >> "$patchlist" -fi - # Patchset setupapi-SetupDiSelectBestCompatDrv # | # | This patchset fixes the following Wine bugs: @@ -4370,21 +4525,6 @@ ) >> "$patchlist" fi -# Patchset shell32-Quoted_ShellExecute -# | -# | This patchset fixes the following Wine bugs: -# | * [#19666] Multiple applications start wrong executable if whitespace present in name -# | -# | Modified files: -# | * dlls/shell32/shlexec.c, dlls/shell32/tests/shlexec.c -# | -if test "$enable_shell32_Quoted_ShellExecute" -eq 1; then - patch_apply shell32-Quoted_ShellExecute/0001-shell32-Quote-program-name-in-ShellExecuteEx-if-it-c.patch - ( - echo '+ { "Stefan Leichter", "shell32: Quote program name in ShellExecuteEx if it contains spaces.", 1 },'; - ) >> "$patchlist" -fi - # Patchset shell32-RunDLL_CallEntry16 # | # | This patchset fixes the following Wine bugs: @@ -4620,34 +4760,15 @@ # | * [#31640] Implement various vcomp functions # | # | Modified files: -# | * configure.ac, dlls/vcomp/main.c, dlls/vcomp/tests/Makefile.in, dlls/vcomp/tests/vcomp.c, -# | dlls/vcomp/tests/vcomp.manifest, dlls/vcomp/tests/vcomp.rc, dlls/vcomp/vcomp.spec, dlls/vcomp100/vcomp100.spec, +# | * dlls/vcomp/main.c, dlls/vcomp/tests/vcomp.c, dlls/vcomp/vcomp.spec, dlls/vcomp100/vcomp100.spec, # | dlls/vcomp90/vcomp90.spec # | if test "$enable_vcomp_Functions" -eq 1; then - patch_apply vcomp-Functions/0001-vcomp-Implement-stub-for-_vcomp_fork.patch - patch_apply vcomp-Functions/0002-vcomp-Add-basic-worker-thread-infrastructure.patch - patch_apply vcomp-Functions/0003-vcomp-tests-Add-initial-tests-for-_vcomp_fork.patch - patch_apply vcomp-Functions/0004-vcomp-Implement-_vcomp_for_static_simple_init-and-_v.patch - patch_apply vcomp-Functions/0005-vcomp-tests-Add-tests-for-_vcomp_for_static_simple_i.patch - patch_apply vcomp-Functions/0006-vcomp-Implement-_vcomp_for_static_init.patch - patch_apply vcomp-Functions/0007-vcomp-tests-Add-tests-for-_vcomp_for_static_init.patch - patch_apply vcomp-Functions/0008-vcomp-Implement-_vcomp_barrier.patch - patch_apply vcomp-Functions/0009-vcomp-Implement-omp_in_parallel.patch - patch_apply vcomp-Functions/0010-vcomp-Implement-_vcomp_sections_init-and-_vcomp_sect.patch - patch_apply vcomp-Functions/0011-vcomp-Implement-_vcomp_for_dynamic_init-and-_vcomp_f.patch - ( - echo '+ { "Dan Kegel", "vcomp: Implement stub for _vcomp_fork.", 1 },'; - echo '+ { "Sebastian Lackner", "vcomp: Add basic worker thread infrastructure.", 1 },'; - echo '+ { "Dan Kegel", "vcomp/tests: Add initial tests for _vcomp_fork.", 1 },'; - echo '+ { "Sebastian Lackner", "vcomp: Implement _vcomp_for_static_simple_init and _vcomp_for_static_end.", 1 },'; - echo '+ { "Sebastian Lackner", "vcomp/tests: Add tests for _vcomp_for_static_simple_init.", 1 },'; - echo '+ { "Sebastian Lackner", "vcomp: Implement _vcomp_for_static_init.", 1 },'; - echo '+ { "Sebastian Lackner", "vcomp/tests: Add tests for _vcomp_for_static_init.", 1 },'; - echo '+ { "Sebastian Lackner", "vcomp: Implement _vcomp_barrier.", 1 },'; - echo '+ { "Sebastian Lackner", "vcomp: Implement omp_in_parallel.", 1 },'; - echo '+ { "Sebastian Lackner", "vcomp: Implement _vcomp_sections_init and _vcomp_sections_next and add tests.", 1 },'; - echo '+ { "Sebastian Lackner", "vcomp: Implement _vcomp_for_dynamic_init and _vcomp_for_dynamic_next and add tests.", 1 },'; + patch_apply vcomp-Functions/0001-vcomp-Implement-_vcomp_for_dynamic_init-and-_vcomp_f.patch + patch_apply vcomp-Functions/0002-vcomp-tests-Add-tests-for-_vcomp_for_dynamic_init.patch + ( + echo '+ { "Sebastian Lackner", "vcomp: Implement _vcomp_for_dynamic_init and _vcomp_for_dynamic_next.", 1 },'; + echo '+ { "Sebastian Lackner", "vcomp/tests: Add tests for _vcomp_for_dynamic_init.", 1 },'; ) >> "$patchlist" fi @@ -4705,51 +4826,6 @@ ) >> "$patchlist" fi -# Patchset widl-Buffer_Overflow -# | -# | This patchset fixes the following Wine bugs: -# | * [#37129] Increase buffer size in widl/typegen.c to avoid buffer overflow -# | -# | Modified files: -# | * tools/widl/typegen.c -# | -if test "$enable_widl_Buffer_Overflow" -eq 1; then - patch_apply widl-Buffer_Overflow/0001-widl-Increase-buffer-size-in-typegen.c.patch - ( - echo '+ { "Jarkko Korpi", "widl: Increase buffer size in typegen.c.", 1 },'; - ) >> "$patchlist" -fi - -# Patchset windowscodecs-GIF_Decoder -# | -# | This patchset fixes the following Wine bugs: -# | * [#32227] Ignore garbage after decoding gif lines -# | -# | Modified files: -# | * dlls/windowscodecs/ungif.c -# | -if test "$enable_windowscodecs_GIF_Decoder" -eq 1; then - patch_apply windowscodecs-GIF_Decoder/0001-windowscodecs-Don-t-fail-to-decode-GIF-if-an-image-h.patch - ( - echo '+ { "Dmitry Timoshkov", "windowscodecs: Don'\''t fail to decode GIF if an image has been already loaded.", 1 },'; - ) >> "$patchlist" -fi - -# Patchset windowscodecs-TIFF_Decoder -# | -# | This patchset fixes the following Wine bugs: -# | * [#38027] Support for 8bpp grayscale TIFF images with 8bpp alpha channel -# | -# | Modified files: -# | * dlls/windowscodecs/tests/tiffformat.c, dlls/windowscodecs/tiffformat.c -# | -if test "$enable_windowscodecs_TIFF_Decoder" -eq 1; then - patch_apply windowscodecs-TIFF_Decoder/0001-windowscodecs-Add-support-for-8bpp-grayscale-TIFF-im.patch - ( - echo '+ { "Dmitry Timoshkov", "windowscodecs: Add support for 8bpp grayscale TIFF images with 8bpp alpha channel.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wine.inf-Performance # | # | This patchset fixes the following Wine bugs: @@ -4852,23 +4928,18 @@ ) >> "$patchlist" fi -# Patchset wineconsole-Insert_Mode -# | -# | This patchset fixes the following Wine bugs: -# | * [#38697] Allow to enable/disable InsertMode in wineconsole settings +# Patchset wineconsole-Forward_Exitcode # | # | Modified files: -# | * programs/wineconsole/dialog.c, programs/wineconsole/wineconsole.c, programs/wineconsole/wineconsole.rc, -# | programs/wineconsole/wineconsole_res.h +# | * programs/wineconsole/curses.c, programs/wineconsole/user.c, programs/wineconsole/winecon_private.h, +# | programs/wineconsole/wineconsole.c # | -if test "$enable_wineconsole_Insert_Mode" -eq 1; then - patch_apply wineconsole-Insert_Mode/0001-wineconsole-Rearrange-user-dialog-to-make-space-for-.patch - patch_apply wineconsole-Insert_Mode/0002-wineconsole-Improve-semantics-of-some-poorly-worded-.patch - patch_apply wineconsole-Insert_Mode/0003-wineconsole-Add-InsertMode-to-the-user-dialog.patch +if test "$enable_wineconsole_Forward_Exitcode" -eq 1; then + patch_apply wineconsole-Forward_Exitcode/0001-wineconsole-Consistently-return-nonzero-exitcode-on-.patch + patch_apply wineconsole-Forward_Exitcode/0002-wineconsole-Forward-child-process-exitcode.patch ( - echo '+ { "Hugh McMaster", "wineconsole: Rearrange user dialog to make space for InsertMode checkbox.", 1 },'; - echo '+ { "Hugh McMaster", "wineconsole: Improve semantics of some poorly-worded resource strings.", 1 },'; - echo '+ { "Hugh McMaster", "wineconsole: Add InsertMode to the user dialog.", 1 },'; + echo '+ { "Sebastian Lackner", "wineconsole: Consistently return nonzero exitcode on error.", 1 },'; + echo '+ { "Michael Müller", "wineconsole: Forward child process exitcode.", 1 },'; ) >> "$patchlist" fi @@ -4887,31 +4958,15 @@ # Patchset wined3d-CSMT_Helper # | # | Modified files: -# | * configure.ac, dlls/ddraw/surface.c, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc, -# | dlls/wined3d/resource.c, dlls/wined3d/surface.c, dlls/wined3d/texture.c, dlls/wined3d/volume.c, -# | dlls/wined3d/wined3d.spec, dlls/wined3d/wined3d_private.h, include/wine/wined3d.h +# | * configure.ac, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc # | if test "$enable_wined3d_CSMT_Helper" -eq 1; then - patch_apply wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch - patch_apply wined3d-CSMT_Helper/0002-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch + patch_apply wined3d-CSMT_Helper/0001-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch ( - echo '+ { "Stefan Dösinger", "wined3d: Merge get_pitch functions.", 1 },'; echo '+ { "Sebastian Lackner", "wined3d: Add second dll with STAGING_CSMT definition set.", 1 },'; ) >> "$patchlist" fi -# Patchset wined3d-MESA_GPU_Info -# | -# | Modified files: -# | * dlls/wined3d/directx.c, dlls/wined3d/wined3d_gl.h, dlls/winex11.drv/opengl.c, include/wine/wgl_driver.h -# | -if test "$enable_wined3d_MESA_GPU_Info" -eq 1; then - patch_apply wined3d-MESA_GPU_Info/0001-wined3d-Use-pci-and-memory-information-from-MESA-if-.patch - ( - echo '+ { "Michael Müller", "wined3d: Use pci and memory information from MESA if possible.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-Multisampling # | # | This patchset fixes the following Wine bugs: @@ -4927,6 +4982,30 @@ ) >> "$patchlist" fi +# Patchset wined3d-resource_check_usage +# | +# | Modified files: +# | * dlls/wined3d/resource.c +# | +if test "$enable_wined3d_resource_check_usage" -eq 1; then + patch_apply wined3d-resource_check_usage/0001-wined3d-Silence-repeated-resource_check_usage-FIXME.patch + ( + echo '+ { "Erich E. Hoover", "wined3d: Silence repeated resource_check_usage FIXME.", 2 },'; + ) >> "$patchlist" +fi + +# Patchset wined3d-wined3d_swapchain_present +# | +# | Modified files: +# | * dlls/wined3d/swapchain.c +# | +if test "$enable_wined3d_wined3d_swapchain_present" -eq 1; then + patch_apply wined3d-wined3d_swapchain_present/0001-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch + ( + echo '+ { "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-Revert_PixelFormat # | # | This patchset fixes the following Wine bugs: @@ -4972,27 +5051,30 @@ ) >> "$patchlist" fi -# Patchset wined3d-resource_check_usage +# Patchset wined3d-Geforce_425M +# | +# | This patchset fixes the following Wine bugs: +# | * [#35054] Add wined3d detection for GeForce GT 425M # | # | Modified files: -# | * dlls/wined3d/resource.c +# | * dlls/wined3d/directx.c, dlls/wined3d/wined3d_private.h # | -if test "$enable_wined3d_resource_check_usage" -eq 1; then - patch_apply wined3d-resource_check_usage/0001-wined3d-Silence-repeated-resource_check_usage-FIXME.patch +if test "$enable_wined3d_Geforce_425M" -eq 1; then + patch_apply wined3d-Geforce_425M/0001-wined3d-Add-detection-for-NVIDIA-GeForce-425M.patch ( - echo '+ { "Erich E. Hoover", "wined3d: Silence repeated resource_check_usage FIXME.", 2 },'; + echo '+ { "Jarkko Korpi", "wined3d: Add detection for NVIDIA GeForce 425M.", 1 },'; ) >> "$patchlist" fi -# Patchset wined3d-wined3d_swapchain_present +# Patchset wined3d-MESA_GPU_Info # | # | Modified files: -# | * dlls/wined3d/swapchain.c +# | * dlls/wined3d/directx.c, dlls/wined3d/wined3d_gl.h, dlls/winex11.drv/opengl.c, include/wine/wgl_driver.h # | -if test "$enable_wined3d_wined3d_swapchain_present" -eq 1; then - patch_apply wined3d-wined3d_swapchain_present/0001-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch +if test "$enable_wined3d_MESA_GPU_Info" -eq 1; then + patch_apply wined3d-MESA_GPU_Info/0001-wined3d-Use-pci-and-memory-information-from-MESA-if-.patch ( - echo '+ { "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME.", 1 },'; + echo '+ { "Michael Müller", "wined3d: Use pci and memory information from MESA if possible.", 2 },'; ) >> "$patchlist" fi @@ -5010,182 +5092,186 @@ # | dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h, dlls/winex11.drv/opengl.c # | if test "$enable_wined3d_CSMT_Main" -eq 1; then - patch_apply wined3d-CSMT_Main/0001-wined3d-Pass-a-context-to-surface_load_sysmem.patch - patch_apply wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch - patch_apply wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch - patch_apply wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_blt_fbo.patch - patch_apply wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_multisample_resolv.patch - patch_apply wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_load_texture.patch - patch_apply wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch - patch_apply wined3d-CSMT_Main/0008-wined3d-Make-surface_load_location-return-nothing.patch - patch_apply wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch - patch_apply wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch - patch_apply wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch - patch_apply wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch - patch_apply wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch - patch_apply wined3d-CSMT_Main/0014-wined3d-Invalidate-containers-via-callback.patch - patch_apply wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch - patch_apply wined3d-CSMT_Main/0016-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch - patch_apply wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch - patch_apply wined3d-CSMT_Main/0018-wined3d-Replace-surface_load_location-with-resource_.patch - patch_apply wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch - patch_apply wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch - patch_apply wined3d-CSMT_Main/0021-wined3d-Remove-surface-pbo.patch - patch_apply wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch - patch_apply wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch - patch_apply wined3d-CSMT_Main/0024-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch - patch_apply wined3d-CSMT_Main/0025-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch - patch_apply wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch - patch_apply wined3d-CSMT_Main/0027-wined3d-Discard-implicit-surfaces-on-unload.patch - patch_apply wined3d-CSMT_Main/0028-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch - patch_apply wined3d-CSMT_Main/0029-wined3d-Discard-the-backbuffer-in-discard-presents.patch - patch_apply wined3d-CSMT_Main/0030-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch - patch_apply wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch - patch_apply wined3d-CSMT_Main/0032-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch - patch_apply wined3d-CSMT_Main/0033-wined3d-Move-check_block_align-to-resource.c.patch - patch_apply wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch - patch_apply wined3d-CSMT_Main/0035-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch - patch_apply wined3d-CSMT_Main/0036-wined3d-Use-resource-facilities-to-destroy-PBOs.patch - patch_apply wined3d-CSMT_Main/0037-wined3d-Move-simple-location-copying-to-the-resource.patch - patch_apply wined3d-CSMT_Main/0038-wined3d-Move-most-of-volume_map-to-resource.c.patch - patch_apply wined3d-CSMT_Main/0039-wined3d-Use-resource_map-for-surface_map.patch - patch_apply wined3d-CSMT_Main/0040-wined3d-Use-client-storage-with-DIB-sections.patch - patch_apply wined3d-CSMT_Main/0041-wined3d-Don-t-call-the-public-map-function-in-surfac.patch - patch_apply wined3d-CSMT_Main/0042-wined3d-Don-t-call-the-public-map-function-in-surfac.patch - patch_apply wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch - patch_apply wined3d-CSMT_Main/0044-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch - patch_apply wined3d-CSMT_Main/0045-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch - patch_apply wined3d-CSMT_Main/0046-wined3d-Hackily-introduce-a-multithreaded-command-st.patch - patch_apply wined3d-CSMT_Main/0047-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch - patch_apply wined3d-CSMT_Main/0048-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch - patch_apply wined3d-CSMT_Main/0049-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch - patch_apply wined3d-CSMT_Main/0050-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch - patch_apply wined3d-CSMT_Main/0051-wined3d-Pass-the-state-to-draw_primitive.patch - patch_apply wined3d-CSMT_Main/0052-wined3d-Wait-for-the-cs-before-destroying-objects.patch - patch_apply wined3d-CSMT_Main/0053-wined3d-Give-the-cs-its-own-state.patch - patch_apply wined3d-CSMT_Main/0054-wined3d-Send-float-constant-updates-through-the-comm.patch - patch_apply wined3d-CSMT_Main/0055-wined3d-Request-a-glFinish-before-modifying-resource.patch - patch_apply wined3d-CSMT_Main/0056-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch - patch_apply wined3d-CSMT_Main/0057-wined3d-Don-t-call-glFinish-after-clears.patch - patch_apply wined3d-CSMT_Main/0058-wined3d-Don-t-call-glFinish-after-draws.patch - patch_apply wined3d-CSMT_Main/0059-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch - patch_apply wined3d-CSMT_Main/0060-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch - patch_apply wined3d-CSMT_Main/0061-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch - patch_apply wined3d-CSMT_Main/0062-wined3d-Don-t-store-viewport-pointers-in-the-command.patch - patch_apply wined3d-CSMT_Main/0063-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch - patch_apply wined3d-CSMT_Main/0064-wined3d-Send-base-vertex-index-updates-through-the-c.patch - patch_apply wined3d-CSMT_Main/0065-wined3d-Send-primitive-type-updates-through-the-comm.patch - patch_apply wined3d-CSMT_Main/0066-wined3d-Send-bool-constant-updates-through-the-comma.patch - patch_apply wined3d-CSMT_Main/0067-wined3d-Send-int-constant-updates-through-the-comman.patch - patch_apply wined3d-CSMT_Main/0068-wined3d-Send-light-updates-through-the-command-strea.patch - patch_apply wined3d-CSMT_Main/0069-wined3d-Prevent-the-command-stream-from-running-ahea.patch - patch_apply wined3d-CSMT_Main/0070-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch - patch_apply wined3d-CSMT_Main/0071-wined3d-Run-the-cs-asynchronously.patch - patch_apply wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch - patch_apply wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch - patch_apply wined3d-CSMT_Main/0074-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch - patch_apply wined3d-CSMT_Main/0075-wined3d-Add-cs-waiting-debug-code.patch - patch_apply wined3d-CSMT_Main/0076-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch - patch_apply wined3d-CSMT_Main/0077-wined3d-Send-render-target-view-clears-through-the-c.patch - patch_apply wined3d-CSMT_Main/0078-wined3d-Wait-for-the-CS-in-GetDC.patch - patch_apply wined3d-CSMT_Main/0079-wined3d-send-resource-maps-through-the-command-strea.patch - patch_apply wined3d-CSMT_Main/0080-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch - patch_apply wined3d-CSMT_Main/0081-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch - patch_apply wined3d-CSMT_Main/0082-wined3d-Don-t-preload-buffers-on-unmap.patch - patch_apply wined3d-CSMT_Main/0083-wined3d-Don-t-call-glFinish-before-swapping.patch - patch_apply wined3d-CSMT_Main/0084-wined3d-wined3d_-_query_issue-never-fails.patch - patch_apply wined3d-CSMT_Main/0085-wined3d-Add-query-support-to-the-command-stream.patch - patch_apply wined3d-CSMT_Main/0086-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch - patch_apply wined3d-CSMT_Main/0087-wined3d-Poll-queries-automatically-in-the-CS.patch - patch_apply wined3d-CSMT_Main/0088-wined3d-Introduce-a-separate-queue-for-priority-comm.patch - patch_apply wined3d-CSMT_Main/0089-wined3d-Destroy-queries-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0090-wined3d-Separate-main-and-worker-thread-query-state.patch - patch_apply wined3d-CSMT_Main/0091-wined3d-Don-t-poll-queries-that-failed-to-start.patch - patch_apply wined3d-CSMT_Main/0092-wined3d-Remove-restated-queries-from-the-poll-list.patch - patch_apply wined3d-CSMT_Main/0093-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch - patch_apply wined3d-CSMT_Main/0094-wined3d-Put-this-into-the-query-poll-patch.patch - patch_apply wined3d-CSMT_Main/0095-wined3d-Send-update_surface-commands-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0096-wined3d-Send-texture-preloads-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0097-wined3d-Send-surface-preloads-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0099-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch - patch_apply wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch - patch_apply wined3d-CSMT_Main/0101-wined3d-Handle-evit_managed_resources-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0102-wined3d-Send-flips-through-the-command-stream.patch - patch_apply wined3d-CSMT_Main/0103-wined3d-Introduce-resource-fencing.patch - patch_apply wined3d-CSMT_Main/0104-wined3d-Fence-update_texture-and-update_surface-call.patch - patch_apply wined3d-CSMT_Main/0105-wined3d-Dirtify-resources-on-unmap.patch - patch_apply wined3d-CSMT_Main/0106-wined3d-Fence-texture-reads-in-draws.patch - patch_apply wined3d-CSMT_Main/0107-wined3d-Fence-render-targets-and-depth-stencils.patch - patch_apply wined3d-CSMT_Main/0108-wined3d-Fence-blit-operations.patch - patch_apply wined3d-CSMT_Main/0109-wined3d-Fence-color_fill-operations.patch - patch_apply wined3d-CSMT_Main/0110-wined3d-Fence-clear-calls.patch - patch_apply wined3d-CSMT_Main/0111-wined3d-Fence-present-calls.patch - patch_apply wined3d-CSMT_Main/0112-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch - patch_apply wined3d-CSMT_Main/0113-wined3d-Dirtify-changed-textures-through-the-command.patch - patch_apply wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch - patch_apply wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch - patch_apply wined3d-CSMT_Main/0116-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch - patch_apply wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch - patch_apply wined3d-CSMT_Main/0118-wined3d-Unset-some-objects-in-state_init_default.patch - patch_apply wined3d-CSMT_Main/0119-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch - patch_apply wined3d-CSMT_Main/0120-wined3d-Use-double-buffered-buffers-for-multithreade.patch - patch_apply wined3d-CSMT_Main/0121-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch - patch_apply wined3d-CSMT_Main/0122-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch - patch_apply wined3d-CSMT_Main/0123-wined3d-Accelerate-DISCARD-buffer-maps.patch - patch_apply wined3d-CSMT_Main/0124-wined3d-Accelerate-READONLY-buffer-maps.patch - patch_apply wined3d-CSMT_Main/0125-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0126-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch - patch_apply wined3d-CSMT_Main/0127-wined3d-Send-buffer-preloads-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0128-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch - patch_apply wined3d-CSMT_Main/0129-wined3d-Separate-GL-buffer-discard-control-from-igno.patch - patch_apply wined3d-CSMT_Main/0130-wined3d-Create-buffers-before-mapping-them.patch - patch_apply wined3d-CSMT_Main/0131-wined3d-Destroy-views-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0132-wined3d-Remove-another-glFinish.patch - patch_apply wined3d-CSMT_Main/0133-wined3d-Destroy-vertex-declarations-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0134-wined3d-Destroy-shaders-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0135-wined3d-Create-VBOs-through-the-command-stream.patch - patch_apply wined3d-CSMT_Main/0136-wined3d-Clean-up-resource-data-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0137-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0138-wined3d-Clean-up-volume-resource-data-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch - patch_apply wined3d-CSMT_Main/0140-wined3d-Clean-up-texture-resources-through-the-cs.patch - patch_apply wined3d-CSMT_Main/0141-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch - patch_apply wined3d-CSMT_Main/0142-wined3d-Unload-resources-through-the-CS-in-device_re.patch - patch_apply wined3d-CSMT_Main/0143-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch - patch_apply wined3d-CSMT_Main/0144-wined3d-Remove-software-cursor-support.patch - patch_apply wined3d-CSMT_Main/0145-wined3d-Create-dummy-textures-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0146-wined3d-Create-the-initial-context-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0147-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch - patch_apply wined3d-CSMT_Main/0148-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch - patch_apply wined3d-CSMT_Main/0149-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch - patch_apply wined3d-CSMT_Main/0150-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch - patch_apply wined3d-CSMT_Main/0151-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch - patch_apply wined3d-CSMT_Main/0152-wined3d-Use-an-event-to-block-the-worker-thread-when.patch - patch_apply wined3d-CSMT_Main/0153-wined3d-Fence-preload-operations.patch - patch_apply wined3d-CSMT_Main/0154-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch - patch_apply wined3d-CSMT_Main/0155-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch - patch_apply wined3d-CSMT_Main/0156-wined3d-Completely-reset-the-state-on-reset.patch - patch_apply wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch - patch_apply wined3d-CSMT_Main/0158-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch - patch_apply wined3d-CSMT_Main/0159-wined3d-Wait-only-for-the-buffer-to-be-idle.patch - patch_apply wined3d-CSMT_Main/0160-wined3d-Add-a-comment-about-worker-thread-lag.patch - patch_apply wined3d-CSMT_Main/0161-wined3d-Remove-the-texture-destroy-glFinish.patch - patch_apply wined3d-CSMT_Main/0162-wined3d-Move-FBO-destruction-into-the-worker-thread.patch - patch_apply wined3d-CSMT_Main/0163-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch - patch_apply wined3d-CSMT_Main/0164-Winex11-complain-about-glfinish.patch - patch_apply wined3d-CSMT_Main/0165-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch - patch_apply wined3d-CSMT_Main/0166-wined3d-Remove-the-device_reset-CS-sync-fixme.patch - patch_apply wined3d-CSMT_Main/0167-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch - patch_apply wined3d-CSMT_Main/0168-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch - patch_apply wined3d-CSMT_Main/0169-wined3d-Don-t-sync-on-redundant-discard-calls.patch - patch_apply wined3d-CSMT_Main/0170-wined3d-Don-t-discard-new-buffers.patch - patch_apply wined3d-CSMT_Main/0171-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch - patch_apply wined3d-CSMT_Main/0172-wined3d-Render-target-lock-hack.patch - patch_apply wined3d-CSMT_Main/0173-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch - patch_apply wined3d-CSMT_Main/0174-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch + patch_apply wined3d-CSMT_Main/0001-wined3d-Properly-initialize-format_flags-for-surface.patch + patch_apply wined3d-CSMT_Main/0002-wined3d-Merge-get_pitch-functions.patch + patch_apply wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_sysmem.patch + patch_apply wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-read_from_framebuffer.patch + patch_apply wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch + patch_apply wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_blt_fbo.patch + patch_apply wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_multisample_resolv.patch + patch_apply wined3d-CSMT_Main/0008-wined3d-Pass-a-context-to-surface_load_texture.patch + patch_apply wined3d-CSMT_Main/0009-wined3d-Pass-a-context-to-surface_load_location.patch + patch_apply wined3d-CSMT_Main/0010-wined3d-Make-surface_load_location-return-nothing.patch + patch_apply wined3d-CSMT_Main/0011-wined3d-Store-volume-locations-in-the-resource.patch + patch_apply wined3d-CSMT_Main/0012-wined3d-Move-validate_location-to-resource.c.patch + patch_apply wined3d-CSMT_Main/0013-wined3d-Move-surface-locations-into-the-resource.patch + patch_apply wined3d-CSMT_Main/0014-wined3d-Remove-surface_validate_location.patch + patch_apply wined3d-CSMT_Main/0015-wined3d-Move-invalidate_location-to-resource.c.patch + patch_apply wined3d-CSMT_Main/0016-wined3d-Invalidate-containers-via-callback.patch + patch_apply wined3d-CSMT_Main/0017-wined3d-Remove-surface_invalidate_location.patch + patch_apply wined3d-CSMT_Main/0018-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch + patch_apply wined3d-CSMT_Main/0019-wined3d-Move-load_location-into-the-resource.patch + patch_apply wined3d-CSMT_Main/0020-wined3d-Replace-surface_load_location-with-resource_.patch + patch_apply wined3d-CSMT_Main/0021-wined3d-Introduce-helper-functions-for-mapping-volum.patch + patch_apply wined3d-CSMT_Main/0022-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch + patch_apply wined3d-CSMT_Main/0023-wined3d-Remove-surface-pbo.patch + patch_apply wined3d-CSMT_Main/0024-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch + patch_apply wined3d-CSMT_Main/0025-wined3d-Move-buffer-creation-into-the-resource.patch + patch_apply wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch + patch_apply wined3d-CSMT_Main/0027-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch + patch_apply wined3d-CSMT_Main/0028-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch + patch_apply wined3d-CSMT_Main/0029-wined3d-Discard-implicit-surfaces-on-unload.patch + patch_apply wined3d-CSMT_Main/0030-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch + patch_apply wined3d-CSMT_Main/0031-wined3d-Discard-the-backbuffer-in-discard-presents.patch + patch_apply wined3d-CSMT_Main/0032-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch + patch_apply wined3d-CSMT_Main/0033-wined3d-Introduce-a-function-to-retrieve-resource-me.patch + patch_apply wined3d-CSMT_Main/0034-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch + patch_apply wined3d-CSMT_Main/0035-wined3d-Move-check_block_align-to-resource.c.patch + patch_apply wined3d-CSMT_Main/0036-wined3d-Replace-surface-alloc-functions-with-resourc.patch + patch_apply wined3d-CSMT_Main/0037-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch + patch_apply wined3d-CSMT_Main/0038-wined3d-Use-resource-facilities-to-destroy-PBOs.patch + patch_apply wined3d-CSMT_Main/0039-wined3d-Move-simple-location-copying-to-the-resource.patch + patch_apply wined3d-CSMT_Main/0040-wined3d-Move-most-of-volume_map-to-resource.c.patch + patch_apply wined3d-CSMT_Main/0041-wined3d-Use-resource_map-for-surface_map.patch + patch_apply wined3d-CSMT_Main/0042-wined3d-Use-client-storage-with-DIB-sections.patch + patch_apply wined3d-CSMT_Main/0043-wined3d-Don-t-call-the-public-map-function-in-surfac.patch + patch_apply wined3d-CSMT_Main/0044-wined3d-Don-t-call-the-public-map-function-in-surfac.patch + patch_apply wined3d-CSMT_Main/0045-wined3d-Move-the-framebuffer-into-wined3d_state.patch + patch_apply wined3d-CSMT_Main/0046-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch + patch_apply wined3d-CSMT_Main/0047-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch + patch_apply wined3d-CSMT_Main/0048-wined3d-Hackily-introduce-a-multithreaded-command-st.patch + patch_apply wined3d-CSMT_Main/0049-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch + patch_apply wined3d-CSMT_Main/0050-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch + patch_apply wined3d-CSMT_Main/0051-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch + patch_apply wined3d-CSMT_Main/0052-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch + patch_apply wined3d-CSMT_Main/0053-wined3d-Pass-the-state-to-draw_primitive.patch + patch_apply wined3d-CSMT_Main/0054-wined3d-Wait-for-the-cs-before-destroying-objects.patch + patch_apply wined3d-CSMT_Main/0055-wined3d-Give-the-cs-its-own-state.patch + patch_apply wined3d-CSMT_Main/0056-wined3d-Send-float-constant-updates-through-the-comm.patch + patch_apply wined3d-CSMT_Main/0057-wined3d-Request-a-glFinish-before-modifying-resource.patch + patch_apply wined3d-CSMT_Main/0058-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch + patch_apply wined3d-CSMT_Main/0059-wined3d-Don-t-call-glFinish-after-clears.patch + patch_apply wined3d-CSMT_Main/0060-wined3d-Don-t-call-glFinish-after-draws.patch + patch_apply wined3d-CSMT_Main/0061-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch + patch_apply wined3d-CSMT_Main/0062-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch + patch_apply wined3d-CSMT_Main/0063-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch + patch_apply wined3d-CSMT_Main/0064-wined3d-Don-t-store-viewport-pointers-in-the-command.patch + patch_apply wined3d-CSMT_Main/0065-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch + patch_apply wined3d-CSMT_Main/0066-wined3d-Send-base-vertex-index-updates-through-the-c.patch + patch_apply wined3d-CSMT_Main/0067-wined3d-Send-primitive-type-updates-through-the-comm.patch + patch_apply wined3d-CSMT_Main/0068-wined3d-Send-bool-constant-updates-through-the-comma.patch + patch_apply wined3d-CSMT_Main/0069-wined3d-Send-int-constant-updates-through-the-comman.patch + patch_apply wined3d-CSMT_Main/0070-wined3d-Send-light-updates-through-the-command-strea.patch + patch_apply wined3d-CSMT_Main/0071-wined3d-Prevent-the-command-stream-from-running-ahea.patch + patch_apply wined3d-CSMT_Main/0072-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch + patch_apply wined3d-CSMT_Main/0073-wined3d-Run-the-cs-asynchronously.patch + patch_apply wined3d-CSMT_Main/0074-wined3d-Send-blits-through-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0075-wined3d-Put-update_surface-checks-back-in-place.patch + patch_apply wined3d-CSMT_Main/0076-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch + patch_apply wined3d-CSMT_Main/0077-wined3d-Add-cs-waiting-debug-code.patch + patch_apply wined3d-CSMT_Main/0078-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch + patch_apply wined3d-CSMT_Main/0079-wined3d-Send-render-target-view-clears-through-the-c.patch + patch_apply wined3d-CSMT_Main/0080-wined3d-Wait-for-the-CS-in-GetDC.patch + patch_apply wined3d-CSMT_Main/0081-wined3d-send-resource-maps-through-the-command-strea.patch + patch_apply wined3d-CSMT_Main/0082-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch + patch_apply wined3d-CSMT_Main/0083-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch + patch_apply wined3d-CSMT_Main/0084-wined3d-Don-t-preload-buffers-on-unmap.patch + patch_apply wined3d-CSMT_Main/0085-wined3d-Don-t-call-glFinish-before-swapping.patch + patch_apply wined3d-CSMT_Main/0086-wined3d-wined3d_-_query_issue-never-fails.patch + patch_apply wined3d-CSMT_Main/0087-wined3d-Add-query-support-to-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0088-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch + patch_apply wined3d-CSMT_Main/0089-wined3d-Poll-queries-automatically-in-the-CS.patch + patch_apply wined3d-CSMT_Main/0090-wined3d-Introduce-a-separate-queue-for-priority-comm.patch + patch_apply wined3d-CSMT_Main/0091-wined3d-Destroy-queries-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0092-wined3d-Separate-main-and-worker-thread-query-state.patch + patch_apply wined3d-CSMT_Main/0093-wined3d-Don-t-poll-queries-that-failed-to-start.patch + patch_apply wined3d-CSMT_Main/0094-wined3d-Remove-restated-queries-from-the-poll-list.patch + patch_apply wined3d-CSMT_Main/0095-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch + patch_apply wined3d-CSMT_Main/0096-wined3d-Put-this-into-the-query-poll-patch.patch + patch_apply wined3d-CSMT_Main/0097-wined3d-Send-update_surface-commands-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0098-wined3d-Send-texture-preloads-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0099-wined3d-Send-surface-preloads-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0100-wined3d-Send-update_texture-calls-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0101-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch + patch_apply wined3d-CSMT_Main/0102-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch + patch_apply wined3d-CSMT_Main/0103-wined3d-Handle-evit_managed_resources-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0104-wined3d-Send-flips-through-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0105-wined3d-Introduce-resource-fencing.patch + patch_apply wined3d-CSMT_Main/0106-wined3d-Fence-update_texture-and-update_surface-call.patch + patch_apply wined3d-CSMT_Main/0107-wined3d-Dirtify-resources-on-unmap.patch + patch_apply wined3d-CSMT_Main/0108-wined3d-Fence-texture-reads-in-draws.patch + patch_apply wined3d-CSMT_Main/0109-wined3d-Fence-render-targets-and-depth-stencils.patch + patch_apply wined3d-CSMT_Main/0110-wined3d-Fence-blit-operations.patch + patch_apply wined3d-CSMT_Main/0111-wined3d-Fence-color_fill-operations.patch + patch_apply wined3d-CSMT_Main/0112-wined3d-Fence-clear-calls.patch + patch_apply wined3d-CSMT_Main/0113-wined3d-Fence-present-calls.patch + patch_apply wined3d-CSMT_Main/0114-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch + patch_apply wined3d-CSMT_Main/0115-wined3d-Dirtify-changed-textures-through-the-command.patch + patch_apply wined3d-CSMT_Main/0116-wined3d-Wrap-GL-BOs-in-a-structure.patch + patch_apply wined3d-CSMT_Main/0117-wined3d-Separate-resource-map-and-draw-buffers.patch + patch_apply wined3d-CSMT_Main/0118-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch + patch_apply wined3d-CSMT_Main/0119-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch + patch_apply wined3d-CSMT_Main/0120-wined3d-Unset-some-objects-in-state_init_default.patch + patch_apply wined3d-CSMT_Main/0121-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch + patch_apply wined3d-CSMT_Main/0122-wined3d-Use-double-buffered-buffers-for-multithreade.patch + patch_apply wined3d-CSMT_Main/0123-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch + patch_apply wined3d-CSMT_Main/0124-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch + patch_apply wined3d-CSMT_Main/0125-wined3d-Accelerate-DISCARD-buffer-maps.patch + patch_apply wined3d-CSMT_Main/0126-wined3d-Accelerate-READONLY-buffer-maps.patch + patch_apply wined3d-CSMT_Main/0127-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0128-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch + patch_apply wined3d-CSMT_Main/0129-wined3d-Send-buffer-preloads-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0130-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch + patch_apply wined3d-CSMT_Main/0131-wined3d-Separate-GL-buffer-discard-control-from-igno.patch + patch_apply wined3d-CSMT_Main/0132-wined3d-Create-buffers-before-mapping-them.patch + patch_apply wined3d-CSMT_Main/0133-wined3d-Destroy-views-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0134-wined3d-Remove-another-glFinish.patch + patch_apply wined3d-CSMT_Main/0135-wined3d-Destroy-vertex-declarations-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0136-wined3d-Destroy-shaders-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0137-wined3d-Create-VBOs-through-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0138-wined3d-Clean-up-resource-data-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0139-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0140-wined3d-Clean-up-volume-resource-data-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0141-wined3d-Clean-up-surfaces-through-the-cs.patch + patch_apply wined3d-CSMT_Main/0142-wined3d-Clean-up-texture-resources-through-the-cs.patch + patch_apply wined3d-CSMT_Main/0143-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch + patch_apply wined3d-CSMT_Main/0144-wined3d-Unload-resources-through-the-CS-in-device_re.patch + patch_apply wined3d-CSMT_Main/0145-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch + patch_apply wined3d-CSMT_Main/0146-wined3d-Remove-software-cursor-support.patch + patch_apply wined3d-CSMT_Main/0147-wined3d-Create-dummy-textures-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0148-wined3d-Create-the-initial-context-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0149-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch + patch_apply wined3d-CSMT_Main/0150-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch + patch_apply wined3d-CSMT_Main/0151-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch + patch_apply wined3d-CSMT_Main/0152-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch + patch_apply wined3d-CSMT_Main/0153-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch + patch_apply wined3d-CSMT_Main/0154-wined3d-Use-an-event-to-block-the-worker-thread-when.patch + patch_apply wined3d-CSMT_Main/0155-wined3d-Fence-preload-operations.patch + patch_apply wined3d-CSMT_Main/0156-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch + patch_apply wined3d-CSMT_Main/0157-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch + patch_apply wined3d-CSMT_Main/0158-wined3d-Completely-reset-the-state-on-reset.patch + patch_apply wined3d-CSMT_Main/0159-wined3d-Send-getdc-and-releasedc-through-the-command.patch + patch_apply wined3d-CSMT_Main/0160-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch + patch_apply wined3d-CSMT_Main/0161-wined3d-Wait-only-for-the-buffer-to-be-idle.patch + patch_apply wined3d-CSMT_Main/0162-wined3d-Add-a-comment-about-worker-thread-lag.patch + patch_apply wined3d-CSMT_Main/0163-wined3d-Remove-the-texture-destroy-glFinish.patch + patch_apply wined3d-CSMT_Main/0164-wined3d-Move-FBO-destruction-into-the-worker-thread.patch + patch_apply wined3d-CSMT_Main/0165-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch + patch_apply wined3d-CSMT_Main/0166-Winex11-complain-about-glfinish.patch + patch_apply wined3d-CSMT_Main/0167-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch + patch_apply wined3d-CSMT_Main/0168-wined3d-Remove-the-device_reset-CS-sync-fixme.patch + patch_apply wined3d-CSMT_Main/0169-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch + patch_apply wined3d-CSMT_Main/0170-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch + patch_apply wined3d-CSMT_Main/0171-wined3d-Don-t-sync-on-redundant-discard-calls.patch + patch_apply wined3d-CSMT_Main/0172-wined3d-Don-t-discard-new-buffers.patch + patch_apply wined3d-CSMT_Main/0173-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch + patch_apply wined3d-CSMT_Main/0174-wined3d-Render-target-lock-hack.patch + patch_apply wined3d-CSMT_Main/0175-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch + patch_apply wined3d-CSMT_Main/0176-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch patch_apply wined3d-CSMT_Main/9999-IfDefined.patch ( + echo '+ { "Sebastian Lackner", "wined3d: Properly initialize format_flags for surfaces and volumes.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Merge get_pitch functions.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Pass a context to surface_load_sysmem.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Pass a context to read_from_framebuffer.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Pass a context to surface_load_drawable and surface_blt_to_drawable.", 1 },'; @@ -5699,7 +5785,7 @@ if test "$enable_winsta_WinStationEnumerateW" -eq 1; then patch_apply winsta-WinStationEnumerateW/0001-winsta-Add-stub-for-WinStationEnumerateW.patch ( - echo '+ { "Austin English", "winsta: Add stub for WinStationEnumerateW.", 1 },'; + echo '+ { "Austin English", "winsta: Add stub for WinStationEnumerateW.", 2 },'; ) >> "$patchlist" fi diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/server-JobObjects/0001-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch wine-staging-1.7.48~ubuntu12.04.1/patches/server-JobObjects/0001-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/server-JobObjects/0001-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/server-JobObjects/0001-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,55 @@ +From 32940d62072444eb41a918b27aae6e4b48fe555f Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Thu, 12 Mar 2015 22:19:50 +0100 +Subject: ntdll: Implement NtQueryInformationJobObject stub function. + +--- + dlls/ntdll/sync.c | 31 ++++++++++++++++++++++++++++++- + 1 file changed, 30 insertions(+), 1 deletion(-) + +diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c +index 04c6de30..fb95460 100644 +--- a/dlls/ntdll/sync.c ++++ b/dlls/ntdll/sync.c +@@ -635,8 +635,37 @@ NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status ) + NTSTATUS WINAPI NtQueryInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS class, PVOID info, + ULONG len, PULONG ret_len ) + { ++ JOBOBJECT_EXTENDED_LIMIT_INFORMATION *extended_limit; ++ JOBOBJECT_BASIC_LIMIT_INFORMATION *basic_limit; ++ + FIXME( "stub: %p %u %p %u %p\n", handle, class, info, len, ret_len ); +- return STATUS_NOT_IMPLEMENTED; ++ ++ if (class >= MaxJobObjectInfoClass) ++ return STATUS_INVALID_PARAMETER; ++ ++ switch (class) ++ { ++ case JobObjectExtendedLimitInformation: ++ if (len < sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION)) ++ return STATUS_INVALID_PARAMETER; ++ ++ extended_limit = (JOBOBJECT_EXTENDED_LIMIT_INFORMATION *)info; ++ memset(extended_limit, 0, sizeof(*extended_limit)); ++ if (ret_len) *ret_len = sizeof(*extended_limit); ++ return STATUS_SUCCESS; ++ ++ case JobObjectBasicLimitInformation: ++ if (len < sizeof(JOBOBJECT_BASIC_LIMIT_INFORMATION)) ++ return STATUS_INVALID_PARAMETER; ++ ++ basic_limit = (JOBOBJECT_BASIC_LIMIT_INFORMATION *)info; ++ memset(basic_limit, 0, sizeof(*basic_limit)); ++ if (ret_len) *ret_len = sizeof(*basic_limit); ++ return STATUS_SUCCESS; ++ ++ default: ++ return STATUS_NOT_IMPLEMENTED; ++ } + } + + /****************************************************************************** +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/server-JobObjects/0001-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch wine-staging-1.7.48~ubuntu12.04.1/patches/server-JobObjects/0001-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/server-JobObjects/0001-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/server-JobObjects/0001-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -From 23d528b7e744e69fa5d857be20f188ce5510c088 Mon Sep 17 00:00:00 2001 -From: Andrew Cook -Date: Thu, 26 Feb 2015 13:10:41 +1100 -Subject: server: Implement JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE. - ---- - dlls/kernel32/tests/process.c | 1 - - server/process.c | 17 ++++++++++++++++- - 2 files changed, 16 insertions(+), 2 deletions(-) - -diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c -index c63d6b1..5e04836 100644 ---- a/dlls/kernel32/tests/process.c -+++ b/dlls/kernel32/tests/process.c -@@ -2435,7 +2435,6 @@ static void test_KillOnJobClose(void) - CloseHandle(job); - - dwret = WaitForSingleObject(pi.hProcess, 1000); -- todo_wine - ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret); - if (dwret == WAIT_TIMEOUT) TerminateProcess(pi.hProcess, 0); - -diff --git a/server/process.c b/server/process.c -index 569a8fe..38bd977 100644 ---- a/server/process.c -+++ b/server/process.c -@@ -140,6 +140,7 @@ static void job_dump( struct object *obj, int verbose ); - static struct object_type *job_get_type( struct object *obj ); - static int job_signaled( struct object *obj, struct wait_queue_entry *entry ); - static unsigned int job_map_access( struct object *obj, unsigned int access ); -+static int job_close_handle( struct object *, struct process *process, obj_handle_t handle ); - static void job_destroy( struct object *obj ); - - struct job -@@ -170,7 +171,7 @@ static const struct object_ops job_ops = - default_set_sd, /* set_sd */ - no_lookup_name, /* lookup_name */ - no_open_file, /* open_file */ -- no_close_handle, /* close_handle */ -+ job_close_handle, /* close_handle */ - job_destroy /* destroy */ - }; - -@@ -287,6 +288,20 @@ static void terminate_job( struct job *job, int exit_code ) - wake_up( &job->obj, 0 ); - } - -+static int job_close_handle( struct object *obj, struct process *process, obj_handle_t handle ) -+{ -+ struct job *job = (struct job *)obj; -+ assert( obj->ops == &job_ops ); -+ -+ /* If this is the last handle and JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE is set, -+ * then terminate all associcated processes. We can't use the refcount because -+ * processes have a reference to the job object. */ -+ if (obj->handle_count == 1 && (job->limit_flags & JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE)) -+ terminate_job( job, 0 ); -+ -+ return 1; -+} -+ - static void job_destroy( struct object *obj ) - { - struct job *job = (struct job *)obj; --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/server-JobObjects/0002-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch wine-staging-1.7.48~ubuntu12.04.1/patches/server-JobObjects/0002-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/server-JobObjects/0002-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/server-JobObjects/0002-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -From 32940d62072444eb41a918b27aae6e4b48fe555f Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Thu, 12 Mar 2015 22:19:50 +0100 -Subject: ntdll: Implement NtQueryInformationJobObject stub function. - ---- - dlls/ntdll/sync.c | 31 ++++++++++++++++++++++++++++++- - 1 file changed, 30 insertions(+), 1 deletion(-) - -diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c -index 04c6de30..fb95460 100644 ---- a/dlls/ntdll/sync.c -+++ b/dlls/ntdll/sync.c -@@ -635,8 +635,37 @@ NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status ) - NTSTATUS WINAPI NtQueryInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS class, PVOID info, - ULONG len, PULONG ret_len ) - { -+ JOBOBJECT_EXTENDED_LIMIT_INFORMATION *extended_limit; -+ JOBOBJECT_BASIC_LIMIT_INFORMATION *basic_limit; -+ - FIXME( "stub: %p %u %p %u %p\n", handle, class, info, len, ret_len ); -- return STATUS_NOT_IMPLEMENTED; -+ -+ if (class >= MaxJobObjectInfoClass) -+ return STATUS_INVALID_PARAMETER; -+ -+ switch (class) -+ { -+ case JobObjectExtendedLimitInformation: -+ if (len < sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION)) -+ return STATUS_INVALID_PARAMETER; -+ -+ extended_limit = (JOBOBJECT_EXTENDED_LIMIT_INFORMATION *)info; -+ memset(extended_limit, 0, sizeof(*extended_limit)); -+ if (ret_len) *ret_len = sizeof(*extended_limit); -+ return STATUS_SUCCESS; -+ -+ case JobObjectBasicLimitInformation: -+ if (len < sizeof(JOBOBJECT_BASIC_LIMIT_INFORMATION)) -+ return STATUS_INVALID_PARAMETER; -+ -+ basic_limit = (JOBOBJECT_BASIC_LIMIT_INFORMATION *)info; -+ memset(basic_limit, 0, sizeof(*basic_limit)); -+ if (ret_len) *ret_len = sizeof(*basic_limit); -+ return STATUS_SUCCESS; -+ -+ default: -+ return STATUS_NOT_IMPLEMENTED; -+ } - } - - /****************************************************************************** --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/server-Registry_Timestamp/0001-server-Increase-precision-when-saving-loading-regist.patch wine-staging-1.7.48~ubuntu12.04.1/patches/server-Registry_Timestamp/0001-server-Increase-precision-when-saving-loading-regist.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/server-Registry_Timestamp/0001-server-Increase-precision-when-saving-loading-regist.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/server-Registry_Timestamp/0001-server-Increase-precision-when-saving-loading-regist.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,50 @@ +From 0cbf2798faf44d394601702bbfe97c7804c623d4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Tue, 28 Jul 2015 17:46:13 +0200 +Subject: server: Increase precision when saving / loading registry + modification date + +--- + server/registry.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/server/registry.c b/server/registry.c +index 43527df..68862a1 100644 +--- a/server/registry.c ++++ b/server/registry.c +@@ -264,7 +264,8 @@ static void save_subkeys( const struct key *key, const struct key *base, FILE *f + { + fprintf( f, "\n[" ); + if (key != base) dump_path( key, base, f ); +- fprintf( f, "] %u\n", (unsigned int)((key->modif - ticks_1601_to_1970) / TICKS_PER_SEC) ); ++ fprintf( f, "] %u %u\n", (unsigned int)((key->modif - ticks_1601_to_1970) / TICKS_PER_SEC), ++ (unsigned int)((key->modif - ticks_1601_to_1970) % TICKS_PER_SEC) ); + if (key->class) + { + fprintf( f, "#class=\"" ); +@@ -1346,8 +1347,8 @@ static struct key *load_key( struct key *base, const char *buffer, + { + WCHAR *p; + struct unicode_str name; +- int res; +- unsigned int mod; ++ int res, num_items; ++ unsigned int mod, mod_ticks; + timeout_t modif = current_time; + data_size_t len; + +@@ -1359,8 +1360,9 @@ static struct key *load_key( struct key *base, const char *buffer, + file_read_error( "Malformed key", info ); + return NULL; + } +- if (sscanf( buffer + res, " %u", &mod ) == 1) +- modif = (timeout_t)mod * TICKS_PER_SEC + ticks_1601_to_1970; ++ num_items = sscanf( buffer + res, " %u %u", &mod, &mod_ticks ); ++ if (num_items >= 1) modif = (timeout_t)mod * TICKS_PER_SEC + ticks_1601_to_1970; ++ if (num_items >= 2) modif += mod_ticks; + + p = info->tmp; + while (prefix_len && *p) { if (*p++ == '\\') prefix_len--; } +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/server-Registry_Timestamp/definition wine-staging-1.7.48~ubuntu12.04.1/patches/server-Registry_Timestamp/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/server-Registry_Timestamp/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/server-Registry_Timestamp/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [38927] Store registry timestamps with nanoseconds precision diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/server-Unexpected_Wakeup/0001-server-Avoid-sending-unexpected-wakeup-with-uninitia.patch wine-staging-1.7.48~ubuntu12.04.1/patches/server-Unexpected_Wakeup/0001-server-Avoid-sending-unexpected-wakeup-with-uninitia.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/server-Unexpected_Wakeup/0001-server-Avoid-sending-unexpected-wakeup-with-uninitia.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/server-Unexpected_Wakeup/0001-server-Avoid-sending-unexpected-wakeup-with-uninitia.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -From 9df06c6e4b4cf258b7f321dfd5e20467bef2b36f Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 22 Nov 2014 17:42:22 +0100 -Subject: server: Avoid sending unexpected wakeup with uninitialized cookie - value. - -While executing the kernel32/sync tests I noticed a couple of unexpected wakeup cookies, which looked like uninitialized wineserver memory. -Here an excerpt from the log (added additional debug values): ---- - server/thread.c | 13 +++++++++++-- - 1 file changed, 11 insertions(+), 2 deletions(-) - -diff --git a/server/thread.c b/server/thread.c -index ba3f1d5..bdd9ef7 100644 ---- a/server/thread.c -+++ b/server/thread.c -@@ -601,6 +601,7 @@ static int wait_on( const select_op_t *select_op, unsigned int count, struct obj - wait->count = count; - wait->flags = flags; - wait->select = select_op->op; -+ wait->cookie = 0; - wait->user = NULL; - wait->timeout = timeout; - wait->abandoned = 0; -@@ -719,7 +720,7 @@ int wake_thread( struct thread *thread ) - cookie = thread->wait->cookie; - if (debug_level) fprintf( stderr, "%04x: *wakeup* signaled=%d\n", thread->id, signaled ); - end_wait( thread ); -- if (send_thread_wakeup( thread, cookie, signaled ) == -1) /* error */ -+ if (cookie && send_thread_wakeup( thread, cookie, signaled ) == -1) /* error */ - { - if (!count) count = -1; - break; -@@ -749,7 +750,7 @@ int wake_thread_queue_entry( struct wait_queue_entry *entry ) - if (debug_level) fprintf( stderr, "%04x: *wakeup* signaled=%d\n", thread->id, signaled ); - end_wait( thread ); - -- if (send_thread_wakeup( thread, cookie, signaled ) != -1) -+ if (!cookie || send_thread_wakeup( thread, cookie, signaled ) != -1) - wake_thread( thread ); /* check other waits too */ - - return 1; -@@ -768,6 +769,8 @@ static void thread_timeout( void *ptr ) - - if (debug_level) fprintf( stderr, "%04x: *wakeup* signaled=TIMEOUT\n", thread->id ); - end_wait( thread ); -+ -+ assert( cookie ); - if (send_thread_wakeup( thread, cookie, STATUS_TIMEOUT ) == -1) return; - /* check if other objects have become signaled in the meantime */ - wake_thread( thread ); -@@ -1429,6 +1432,12 @@ DECL_HANDLER(select) - set_error( STATUS_INVALID_PARAMETER ); - return; - } -+ if (!req->cookie) -+ { -+ set_error( STATUS_INVALID_PARAMETER ); -+ return; -+ } -+ - op_size = min( get_req_data_size() - sizeof(*result), sizeof(select_op) ); - memset( &select_op, 0, sizeof(select_op) ); - memcpy( &select_op, result + 1, op_size ); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/server-Unexpected_Wakeup/0002-kernel32-tests-Repeat-test-for-SignalObjectAndWait-m.patch wine-staging-1.7.48~ubuntu12.04.1/patches/server-Unexpected_Wakeup/0002-kernel32-tests-Repeat-test-for-SignalObjectAndWait-m.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/server-Unexpected_Wakeup/0002-kernel32-tests-Repeat-test-for-SignalObjectAndWait-m.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/server-Unexpected_Wakeup/0002-kernel32-tests-Repeat-test-for-SignalObjectAndWait-m.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -From e8a0619c85e774abd866e3882038dee563007c77 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Tue, 16 Dec 2014 06:23:15 +0100 -Subject: kernel32/tests: Repeat test for SignalObjectAndWait multiple times to - test wineserver wakeup cookie management. - ---- - dlls/kernel32/tests/sync.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c -index cbe0acb..668b92d 100644 ---- a/dlls/kernel32/tests/sync.c -+++ b/dlls/kernel32/tests/sync.c -@@ -64,6 +64,7 @@ static void test_signalandwait(void) - HMODULE kernel32; - DWORD r; - HANDLE event[2], semaphore[2], file; -+ int i; - - kernel32 = GetModuleHandleA("kernel32.dll"); - pSignalObjectAndWait = (void*) GetProcAddress(kernel32, "SignalObjectAndWait"); -@@ -96,9 +97,13 @@ static void test_signalandwait(void) - r = pSignalObjectAndWait(event[0], event[1], 0, FALSE); - ok( r == WAIT_OBJECT_0, "should succeed\n"); - -- /* event[0] is now signalled */ -- r = pSignalObjectAndWait(event[0], event[0], 0, FALSE); -- ok( r == WAIT_OBJECT_0, "should succeed\n"); -+ /* event[0] is now signalled - we repeat this test multiple times -+ * to ensure that the wineserver handles this situation properly. */ -+ for (i = 0; i < 10000; i++) -+ { -+ r = pSignalObjectAndWait(event[0], event[0], 0, FALSE); -+ ok( r == WAIT_OBJECT_0, "should succeed\n"); -+ } - - /* event[0] is not signalled */ - r = WaitForSingleObject(event[0], 0); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/server-Unexpected_Wakeup/definition wine-staging-1.7.48~ubuntu12.04.1/patches/server-Unexpected_Wakeup/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/server-Unexpected_Wakeup/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/server-Unexpected_Wakeup/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Category: stable diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/shell32-Quoted_ShellExecute/definition wine-staging-1.7.48~ubuntu12.04.1/patches/shell32-Quoted_ShellExecute/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/shell32-Quoted_ShellExecute/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/shell32-Quoted_ShellExecute/definition 2015-07-29 19:51:42.000000000 +0000 @@ -1 +1,2 @@ -Fixes: [19666] Multiple applications start wrong executable if whitespace present in name +# Fixes: [19666] Multiple applications start wrong executable if whitespace present in name +Disabled: true diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0001-vcomp-Implement-stub-for-_vcomp_fork.patch wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0001-vcomp-Implement-stub-for-_vcomp_fork.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0001-vcomp-Implement-stub-for-_vcomp_fork.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0001-vcomp-Implement-stub-for-_vcomp_fork.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -From 6404654fd885acbf0e563d9b5070d321986b5b8d Mon Sep 17 00:00:00 2001 -From: Dan Kegel -Date: Sat, 11 Jul 2015 06:50:26 +0200 -Subject: vcomp: Implement stub for _vcomp_fork. - ---- - dlls/vcomp/main.c | 93 +++++++++++++++++++++++++++++++++++++++++++++ - dlls/vcomp/vcomp.spec | 2 +- - dlls/vcomp100/vcomp100.spec | 2 +- - dlls/vcomp90/vcomp90.spec | 2 +- - 4 files changed, 96 insertions(+), 3 deletions(-) - -diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c -index ab2a372..26f6c67 100644 ---- a/dlls/vcomp/main.c -+++ b/dlls/vcomp/main.c -@@ -3,6 +3,7 @@ - * vcomp implementation - * - * Copyright 2011 Austin English -+ * Copyright 2012 Dan Kegel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -107,6 +108,98 @@ void CDECL _vcomp_single_end(void) - TRACE("stub\n"); - } - -+void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args); -+ -+void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) -+{ -+ __ms_va_list valist; -+ -+ TRACE("(%d, %d, %p, ...)\n", ifval, nargs, wrapper); -+ -+ __ms_va_start(valist, wrapper); -+ _vcomp_fork_call_wrapper(wrapper, nargs, valist); -+ __ms_va_end(valist); -+} -+ -+#if defined(__i386__) -+__ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper, -+ "pushl %ebp\n\t" -+ __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") -+ __ASM_CFI(".cfi_rel_offset %ebp,0\n\t") -+ "movl %esp,%ebp\n\t" -+ __ASM_CFI(".cfi_def_cfa_register %ebp\n\t") -+ "pushl %esi\n\t" -+ __ASM_CFI(".cfi_rel_offset %esi,-4\n\t") -+ "pushl %edi\n\t" -+ __ASM_CFI(".cfi_rel_offset %edi,-8\n\t") -+ "movl 12(%ebp),%edx\n\t" -+ "movl %esp,%edi\n\t" -+ "shll $2,%edx\n\t" -+ "jz 1f\n\t" -+ "subl %edx,%edi\n\t" -+ "andl $~15,%edi\n\t" -+ "movl %edi,%esp\n\t" -+ "movl 12(%ebp),%ecx\n\t" -+ "movl 16(%ebp),%esi\n\t" -+ "cld\n\t" -+ "rep; movsl\n" -+ "1:\tcall *8(%ebp)\n\t" -+ "leal -8(%ebp),%esp\n\t" -+ "popl %edi\n\t" -+ __ASM_CFI(".cfi_same_value %edi\n\t") -+ "popl %esi\n\t" -+ __ASM_CFI(".cfi_same_value %esi\n\t") -+ "popl %ebp\n\t" -+ __ASM_CFI(".cfi_def_cfa %esp,4\n\t") -+ __ASM_CFI(".cfi_same_value %ebp\n\t") -+ "ret" ) -+ -+#elif defined(__x86_64__) -+ -+__ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper, -+ "pushq %rbp\n\t" -+ __ASM_CFI(".cfi_adjust_cfa_offset 8\n\t") -+ __ASM_CFI(".cfi_rel_offset %rbp,0\n\t") -+ "movq %rsp,%rbp\n\t" -+ __ASM_CFI(".cfi_def_cfa_register %rbp\n\t") -+ "pushq %rsi\n\t" -+ __ASM_CFI(".cfi_rel_offset %rsi,-8\n\t") -+ "pushq %rdi\n\t" -+ __ASM_CFI(".cfi_rel_offset %rdi,-16\n\t") -+ "movq %rcx,%rax\n\t" -+ "movq $4,%rcx\n\t" -+ "cmp %rcx,%rdx\n\t" -+ "cmovgq %rdx,%rcx\n\t" -+ "leaq 0(,%rcx,8),%rdx\n\t" -+ "subq %rdx,%rsp\n\t" -+ "andq $~15,%rsp\n\t" -+ "movq %rsp,%rdi\n\t" -+ "movq %r8,%rsi\n\t" -+ "rep; movsq\n\t" -+ "movq 0(%rsp),%rcx\n\t" -+ "movq 8(%rsp),%rdx\n\t" -+ "movq 16(%rsp),%r8\n\t" -+ "movq 24(%rsp),%r9\n\t" -+ "callq *%rax\n\t" -+ "leaq -16(%rbp),%rsp\n\t" -+ "popq %rdi\n\t" -+ __ASM_CFI(".cfi_same_value %rdi\n\t") -+ "popq %rsi\n\t" -+ __ASM_CFI(".cfi_same_value %rsi\n\t") -+ __ASM_CFI(".cfi_def_cfa_register %rsp\n\t") -+ "popq %rbp\n\t" -+ __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") -+ __ASM_CFI(".cfi_same_value %rbp\n\t") -+ "ret") -+#else -+ -+void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args) -+{ -+ ERR("Not implemented for this architecture\n"); -+} -+ -+#endif -+ - BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) - { - TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); -diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec -index 306dd15..d446574 100644 ---- a/dlls/vcomp/vcomp.spec -+++ b/dlls/vcomp/vcomp.spec -@@ -64,7 +64,7 @@ - @ stub _vcomp_for_static_init_i8 - @ stub _vcomp_for_static_simple_init - @ stub _vcomp_for_static_simple_init_i8 --@ stub _vcomp_fork -+@ varargs _vcomp_fork(long long ptr) - @ stub _vcomp_get_thread_num - @ stub _vcomp_leave_critsect - @ stub _vcomp_master_barrier -diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec -index 39cf91c..2c04e91 100644 ---- a/dlls/vcomp100/vcomp100.spec -+++ b/dlls/vcomp100/vcomp100.spec -@@ -64,7 +64,7 @@ - @ stub _vcomp_for_static_init_i8 - @ stub _vcomp_for_static_simple_init - @ stub _vcomp_for_static_simple_init_i8 --@ stub _vcomp_fork -+@ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork - @ stub _vcomp_get_thread_num - @ stub _vcomp_leave_critsect - @ stub _vcomp_master_barrier -diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec -index 39cf91c..2c04e91 100644 ---- a/dlls/vcomp90/vcomp90.spec -+++ b/dlls/vcomp90/vcomp90.spec -@@ -64,7 +64,7 @@ - @ stub _vcomp_for_static_init_i8 - @ stub _vcomp_for_static_simple_init - @ stub _vcomp_for_static_simple_init_i8 --@ stub _vcomp_fork -+@ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork - @ stub _vcomp_get_thread_num - @ stub _vcomp_leave_critsect - @ stub _vcomp_master_barrier --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0001-vcomp-Implement-_vcomp_for_dynamic_init-and-_vcomp_f.patch wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0001-vcomp-Implement-_vcomp_for_dynamic_init-and-_vcomp_f.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0001-vcomp-Implement-_vcomp_for_dynamic_init-and-_vcomp_f.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0001-vcomp-Implement-_vcomp_for_dynamic_init-and-_vcomp_f.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,207 @@ +From ae5dc1f9033a941c293ad221c19e5d49c140a13f Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 19 Jul 2015 01:01:28 +0200 +Subject: vcomp: Implement _vcomp_for_dynamic_init and _vcomp_for_dynamic_next. + +--- + dlls/vcomp/main.c | 77 +++++++++++++++++++++++++++++++++++++++++++++ + dlls/vcomp/vcomp.spec | 4 +-- + dlls/vcomp100/vcomp100.spec | 4 +-- + dlls/vcomp90/vcomp90.spec | 4 +-- + 4 files changed, 83 insertions(+), 6 deletions(-) + +diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c +index 301370c..2433abc 100644 +--- a/dlls/vcomp/main.c ++++ b/dlls/vcomp/main.c +@@ -64,6 +64,9 @@ struct vcomp_thread_data + + /* section */ + unsigned int section; ++ ++ /* dynamic */ ++ unsigned int dynamic; + }; + + struct vcomp_team_data +@@ -88,6 +91,14 @@ struct vcomp_task_data + unsigned int section; + int num_sections; + int section_index; ++ ++ /* dynamic */ ++ unsigned int dynamic; ++ unsigned int dynamic_first; ++ unsigned int dynamic_iterations; ++ int dynamic_step; ++ unsigned int dynamic_chunksize; ++ unsigned int dynamic_min_chunksize; + }; + + #if defined(__i386__) +@@ -200,6 +211,7 @@ static struct vcomp_thread_data *vcomp_init_thread_data(void) + } + + data->task.section = 0; ++ data->task.dynamic = 0; + + thread_data = &data->thread; + thread_data->team = NULL; +@@ -208,6 +220,7 @@ static struct vcomp_thread_data *vcomp_init_thread_data(void) + thread_data->parallel = FALSE; + thread_data->fork_threads = 0; + thread_data->section = 1; ++ thread_data->dynamic = 1; + + vcomp_set_thread_data(thread_data); + return thread_data; +@@ -634,6 +647,66 @@ void CDECL _vcomp_for_static_end(void) + /* nothing to do here */ + } + ++void CDECL _vcomp_for_dynamic_init(unsigned int flags, unsigned int first, unsigned int last, ++ int step, unsigned int chunksize) ++{ ++ struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); ++ struct vcomp_task_data *task_data = thread_data->task; ++ ++ TRACE("(%u, %u, %u, %d, %u)\n", flags, first, last, step, chunksize); ++ ++ EnterCriticalSection(&vcomp_section); ++ thread_data->dynamic++; ++ if ((int)(thread_data->dynamic - task_data->dynamic) > 0) ++ { ++ struct vcomp_team_data *team_data = thread_data->team; ++ int num_threads = team_data ? team_data->num_threads : 1; ++ unsigned int iterations; ++ ++ if (flags & 0x40) ++ iterations = 1 + (last - first) / step; ++ else ++ { ++ iterations = 1 + (first - last) / step; ++ step *= -1; ++ } ++ ++ task_data->dynamic = thread_data->dynamic; ++ task_data->dynamic_first = first; ++ task_data->dynamic_iterations = iterations; ++ task_data->dynamic_step = step; ++ task_data->dynamic_chunksize = max(1, iterations / num_threads); ++ task_data->dynamic_min_chunksize = max(1, chunksize); ++ } ++ LeaveCriticalSection(&vcomp_section); ++} ++ ++int CDECL _vcomp_for_dynamic_next(unsigned int *begin, unsigned int *end) ++{ ++ struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); ++ struct vcomp_task_data *task_data = thread_data->task; ++ unsigned int iterations = 0; ++ ++ TRACE("(%p, %p)\n", begin, end); ++ ++ EnterCriticalSection(&vcomp_section); ++ if (thread_data->dynamic == task_data->dynamic && ++ task_data->dynamic_iterations != 0) ++ { ++ iterations = min(task_data->dynamic_iterations, task_data->dynamic_chunksize); ++ *begin = task_data->dynamic_first; ++ *end = task_data->dynamic_first + (iterations - 1) * task_data->dynamic_step; ++ ++ task_data->dynamic_iterations -= iterations; ++ task_data->dynamic_first += iterations * task_data->dynamic_step; ++ task_data->dynamic_chunksize = max((task_data->dynamic_chunksize * 3 + 2)/4, ++ task_data->dynamic_min_chunksize); ++ } ++ LeaveCriticalSection(&vcomp_section); ++ ++ return (iterations != 0); ++} ++ + int CDECL omp_in_parallel(void) + { + TRACE("()\n"); +@@ -711,6 +784,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) + team_data.barrier_count = 0; + + task_data.section = 0; ++ task_data.dynamic = 0; + + thread_data.team = &team_data; + thread_data.task = &task_data; +@@ -718,6 +792,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) + thread_data.parallel = ifval || prev_thread_data->parallel; + thread_data.fork_threads = 0; + thread_data.section = 1; ++ thread_data.dynamic = 1; + list_init(&thread_data.entry); + InitializeConditionVariable(&thread_data.cond); + +@@ -736,6 +811,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) + data->parallel = thread_data.parallel; + data->fork_threads = 0; + data->section = 1; ++ data->dynamic = 1; + list_remove(&data->entry); + list_add_tail(&thread_data.entry, &data->entry); + WakeAllConditionVariable(&data->cond); +@@ -757,6 +833,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) + data->parallel = thread_data.parallel; + data->fork_threads = 0; + data->section = 1; ++ data->dynamic = 1; + InitializeConditionVariable(&data->cond); + + thread = CreateThread(NULL, 0, _vcomp_fork_worker, data, 0, NULL); +diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec +index 3a709df..6e2fcec 100644 +--- a/dlls/vcomp/vcomp.spec ++++ b/dlls/vcomp/vcomp.spec +@@ -55,9 +55,9 @@ + @ stub _vcomp_copyprivate_receive + @ stub _vcomp_enter_critsect + @ stub _vcomp_flush +-@ stub _vcomp_for_dynamic_init ++@ cdecl _vcomp_for_dynamic_init(long long long long long) + @ stub _vcomp_for_dynamic_init_i8 +-@ stub _vcomp_for_dynamic_next ++@ cdecl _vcomp_for_dynamic_next(ptr ptr) + @ stub _vcomp_for_dynamic_next_i8 + @ cdecl _vcomp_for_static_end() + @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) +diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec +index 56c7ae3..ab93ec2 100644 +--- a/dlls/vcomp100/vcomp100.spec ++++ b/dlls/vcomp100/vcomp100.spec +@@ -55,9 +55,9 @@ + @ stub _vcomp_copyprivate_receive + @ stub _vcomp_enter_critsect + @ stub _vcomp_flush +-@ stub _vcomp_for_dynamic_init ++@ cdecl _vcomp_for_dynamic_init(long long long long long) vcomp._vcomp_for_dynamic_init + @ stub _vcomp_for_dynamic_init_i8 +-@ stub _vcomp_for_dynamic_next ++@ cdecl _vcomp_for_dynamic_next(ptr ptr) vcomp._vcomp_for_dynamic_next + @ stub _vcomp_for_dynamic_next_i8 + @ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end + @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init +diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec +index 56c7ae3..ab93ec2 100644 +--- a/dlls/vcomp90/vcomp90.spec ++++ b/dlls/vcomp90/vcomp90.spec +@@ -55,9 +55,9 @@ + @ stub _vcomp_copyprivate_receive + @ stub _vcomp_enter_critsect + @ stub _vcomp_flush +-@ stub _vcomp_for_dynamic_init ++@ cdecl _vcomp_for_dynamic_init(long long long long long) vcomp._vcomp_for_dynamic_init + @ stub _vcomp_for_dynamic_init_i8 +-@ stub _vcomp_for_dynamic_next ++@ cdecl _vcomp_for_dynamic_next(ptr ptr) vcomp._vcomp_for_dynamic_next + @ stub _vcomp_for_dynamic_next_i8 + @ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end + @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0002-vcomp-Add-basic-worker-thread-infrastructure.patch wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0002-vcomp-Add-basic-worker-thread-infrastructure.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0002-vcomp-Add-basic-worker-thread-infrastructure.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0002-vcomp-Add-basic-worker-thread-infrastructure.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,311 +0,0 @@ -From e3f58ae29d504bd1f2287566878b7d6674bd5484 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 11 Jul 2015 18:53:41 +0200 -Subject: vcomp: Add basic worker thread infrastructure. - ---- - dlls/vcomp/main.c | 221 +++++++++++++++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 211 insertions(+), 10 deletions(-) - -diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c -index 26f6c67..9de9721 100644 ---- a/dlls/vcomp/main.c -+++ b/dlls/vcomp/main.c -@@ -4,6 +4,7 @@ - * - * Copyright 2011 Austin English - * Copyright 2012 Dan Kegel -+ * Copyright 2015 Sebastian Lackner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -23,13 +24,68 @@ - #include "config.h" - - #include -+#include - - #include "windef.h" - #include "winbase.h" - #include "wine/debug.h" -+#include "wine/list.h" - - WINE_DEFAULT_DEBUG_CHANNEL(vcomp); - -+static HMODULE vcomp_module; -+static struct list vcomp_idle_threads = LIST_INIT(vcomp_idle_threads); -+static DWORD vcomp_context_tls = TLS_OUT_OF_INDEXES; -+static DWORD vcomp_max_threads = 32; -+static DWORD vcomp_num_threads = 1; -+ -+static RTL_CRITICAL_SECTION vcomp_section; -+static RTL_CRITICAL_SECTION_DEBUG critsect_debug = -+{ -+ 0, 0, &vcomp_section, -+ { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, -+ 0, 0, { (DWORD_PTR)(__FILE__ ": vcomp_section") } -+}; -+static RTL_CRITICAL_SECTION vcomp_section = { &critsect_debug, -1, 0, 0, 0, 0 }; -+ -+struct vcomp_thread_info -+{ -+ struct list entry; -+ CONDITION_VARIABLE cond; -+ -+ /* current task */ -+ struct vcomp_team_info *team; -+ DWORD thread_num; -+}; -+ -+struct vcomp_team_info -+{ -+ CONDITION_VARIABLE cond; -+ DWORD num_threads; -+ DWORD finished_threads; -+ -+ /* callback arguments */ -+ unsigned int nargs; -+ void *wrapper; -+ __ms_va_list valist; -+}; -+ -+static inline struct vcomp_thread_info *vcomp_get_thread_info(void) -+{ -+ return (struct vcomp_thread_info *)TlsGetValue(vcomp_context_tls); -+} -+ -+static inline struct vcomp_team_info *vcomp_get_team_info(void) -+{ -+ struct vcomp_thread_info *thread_info = vcomp_get_thread_info(); -+ return thread_info ? thread_info->team : NULL; -+} -+ -+static inline void vcomp_set_thread_info(struct vcomp_thread_info *thread_info) -+{ -+ TlsSetValue(vcomp_context_tls, thread_info); -+} -+ - int CDECL omp_get_dynamic(void) - { - TRACE("stub\n"); -@@ -39,7 +95,7 @@ int CDECL omp_get_dynamic(void) - int CDECL omp_get_max_threads(void) - { - TRACE("stub\n"); -- return 1; -+ return vcomp_max_threads; - } - - int CDECL omp_get_nested(void) -@@ -56,14 +112,22 @@ int CDECL omp_get_num_procs(void) - - int CDECL omp_get_num_threads(void) - { -- TRACE("stub\n"); -- return 1; -+ struct vcomp_team_info *team_info; -+ -+ TRACE("()\n"); -+ -+ team_info = vcomp_get_team_info(); -+ return team_info ? team_info->num_threads : 1; - } - - int CDECL omp_get_thread_num(void) - { -- TRACE("stub\n"); -- return 0; -+ struct vcomp_thread_info *thread_info; -+ -+ TRACE("()\n"); -+ -+ thread_info = vcomp_get_thread_info(); -+ return thread_info ? thread_info->thread_num : 0; - } - - /* Time in seconds since "some time in the past" */ -@@ -85,6 +149,7 @@ void CDECL omp_set_nested(int nested) - void CDECL omp_set_num_threads(int num_threads) - { - TRACE("(%d): stub\n", num_threads); -+ vcomp_num_threads = max(1, min(num_threads, vcomp_max_threads)); - } - - void CDECL _vcomp_barrier(void) -@@ -94,7 +159,8 @@ void CDECL _vcomp_barrier(void) - - void CDECL _vcomp_set_num_threads(int num_threads) - { -- TRACE("(%d): stub\n", num_threads); -+ TRACE("(%d)\n", num_threads); -+ vcomp_num_threads = max(1, min(num_threads, vcomp_max_threads)); - } - - int CDECL _vcomp_single_begin(int flags) -@@ -110,15 +176,139 @@ void CDECL _vcomp_single_end(void) - - void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args); - -+static DWORD WINAPI _vcomp_fork_worker(void *param) -+{ -+ struct vcomp_thread_info *thread_info = param; -+ vcomp_set_thread_info(thread_info); -+ -+ TRACE("starting worker thread %p\n", thread_info); -+ -+ EnterCriticalSection(&vcomp_section); -+ for (;;) -+ { -+ struct vcomp_team_info *team = thread_info->team; -+ if (team != NULL) -+ { -+ /* Leave critical section and execute callback. */ -+ LeaveCriticalSection(&vcomp_section); -+ _vcomp_fork_call_wrapper(team->wrapper, team->nargs, team->valist); -+ EnterCriticalSection(&vcomp_section); -+ -+ /* Detach current thread from team. */ -+ thread_info->team = NULL; -+ list_remove(&thread_info->entry); -+ list_add_tail(&vcomp_idle_threads, &thread_info->entry); -+ if (++team->finished_threads >= team->num_threads) -+ WakeAllConditionVariable(&team->cond); -+ } -+ -+ if (!SleepConditionVariableCS(&thread_info->cond, &vcomp_section, 5000) && -+ GetLastError() == ERROR_TIMEOUT && !thread_info->team) -+ { -+ break; -+ } -+ } -+ list_remove(&thread_info->entry); -+ LeaveCriticalSection(&vcomp_section); -+ -+ TRACE("terminating worker thread %p\n", thread_info); -+ HeapFree(GetProcessHeap(), 0, thread_info); -+ FreeLibraryAndExitThread(vcomp_module, 0); -+ return 0; -+} -+ - void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) - { -- __ms_va_list valist; -+ struct vcomp_thread_info thread_info, *prev_thread_info; -+ struct vcomp_team_info team_info; -+ DWORD num_threads = vcomp_num_threads; /* FIXME */ -+ BOOL parallel = ifval; - - TRACE("(%d, %d, %p, ...)\n", ifval, nargs, wrapper); - -- __ms_va_start(valist, wrapper); -- _vcomp_fork_call_wrapper(wrapper, nargs, valist); -- __ms_va_end(valist); -+ /* Initialize members of team_info. */ -+ InitializeConditionVariable(&team_info.cond); -+ team_info.num_threads = 1; -+ team_info.finished_threads = 0; -+ team_info.nargs = nargs; -+ team_info.wrapper = wrapper; -+ __ms_va_start(team_info.valist, wrapper); -+ -+ /* Initialize members of thread_info. */ -+ list_init(&thread_info.entry); -+ InitializeConditionVariable(&thread_info.cond); -+ thread_info.team = &team_info; -+ thread_info.thread_num = 0; -+ -+ if (parallel) -+ { -+ struct list *ptr; -+ EnterCriticalSection(&vcomp_section); -+ -+ /* Try to reuse idle threads. */ -+ while (team_info.num_threads < num_threads && -+ (ptr = list_head( &vcomp_idle_threads ))) -+ { -+ struct vcomp_thread_info *info = LIST_ENTRY(ptr, struct vcomp_thread_info, entry); -+ list_remove(&info->entry); -+ list_add_tail(&thread_info.entry, &info->entry); -+ info->team = &team_info; -+ info->thread_num = team_info.num_threads++; -+ WakeAllConditionVariable(&info->cond); -+ } -+ -+ /* Spawn additional new threads. */ -+ while (team_info.num_threads < num_threads) -+ { -+ struct vcomp_thread_info *info; -+ HMODULE module; -+ HANDLE thread; -+ -+ info = HeapAlloc(GetProcessHeap(), 0, sizeof(*info)); -+ if (!info) break; -+ -+ InitializeConditionVariable(&info->cond); -+ info->team = &team_info; -+ info->thread_num = team_info.num_threads; -+ -+ thread = CreateThread(NULL, 0, _vcomp_fork_worker, info, 0, NULL); -+ if (!thread) -+ { -+ HeapFree(GetProcessHeap(), 0, info); -+ break; -+ } -+ -+ GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, -+ (const WCHAR *)vcomp_module, &module); -+ -+ list_add_tail(&thread_info.entry, &info->entry); -+ team_info.num_threads++; -+ CloseHandle(thread); -+ } -+ -+ LeaveCriticalSection(&vcomp_section); -+ } -+ -+ /* Call the callback in the context of the new team. */ -+ prev_thread_info = vcomp_get_thread_info(); -+ vcomp_set_thread_info(&thread_info); -+ _vcomp_fork_call_wrapper(team_info.wrapper, team_info.nargs, team_info.valist); -+ vcomp_set_thread_info(prev_thread_info); -+ -+ /* Implicit join, wait for other tasks. */ -+ if (parallel) -+ { -+ EnterCriticalSection(&vcomp_section); -+ -+ team_info.finished_threads++; -+ while (team_info.finished_threads < team_info.num_threads) -+ SleepConditionVariableCS(&team_info.cond, &vcomp_section, INFINITE); -+ -+ LeaveCriticalSection(&vcomp_section); -+ assert(list_empty(&thread_info.entry)); -+ } -+ -+ __ms_va_end(team_info.valist); - } - - #if defined(__i386__) -@@ -208,8 +398,19 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ -+ - case DLL_PROCESS_ATTACH: -+ vcomp_module = hinstDLL; - DisableThreadLibraryCalls(hinstDLL); -+ if ((vcomp_context_tls = TlsAlloc()) == TLS_OUT_OF_INDEXES) -+ { -+ ERR("Failed to allocate TLS index\n"); -+ return FALSE; -+ } -+ break; -+ -+ case DLL_PROCESS_DETACH: -+ TlsFree(vcomp_context_tls); - break; - } - --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0002-vcomp-tests-Add-tests-for-_vcomp_for_dynamic_init.patch wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0002-vcomp-tests-Add-tests-for-_vcomp_for_dynamic_init.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0002-vcomp-tests-Add-tests-for-_vcomp_for_dynamic_init.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0002-vcomp-tests-Add-tests-for-_vcomp_for_dynamic_init.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,112 @@ +From 6c4782b340f4cd6c9262cda2a4023f3d472e380e Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 19 Jul 2015 01:05:02 +0200 +Subject: vcomp/tests: Add tests for _vcomp_for_dynamic_init. + +--- + dlls/vcomp/tests/vcomp.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 68 insertions(+) + +diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c +index f021a72..faa7bd1 100644 +--- a/dlls/vcomp/tests/vcomp.c ++++ b/dlls/vcomp/tests/vcomp.c +@@ -51,6 +51,9 @@ static void (CDECL *p_vcomp_atomic_sub_r4)(float *dest, float val); + static void (CDECL *p_vcomp_atomic_sub_r8)(double *dest, double val); + static void (CDECL *p_vcomp_atomic_xor_i4)(int *dest, int val); + static void (CDECL *p_vcomp_barrier)(void); ++static void (CDECL *p_vcomp_for_dynamic_init)(unsigned int flags, unsigned int first, unsigned int last, ++ int step, unsigned int chunksize); ++static int (CDECL *p_vcomp_for_dynamic_next)(unsigned int *begin, unsigned int *end); + static void (CDECL *p_vcomp_for_static_end)(void); + static void (CDECL *p_vcomp_for_static_init)(int first, int last, int step, int chunksize, unsigned int *loops, + int *begin, int *end, int *next, int *lastchunk); +@@ -214,6 +217,8 @@ static BOOL init_vcomp(void) + VCOMP_GET_PROC(_vcomp_atomic_sub_r8); + VCOMP_GET_PROC(_vcomp_atomic_xor_i4); + VCOMP_GET_PROC(_vcomp_barrier); ++ VCOMP_GET_PROC(_vcomp_for_dynamic_init); ++ VCOMP_GET_PROC(_vcomp_for_dynamic_next); + VCOMP_GET_PROC(_vcomp_for_static_end); + VCOMP_GET_PROC(_vcomp_for_static_init); + VCOMP_GET_PROC(_vcomp_for_static_simple_init); +@@ -991,6 +996,68 @@ static void test_atomic_double(void) + } + } + ++static void CDECL for_dynamic_cb(LONG *a, LONG *b, LONG *c) ++{ ++ unsigned int begin, end; ++ ++ p_vcomp_for_dynamic_init(0x40, 1, 999983, 1, 30); ++ while (p_vcomp_for_dynamic_next(&begin, &end)) ++ { ++ InterlockedExchangeAdd(a, end - begin + 1); ++ Sleep(1); ++ } ++ ++ p_vcomp_for_dynamic_init(0, 99991, 1, 1, 50); ++ while (p_vcomp_for_dynamic_next(&begin, &end)) ++ { ++ InterlockedExchangeAdd(b, begin - end + 1); ++ Sleep(1); ++ } ++ ++ p_vcomp_for_dynamic_init(0x40, 1, 9973, 7, 30); ++ while (p_vcomp_for_dynamic_next(&begin, &end)) ++ { ++ while (begin <= end) ++ { ++ InterlockedIncrement(c); ++ begin += 7; ++ } ++ Sleep(1); ++ } ++} ++ ++static void test_vcomp_for_dynamic_init(void) ++{ ++ int max_threads = pomp_get_max_threads(); ++ LONG a, b, c; ++ int i; ++ ++ a = b = c = 0; ++ for_dynamic_cb(&a, &b, &c); ++ ok(a == 999983, "expected a == 999983, got %d\n", a); ++ ok(b == 99991, "expected b == 99991, got %d\n", b); ++ ok(c == 1425, "expected c == 1425, got %d\n", c); ++ ++ for (i = 1; i <= 4; i++) ++ { ++ pomp_set_num_threads(i); ++ ++ a = b = c = 0; ++ p_vcomp_fork(TRUE, 3, for_dynamic_cb, &a, &b, &c); ++ ok(a == 999983, "expected a == 999983, got %d\n", a); ++ ok(b == 99991, "expected b == 99991, got %d\n", b); ++ ok(c == 1425, "expected c == 1425, got %d\n", c); ++ ++ a = b = c = 0; ++ p_vcomp_fork(FALSE, 3, for_dynamic_cb, &a, &b, &c); ++ ok(a == 999983, "expected a == 999983, got %d\n", a); ++ ok(b == 99991, "expected b == 99991, got %d\n", b); ++ ok(c == 1425, "expected c == 1425, got %d\n", c); ++ } ++ ++ pomp_set_num_threads(max_threads); ++} ++ + START_TEST(vcomp) + { + if (!init_vcomp()) +@@ -1002,6 +1069,7 @@ START_TEST(vcomp) + test_vcomp_sections_init(); + test_vcomp_for_static_simple_init(); + test_vcomp_for_static_init(); ++ test_vcomp_for_dynamic_init(); + test_atomic_integer32(); + test_atomic_float(); + test_atomic_double(); +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0003-vcomp-tests-Add-initial-tests-for-_vcomp_fork.patch wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0003-vcomp-tests-Add-initial-tests-for-_vcomp_fork.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0003-vcomp-tests-Add-initial-tests-for-_vcomp_fork.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0003-vcomp-tests-Add-initial-tests-for-_vcomp_fork.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,230 +0,0 @@ -From 92cd559115925b61b980a784efacb0ccdd7029d0 Mon Sep 17 00:00:00 2001 -From: Dan Kegel -Date: Sat, 11 Jul 2015 03:56:04 +0200 -Subject: vcomp/tests: Add initial tests for _vcomp_fork. - ---- - configure.ac | 3 +- - dlls/vcomp/tests/Makefile.in | 7 +++ - dlls/vcomp/tests/vcomp.c | 122 ++++++++++++++++++++++++++++++++++++++++ - dlls/vcomp/tests/vcomp.manifest | 21 +++++++ - dlls/vcomp/tests/vcomp.rc | 22 ++++++++ - 5 files changed, 174 insertions(+), 1 deletion(-) - create mode 100644 dlls/vcomp/tests/Makefile.in - create mode 100644 dlls/vcomp/tests/vcomp.c - create mode 100644 dlls/vcomp/tests/vcomp.manifest - create mode 100644 dlls/vcomp/tests/vcomp.rc - -diff --git a/configure.ac b/configure.ac -index 3eaec29..a36fc4b 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3321,7 +3321,8 @@ WINE_CONFIG_DLL(uxtheme,,[implib]) - WINE_CONFIG_TEST(dlls/uxtheme/tests) - WINE_CONFIG_DLL(vbscript,,[clean]) - WINE_CONFIG_TEST(dlls/vbscript/tests,[clean]) --WINE_CONFIG_DLL(vcomp) -+WINE_CONFIG_DLL(vcomp,,[implib]) -+WINE_CONFIG_TEST(dlls/vcomp/tests) - WINE_CONFIG_DLL(vcomp100) - WINE_CONFIG_DLL(vcomp90) - WINE_CONFIG_DLL(vdhcp.vxd,enable_win16) -diff --git a/dlls/vcomp/tests/Makefile.in b/dlls/vcomp/tests/Makefile.in -new file mode 100644 -index 0000000..08a5b7f ---- /dev/null -+++ b/dlls/vcomp/tests/Makefile.in -@@ -0,0 +1,7 @@ -+TESTDLL = vcomp.dll -+ -+C_SRCS = \ -+ vcomp.c -+ -+RC_SRCS = \ -+ vcomp.rc -diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c -new file mode 100644 -index 0000000..5c6a861 ---- /dev/null -+++ b/dlls/vcomp/tests/vcomp.c -@@ -0,0 +1,122 @@ -+/* -+ * Unit test suite for vcomp fork/join implementation -+ * -+ * Copyright 2012 Dan Kegel -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#include "wine/test.h" -+ -+static const int is_win64 = (sizeof(void *) > sizeof(int)); -+ -+static HMODULE hvcomp = 0; -+static void (WINAPIV *p_vcomp_fork)(BOOL ifval, int nargs, void *wrapper, ...); -+static int (CDECL *pomp_get_max_threads)(void); -+ -+#define VCOMP_GET_PROC(func) \ -+ do \ -+ { \ -+ p ## func = (void *)GetProcAddress(hvcomp, #func); \ -+ if (!p ## func) trace("Failed to get address for %s\n", #func); \ -+ } \ -+ while (0) -+ -+static BOOL init_vcomp(void) -+{ -+ hvcomp = LoadLibraryA("vcomp.dll"); -+ if (!hvcomp) -+ { -+ win_skip("vcomp.dll not installed\n"); -+ return FALSE; -+ } -+ -+ VCOMP_GET_PROC(_vcomp_fork); -+ VCOMP_GET_PROC(omp_get_max_threads); -+ -+ return TRUE; -+} -+ -+#undef VCOMP_GET_PROC -+ -+static void CDECL _test_vcomp_fork_ptr(LONG *a, LONG *b, LONG *c, LONG *d, LONG *e) -+{ -+ InterlockedIncrement(a); -+ InterlockedIncrement(b); -+ InterlockedIncrement(c); -+ InterlockedIncrement(d); -+ InterlockedIncrement(e); -+} -+ -+static void CDECL _test_vcomp_fork_uintptr(UINT_PTR a, UINT_PTR b, UINT_PTR c, UINT_PTR d, UINT_PTR e) -+{ -+ ok(a == 1, "expected a = 1, got %p\n", (void *)a); -+ ok(b == MAXUINT_PTR - 2, "expected b = MAXUINT_PTR - 2, got %p\n", (void *)b); -+ ok(c == 3, "expected c = 3, got %p\n", (void *)c); -+ ok(d == MAXUINT_PTR - 4, "expected d = MAXUINT_PTR - 4, got %p\n", (void *)d); -+ ok(e == 5, "expected e = 5, got %p\n", (void *)e); -+} -+ -+static void CDECL _test_vcomp_fork_float(float a, float b, float c, float d, float e) -+{ -+ ok(1.4999 < a && a < 1.5001, "expected a = 1.5, got %f\n", a); -+ ok(2.4999 < b && b < 2.5001, "expected b = 2.5, got %f\n", b); -+ ok(3.4999 < c && c < 3.5001, "expected c = 3.5, got %f\n", c); -+ ok(4.4999 < d && d < 4.5001, "expected d = 4.5, got %f\n", d); -+ ok(5.4999 < e && e < 5.5001, "expected e = 5.5, got %f\n", e); -+} -+ -+static void test_vcomp_fork(void) -+{ -+ LONG a, b, c, d, e; -+ int n = pomp_get_max_threads(); -+ -+ a = 0; b = 1; c = 2; d = 3; e = 4; -+ p_vcomp_fork(FALSE, 5, _test_vcomp_fork_ptr, &a, &b, &c, &d, &e); -+ ok(a == 1, "expected a = 1, got %u\n", a); -+ ok(b == 2, "expected b = 2, got %u\n", b); -+ ok(c == 3, "expected c = 3, got %u\n", c); -+ ok(d == 4, "expected d = 4, got %u\n", d); -+ ok(e == 5, "expected e = 5, got %u\n", e); -+ -+ a = 0; b = 1; c = 2; d = 3; e = 4; -+ p_vcomp_fork(TRUE, 5, _test_vcomp_fork_ptr, &a, &b, &c, &d, &e); -+ ok(a > 0 && a <= (n + 0), "expected a > 0 && a <= (n + 0), got %u\n", a); -+ ok(b > 1 && b <= (n + 1), "expected b > 1 && b <= (n + 1), got %u\n", b); -+ ok(c > 2 && c <= (n + 2), "expected c > 2 && c <= (n + 2), got %u\n", c); -+ ok(d > 3 && d <= (n + 3), "expected d > 3 && d <= (n + 3), got %u\n", d); -+ ok(e > 4 && e <= (n + 4), "expected e > 4 && e <= (n + 4), got %u\n", e); -+ -+ p_vcomp_fork(TRUE, 5, _test_vcomp_fork_uintptr, (UINT_PTR)1, (UINT_PTR)(MAXUINT_PTR - 2), -+ (UINT_PTR)3, (UINT_PTR)(MAXUINT_PTR - 4), (UINT_PTR)5); -+ -+ if (is_win64) -+ skip("skipping float test on x86_64\n"); -+ else -+ { -+ void (CDECL *func)(BOOL, int, void *, float, float, float, float, float) = (void *)p_vcomp_fork; -+ func(TRUE, 5, _test_vcomp_fork_float, 1.5f, 2.5f, 3.5f, 4.5f, 5.5f); -+ } -+} -+ -+START_TEST(vcomp) -+{ -+ if (!init_vcomp()) -+ return; -+ -+ test_vcomp_fork(); -+ -+ FreeLibrary(hvcomp); -+} -diff --git a/dlls/vcomp/tests/vcomp.manifest b/dlls/vcomp/tests/vcomp.manifest -new file mode 100644 -index 0000000..6c8bd91 ---- /dev/null -+++ b/dlls/vcomp/tests/vcomp.manifest -@@ -0,0 +1,21 @@ -+ -+ -+ -+Wine vcomp test suite -+ -+ -+ -+ -+ -+ -diff --git a/dlls/vcomp/tests/vcomp.rc b/dlls/vcomp/tests/vcomp.rc -new file mode 100644 -index 0000000..c5f1d25 ---- /dev/null -+++ b/dlls/vcomp/tests/vcomp.rc -@@ -0,0 +1,22 @@ -+/* -+ * Copyright (c) 2012 Dan Kegel -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#include "winuser.h" -+ -+/* @makedep: vcomp.manifest */ -+1 RT_MANIFEST vcomp.manifest --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0004-vcomp-Implement-_vcomp_for_static_simple_init-and-_v.patch wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0004-vcomp-Implement-_vcomp_for_static_simple_init-and-_v.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0004-vcomp-Implement-_vcomp_for_static_simple_init-and-_v.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0004-vcomp-Implement-_vcomp_for_static_simple_init-and-_v.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,168 +0,0 @@ -From f455eb53b0d527874fb95bdc652d1a31cd8fa93a Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 11 Jul 2015 18:59:41 +0200 -Subject: vcomp: Implement _vcomp_for_static_simple_init and - _vcomp_for_static_end. - ---- - dlls/vcomp/main.c | 90 +++++++++++++++++++++++++++++++++++++++++++++ - dlls/vcomp/vcomp.spec | 4 +- - dlls/vcomp100/vcomp100.spec | 4 +- - dlls/vcomp90/vcomp90.spec | 4 +- - 4 files changed, 96 insertions(+), 6 deletions(-) - -diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c -index 9de9721..400f93a 100644 ---- a/dlls/vcomp/main.c -+++ b/dlls/vcomp/main.c -@@ -174,6 +174,96 @@ void CDECL _vcomp_single_end(void) - TRACE("stub\n"); - } - -+void CDECL _vcomp_for_static_simple_init(unsigned int first, unsigned int last, int step, BOOL forward, -+ unsigned int *begin, unsigned int *end) -+{ -+ struct vcomp_thread_info *thread_info = vcomp_get_thread_info(); -+ struct vcomp_team_info *team_info = thread_info->team; -+ unsigned int iterations, per_thread, remaining; -+ DWORD num_threads, thread_num; -+ -+ TRACE("(%d, %d, %d, %d, %p, %p)\n", first, last, step, forward, begin, end); -+ -+ num_threads = team_info->num_threads; -+ thread_num = thread_info->thread_num; -+ -+ if (num_threads == 1) -+ { -+ *begin = first; -+ *end = last; -+ return; -+ } -+ -+ if (step <= 0) -+ { -+ *begin = 0; -+ *end = forward ? -1 : 1; -+ return; -+ } -+ -+ if (forward) -+ { -+ DWORD64 last64 = last; -+ if (last64 < first) -+ last64 += 0x100000000; -+ -+ iterations = 1 + (last64 - first) / step; -+ per_thread = iterations / num_threads; -+ remaining = iterations - per_thread * num_threads; -+ -+ if (thread_num < remaining) -+ { -+ per_thread++; -+ } -+ else if (per_thread) -+ { -+ first += remaining * step; -+ } -+ else -+ { -+ *begin = first; -+ *end = first - step; -+ return; -+ } -+ -+ *begin = first + per_thread * thread_num * step; -+ *end = *begin + (per_thread - 1) * step; -+ } -+ else -+ { -+ DWORD first64 = first; -+ if (first64 < last) -+ first64 += 0x100000000; -+ -+ iterations = 1 + (first64 - last) / step; -+ per_thread = iterations / num_threads; -+ remaining = iterations - per_thread * num_threads; -+ -+ if (thread_num < remaining) -+ { -+ per_thread++; -+ } -+ else if (per_thread) -+ { -+ first64 -= remaining * step; -+ } -+ else -+ { -+ *begin = first64; -+ *end = first64 + step; -+ return; -+ } -+ -+ *begin = first64 - per_thread * thread_num * step; -+ *end = *begin - (per_thread - 1) * step; -+ } -+} -+ -+void CDECL _vcomp_for_static_end(void) -+{ -+ TRACE("()\n"); -+} -+ - void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args); - - static DWORD WINAPI _vcomp_fork_worker(void *param) -diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec -index d446574..b14edca 100644 ---- a/dlls/vcomp/vcomp.spec -+++ b/dlls/vcomp/vcomp.spec -@@ -59,10 +59,10 @@ - @ stub _vcomp_for_dynamic_init_i8 - @ stub _vcomp_for_dynamic_next - @ stub _vcomp_for_dynamic_next_i8 --@ stub _vcomp_for_static_end -+@ cdecl _vcomp_for_static_end() - @ stub _vcomp_for_static_init - @ stub _vcomp_for_static_init_i8 --@ stub _vcomp_for_static_simple_init -+@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) - @ stub _vcomp_for_static_simple_init_i8 - @ varargs _vcomp_fork(long long ptr) - @ stub _vcomp_get_thread_num -diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec -index 2c04e91..89e0972 100644 ---- a/dlls/vcomp100/vcomp100.spec -+++ b/dlls/vcomp100/vcomp100.spec -@@ -59,10 +59,10 @@ - @ stub _vcomp_for_dynamic_init_i8 - @ stub _vcomp_for_dynamic_next - @ stub _vcomp_for_dynamic_next_i8 --@ stub _vcomp_for_static_end -+@ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end - @ stub _vcomp_for_static_init - @ stub _vcomp_for_static_init_i8 --@ stub _vcomp_for_static_simple_init -+@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init - @ stub _vcomp_for_static_simple_init_i8 - @ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork - @ stub _vcomp_get_thread_num -diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec -index 2c04e91..89e0972 100644 ---- a/dlls/vcomp90/vcomp90.spec -+++ b/dlls/vcomp90/vcomp90.spec -@@ -59,10 +59,10 @@ - @ stub _vcomp_for_dynamic_init_i8 - @ stub _vcomp_for_dynamic_next - @ stub _vcomp_for_dynamic_next_i8 --@ stub _vcomp_for_static_end -+@ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end - @ stub _vcomp_for_static_init - @ stub _vcomp_for_static_init_i8 --@ stub _vcomp_for_static_simple_init -+@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init - @ stub _vcomp_for_static_simple_init_i8 - @ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork - @ stub _vcomp_get_thread_num --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0005-vcomp-tests-Add-tests-for-_vcomp_for_static_simple_i.patch wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0005-vcomp-tests-Add-tests-for-_vcomp_for_static_simple_i.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0005-vcomp-tests-Add-tests-for-_vcomp_for_static_simple_i.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0005-vcomp-tests-Add-tests-for-_vcomp_for_static_simple_i.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,275 +0,0 @@ -From af8411c2c51708c2edbc620b3d775bf5a08144f9 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 11 Jul 2015 05:12:39 +0200 -Subject: vcomp/tests: Add tests for _vcomp_for_static_simple_init. - ---- - dlls/vcomp/tests/vcomp.c | 228 +++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 228 insertions(+) - -diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c -index 5c6a861..1971b6d 100644 ---- a/dlls/vcomp/tests/vcomp.c -+++ b/dlls/vcomp/tests/vcomp.c -@@ -23,8 +23,15 @@ - static const int is_win64 = (sizeof(void *) > sizeof(int)); - - static HMODULE hvcomp = 0; -+static void (CDECL *p_vcomp_barrier)(void); -+static void (CDECL *p_vcomp_for_static_end)(void); -+static void (CDECL *p_vcomp_for_static_simple_init)(unsigned int first, unsigned int last, int step, -+ BOOL forward, unsigned int *begin, unsigned int *end); - static void (WINAPIV *p_vcomp_fork)(BOOL ifval, int nargs, void *wrapper, ...); - static int (CDECL *pomp_get_max_threads)(void); -+static int (CDECL *pomp_get_num_threads)(void); -+static int (CDECL *pomp_get_thread_num)(void); -+static void (CDECL *pomp_set_num_threads)(int num_threads); - - #define VCOMP_GET_PROC(func) \ - do \ -@@ -43,8 +50,14 @@ static BOOL init_vcomp(void) - return FALSE; - } - -+ VCOMP_GET_PROC(_vcomp_barrier); -+ VCOMP_GET_PROC(_vcomp_for_static_end); -+ VCOMP_GET_PROC(_vcomp_for_static_simple_init); - VCOMP_GET_PROC(_vcomp_fork); - VCOMP_GET_PROC(omp_get_max_threads); -+ VCOMP_GET_PROC(omp_get_num_threads); -+ VCOMP_GET_PROC(omp_get_thread_num); -+ VCOMP_GET_PROC(omp_set_num_threads); - - return TRUE; - } -@@ -111,12 +124,227 @@ static void test_vcomp_fork(void) - } - } - -+static void CDECL _test_vcomp_for_static_simple_init(void) -+{ -+ static const struct -+ { -+ unsigned int first; -+ unsigned int last; -+ int step; -+ BOOL forward; -+ } -+ tests[] = -+ { -+ /* loop forward, step 1 */ -+ { 0, 0, 1, TRUE }, -+ { 0, 1, 1, TRUE }, -+ { 0, 2, 1, TRUE }, -+ { 0, 3, 1, TRUE }, -+ { 0, 0x10000000, 1, TRUE }, -+ { 0, 0x20000000, 1, TRUE }, -+ { 0, 0x40000000, 1, TRUE }, -+ { 0, 0x80000000, 1, TRUE }, -+ -+ /* loop forward, varying step */ -+ { 0, 100, 1, TRUE }, -+ { 0, 100, 5, TRUE }, -+ { 0, 100, 10, TRUE }, -+ { 0, 100, 25, TRUE }, -+ { 0, 100, 50, TRUE }, -+ { 0, 100, 75, TRUE }, -+ { 0, 100, 100, TRUE }, -+ { 0, 100, 150, TRUE }, -+ -+ /* empty loop forward, varying step */ -+ { 50, 50, 3, TRUE }, -+ { 50, 50, 2, TRUE }, -+ { 50, 50, 1, TRUE }, -+ { 50, 50, 0, TRUE }, -+ { 50, 50, -1, TRUE }, -+ { 50, 50, -2, TRUE }, -+ { 50, 50, -3, TRUE }, -+ -+ /* loop backward, step 1 */ -+ { 0, 0, 1, FALSE }, -+ { 1, 0, 1, FALSE }, -+ { 2, 0, 1, FALSE }, -+ { 3, 0, 1, FALSE }, -+ { 0x10000000, 0, 1, FALSE }, -+ { 0x20000000, 0, 1, FALSE }, -+ { 0x40000000, 0, 1, FALSE }, -+ { 0x80000000, 0, 1, FALSE }, -+ -+ /* loop backward, varying step */ -+ { 100, 0, 1, FALSE }, -+ { 100, 0, 5, FALSE }, -+ { 100, 0, 10, FALSE }, -+ { 100, 0, 25, FALSE }, -+ { 100, 0, 50, FALSE }, -+ { 100, 0, 75, FALSE }, -+ { 100, 0, 100, FALSE }, -+ { 100, 0, 150, FALSE }, -+ -+ /* empty loop backward, varying step */ -+ { 50, 50, 3, FALSE }, -+ { 50, 50, 2, FALSE }, -+ { 50, 50, 1, FALSE }, -+ { 50, 50, 0, FALSE }, -+ { 50, 50, -1, FALSE }, -+ { 50, 50, -2, FALSE }, -+ { 50, 50, -3, FALSE }, -+ -+ /* test overflow in forward loop */ -+ { 0, 0, 1, TRUE }, -+ { 1, 0, 1, TRUE }, -+ { 2, 0, 1, TRUE }, -+ { 3, 0, 1, TRUE }, -+ { 0x10000000, 0, 1, TRUE }, -+ { 0x20000000, 0, 1, TRUE }, -+ { 0x40000000, 0, 1, TRUE }, -+ { 0x80000000, 0, 1, TRUE }, -+ -+ { 100, 0, 1, TRUE }, -+ { 100, 0, 5, TRUE }, -+ { 100, 0, 10, TRUE }, -+ { 100, 0, 25, TRUE }, -+ { 100, 0, 50, TRUE }, -+ { 100, 0, 75, TRUE }, -+ { 100, 0, 100, TRUE }, -+ { 100, 0, 150, TRUE }, -+ -+ /* test overflow in backward loop */ -+ { 0, 0, 1, FALSE }, -+ { 0, 1, 1, FALSE }, -+ { 0, 2, 1, FALSE }, -+ { 0, 3, 1, FALSE }, -+ { 0, 0x10000000, 1, FALSE }, -+ { 0, 0x20000000, 1, FALSE }, -+ { 0, 0x40000000, 1, FALSE }, -+ { 0, 0x80000000, 1, FALSE }, -+ -+ { 0, 100, 1, FALSE }, -+ { 0, 100, 5, FALSE }, -+ { 0, 100, 10, FALSE }, -+ { 0, 100, 25, FALSE }, -+ { 0, 100, 50, FALSE }, -+ { 0, 100, 75, FALSE }, -+ { 0, 100, 100, FALSE }, -+ { 0, 100, 150, FALSE }, -+ }; -+ unsigned int begin, end, expected_begin, expected_end; -+ int thread_num = pomp_get_thread_num(); -+ int num_threads = pomp_get_num_threads(); -+ int i; -+ -+ for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) -+ { -+ unsigned int iterations, per_thread, remaining; -+ DWORD64 first = tests[i].first; -+ DWORD64 last = tests[i].last; -+ int step = tests[i].step; -+ -+ if (num_threads == 1) -+ { -+ expected_begin = first; -+ expected_end = last; -+ goto done; -+ } -+ -+ if (tests[i].forward) -+ { -+ if (tests[i].step <= 0) -+ { -+ expected_begin = 0; -+ expected_end = -1; -+ goto done; -+ } -+ -+ if (last < first) -+ last += 0x100000000; -+ -+ iterations = 1 + (last - first) / step; -+ per_thread = iterations / num_threads; -+ remaining = iterations - per_thread * num_threads; -+ -+ if (thread_num < remaining) -+ per_thread++; -+ else if (per_thread) -+ first += remaining * step; -+ else -+ { -+ expected_begin = first; -+ expected_end = first - step; -+ goto done; -+ } -+ -+ expected_begin = first + per_thread * thread_num * step; -+ expected_end = expected_begin + (per_thread - 1) * step; -+ } -+ else -+ { -+ if (tests[i].step <= 0) -+ { -+ expected_begin = 0; -+ expected_end = 1; -+ goto done; -+ } -+ -+ if (first < last) -+ first += 0x100000000; -+ -+ iterations = 1 + (first - last) / step; -+ per_thread = iterations / num_threads; -+ remaining = iterations - per_thread * num_threads; -+ -+ if (thread_num < remaining) -+ per_thread++; -+ else if (per_thread) -+ first -= remaining * step; -+ else -+ { -+ expected_begin = first; -+ expected_end = first + step; -+ goto done; -+ } -+ -+ expected_begin = first - per_thread * thread_num * step; -+ expected_end = expected_begin - (per_thread - 1) * step; -+ } -+ -+done: -+ begin = end = 0xdeadbeef; -+ p_vcomp_for_static_simple_init(tests[i].first, tests[i].last, tests[i].step, -+ tests[i].forward, &begin, &end); -+ -+ ok(begin == expected_begin, "%d:%d/%d: expected begin = %u, got %u\n", -+ i, thread_num, num_threads, expected_begin, end); -+ ok(end == expected_end, "%d:%d/%d: expected end = %u, got %u\n", -+ i, thread_num, num_threads, expected_end, end); -+ -+ p_vcomp_for_static_end(); -+ p_vcomp_barrier(); -+ } -+} -+ -+static void test_vcomp_for_static_simple_init(void) -+{ -+ int i; -+ -+ for (i = 1; i <= 4; i++) -+ { -+ trace("Running tests with %d threads\n", i); -+ pomp_set_num_threads(i); -+ p_vcomp_fork(TRUE, 0, _test_vcomp_for_static_simple_init); -+ } -+} -+ - START_TEST(vcomp) - { - if (!init_vcomp()) - return; - - test_vcomp_fork(); -+ test_vcomp_for_static_simple_init(); - - FreeLibrary(hvcomp); - } --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0006-vcomp-Implement-_vcomp_for_static_init.patch wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0006-vcomp-Implement-_vcomp_for_static_init.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0006-vcomp-Implement-_vcomp_for_static_init.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0006-vcomp-Implement-_vcomp_for_static_init.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,127 +0,0 @@ -From 721c89ed7aec4a9ae8f0a5f7b0efeee838c08985 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 11 Jul 2015 19:19:00 +0200 -Subject: vcomp: Implement _vcomp_for_static_init. - ---- - dlls/vcomp/main.c | 62 +++++++++++++++++++++++++++++++++++++++++++++ - dlls/vcomp/vcomp.spec | 2 +- - dlls/vcomp100/vcomp100.spec | 2 +- - dlls/vcomp90/vcomp90.spec | 2 +- - 4 files changed, 65 insertions(+), 3 deletions(-) - -diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c -index 400f93a..2eeea3b 100644 ---- a/dlls/vcomp/main.c -+++ b/dlls/vcomp/main.c -@@ -259,6 +259,68 @@ void CDECL _vcomp_for_static_simple_init(unsigned int first, unsigned int last, - } - } - -+void CDECL _vcomp_for_static_init(int first, int last, int step, int chunksize, unsigned int *loops, -+ int *begin, int *end, int *next, int *lastchunk) -+{ -+ struct vcomp_thread_info *thread_info = vcomp_get_thread_info(); -+ struct vcomp_team_info *team_info = thread_info->team; -+ unsigned int iterations, num_chunks, per_thread, remaining; -+ DWORD num_threads, thread_num; -+ -+ TRACE("(%d, %d, %d, %d, %p, %p, %p, %p, %p)\n", -+ first, last, step, chunksize, loops, begin, end, next, lastchunk); -+ -+ num_threads = team_info->num_threads; -+ thread_num = thread_info->thread_num; -+ -+ if (chunksize < 1) -+ chunksize = 1; -+ -+ if (num_threads == 1 && chunksize > 1) -+ { -+ *loops = 1; -+ *begin = first; -+ *end = last; -+ *next = chunksize; -+ *lastchunk = first; -+ } -+ else if (last > first) -+ { -+ iterations = 1 + (last - first) / step; -+ num_chunks = (iterations + chunksize - 1) / chunksize; -+ per_thread = num_chunks / num_threads; -+ remaining = num_chunks - per_thread * num_threads; -+ -+ *loops = per_thread + (thread_num < remaining); -+ *begin = first + thread_num * chunksize * step; -+ *end = *begin + (chunksize - 1) * step; -+ *next = chunksize * num_threads * step; -+ *lastchunk = first + (num_chunks - 1) * chunksize * step; -+ -+ } -+ else if (last < first) -+ { -+ iterations = 1 + (first - last) / step; -+ num_chunks = (iterations + chunksize - 1) / chunksize; -+ per_thread = num_chunks / num_threads; -+ remaining = num_chunks - per_thread * num_threads; -+ -+ *loops = per_thread + (thread_num < remaining); -+ *begin = first - thread_num * chunksize * step; -+ *end = *begin - (chunksize - 1) * step; -+ *next = - chunksize * num_threads * step; -+ *lastchunk = first - (num_chunks - 1) * chunksize * step; -+ } -+ else -+ { -+ *loops = (thread_num == 0); -+ *begin = first; -+ *end = last; -+ *next = 0; -+ *lastchunk = first; -+ } -+} -+ - void CDECL _vcomp_for_static_end(void) - { - TRACE("()\n"); -diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec -index b14edca..8bc66e8 100644 ---- a/dlls/vcomp/vcomp.spec -+++ b/dlls/vcomp/vcomp.spec -@@ -60,7 +60,7 @@ - @ stub _vcomp_for_dynamic_next - @ stub _vcomp_for_dynamic_next_i8 - @ cdecl _vcomp_for_static_end() --@ stub _vcomp_for_static_init -+@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) - @ stub _vcomp_for_static_init_i8 - @ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) - @ stub _vcomp_for_static_simple_init_i8 -diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec -index 89e0972..f008e2e 100644 ---- a/dlls/vcomp100/vcomp100.spec -+++ b/dlls/vcomp100/vcomp100.spec -@@ -60,7 +60,7 @@ - @ stub _vcomp_for_dynamic_next - @ stub _vcomp_for_dynamic_next_i8 - @ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end --@ stub _vcomp_for_static_init -+@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init - @ stub _vcomp_for_static_init_i8 - @ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init - @ stub _vcomp_for_static_simple_init_i8 -diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec -index 89e0972..f008e2e 100644 ---- a/dlls/vcomp90/vcomp90.spec -+++ b/dlls/vcomp90/vcomp90.spec -@@ -60,7 +60,7 @@ - @ stub _vcomp_for_dynamic_next - @ stub _vcomp_for_dynamic_next_i8 - @ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end --@ stub _vcomp_for_static_init -+@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init - @ stub _vcomp_for_static_init_i8 - @ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init - @ stub _vcomp_for_static_simple_init_i8 --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0007-vcomp-tests-Add-tests-for-_vcomp_for_static_init.patch wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0007-vcomp-tests-Add-tests-for-_vcomp_for_static_init.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0007-vcomp-tests-Add-tests-for-_vcomp_for_static_init.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0007-vcomp-tests-Add-tests-for-_vcomp_for_static_init.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,243 +0,0 @@ -From 9cea1ba140eb5d8ecd70eab4a68e309cd80fd454 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 11 Jul 2015 06:08:08 +0200 -Subject: vcomp/tests: Add tests for _vcomp_for_static_init. - ---- - dlls/vcomp/tests/vcomp.c | 199 +++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 199 insertions(+) - -diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c -index 1971b6d..96806fd 100644 ---- a/dlls/vcomp/tests/vcomp.c -+++ b/dlls/vcomp/tests/vcomp.c -@@ -25,6 +25,8 @@ static const int is_win64 = (sizeof(void *) > sizeof(int)); - static HMODULE hvcomp = 0; - static void (CDECL *p_vcomp_barrier)(void); - static void (CDECL *p_vcomp_for_static_end)(void); -+static void (CDECL *p_vcomp_for_static_init)(int first, int last, int step, int chunksize, unsigned int *loops, -+ int *begin, int *end, int *next, int *lastchunk); - static void (CDECL *p_vcomp_for_static_simple_init)(unsigned int first, unsigned int last, int step, - BOOL forward, unsigned int *begin, unsigned int *end); - static void (WINAPIV *p_vcomp_fork)(BOOL ifval, int nargs, void *wrapper, ...); -@@ -52,6 +54,7 @@ static BOOL init_vcomp(void) - - VCOMP_GET_PROC(_vcomp_barrier); - VCOMP_GET_PROC(_vcomp_for_static_end); -+ VCOMP_GET_PROC(_vcomp_for_static_init); - VCOMP_GET_PROC(_vcomp_for_static_simple_init); - VCOMP_GET_PROC(_vcomp_fork); - VCOMP_GET_PROC(omp_get_max_threads); -@@ -338,6 +341,201 @@ static void test_vcomp_for_static_simple_init(void) - } - } - -+static void CDECL _test_vcomp_for_static_init(void) -+{ -+ static const struct -+ { -+ int first; -+ int last; -+ int step; -+ int chunksize; -+ } -+ tests[] = -+ { -+ /* loop forward, step 1 */ -+ { 0, 0, 1, 1 }, -+ { 0, 1, 1, 1 }, -+ { 0, 2, 1, 1 }, -+ { 0, 3, 1, 1 }, -+ { 0, 0x10000000, 1, 1 }, -+ { 0, 0x20000000, 1, 1 }, -+ { 0, 0x40000000, 1, 1 }, -+ { 0, (int)0x80000000, 1, 1 }, -+ -+ /* loop forward, varying step */ -+ {0, 100, 1, 1}, -+ {0, 100, 5, 1}, -+ {0, 100, 10, 1}, -+ {0, 100, 25, 1}, -+ {0, 100, 50, 1}, -+ {0, 100, 75, 1}, -+ {0, 100, 100, 1}, -+ {0, 100, 150, 1}, -+ -+ /* empty loop forward, varying step */ -+ { 50, 50, 3, 1 }, -+ { 50, 50, 2, 1 }, -+ { 50, 50, 1, 1 }, -+ /*{ 50, 50, 0, 1 }, - generates a division by zero exception */ -+ { 50, 50, -1, 1 }, -+ { 50, 50, -2, 1 }, -+ { 50, 50, -3, 1 }, -+ -+ /* loop backwards, step 1 */ -+ { 0, 0, 1, 1 }, -+ { 1, 0, 1, 1 }, -+ { 2, 0, 1, 1 }, -+ { 3, 0, 1, 1 }, -+ { 0x10000000, 0, 1, 1 }, -+ { 0x20000000, 0, 1, 1 }, -+ { 0x40000000, 0, 1, 1 }, -+ { (int)0x80000000, 0, 1, 1 }, -+ -+ /* loop backwards, varying step */ -+ {100, 0, 1, 1}, -+ {100, 0, 5, 1}, -+ {100, 0, 10, 1}, -+ {100, 0, 25, 1}, -+ {100, 0, 50, 1}, -+ {100, 0, 75, 1}, -+ {100, 0, 100, 1}, -+ {100, 0, 150, 1}, -+ -+ /* loop forward, varying chunksize */ -+ {0, 100, 1, 1}, -+ {0, 100, 1, 5}, -+ {0, 100, 1, 10}, -+ {0, 100, 1, 25}, -+ {0, 100, 1, 50}, -+ {0, 100, 1, 75}, -+ {0, 100, 1, 100}, -+ {0, 100, 1, 150}, -+ -+ {0, 100, 7, 1}, -+ {0, 100, 7, 5}, -+ {0, 100, 7, 10}, -+ {0, 100, 7, 25}, -+ {0, 100, 7, 50}, -+ {0, 100, 7, 75}, -+ {0, 100, 7, 100}, -+ {0, 100, 7, 150}, -+ -+ /* loop backwards, varying chunksize */ -+ {100, 0, 1, 1}, -+ {100, 0, 1, 5}, -+ {100, 0, 1, 10}, -+ {100, 0, 1, 25}, -+ {100, 0, 1, 50}, -+ {100, 0, 1, 75}, -+ {100, 0, 1, 100}, -+ {100, 0, 1, 150}, -+ -+ {100, 0, 7, 1}, -+ {100, 0, 7, 5}, -+ {100, 0, 7, 10}, -+ {100, 0, 7, 25}, -+ {100, 0, 7, 50}, -+ {100, 0, 7, 75}, -+ {100, 0, 7, 100}, -+ {100, 0, 7, 150}, -+ -+ }; -+ int begin, end, expected_begin, expected_end; -+ unsigned int loops, expected_loops; -+ int lastchunk, expected_lastchunk; -+ int chunksize, expected_chunksize; -+ int thread_num = pomp_get_thread_num(); -+ int num_threads = pomp_get_num_threads(); -+ int i; -+ -+ for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) -+ { -+ unsigned int iterations, num_chunks, per_thread, remaining; -+ int first = tests[i].first; -+ int last = tests[i].last; -+ int step = tests[i].step; -+ chunksize = tests[i].chunksize; -+ -+ if (chunksize < 1) -+ chunksize = 1; -+ -+ if (num_threads == 1 && chunksize > 1) -+ { -+ expected_loops = 1; -+ expected_begin = first; -+ expected_end = last; -+ expected_chunksize = chunksize; -+ expected_lastchunk = first; -+ } -+ else if (last > first) -+ { -+ iterations = 1 + (last - first) / step; -+ num_chunks = (iterations + chunksize - 1) / chunksize; -+ per_thread = num_chunks / num_threads; -+ remaining = num_chunks - per_thread * num_threads; -+ -+ expected_loops = per_thread + (thread_num < remaining); -+ expected_begin = first + thread_num * chunksize * step; -+ expected_end = expected_begin + (chunksize - 1) * step; -+ expected_chunksize = chunksize * num_threads * step; -+ expected_lastchunk = first + (num_chunks - 1) * chunksize * step; -+ -+ } -+ else if (last < first) -+ { -+ iterations = 1 + (first - last) / step; -+ num_chunks = (iterations + chunksize - 1) / chunksize; -+ per_thread = num_chunks / num_threads; -+ remaining = num_chunks - per_thread * num_threads; -+ -+ expected_loops = per_thread + (thread_num < remaining); -+ expected_begin = first - thread_num * chunksize * step; -+ expected_end = expected_begin - (chunksize - 1) * step; -+ expected_chunksize = - chunksize * num_threads * step; -+ expected_lastchunk = first - (num_chunks - 1) * chunksize * step; -+ } -+ else -+ { -+ expected_loops = (thread_num == 0); -+ expected_begin = first; -+ expected_end = last; -+ expected_chunksize = 0; -+ expected_lastchunk = first; -+ } -+ -+ loops = begin = end = chunksize = lastchunk = 0xdeadbeef; -+ p_vcomp_for_static_init(tests[i].first, tests[i].last, tests[i].step, tests[i].chunksize, -+ &loops, &begin, &end, &chunksize, &lastchunk); -+ -+ ok(loops == expected_loops, "%d:%d/%d: expected loops = %u, got %u\n", -+ i, thread_num, num_threads, expected_loops, loops); -+ ok(begin == expected_begin || broken(begin == 0xdeadbeef && first == last && thread_num > 0), -+ "%d:%d/%d: expected begin = %u, got %u\n", i, thread_num, num_threads, expected_begin, end); -+ ok(end == expected_end || broken(end == 0xdeadbeef && first == last && thread_num > 0), -+ "%d:%d/%d: expected end = %u, got %u\n", i, thread_num, num_threads, expected_end, end); -+ ok(chunksize == expected_chunksize || broken(chunksize == (int)0xdeadbeef && first == last) || -+ broken(chunksize != expected_chunksize && num_threads == 1), -+ "%d:%d/%d: expected chunksize = %u, got %u\n", i, thread_num, num_threads, expected_chunksize, chunksize); -+ ok(lastchunk == expected_lastchunk || broken(lastchunk == 0xdeadbeef && first == last && thread_num > 0), -+ "%d:%d/%d: expected lastchunk = %u, got %u\n", i, thread_num, num_threads, expected_lastchunk, lastchunk); -+ -+ p_vcomp_for_static_end(); -+ p_vcomp_barrier(); -+ } -+} -+ -+static void test_vcomp_for_static_init(void) -+{ -+ int i; -+ -+ for (i = 1; i <= 4; i++) -+ { -+ trace("Running tests with %d threads\n", i); -+ pomp_set_num_threads(i); -+ p_vcomp_fork(TRUE, 0, _test_vcomp_for_static_init); -+ } -+} -+ - START_TEST(vcomp) - { - if (!init_vcomp()) -@@ -345,6 +543,7 @@ START_TEST(vcomp) - - test_vcomp_fork(); - test_vcomp_for_static_simple_init(); -+ test_vcomp_for_static_init(); - - FreeLibrary(hvcomp); - } --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0008-vcomp-Implement-_vcomp_barrier.patch wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0008-vcomp-Implement-_vcomp_barrier.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0008-vcomp-Implement-_vcomp_barrier.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0008-vcomp-Implement-_vcomp_barrier.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -From 8732b345bcab27edc68eda1ab35095d72a817899 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 11 Jul 2015 19:38:24 +0200 -Subject: vcomp: Implement _vcomp_barrier. - ---- - dlls/vcomp/main.c | 29 ++++++++++++++++++++++++++++- - 1 file changed, 28 insertions(+), 1 deletion(-) - -diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c -index 2eeea3b..4f3471a 100644 ---- a/dlls/vcomp/main.c -+++ b/dlls/vcomp/main.c -@@ -68,6 +68,10 @@ struct vcomp_team_info - unsigned int nargs; - void *wrapper; - __ms_va_list valist; -+ -+ /* barrier */ -+ DWORD barrier; -+ DWORD barrier_count; - }; - - static inline struct vcomp_thread_info *vcomp_get_thread_info(void) -@@ -154,7 +158,28 @@ void CDECL omp_set_num_threads(int num_threads) - - void CDECL _vcomp_barrier(void) - { -- TRACE("stub\n"); -+ struct vcomp_team_info *team_info; -+ -+ TRACE("()\n"); -+ -+ team_info = vcomp_get_team_info(); -+ EnterCriticalSection(&vcomp_section); -+ -+ team_info->barrier_count++; -+ if (team_info->barrier_count >= team_info->num_threads) -+ { -+ team_info->barrier++; -+ team_info->barrier_count = 0; -+ WakeAllConditionVariable(&team_info->cond); -+ } -+ else -+ { -+ DWORD barrier = team_info->barrier; -+ while (team_info->barrier == barrier) -+ SleepConditionVariableCS(&team_info->cond, &vcomp_section, INFINITE); -+ } -+ -+ LeaveCriticalSection(&vcomp_section); - } - - void CDECL _vcomp_set_num_threads(int num_threads) -@@ -385,6 +410,8 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) - team_info.nargs = nargs; - team_info.wrapper = wrapper; - __ms_va_start(team_info.valist, wrapper); -+ team_info.barrier = 0; -+ team_info.barrier_count = 0; - - /* Initialize members of thread_info. */ - list_init(&thread_info.entry); --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0009-vcomp-Implement-omp_in_parallel.patch wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0009-vcomp-Implement-omp_in_parallel.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0009-vcomp-Implement-omp_in_parallel.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0009-vcomp-Implement-omp_in_parallel.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -From aad24232add010020898eaa1a0934cb353c123f2 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 11 Jul 2015 19:41:29 +0200 -Subject: vcomp: Implement omp_in_parallel. - ---- - dlls/vcomp/main.c | 6 ++++++ - dlls/vcomp/vcomp.spec | 2 +- - dlls/vcomp100/vcomp100.spec | 2 +- - dlls/vcomp90/vcomp90.spec | 2 +- - 4 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c -index 4f3471a..fccad93 100644 ---- a/dlls/vcomp/main.c -+++ b/dlls/vcomp/main.c -@@ -351,6 +351,12 @@ void CDECL _vcomp_for_static_end(void) - TRACE("()\n"); - } - -+int CDECL omp_in_parallel(void) -+{ -+ TRACE("()\n"); -+ return vcomp_get_team_info() != NULL; -+} -+ - void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args); - - static DWORD WINAPI _vcomp_fork_worker(void *param) -diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec -index 8bc66e8..156233f 100644 ---- a/dlls/vcomp/vcomp.spec -+++ b/dlls/vcomp/vcomp.spec -@@ -98,7 +98,7 @@ - @ cdecl omp_get_thread_num() - @ stub omp_get_wtick - @ cdecl omp_get_wtime() --@ stub omp_in_parallel -+@ cdecl omp_in_parallel() - @ stub omp_init_lock - @ stub omp_init_nest_lock - @ cdecl omp_set_dynamic(long) -diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec -index f008e2e..dd276d0 100644 ---- a/dlls/vcomp100/vcomp100.spec -+++ b/dlls/vcomp100/vcomp100.spec -@@ -98,7 +98,7 @@ - @ cdecl omp_get_thread_num() vcomp.omp_get_thread_num - @ stub omp_get_wtick - @ cdecl omp_get_wtime() vcomp.omp_get_wtime --@ stub omp_in_parallel -+@ cdecl omp_in_parallel() vcomp.omp_in_parallel - @ stub omp_init_lock - @ stub omp_init_nest_lock - @ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic -diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec -index f008e2e..dd276d0 100644 ---- a/dlls/vcomp90/vcomp90.spec -+++ b/dlls/vcomp90/vcomp90.spec -@@ -98,7 +98,7 @@ - @ cdecl omp_get_thread_num() vcomp.omp_get_thread_num - @ stub omp_get_wtick - @ cdecl omp_get_wtime() vcomp.omp_get_wtime --@ stub omp_in_parallel -+@ cdecl omp_in_parallel() vcomp.omp_in_parallel - @ stub omp_init_lock - @ stub omp_init_nest_lock - @ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0010-vcomp-Implement-_vcomp_sections_init-and-_vcomp_sect.patch wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0010-vcomp-Implement-_vcomp_sections_init-and-_vcomp_sect.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0010-vcomp-Implement-_vcomp_sections_init-and-_vcomp_sect.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0010-vcomp-Implement-_vcomp_sections_init-and-_vcomp_sect.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,244 +0,0 @@ -From 77d6daebca21cfb4209a8281abac2b9db0d7a1b4 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 11 Jul 2015 21:29:41 +0200 -Subject: vcomp: Implement _vcomp_sections_init and _vcomp_sections_next and - add tests. - ---- - dlls/vcomp/main.c | 49 +++++++++++++++++++++++++++++++++++++++++++++ - dlls/vcomp/tests/vcomp.c | 49 +++++++++++++++++++++++++++++++++++++++++++++ - dlls/vcomp/vcomp.spec | 4 ++-- - dlls/vcomp100/vcomp100.spec | 4 ++-- - dlls/vcomp90/vcomp90.spec | 4 ++-- - 5 files changed, 104 insertions(+), 6 deletions(-) - -diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c -index fccad93..db47ff6 100644 ---- a/dlls/vcomp/main.c -+++ b/dlls/vcomp/main.c -@@ -56,6 +56,9 @@ struct vcomp_thread_info - /* current task */ - struct vcomp_team_info *team; - DWORD thread_num; -+ -+ /* section */ -+ DWORD section; - }; - - struct vcomp_team_info -@@ -72,6 +75,11 @@ struct vcomp_team_info - /* barrier */ - DWORD barrier; - DWORD barrier_count; -+ -+ /* section */ -+ DWORD section; -+ DWORD num_sections; -+ DWORD section_index; - }; - - static inline struct vcomp_thread_info *vcomp_get_thread_info(void) -@@ -357,6 +365,43 @@ int CDECL omp_in_parallel(void) - return vcomp_get_team_info() != NULL; - } - -+void CDECL _vcomp_sections_init(int n) -+{ -+ struct vcomp_thread_info *thread_info = vcomp_get_thread_info(); -+ struct vcomp_team_info *team_info = thread_info->team; -+ -+ TRACE("(%d)\n", n); -+ -+ EnterCriticalSection(&vcomp_section); -+ thread_info->section++; -+ if ((int)(thread_info->section - team_info->section) > 0) -+ { -+ /* first thread in a new section */ -+ team_info->section = thread_info->section; -+ team_info->num_sections = n; -+ team_info->section_index = 0; -+ } -+ LeaveCriticalSection(&vcomp_section); -+} -+ -+int CDECL _vcomp_sections_next(void) -+{ -+ struct vcomp_thread_info *thread_info = vcomp_get_thread_info(); -+ struct vcomp_team_info *team_info = thread_info->team; -+ int i = -1; -+ -+ TRACE("()\n"); -+ -+ EnterCriticalSection(&vcomp_section); -+ if (thread_info->section == team_info->section && -+ team_info->section_index < team_info->num_sections) -+ { -+ i = team_info->section_index++; -+ } -+ LeaveCriticalSection(&vcomp_section); -+ return i; -+} -+ - void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args); - - static DWORD WINAPI _vcomp_fork_worker(void *param) -@@ -418,12 +463,14 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) - __ms_va_start(team_info.valist, wrapper); - team_info.barrier = 0; - team_info.barrier_count = 0; -+ team_info.section = -1; - - /* Initialize members of thread_info. */ - list_init(&thread_info.entry); - InitializeConditionVariable(&thread_info.cond); - thread_info.team = &team_info; - thread_info.thread_num = 0; -+ thread_info.section = 0; - - if (parallel) - { -@@ -439,6 +486,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) - list_add_tail(&thread_info.entry, &info->entry); - info->team = &team_info; - info->thread_num = team_info.num_threads++; -+ info->section = 0; - WakeAllConditionVariable(&info->cond); - } - -@@ -455,6 +503,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) - InitializeConditionVariable(&info->cond); - info->team = &team_info; - info->thread_num = team_info.num_threads; -+ info->section = 0; - - thread = CreateThread(NULL, 0, _vcomp_fork_worker, info, 0, NULL); - if (!thread) -diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c -index 96806fd..902a836 100644 ---- a/dlls/vcomp/tests/vcomp.c -+++ b/dlls/vcomp/tests/vcomp.c -@@ -30,6 +30,8 @@ static void (CDECL *p_vcomp_for_static_init)(int first, int last, int step, i - static void (CDECL *p_vcomp_for_static_simple_init)(unsigned int first, unsigned int last, int step, - BOOL forward, unsigned int *begin, unsigned int *end); - static void (WINAPIV *p_vcomp_fork)(BOOL ifval, int nargs, void *wrapper, ...); -+static void (CDECL *p_vcomp_sections_init)(int n); -+static int (CDECL *p_vcomp_sections_next)(void); - static int (CDECL *pomp_get_max_threads)(void); - static int (CDECL *pomp_get_num_threads)(void); - static int (CDECL *pomp_get_thread_num)(void); -@@ -57,6 +59,8 @@ static BOOL init_vcomp(void) - VCOMP_GET_PROC(_vcomp_for_static_init); - VCOMP_GET_PROC(_vcomp_for_static_simple_init); - VCOMP_GET_PROC(_vcomp_fork); -+ VCOMP_GET_PROC(_vcomp_sections_init); -+ VCOMP_GET_PROC(_vcomp_sections_next); - VCOMP_GET_PROC(omp_get_max_threads); - VCOMP_GET_PROC(omp_get_num_threads); - VCOMP_GET_PROC(omp_get_thread_num); -@@ -536,6 +540,50 @@ static void test_vcomp_for_static_init(void) - } - } - -+static void CDECL _test_vcomp_sections_init(LONG *a, LONG *b, LONG *c) -+{ -+ int i; -+ -+ p_vcomp_sections_init(20); -+ while ((i = p_vcomp_sections_next()) != -1) -+ { -+ InterlockedIncrement(a); -+ Sleep(50); -+ } -+ -+ p_vcomp_sections_init(30); -+ while ((i = p_vcomp_sections_next()) != -1) -+ { -+ InterlockedIncrement(b); -+ Sleep(50); -+ } -+ -+ p_vcomp_sections_init(40); -+ while ((i = p_vcomp_sections_next()) != -1) -+ { -+ InterlockedIncrement(c); -+ Sleep(50); -+ } -+} -+ -+static void test_vcomp_sections_init(void) -+{ -+ LONG a, b, c; -+ int i; -+ -+ for (i = 1; i <= 4; i++) -+ { -+ trace("Running tests with %d threads\n", i); -+ pomp_set_num_threads(i); -+ -+ a = b = c = 0; -+ p_vcomp_fork(TRUE, 3, _test_vcomp_sections_init, &a, &b, &c); -+ ok(a == 20, "expected a = 20, got %d\n", a); -+ ok(b == 30, "expected b = 30, got %d\n", b); -+ ok(c == 40, "expected c = 40, got %d\n", c); -+ } -+} -+ - START_TEST(vcomp) - { - if (!init_vcomp()) -@@ -544,6 +592,7 @@ START_TEST(vcomp) - test_vcomp_fork(); - test_vcomp_for_static_simple_init(); - test_vcomp_for_static_init(); -+ test_vcomp_sections_init(); - - FreeLibrary(hvcomp); - } -diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec -index 156233f..7083ce4 100644 ---- a/dlls/vcomp/vcomp.spec -+++ b/dlls/vcomp/vcomp.spec -@@ -83,8 +83,8 @@ - @ stub _vcomp_reduction_u2 - @ stub _vcomp_reduction_u4 - @ stub _vcomp_reduction_u8 --@ stub _vcomp_sections_init --@ stub _vcomp_sections_next -+@ cdecl _vcomp_sections_init(long) -+@ cdecl _vcomp_sections_next() - @ cdecl _vcomp_set_num_threads(long) - @ cdecl _vcomp_single_begin(long) - @ cdecl _vcomp_single_end() -diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec -index dd276d0..56c7ae3 100644 ---- a/dlls/vcomp100/vcomp100.spec -+++ b/dlls/vcomp100/vcomp100.spec -@@ -83,8 +83,8 @@ - @ stub _vcomp_reduction_u2 - @ stub _vcomp_reduction_u4 - @ stub _vcomp_reduction_u8 --@ stub _vcomp_sections_init --@ stub _vcomp_sections_next -+@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init -+@ cdecl _vcomp_sections_next() vcomp._vcomp_sections_next - @ cdecl _vcomp_set_num_threads(long) vcomp._vcomp_set_num_threads - @ cdecl _vcomp_single_begin(long) vcomp._vcomp_single_begin - @ cdecl _vcomp_single_end() vcomp._vcomp_single_end -diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec -index dd276d0..56c7ae3 100644 ---- a/dlls/vcomp90/vcomp90.spec -+++ b/dlls/vcomp90/vcomp90.spec -@@ -83,8 +83,8 @@ - @ stub _vcomp_reduction_u2 - @ stub _vcomp_reduction_u4 - @ stub _vcomp_reduction_u8 --@ stub _vcomp_sections_init --@ stub _vcomp_sections_next -+@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init -+@ cdecl _vcomp_sections_next() vcomp._vcomp_sections_next - @ cdecl _vcomp_set_num_threads(long) vcomp._vcomp_set_num_threads - @ cdecl _vcomp_single_begin(long) vcomp._vcomp_single_begin - @ cdecl _vcomp_single_end() vcomp._vcomp_single_end --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0011-vcomp-Implement-_vcomp_for_dynamic_init-and-_vcomp_f.patch wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0011-vcomp-Implement-_vcomp_for_dynamic_init-and-_vcomp_f.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/vcomp-Functions/0011-vcomp-Implement-_vcomp_for_dynamic_init-and-_vcomp_f.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/vcomp-Functions/0011-vcomp-Implement-_vcomp_for_dynamic_init-and-_vcomp_f.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,296 +0,0 @@ -From f29610acbf9ce393b772520f6041acce9d1aefd8 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 11 Jul 2015 23:28:31 +0200 -Subject: vcomp: Implement _vcomp_for_dynamic_init and _vcomp_for_dynamic_next - and add tests. - ---- - dlls/vcomp/main.c | 93 +++++++++++++++++++++++++++++++++++++++++++++ - dlls/vcomp/tests/vcomp.c | 53 ++++++++++++++++++++++++++ - dlls/vcomp/vcomp.spec | 4 +- - dlls/vcomp100/vcomp100.spec | 4 +- - dlls/vcomp90/vcomp90.spec | 4 +- - 5 files changed, 152 insertions(+), 6 deletions(-) - -diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c -index db47ff6..3a1e9ee 100644 ---- a/dlls/vcomp/main.c -+++ b/dlls/vcomp/main.c -@@ -59,6 +59,9 @@ struct vcomp_thread_info - - /* section */ - DWORD section; -+ -+ /* dynamic */ -+ DWORD dynamic; - }; - - struct vcomp_team_info -@@ -80,6 +83,15 @@ struct vcomp_team_info - DWORD section; - DWORD num_sections; - DWORD section_index; -+ -+ /* dynamic */ -+ DWORD dynamic; -+ DWORD dynamic_forward; -+ DWORD dynamic_first; -+ DWORD dynamic_iterations; -+ int dynamic_step; -+ DWORD dynamic_chunksize; -+ DWORD dynamic_min_chunksize; - }; - - static inline struct vcomp_thread_info *vcomp_get_thread_info(void) -@@ -402,6 +414,83 @@ int CDECL _vcomp_sections_next(void) - return i; - } - -+void CDECL _vcomp_for_dynamic_init(int flags, int first, int last, int step, int chunksize) -+{ -+ struct vcomp_thread_info *thread_info = vcomp_get_thread_info(); -+ struct vcomp_team_info *team_info = thread_info->team; -+ unsigned int iterations; -+ BOOL forward = (flags & 0x40) != 0; -+ -+ TRACE("(%d, %d, %d, %d, %d)\n", flags, first, last, step, chunksize); -+ -+ EnterCriticalSection(&vcomp_section); -+ thread_info->dynamic++; -+ if ((int)(thread_info->dynamic - team_info->dynamic) > 0) -+ { -+ /* first thread in a new for_dynamic */ -+ -+ if (forward) -+ { -+ DWORD64 last64 = last; -+ if (last64 < first) -+ last64 += 0x100000000; -+ iterations = 1 + (last64 - first) / step; -+ } -+ else -+ { -+ DWORD first64 = first; -+ if (first64 < last) -+ first64 += 0x100000000; -+ iterations = 1 + (first64 - last) / step; -+ } -+ -+ team_info->dynamic = thread_info->dynamic; -+ team_info->dynamic_forward = forward; -+ team_info->dynamic_first = first; -+ team_info->dynamic_iterations = iterations; -+ team_info->dynamic_step = step; -+ team_info->dynamic_chunksize = max(1, iterations / team_info->num_threads); -+ team_info->dynamic_min_chunksize = max(1, chunksize); -+ } -+ LeaveCriticalSection(&vcomp_section); -+} -+ -+int CDECL _vcomp_for_dynamic_next(int *begin, int *end) -+{ -+ struct vcomp_thread_info *thread_info = vcomp_get_thread_info(); -+ struct vcomp_team_info *team_info = thread_info->team; -+ unsigned int iterations = 0; -+ -+ TRACE("(%p, %p)\n", begin, end); -+ -+ EnterCriticalSection(&vcomp_section); -+ if (thread_info->dynamic == team_info->dynamic && -+ team_info->dynamic_iterations != 0) -+ { -+ iterations = min(team_info->dynamic_iterations, team_info->dynamic_chunksize); -+ team_info->dynamic_iterations -= iterations; -+ -+ if (team_info->dynamic_forward) -+ { -+ *begin = team_info->dynamic_first; -+ *end = team_info->dynamic_first + (iterations - 1) * team_info->dynamic_step; -+ team_info->dynamic_first += iterations * team_info->dynamic_step; -+ } -+ else -+ { -+ *begin = team_info->dynamic_first; -+ *end = team_info->dynamic_first - (iterations - 1) * team_info->dynamic_step; -+ team_info->dynamic_first -= iterations * team_info->dynamic_step; -+ } -+ -+ team_info->dynamic_chunksize = -+ max((team_info->dynamic_chunksize * 3 + 2)/4, team_info->dynamic_min_chunksize); -+ } -+ LeaveCriticalSection(&vcomp_section); -+ -+ return (iterations != 0); -+} -+ - void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args); - - static DWORD WINAPI _vcomp_fork_worker(void *param) -@@ -464,6 +553,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) - team_info.barrier = 0; - team_info.barrier_count = 0; - team_info.section = -1; -+ team_info.dynamic = -1; - - /* Initialize members of thread_info. */ - list_init(&thread_info.entry); -@@ -471,6 +561,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) - thread_info.team = &team_info; - thread_info.thread_num = 0; - thread_info.section = 0; -+ thread_info.dynamic = 0; - - if (parallel) - { -@@ -487,6 +578,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) - info->team = &team_info; - info->thread_num = team_info.num_threads++; - info->section = 0; -+ info->dynamic = 0; - WakeAllConditionVariable(&info->cond); - } - -@@ -504,6 +596,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) - info->team = &team_info; - info->thread_num = team_info.num_threads; - info->section = 0; -+ info->dynamic = 0; - - thread = CreateThread(NULL, 0, _vcomp_fork_worker, info, 0, NULL); - if (!thread) -diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c -index 902a836..4273680 100644 ---- a/dlls/vcomp/tests/vcomp.c -+++ b/dlls/vcomp/tests/vcomp.c -@@ -24,6 +24,8 @@ static const int is_win64 = (sizeof(void *) > sizeof(int)); - - static HMODULE hvcomp = 0; - static void (CDECL *p_vcomp_barrier)(void); -+static void (CDECL *p_vcomp_for_dynamic_init)(int flags, int first, int last, int step, int chunksize); -+static int (CDECL *p_vcomp_for_dynamic_next)(int *begin, int *end); - static void (CDECL *p_vcomp_for_static_end)(void); - static void (CDECL *p_vcomp_for_static_init)(int first, int last, int step, int chunksize, unsigned int *loops, - int *begin, int *end, int *next, int *lastchunk); -@@ -55,6 +57,8 @@ static BOOL init_vcomp(void) - } - - VCOMP_GET_PROC(_vcomp_barrier); -+ VCOMP_GET_PROC(_vcomp_for_dynamic_init); -+ VCOMP_GET_PROC(_vcomp_for_dynamic_next); - VCOMP_GET_PROC(_vcomp_for_static_end); - VCOMP_GET_PROC(_vcomp_for_static_init); - VCOMP_GET_PROC(_vcomp_for_static_simple_init); -@@ -584,6 +588,54 @@ static void test_vcomp_sections_init(void) - } - } - -+static void CDECL _test_vcomp_for_dynamic_init(LONG *a, LONG *b, LONG *c) -+{ -+ int begin, end; -+ -+ p_vcomp_for_dynamic_init(0x40, 1, 100000, 1, 30); -+ while (p_vcomp_for_dynamic_next(&begin, &end)) -+ { -+ InterlockedExchangeAdd(a, end - begin + 1); -+ Sleep(50); -+ } -+ -+ p_vcomp_for_dynamic_init(0, 1337, 1, 1, 50); -+ while (p_vcomp_for_dynamic_next(&begin, &end)) -+ { -+ InterlockedExchangeAdd(b, begin - end + 1); -+ Sleep(50); -+ } -+ -+ p_vcomp_for_dynamic_init(0x40, 1, 100000, 7, 30); -+ while (p_vcomp_for_dynamic_next(&begin, &end)) -+ { -+ while (begin <= end) -+ { -+ InterlockedIncrement(c); -+ begin += 7; -+ } -+ Sleep(50); -+ } -+} -+ -+static void test_vcomp_for_dynamic_init(void) -+{ -+ LONG a, b, c; -+ int i; -+ -+ for (i = 1; i <= 4; i++) -+ { -+ trace("Running tests with %d threads\n", i); -+ pomp_set_num_threads(i); -+ -+ a = b = c = 0; -+ p_vcomp_fork(TRUE, 3, _test_vcomp_for_dynamic_init, &a, &b, &c); -+ ok(a == 100000, "expected a = 100000, got %d\n", a); -+ ok(b == 1337, "expected b = 1337, got %d\n", b); -+ ok(c == 14286, "expected c = 14286, got %d\n", c); -+ } -+} -+ - START_TEST(vcomp) - { - if (!init_vcomp()) -@@ -593,6 +645,7 @@ START_TEST(vcomp) - test_vcomp_for_static_simple_init(); - test_vcomp_for_static_init(); - test_vcomp_sections_init(); -+ test_vcomp_for_dynamic_init(); - - FreeLibrary(hvcomp); - } -diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec -index 7083ce4..1b02a65 100644 ---- a/dlls/vcomp/vcomp.spec -+++ b/dlls/vcomp/vcomp.spec -@@ -55,9 +55,9 @@ - @ stub _vcomp_copyprivate_receive - @ stub _vcomp_enter_critsect - @ stub _vcomp_flush --@ stub _vcomp_for_dynamic_init -+@ cdecl _vcomp_for_dynamic_init(long long long long long) - @ stub _vcomp_for_dynamic_init_i8 --@ stub _vcomp_for_dynamic_next -+@ cdecl _vcomp_for_dynamic_next(ptr ptr) - @ stub _vcomp_for_dynamic_next_i8 - @ cdecl _vcomp_for_static_end() - @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) -diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec -index 56c7ae3..ab93ec2 100644 ---- a/dlls/vcomp100/vcomp100.spec -+++ b/dlls/vcomp100/vcomp100.spec -@@ -55,9 +55,9 @@ - @ stub _vcomp_copyprivate_receive - @ stub _vcomp_enter_critsect - @ stub _vcomp_flush --@ stub _vcomp_for_dynamic_init -+@ cdecl _vcomp_for_dynamic_init(long long long long long) vcomp._vcomp_for_dynamic_init - @ stub _vcomp_for_dynamic_init_i8 --@ stub _vcomp_for_dynamic_next -+@ cdecl _vcomp_for_dynamic_next(ptr ptr) vcomp._vcomp_for_dynamic_next - @ stub _vcomp_for_dynamic_next_i8 - @ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end - @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init -diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec -index 56c7ae3..ab93ec2 100644 ---- a/dlls/vcomp90/vcomp90.spec -+++ b/dlls/vcomp90/vcomp90.spec -@@ -55,9 +55,9 @@ - @ stub _vcomp_copyprivate_receive - @ stub _vcomp_enter_critsect - @ stub _vcomp_flush --@ stub _vcomp_for_dynamic_init -+@ cdecl _vcomp_for_dynamic_init(long long long long long) vcomp._vcomp_for_dynamic_init - @ stub _vcomp_for_dynamic_init_i8 --@ stub _vcomp_for_dynamic_next -+@ cdecl _vcomp_for_dynamic_next(ptr ptr) vcomp._vcomp_for_dynamic_next - @ stub _vcomp_for_dynamic_next_i8 - @ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end - @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/widl-Buffer_Overflow/0001-widl-Increase-buffer-size-in-typegen.c.patch wine-staging-1.7.48~ubuntu12.04.1/patches/widl-Buffer_Overflow/0001-widl-Increase-buffer-size-in-typegen.c.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/widl-Buffer_Overflow/0001-widl-Increase-buffer-size-in-typegen.c.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/widl-Buffer_Overflow/0001-widl-Increase-buffer-size-in-typegen.c.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From 6f484b8e9cb7dcfcc8c3f0103012576b43572422 Mon Sep 17 00:00:00 2001 -From: Jarkko Korpi -Date: Fri, 10 Jul 2015 18:49:44 +0300 -Subject: widl: Increase buffer size in typegen.c. - ---- - tools/widl/typegen.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c -index 4bb4cc4..045a5b7 100644 ---- a/tools/widl/typegen.c -+++ b/tools/widl/typegen.c -@@ -1142,7 +1142,7 @@ static unsigned char get_func_oi2_flags( const var_t *func ) - static unsigned int write_new_procformatstring_type(FILE *file, int indent, const var_t *var, - int is_return, unsigned int *stack_offset) - { -- char buffer[64]; -+ char buffer[128]; - unsigned int stack_size, typestring_offset; - unsigned short flags; - unsigned char fc = get_parameter_fc( var, is_return, &flags, &stack_size, &typestring_offset ); --- -2.4.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/widl-Buffer_Overflow/definition wine-staging-1.7.48~ubuntu12.04.1/patches/widl-Buffer_Overflow/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/widl-Buffer_Overflow/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/widl-Buffer_Overflow/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [37129] Increase buffer size in widl/typegen.c to avoid buffer overflow diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/windowscodecs-GIF_Decoder/0001-windowscodecs-Don-t-fail-to-decode-GIF-if-an-image-h.patch wine-staging-1.7.48~ubuntu12.04.1/patches/windowscodecs-GIF_Decoder/0001-windowscodecs-Don-t-fail-to-decode-GIF-if-an-image-h.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/windowscodecs-GIF_Decoder/0001-windowscodecs-Don-t-fail-to-decode-GIF-if-an-image-h.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/windowscodecs-GIF_Decoder/0001-windowscodecs-Don-t-fail-to-decode-GIF-if-an-image-h.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From ccd2fe7c16c909728d157283d38419af6decfdaf Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Fri, 25 Apr 2014 12:13:56 +0900 -Subject: windowscodecs: Don't fail to decode GIF if an image has been already - loaded. - ---- - dlls/windowscodecs/ungif.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/windowscodecs/ungif.c b/dlls/windowscodecs/ungif.c -index 427b32f..e08cb4b 100644 ---- a/dlls/windowscodecs/ungif.c -+++ b/dlls/windowscodecs/ungif.c -@@ -491,7 +491,7 @@ DGifGetLine(GifFileType * GifFile, - * image until empty block (size 0) detected. We use GetCodeNext. */ - do - if (DGifGetCodeNext(GifFile, &Dummy) == GIF_ERROR) -- return GIF_ERROR; -+ break; - while (Dummy != NULL) ; - } - return GIF_OK; --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/windowscodecs-GIF_Decoder/definition wine-staging-1.7.48~ubuntu12.04.1/patches/windowscodecs-GIF_Decoder/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/windowscodecs-GIF_Decoder/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/windowscodecs-GIF_Decoder/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -Fixes: [32227] Ignore garbage after decoding gif lines -Category: stable diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/windowscodecs-TIFF_Decoder/0001-windowscodecs-Add-support-for-8bpp-grayscale-TIFF-im.patch wine-staging-1.7.48~ubuntu12.04.1/patches/windowscodecs-TIFF_Decoder/0001-windowscodecs-Add-support-for-8bpp-grayscale-TIFF-im.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/windowscodecs-TIFF_Decoder/0001-windowscodecs-Add-support-for-8bpp-grayscale-TIFF-im.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/windowscodecs-TIFF_Decoder/0001-windowscodecs-Add-support-for-8bpp-grayscale-TIFF-im.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,246 +0,0 @@ -From 62f8f2989fd6f2116fbd93ae9c7a6b9332c2cd77 Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Wed, 1 Apr 2015 03:06:29 +0200 -Subject: windowscodecs: Add support for 8bpp grayscale TIFF images with 8bpp - alpha channel. - ---- - dlls/windowscodecs/tests/tiffformat.c | 103 ++++++++++++++++++++++++++++++++++ - dlls/windowscodecs/tiffformat.c | 66 ++++++++++++++++++++-- - 2 files changed, 164 insertions(+), 5 deletions(-) - -diff --git a/dlls/windowscodecs/tests/tiffformat.c b/dlls/windowscodecs/tests/tiffformat.c -index cc1951e..d07caa3 100644 ---- a/dlls/windowscodecs/tests/tiffformat.c -+++ b/dlls/windowscodecs/tests/tiffformat.c -@@ -92,6 +92,48 @@ static const struct tiff_1bpp_data - { 900, 3 }, - { 0x11, 0x22, 0x33, 0 } - }; -+ -+static const struct tiff_8bpp_alpha -+{ -+ USHORT byte_order; -+ USHORT version; -+ ULONG dir_offset; -+ USHORT number_of_entries; -+ struct IFD_entry entry[15]; -+ ULONG next_IFD; -+ struct IFD_rational res; -+ BYTE pixel_data[8]; -+} tiff_8bpp_alpha = -+{ -+#ifdef WORDS_BIGENDIAN -+ 'M' | 'M' << 8, -+#else -+ 'I' | 'I' << 8, -+#endif -+ 42, -+ FIELD_OFFSET(struct tiff_8bpp_alpha, number_of_entries), -+ 15, -+ { -+ { 0xff, IFD_SHORT, 1, 0 }, /* SUBFILETYPE */ -+ { 0x100, IFD_LONG, 1, 2 }, /* IMAGEWIDTH */ -+ { 0x101, IFD_LONG, 1, 2 }, /* IMAGELENGTH */ -+ { 0x102, IFD_SHORT, 2, MAKELONG(8, 8) }, /* BITSPERSAMPLE */ -+ { 0x103, IFD_SHORT, 1, 1 }, /* COMPRESSION: XP doesn't accept IFD_LONG here */ -+ { 0x106, IFD_SHORT, 1, 1 }, /* PHOTOMETRIC */ -+ { 0x111, IFD_LONG, 1, FIELD_OFFSET(struct tiff_8bpp_alpha, pixel_data) }, /* STRIPOFFSETS */ -+ { 0x115, IFD_SHORT, 1, 2 }, /* SAMPLESPERPIXEL */ -+ { 0x116, IFD_LONG, 1, 2 }, /* ROWSPERSTRIP */ -+ { 0x117, IFD_LONG, 1, 8 }, /* STRIPBYTECOUNT */ -+ { 0x11a, IFD_RATIONAL, 1, FIELD_OFFSET(struct tiff_8bpp_alpha, res) }, -+ { 0x11b, IFD_RATIONAL, 1, FIELD_OFFSET(struct tiff_8bpp_alpha, res) }, -+ { 0x11c, IFD_SHORT, 1, 1 }, /* PLANARCONFIGURATION */ -+ { 0x128, IFD_SHORT, 1, 2 }, /* RESOLUTIONUNIT */ -+ { 0x152, IFD_SHORT, 1, 1 } /* EXTRASAMPLES: 1 - Associated alpha with pre-multiplied color */ -+ }, -+ 0, -+ { 96, 1 }, -+ { 0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88 } -+}; - #include "poppack.h" - - static IWICImagingFactory *factory; -@@ -264,6 +306,66 @@ todo_wine - IStream_Release(stream); - } - -+static void test_tiff_8bpp_alpha(void) -+{ -+ HRESULT hr; -+ IWICBitmapDecoder *decoder; -+ IWICBitmapFrameDecode *frame; -+ UINT frame_count, width, height, i; -+ double dpi_x, dpi_y; -+ IWICPalette *palette; -+ GUID format; -+ WICRect rc; -+ BYTE data[16]; -+ static const BYTE expected_data[16] = { 0x11,0x11,0x11,0x22,0x33,0x33,0x33,0x44, -+ 0x55,0x55,0x55,0x66,0x77,0x77,0x77,0x88 }; -+ -+ decoder = create_decoder(&tiff_8bpp_alpha, sizeof(tiff_8bpp_alpha)); -+ ok(decoder != 0, "Failed to load TIFF image data\n"); -+ -+ hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count); -+ ok(hr == S_OK, "GetFrameCount error %#x\n", hr); -+ ok(frame_count == 1, "expected 1, got %u\n", frame_count); -+ -+ hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); -+ ok(hr == S_OK, "GetFrame error %#x\n", hr); -+ -+ hr = IWICBitmapFrameDecode_GetSize(frame, &width, &height); -+ ok(hr == S_OK, "GetSize error %#x\n", hr); -+ ok(width == 2, "expected 2, got %u\n", width); -+ ok(height == 2, "expected 2, got %u\n", height); -+ -+ hr = IWICBitmapFrameDecode_GetResolution(frame, &dpi_x, &dpi_y); -+ ok(hr == S_OK, "GetResolution error %#x\n", hr); -+ ok(dpi_x == 96.0, "expected 96.0, got %f\n", dpi_x); -+ ok(dpi_y == 96.0, "expected 96.0, got %f\n", dpi_y); -+ -+ hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); -+ ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); -+ ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppPBGRA), -+ "got wrong format %s\n", wine_dbgstr_guid(&format)); -+ -+ hr = IWICImagingFactory_CreatePalette(factory, &palette); -+ ok(hr == S_OK, "CreatePalette error %#x\n", hr); -+ hr = IWICBitmapFrameDecode_CopyPalette(frame, palette); -+ ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, -+ "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %#x\n", hr); -+ IWICPalette_Release(palette); -+ -+ rc.X = 0; -+ rc.Y = 0; -+ rc.Width = 2; -+ rc.Height = 2; -+ hr = IWICBitmapFrameDecode_CopyPixels(frame, &rc, 8, sizeof(data), data); -+ ok(hr == S_OK, "CopyPixels error %#x\n", hr); -+ -+ for (i = 0; i < sizeof(data); i++) -+ ok(data[i] == expected_data[i], "%u: expected %02x, got %02x\n", i, expected_data[i], data[i]); -+ -+ IWICBitmapFrameDecode_Release(frame); -+ IWICBitmapDecoder_Release(decoder); -+} -+ - START_TEST(tiffformat) - { - HRESULT hr; -@@ -277,6 +379,7 @@ START_TEST(tiffformat) - - test_tiff_palette(); - test_QueryCapability(); -+ test_tiff_8bpp_alpha(); - - IWICImagingFactory_Release(factory); - CoUninitialize(); -diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c -index 7f987de..51e940f 100644 ---- a/dlls/windowscodecs/tiffformat.c -+++ b/dlls/windowscodecs/tiffformat.c -@@ -236,7 +236,7 @@ typedef struct { - const WICPixelFormatGUID *format; - int bps; - int samples; -- int bpp; -+ int bpp, source_bpp; - int planar; - int indexed; - int reverse_bgr; -@@ -326,23 +326,63 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) - decode_info->invert_grayscale = 1; - /* fall through */ - case 1: /* BlackIsZero */ -- if (samples != 1) -+ if (samples == 2) -+ { -+ ret = pTIFFGetField(tiff, TIFFTAG_EXTRASAMPLES, &extra_sample_count, &extra_samples); -+ if (!ret) -+ { -+ extra_sample_count = 1; -+ extra_sample = 0; -+ extra_samples = &extra_sample; -+ } -+ } -+ else if (samples != 1) - { -- FIXME("unhandled grayscale sample count %u\n", samples); -+ FIXME("unhandled %dbpp sample count %u\n", bps, samples); - return E_FAIL; - } - -- decode_info->bpp = bps; -+ decode_info->bpp = bps * samples; -+ decode_info->source_bpp = decode_info->bpp; - switch (bps) - { - case 1: -+ if (samples != 1) -+ { -+ FIXME("unhandled 1bpp sample count %u\n", samples); -+ return E_FAIL; -+ } - decode_info->format = &GUID_WICPixelFormatBlackWhite; - break; - case 4: -+ if (samples != 1) -+ { -+ FIXME("unhandled 4bpp grayscale sample count %u\n", samples); -+ return E_FAIL; -+ } - decode_info->format = &GUID_WICPixelFormat4bppGray; - break; - case 8: -- decode_info->format = &GUID_WICPixelFormat8bppGray; -+ if (samples == 1) -+ decode_info->format = &GUID_WICPixelFormat8bppGray; -+ else -+ { -+ decode_info->bpp = 32; -+ -+ switch(extra_samples[0]) -+ { -+ case 1: /* Associated (pre-multiplied) alpha data */ -+ decode_info->format = &GUID_WICPixelFormat32bppPBGRA; -+ break; -+ case 0: /* Unspecified data */ -+ case 2: /* Unassociated alpha data */ -+ decode_info->format = &GUID_WICPixelFormat32bppBGRA; -+ break; -+ default: -+ FIXME("unhandled extra sample type %u\n", extra_samples[0]); -+ return E_FAIL; -+ } -+ } - break; - default: - FIXME("unhandled greyscale bit count %u\n", bps); -@@ -943,6 +983,22 @@ static HRESULT TiffFrameDecode_ReadTile(TiffFrameDecode *This, UINT tile_x, UINT - hr = E_FAIL; - } - -+ /* 8bpp grayscale with extra alpha */ -+ if (hr == S_OK && This->decode_info.source_bpp == 16 && This->decode_info.samples == 2 && This->decode_info.bpp == 32) -+ { -+ BYTE *src; -+ DWORD *dst, count = This->decode_info.tile_width * This->decode_info.tile_height; -+ -+ src = This->cached_tile + This->decode_info.tile_width * This->decode_info.tile_height * 2 - 2; -+ dst = (DWORD *)(This->cached_tile + This->decode_info.tile_size - 4); -+ -+ while (count--) -+ { -+ *dst-- = src[0] | (src[0] << 8) | (src[0] << 16) | (src[1] << 24); -+ src -= 2; -+ } -+ } -+ - if (hr == S_OK && This->decode_info.reverse_bgr) - { - if (This->decode_info.bps == 8) --- -2.3.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/windowscodecs-TIFF_Decoder/definition wine-staging-1.7.48~ubuntu12.04.1/patches/windowscodecs-TIFF_Decoder/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/windowscodecs-TIFF_Decoder/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/windowscodecs-TIFF_Decoder/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [38027] Support for 8bpp grayscale TIFF images with 8bpp alpha channel diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Forward_Exitcode/0001-wineconsole-Consistently-return-nonzero-exitcode-on-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Forward_Exitcode/0001-wineconsole-Consistently-return-nonzero-exitcode-on-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Forward_Exitcode/0001-wineconsole-Consistently-return-nonzero-exitcode-on-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Forward_Exitcode/0001-wineconsole-Consistently-return-nonzero-exitcode-on-.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,117 @@ +From 4134e0b939a4194bc961231523e381fa83806b33 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Mon, 13 Jul 2015 20:51:29 +0200 +Subject: wineconsole: Consistently return nonzero exitcode on error. + +--- + programs/wineconsole/curses.c | 2 +- + programs/wineconsole/user.c | 2 +- + programs/wineconsole/wineconsole.c | 28 +++++++++++++++------------- + 3 files changed, 17 insertions(+), 15 deletions(-) + +diff --git a/programs/wineconsole/curses.c b/programs/wineconsole/curses.c +index 2903b80..7413c8f 100644 +--- a/programs/wineconsole/curses.c ++++ b/programs/wineconsole/curses.c +@@ -1018,7 +1018,7 @@ static int WCCURSES_MainLoop(struct inner_data* data) + + WCCURSES_Resize(data); + +- if (pipe( PRIVATE(data)->sync_pipe ) == -1) return 0; ++ if (pipe( PRIVATE(data)->sync_pipe ) == -1) return 1; + PRIVATE(data)->input_thread = CreateThread( NULL, 0, input_thread, data, 0, &id ); + + while (!data->dying && WaitForSingleObject(data->hSynchro, INFINITE) == WAIT_OBJECT_0) +diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c +index 5c8c2c0..4725ebd 100644 +--- a/programs/wineconsole/user.c ++++ b/programs/wineconsole/user.c +@@ -1382,7 +1382,7 @@ static int WCUSER_MainLoop(struct inner_data* data) + * so GetMessage would lead to delayed processing */ + while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE)) + { +- if (msg.message == WM_QUIT) return 0; ++ if (msg.message == WM_QUIT) return 1; + WINE_TRACE("dispatching msg %04x\n", msg.message); + DispatchMessageW(&msg); + } +diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c +index bdd5629..4ea5f84 100644 +--- a/programs/wineconsole/wineconsole.c ++++ b/programs/wineconsole/wineconsole.c +@@ -747,16 +747,18 @@ static BOOL WINECON_Spawn(struct inner_data* data, LPWSTR cmdLine) + } + + done = CreateProcessW(NULL, cmdLine, NULL, NULL, TRUE, 0L, NULL, NULL, &startup, &info); ++ if (done) ++ { ++ CloseHandle(info.hProcess); ++ CloseHandle(info.hThread); ++ } + + /* we no longer need the handles passed to the child for the console */ + CloseHandle(startup.hStdInput); + CloseHandle(startup.hStdOutput); + CloseHandle(startup.hStdError); + +- CloseHandle(info.hProcess); +- CloseHandle(info.hThread); +- +- return done; ++ return !done; + } + + struct wc_init { +@@ -852,9 +854,9 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, INT nCmdSh + { + case from_event: + /* case of wineconsole , signal process that created us that we're up and running */ +- if (!(data = WINECON_Init(hInst, 0, NULL, wci.backend, nCmdShow))) return 0; +- ret = SetEvent(wci.event); +- if (!ret) WINE_ERR("SetEvent failed.\n"); ++ if (!(data = WINECON_Init(hInst, 0, NULL, wci.backend, nCmdShow))) return 1; ++ ret = !SetEvent(wci.event); ++ if (ret != 0) WINE_ERR("SetEvent failed.\n"); + break; + case from_process_name: + { +@@ -865,30 +867,30 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, INT nCmdSh + + buffer = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (!buffer) +- return 0; ++ return 1; + + MultiByteToWideChar(CP_ACP, 0, wci.ptr, -1, buffer, len); + + if (!(data = WINECON_Init(hInst, GetCurrentProcessId(), buffer, wci.backend, nCmdShow))) + { + HeapFree(GetProcessHeap(), 0, buffer); +- return 0; ++ return 1; + } + ret = WINECON_Spawn(data, buffer); + HeapFree(GetProcessHeap(), 0, buffer); +- if (!ret) ++ if (ret != 0) + { + WINECON_Delete(data); + printf_res(IDS_CMD_LAUNCH_FAILED, wine_dbgstr_a(wci.ptr)); +- return 0; ++ return ret; + } + } + break; + default: +- return 0; ++ return 1; + } + +- if (ret) ++ if (!ret) + { + WINE_TRACE("calling MainLoop.\n"); + ret = data->fnMainLoop(data); +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Forward_Exitcode/0002-wineconsole-Forward-child-process-exitcode.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Forward_Exitcode/0002-wineconsole-Forward-child-process-exitcode.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Forward_Exitcode/0002-wineconsole-Forward-child-process-exitcode.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Forward_Exitcode/0002-wineconsole-Forward-child-process-exitcode.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,67 @@ +From 455d3fe40a00e970a8e31e59c5d88ae671bd6802 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Mon, 13 Jul 2015 02:22:47 +0200 +Subject: wineconsole: Forward child process exitcode. + +--- + programs/wineconsole/winecon_private.h | 1 + + programs/wineconsole/wineconsole.c | 17 ++++++++++++++--- + 2 files changed, 15 insertions(+), 3 deletions(-) + +diff --git a/programs/wineconsole/winecon_private.h b/programs/wineconsole/winecon_private.h +index 2178dd0..5608f99 100644 +--- a/programs/wineconsole/winecon_private.h ++++ b/programs/wineconsole/winecon_private.h +@@ -59,6 +59,7 @@ struct inner_data { + HANDLE hConIn; /* console input handle */ + HANDLE hConOut; /* screen buffer handle: has to be changed when active sb changes */ + HANDLE hSynchro; /* waitable handle signalled by server when something in server has been modified */ ++ HANDLE hProcess; /* handle to the child process or NULL */ + HWND hWnd; /* handle of 'user' window or NULL for 'curses' */ + INT nCmdShow; /* argument of WinMain */ + BOOL in_set_config; /* to handle re-entrant calls to WINECON_SetConfig */ +diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c +index 4ea5f84..f92632c 100644 +--- a/programs/wineconsole/wineconsole.c ++++ b/programs/wineconsole/wineconsole.c +@@ -541,6 +541,7 @@ static void WINECON_Delete(struct inner_data* data) + if (data->hConIn) CloseHandle(data->hConIn); + if (data->hConOut) CloseHandle(data->hConOut); + if (data->hSynchro) CloseHandle(data->hSynchro); ++ if (data->hProcess) CloseHandle(data->hProcess); + HeapFree(GetProcessHeap(), 0, data->curcfg.registry); + HeapFree(GetProcessHeap(), 0, data->cells); + HeapFree(GetProcessHeap(), 0, data); +@@ -749,7 +750,7 @@ static BOOL WINECON_Spawn(struct inner_data* data, LPWSTR cmdLine) + done = CreateProcessW(NULL, cmdLine, NULL, NULL, TRUE, 0L, NULL, NULL, &startup, &info); + if (done) + { +- CloseHandle(info.hProcess); ++ data->hProcess = info.hProcess; + CloseHandle(info.hThread); + } + +@@ -892,8 +893,18 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, INT nCmdSh + + if (!ret) + { +- WINE_TRACE("calling MainLoop.\n"); +- ret = data->fnMainLoop(data); ++ DWORD exitcode; ++ ++ WINE_TRACE("calling MainLoop.\n"); ++ ret = data->fnMainLoop(data); ++ ++ if (!ret && data->hProcess && ++ WaitForSingleObject(data->hProcess, INFINITE) == WAIT_OBJECT_0 && ++ GetExitCodeProcess(data->hProcess, &exitcode)) ++ { ++ WINE_TRACE("forwarding exitcode %u from child process\n", exitcode); ++ ret = exitcode; ++ } + } + + WINECON_Delete(data); +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Forward_Exitcode/definition wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Forward_Exitcode/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Forward_Exitcode/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Forward_Exitcode/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Forward exitcode from child process when in wineconsole diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Insert_Mode/0001-wineconsole-Rearrange-user-dialog-to-make-space-for-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Insert_Mode/0001-wineconsole-Rearrange-user-dialog-to-make-space-for-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Insert_Mode/0001-wineconsole-Rearrange-user-dialog-to-make-space-for-.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Insert_Mode/0001-wineconsole-Rearrange-user-dialog-to-make-space-for-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -From f5b87201251c3fd2d10cc9208ade78d0a100d26a Mon Sep 17 00:00:00 2001 -From: Hugh McMaster -Date: Thu, 28 May 2015 21:29:24 +1000 -Subject: wineconsole: Rearrange user dialog to make space for InsertMode - checkbox - ---- - programs/wineconsole/wineconsole.rc | 28 ++++++++++++++-------------- - 1 file changed, 14 insertions(+), 14 deletions(-) - -diff --git a/programs/wineconsole/wineconsole.rc b/programs/wineconsole/wineconsole.rc -index e4e0624..4dd06b7 100644 ---- a/programs/wineconsole/wineconsole.rc -+++ b/programs/wineconsole/wineconsole.rc -@@ -54,31 +54,31 @@ IDS_USAGE_FOOTER "\nExample:\n wineconsole cmd\nStarts the Wine comma - - END - --IDD_OPTION DIALOG 36, 24, 140, 105 -+IDD_OPTION DIALOG 36, 24, 140, 153 - STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU - CAPTION "Options" - FONT 8, "MS Shell Dlg" - { -- GROUPBOX "Cursor size", -1, 5, 5, 65, 56, BS_GROUPBOX -+ GROUPBOX "Cursor size", -1, 5, 5, 70, 54, BS_GROUPBOX - AUTORADIOBUTTON "&Small", IDC_OPT_CURSOR_SMALL, 9, 18, 50, 10, WS_TABSTOP - AUTORADIOBUTTON "&Medium", IDC_OPT_CURSOR_MEDIUM, 9, 30, 50, 10, WS_TABSTOP - AUTORADIOBUTTON "&Large", IDC_OPT_CURSOR_LARGE, 9, 42, 50, 10, WS_TABSTOP - -- GROUPBOX "Control", -1, 75, 5, 125, 56, BS_GROUPBOX -- LTEXT "Popup menu", -1, 79, 18, 50, 18 -- AUTOCHECKBOX "&Control", IDC_OPT_CONF_CTRL, 138, 18, 60, 10, WS_TABSTOP -- AUTOCHECKBOX "S&hift", IDC_OPT_CONF_SHIFT, 138, 30, 60, 10, WS_TABSTOP -- LTEXT "Quick edit", -1, 79, 42, 50, 18 -- AUTOCHECKBOX "&enable", IDC_OPT_QUICK_EDIT, 138, 42, 60, 10, WS_TABSTOP -+ GROUPBOX "Console", -1, 80, 5, 120, 54, BS_GROUPBOX -+ AUTOCHECKBOX "&Quick edit", IDC_OPT_QUICK_EDIT, 84, 18, 70, 10, WS_TABSTOP - -- GROUPBOX "Command history", -1, 5, 63, 195, 40, BS_GROUPBOX -- LTEXT "&Number of recalled commands:", -1, 9, 75, 78, 18 -- EDITTEXT IDC_OPT_HIST_SIZE, 87, 77, 31, 12, WS_TABSTOP|WS_BORDER|ES_NUMBER -+ GROUPBOX "Popup menu", -1, 5, 61, 70, 42, BS_GROUPBOX -+ AUTOCHECKBOX "&Control", IDC_OPT_CONF_CTRL, 9, 74, 60, 10, WS_TABSTOP -+ AUTOCHECKBOX "S&hift", IDC_OPT_CONF_SHIFT, 9, 86, 60, 10, WS_TABSTOP -+ -+ GROUPBOX "Command history", -1, 5, 105, 195, 42, BS_GROUPBOX -+ LTEXT "&Number of recalled commands:", -1, 9, 118, 110, 10 -+ EDITTEXT IDC_OPT_HIST_SIZE, 123, 117, 31, 12, WS_TABSTOP|WS_BORDER|ES_NUMBER - CONTROL "", IDC_OPT_HIST_SIZE_UD, "msctls_updown32", UDS_SETBUDDYINT|UDS_ALIGNRIGHT|UDS_AUTOBUDDY|UDS_ARROWKEYS|UDS_NOTHOUSANDS, 0, 0, 0, 0 -- AUTOCHECKBOX "&Remove doubles", IDC_OPT_HIST_NODOUBLE, 125, 75, 60, 18, WS_TABSTOP|BS_MULTILINE -+ AUTOCHECKBOX "&Remove doubles", IDC_OPT_HIST_NODOUBLE, 9, 130, 80, 10, WS_TABSTOP|BS_MULTILINE - } - --IDD_FONT DIALOG 36, 24, 140, 105 -+IDD_FONT DIALOG 36, 24, 140, 153 - STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU - CAPTION "Font" - FONT 8, "MS Shell Dlg" -@@ -94,7 +94,7 @@ FONT 8, "MS Shell Dlg" - LTEXT "", IDC_FNT_FONT_INFO, 128, 73, 80, 27 - } - --IDD_CONFIG DIALOG 36, 24, 140, 105 -+IDD_CONFIG DIALOG 36, 24, 140, 153 - STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU - CAPTION "Configuration" - FONT 8, "MS Shell Dlg" --- -2.4.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Insert_Mode/0002-wineconsole-Improve-semantics-of-some-poorly-worded-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Insert_Mode/0002-wineconsole-Improve-semantics-of-some-poorly-worded-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Insert_Mode/0002-wineconsole-Improve-semantics-of-some-poorly-worded-.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Insert_Mode/0002-wineconsole-Improve-semantics-of-some-poorly-worded-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -From c89f895ce2d7e5a29491bf658bdae0b53fbf0c08 Mon Sep 17 00:00:00 2001 -From: Hugh McMaster -Date: Thu, 28 May 2015 21:29:47 +1000 -Subject: wineconsole: Improve semantics of some poorly-worded resource strings - ---- - programs/wineconsole/wineconsole.rc | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/programs/wineconsole/wineconsole.rc b/programs/wineconsole/wineconsole.rc -index 4dd06b7..4226ba3 100644 ---- a/programs/wineconsole/wineconsole.rc -+++ b/programs/wineconsole/wineconsole.rc -@@ -65,17 +65,17 @@ FONT 8, "MS Shell Dlg" - AUTORADIOBUTTON "&Large", IDC_OPT_CURSOR_LARGE, 9, 42, 50, 10, WS_TABSTOP - - GROUPBOX "Console", -1, 80, 5, 120, 54, BS_GROUPBOX -- AUTOCHECKBOX "&Quick edit", IDC_OPT_QUICK_EDIT, 84, 18, 70, 10, WS_TABSTOP -+ AUTOCHECKBOX "&QuickEdit mode", IDC_OPT_QUICK_EDIT, 84, 18, 70, 10, WS_TABSTOP - - GROUPBOX "Popup menu", -1, 5, 61, 70, 42, BS_GROUPBOX - AUTOCHECKBOX "&Control", IDC_OPT_CONF_CTRL, 9, 74, 60, 10, WS_TABSTOP - AUTOCHECKBOX "S&hift", IDC_OPT_CONF_SHIFT, 9, 86, 60, 10, WS_TABSTOP - - GROUPBOX "Command history", -1, 5, 105, 195, 42, BS_GROUPBOX -- LTEXT "&Number of recalled commands:", -1, 9, 118, 110, 10 -+ LTEXT "&Number of stored commands:", -1, 9, 118, 110, 10 - EDITTEXT IDC_OPT_HIST_SIZE, 123, 117, 31, 12, WS_TABSTOP|WS_BORDER|ES_NUMBER - CONTROL "", IDC_OPT_HIST_SIZE_UD, "msctls_updown32", UDS_SETBUDDYINT|UDS_ALIGNRIGHT|UDS_AUTOBUDDY|UDS_ARROWKEYS|UDS_NOTHOUSANDS, 0, 0, 0, 0 -- AUTOCHECKBOX "&Remove doubles", IDC_OPT_HIST_NODOUBLE, 9, 130, 80, 10, WS_TABSTOP|BS_MULTILINE -+ AUTOCHECKBOX "&Remove duplicates", IDC_OPT_HIST_NODOUBLE, 9, 130, 80, 10, WS_TABSTOP|BS_MULTILINE - } - - IDD_FONT DIALOG 36, 24, 140, 153 --- -2.4.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Insert_Mode/0003-wineconsole-Add-InsertMode-to-the-user-dialog.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Insert_Mode/0003-wineconsole-Add-InsertMode-to-the-user-dialog.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Insert_Mode/0003-wineconsole-Add-InsertMode-to-the-user-dialog.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Insert_Mode/0003-wineconsole-Add-InsertMode-to-the-user-dialog.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -From 51f0cd8d176e8889b969ba9f02de67041c30b313 Mon Sep 17 00:00:00 2001 -From: Hugh McMaster -Date: Thu, 28 May 2015 21:53:55 +1000 -Subject: wineconsole: Add InsertMode to the user dialog - ---- - programs/wineconsole/dialog.c | 5 +++++ - programs/wineconsole/wineconsole.c | 32 +++++++++++++++++++++++++++++++- - programs/wineconsole/wineconsole.rc | 1 + - programs/wineconsole/wineconsole_res.h | 1 + - 4 files changed, 38 insertions(+), 1 deletion(-) - -diff --git a/programs/wineconsole/dialog.c b/programs/wineconsole/dialog.c -index 8573d07..493990d 100644 ---- a/programs/wineconsole/dialog.c -+++ b/programs/wineconsole/dialog.c -@@ -76,6 +76,8 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L - SetDlgItemInt(hDlg, IDC_OPT_HIST_SIZE, di->config.history_size, FALSE); - SendDlgItemMessageW(hDlg, IDC_OPT_HIST_NODOUBLE, BM_SETCHECK, - (di->config.history_nodup) ? BST_CHECKED : BST_UNCHECKED, 0); -+ SendDlgItemMessageW(hDlg, IDC_OPT_INSERT_MODE, BM_SETCHECK, -+ (di->config.insert_mode) ? BST_CHECKED : BST_UNCHECKED, 0); - SendDlgItemMessageW(hDlg, IDC_OPT_CONF_CTRL, BM_SETCHECK, - (di->config.menu_mask & MK_CONTROL) ? BST_CHECKED : BST_UNCHECKED, 0); - SendDlgItemMessageW(hDlg, IDC_OPT_CONF_SHIFT, BM_SETCHECK, -@@ -121,6 +123,9 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L - val = (IsDlgButtonChecked(hDlg, IDC_OPT_HIST_NODOUBLE) & BST_CHECKED) != 0; - di->config.history_nodup = val; - -+ val = (IsDlgButtonChecked(hDlg, IDC_OPT_INSERT_MODE) & BST_CHECKED) != 0; -+ di->config.insert_mode = val; -+ - val = 0; - if (IsDlgButtonChecked(hDlg, IDC_OPT_CONF_CTRL) & BST_CHECKED) val |= MK_CONTROL; - if (IsDlgButtonChecked(hDlg, IDC_OPT_CONF_SHIFT) & BST_CHECKED) val |= MK_SHIFT; -diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c -index ed5f816..b7a968c 100644 ---- a/programs/wineconsole/wineconsole.c -+++ b/programs/wineconsole/wineconsole.c -@@ -150,6 +150,25 @@ static BOOL WINECON_SetHistoryMode(HANDLE hConIn, int mode) - } - - /****************************************************************** -+ * WINECON_SetInsertMode -+ * -+ * -+ */ -+static void WINECON_SetInsertMode(HANDLE hConIn, int enable) -+{ -+ DWORD mode; -+ -+ if (GetConsoleMode( hConIn, &mode )) -+ { -+ if (enable) -+ mode |= ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS; -+ else -+ mode &= ~ENABLE_INSERT_MODE; -+ SetConsoleMode( hConIn, mode ); -+ } -+} -+ -+/****************************************************************** - * WINECON_GetConsoleTitle - * - * -@@ -397,6 +416,11 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf - data->curcfg.history_nodup = cfg->history_nodup; - WINECON_SetHistoryMode(data->hConIn, cfg->history_nodup); - } -+ if (data->curcfg.insert_mode != cfg->insert_mode) -+ { -+ data->curcfg.insert_mode = cfg->insert_mode; -+ WINECON_SetInsertMode(data->hConIn, cfg->insert_mode); -+ } - data->curcfg.menu_mask = cfg->menu_mask; - data->curcfg.quick_edit = cfg->quick_edit; - if (1 /* FIXME: font info has changed */) -@@ -533,7 +557,12 @@ static void WINECON_Delete(struct inner_data* data) - */ - static BOOL WINECON_GetServerConfig(struct inner_data* data) - { -- BOOL ret; -+ BOOL ret; -+ DWORD mode; -+ -+ if (!GetConsoleMode( data->hConIn, &mode )) mode = 0; -+ data->curcfg.insert_mode = (mode & (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS)) == -+ (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS); - - SERVER_START_REQ(get_console_input_info) - { -@@ -545,6 +574,7 @@ static BOOL WINECON_GetServerConfig(struct inner_data* data) - } - SERVER_END_REQ; - if (!ret) return FALSE; -+ - SERVER_START_REQ(get_console_output_info) - { - req->handle = wine_server_obj_handle( data->hConOut ); -diff --git a/programs/wineconsole/wineconsole.rc b/programs/wineconsole/wineconsole.rc -index 4226ba3..a3afa1b 100644 ---- a/programs/wineconsole/wineconsole.rc -+++ b/programs/wineconsole/wineconsole.rc -@@ -66,6 +66,7 @@ FONT 8, "MS Shell Dlg" - - GROUPBOX "Console", -1, 80, 5, 120, 54, BS_GROUPBOX - AUTOCHECKBOX "&QuickEdit mode", IDC_OPT_QUICK_EDIT, 84, 18, 70, 10, WS_TABSTOP -+ AUTOCHECKBOX "&Insert mode", IDC_OPT_INSERT_MODE, 84, 30, 70, 10, WS_TABSTOP - - GROUPBOX "Popup menu", -1, 5, 61, 70, 42, BS_GROUPBOX - AUTOCHECKBOX "&Control", IDC_OPT_CONF_CTRL, 9, 74, 60, 10, WS_TABSTOP -diff --git a/programs/wineconsole/wineconsole_res.h b/programs/wineconsole/wineconsole_res.h -index ac62b58..8261fd5 100644 ---- a/programs/wineconsole/wineconsole_res.h -+++ b/programs/wineconsole/wineconsole_res.h -@@ -70,6 +70,7 @@ - #define IDC_OPT_CONF_CTRL 0x0107 - #define IDC_OPT_CONF_SHIFT 0x0108 - #define IDC_OPT_QUICK_EDIT 0x0109 -+#define IDC_OPT_INSERT_MODE 0x0110 - - #define IDC_FNT_LIST_FONT 0x0201 - #define IDC_FNT_LIST_SIZE 0x0202 --- -2.4.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Insert_Mode/definition wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Insert_Mode/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/wineconsole-Insert_Mode/definition 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wineconsole-Insert_Mode/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [38697] Allow to enable/disable InsertMode in wineconsole settings diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-Accounting/0001-wined3d-Use-real-values-for-memory-accounting-on-NVI.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-Accounting/0001-wined3d-Use-real-values-for-memory-accounting-on-NVI.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-Accounting/0001-wined3d-Use-real-values-for-memory-accounting-on-NVI.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-Accounting/0001-wined3d-Use-real-values-for-memory-accounting-on-NVI.patch 2015-07-29 19:51:42.000000000 +0000 @@ -1,4 +1,4 @@ -From 10565101ae7063c68218c68487b8e57d044496ff Mon Sep 17 00:00:00 2001 +From 53a49004741dbe3d7cf1b9e79ed0a5b021bef51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 6 Jun 2015 06:53:34 +0200 Subject: wined3d: Use real values for memory accounting on NVIDIA cards. @@ -10,7 +10,7 @@ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 56cf325..8f62570 100644 +index c746d18..f33b313 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1181,8 +1181,31 @@ void CDECL wined3d_device_set_multithreaded(struct wined3d_device *device) @@ -46,7 +46,7 @@ wine_dbgstr_longlong(device->adapter->vram_bytes), wine_dbgstr_longlong(device->adapter->vram_bytes_used), diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c -index eb749ea..c1eeaef 100644 +index ce23c47..af7a63b 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -220,6 +220,7 @@ static const struct wined3d_extension_map gl_extension_map[] = @@ -57,7 +57,7 @@ /* SGI */ {"GL_SGIS_generate_mipmap", SGIS_GENERATE_MIPMAP }, -@@ -1391,7 +1392,8 @@ static const struct gpu_description *get_gpu_description(enum wined3d_pci_vendor +@@ -1395,7 +1396,8 @@ static const struct gpu_description *get_gpu_description(enum wined3d_pci_vendor return NULL; } @@ -67,7 +67,7 @@ enum wined3d_pci_vendor vendor, enum wined3d_pci_device device) { OSVERSIONINFOW os_version; -@@ -1500,6 +1502,16 @@ static void init_driver_info(struct wined3d_driver_info *driver_info, +@@ -1504,6 +1506,16 @@ static void init_driver_info(struct wined3d_driver_info *driver_info, driver = DRIVER_UNKNOWN; } @@ -84,17 +84,17 @@ if (wined3d_settings.emulated_textureram) { TRACE("Overriding amount of video memory with 0x%s bytes.\n", -@@ -3652,7 +3664,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter) - adapter->d3d_info.valid_rt_mask |= (1 << i); +@@ -3804,7 +3816,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter) + } fixup_extensions(gl_info, gl_renderer_str, gl_vendor, card_vendor, device); - init_driver_info(driver_info, card_vendor, device); + init_driver_info(gl_info, driver_info, card_vendor, device); - add_gl_compat_wrappers(gl_info); - - return TRUE; + gl_ext_emul_mask = adapter->vertex_pipe->vp_get_emul_mask(gl_info) + | adapter->fragment_pipe->get_emul_mask(gl_info); + if (gl_ext_emul_mask & GL_EXT_EMUL_ARB_MULTITEXTURE) diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h -index 009dca6..2c400fa 100644 +index 8c07ed1..3007516 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -153,6 +153,7 @@ enum wined3d_gl_extension @@ -106,5 +106,5 @@ SGIS_GENERATE_MIPMAP, /* WGL extensions */ -- -2.4.2 +2.4.5 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0001-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0001-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0001-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0001-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,105 @@ +From 437012ece4738ad5cea694b2a6c2759927074ebe Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 14 Dec 2014 20:49:28 +0100 +Subject: wined3d: Add second dll with STAGING_CSMT definition set. + +--- + configure.ac | 1 + + dlls/wined3d-csmt/Makefile.in | 38 ++++++++++++++++++++++++++++++++++++++ + dlls/wined3d-csmt/version.rc | 27 +++++++++++++++++++++++++++ + 3 files changed, 66 insertions(+) + create mode 100644 dlls/wined3d-csmt/Makefile.in + create mode 100644 dlls/wined3d-csmt/version.rc + +diff --git a/configure.ac b/configure.ac +index e5fb209..7394424 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3318,6 +3318,7 @@ WINE_CONFIG_TEST(dlls/windowscodecsext/tests) + WINE_CONFIG_DLL(winealsa.drv) + WINE_CONFIG_DLL(winecoreaudio.drv) + WINE_CONFIG_LIB(winecrt0) ++WINE_CONFIG_DLL(wined3d-csmt) + WINE_CONFIG_DLL(wined3d,,[implib]) + WINE_CONFIG_DLL(winegstreamer) + WINE_CONFIG_DLL(winejoystick.drv) +diff --git a/dlls/wined3d-csmt/Makefile.in b/dlls/wined3d-csmt/Makefile.in +new file mode 100644 +index 0000000..3a401a0 +--- /dev/null ++++ b/dlls/wined3d-csmt/Makefile.in +@@ -0,0 +1,38 @@ ++EXTRADEFS = -DSTAGING_CSMT ++MODULE = wined3d-csmt.dll ++IMPORTS = uuid opengl32 user32 gdi32 advapi32 ++PARENTSRC = ../wined3d ++PARENTSPEC = ../wined3d/wined3d.spec ++ ++C_SRCS = \ ++ arb_program_shader.c \ ++ ati_fragment_shader.c \ ++ buffer.c \ ++ context.c \ ++ cs.c \ ++ device.c \ ++ directx.c \ ++ drawprim.c \ ++ dxtn.c \ ++ gl_compat.c \ ++ glsl_shader.c \ ++ nvidia_texture_shader.c \ ++ palette.c \ ++ query.c \ ++ resource.c \ ++ sampler.c \ ++ shader.c \ ++ shader_sm1.c \ ++ shader_sm4.c \ ++ state.c \ ++ stateblock.c \ ++ surface.c \ ++ swapchain.c \ ++ texture.c \ ++ utils.c \ ++ vertexdeclaration.c \ ++ view.c \ ++ volume.c \ ++ wined3d_main.c ++ ++RC_SRCS = version.rc +diff --git a/dlls/wined3d-csmt/version.rc b/dlls/wined3d-csmt/version.rc +new file mode 100644 +index 0000000..0439375 +--- /dev/null ++++ b/dlls/wined3d-csmt/version.rc +@@ -0,0 +1,27 @@ ++/* ++ * Copyright 2009 Austin English ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" /* Needed to get PACKAGE_VERSION */ ++ ++#define WINE_FILEDESCRIPTION_STR "Wine D3D" ++#define WINE_FILENAME_STR "wined3d-csmt.dll" ++#define WINE_FILEVERSION_STR PACKAGE_VERSION ++#define WINE_PRODUCTVERSION_STR PACKAGE_VERSION ++#define WINE_PRODUCTNAME_STR "Wine D3D" ++ ++#include "wine/wine_common_ver.rc" +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,459 +0,0 @@ -From e34f6f432826634f80cefdc9311c5472eae80dad Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 19 Sep 2013 14:22:24 +0200 -Subject: wined3d: Merge get_pitch functions. - ---- - dlls/ddraw/surface.c | 12 +++++-- - dlls/wined3d/resource.c | 31 ++++++++++++++++ - dlls/wined3d/surface.c | 81 ++++++++++++++++++------------------------ - dlls/wined3d/texture.c | 2 +- - dlls/wined3d/volume.c | 28 ++------------- - dlls/wined3d/wined3d.spec | 2 +- - dlls/wined3d/wined3d_private.h | 3 +- - include/wine/wined3d.h | 3 +- - 8 files changed, 81 insertions(+), 81 deletions(-) - -diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c -index f716cfc..da64d97 100644 ---- a/dlls/ddraw/surface.c -+++ b/dlls/ddraw/surface.c -@@ -6212,6 +6212,10 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, stru - DDSURFACEDESC2 *desc = &surface->surface_desc; - struct wined3d_resource_desc wined3d_desc; - unsigned int version = texture->version; -+ UINT row_pitch, slice_pitch; -+ struct wined3d_resource *resource = wined3d_surface_get_resource(wined3d_surface); -+ -+ wined3d_resource_get_pitch(resource, &row_pitch, &slice_pitch); - - surface->IDirectDrawSurface7_iface.lpVtbl = &ddraw_surface7_vtbl; - surface->IDirectDrawSurface4_iface.lpVtbl = &ddraw_surface4_vtbl; -@@ -6242,7 +6246,7 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, stru - } - - *desc = texture->surface_desc; -- wined3d_resource_get_desc(wined3d_surface_get_resource(wined3d_surface), &wined3d_desc); -+ wined3d_resource_get_desc(resource, &wined3d_desc); - desc->dwWidth = wined3d_desc.width; - desc->dwHeight = wined3d_desc.height; - surface->first_attached = surface; -@@ -6252,14 +6256,16 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, stru - if (desc->dwFlags & DDSD_LPSURFACE) - desc->u1.dwLinearSize = ~0u; - else -- desc->u1.dwLinearSize = wined3d_surface_get_pitch(wined3d_surface) * ((desc->dwHeight + 3) / 4); -+ { -+ desc->u1.dwLinearSize = row_pitch * ((desc->dwHeight + 3) / 4); -+ } - desc->dwFlags |= DDSD_LINEARSIZE; - desc->dwFlags &= ~(DDSD_LPSURFACE | DDSD_PITCH); - } - else - { - if (!(desc->dwFlags & DDSD_LPSURFACE)) -- desc->u1.lPitch = wined3d_surface_get_pitch(wined3d_surface); -+ desc->u1.lPitch = row_pitch; - desc->dwFlags |= DDSD_PITCH; - desc->dwFlags &= ~(DDSD_LPSURFACE | DDSD_LINEARSIZE); - } -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index e9e586f..648882e 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -405,3 +405,34 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) - else - resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB; - } -+ -+void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, -+ UINT *slice_pitch) -+{ -+ unsigned int alignment; -+ const struct wined3d_format *format = resource->format; -+ -+ if (resource->custom_row_pitch) -+ { -+ *row_pitch = resource->custom_row_pitch; -+ *slice_pitch = resource->custom_slice_pitch; -+ return; -+ } -+ -+ alignment = resource->device->surface_alignment; -+ *row_pitch = wined3d_format_calculate_pitch(resource->format, resource->width); -+ *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1); -+ if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_BLOCKS) -+ { -+ /* Since compressed formats are block based, pitch means the amount of -+ * bytes to the next row of block rather than the next row of pixels. */ -+ UINT slice_block_count = (resource->height + format->block_height - 1) / format->block_height; -+ *slice_pitch = *row_pitch * slice_block_count; -+ } -+ else -+ { -+ *slice_pitch = *row_pitch * resource->height; -+ } -+ -+ TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); -+} -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 1ea8e61..5460f79 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -364,6 +364,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) - BITMAPINFO *b_info; - int extraline = 0; - DWORD *masks; -+ UINT row_pitch, slice_pitch; - - TRACE("surface %p.\n", surface); - -@@ -409,10 +410,11 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) - - b_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - /* TODO: Is there a nicer way to force a specific alignment? (8 byte for ddraw) */ -- b_info->bmiHeader.biWidth = wined3d_surface_get_pitch(surface) / format->byte_count; -+ wined3d_resource_get_pitch(&surface->resource, &row_pitch, &slice_pitch); -+ b_info->bmiHeader.biWidth = row_pitch / format->byte_count; - b_info->bmiHeader.biHeight = 0 - surface->resource.height - extraline; - b_info->bmiHeader.biSizeImage = (surface->resource.height + extraline) -- * wined3d_surface_get_pitch(surface); -+ * row_pitch; - b_info->bmiHeader.biPlanes = 1; - b_info->bmiHeader.biBitCount = format->byte_count * 8; - -@@ -1305,14 +1307,14 @@ static void surface_download_data(struct wined3d_surface *surface, const struct - void *mem; - GLenum gl_format = format->glFormat; - GLenum gl_type = format->glType; -- int src_pitch = 0; -- int dst_pitch = 0; -+ UINT src_pitch = 0; -+ UINT dst_row_pitch, dst_slice_pitch; - - if (surface->flags & SFLAG_NONPOW2) - { - unsigned char alignment = surface->resource.device->surface_alignment; - src_pitch = format->byte_count * surface->pow2Width; -- dst_pitch = wined3d_surface_get_pitch(surface); -+ wined3d_resource_get_pitch(&surface->resource, &dst_row_pitch, &dst_slice_pitch); - src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1); - mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * surface->pow2Height); - } -@@ -1399,12 +1401,12 @@ static void surface_download_data(struct wined3d_surface *surface, const struct - * won't be released, and doesn't have to be re-read. */ - src_data = mem; - dst_data = data.addr; -- TRACE("(%p) : Repacking the surface data from pitch %d to pitch %d\n", surface, src_pitch, dst_pitch); -+ TRACE("(%p) : Repacking the surface data from pitch %d to pitch %d\n", surface, src_pitch, dst_row_pitch); - for (y = 0; y < surface->resource.height; ++y) - { -- memcpy(dst_data, src_data, dst_pitch); -+ memcpy(dst_data, src_data, dst_row_pitch); - src_data += src_pitch; -- dst_data += dst_pitch; -+ dst_data += dst_row_pitch; - } - - HeapFree(GetProcessHeap(), 0, mem); -@@ -1559,7 +1561,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P - UINT update_w, update_h; - UINT dst_w, dst_h; - RECT r, dst_rect; -- UINT src_pitch; -+ UINT src_row_pitch, src_slice_pitch; - POINT p; - - TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n", -@@ -1647,10 +1649,10 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P - wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); - - surface_get_memory(src_surface, &data, src_surface->locations); -- src_pitch = wined3d_surface_get_pitch(src_surface); -+ wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); - - wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -- src_pitch, dst_point, FALSE, wined3d_const_bo_address(&data)); -+ src_row_pitch, dst_point, FALSE, wined3d_const_bo_address(&data)); - - context_release(context); - -@@ -1931,25 +1933,6 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface) - return WINED3D_OK; - } - --DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface) --{ -- unsigned int alignment; -- DWORD pitch; -- -- TRACE("surface %p.\n", surface); -- -- if (surface->pitch) -- return surface->pitch; -- -- alignment = surface->resource.device->surface_alignment; -- pitch = wined3d_format_calculate_pitch(surface->resource.format, surface->resource.width); -- pitch = (pitch + alignment - 1) & ~(alignment - 1); -- -- TRACE("Returning %u.\n", pitch); -- -- return pitch; --} -- - HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y) - { - LONG w, h; -@@ -2130,20 +2113,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, - surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; - valid_location = WINED3D_LOCATION_USER_MEMORY; - } -- surface->pitch = pitch; -+ surface->resource.custom_row_pitch = pitch; -+ surface->resource.custom_slice_pitch = pitch * surface->resource.height; - surface->resource.format = texture_resource->format; - surface->resource.multisample_type = texture_resource->multisample_type; - surface->resource.multisample_quality = texture_resource->multisample_quality; -- if (surface->pitch) -+ if (surface->resource.custom_row_pitch) - { -- surface->resource.size = height * surface->pitch; -+ surface->resource.size = height * surface->resource.custom_row_pitch; - } - else - { - /* User memory surfaces don't have the regular surface alignment. */ -- surface->resource.size = wined3d_format_calculate_size(texture_resource->format, -- 1, width, height, 1); -- surface->pitch = wined3d_format_calculate_pitch(texture_resource->format, width); -+ surface->resource.size = wined3d_format_calculate_size(texture_resource->format, 1, width, height, 1); -+ surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width); -+ surface->resource.custom_slice_pitch = surface->resource.custom_row_pitch * surface->resource.height; /* FIXME */ - } - - /* The format might be changed to a format that needs conversion. -@@ -2763,7 +2747,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) - map_desc->row_pitch = surface->resource.width * format->byte_count; - else -- map_desc->row_pitch = wined3d_surface_get_pitch(surface); -+ wined3d_resource_get_pitch(&surface->resource, &map_desc->row_pitch, &map_desc->slice_pitch); - map_desc->slice_pitch = 0; - - if (!rect) -@@ -2890,6 +2874,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc - int i; - BOOL srcIsUpsideDown; - struct wined3d_bo_address data; -+ UINT row_pitch, slice_pitch; - - surface_get_memory(surface, &data, dst_location); - -@@ -2926,8 +2911,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc - } - - /* Setup pixel store pack state -- to glReadPixels into the correct place */ -- gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, -- wined3d_surface_get_pitch(surface) / surface->resource.format->byte_count); -+ wined3d_resource_get_pitch(&surface->resource, &row_pitch, &slice_pitch); -+ gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, row_pitch / surface->resource.format->byte_count); - checkGLcall("glPixelStorei"); - - gl_info->gl_ops.gl.p_glReadPixels(0, 0, -@@ -2944,7 +2929,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc - { - /* glReadPixels returns the image upside down, and there is no way to prevent this. - * Flip the lines in software. */ -- UINT pitch = wined3d_surface_get_pitch(surface); -+ UINT pitch, slice_pitch; -+ -+ wined3d_resource_get_pitch(&surface->resource, &pitch, &slice_pitch); - - if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) - goto error; -@@ -4125,7 +4112,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - const struct wined3d_color_key_conversion *conversion; - struct wined3d_texture *texture = surface->container; - struct wined3d_context *context; -- UINT width, src_pitch, dst_pitch; -+ UINT width, src_row_pitch, src_slice_pitch, dst_pitch; - struct wined3d_bo_address data; - struct wined3d_format format; - POINT dst_point = {0, 0}; -@@ -4213,7 +4200,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - wined3d_texture_bind_and_dirtify(texture, context, srgb); - - width = surface->resource.width; -- src_pitch = wined3d_surface_get_pitch(surface); -+ wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch); - - format = *texture->resource.format; - if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) -@@ -4251,9 +4238,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - context_release(context); - return E_OUTOFMEMORY; - } -- format.convert(data.addr, mem, src_pitch, src_pitch * height, -+ format.convert(data.addr, mem, src_row_pitch, src_row_pitch * height, - dst_pitch, dst_pitch * height, width, height, 1); -- src_pitch = dst_pitch; -+ src_row_pitch = dst_pitch; - data.addr = mem; - } - else if (conversion) -@@ -4273,14 +4260,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - } - if (texture->swapchain && texture->swapchain->palette) - palette = texture->swapchain->palette; -- conversion->convert(data.addr, src_pitch, mem, dst_pitch, -+ conversion->convert(data.addr, src_row_pitch, mem, dst_pitch, - width, height, palette, &texture->async.gl_color_key); -- src_pitch = dst_pitch; -+ src_row_pitch = dst_pitch; - data.addr = mem; - } - - wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, -- src_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); -+ src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); - - context_release(context); - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 1e039e4..f4e77fb 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -1233,7 +1233,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso - struct wined3d_const_bo_address addr; - unsigned int row_pitch, slice_pitch; - -- wined3d_volume_get_pitch(volume, &row_pitch, &slice_pitch); -+ wined3d_resource_get_pitch(sub_resource, &row_pitch, &slice_pitch); - if (row_pitch != data->row_pitch || slice_pitch != data->slice_pitch) - FIXME("Ignoring row/slice pitch (%u/%u).\n", data->row_pitch, data->slice_pitch); - -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 424938a..b672d4a 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -40,30 +40,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) - return TRUE; - } - --void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch) --{ -- const struct wined3d_format *format = volume->resource.format; -- -- if (volume->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) -- { -- /* Since compressed formats are block based, pitch means the amount of -- * bytes to the next row of block rather than the next row of pixels. */ -- UINT row_block_count = (volume->resource.width + format->block_width - 1) / format->block_width; -- UINT slice_block_count = (volume->resource.height + format->block_height - 1) / format->block_height; -- *row_pitch = row_block_count * format->block_byte_count; -- *slice_pitch = *row_pitch * slice_block_count; -- } -- else -- { -- unsigned char alignment = volume->resource.device->surface_alignment; -- *row_pitch = format->byte_count * volume->resource.width; /* Bytes / row */ -- *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1); -- *slice_pitch = *row_pitch * volume->resource.height; -- } -- -- TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); --} -- - /* This call just uploads data, the caller is responsible for binding the - * correct texture. */ - /* Context activation is done by the caller. */ -@@ -95,7 +71,7 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine - dst_row_pitch = width * format->conv_byte_count; - dst_slice_pitch = dst_row_pitch * height; - -- wined3d_volume_get_pitch(volume, &src_row_pitch, &src_slice_pitch); -+ wined3d_resource_get_pitch(&volume->resource, &src_row_pitch, &src_slice_pitch); - - converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth); - format->convert(data->addr, converted_mem, src_row_pitch, src_slice_pitch, -@@ -643,7 +619,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - } - else - { -- wined3d_volume_get_pitch(volume, &map_desc->row_pitch, &map_desc->slice_pitch); -+ wined3d_resource_get_pitch(&volume->resource, &map_desc->row_pitch, &map_desc->slice_pitch); - } - - if (!box) -diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec -index bc1129f..fcabd53 100644 ---- a/dlls/wined3d/wined3d.spec -+++ b/dlls/wined3d/wined3d.spec -@@ -182,6 +182,7 @@ - - @ cdecl wined3d_resource_get_desc(ptr ptr) - @ cdecl wined3d_resource_get_parent(ptr) -+@ cdecl wined3d_resource_get_pitch(ptr ptr ptr) - @ cdecl wined3d_resource_get_priority(ptr) - @ cdecl wined3d_resource_set_parent(ptr ptr) - @ cdecl wined3d_resource_set_priority(ptr long) -@@ -227,7 +228,6 @@ - @ cdecl wined3d_surface_get_flip_status(ptr long) - @ cdecl wined3d_surface_get_overlay_position(ptr ptr ptr) - @ cdecl wined3d_surface_get_parent(ptr) --@ cdecl wined3d_surface_get_pitch(ptr) - @ cdecl wined3d_surface_get_render_target_data(ptr ptr) - @ cdecl wined3d_surface_get_resource(ptr) - @ cdecl wined3d_surface_getdc(ptr ptr) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 0f181f3..9e6cb5e 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2136,6 +2136,7 @@ struct wined3d_resource - UINT size; - DWORD priority; - void *heap_memory; -+ UINT custom_row_pitch, custom_slice_pitch; - struct list resource_list_entry; - - void *parent; -@@ -2300,7 +2301,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN - HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, - unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; - void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; --void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch) DECLSPEC_HIDDEN; - void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, - BOOL srgb_mode) DECLSPEC_HIDDEN; - void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; -@@ -2350,7 +2350,6 @@ struct wined3d_surface - - DWORD flags; - -- UINT pitch; - UINT pow2Width; - UINT pow2Height; - -diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h -index a1803bb..fc91d02 100644 ---- a/include/wine/wined3d.h -+++ b/include/wine/wined3d.h -@@ -2427,6 +2427,8 @@ static inline HRESULT wined3d_private_store_set_private_data(struct wined3d_priv - void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource, - struct wined3d_resource_desc *desc); - void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource); -+void __cdecl wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, -+ UINT *slice_pitch); - DWORD __cdecl wined3d_resource_get_priority(const struct wined3d_resource *resource); - void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent); - DWORD __cdecl wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority); -@@ -2485,7 +2487,6 @@ HRESULT __cdecl wined3d_surface_get_blt_status(const struct wined3d_surface *sur - HRESULT __cdecl wined3d_surface_get_flip_status(const struct wined3d_surface *surface, DWORD flags); - HRESULT __cdecl wined3d_surface_get_overlay_position(const struct wined3d_surface *surface, LONG *x, LONG *y); - void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface); --DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface); - HRESULT __cdecl wined3d_surface_get_render_target_data(struct wined3d_surface *surface, - struct wined3d_surface *render_target); - struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface); --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0002-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0002-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0002-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Helper/0002-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -From 437012ece4738ad5cea694b2a6c2759927074ebe Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 14 Dec 2014 20:49:28 +0100 -Subject: wined3d: Add second dll with STAGING_CSMT definition set. - ---- - configure.ac | 1 + - dlls/wined3d-csmt/Makefile.in | 38 ++++++++++++++++++++++++++++++++++++++ - dlls/wined3d-csmt/version.rc | 27 +++++++++++++++++++++++++++ - 3 files changed, 66 insertions(+) - create mode 100644 dlls/wined3d-csmt/Makefile.in - create mode 100644 dlls/wined3d-csmt/version.rc - -diff --git a/configure.ac b/configure.ac -index e5fb209..7394424 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3318,6 +3318,7 @@ WINE_CONFIG_TEST(dlls/windowscodecsext/tests) - WINE_CONFIG_DLL(winealsa.drv) - WINE_CONFIG_DLL(winecoreaudio.drv) - WINE_CONFIG_LIB(winecrt0) -+WINE_CONFIG_DLL(wined3d-csmt) - WINE_CONFIG_DLL(wined3d,,[implib]) - WINE_CONFIG_DLL(winegstreamer) - WINE_CONFIG_DLL(winejoystick.drv) -diff --git a/dlls/wined3d-csmt/Makefile.in b/dlls/wined3d-csmt/Makefile.in -new file mode 100644 -index 0000000..3a401a0 ---- /dev/null -+++ b/dlls/wined3d-csmt/Makefile.in -@@ -0,0 +1,38 @@ -+EXTRADEFS = -DSTAGING_CSMT -+MODULE = wined3d-csmt.dll -+IMPORTS = uuid opengl32 user32 gdi32 advapi32 -+PARENTSRC = ../wined3d -+PARENTSPEC = ../wined3d/wined3d.spec -+ -+C_SRCS = \ -+ arb_program_shader.c \ -+ ati_fragment_shader.c \ -+ buffer.c \ -+ context.c \ -+ cs.c \ -+ device.c \ -+ directx.c \ -+ drawprim.c \ -+ dxtn.c \ -+ gl_compat.c \ -+ glsl_shader.c \ -+ nvidia_texture_shader.c \ -+ palette.c \ -+ query.c \ -+ resource.c \ -+ sampler.c \ -+ shader.c \ -+ shader_sm1.c \ -+ shader_sm4.c \ -+ state.c \ -+ stateblock.c \ -+ surface.c \ -+ swapchain.c \ -+ texture.c \ -+ utils.c \ -+ vertexdeclaration.c \ -+ view.c \ -+ volume.c \ -+ wined3d_main.c -+ -+RC_SRCS = version.rc -diff --git a/dlls/wined3d-csmt/version.rc b/dlls/wined3d-csmt/version.rc -new file mode 100644 -index 0000000..0439375 ---- /dev/null -+++ b/dlls/wined3d-csmt/version.rc -@@ -0,0 +1,27 @@ -+/* -+ * Copyright 2009 Austin English -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#include "config.h" /* Needed to get PACKAGE_VERSION */ -+ -+#define WINE_FILEDESCRIPTION_STR "Wine D3D" -+#define WINE_FILENAME_STR "wined3d.dll" -+#define WINE_FILEVERSION_STR PACKAGE_VERSION -+#define WINE_PRODUCTVERSION_STR PACKAGE_VERSION -+#define WINE_PRODUCTNAME_STR "Wine D3D" -+ -+#include "wine/wine_common_ver.rc" --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0001-wined3d-Pass-a-context-to-surface_load_sysmem.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0001-wined3d-Pass-a-context-to-surface_load_sysmem.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0001-wined3d-Pass-a-context-to-surface_load_sysmem.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0001-wined3d-Pass-a-context-to-surface_load_sysmem.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -From d802d551603f20fde872cf45d43064426bea4434 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 17 Nov 2013 19:10:18 +0100 -Subject: wined3d: Pass a context to surface_load_sysmem. - ---- - dlls/wined3d/surface.c | 22 +++++++++++----------- - 1 file changed, 11 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index d9b1846..3877139 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -4010,9 +4010,12 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD - memcpy(dst.addr, src.addr, size); - } - -+/* Context activation is done by the caller. */ - static void surface_load_sysmem(struct wined3d_surface *surface, -- const struct wined3d_gl_info *gl_info, DWORD dst_location) -+ struct wined3d_context *context, DWORD dst_location) - { -+ const struct wined3d_gl_info *gl_info = context->gl_info; -+ - if (surface->locations & surface_simple_locations) - { - surface_copy_simple_location(surface, dst_location); -@@ -4025,18 +4028,10 @@ static void surface_load_sysmem(struct wined3d_surface *surface, - /* Download the surface to system memory. */ - if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - { -- struct wined3d_device *device = surface->resource.device; -- struct wined3d_context *context; -- -- /* TODO: Use already acquired context when possible. */ -- context = context_acquire(device, NULL); -- - wined3d_texture_bind_and_dirtify(surface->container, context, - !(surface->locations & WINED3D_LOCATION_TEXTURE_RGB)); - surface_download_data(surface, gl_info, dst_location); - -- context_release(context); -- - return; - } - -@@ -4266,6 +4261,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) - struct wined3d_device *device = surface->resource.device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - HRESULT hr; -+ struct wined3d_context *context = NULL; - - TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); - -@@ -4274,7 +4270,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) - if (location == WINED3D_LOCATION_TEXTURE_RGB - && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) - { -- struct wined3d_context *context = context_acquire(device, NULL); -+ context = context_acquire(device, NULL); - surface_load_ds_location(surface, context, location); - context_release(context); - return WINED3D_OK; -@@ -4320,7 +4316,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) - case WINED3D_LOCATION_USER_MEMORY: - case WINED3D_LOCATION_SYSMEM: - case WINED3D_LOCATION_BUFFER: -- surface_load_sysmem(surface, gl_info, location); -+ if (device->d3d_initialized) -+ context = context_acquire(device, NULL); -+ surface_load_sysmem(surface, context, location); -+ if (context) -+ context_release(context); - break; - - case WINED3D_LOCATION_DRAWABLE: --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0001-wined3d-Properly-initialize-format_flags-for-surface.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0001-wined3d-Properly-initialize-format_flags-for-surface.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0001-wined3d-Properly-initialize-format_flags-for-surface.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0001-wined3d-Properly-initialize-format_flags-for-surface.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,38 @@ +From 8dc59ef56211678a681315041c0fd23bd490ad25 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Wed, 29 Jul 2015 06:35:07 +0200 +Subject: wined3d: Properly initialize format_flags for surfaces and volumes. + +--- + dlls/wined3d/surface.c | 2 ++ + dlls/wined3d/volume.c | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 3b033db..38a233d 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -5603,6 +5603,8 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text + } + + surface->container = container; ++ surface->resource.format_flags = container->resource.format_flags; ++ + surface_validate_location(surface, WINED3D_LOCATION_SYSMEM); + list_init(&surface->renderbuffers); + list_init(&surface->overlays); +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 424938a..4e1c415 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -779,6 +779,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture + } + + volume->container = container; ++ volume->resource.format_flags = container->resource.format_flags; + + return WINED3D_OK; + } +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0002-wined3d-Merge-get_pitch-functions.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0002-wined3d-Merge-get_pitch-functions.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0002-wined3d-Merge-get_pitch-functions.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0002-wined3d-Merge-get_pitch-functions.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,381 @@ +From fb1391dc1f2274d4336846720bb9869a3b751b0c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 19 Sep 2013 14:22:24 +0200 +Subject: wined3d: Merge get_pitch functions. + +--- + dlls/wined3d/resource.c | 31 ++++++++++++++++ + dlls/wined3d/surface.c | 81 ++++++++++++++++++++---------------------- + dlls/wined3d/texture.c | 2 +- + dlls/wined3d/volume.c | 28 ++------------- + dlls/wined3d/wined3d_private.h | 5 +-- + 5 files changed, 75 insertions(+), 72 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 1891165..0968cd2 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -414,3 +414,34 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) + else + resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB; + } ++ ++void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, ++ UINT *slice_pitch) ++{ ++ unsigned int alignment; ++ const struct wined3d_format *format = resource->format; ++ ++ if (resource->custom_row_pitch) ++ { ++ *row_pitch = resource->custom_row_pitch; ++ *slice_pitch = resource->custom_slice_pitch; ++ return; ++ } ++ ++ alignment = resource->device->surface_alignment; ++ *row_pitch = wined3d_format_calculate_pitch(resource->format, resource->width); ++ *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1); ++ if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_BLOCKS) ++ { ++ /* Since compressed formats are block based, pitch means the amount of ++ * bytes to the next row of block rather than the next row of pixels. */ ++ UINT slice_block_count = (resource->height + format->block_height - 1) / format->block_height; ++ *slice_pitch = *row_pitch * slice_block_count; ++ } ++ else ++ { ++ *slice_pitch = *row_pitch * resource->height; ++ } ++ ++ TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); ++} +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 3b033db..bb2278d 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -364,6 +364,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) + BITMAPINFO *b_info; + int extraline = 0; + DWORD *masks; ++ UINT row_pitch, slice_pitch; + + TRACE("surface %p.\n", surface); + +@@ -409,10 +410,11 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) + + b_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + /* TODO: Is there a nicer way to force a specific alignment? (8 byte for ddraw) */ +- b_info->bmiHeader.biWidth = wined3d_surface_get_pitch(surface) / format->byte_count; ++ wined3d_resource_get_pitch(&surface->resource, &row_pitch, &slice_pitch); ++ b_info->bmiHeader.biWidth = row_pitch / format->byte_count; + b_info->bmiHeader.biHeight = 0 - surface->resource.height - extraline; + b_info->bmiHeader.biSizeImage = (surface->resource.height + extraline) +- * wined3d_surface_get_pitch(surface); ++ * row_pitch; + b_info->bmiHeader.biPlanes = 1; + b_info->bmiHeader.biBitCount = format->byte_count * 8; + +@@ -1305,14 +1307,14 @@ static void surface_download_data(struct wined3d_surface *surface, const struct + void *mem; + GLenum gl_format = format->glFormat; + GLenum gl_type = format->glType; +- int src_pitch = 0; +- int dst_pitch = 0; ++ UINT src_pitch = 0; ++ UINT dst_row_pitch, dst_slice_pitch; + + if (surface->flags & SFLAG_NONPOW2) + { + unsigned char alignment = surface->resource.device->surface_alignment; + src_pitch = format->byte_count * surface->pow2Width; +- dst_pitch = wined3d_surface_get_pitch(surface); ++ wined3d_resource_get_pitch(&surface->resource, &dst_row_pitch, &dst_slice_pitch); + src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1); + mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * surface->pow2Height); + } +@@ -1399,12 +1401,12 @@ static void surface_download_data(struct wined3d_surface *surface, const struct + * won't be released, and doesn't have to be re-read. */ + src_data = mem; + dst_data = data.addr; +- TRACE("(%p) : Repacking the surface data from pitch %d to pitch %d\n", surface, src_pitch, dst_pitch); ++ TRACE("(%p) : Repacking the surface data from pitch %d to pitch %d\n", surface, src_pitch, dst_row_pitch); + for (y = 0; y < surface->resource.height; ++y) + { +- memcpy(dst_data, src_data, dst_pitch); ++ memcpy(dst_data, src_data, dst_row_pitch); + src_data += src_pitch; +- dst_data += dst_pitch; ++ dst_data += dst_row_pitch; + } + + HeapFree(GetProcessHeap(), 0, mem); +@@ -1559,7 +1561,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P + UINT update_w, update_h; + UINT dst_w, dst_h; + RECT r, dst_rect; +- UINT src_pitch; ++ UINT src_row_pitch, src_slice_pitch; + POINT p; + + TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n", +@@ -1647,10 +1649,10 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P + wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); + + surface_get_memory(src_surface, &data, src_surface->locations); +- src_pitch = wined3d_surface_get_pitch(src_surface); ++ wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); + + wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, +- src_pitch, dst_point, FALSE, wined3d_const_bo_address(&data)); ++ src_row_pitch, dst_point, FALSE, wined3d_const_bo_address(&data)); + + context_release(context); + +@@ -1933,21 +1935,10 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface) + + DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface) + { +- unsigned int alignment; +- DWORD pitch; +- +- TRACE("surface %p.\n", surface); +- +- if (surface->pitch) +- return surface->pitch; +- +- alignment = surface->resource.device->surface_alignment; +- pitch = wined3d_format_calculate_pitch(surface->resource.format, surface->resource.width); +- pitch = (pitch + alignment - 1) & ~(alignment - 1); +- +- TRACE("Returning %u.\n", pitch); +- +- return pitch; ++ UINT row_pitch, slice_pitch; ++ const struct wined3d_resource *resource = &surface->resource; ++ wined3d_resource_get_pitch(resource, &row_pitch, &slice_pitch); ++ return row_pitch; + } + + HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y) +@@ -2109,20 +2100,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, + surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; + valid_location = WINED3D_LOCATION_USER_MEMORY; + } +- surface->pitch = pitch; ++ surface->resource.custom_row_pitch = pitch; ++ surface->resource.custom_slice_pitch = pitch * surface->resource.height; + surface->resource.format = texture_resource->format; + surface->resource.multisample_type = texture_resource->multisample_type; + surface->resource.multisample_quality = texture_resource->multisample_quality; +- if (surface->pitch) ++ if (surface->resource.custom_row_pitch) + { +- surface->resource.size = height * surface->pitch; ++ surface->resource.size = height * surface->resource.custom_row_pitch; + } + else + { + /* User memory surfaces don't have the regular surface alignment. */ +- surface->resource.size = wined3d_format_calculate_size(texture_resource->format, +- 1, width, height, 1); +- surface->pitch = wined3d_format_calculate_pitch(texture_resource->format, width); ++ surface->resource.size = wined3d_format_calculate_size(texture_resource->format, 1, width, height, 1); ++ surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width); ++ surface->resource.custom_slice_pitch = surface->resource.custom_row_pitch * surface->resource.height; /* FIXME */ + } + + /* The format might be changed to a format that needs conversion. +@@ -2742,7 +2734,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + map_desc->row_pitch = surface->resource.width * format->byte_count; + else +- map_desc->row_pitch = wined3d_surface_get_pitch(surface); ++ wined3d_resource_get_pitch(&surface->resource, &map_desc->row_pitch, &map_desc->slice_pitch); + map_desc->slice_pitch = 0; + + if (!rect) +@@ -2869,6 +2861,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc + int i; + BOOL srcIsUpsideDown; + struct wined3d_bo_address data; ++ UINT row_pitch, slice_pitch; + + surface_get_memory(surface, &data, dst_location); + +@@ -2905,8 +2898,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc + } + + /* Setup pixel store pack state -- to glReadPixels into the correct place */ +- gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, +- wined3d_surface_get_pitch(surface) / surface->resource.format->byte_count); ++ wined3d_resource_get_pitch(&surface->resource, &row_pitch, &slice_pitch); ++ gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, row_pitch / surface->resource.format->byte_count); + checkGLcall("glPixelStorei"); + + gl_info->gl_ops.gl.p_glReadPixels(0, 0, +@@ -2923,7 +2916,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc + { + /* glReadPixels returns the image upside down, and there is no way to prevent this. + * Flip the lines in software. */ +- UINT pitch = wined3d_surface_get_pitch(surface); ++ UINT pitch, slice_pitch; ++ ++ wined3d_resource_get_pitch(&surface->resource, &pitch, &slice_pitch); + + if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) + goto error; +@@ -4107,7 +4102,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + const struct wined3d_color_key_conversion *conversion; + struct wined3d_texture *texture = surface->container; + struct wined3d_context *context; +- UINT width, src_pitch, dst_pitch; ++ UINT width, src_row_pitch, src_slice_pitch, dst_pitch; + struct wined3d_bo_address data; + struct wined3d_format format; + POINT dst_point = {0, 0}; +@@ -4195,7 +4190,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + wined3d_texture_bind_and_dirtify(texture, context, srgb); + + width = surface->resource.width; +- src_pitch = wined3d_surface_get_pitch(surface); ++ wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch); + + format = *texture->resource.format; + if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) +@@ -4233,9 +4228,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + context_release(context); + return E_OUTOFMEMORY; + } +- format.convert(data.addr, mem, src_pitch, src_pitch * height, ++ format.convert(data.addr, mem, src_row_pitch, src_row_pitch * height, + dst_pitch, dst_pitch * height, width, height, 1); +- src_pitch = dst_pitch; ++ src_row_pitch = dst_pitch; + data.addr = mem; + } + else if (conversion) +@@ -4255,14 +4250,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + } + if (texture->swapchain && texture->swapchain->palette) + palette = texture->swapchain->palette; +- conversion->convert(data.addr, src_pitch, mem, dst_pitch, ++ conversion->convert(data.addr, src_row_pitch, mem, dst_pitch, + width, height, palette, &texture->async.gl_color_key); +- src_pitch = dst_pitch; ++ src_row_pitch = dst_pitch; + data.addr = mem; + } + + wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, +- src_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); ++ src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); + + context_release(context); + +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 1e039e4..f4e77fb 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -1233,7 +1233,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso + struct wined3d_const_bo_address addr; + unsigned int row_pitch, slice_pitch; + +- wined3d_volume_get_pitch(volume, &row_pitch, &slice_pitch); ++ wined3d_resource_get_pitch(sub_resource, &row_pitch, &slice_pitch); + if (row_pitch != data->row_pitch || slice_pitch != data->slice_pitch) + FIXME("Ignoring row/slice pitch (%u/%u).\n", data->row_pitch, data->slice_pitch); + +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 424938a..b672d4a 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -40,30 +40,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) + return TRUE; + } + +-void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch) +-{ +- const struct wined3d_format *format = volume->resource.format; +- +- if (volume->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) +- { +- /* Since compressed formats are block based, pitch means the amount of +- * bytes to the next row of block rather than the next row of pixels. */ +- UINT row_block_count = (volume->resource.width + format->block_width - 1) / format->block_width; +- UINT slice_block_count = (volume->resource.height + format->block_height - 1) / format->block_height; +- *row_pitch = row_block_count * format->block_byte_count; +- *slice_pitch = *row_pitch * slice_block_count; +- } +- else +- { +- unsigned char alignment = volume->resource.device->surface_alignment; +- *row_pitch = format->byte_count * volume->resource.width; /* Bytes / row */ +- *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1); +- *slice_pitch = *row_pitch * volume->resource.height; +- } +- +- TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); +-} +- + /* This call just uploads data, the caller is responsible for binding the + * correct texture. */ + /* Context activation is done by the caller. */ +@@ -95,7 +71,7 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine + dst_row_pitch = width * format->conv_byte_count; + dst_slice_pitch = dst_row_pitch * height; + +- wined3d_volume_get_pitch(volume, &src_row_pitch, &src_slice_pitch); ++ wined3d_resource_get_pitch(&volume->resource, &src_row_pitch, &src_slice_pitch); + + converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth); + format->convert(data->addr, converted_mem, src_row_pitch, src_slice_pitch, +@@ -643,7 +619,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + } + else + { +- wined3d_volume_get_pitch(volume, &map_desc->row_pitch, &map_desc->slice_pitch); ++ wined3d_resource_get_pitch(&volume->resource, &map_desc->row_pitch, &map_desc->slice_pitch); + } + + if (!box) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 5786db0..7f989dc 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2162,6 +2162,7 @@ struct wined3d_resource + UINT size; + DWORD priority; + void *heap_memory; ++ UINT custom_row_pitch, custom_slice_pitch; + struct list resource_list_entry; + + void *parent; +@@ -2189,6 +2190,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * + void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, ++ UINT *slice_pitch) DECLSPEC_HIDDEN; + GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; + GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; + BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; +@@ -2326,7 +2329,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN + HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, + unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; + void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; +-void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch) DECLSPEC_HIDDEN; + void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, + BOOL srgb_mode) DECLSPEC_HIDDEN; + void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; +@@ -2376,7 +2378,6 @@ struct wined3d_surface + + DWORD flags; + +- UINT pitch; + UINT pow2Width; + UINT pow2Height; + +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -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. - -In the average case the function will not be able to reuse it, because -it requires a specific context to access the WGL framebuffer. It will -restore the original context afterwards to hide the context change from -load_location / preload callers. This is related to bug 34574. ---- - dlls/wined3d/surface.c | 29 +++++++++++++++++++++++++---- - 1 file changed, 25 insertions(+), 4 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 534a152..534d4bd 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -2935,11 +2935,13 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) - return WINED3D_OK; - } - --static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_location) -+static void read_from_framebuffer(struct wined3d_surface *surface, -+ struct wined3d_context *old_ctx, DWORD dst_location) - { - struct wined3d_device *device = surface->resource.device; - const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; -+ struct wined3d_surface *restore_rt; - BYTE *mem; - BYTE *row, *top, *bottom; - int i; -@@ -2948,7 +2950,21 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc - - surface_get_memory(surface, &data, dst_location); - -- context = context_acquire(device, surface); -+ /* Context_release does not restore the original context in case of -+ * nested context_acquire calls. Only read_from_framebuffer and -+ * surface_blt_to_drawable use nested context_acquire calls. Manually -+ * restore the original context at the end of the function if needed. */ -+ if (old_ctx->current_rt == surface) -+ { -+ restore_rt = NULL; -+ context = old_ctx; -+ } -+ else -+ { -+ restore_rt = old_ctx->current_rt; -+ context = context_acquire(device, surface); -+ } -+ - context_apply_blit_state(context, device); - gl_info = context->gl_info; - -@@ -3036,7 +3052,12 @@ error: - checkGLcall("glBindBuffer"); - } - -- context_release(context); -+ if (restore_rt) -+ { -+ context_release(context); -+ context = context_acquire(device, restore_rt); -+ context_release(context); -+ } - } - - /* Read the framebuffer contents into a texture. Note that this function -@@ -4191,7 +4212,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, - - if (surface->locations & WINED3D_LOCATION_DRAWABLE) - { -- read_from_framebuffer(surface, dst_location); -+ read_from_framebuffer(surface, context, dst_location); - return; - } - --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -From f322a8e12cfa32650bcbb970f41a84c2430ac00e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 17 Nov 2013 19:34:26 +0100 -Subject: wined3d: Pass a context to surface_load_drawable and - surface_blt_to_drawable. - ---- - dlls/wined3d/surface.c | 40 ++++++++++++++++++++++++++++++++++------ - 1 file changed, 34 insertions(+), 6 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 4e2063f..1f97857 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -3533,19 +3533,35 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW - rect->bottom = drawable_height - rect->bottom; - } - -+/* Context activation is done by the caller. */ - static void surface_blt_to_drawable(const struct wined3d_device *device, -+ struct wined3d_context *old_ctx, - enum wined3d_texture_filter_type filter, BOOL alpha_test, - struct wined3d_surface *src_surface, const RECT *src_rect_in, - struct wined3d_surface *dst_surface, const RECT *dst_rect_in) - { - const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; -+ struct wined3d_surface *restore_rt; - RECT src_rect, dst_rect; - - src_rect = *src_rect_in; - dst_rect = *dst_rect_in; - -- context = context_acquire(device, dst_surface); -+ /* Context_release does not restore the original context in case of -+ * nested context_acquire calls. Only read_from_framebuffer and -+ * surface_blt_to_drawable use nested context_acquire calls. Manually -+ * restore the original context at the end of the function if needed. */ -+ if (old_ctx->current_rt == dst_surface) -+ { -+ restore_rt = NULL; -+ context = old_ctx; -+ } -+ else -+ { -+ restore_rt = old_ctx->current_rt; -+ context = context_acquire(device, dst_surface); -+ } - gl_info = context->gl_info; - - /* Make sure the surface is up-to-date. This should probably use -@@ -3598,7 +3614,12 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, - && dst_surface->container->swapchain->front_buffer == dst_surface->container)) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - -- context_release(context); -+ if (restore_rt) -+ { -+ context_release(context); -+ context = context_acquire(device, restore_rt); -+ context_release(context); -+ } - } - - HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) -@@ -4095,8 +4116,9 @@ static void surface_load_sysmem(struct wined3d_surface *surface, - surface, wined3d_debug_location(surface->locations)); - } - -+/* Context activation is done by the caller. */ - static HRESULT surface_load_drawable(struct wined3d_surface *surface, -- const struct wined3d_gl_info *gl_info) -+ struct wined3d_context *context) - { - RECT r; - -@@ -4109,7 +4131,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, - - surface_get_rect(surface, NULL, &r); - surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); -- surface_blt_to_drawable(surface->resource.device, -+ surface_blt_to_drawable(surface->resource.device, context, - WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); - - return WINED3D_OK; -@@ -4367,7 +4389,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) - break; - - case WINED3D_LOCATION_DRAWABLE: -- if (FAILED(hr = surface_load_drawable(surface, gl_info))) -+ context = context_acquire(device, NULL); -+ hr = surface_load_drawable(surface, context); -+ context_release(context); -+ if (FAILED(hr)) - return hr; - break; - -@@ -4546,13 +4571,16 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter, - /* Blit from offscreen surface to render target */ - struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key; - DWORD old_color_key_flags = src_surface->container->async.color_key_flags; -+ struct wined3d_context *context; - - TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); - - wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, color_key); - -- surface_blt_to_drawable(device, filter, -+ context = context_acquire(device, dst_surface); -+ surface_blt_to_drawable(device, context, filter, - !!color_key, src_surface, src_rect, dst_surface, dst_rect); -+ context_release(context); - - /* Restore the color key parameters */ - wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_sysmem.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_sysmem.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_sysmem.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_sysmem.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,79 @@ +From d802d551603f20fde872cf45d43064426bea4434 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 17 Nov 2013 19:10:18 +0100 +Subject: wined3d: Pass a context to surface_load_sysmem. + +--- + dlls/wined3d/surface.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index d9b1846..3877139 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -4010,9 +4010,12 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD + memcpy(dst.addr, src.addr, size); + } + ++/* Context activation is done by the caller. */ + static void surface_load_sysmem(struct wined3d_surface *surface, +- const struct wined3d_gl_info *gl_info, DWORD dst_location) ++ struct wined3d_context *context, DWORD dst_location) + { ++ const struct wined3d_gl_info *gl_info = context->gl_info; ++ + if (surface->locations & surface_simple_locations) + { + surface_copy_simple_location(surface, dst_location); +@@ -4025,18 +4028,10 @@ static void surface_load_sysmem(struct wined3d_surface *surface, + /* Download the surface to system memory. */ + if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + { +- struct wined3d_device *device = surface->resource.device; +- struct wined3d_context *context; +- +- /* TODO: Use already acquired context when possible. */ +- context = context_acquire(device, NULL); +- + wined3d_texture_bind_and_dirtify(surface->container, context, + !(surface->locations & WINED3D_LOCATION_TEXTURE_RGB)); + surface_download_data(surface, gl_info, dst_location); + +- context_release(context); +- + return; + } + +@@ -4266,6 +4261,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) + struct wined3d_device *device = surface->resource.device; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + HRESULT hr; ++ struct wined3d_context *context = NULL; + + TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); + +@@ -4274,7 +4270,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) + if (location == WINED3D_LOCATION_TEXTURE_RGB + && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) + { +- struct wined3d_context *context = context_acquire(device, NULL); ++ context = context_acquire(device, NULL); + surface_load_ds_location(surface, context, location); + context_release(context); + return WINED3D_OK; +@@ -4320,7 +4316,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) + case WINED3D_LOCATION_USER_MEMORY: + case WINED3D_LOCATION_SYSMEM: + case WINED3D_LOCATION_BUFFER: +- surface_load_sysmem(surface, gl_info, location); ++ if (device->d3d_initialized) ++ context = context_acquire(device, NULL); ++ surface_load_sysmem(surface, context, location); ++ if (context) ++ context_release(context); + break; + + case WINED3D_LOCATION_DRAWABLE: +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-read_from_framebuffer.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-read_from_framebuffer.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-read_from_framebuffer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-read_from_framebuffer.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,81 @@ +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. + +In the average case the function will not be able to reuse it, because +it requires a specific context to access the WGL framebuffer. It will +restore the original context afterwards to hide the context change from +load_location / preload callers. This is related to bug 34574. +--- + dlls/wined3d/surface.c | 29 +++++++++++++++++++++++++---- + 1 file changed, 25 insertions(+), 4 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 534a152..534d4bd 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -2935,11 +2935,13 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) + return WINED3D_OK; + } + +-static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_location) ++static void read_from_framebuffer(struct wined3d_surface *surface, ++ struct wined3d_context *old_ctx, DWORD dst_location) + { + struct wined3d_device *device = surface->resource.device; + const struct wined3d_gl_info *gl_info; + struct wined3d_context *context; ++ struct wined3d_surface *restore_rt; + BYTE *mem; + BYTE *row, *top, *bottom; + int i; +@@ -2948,7 +2950,21 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc + + surface_get_memory(surface, &data, dst_location); + +- context = context_acquire(device, surface); ++ /* Context_release does not restore the original context in case of ++ * nested context_acquire calls. Only read_from_framebuffer and ++ * surface_blt_to_drawable use nested context_acquire calls. Manually ++ * restore the original context at the end of the function if needed. */ ++ if (old_ctx->current_rt == surface) ++ { ++ restore_rt = NULL; ++ context = old_ctx; ++ } ++ else ++ { ++ restore_rt = old_ctx->current_rt; ++ context = context_acquire(device, surface); ++ } ++ + context_apply_blit_state(context, device); + gl_info = context->gl_info; + +@@ -3036,7 +3052,12 @@ error: + checkGLcall("glBindBuffer"); + } + +- context_release(context); ++ if (restore_rt) ++ { ++ context_release(context); ++ context = context_acquire(device, restore_rt); ++ context_release(context); ++ } + } + + /* Read the framebuffer contents into a texture. Note that this function +@@ -4191,7 +4212,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, + + if (surface->locations & WINED3D_LOCATION_DRAWABLE) + { +- read_from_framebuffer(surface, dst_location); ++ read_from_framebuffer(surface, context, dst_location); + return; + } + +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_blt_fbo.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_blt_fbo.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_blt_fbo.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_blt_fbo.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -From 0d11e8c92575dae298bcf9b830ef155689823c04 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 17 Nov 2013 19:49:38 +0100 -Subject: wined3d: Pass a context to surface_blt_fbo. - ---- - dlls/wined3d/surface.c | 53 +++++++++++++++++++++++++++++++++++++++----------- - 1 file changed, 42 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index f4b9071..8ca5bda 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -860,13 +860,15 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, - } - - /* Blit between surface locations. Onscreen on different swapchains is not supported. -- * Depth / stencil is not supported. */ --static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_texture_filter_type filter, -+ * Depth / stencil is not supported. Context activation is done by the caller. */ -+static void surface_blt_fbo(const struct wined3d_device *device, -+ struct wined3d_context *old_ctx, enum wined3d_texture_filter_type filter, - struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect_in, - struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect_in) - { - const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; -+ struct wined3d_surface *required_rt, *restore_rt; - RECT src_rect, dst_rect; - GLenum gl_filter; - GLenum buffer; -@@ -909,9 +911,20 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te - if (!surface_is_full_rect(dst_surface, &dst_rect)) - surface_load_location(dst_surface, dst_location); - -- if (src_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, src_surface); -- else if (dst_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, dst_surface); -- else context = context_acquire(device, NULL); -+ if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface; -+ else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface; -+ else required_rt = NULL; -+ -+ if (required_rt && required_rt != old_ctx->current_rt) -+ { -+ restore_rt = old_ctx->current_rt; -+ context = context_acquire(device, required_rt); -+ } -+ else -+ { -+ restore_rt = NULL; -+ context = old_ctx; -+ } - - if (!context->valid) - { -@@ -974,7 +987,12 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te - && dst_surface->container->swapchain->front_buffer == dst_surface->container)) - gl_info->gl_ops.gl.p_glFlush(); - -- context_release(context); -+ if (restore_rt) -+ { -+ context_release(context); -+ context = context_acquire(device, restore_rt); -+ context_release(context); -+ } - } - - static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined3d_blit_op blit_op, -@@ -4294,13 +4312,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, - NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) - { -+ context = context_acquire(device, NULL); -+ - if (srgb) -- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, -+ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, - &src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect); - else -- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB, -+ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB, - &src_rect, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect); - -+ context_release(context); -+ - return WINED3D_OK; - } - -@@ -4315,8 +4337,10 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; - RECT rect = {0, 0, surface->resource.width, surface->resource.height}; - -- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, src_location, -+ context = context_acquire(device, NULL); -+ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, - &rect, surface, dst_location, &rect); -+ context_release(context); - - return WINED3D_OK; - } -@@ -4447,14 +4471,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - - static void surface_multisample_resolve(struct wined3d_surface *surface) - { -+ struct wined3d_context *context; - RECT rect = {0, 0, surface->resource.width, surface->resource.height}; - - if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE)) - ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n", - surface); - -- surface_blt_fbo(surface->resource.device, WINED3D_TEXF_POINT, -+ context = context_acquire(surface->resource.device, NULL); -+ surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT, - surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect); -+ context_release(context); - } - - HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) -@@ -5629,11 +5656,15 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, - &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) - { -+ struct wined3d_context *context; - TRACE("Using FBO blit.\n"); - -- surface_blt_fbo(device, filter, -+ context = context_acquire(device, NULL); -+ surface_blt_fbo(device, context, filter, - src_surface, src_surface->container->resource.draw_binding, &src_rect, - dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); -+ context_release(context); -+ - surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); - surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); - --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,118 @@ +From f322a8e12cfa32650bcbb970f41a84c2430ac00e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 17 Nov 2013 19:34:26 +0100 +Subject: wined3d: Pass a context to surface_load_drawable and + surface_blt_to_drawable. + +--- + dlls/wined3d/surface.c | 40 ++++++++++++++++++++++++++++++++++------ + 1 file changed, 34 insertions(+), 6 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 4e2063f..1f97857 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -3533,19 +3533,35 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW + rect->bottom = drawable_height - rect->bottom; + } + ++/* Context activation is done by the caller. */ + static void surface_blt_to_drawable(const struct wined3d_device *device, ++ struct wined3d_context *old_ctx, + enum wined3d_texture_filter_type filter, BOOL alpha_test, + struct wined3d_surface *src_surface, const RECT *src_rect_in, + struct wined3d_surface *dst_surface, const RECT *dst_rect_in) + { + const struct wined3d_gl_info *gl_info; + struct wined3d_context *context; ++ struct wined3d_surface *restore_rt; + RECT src_rect, dst_rect; + + src_rect = *src_rect_in; + dst_rect = *dst_rect_in; + +- context = context_acquire(device, dst_surface); ++ /* Context_release does not restore the original context in case of ++ * nested context_acquire calls. Only read_from_framebuffer and ++ * surface_blt_to_drawable use nested context_acquire calls. Manually ++ * restore the original context at the end of the function if needed. */ ++ if (old_ctx->current_rt == dst_surface) ++ { ++ restore_rt = NULL; ++ context = old_ctx; ++ } ++ else ++ { ++ restore_rt = old_ctx->current_rt; ++ context = context_acquire(device, dst_surface); ++ } + gl_info = context->gl_info; + + /* Make sure the surface is up-to-date. This should probably use +@@ -3598,7 +3614,12 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, + && dst_surface->container->swapchain->front_buffer == dst_surface->container)) + gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + +- context_release(context); ++ if (restore_rt) ++ { ++ context_release(context); ++ context = context_acquire(device, restore_rt); ++ context_release(context); ++ } + } + + HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) +@@ -4095,8 +4116,9 @@ static void surface_load_sysmem(struct wined3d_surface *surface, + surface, wined3d_debug_location(surface->locations)); + } + ++/* Context activation is done by the caller. */ + static HRESULT surface_load_drawable(struct wined3d_surface *surface, +- const struct wined3d_gl_info *gl_info) ++ struct wined3d_context *context) + { + RECT r; + +@@ -4109,7 +4131,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, + + surface_get_rect(surface, NULL, &r); + surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); +- surface_blt_to_drawable(surface->resource.device, ++ surface_blt_to_drawable(surface->resource.device, context, + WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); + + return WINED3D_OK; +@@ -4367,7 +4389,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) + break; + + case WINED3D_LOCATION_DRAWABLE: +- if (FAILED(hr = surface_load_drawable(surface, gl_info))) ++ context = context_acquire(device, NULL); ++ hr = surface_load_drawable(surface, context); ++ context_release(context); ++ if (FAILED(hr)) + return hr; + break; + +@@ -4546,13 +4571,16 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter, + /* Blit from offscreen surface to render target */ + struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key; + DWORD old_color_key_flags = src_surface->container->async.color_key_flags; ++ struct wined3d_context *context; + + TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); + + wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, color_key); + +- surface_blt_to_drawable(device, filter, ++ context = context_acquire(device, dst_surface); ++ surface_blt_to_drawable(device, context, filter, + !!color_key, src_surface, src_rect, dst_surface, dst_rect); ++ context_release(context); + + /* Restore the color key parameters */ + wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_multisample_resolv.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_multisample_resolv.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_multisample_resolv.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_multisample_resolv.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -From f3cecdde174e3fc350ca4a35771183695b6777de Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 17 Nov 2013 19:50:47 +0100 -Subject: wined3d: Pass a context to surface_multisample_resolve. - ---- - dlls/wined3d/surface.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index a2f8112..ee6cfdd 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -4314,19 +4314,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - return WINED3D_OK; - } - --static void surface_multisample_resolve(struct wined3d_surface *surface) -+/* Context activation is done by the caller. */ -+static void surface_multisample_resolve(struct wined3d_surface *surface, struct wined3d_context *context) - { -- struct wined3d_context *context; - RECT rect = {0, 0, surface->resource.width, surface->resource.height}; - - if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE)) - ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n", - surface); - -- context = context_acquire(surface->resource.device, NULL); - surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT, - surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect); -- context_release(context); - } - - HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) -@@ -4405,7 +4403,9 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) - break; - - case WINED3D_LOCATION_RB_RESOLVED: -- surface_multisample_resolve(surface); -+ context = context_acquire(device, NULL); -+ surface_multisample_resolve(surface, context); -+ context_release(context); - break; - - case WINED3D_LOCATION_TEXTURE_RGB: --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_blt_fbo.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_blt_fbo.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_blt_fbo.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_blt_fbo.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,140 @@ +From 0d11e8c92575dae298bcf9b830ef155689823c04 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 17 Nov 2013 19:49:38 +0100 +Subject: wined3d: Pass a context to surface_blt_fbo. + +--- + dlls/wined3d/surface.c | 53 +++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 42 insertions(+), 11 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index f4b9071..8ca5bda 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -860,13 +860,15 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, + } + + /* Blit between surface locations. Onscreen on different swapchains is not supported. +- * Depth / stencil is not supported. */ +-static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_texture_filter_type filter, ++ * Depth / stencil is not supported. Context activation is done by the caller. */ ++static void surface_blt_fbo(const struct wined3d_device *device, ++ struct wined3d_context *old_ctx, enum wined3d_texture_filter_type filter, + struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect_in, + struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect_in) + { + const struct wined3d_gl_info *gl_info; + struct wined3d_context *context; ++ struct wined3d_surface *required_rt, *restore_rt; + RECT src_rect, dst_rect; + GLenum gl_filter; + GLenum buffer; +@@ -909,9 +911,20 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te + if (!surface_is_full_rect(dst_surface, &dst_rect)) + surface_load_location(dst_surface, dst_location); + +- if (src_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, src_surface); +- else if (dst_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, dst_surface); +- else context = context_acquire(device, NULL); ++ if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface; ++ else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface; ++ else required_rt = NULL; ++ ++ if (required_rt && required_rt != old_ctx->current_rt) ++ { ++ restore_rt = old_ctx->current_rt; ++ context = context_acquire(device, required_rt); ++ } ++ else ++ { ++ restore_rt = NULL; ++ context = old_ctx; ++ } + + if (!context->valid) + { +@@ -974,7 +987,12 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te + && dst_surface->container->swapchain->front_buffer == dst_surface->container)) + gl_info->gl_ops.gl.p_glFlush(); + +- context_release(context); ++ if (restore_rt) ++ { ++ context_release(context); ++ context = context_acquire(device, restore_rt); ++ context_release(context); ++ } + } + + static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined3d_blit_op blit_op, +@@ -4294,13 +4312,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) + { ++ context = context_acquire(device, NULL); ++ + if (srgb) +- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, ++ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, + &src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect); + else +- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB, ++ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB, + &src_rect, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect); + ++ context_release(context); ++ + return WINED3D_OK; + } + +@@ -4315,8 +4337,10 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; + RECT rect = {0, 0, surface->resource.width, surface->resource.height}; + +- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, src_location, ++ context = context_acquire(device, NULL); ++ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, + &rect, surface, dst_location, &rect); ++ context_release(context); + + return WINED3D_OK; + } +@@ -4447,14 +4471,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + + static void surface_multisample_resolve(struct wined3d_surface *surface) + { ++ struct wined3d_context *context; + RECT rect = {0, 0, surface->resource.width, surface->resource.height}; + + if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE)) + ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n", + surface); + +- surface_blt_fbo(surface->resource.device, WINED3D_TEXF_POINT, ++ context = context_acquire(surface->resource.device, NULL); ++ surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT, + surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect); ++ context_release(context); + } + + HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) +@@ -5629,11 +5656,15 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, + &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) + { ++ struct wined3d_context *context; + TRACE("Using FBO blit.\n"); + +- surface_blt_fbo(device, filter, ++ context = context_acquire(device, NULL); ++ surface_blt_fbo(device, context, filter, + src_surface, src_surface->container->resource.draw_binding, &src_rect, + dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); ++ context_release(context); ++ + surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); + surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); + +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_load_texture.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_load_texture.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_load_texture.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_load_texture.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -From 4e063e06ce5bf0e641ce3f307c6cbfc891a227d4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 17 Nov 2013 19:52:56 +0100 -Subject: wined3d: Pass a context to surface_load_texture. - ---- - dlls/wined3d/surface.c | 21 ++++++--------------- - 1 file changed, 6 insertions(+), 15 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 92fe15c..6c291ad 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -4275,13 +4275,13 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, - } - - static HRESULT surface_load_texture(struct wined3d_surface *surface, -- const struct wined3d_gl_info *gl_info, BOOL srgb) -+ struct wined3d_context *context, BOOL srgb) - { -+ const struct wined3d_gl_info *gl_info = context->gl_info; - RECT src_rect = {0, 0, surface->resource.width, surface->resource.height}; - struct wined3d_device *device = surface->resource.device; - const struct wined3d_color_key_conversion *conversion; - struct wined3d_texture *texture = surface->container; -- struct wined3d_context *context; - UINT width, src_row_pitch, src_slice_pitch, dst_pitch; - struct wined3d_bo_address data; - struct wined3d_format format; -@@ -4303,8 +4303,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, - NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) - { -- context = context_acquire(device, NULL); -- - if (srgb) - surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, - &src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect); -@@ -4312,8 +4310,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB, - &src_rect, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect); - -- context_release(context); -- - return WINED3D_OK; - } - -@@ -4328,10 +4324,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; - RECT rect = {0, 0, surface->resource.width, surface->resource.height}; - -- context = context_acquire(device, NULL); - surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, - &rect, surface, dst_location, &rect); -- context_release(context); - - return WINED3D_OK; - } -@@ -4369,9 +4363,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - surface_load_location(surface, WINED3D_LOCATION_SYSMEM); - } - -- /* TODO: Use already acquired context when possible. */ -- context = context_acquire(device, NULL); -- - wined3d_texture_prepare_texture(texture, context, srgb); - wined3d_texture_bind_and_dirtify(texture, context, srgb); - -@@ -4453,8 +4444,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, - src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); - -- context_release(context); -- - HeapFree(GetProcessHeap(), 0, mem); - - return WINED3D_OK; -@@ -4476,7 +4465,6 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct - HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) - { - struct wined3d_device *device = surface->resource.device; -- const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - HRESULT hr; - struct wined3d_context *context = NULL; - -@@ -4556,7 +4544,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) - - case WINED3D_LOCATION_TEXTURE_RGB: - case WINED3D_LOCATION_TEXTURE_SRGB: -- if (FAILED(hr = surface_load_texture(surface, gl_info, location == WINED3D_LOCATION_TEXTURE_SRGB))) -+ context = context_acquire(device, NULL); -+ hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB); -+ context_release(context); -+ if (FAILED(hr)) - return hr; - break; - --- -1.9.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,534 +0,0 @@ -From 0384901fc9ef670f7e83e7dfcbdad35edff52746 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 17 Nov 2013 20:19:24 +0100 -Subject: wined3d: Pass a context to surface_load_location. - ---- - dlls/wined3d/context.c | 4 +- - dlls/wined3d/device.c | 20 +++---- - dlls/wined3d/drawprim.c | 20 +++---- - dlls/wined3d/surface.c | 120 +++++++++++++++++++++++++---------------- - dlls/wined3d/swapchain.c | 8 +-- - dlls/wined3d/texture.c | 7 ++- - dlls/wined3d/wined3d_private.h | 5 +- - 7 files changed, 107 insertions(+), 77 deletions(-) - -diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index a122845..12a172b 100644 ---- a/dlls/wined3d/context.c -+++ b/dlls/wined3d/context.c -@@ -2212,7 +2212,7 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing, - return TRUE; - } - --/* The caller provides a context */ -+/* Context activation is done by the caller. */ - static void context_validate_onscreen_formats(struct wined3d_context *context, - const struct wined3d_rendertarget_view *depth_stencil) - { -@@ -2228,7 +2228,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, - WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); - - /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ -- surface_load_location(context->current_rt, WINED3D_LOCATION_TEXTURE_RGB); -+ surface_load_location(context->current_rt, context, WINED3D_LOCATION_TEXTURE_RGB); - swapchain->render_to_fbo = TRUE; - swapchain_update_draw_bindings(swapchain); - context_set_render_offscreen(context, TRUE); -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 56cf325..0521a94 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -300,6 +300,15 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c - unsigned int i; - RECT ds_rect; - -+ context = context_acquire(device, target); -+ if (!context->valid) -+ { -+ context_release(context); -+ WARN("Invalid context, skipping clear.\n"); -+ return; -+ } -+ gl_info = context->gl_info; -+ - /* When we're clearing parts of the drawable, make sure that the target surface is well up to date in the - * drawable. After the clear we'll mark the drawable up to date, so we have to make sure that this is true - * for the cleared parts, and the untouched parts. -@@ -314,19 +323,10 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c - { - struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(fb->render_targets[i]); - if (rt) -- surface_load_location(rt, rt->container->resource.draw_binding); -+ surface_load_location(rt, context, rt->container->resource.draw_binding); - } - } - -- context = context_acquire(device, target); -- if (!context->valid) -- { -- context_release(context); -- WARN("Invalid context, skipping clear.\n"); -- return; -- } -- gl_info = context->gl_info; -- - if (target) - { - render_offscreen = context->render_offscreen; -diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index c0654a6..913ada5 100644 ---- a/dlls/wined3d/drawprim.c -+++ b/dlls/wined3d/drawprim.c -@@ -611,6 +611,15 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co - - if (!index_count) return; - -+ context = context_acquire(device, wined3d_rendertarget_view_get_surface(device->fb.render_targets[0])); -+ if (!context->valid) -+ { -+ context_release(context); -+ WARN("Invalid context, skipping draw.\n"); -+ return; -+ } -+ gl_info = context->gl_info; -+ - if (state->render_states[WINED3D_RS_COLORWRITEENABLE]) - { - /* Invalidate the back buffer memory so LockRect will read it the next time */ -@@ -619,21 +628,12 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co - struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]); - if (target) - { -- surface_load_location(target, target->container->resource.draw_binding); -+ surface_load_location(target, context, target->container->resource.draw_binding); - surface_invalidate_location(target, ~target->container->resource.draw_binding); - } - } - } - -- context = context_acquire(device, wined3d_rendertarget_view_get_surface(device->fb.render_targets[0])); -- if (!context->valid) -- { -- context_release(context); -- WARN("Invalid context, skipping draw.\n"); -- return; -- } -- gl_info = context->gl_info; -- - if (device->fb.depth_stencil) - { - /* Note that this depends on the context_acquire() call above to set -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 320bd31..a0342a0 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -753,7 +753,16 @@ static void surface_unmap(struct wined3d_surface *surface) - } - - if (surface->container->swapchain && surface->container->swapchain->front_buffer == surface->container) -- surface_load_location(surface, surface->container->resource.draw_binding); -+ { -+ struct wined3d_device *device = surface->resource.device; -+ struct wined3d_context *context = NULL; -+ -+ if (device->d3d_initialized) -+ context = context_acquire(device, surface); -+ surface_load_location(surface, context, surface->container->resource.draw_binding); -+ if (context) -+ context_release(context); -+ } - else if (surface->container->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) - FIXME("Depth / stencil buffer locking is not implemented.\n"); - } -@@ -806,12 +815,6 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, - if (src_mask & WINED3DFMT_FLAG_STENCIL) - gl_mask |= GL_STENCIL_BUFFER_BIT; - -- /* Make sure the locations are up-to-date. Loading the destination -- * surface isn't required if the entire surface is overwritten. */ -- surface_load_location(src_surface, src_location); -- if (!surface_is_full_rect(dst_surface, dst_rect)) -- surface_load_location(dst_surface, dst_location); -- - context = context_acquire(device, NULL); - if (!context->valid) - { -@@ -820,6 +823,12 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, - return; - } - -+ /* Make sure the locations are up-to-date. Loading the destination -+ * surface isn't required if the entire surface is overwritten. */ -+ surface_load_location(src_surface, context, src_location); -+ if (!surface_is_full_rect(dst_surface, dst_rect)) -+ surface_load_location(dst_surface, context, dst_location); -+ - gl_info = context->gl_info; - - context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, NULL, src_surface, src_location); -@@ -907,9 +916,9 @@ static void surface_blt_fbo(const struct wined3d_device *device, - * surface isn't required if the entire surface is overwritten. (And is - * in fact harmful if we're being called by surface_load_location() with - * the purpose of loading the destination surface.) */ -- surface_load_location(src_surface, src_location); -+ surface_load_location(src_surface, old_ctx, src_location); - if (!surface_is_full_rect(dst_surface, &dst_rect)) -- surface_load_location(dst_surface, dst_location); -+ surface_load_location(dst_surface, old_ctx, dst_location); - - if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface; - else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface; -@@ -1145,6 +1154,9 @@ static void surface_unload(struct wined3d_resource *resource) - - TRACE("surface %p.\n", surface); - -+ context = context_acquire(device, NULL); -+ gl_info = context->gl_info; -+ - if (resource->pool == WINED3D_POOL_DEFAULT) - { - /* Default pool resources are supposed to be destroyed before Reset is called. -@@ -1170,13 +1182,10 @@ static void surface_unload(struct wined3d_resource *resource) - else - { - surface_prepare_map_memory(surface); -- surface_load_location(surface, surface->resource.map_binding); -+ surface_load_location(surface, context, surface->resource.map_binding); - surface_invalidate_location(surface, ~surface->resource.map_binding); - } - -- context = context_acquire(device, NULL); -- gl_info = context->gl_info; -- - /* Destroy PBOs, but load them into real sysmem before */ - if (surface->pbo) - surface_remove_pbo(surface, gl_info); -@@ -1663,7 +1672,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P - if (update_w == dst_w && update_h == dst_h) - wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); - else -- surface_load_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); -+ surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB); - wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); - - surface_get_memory(src_surface, &data, src_surface->locations); -@@ -1779,7 +1788,8 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) - return GL_BACK; - } - --void surface_load(struct wined3d_surface *surface, BOOL srgb) -+/* Context activation is done by the caller. */ -+void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) - { - DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; - -@@ -1795,7 +1805,7 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb) - } - TRACE("Reloading because surface is dirty.\n"); - -- surface_load_location(surface, location); -+ surface_load_location(surface, context, location); - surface_evict_sysmem(surface); - } - -@@ -2722,10 +2732,16 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - } - else - { -+ struct wined3d_context *context = NULL; -+ - if (surface->resource.usage & WINED3DUSAGE_DYNAMIC) - WARN_(d3d_perf)("Mapping a dynamic surface without WINED3D_MAP_DISCARD.\n"); - -- surface_load_location(surface, surface->resource.map_binding); -+ if (surface->resource.device->d3d_initialized) -+ context = context_acquire(surface->resource.device, NULL); -+ surface_load_location(surface, context, surface->resource.map_binding); -+ if (context) -+ context_release(context); - } - - if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) -@@ -2807,6 +2823,8 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - { - HRESULT hr; -+ struct wined3d_device *device = surface->resource.device; -+ struct wined3d_context *context = NULL; - - TRACE("surface %p, dc %p.\n", surface, dc); - -@@ -2818,26 +2836,36 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - if (surface->resource.map_count) - return WINED3DERR_INVALIDCALL; - -+ if (device->d3d_initialized) -+ context = context_acquire(surface->resource.device, NULL); -+ - /* Create a DIB section if there isn't a dc yet. */ - if (!surface->hDC) - { - if (surface->flags & SFLAG_CLIENT) - { -- surface_load_location(surface, WINED3D_LOCATION_SYSMEM); -+ surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM); - surface_release_client_storage(surface); - } - hr = surface_create_dib_section(surface); - if (FAILED(hr)) -- return WINED3DERR_INVALIDCALL; -+ { -+ if (context) -+ context_release(context); -+ return WINED3DERR_INVALIDCALL; -+ } - if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY - || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM - || surface->pbo)) - surface->resource.map_binding = WINED3D_LOCATION_DIB; - } - -- surface_load_location(surface, WINED3D_LOCATION_DIB); -+ surface_load_location(surface, context, WINED3D_LOCATION_DIB); - surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB); - -+ if (context) -+ context_release(context); -+ - surface->flags |= SFLAG_DCINUSE; - surface->resource.map_count++; - -@@ -2875,8 +2903,16 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) - * copied back to the DIB in the next getdc call. - * - * The same consideration applies to user memory surfaces. */ -- surface_load_location(surface, surface->resource.map_binding); -+ struct wined3d_device *device = surface->resource.device; -+ struct wined3d_context *context = NULL; -+ -+ if (device->d3d_initialized) -+ context = context_acquire(device, NULL); -+ -+ surface_load_location(surface, context, surface->resource.map_binding); - surface_invalidate_location(surface, WINED3D_LOCATION_DIB); -+ if (context) -+ context_release(context); - } - - return WINED3D_OK; -@@ -4117,7 +4153,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, - } - - if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) -- surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); -+ surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); - - /* Download the surface to system memory. */ - if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -@@ -4153,7 +4189,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, - } - - surface_get_rect(surface, NULL, &r); -- surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); -+ surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); - surface_blt_to_drawable(surface->resource.device, context, - WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); - -@@ -4226,7 +4262,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - /* Performance warning... */ - FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); - surface_prepare_map_memory(surface); -- surface_load_location(surface, surface->resource.map_binding); -+ surface_load_location(surface, context, surface->resource.map_binding); - } - } - else -@@ -4237,7 +4273,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - /* Performance warning... */ - FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); - surface_prepare_map_memory(surface); -- surface_load_location(surface, surface->resource.map_binding); -+ surface_load_location(surface, context, surface->resource.map_binding); - } - } - -@@ -4246,7 +4282,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); - /* Lets hope we get it from somewhere... */ - surface_prepare_system_memory(surface); -- surface_load_location(surface, WINED3D_LOCATION_SYSMEM); -+ surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM); - } - - wined3d_texture_prepare_texture(texture, context, srgb); -@@ -4272,7 +4308,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; - - surface_prepare_map_memory(surface); -- surface_load_location(surface, surface->resource.map_binding); -+ surface_load_location(surface, context, surface->resource.map_binding); - surface_remove_pbo(surface, gl_info); - } - -@@ -4340,11 +4376,10 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct - surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect); - } - --HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) -+/* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ -+HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) - { -- struct wined3d_device *device = surface->resource.device; - HRESULT hr; -- struct wined3d_context *context = NULL; - - TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); - -@@ -4353,9 +4388,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) - if (location == WINED3D_LOCATION_TEXTURE_RGB - && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) - { -- context = context_acquire(device, NULL); - surface_load_ds_location(surface, context, location); -- context_release(context); - return WINED3D_OK; - } - else if (location & surface->locations -@@ -4399,33 +4432,22 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) - case WINED3D_LOCATION_USER_MEMORY: - case WINED3D_LOCATION_SYSMEM: - case WINED3D_LOCATION_BUFFER: -- if (device->d3d_initialized) -- context = context_acquire(device, NULL); - surface_load_sysmem(surface, context, location); -- if (context) -- context_release(context); - break; - - case WINED3D_LOCATION_DRAWABLE: -- context = context_acquire(device, NULL); -- hr = surface_load_drawable(surface, context); -- context_release(context); -- if (FAILED(hr)) -+ if (FAILED(hr = surface_load_drawable(surface, context))) - return hr; - break; - - case WINED3D_LOCATION_RB_RESOLVED: -- context = context_acquire(device, NULL); - surface_multisample_resolve(surface, context); -- context_release(context); - break; - - case WINED3D_LOCATION_TEXTURE_RGB: - case WINED3D_LOCATION_TEXTURE_SRGB: -- context = context_acquire(device, NULL); -- hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB); -- context_release(context); -- if (FAILED(hr)) -+ if (FAILED(hr = surface_load_texture(surface, context, -+ location == WINED3D_LOCATION_TEXTURE_SRGB))) - return hr; - break; - -@@ -5542,7 +5564,11 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, &src_rect))) - { - if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) -- surface_load_location(dst_surface, dst_surface->container->resource.draw_binding); -+ { -+ struct wined3d_context *context = context_acquire(device, dst_surface); -+ surface_load_location(dst_surface, context, dst_surface->container->resource.draw_binding); -+ context_release(context); -+ } - return WINED3D_OK; - } - } -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 146f5d6..4f4d4df 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -309,7 +309,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain, - if (backbuffer->resource.multisample_type) - { - location = WINED3D_LOCATION_RB_RESOLVED; -- surface_load_location(backbuffer, location); -+ surface_load_location(backbuffer, context, location); - } - - context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, backbuffer, NULL, location); -@@ -511,14 +511,14 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - */ - if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO) - { -- surface_load_location(back_buffer, WINED3D_LOCATION_TEXTURE_RGB); -+ surface_load_location(back_buffer, context, WINED3D_LOCATION_TEXTURE_RGB); - surface_invalidate_location(back_buffer, WINED3D_LOCATION_DRAWABLE); - swapchain->render_to_fbo = TRUE; - swapchain_update_draw_bindings(swapchain); - } - else - { -- surface_load_location(back_buffer, back_buffer->container->resource.draw_binding); -+ surface_load_location(back_buffer, context, back_buffer->container->resource.draw_binding); - } - - if (swapchain->render_to_fbo) -@@ -640,7 +640,7 @@ void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *r - - TRACE("Copying surface %p to screen.\n", front); - -- surface_load_location(front, WINED3D_LOCATION_DIB); -+ surface_load_location(front, NULL, WINED3D_LOCATION_DIB); - - src_dc = front->hDC; - window = swapchain->win_handle; -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index f4e77fb..2f0d3d4 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -753,16 +753,19 @@ static void wined3d_texture_upload_data(struct wined3d_texture *texture, const s - static void texture2d_sub_resource_load(struct wined3d_resource *sub_resource, - struct wined3d_context *context, BOOL srgb) - { -- surface_load(surface_from_resource(sub_resource), srgb); -+ surface_load(surface_from_resource(sub_resource), context, srgb); - } - - static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub_resource, - const struct wined3d_box *dirty_region) - { - struct wined3d_surface *surface = surface_from_resource(sub_resource); -+ struct wined3d_context *context; - - surface_prepare_map_memory(surface); -- surface_load_location(surface, surface->resource.map_binding); -+ context = context_acquire(surface->resource.device, NULL); -+ surface_load_location(surface, context, surface->resource.map_binding); -+ context_release(context); - surface_invalidate_location(surface, ~surface->resource.map_binding); - } - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 9e6cb5e..ccfebf0 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2399,11 +2399,12 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HID - void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, - unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; - void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; --void surface_load(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN; -+void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; - void surface_load_ds_location(struct wined3d_surface *surface, - struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; - void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN; --HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; -+HRESULT surface_load_location(struct wined3d_surface *surface, -+ struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; - void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; - void surface_prepare_rb(struct wined3d_surface *surface, - const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_multisample_resolv.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_multisample_resolv.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_multisample_resolv.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_multisample_resolv.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,49 @@ +From f3cecdde174e3fc350ca4a35771183695b6777de Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 17 Nov 2013 19:50:47 +0100 +Subject: wined3d: Pass a context to surface_multisample_resolve. + +--- + dlls/wined3d/surface.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index a2f8112..ee6cfdd 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -4314,19 +4314,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + return WINED3D_OK; + } + +-static void surface_multisample_resolve(struct wined3d_surface *surface) ++/* Context activation is done by the caller. */ ++static void surface_multisample_resolve(struct wined3d_surface *surface, struct wined3d_context *context) + { +- struct wined3d_context *context; + RECT rect = {0, 0, surface->resource.width, surface->resource.height}; + + if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE)) + ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n", + surface); + +- context = context_acquire(surface->resource.device, NULL); + surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT, + surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect); +- context_release(context); + } + + HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) +@@ -4405,7 +4403,9 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) + break; + + case WINED3D_LOCATION_RB_RESOLVED: +- surface_multisample_resolve(surface); ++ context = context_acquire(device, NULL); ++ surface_multisample_resolve(surface, context); ++ context_release(context); + break; + + case WINED3D_LOCATION_TEXTURE_RGB: +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0008-wined3d-Make-surface_load_location-return-nothing.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0008-wined3d-Make-surface_load_location-return-nothing.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0008-wined3d-Make-surface_load_location-return-nothing.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0008-wined3d-Make-surface_load_location-return-nothing.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -From 7059ae36100e7efafcbcefcf582c34c0ce99e435 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 17 Nov 2013 20:25:01 +0100 -Subject: wined3d: Make surface_load_location return nothing. - ---- - dlls/wined3d/surface.c | 18 +++++++++--------- - dlls/wined3d/wined3d_private.h | 2 +- - 2 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 66956df..8a14169 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -4353,7 +4353,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct - } - - /* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ --HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) -+void surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) - { - HRESULT hr; - -@@ -4365,26 +4365,26 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co - && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) - { - surface_load_ds_location(surface, context, location); -- return WINED3D_OK; -+ return; - } - else if (location & surface->locations - && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) - { - /* Already up to date, nothing to do. */ -- return WINED3D_OK; -+ return; - } - else - { - FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n", - wined3d_debug_location(surface->locations), wined3d_debug_location(location)); -- return WINED3DERR_INVALIDCALL; -+ return; - } - } - - if (surface->locations & location) - { - TRACE("Location already up to date.\n"); -- return WINED3D_OK; -+ return; - } - - if (WARN_ON(d3d_surface)) -@@ -4399,7 +4399,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co - { - ERR("Surface %p does not have any up to date location.\n", surface); - surface->flags |= SFLAG_LOST; -- return WINED3DERR_DEVICELOST; -+ return; - } - - switch (location) -@@ -4413,7 +4413,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co - - case WINED3D_LOCATION_DRAWABLE: - if (FAILED(hr = surface_load_drawable(surface, context))) -- return hr; -+ return; - break; - - case WINED3D_LOCATION_RB_RESOLVED: -@@ -4424,7 +4424,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co - case WINED3D_LOCATION_TEXTURE_SRGB: - if (FAILED(hr = surface_load_texture(surface, context, - location == WINED3D_LOCATION_TEXTURE_SRGB))) -- return hr; -+ return; - break; - - default: -@@ -4437,7 +4437,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co - if (location != WINED3D_LOCATION_SYSMEM && (surface->locations & WINED3D_LOCATION_SYSMEM)) - surface_evict_sysmem(surface); - -- return WINED3D_OK; -+ return; - } - - static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7115eca..f24808b 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2354,7 +2354,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte - void surface_load_ds_location(struct wined3d_surface *surface, - struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; - void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN; --HRESULT surface_load_location(struct wined3d_surface *surface, -+void surface_load_location(struct wined3d_surface *surface, - struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; - void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; - void surface_prepare_rb(struct wined3d_surface *surface, --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0008-wined3d-Pass-a-context-to-surface_load_texture.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0008-wined3d-Pass-a-context-to-surface_load_texture.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0008-wined3d-Pass-a-context-to-surface_load_texture.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0008-wined3d-Pass-a-context-to-surface_load_texture.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,100 @@ +From 4e063e06ce5bf0e641ce3f307c6cbfc891a227d4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 17 Nov 2013 19:52:56 +0100 +Subject: wined3d: Pass a context to surface_load_texture. + +--- + dlls/wined3d/surface.c | 21 ++++++--------------- + 1 file changed, 6 insertions(+), 15 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 92fe15c..6c291ad 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -4275,13 +4275,13 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, + } + + static HRESULT surface_load_texture(struct wined3d_surface *surface, +- const struct wined3d_gl_info *gl_info, BOOL srgb) ++ struct wined3d_context *context, BOOL srgb) + { ++ const struct wined3d_gl_info *gl_info = context->gl_info; + RECT src_rect = {0, 0, surface->resource.width, surface->resource.height}; + struct wined3d_device *device = surface->resource.device; + const struct wined3d_color_key_conversion *conversion; + struct wined3d_texture *texture = surface->container; +- struct wined3d_context *context; + UINT width, src_row_pitch, src_slice_pitch, dst_pitch; + struct wined3d_bo_address data; + struct wined3d_format format; +@@ -4303,8 +4303,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) + { +- context = context_acquire(device, NULL); +- + if (srgb) + surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, + &src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect); +@@ -4312,8 +4310,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB, + &src_rect, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect); + +- context_release(context); +- + return WINED3D_OK; + } + +@@ -4328,10 +4324,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; + RECT rect = {0, 0, surface->resource.width, surface->resource.height}; + +- context = context_acquire(device, NULL); + surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, + &rect, surface, dst_location, &rect); +- context_release(context); + + return WINED3D_OK; + } +@@ -4369,9 +4363,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + surface_load_location(surface, WINED3D_LOCATION_SYSMEM); + } + +- /* TODO: Use already acquired context when possible. */ +- context = context_acquire(device, NULL); +- + wined3d_texture_prepare_texture(texture, context, srgb); + wined3d_texture_bind_and_dirtify(texture, context, srgb); + +@@ -4453,8 +4444,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, + src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); + +- context_release(context); +- + HeapFree(GetProcessHeap(), 0, mem); + + return WINED3D_OK; +@@ -4476,7 +4465,6 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct + HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) + { + struct wined3d_device *device = surface->resource.device; +- const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + HRESULT hr; + struct wined3d_context *context = NULL; + +@@ -4556,7 +4544,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) + + case WINED3D_LOCATION_TEXTURE_RGB: + case WINED3D_LOCATION_TEXTURE_SRGB: +- if (FAILED(hr = surface_load_texture(surface, gl_info, location == WINED3D_LOCATION_TEXTURE_SRGB))) ++ context = context_acquire(device, NULL); ++ hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB); ++ context_release(context); ++ if (FAILED(hr)) + return hr; + break; + +-- +1.9.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0009-wined3d-Pass-a-context-to-surface_load_location.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0009-wined3d-Pass-a-context-to-surface_load_location.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0009-wined3d-Pass-a-context-to-surface_load_location.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0009-wined3d-Pass-a-context-to-surface_load_location.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,534 @@ +From 0384901fc9ef670f7e83e7dfcbdad35edff52746 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 17 Nov 2013 20:19:24 +0100 +Subject: wined3d: Pass a context to surface_load_location. + +--- + dlls/wined3d/context.c | 4 +- + dlls/wined3d/device.c | 20 +++---- + dlls/wined3d/drawprim.c | 20 +++---- + dlls/wined3d/surface.c | 120 +++++++++++++++++++++++++---------------- + dlls/wined3d/swapchain.c | 8 +-- + dlls/wined3d/texture.c | 7 ++- + dlls/wined3d/wined3d_private.h | 5 +- + 7 files changed, 107 insertions(+), 77 deletions(-) + +diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c +index a122845..12a172b 100644 +--- a/dlls/wined3d/context.c ++++ b/dlls/wined3d/context.c +@@ -2212,7 +2212,7 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing, + return TRUE; + } + +-/* The caller provides a context */ ++/* Context activation is done by the caller. */ + static void context_validate_onscreen_formats(struct wined3d_context *context, + const struct wined3d_rendertarget_view *depth_stencil) + { +@@ -2228,7 +2228,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, + WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); + + /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ +- surface_load_location(context->current_rt, WINED3D_LOCATION_TEXTURE_RGB); ++ surface_load_location(context->current_rt, context, WINED3D_LOCATION_TEXTURE_RGB); + swapchain->render_to_fbo = TRUE; + swapchain_update_draw_bindings(swapchain); + context_set_render_offscreen(context, TRUE); +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 56cf325..0521a94 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -300,6 +300,15 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c + unsigned int i; + RECT ds_rect; + ++ context = context_acquire(device, target); ++ if (!context->valid) ++ { ++ context_release(context); ++ WARN("Invalid context, skipping clear.\n"); ++ return; ++ } ++ gl_info = context->gl_info; ++ + /* When we're clearing parts of the drawable, make sure that the target surface is well up to date in the + * drawable. After the clear we'll mark the drawable up to date, so we have to make sure that this is true + * for the cleared parts, and the untouched parts. +@@ -314,19 +323,10 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c + { + struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(fb->render_targets[i]); + if (rt) +- surface_load_location(rt, rt->container->resource.draw_binding); ++ surface_load_location(rt, context, rt->container->resource.draw_binding); + } + } + +- context = context_acquire(device, target); +- if (!context->valid) +- { +- context_release(context); +- WARN("Invalid context, skipping clear.\n"); +- return; +- } +- gl_info = context->gl_info; +- + if (target) + { + render_offscreen = context->render_offscreen; +diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c +index c0654a6..913ada5 100644 +--- a/dlls/wined3d/drawprim.c ++++ b/dlls/wined3d/drawprim.c +@@ -611,6 +611,15 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co + + if (!index_count) return; + ++ context = context_acquire(device, wined3d_rendertarget_view_get_surface(device->fb.render_targets[0])); ++ if (!context->valid) ++ { ++ context_release(context); ++ WARN("Invalid context, skipping draw.\n"); ++ return; ++ } ++ gl_info = context->gl_info; ++ + if (state->render_states[WINED3D_RS_COLORWRITEENABLE]) + { + /* Invalidate the back buffer memory so LockRect will read it the next time */ +@@ -619,21 +628,12 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co + struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]); + if (target) + { +- surface_load_location(target, target->container->resource.draw_binding); ++ surface_load_location(target, context, target->container->resource.draw_binding); + surface_invalidate_location(target, ~target->container->resource.draw_binding); + } + } + } + +- context = context_acquire(device, wined3d_rendertarget_view_get_surface(device->fb.render_targets[0])); +- if (!context->valid) +- { +- context_release(context); +- WARN("Invalid context, skipping draw.\n"); +- return; +- } +- gl_info = context->gl_info; +- + if (device->fb.depth_stencil) + { + /* Note that this depends on the context_acquire() call above to set +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 320bd31..a0342a0 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -753,7 +753,16 @@ static void surface_unmap(struct wined3d_surface *surface) + } + + if (surface->container->swapchain && surface->container->swapchain->front_buffer == surface->container) +- surface_load_location(surface, surface->container->resource.draw_binding); ++ { ++ struct wined3d_device *device = surface->resource.device; ++ struct wined3d_context *context = NULL; ++ ++ if (device->d3d_initialized) ++ context = context_acquire(device, surface); ++ surface_load_location(surface, context, surface->container->resource.draw_binding); ++ if (context) ++ context_release(context); ++ } + else if (surface->container->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) + FIXME("Depth / stencil buffer locking is not implemented.\n"); + } +@@ -806,12 +815,6 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, + if (src_mask & WINED3DFMT_FLAG_STENCIL) + gl_mask |= GL_STENCIL_BUFFER_BIT; + +- /* Make sure the locations are up-to-date. Loading the destination +- * surface isn't required if the entire surface is overwritten. */ +- surface_load_location(src_surface, src_location); +- if (!surface_is_full_rect(dst_surface, dst_rect)) +- surface_load_location(dst_surface, dst_location); +- + context = context_acquire(device, NULL); + if (!context->valid) + { +@@ -820,6 +823,12 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, + return; + } + ++ /* Make sure the locations are up-to-date. Loading the destination ++ * surface isn't required if the entire surface is overwritten. */ ++ surface_load_location(src_surface, context, src_location); ++ if (!surface_is_full_rect(dst_surface, dst_rect)) ++ surface_load_location(dst_surface, context, dst_location); ++ + gl_info = context->gl_info; + + context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, NULL, src_surface, src_location); +@@ -907,9 +916,9 @@ static void surface_blt_fbo(const struct wined3d_device *device, + * surface isn't required if the entire surface is overwritten. (And is + * in fact harmful if we're being called by surface_load_location() with + * the purpose of loading the destination surface.) */ +- surface_load_location(src_surface, src_location); ++ surface_load_location(src_surface, old_ctx, src_location); + if (!surface_is_full_rect(dst_surface, &dst_rect)) +- surface_load_location(dst_surface, dst_location); ++ surface_load_location(dst_surface, old_ctx, dst_location); + + if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface; + else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface; +@@ -1145,6 +1154,9 @@ static void surface_unload(struct wined3d_resource *resource) + + TRACE("surface %p.\n", surface); + ++ context = context_acquire(device, NULL); ++ gl_info = context->gl_info; ++ + if (resource->pool == WINED3D_POOL_DEFAULT) + { + /* Default pool resources are supposed to be destroyed before Reset is called. +@@ -1170,13 +1182,10 @@ static void surface_unload(struct wined3d_resource *resource) + else + { + surface_prepare_map_memory(surface); +- surface_load_location(surface, surface->resource.map_binding); ++ surface_load_location(surface, context, surface->resource.map_binding); + surface_invalidate_location(surface, ~surface->resource.map_binding); + } + +- context = context_acquire(device, NULL); +- gl_info = context->gl_info; +- + /* Destroy PBOs, but load them into real sysmem before */ + if (surface->pbo) + surface_remove_pbo(surface, gl_info); +@@ -1663,7 +1672,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P + if (update_w == dst_w && update_h == dst_h) + wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); + else +- surface_load_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); ++ surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); + + surface_get_memory(src_surface, &data, src_surface->locations); +@@ -1779,7 +1788,8 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) + return GL_BACK; + } + +-void surface_load(struct wined3d_surface *surface, BOOL srgb) ++/* Context activation is done by the caller. */ ++void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) + { + DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; + +@@ -1795,7 +1805,7 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb) + } + TRACE("Reloading because surface is dirty.\n"); + +- surface_load_location(surface, location); ++ surface_load_location(surface, context, location); + surface_evict_sysmem(surface); + } + +@@ -2722,10 +2732,16 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + } + else + { ++ struct wined3d_context *context = NULL; ++ + if (surface->resource.usage & WINED3DUSAGE_DYNAMIC) + WARN_(d3d_perf)("Mapping a dynamic surface without WINED3D_MAP_DISCARD.\n"); + +- surface_load_location(surface, surface->resource.map_binding); ++ if (surface->resource.device->d3d_initialized) ++ context = context_acquire(surface->resource.device, NULL); ++ surface_load_location(surface, context, surface->resource.map_binding); ++ if (context) ++ context_release(context); + } + + if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) +@@ -2807,6 +2823,8 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) + { + HRESULT hr; ++ struct wined3d_device *device = surface->resource.device; ++ struct wined3d_context *context = NULL; + + TRACE("surface %p, dc %p.\n", surface, dc); + +@@ -2818,26 +2836,36 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) + if (surface->resource.map_count) + return WINED3DERR_INVALIDCALL; + ++ if (device->d3d_initialized) ++ context = context_acquire(surface->resource.device, NULL); ++ + /* Create a DIB section if there isn't a dc yet. */ + if (!surface->hDC) + { + if (surface->flags & SFLAG_CLIENT) + { +- surface_load_location(surface, WINED3D_LOCATION_SYSMEM); ++ surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM); + surface_release_client_storage(surface); + } + hr = surface_create_dib_section(surface); + if (FAILED(hr)) +- return WINED3DERR_INVALIDCALL; ++ { ++ if (context) ++ context_release(context); ++ return WINED3DERR_INVALIDCALL; ++ } + if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY + || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM + || surface->pbo)) + surface->resource.map_binding = WINED3D_LOCATION_DIB; + } + +- surface_load_location(surface, WINED3D_LOCATION_DIB); ++ surface_load_location(surface, context, WINED3D_LOCATION_DIB); + surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB); + ++ if (context) ++ context_release(context); ++ + surface->flags |= SFLAG_DCINUSE; + surface->resource.map_count++; + +@@ -2875,8 +2903,16 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) + * copied back to the DIB in the next getdc call. + * + * The same consideration applies to user memory surfaces. */ +- surface_load_location(surface, surface->resource.map_binding); ++ struct wined3d_device *device = surface->resource.device; ++ struct wined3d_context *context = NULL; ++ ++ if (device->d3d_initialized) ++ context = context_acquire(device, NULL); ++ ++ surface_load_location(surface, context, surface->resource.map_binding); + surface_invalidate_location(surface, WINED3D_LOCATION_DIB); ++ if (context) ++ context_release(context); + } + + return WINED3D_OK; +@@ -4117,7 +4153,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, + } + + if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) +- surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); ++ surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); + + /* Download the surface to system memory. */ + if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) +@@ -4153,7 +4189,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, + } + + surface_get_rect(surface, NULL, &r); +- surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); ++ surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); + surface_blt_to_drawable(surface->resource.device, context, + WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); + +@@ -4226,7 +4262,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + /* Performance warning... */ + FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); + surface_prepare_map_memory(surface); +- surface_load_location(surface, surface->resource.map_binding); ++ surface_load_location(surface, context, surface->resource.map_binding); + } + } + else +@@ -4237,7 +4273,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + /* Performance warning... */ + FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); + surface_prepare_map_memory(surface); +- surface_load_location(surface, surface->resource.map_binding); ++ surface_load_location(surface, context, surface->resource.map_binding); + } + } + +@@ -4246,7 +4282,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); + /* Lets hope we get it from somewhere... */ + surface_prepare_system_memory(surface); +- surface_load_location(surface, WINED3D_LOCATION_SYSMEM); ++ surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM); + } + + wined3d_texture_prepare_texture(texture, context, srgb); +@@ -4272,7 +4308,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; + + surface_prepare_map_memory(surface); +- surface_load_location(surface, surface->resource.map_binding); ++ surface_load_location(surface, context, surface->resource.map_binding); + surface_remove_pbo(surface, gl_info); + } + +@@ -4340,11 +4376,10 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct + surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect); + } + +-HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) ++/* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ ++HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) + { +- struct wined3d_device *device = surface->resource.device; + HRESULT hr; +- struct wined3d_context *context = NULL; + + TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); + +@@ -4353,9 +4388,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) + if (location == WINED3D_LOCATION_TEXTURE_RGB + && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) + { +- context = context_acquire(device, NULL); + surface_load_ds_location(surface, context, location); +- context_release(context); + return WINED3D_OK; + } + else if (location & surface->locations +@@ -4399,33 +4432,22 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) + case WINED3D_LOCATION_USER_MEMORY: + case WINED3D_LOCATION_SYSMEM: + case WINED3D_LOCATION_BUFFER: +- if (device->d3d_initialized) +- context = context_acquire(device, NULL); + surface_load_sysmem(surface, context, location); +- if (context) +- context_release(context); + break; + + case WINED3D_LOCATION_DRAWABLE: +- context = context_acquire(device, NULL); +- hr = surface_load_drawable(surface, context); +- context_release(context); +- if (FAILED(hr)) ++ if (FAILED(hr = surface_load_drawable(surface, context))) + return hr; + break; + + case WINED3D_LOCATION_RB_RESOLVED: +- context = context_acquire(device, NULL); + surface_multisample_resolve(surface, context); +- context_release(context); + break; + + case WINED3D_LOCATION_TEXTURE_RGB: + case WINED3D_LOCATION_TEXTURE_SRGB: +- context = context_acquire(device, NULL); +- hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB); +- context_release(context); +- if (FAILED(hr)) ++ if (FAILED(hr = surface_load_texture(surface, context, ++ location == WINED3D_LOCATION_TEXTURE_SRGB))) + return hr; + break; + +@@ -5542,7 +5564,11 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, &src_rect))) + { + if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) +- surface_load_location(dst_surface, dst_surface->container->resource.draw_binding); ++ { ++ struct wined3d_context *context = context_acquire(device, dst_surface); ++ surface_load_location(dst_surface, context, dst_surface->container->resource.draw_binding); ++ context_release(context); ++ } + return WINED3D_OK; + } + } +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index 146f5d6..4f4d4df 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -309,7 +309,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain, + if (backbuffer->resource.multisample_type) + { + location = WINED3D_LOCATION_RB_RESOLVED; +- surface_load_location(backbuffer, location); ++ surface_load_location(backbuffer, context, location); + } + + context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, backbuffer, NULL, location); +@@ -511,14 +511,14 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + */ + if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO) + { +- surface_load_location(back_buffer, WINED3D_LOCATION_TEXTURE_RGB); ++ surface_load_location(back_buffer, context, WINED3D_LOCATION_TEXTURE_RGB); + surface_invalidate_location(back_buffer, WINED3D_LOCATION_DRAWABLE); + swapchain->render_to_fbo = TRUE; + swapchain_update_draw_bindings(swapchain); + } + else + { +- surface_load_location(back_buffer, back_buffer->container->resource.draw_binding); ++ surface_load_location(back_buffer, context, back_buffer->container->resource.draw_binding); + } + + if (swapchain->render_to_fbo) +@@ -640,7 +640,7 @@ void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *r + + TRACE("Copying surface %p to screen.\n", front); + +- surface_load_location(front, WINED3D_LOCATION_DIB); ++ surface_load_location(front, NULL, WINED3D_LOCATION_DIB); + + src_dc = front->hDC; + window = swapchain->win_handle; +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index f4e77fb..2f0d3d4 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -753,16 +753,19 @@ static void wined3d_texture_upload_data(struct wined3d_texture *texture, const s + static void texture2d_sub_resource_load(struct wined3d_resource *sub_resource, + struct wined3d_context *context, BOOL srgb) + { +- surface_load(surface_from_resource(sub_resource), srgb); ++ surface_load(surface_from_resource(sub_resource), context, srgb); + } + + static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub_resource, + const struct wined3d_box *dirty_region) + { + struct wined3d_surface *surface = surface_from_resource(sub_resource); ++ struct wined3d_context *context; + + surface_prepare_map_memory(surface); +- surface_load_location(surface, surface->resource.map_binding); ++ context = context_acquire(surface->resource.device, NULL); ++ surface_load_location(surface, context, surface->resource.map_binding); ++ context_release(context); + surface_invalidate_location(surface, ~surface->resource.map_binding); + } + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 9e6cb5e..ccfebf0 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2399,11 +2399,12 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HID + void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, + unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; + void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; +-void surface_load(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN; ++void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; + void surface_load_ds_location(struct wined3d_surface *surface, + struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; + void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN; +-HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; ++HRESULT surface_load_location(struct wined3d_surface *surface, ++ struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; + void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; + void surface_prepare_rb(struct wined3d_surface *surface, + const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,207 +0,0 @@ -From 81726de3e2c63759ff771038ec1a829758314bc7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 3 Oct 2013 12:31:24 +0200 -Subject: wined3d: Store volume locations in the resource. - ---- - dlls/wined3d/volume.c | 46 +++++++++++++++++++++--------------------- - dlls/wined3d/wined3d_private.h | 5 +++-- - 2 files changed, 26 insertions(+), 25 deletions(-) - -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 1a5e629..5f5fe8b 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -102,15 +102,15 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine - void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) - { - TRACE("Volume %p, setting %s.\n", volume, wined3d_debug_location(location)); -- volume->locations |= location; -- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->locations)); -+ volume->resource.locations |= location; -+ TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations)); - } - - void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) - { - TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location)); -- volume->locations &= ~location; -- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->locations)); -+ volume->resource.locations &= ~location; -+ TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations)); - } - - /* Context activation is done by the caller. */ -@@ -218,9 +218,9 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - DWORD required_access = volume_access_from_location(location); - - TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location), -- wined3d_debug_location(volume->locations)); -+ wined3d_debug_location(volume->resource.locations)); - -- if ((volume->locations & location) == location) -+ if ((volume->resource.locations & location) == location) - { - TRACE("Location(s) already up to date.\n"); - return; -@@ -243,36 +243,36 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - && !(volume->container->flags & WINED3D_TEXTURE_SRGB_ALLOCATED))) - ERR("Trying to load (s)RGB texture without prior allocation.\n"); - -- if (volume->locations & WINED3D_LOCATION_DISCARDED) -+ if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) - { - TRACE("Volume previously discarded, nothing to do.\n"); - wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED); - } -- else if (volume->locations & WINED3D_LOCATION_SYSMEM) -+ else if (volume->resource.locations & WINED3D_LOCATION_SYSMEM) - { - struct wined3d_const_bo_address data = {0, volume->resource.heap_memory}; - wined3d_texture_bind_and_dirtify(volume->container, context, - location == WINED3D_LOCATION_TEXTURE_SRGB); - wined3d_volume_upload_data(volume, context, &data); - } -- else if (volume->locations & WINED3D_LOCATION_BUFFER) -+ else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) - { - struct wined3d_const_bo_address data = {volume->pbo, NULL}; - wined3d_texture_bind_and_dirtify(volume->container, context, - location == WINED3D_LOCATION_TEXTURE_SRGB); - wined3d_volume_upload_data(volume, context, &data); - } -- else if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB) -+ else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) - { - wined3d_volume_srgb_transfer(volume, context, TRUE); - } -- else if (volume->locations & WINED3D_LOCATION_TEXTURE_SRGB) -+ else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_SRGB) - { - wined3d_volume_srgb_transfer(volume, context, FALSE); - } - else - { -- FIXME("Implement texture loading from %s.\n", wined3d_debug_location(volume->locations)); -+ FIXME("Implement texture loading from %s.\n", wined3d_debug_location(volume->resource.locations)); - return; - } - wined3d_volume_validate_location(volume, location); -@@ -286,16 +286,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - if (!volume->resource.heap_memory) - ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n"); - -- if (volume->locations & WINED3D_LOCATION_DISCARDED) -+ if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) - { - TRACE("Volume previously discarded, nothing to do.\n"); - wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED); - } -- else if (volume->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -+ else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - { - struct wined3d_bo_address data = {0, volume->resource.heap_memory}; - -- if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB) -+ if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) - wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); - else - wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -306,7 +306,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - else - { - FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n", -- wined3d_debug_location(volume->locations)); -+ wined3d_debug_location(volume->resource.locations)); - return; - } - wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); -@@ -316,16 +316,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - if (!volume->pbo) - ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); - -- if (volume->locations & WINED3D_LOCATION_DISCARDED) -+ if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) - { - TRACE("Volume previously discarded, nothing to do.\n"); - wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED); - } -- else if (volume->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -+ else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - { - struct wined3d_bo_address data = {volume->pbo, NULL}; - -- if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB) -+ if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) - wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); - else - wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -335,7 +335,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - else - { - FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n", -- wined3d_debug_location(volume->locations)); -+ wined3d_debug_location(volume->resource.locations)); - return; - } - wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER); -@@ -343,7 +343,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - - default: - FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location), -- wined3d_debug_location(volume->locations)); -+ wined3d_debug_location(volume->resource.locations)); - } - } - -@@ -600,7 +600,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - { - wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); - } -- else if (!(volume->locations & WINED3D_LOCATION_SYSMEM)) -+ else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM)) - { - context = context_acquire(device, NULL); - wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM); -@@ -748,7 +748,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture - } - - volume->texture_level = level; -- volume->locations = WINED3D_LOCATION_DISCARDED; -+ volume->resource.locations = WINED3D_LOCATION_DISCARDED; - - if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC - && gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 254dfd7..f2d3943 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -5,7 +5,7 @@ - * Copyright 2002-2003 Raphael Junqueira - * Copyright 2002-2003, 2004 Jason Edmeades - * Copyright 2005 Oliver Stieber -- * Copyright 2006-2011, 2013 Stefan Dösinger for CodeWeavers -+ * Copyright 2006-2011, 2013-2014 Stefan Dösinger for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -2123,6 +2123,7 @@ struct wined3d_resource - void *heap_memory; - UINT custom_row_pitch, custom_slice_pitch; - struct list resource_list_entry; -+ DWORD locations; - - void *parent; - const struct wined3d_parent_ops *parent_ops; -@@ -2271,7 +2272,7 @@ struct wined3d_volume - struct wined3d_resource resource; - struct wined3d_texture *container; - -- DWORD flags, locations; -+ DWORD flags; - GLint texture_level; - DWORD download_count; - GLuint pbo; --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0010-wined3d-Make-surface_load_location-return-nothing.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0010-wined3d-Make-surface_load_location-return-nothing.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0010-wined3d-Make-surface_load_location-return-nothing.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0010-wined3d-Make-surface_load_location-return-nothing.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,106 @@ +From 7059ae36100e7efafcbcefcf582c34c0ce99e435 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 17 Nov 2013 20:25:01 +0100 +Subject: wined3d: Make surface_load_location return nothing. + +--- + dlls/wined3d/surface.c | 18 +++++++++--------- + dlls/wined3d/wined3d_private.h | 2 +- + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 66956df..8a14169 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -4353,7 +4353,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct + } + + /* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ +-HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) ++void surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) + { + HRESULT hr; + +@@ -4365,26 +4365,26 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co + && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) + { + surface_load_ds_location(surface, context, location); +- return WINED3D_OK; ++ return; + } + else if (location & surface->locations + && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) + { + /* Already up to date, nothing to do. */ +- return WINED3D_OK; ++ return; + } + else + { + FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n", + wined3d_debug_location(surface->locations), wined3d_debug_location(location)); +- return WINED3DERR_INVALIDCALL; ++ return; + } + } + + if (surface->locations & location) + { + TRACE("Location already up to date.\n"); +- return WINED3D_OK; ++ return; + } + + if (WARN_ON(d3d_surface)) +@@ -4399,7 +4399,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co + { + ERR("Surface %p does not have any up to date location.\n", surface); + surface->flags |= SFLAG_LOST; +- return WINED3DERR_DEVICELOST; ++ return; + } + + switch (location) +@@ -4413,7 +4413,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co + + case WINED3D_LOCATION_DRAWABLE: + if (FAILED(hr = surface_load_drawable(surface, context))) +- return hr; ++ return; + break; + + case WINED3D_LOCATION_RB_RESOLVED: +@@ -4424,7 +4424,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co + case WINED3D_LOCATION_TEXTURE_SRGB: + if (FAILED(hr = surface_load_texture(surface, context, + location == WINED3D_LOCATION_TEXTURE_SRGB))) +- return hr; ++ return; + break; + + default: +@@ -4437,7 +4437,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co + if (location != WINED3D_LOCATION_SYSMEM && (surface->locations & WINED3D_LOCATION_SYSMEM)) + surface_evict_sysmem(surface); + +- return WINED3D_OK; ++ return; + } + + static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 7115eca..f24808b 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2354,7 +2354,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte + void surface_load_ds_location(struct wined3d_surface *surface, + struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; + void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN; +-HRESULT surface_load_location(struct wined3d_surface *surface, ++void surface_load_location(struct wined3d_surface *surface, + struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; + void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; + void surface_prepare_rb(struct wined3d_surface *surface, +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -From e872730f9d2dbdb4220860cc6ee5588860971223 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 3 Oct 2013 12:34:13 +0200 -Subject: wined3d: Move validate_location to resource.c. - ---- - dlls/wined3d/resource.c | 7 +++++++ - dlls/wined3d/texture.c | 4 +--- - dlls/wined3d/volume.c | 19 ++++++------------- - dlls/wined3d/wined3d_private.h | 1 + - 4 files changed, 15 insertions(+), 16 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 8032a4c..2731f27 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -362,3 +362,10 @@ void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, U - - TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); - } -+ -+void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) -+{ -+ TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location)); -+ resource->locations |= location; -+ TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); -+} -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 9fe7d25..92f7744 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -1331,9 +1331,7 @@ static void texture3d_sub_resource_invalidate_location(struct wined3d_resource * - - static void texture3d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) - { -- struct wined3d_volume *volume = volume_from_resource(sub_resource); -- -- wined3d_volume_validate_location(volume, location); -+ wined3d_resource_validate_location(sub_resource, location); - } - - static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_resource, -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 62eb5ed..e1fa454 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -99,13 +99,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine - HeapFree(GetProcessHeap(), 0, converted_mem); - } - --void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) --{ -- TRACE("Volume %p, setting %s.\n", volume, wined3d_debug_location(location)); -- volume->resource.locations |= location; -- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations)); --} -- - void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) - { - TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location)); -@@ -271,7 +264,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - FIXME("Implement texture loading from %s.\n", wined3d_debug_location(volume->resource.locations)); - return; - } -- wined3d_volume_validate_location(volume, location); -+ wined3d_resource_validate_location(&volume->resource, location); - - if (wined3d_volume_can_evict(volume)) - wined3d_volume_evict_sysmem(volume); -@@ -305,7 +298,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - wined3d_debug_location(volume->resource.locations)); - return; - } -- wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); - break; - - case WINED3D_LOCATION_BUFFER: -@@ -334,7 +327,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - wined3d_debug_location(volume->resource.locations)); - return; - } -- wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER); -+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER); - break; - - default: -@@ -413,7 +406,7 @@ static void volume_unload(struct wined3d_resource *resource) - else - { - ERR("Out of memory when unloading volume %p.\n", volume); -- wined3d_volume_validate_location(volume, WINED3D_LOCATION_DISCARDED); -+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); - wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_DISCARDED); - } - -@@ -559,7 +552,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - - wined3d_volume_prepare_pbo(volume, context); - if (flags & WINED3D_MAP_DISCARD) -- wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER); -+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER); - else - wined3d_volume_load_location(volume, context, WINED3D_LOCATION_BUFFER); - -@@ -594,7 +587,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - - if (flags & WINED3D_MAP_DISCARD) - { -- wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); - } - else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM)) - { -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index a431453..f47c2fb 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2125,6 +2125,7 @@ GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; - BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; - void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; - - /* Tests show that the start address of resources is 32 byte aligned */ - #define RESOURCE_ALIGNMENT 16 --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,457 +0,0 @@ -From 518ce36e50012eb7f2dea0e4daf34c73fae4456c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 21 Jan 2014 12:22:30 +0100 -Subject: wined3d: Move surface locations into the resource. - ---- - dlls/wined3d/arb_program_shader.c | 2 +- - dlls/wined3d/device.c | 4 +- - dlls/wined3d/drawprim.c | 2 +- - dlls/wined3d/surface.c | 99 ++++++++++++++++++++------------------- - dlls/wined3d/swapchain.c | 4 +- - dlls/wined3d/wined3d_private.h | 1 - - 6 files changed, 56 insertions(+), 56 deletions(-) - -diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index 0bd7c22..f218979 100644 ---- a/dlls/wined3d/arb_program_shader.c -+++ b/dlls/wined3d/arb_program_shader.c -@@ -7821,7 +7821,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter, - - /* Now load the surface */ - if (wined3d_settings.offscreen_rendering_mode != ORM_FBO -- && (src_surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_DRAWABLE)) -+ && (src_surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_DRAWABLE)) - == WINED3D_LOCATION_DRAWABLE - && !wined3d_resource_is_offscreen(&src_surface->container->resource)) - { -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 0521a94..b4bc3ac 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -236,7 +236,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context - { - RECT current_rect, r; - -- if (ds->locations & WINED3D_LOCATION_DISCARDED) -+ if (ds->resource.locations & WINED3D_LOCATION_DISCARDED) - { - /* Depth buffer was discarded, make it entirely current in its new location since - * there is no other place where we would get data anyway. */ -@@ -244,7 +244,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context - return; - } - -- if (ds->locations & location) -+ if (ds->resource.locations & location) - SetRect(¤t_rect, 0, 0, - ds->ds_current_size.cx, - ds->ds_current_size.cy); -diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index 913ada5..567550e 100644 ---- a/dlls/wined3d/drawprim.c -+++ b/dlls/wined3d/drawprim.c -@@ -651,7 +651,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co - if (!context->render_offscreen && ds != device->onscreen_depth_stencil) - device_switch_onscreen_ds(device, context, ds); - -- if (ds->locations & location) -+ if (ds->resource.locations & location) - SetRect(¤t_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy); - else - SetRectEmpty(¤t_rect); -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 9abffb3..78f92d3 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -556,7 +556,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface) - if (!wined3d_resource_allocate_sysmem(&surface->resource)) - ERR("Failed to allocate system memory.\n"); - -- if (surface->locations & WINED3D_LOCATION_SYSMEM) -+ if (surface->resource.locations & WINED3D_LOCATION_SYSMEM) - ERR("Surface without system memory has WINED3D_LOCATION_SYSMEM set.\n"); - } - -@@ -706,7 +706,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) - } - - if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) -- surface->locations = WINED3D_LOCATION_DISCARDED; -+ surface->resource.locations = WINED3D_LOCATION_DISCARDED; - - if (surface_use_pbo(surface)) - surface->resource.map_binding = WINED3D_LOCATION_BUFFER; -@@ -746,7 +746,7 @@ static void surface_unmap(struct wined3d_surface *surface) - ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding)); - } - -- if (surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)) -+ if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)) - { - TRACE("Not dirtified, nothing to do.\n"); - return; -@@ -1675,7 +1675,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P - surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB); - wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); - -- surface_get_memory(src_surface, &data, src_surface->locations); -+ surface_get_memory(src_surface, &data, src_surface->resource.locations); - wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); - - wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -@@ -1798,7 +1798,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte - if (surface->resource.pool == WINED3D_POOL_SCRATCH) - ERR("Not supported on scratch surfaces.\n"); - -- if (surface->locations & location) -+ if (surface->resource.locations & location) - { - TRACE("surface is already in texture\n"); - return; -@@ -2109,7 +2109,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, - create_dib = TRUE; - } - -- surface->locations = 0; -+ surface->resource.locations = 0; - wined3d_resource_free_sysmem(&surface->resource); - - width = texture_resource->width; -@@ -3175,9 +3175,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) - back->flags = front->flags; - front->flags = tmp_flags; - -- tmp_flags = back->locations; -- back->locations = front->locations; -- front->locations = tmp_flags; -+ tmp_flags = back->resource.locations; -+ back->resource.locations = front->resource.locations; -+ front->resource.locations = tmp_flags; - } - } - -@@ -3356,7 +3356,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 */ -- src_surface->locations &= ~WINED3D_LOCATION_TEXTURE_RGB; -+ src_surface->resource.locations &= ~WINED3D_LOCATION_TEXTURE_RGB; - } - - /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3894,13 +3894,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface, - { - TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); - -- if (((surface->locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) -- || (!(surface->locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB))) -+ if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) -+ || (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) -+ && (location & WINED3D_LOCATION_TEXTURE_RGB))) - wined3d_texture_set_dirty(surface->container); - - surface->ds_current_size.cx = w; - surface->ds_current_size.cy = h; -- surface->locations = location; -+ surface->resource.locations = location; - } - - /* Context activation is done by the caller. */ -@@ -3915,7 +3916,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co - /* TODO: Make this work for modes other than FBO */ - if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; - -- if (!(surface->locations & location)) -+ if (!(surface->resource.locations & location)) - { - w = surface->ds_current_size.cx; - h = surface->ds_current_size.cy; -@@ -3941,7 +3942,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co - return; - } - -- if (surface->locations & WINED3D_LOCATION_DISCARDED) -+ if (surface->resource.locations & WINED3D_LOCATION_DISCARDED) - { - TRACE("Surface was discarded, no need copy data.\n"); - switch (location) -@@ -3958,17 +3959,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co - default: - FIXME("Unhandled location %#x\n", location); - } -- surface->locations &= ~WINED3D_LOCATION_DISCARDED; -- surface->locations |= location; -+ surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED; -+ surface->resource.locations |= location; - surface->ds_current_size.cx = surface->resource.width; - surface->ds_current_size.cy = surface->resource.height; - return; - } - -- if (!surface->locations) -+ if (!surface->resource.locations) - { - FIXME("No up to date depth stencil location.\n"); -- surface->locations |= location; -+ surface->resource.locations |= location; - surface->ds_current_size.cx = surface->resource.width; - surface->ds_current_size.cy = surface->resource.height; - return; -@@ -4057,7 +4058,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co - ERR("Invalid location (%#x) specified.\n", location); - } - -- surface->locations |= location; -+ surface->resource.locations |= location; - surface->ds_current_size.cx = surface->resource.width; - surface->ds_current_size.cy = surface->resource.height; - } -@@ -4066,7 +4067,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location) - { - TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); - -- surface->locations |= location; -+ surface->resource.locations |= location; - } - - void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) -@@ -4075,9 +4076,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location - - if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - wined3d_texture_set_dirty(surface->container); -- surface->locations &= ~location; -+ surface->resource.locations &= ~location; - -- if (!surface->locations) -+ if (!surface->resource.locations) - ERR("Surface %p does not have any up to date location.\n", surface); - } - -@@ -4113,7 +4114,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD - UINT size = surface->resource.size; - - surface_get_memory(surface, &dst, location); -- surface_get_memory(surface, &src, surface->locations); -+ surface_get_memory(surface, &src, surface->resource.locations); - - if (dst.buffer_object) - { -@@ -4146,33 +4147,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface, - { - const struct wined3d_gl_info *gl_info = context->gl_info; - -- if (surface->locations & surface_simple_locations) -+ if (surface->resource.locations & surface_simple_locations) - { - surface_copy_simple_location(surface, dst_location); - return; - } - -- if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) -+ if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) - surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); - - /* Download the surface to system memory. */ -- if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -+ if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - { - wined3d_texture_bind_and_dirtify(surface->container, context, -- !(surface->locations & WINED3D_LOCATION_TEXTURE_RGB)); -+ !(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB)); - surface_download_data(surface, gl_info, dst_location); - - return; - } - -- if (surface->locations & WINED3D_LOCATION_DRAWABLE) -+ if (surface->resource.locations & WINED3D_LOCATION_DRAWABLE) - { - read_from_framebuffer(surface, context, dst_location); - return; - } - - FIXME("Can't load surface %p with location flags %s into sysmem.\n", -- surface, wined3d_debug_location(surface->locations)); -+ surface, wined3d_debug_location(surface->resource.locations)); - } - - /* Context activation is done by the caller. */ -@@ -4212,14 +4213,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - - if (wined3d_settings.offscreen_rendering_mode != ORM_FBO - && wined3d_resource_is_offscreen(&texture->resource) -- && (surface->locations & WINED3D_LOCATION_DRAWABLE)) -+ && (surface->resource.locations & WINED3D_LOCATION_DRAWABLE)) - { - surface_load_fb_texture(surface, srgb); - - return WINED3D_OK; - } - -- if (surface->locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) -+ if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) - && (surface->container->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB) - && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, - NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, -@@ -4235,13 +4236,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - return WINED3D_OK; - } - -- if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) -+ if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) - && (!srgb || (surface->container->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)) - && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, - NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, - NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) - { -- DWORD src_location = surface->locations & WINED3D_LOCATION_RB_RESOLVED ? -+ DWORD src_location = surface->resource.locations & WINED3D_LOCATION_RB_RESOLVED ? - WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE; - DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; - RECT rect = {0, 0, surface->resource.width, surface->resource.height}; -@@ -4256,7 +4257,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - - if (srgb) - { -- if ((surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) -+ if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) - == WINED3D_LOCATION_TEXTURE_RGB) - { - /* Performance warning... */ -@@ -4267,7 +4268,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - } - else - { -- if ((surface->locations & (WINED3D_LOCATION_TEXTURE_SRGB | surface->resource.map_binding)) -+ if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | surface->resource.map_binding)) - == WINED3D_LOCATION_TEXTURE_SRGB) - { - /* Performance warning... */ -@@ -4277,7 +4278,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - } - } - -- if (!(surface->locations & surface_simple_locations)) -+ if (!(surface->resource.locations & surface_simple_locations)) - { - WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); - /* Lets hope we get it from somewhere... */ -@@ -4312,7 +4313,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - surface_remove_pbo(surface, gl_info); - } - -- surface_get_memory(surface, &data, surface->locations); -+ surface_get_memory(surface, &data, surface->resource.locations); - if (format.convert) - { - /* This code is entered for texture formats which need a fixup. */ -@@ -4368,7 +4369,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct - { - RECT rect = {0, 0, surface->resource.width, surface->resource.height}; - -- if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE)) -+ if (!(surface->resource.locations & WINED3D_LOCATION_RB_MULTISAMPLE)) - ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n", - surface); - -@@ -4386,12 +4387,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte - if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) - { - if (location == WINED3D_LOCATION_TEXTURE_RGB -- && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) -+ && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) - { - surface_load_ds_location(surface, context, location); - return; - } -- else if (location & surface->locations -+ else if (location & surface->resource.locations - && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) - { - /* Already up to date, nothing to do. */ -@@ -4400,12 +4401,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte - else - { - FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n", -- wined3d_debug_location(surface->locations), wined3d_debug_location(location)); -+ wined3d_debug_location(surface->resource.locations), wined3d_debug_location(location)); - return; - } - } - -- if (surface->locations & location) -+ if (surface->resource.locations & location) - { - TRACE("Location already up to date.\n"); - return; -@@ -4419,7 +4420,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte - required_access, surface->resource.access_flags); - } - -- if (!surface->locations) -+ if (!surface->resource.locations) - { - ERR("Surface %p does not have any up to date location.\n", surface); - surface->flags |= SFLAG_LOST; -@@ -4458,7 +4459,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte - - surface_validate_location(surface, location); - -- if (location != WINED3D_LOCATION_SYSMEM && (surface->locations & WINED3D_LOCATION_SYSMEM)) -+ if (location != WINED3D_LOCATION_SYSMEM && (surface->resource.locations & WINED3D_LOCATION_SYSMEM)) - surface_evict_sysmem(surface); - - return; -@@ -5508,8 +5509,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - - /* In principle this would apply to depth blits as well, but we don't - * implement those in the CPU blitter at the moment. */ -- if ((dst_surface->locations & dst_surface->resource.map_binding) -- && (!src_surface || (src_surface->locations & src_surface->resource.map_binding))) -+ if ((dst_surface->resource.locations & dst_surface->resource.map_binding) -+ && (!src_surface || (src_surface->resource.locations & src_surface->resource.map_binding))) - { - if (scale) - TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5549,8 +5550,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - color_key = &src_surface->container->async.src_blt_color_key; - blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY; - } -- else if ((src_surface->locations & WINED3D_LOCATION_SYSMEM) -- && !(dst_surface->locations & WINED3D_LOCATION_SYSMEM)) -+ else if ((src_surface->resource.locations & WINED3D_LOCATION_SYSMEM) -+ && !(dst_surface->resource.locations & WINED3D_LOCATION_SYSMEM)) - { - /* Upload */ - if (scale) -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 4f4d4df..e702d61 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -555,8 +555,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - } - - front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); -- if (!swapchain->render_to_fbo && ((front->locations & WINED3D_LOCATION_SYSMEM) -- || (back_buffer->locations & WINED3D_LOCATION_SYSMEM))) -+ if (!swapchain->render_to_fbo && ((front->resource.locations & WINED3D_LOCATION_SYSMEM) -+ || (back_buffer->resource.locations & WINED3D_LOCATION_SYSMEM))) - { - /* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying - * Doesn't work with render_to_fbo because we're not flipping -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 2828e47..bc6f994 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2348,7 +2348,6 @@ struct wined3d_surface - const struct wined3d_surface_ops *surface_ops; - struct wined3d_texture *container; - void *user_memory; -- DWORD locations; - - DWORD flags; - --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0011-wined3d-Store-volume-locations-in-the-resource.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0011-wined3d-Store-volume-locations-in-the-resource.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0011-wined3d-Store-volume-locations-in-the-resource.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0011-wined3d-Store-volume-locations-in-the-resource.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,207 @@ +From 81726de3e2c63759ff771038ec1a829758314bc7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 3 Oct 2013 12:31:24 +0200 +Subject: wined3d: Store volume locations in the resource. + +--- + dlls/wined3d/volume.c | 46 +++++++++++++++++++++--------------------- + dlls/wined3d/wined3d_private.h | 5 +++-- + 2 files changed, 26 insertions(+), 25 deletions(-) + +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 1a5e629..5f5fe8b 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -102,15 +102,15 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine + void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) + { + TRACE("Volume %p, setting %s.\n", volume, wined3d_debug_location(location)); +- volume->locations |= location; +- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->locations)); ++ volume->resource.locations |= location; ++ TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations)); + } + + void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) + { + TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location)); +- volume->locations &= ~location; +- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->locations)); ++ volume->resource.locations &= ~location; ++ TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations)); + } + + /* Context activation is done by the caller. */ +@@ -218,9 +218,9 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + DWORD required_access = volume_access_from_location(location); + + TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location), +- wined3d_debug_location(volume->locations)); ++ wined3d_debug_location(volume->resource.locations)); + +- if ((volume->locations & location) == location) ++ if ((volume->resource.locations & location) == location) + { + TRACE("Location(s) already up to date.\n"); + return; +@@ -243,36 +243,36 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + && !(volume->container->flags & WINED3D_TEXTURE_SRGB_ALLOCATED))) + ERR("Trying to load (s)RGB texture without prior allocation.\n"); + +- if (volume->locations & WINED3D_LOCATION_DISCARDED) ++ if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) + { + TRACE("Volume previously discarded, nothing to do.\n"); + wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED); + } +- else if (volume->locations & WINED3D_LOCATION_SYSMEM) ++ else if (volume->resource.locations & WINED3D_LOCATION_SYSMEM) + { + struct wined3d_const_bo_address data = {0, volume->resource.heap_memory}; + wined3d_texture_bind_and_dirtify(volume->container, context, + location == WINED3D_LOCATION_TEXTURE_SRGB); + wined3d_volume_upload_data(volume, context, &data); + } +- else if (volume->locations & WINED3D_LOCATION_BUFFER) ++ else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) + { + struct wined3d_const_bo_address data = {volume->pbo, NULL}; + wined3d_texture_bind_and_dirtify(volume->container, context, + location == WINED3D_LOCATION_TEXTURE_SRGB); + wined3d_volume_upload_data(volume, context, &data); + } +- else if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB) ++ else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) + { + wined3d_volume_srgb_transfer(volume, context, TRUE); + } +- else if (volume->locations & WINED3D_LOCATION_TEXTURE_SRGB) ++ else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_SRGB) + { + wined3d_volume_srgb_transfer(volume, context, FALSE); + } + else + { +- FIXME("Implement texture loading from %s.\n", wined3d_debug_location(volume->locations)); ++ FIXME("Implement texture loading from %s.\n", wined3d_debug_location(volume->resource.locations)); + return; + } + wined3d_volume_validate_location(volume, location); +@@ -286,16 +286,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + if (!volume->resource.heap_memory) + ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n"); + +- if (volume->locations & WINED3D_LOCATION_DISCARDED) ++ if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) + { + TRACE("Volume previously discarded, nothing to do.\n"); + wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED); + } +- else if (volume->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) ++ else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + { + struct wined3d_bo_address data = {0, volume->resource.heap_memory}; + +- if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB) ++ if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) + wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); + else + wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); +@@ -306,7 +306,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + else + { + FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n", +- wined3d_debug_location(volume->locations)); ++ wined3d_debug_location(volume->resource.locations)); + return; + } + wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); +@@ -316,16 +316,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + if (!volume->pbo) + ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); + +- if (volume->locations & WINED3D_LOCATION_DISCARDED) ++ if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) + { + TRACE("Volume previously discarded, nothing to do.\n"); + wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED); + } +- else if (volume->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) ++ else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + { + struct wined3d_bo_address data = {volume->pbo, NULL}; + +- if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB) ++ if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) + wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); + else + wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); +@@ -335,7 +335,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + else + { + FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n", +- wined3d_debug_location(volume->locations)); ++ wined3d_debug_location(volume->resource.locations)); + return; + } + wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER); +@@ -343,7 +343,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + + default: + FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location), +- wined3d_debug_location(volume->locations)); ++ wined3d_debug_location(volume->resource.locations)); + } + } + +@@ -600,7 +600,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + { + wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); + } +- else if (!(volume->locations & WINED3D_LOCATION_SYSMEM)) ++ else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM)) + { + context = context_acquire(device, NULL); + wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM); +@@ -748,7 +748,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture + } + + volume->texture_level = level; +- volume->locations = WINED3D_LOCATION_DISCARDED; ++ volume->resource.locations = WINED3D_LOCATION_DISCARDED; + + if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC + && gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 254dfd7..f2d3943 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -5,7 +5,7 @@ + * Copyright 2002-2003 Raphael Junqueira + * Copyright 2002-2003, 2004 Jason Edmeades + * Copyright 2005 Oliver Stieber +- * Copyright 2006-2011, 2013 Stefan Dösinger for CodeWeavers ++ * Copyright 2006-2011, 2013-2014 Stefan Dösinger for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -2123,6 +2123,7 @@ struct wined3d_resource + void *heap_memory; + UINT custom_row_pitch, custom_slice_pitch; + struct list resource_list_entry; ++ DWORD locations; + + void *parent; + const struct wined3d_parent_ops *parent_ops; +@@ -2271,7 +2272,7 @@ struct wined3d_volume + struct wined3d_resource resource; + struct wined3d_texture *container; + +- DWORD flags, locations; ++ DWORD flags; + GLint texture_level; + DWORD download_count; + GLuint pbo; +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0012-wined3d-Move-validate_location-to-resource.c.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0012-wined3d-Move-validate_location-to-resource.c.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0012-wined3d-Move-validate_location-to-resource.c.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0012-wined3d-Move-validate_location-to-resource.c.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,129 @@ +From e872730f9d2dbdb4220860cc6ee5588860971223 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 3 Oct 2013 12:34:13 +0200 +Subject: wined3d: Move validate_location to resource.c. + +--- + dlls/wined3d/resource.c | 7 +++++++ + dlls/wined3d/texture.c | 4 +--- + dlls/wined3d/volume.c | 19 ++++++------------- + dlls/wined3d/wined3d_private.h | 1 + + 4 files changed, 15 insertions(+), 16 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 8032a4c..2731f27 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -362,3 +362,10 @@ void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, U + + TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); + } ++ ++void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) ++{ ++ TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location)); ++ resource->locations |= location; ++ TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); ++} +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 9fe7d25..92f7744 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -1331,9 +1331,7 @@ static void texture3d_sub_resource_invalidate_location(struct wined3d_resource * + + static void texture3d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) + { +- struct wined3d_volume *volume = volume_from_resource(sub_resource); +- +- wined3d_volume_validate_location(volume, location); ++ wined3d_resource_validate_location(sub_resource, location); + } + + static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_resource, +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 62eb5ed..e1fa454 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -99,13 +99,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine + HeapFree(GetProcessHeap(), 0, converted_mem); + } + +-void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) +-{ +- TRACE("Volume %p, setting %s.\n", volume, wined3d_debug_location(location)); +- volume->resource.locations |= location; +- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations)); +-} +- + void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) + { + TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location)); +@@ -271,7 +264,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + FIXME("Implement texture loading from %s.\n", wined3d_debug_location(volume->resource.locations)); + return; + } +- wined3d_volume_validate_location(volume, location); ++ wined3d_resource_validate_location(&volume->resource, location); + + if (wined3d_volume_can_evict(volume)) + wined3d_volume_evict_sysmem(volume); +@@ -305,7 +298,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + wined3d_debug_location(volume->resource.locations)); + return; + } +- wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); ++ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); + break; + + case WINED3D_LOCATION_BUFFER: +@@ -334,7 +327,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + wined3d_debug_location(volume->resource.locations)); + return; + } +- wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER); ++ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER); + break; + + default: +@@ -413,7 +406,7 @@ static void volume_unload(struct wined3d_resource *resource) + else + { + ERR("Out of memory when unloading volume %p.\n", volume); +- wined3d_volume_validate_location(volume, WINED3D_LOCATION_DISCARDED); ++ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); + wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_DISCARDED); + } + +@@ -559,7 +552,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + + wined3d_volume_prepare_pbo(volume, context); + if (flags & WINED3D_MAP_DISCARD) +- wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER); ++ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER); + else + wined3d_volume_load_location(volume, context, WINED3D_LOCATION_BUFFER); + +@@ -594,7 +587,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + + if (flags & WINED3D_MAP_DISCARD) + { +- wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); ++ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); + } + else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM)) + { +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index a431453..f47c2fb 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2125,6 +2125,7 @@ GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; + BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; + void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; + + /* Tests show that the start address of resources is 32 byte aligned */ + #define RESOURCE_ALIGNMENT 16 +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,233 +0,0 @@ -From bebac68a70a4be81237cd5ba392870eed6f5eccc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 4 Jan 2014 00:53:47 +0100 -Subject: wined3d: Remove surface_validate_location. - ---- - dlls/wined3d/arb_program_shader.c | 2 +- - dlls/wined3d/device.c | 2 +- - dlls/wined3d/surface.c | 29 +++++++++++------------------ - dlls/wined3d/swapchain.c | 12 ++++++------ - dlls/wined3d/texture.c | 4 +--- - dlls/wined3d/wined3d_private.h | 1 - - 6 files changed, 20 insertions(+), 30 deletions(-) - -diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index 2ad6917..35637f2 100644 ---- a/dlls/wined3d/arb_program_shader.c -+++ b/dlls/wined3d/arb_program_shader.c -@@ -7921,7 +7921,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter, - - context_release(context); - -- surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); -+ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); - surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); - } - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index e84405e..95df08f 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -392,7 +392,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c - - if (rt) - { -- surface_validate_location(rt, rt->container->resource.draw_binding); -+ wined3d_resource_validate_location(&rt->resource, rt->container->resource.draw_binding); - surface_invalidate_location(rt, ~rt->container->resource.draw_binding); - } - } -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 8b2fb74..0599757 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -1167,7 +1167,7 @@ static void surface_unload(struct wined3d_resource *resource) - * and all flags get lost */ - surface_prepare_system_memory(surface); - memset(surface->resource.heap_memory, 0, surface->resource.size); -- surface_validate_location(surface, WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); - surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM); - - /* We also get here when the ddraw swapchain is destroyed, for example -@@ -1679,7 +1679,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P - - context_release(context); - -- surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); - surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); - - return WINED3D_OK; -@@ -2178,7 +2178,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, - valid_location = WINED3D_LOCATION_SYSMEM; - } - -- surface_validate_location(surface, valid_location); -+ wined3d_resource_validate_location(&surface->resource, valid_location); - - return WINED3D_OK; - } -@@ -2723,7 +2723,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - { - TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n", - wined3d_debug_location(surface->resource.map_binding)); -- surface_validate_location(surface, surface->resource.map_binding); -+ wined3d_resource_validate_location(&surface->resource, surface->resource.map_binding); - } - else - { -@@ -3282,7 +3282,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. */ -- surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); - surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); - } - -@@ -3555,7 +3555,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. */ -- surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); - surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); - } - -@@ -4058,13 +4058,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co - surface->ds_current_size.cy = surface->resource.height; - } - --void surface_validate_location(struct wined3d_surface *surface, DWORD location) --{ -- TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -- -- surface->resource.locations |= location; --} -- - void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) - { - TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4452,7 +4445,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte - break; - } - -- surface_validate_location(surface, location); -+ wined3d_resource_validate_location(&surface->resource, location); - - if (location != WINED3D_LOCATION_SYSMEM && (surface->resource.locations & WINED3D_LOCATION_SYSMEM)) - surface_evict_sysmem(surface); -@@ -4627,7 +4620,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter, - wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, - (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); - -- surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); -+ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); - surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); - } - -@@ -5599,7 +5592,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); - context_release(context); - -- surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); -+ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); - surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); - - return WINED3D_OK; -@@ -5695,7 +5688,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text - } - - surface->container = container; -- surface_validate_location(surface, WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); - list_init(&surface->renderbuffers); - list_init(&surface->overlays); - -@@ -5727,7 +5720,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text - if (surface->resource.map_binding == WINED3D_LOCATION_DIB) - { - wined3d_resource_free_sysmem(&surface->resource); -- surface_validate_location(surface, WINED3D_LOCATION_DIB); -+ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB); - surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM); - } - -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index e702d61..075bffc 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -569,19 +569,19 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - /* Tell the front buffer surface that is has been modified. However, - * the other locations were preserved during that, so keep the flags. - * This serves to update the emulated overlay, if any. */ -- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); -+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); - } - else - { -- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); -+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); - surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); -- surface_validate_location(back_buffer, WINED3D_LOCATION_DRAWABLE); -+ wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE); - surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE); - } - } - else - { -- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); -+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); - surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); - /* 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. -@@ -590,7 +590,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - */ - if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) - { -- surface_validate_location(back_buffer, back_buffer->container->resource.draw_binding); -+ wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding); - surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding); - } - } -@@ -865,7 +865,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 - wined3d_texture_set_swapchain(swapchain->front_buffer, swapchain); - if (!(device->wined3d->flags & WINED3D_NO3D)) - { -- surface_validate_location(front_buffer, WINED3D_LOCATION_DRAWABLE); -+ wined3d_resource_validate_location(&front_buffer->resource, WINED3D_LOCATION_DRAWABLE); - surface_invalidate_location(front_buffer, ~WINED3D_LOCATION_DRAWABLE); - } - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index d834cd8..bc9584a 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -798,9 +798,7 @@ static void texture2d_sub_resource_invalidate_location(struct wined3d_resource * - - static void texture2d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) - { -- struct wined3d_surface *surface = surface_from_resource(sub_resource); -- -- surface_validate_location(surface, location); -+ wined3d_resource_validate_location(sub_resource, location); - } - - static void texture2d_sub_resource_upload_data(struct wined3d_resource *sub_resource, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7b5a04f..06774c8 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2409,7 +2409,6 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, - const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN; - HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, - struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN; --void surface_validate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; - HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, - GLenum target, unsigned int level, unsigned int layer, DWORD flags, - struct wined3d_surface **surface) DECLSPEC_HIDDEN; --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -From 025d8d22909fa65d7315f97042cc12efa5809657 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 3 Oct 2013 12:36:46 +0200 -Subject: wined3d: Move invalidate_location to resource.c. - ---- - dlls/wined3d/device.c | 2 +- - dlls/wined3d/resource.c | 7 +++++++ - dlls/wined3d/texture.c | 4 +--- - dlls/wined3d/volume.c | 21 +++++++-------------- - dlls/wined3d/wined3d_private.h | 3 +-- - 5 files changed, 17 insertions(+), 20 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 99f4e96..bde37b1 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -3487,7 +3487,7 @@ static HRESULT device_update_volume(struct wined3d_device *device, - data.buffer_object = 0; - data.addr = src.data; - wined3d_volume_upload_data(dst_volume, context, &data); -- wined3d_volume_invalidate_location(dst_volume, ~WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); - - context_release(context); - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 2731f27..89865ef 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -369,3 +369,10 @@ void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD - resource->locations |= location; - TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); - } -+ -+void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) -+{ -+ TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location)); -+ resource->locations &= ~location; -+ TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); -+} -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 6692118..522ffd6 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -1322,9 +1322,7 @@ static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource - - static void texture3d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) - { -- struct wined3d_volume *volume = volume_from_resource(sub_resource); -- -- wined3d_volume_invalidate_location(volume, location); -+ wined3d_resource_invalidate_location(sub_resource, location); - } - - static void texture3d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index e1fa454..722f92e 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -99,13 +99,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine - HeapFree(GetProcessHeap(), 0, converted_mem); - } - --void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) --{ -- TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location)); -- volume->resource.locations &= ~location; -- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations)); --} -- - /* Context activation is done by the caller. */ - static void wined3d_volume_download_data(struct wined3d_volume *volume, - const struct wined3d_context *context, const struct wined3d_bo_address *data) -@@ -141,7 +134,7 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume, - static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) - { - wined3d_resource_free_sysmem(&volume->resource); -- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); - } - - static DWORD volume_access_from_location(DWORD location) -@@ -239,7 +232,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) - { - TRACE("Volume previously discarded, nothing to do.\n"); -- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED); -+ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); - } - else if (volume->resource.locations & WINED3D_LOCATION_SYSMEM) - { -@@ -278,7 +271,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) - { - TRACE("Volume previously discarded, nothing to do.\n"); -- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED); -+ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); - } - else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - { -@@ -308,7 +301,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) - { - TRACE("Volume previously discarded, nothing to do.\n"); -- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED); -+ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); - } - else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - { -@@ -401,13 +394,13 @@ static void volume_unload(struct wined3d_resource *resource) - context = context_acquire(device, NULL); - wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM); - context_release(context); -- wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_SYSMEM); - } - else - { - ERR("Out of memory when unloading volume %p.\n", volume); - wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); -- wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_DISCARDED); -+ wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); - } - - if (volume->pbo) -@@ -641,7 +634,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) - { - wined3d_texture_set_dirty(volume->container); -- wined3d_volume_invalidate_location(volume, ~volume->resource.map_binding); -+ wined3d_resource_invalidate_location(&volume->resource, ~volume->resource.map_binding); - } - - volume->resource.map_count++; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 3e13ae8..fd82ec3 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2126,6 +2126,7 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_H - DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; - void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; -+void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; - - /* Tests show that the start address of resources is 32 byte aligned */ - #define RESOURCE_ALIGNMENT 16 -@@ -2269,8 +2270,6 @@ HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wi - void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; - void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, - BOOL srgb_mode) DECLSPEC_HIDDEN; --void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; --void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; - void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, - const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; - --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0013-wined3d-Move-surface-locations-into-the-resource.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0013-wined3d-Move-surface-locations-into-the-resource.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0013-wined3d-Move-surface-locations-into-the-resource.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0013-wined3d-Move-surface-locations-into-the-resource.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,457 @@ +From 518ce36e50012eb7f2dea0e4daf34c73fae4456c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 21 Jan 2014 12:22:30 +0100 +Subject: wined3d: Move surface locations into the resource. + +--- + dlls/wined3d/arb_program_shader.c | 2 +- + dlls/wined3d/device.c | 4 +- + dlls/wined3d/drawprim.c | 2 +- + dlls/wined3d/surface.c | 99 ++++++++++++++++++++------------------- + dlls/wined3d/swapchain.c | 4 +- + dlls/wined3d/wined3d_private.h | 1 - + 6 files changed, 56 insertions(+), 56 deletions(-) + +diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c +index 0bd7c22..f218979 100644 +--- a/dlls/wined3d/arb_program_shader.c ++++ b/dlls/wined3d/arb_program_shader.c +@@ -7821,7 +7821,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter, + + /* Now load the surface */ + if (wined3d_settings.offscreen_rendering_mode != ORM_FBO +- && (src_surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_DRAWABLE)) ++ && (src_surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_DRAWABLE)) + == WINED3D_LOCATION_DRAWABLE + && !wined3d_resource_is_offscreen(&src_surface->container->resource)) + { +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 0521a94..b4bc3ac 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -236,7 +236,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context + { + RECT current_rect, r; + +- if (ds->locations & WINED3D_LOCATION_DISCARDED) ++ if (ds->resource.locations & WINED3D_LOCATION_DISCARDED) + { + /* Depth buffer was discarded, make it entirely current in its new location since + * there is no other place where we would get data anyway. */ +@@ -244,7 +244,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context + return; + } + +- if (ds->locations & location) ++ if (ds->resource.locations & location) + SetRect(¤t_rect, 0, 0, + ds->ds_current_size.cx, + ds->ds_current_size.cy); +diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c +index 913ada5..567550e 100644 +--- a/dlls/wined3d/drawprim.c ++++ b/dlls/wined3d/drawprim.c +@@ -651,7 +651,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co + if (!context->render_offscreen && ds != device->onscreen_depth_stencil) + device_switch_onscreen_ds(device, context, ds); + +- if (ds->locations & location) ++ if (ds->resource.locations & location) + SetRect(¤t_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy); + else + SetRectEmpty(¤t_rect); +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 9abffb3..78f92d3 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -556,7 +556,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface) + if (!wined3d_resource_allocate_sysmem(&surface->resource)) + ERR("Failed to allocate system memory.\n"); + +- if (surface->locations & WINED3D_LOCATION_SYSMEM) ++ if (surface->resource.locations & WINED3D_LOCATION_SYSMEM) + ERR("Surface without system memory has WINED3D_LOCATION_SYSMEM set.\n"); + } + +@@ -706,7 +706,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) + } + + if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) +- surface->locations = WINED3D_LOCATION_DISCARDED; ++ surface->resource.locations = WINED3D_LOCATION_DISCARDED; + + if (surface_use_pbo(surface)) + surface->resource.map_binding = WINED3D_LOCATION_BUFFER; +@@ -746,7 +746,7 @@ static void surface_unmap(struct wined3d_surface *surface) + ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding)); + } + +- if (surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)) ++ if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)) + { + TRACE("Not dirtified, nothing to do.\n"); + return; +@@ -1675,7 +1675,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P + surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); + +- surface_get_memory(src_surface, &data, src_surface->locations); ++ surface_get_memory(src_surface, &data, src_surface->resource.locations); + wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); + + wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, +@@ -1798,7 +1798,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte + if (surface->resource.pool == WINED3D_POOL_SCRATCH) + ERR("Not supported on scratch surfaces.\n"); + +- if (surface->locations & location) ++ if (surface->resource.locations & location) + { + TRACE("surface is already in texture\n"); + return; +@@ -2109,7 +2109,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, + create_dib = TRUE; + } + +- surface->locations = 0; ++ surface->resource.locations = 0; + wined3d_resource_free_sysmem(&surface->resource); + + width = texture_resource->width; +@@ -3175,9 +3175,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) + back->flags = front->flags; + front->flags = tmp_flags; + +- tmp_flags = back->locations; +- back->locations = front->locations; +- front->locations = tmp_flags; ++ tmp_flags = back->resource.locations; ++ back->resource.locations = front->resource.locations; ++ front->resource.locations = tmp_flags; + } + } + +@@ -3356,7 +3356,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 */ +- src_surface->locations &= ~WINED3D_LOCATION_TEXTURE_RGB; ++ src_surface->resource.locations &= ~WINED3D_LOCATION_TEXTURE_RGB; + } + + /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag +@@ -3894,13 +3894,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface, + { + TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); + +- if (((surface->locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) +- || (!(surface->locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB))) ++ if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) ++ || (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) ++ && (location & WINED3D_LOCATION_TEXTURE_RGB))) + wined3d_texture_set_dirty(surface->container); + + surface->ds_current_size.cx = w; + surface->ds_current_size.cy = h; +- surface->locations = location; ++ surface->resource.locations = location; + } + + /* Context activation is done by the caller. */ +@@ -3915,7 +3916,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co + /* TODO: Make this work for modes other than FBO */ + if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; + +- if (!(surface->locations & location)) ++ if (!(surface->resource.locations & location)) + { + w = surface->ds_current_size.cx; + h = surface->ds_current_size.cy; +@@ -3941,7 +3942,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co + return; + } + +- if (surface->locations & WINED3D_LOCATION_DISCARDED) ++ if (surface->resource.locations & WINED3D_LOCATION_DISCARDED) + { + TRACE("Surface was discarded, no need copy data.\n"); + switch (location) +@@ -3958,17 +3959,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co + default: + FIXME("Unhandled location %#x\n", location); + } +- surface->locations &= ~WINED3D_LOCATION_DISCARDED; +- surface->locations |= location; ++ surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED; ++ surface->resource.locations |= location; + surface->ds_current_size.cx = surface->resource.width; + surface->ds_current_size.cy = surface->resource.height; + return; + } + +- if (!surface->locations) ++ if (!surface->resource.locations) + { + FIXME("No up to date depth stencil location.\n"); +- surface->locations |= location; ++ surface->resource.locations |= location; + surface->ds_current_size.cx = surface->resource.width; + surface->ds_current_size.cy = surface->resource.height; + return; +@@ -4057,7 +4058,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co + ERR("Invalid location (%#x) specified.\n", location); + } + +- surface->locations |= location; ++ surface->resource.locations |= location; + surface->ds_current_size.cx = surface->resource.width; + surface->ds_current_size.cy = surface->resource.height; + } +@@ -4066,7 +4067,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location) + { + TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); + +- surface->locations |= location; ++ surface->resource.locations |= location; + } + + void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) +@@ -4075,9 +4076,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location + + if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + wined3d_texture_set_dirty(surface->container); +- surface->locations &= ~location; ++ surface->resource.locations &= ~location; + +- if (!surface->locations) ++ if (!surface->resource.locations) + ERR("Surface %p does not have any up to date location.\n", surface); + } + +@@ -4113,7 +4114,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD + UINT size = surface->resource.size; + + surface_get_memory(surface, &dst, location); +- surface_get_memory(surface, &src, surface->locations); ++ surface_get_memory(surface, &src, surface->resource.locations); + + if (dst.buffer_object) + { +@@ -4146,33 +4147,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface, + { + const struct wined3d_gl_info *gl_info = context->gl_info; + +- if (surface->locations & surface_simple_locations) ++ if (surface->resource.locations & surface_simple_locations) + { + surface_copy_simple_location(surface, dst_location); + return; + } + +- if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) ++ if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) + surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); + + /* Download the surface to system memory. */ +- if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) ++ if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + { + wined3d_texture_bind_and_dirtify(surface->container, context, +- !(surface->locations & WINED3D_LOCATION_TEXTURE_RGB)); ++ !(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB)); + surface_download_data(surface, gl_info, dst_location); + + return; + } + +- if (surface->locations & WINED3D_LOCATION_DRAWABLE) ++ if (surface->resource.locations & WINED3D_LOCATION_DRAWABLE) + { + read_from_framebuffer(surface, context, dst_location); + return; + } + + FIXME("Can't load surface %p with location flags %s into sysmem.\n", +- surface, wined3d_debug_location(surface->locations)); ++ surface, wined3d_debug_location(surface->resource.locations)); + } + + /* Context activation is done by the caller. */ +@@ -4212,14 +4213,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + + if (wined3d_settings.offscreen_rendering_mode != ORM_FBO + && wined3d_resource_is_offscreen(&texture->resource) +- && (surface->locations & WINED3D_LOCATION_DRAWABLE)) ++ && (surface->resource.locations & WINED3D_LOCATION_DRAWABLE)) + { + surface_load_fb_texture(surface, srgb); + + return WINED3D_OK; + } + +- if (surface->locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) ++ if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) + && (surface->container->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB) + && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, +@@ -4235,13 +4236,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + return WINED3D_OK; + } + +- if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) ++ if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) + && (!srgb || (surface->container->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)) + && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) + { +- DWORD src_location = surface->locations & WINED3D_LOCATION_RB_RESOLVED ? ++ DWORD src_location = surface->resource.locations & WINED3D_LOCATION_RB_RESOLVED ? + WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE; + DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; + RECT rect = {0, 0, surface->resource.width, surface->resource.height}; +@@ -4256,7 +4257,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + + if (srgb) + { +- if ((surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) ++ if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) + == WINED3D_LOCATION_TEXTURE_RGB) + { + /* Performance warning... */ +@@ -4267,7 +4268,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + } + else + { +- if ((surface->locations & (WINED3D_LOCATION_TEXTURE_SRGB | surface->resource.map_binding)) ++ if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | surface->resource.map_binding)) + == WINED3D_LOCATION_TEXTURE_SRGB) + { + /* Performance warning... */ +@@ -4277,7 +4278,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + } + } + +- if (!(surface->locations & surface_simple_locations)) ++ if (!(surface->resource.locations & surface_simple_locations)) + { + WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); + /* Lets hope we get it from somewhere... */ +@@ -4312,7 +4313,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + surface_remove_pbo(surface, gl_info); + } + +- surface_get_memory(surface, &data, surface->locations); ++ surface_get_memory(surface, &data, surface->resource.locations); + if (format.convert) + { + /* This code is entered for texture formats which need a fixup. */ +@@ -4368,7 +4369,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct + { + RECT rect = {0, 0, surface->resource.width, surface->resource.height}; + +- if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE)) ++ if (!(surface->resource.locations & WINED3D_LOCATION_RB_MULTISAMPLE)) + ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n", + surface); + +@@ -4386,12 +4387,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte + if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) + { + if (location == WINED3D_LOCATION_TEXTURE_RGB +- && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) ++ && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) + { + surface_load_ds_location(surface, context, location); + return; + } +- else if (location & surface->locations ++ else if (location & surface->resource.locations + && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) + { + /* Already up to date, nothing to do. */ +@@ -4400,12 +4401,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte + else + { + FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n", +- wined3d_debug_location(surface->locations), wined3d_debug_location(location)); ++ wined3d_debug_location(surface->resource.locations), wined3d_debug_location(location)); + return; + } + } + +- if (surface->locations & location) ++ if (surface->resource.locations & location) + { + TRACE("Location already up to date.\n"); + return; +@@ -4419,7 +4420,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte + required_access, surface->resource.access_flags); + } + +- if (!surface->locations) ++ if (!surface->resource.locations) + { + ERR("Surface %p does not have any up to date location.\n", surface); + surface->flags |= SFLAG_LOST; +@@ -4458,7 +4459,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte + + surface_validate_location(surface, location); + +- if (location != WINED3D_LOCATION_SYSMEM && (surface->locations & WINED3D_LOCATION_SYSMEM)) ++ if (location != WINED3D_LOCATION_SYSMEM && (surface->resource.locations & WINED3D_LOCATION_SYSMEM)) + surface_evict_sysmem(surface); + + return; +@@ -5508,8 +5509,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + + /* In principle this would apply to depth blits as well, but we don't + * implement those in the CPU blitter at the moment. */ +- if ((dst_surface->locations & dst_surface->resource.map_binding) +- && (!src_surface || (src_surface->locations & src_surface->resource.map_binding))) ++ if ((dst_surface->resource.locations & dst_surface->resource.map_binding) ++ && (!src_surface || (src_surface->resource.locations & src_surface->resource.map_binding))) + { + if (scale) + TRACE("Not doing sysmem blit because of scaling.\n"); +@@ -5549,8 +5550,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + color_key = &src_surface->container->async.src_blt_color_key; + blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY; + } +- else if ((src_surface->locations & WINED3D_LOCATION_SYSMEM) +- && !(dst_surface->locations & WINED3D_LOCATION_SYSMEM)) ++ else if ((src_surface->resource.locations & WINED3D_LOCATION_SYSMEM) ++ && !(dst_surface->resource.locations & WINED3D_LOCATION_SYSMEM)) + { + /* Upload */ + if (scale) +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index 4f4d4df..e702d61 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -555,8 +555,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + } + + front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); +- if (!swapchain->render_to_fbo && ((front->locations & WINED3D_LOCATION_SYSMEM) +- || (back_buffer->locations & WINED3D_LOCATION_SYSMEM))) ++ if (!swapchain->render_to_fbo && ((front->resource.locations & WINED3D_LOCATION_SYSMEM) ++ || (back_buffer->resource.locations & WINED3D_LOCATION_SYSMEM))) + { + /* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying + * Doesn't work with render_to_fbo because we're not flipping +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 2828e47..bc6f994 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2348,7 +2348,6 @@ struct wined3d_surface + const struct wined3d_surface_ops *surface_ops; + struct wined3d_texture *container; + void *user_memory; +- DWORD locations; + + DWORD flags; + +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0014-wined3d-Invalidate-containers-via-callback.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0014-wined3d-Invalidate-containers-via-callback.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0014-wined3d-Invalidate-containers-via-callback.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0014-wined3d-Invalidate-containers-via-callback.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,142 +0,0 @@ -From 28ac147348a282c737e546db1c83c213060915a0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 17 Nov 2013 18:44:48 +0100 -Subject: wined3d: Invalidate containers via callback. - ---- - dlls/wined3d/buffer.c | 6 ++++++ - dlls/wined3d/resource.c | 2 ++ - dlls/wined3d/surface.c | 6 ++++++ - dlls/wined3d/texture.c | 6 ++++++ - dlls/wined3d/volume.c | 12 +++++++++--- - dlls/wined3d/wined3d_private.h | 1 + - 6 files changed, 30 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 989026f..d9bc820 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1123,11 +1123,17 @@ static ULONG buffer_resource_decref(struct wined3d_resource *resource) - return wined3d_buffer_decref(buffer_from_resource(resource)); - } - -+static void wined3d_buffer_location_invalidated(struct wined3d_resource *resource, DWORD location) -+{ -+ ERR("Not yet implemented.\n"); -+} -+ - static const struct wined3d_resource_ops buffer_resource_ops = - { - buffer_resource_incref, - buffer_resource_decref, - buffer_unload, -+ wined3d_buffer_location_invalidated, - }; - - static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 89865ef..a63eab8 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -375,4 +375,6 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO - TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location)); - resource->locations &= ~location; - TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); -+ -+ resource->resource_ops->resource_location_invalidated(resource, location); - } -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 909d405..1a57219 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -1273,11 +1273,17 @@ static void surface_unload(struct wined3d_resource *resource) - resource_unload(resource); - } - -+static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location) -+{ -+ ERR("Not yet implemented.\n"); -+} -+ - static const struct wined3d_resource_ops surface_resource_ops = - { - surface_resource_incref, - surface_resource_decref, - surface_unload, -+ wined3d_surface_location_invalidated, - }; - - static const struct wined3d_surface_ops surface_ops = -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 522ffd6..f2bba1a 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -1036,11 +1036,17 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) - wined3d_texture_unload_gl_texture(texture); - } - -+static void wined3d_texture_load_location_invalidated(struct wined3d_resource *resource, DWORD location) -+{ -+ ERR("Should not be called on textures.\n"); -+} -+ - static const struct wined3d_resource_ops texture_resource_ops = - { - texture_resource_incref, - texture_resource_decref, - wined3d_texture_unload, -+ wined3d_texture_load_location_invalidated, - }; - - 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 722f92e..2cc0baf 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -632,10 +632,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - } - - if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) -- { -- wined3d_texture_set_dirty(volume->container); - wined3d_resource_invalidate_location(&volume->resource, ~volume->resource.map_binding); -- } - - volume->resource.map_count++; - -@@ -689,11 +686,20 @@ static ULONG volume_resource_decref(struct wined3d_resource *resource) - return wined3d_volume_decref(volume_from_resource(resource)); - } - -+static void wined3d_volume_location_invalidated(struct wined3d_resource *resource, DWORD location) -+{ -+ struct wined3d_volume *volume = volume_from_resource(resource); -+ -+ if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -+ wined3d_texture_set_dirty(volume->container); -+} -+ - static const struct wined3d_resource_ops volume_resource_ops = - { - volume_resource_incref, - volume_resource_decref, - volume_unload, -+ wined3d_volume_location_invalidated, - }; - - static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index fd82ec3..acee894 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2068,6 +2068,7 @@ struct wined3d_resource_ops - ULONG (*resource_incref)(struct wined3d_resource *resource); - ULONG (*resource_decref)(struct wined3d_resource *resource); - void (*resource_unload)(struct wined3d_resource *resource); -+ void (*resource_location_invalidated)(struct wined3d_resource *resource, DWORD location); - }; - - struct wined3d_resource --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0014-wined3d-Remove-surface_validate_location.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0014-wined3d-Remove-surface_validate_location.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0014-wined3d-Remove-surface_validate_location.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0014-wined3d-Remove-surface_validate_location.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,233 @@ +From f697640248f83b974829df63769cbb6fb4f6b722 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 4 Jan 2014 00:53:47 +0100 +Subject: wined3d: Remove surface_validate_location. + +--- + dlls/wined3d/arb_program_shader.c | 2 +- + dlls/wined3d/device.c | 2 +- + dlls/wined3d/surface.c | 29 +++++++++++------------------ + dlls/wined3d/swapchain.c | 12 ++++++------ + dlls/wined3d/texture.c | 4 +--- + dlls/wined3d/wined3d_private.h | 1 - + 6 files changed, 20 insertions(+), 30 deletions(-) + +diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c +index 57bc787..bdfc42d 100644 +--- a/dlls/wined3d/arb_program_shader.c ++++ b/dlls/wined3d/arb_program_shader.c +@@ -7864,7 +7864,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter, + + context_release(context); + +- surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); ++ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); + surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); + } + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 08987f2..210e53e 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -392,7 +392,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c + + if (rt) + { +- surface_validate_location(rt, rt->container->resource.draw_binding); ++ wined3d_resource_validate_location(&rt->resource, rt->container->resource.draw_binding); + surface_invalidate_location(rt, ~rt->container->resource.draw_binding); + } + } +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 4a61d1b..8ec6ab8 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -1170,7 +1170,7 @@ static void surface_unload(struct wined3d_resource *resource) + * and all flags get lost */ + surface_prepare_system_memory(surface); + memset(surface->resource.heap_memory, 0, surface->resource.size); +- surface_validate_location(surface, WINED3D_LOCATION_SYSMEM); ++ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); + surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM); + + /* We also get here when the ddraw swapchain is destroyed, for example +@@ -1683,7 +1683,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P + + context_release(context); + +- surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); + surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); + + return WINED3D_OK; +@@ -2169,7 +2169,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, + valid_location = WINED3D_LOCATION_SYSMEM; + } + +- surface_validate_location(surface, valid_location); ++ wined3d_resource_validate_location(&surface->resource, valid_location); + + return WINED3D_OK; + } +@@ -2715,7 +2715,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + { + TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n", + wined3d_debug_location(surface->resource.map_binding)); +- surface_validate_location(surface, surface->resource.map_binding); ++ wined3d_resource_validate_location(&surface->resource, surface->resource.map_binding); + } + else + { +@@ -3274,7 +3274,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. */ +- surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); + surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); + } + +@@ -3547,7 +3547,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. */ +- surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); + surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); + } + +@@ -4053,13 +4053,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co + surface->ds_current_size.cy = surface->resource.height; + } + +-void surface_validate_location(struct wined3d_surface *surface, DWORD location) +-{ +- TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); +- +- surface->resource.locations |= location; +-} +- + void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) + { + TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); +@@ -4447,7 +4440,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte + break; + } + +- surface_validate_location(surface, location); ++ wined3d_resource_validate_location(&surface->resource, location); + + if (location != WINED3D_LOCATION_SYSMEM && (surface->resource.locations & WINED3D_LOCATION_SYSMEM)) + surface_evict_sysmem(surface); +@@ -4620,7 +4613,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter, + wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, + (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); + +- surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); ++ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); + surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); + } + +@@ -5600,7 +5593,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); + context_release(context); + +- surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); ++ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); + surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); + + return WINED3D_OK; +@@ -5698,7 +5691,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text + surface->container = container; + surface->resource.format_flags = container->resource.format_flags; + +- surface_validate_location(surface, WINED3D_LOCATION_SYSMEM); ++ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); + list_init(&surface->renderbuffers); + list_init(&surface->overlays); + +@@ -5730,7 +5723,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text + if (surface->resource.map_binding == WINED3D_LOCATION_DIB) + { + wined3d_resource_free_sysmem(&surface->resource); +- surface_validate_location(surface, WINED3D_LOCATION_DIB); ++ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB); + surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM); + } + +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index 2e91c7c..a62d245 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -569,19 +569,19 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + /* Tell the front buffer surface that is has been modified. However, + * the other locations were preserved during that, so keep the flags. + * This serves to update the emulated overlay, if any. */ +- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); ++ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); + } + else + { +- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); ++ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); + surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); +- surface_validate_location(back_buffer, WINED3D_LOCATION_DRAWABLE); ++ wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE); + surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE); + } + } + else + { +- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); ++ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); + surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); + /* 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. +@@ -590,7 +590,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + */ + if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) + { +- surface_validate_location(back_buffer, back_buffer->container->resource.draw_binding); ++ wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding); + surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding); + } + } +@@ -865,7 +865,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 + wined3d_texture_set_swapchain(swapchain->front_buffer, swapchain); + if (!(device->wined3d->flags & WINED3D_NO3D)) + { +- surface_validate_location(front_buffer, WINED3D_LOCATION_DRAWABLE); ++ wined3d_resource_validate_location(&front_buffer->resource, WINED3D_LOCATION_DRAWABLE); + surface_invalidate_location(front_buffer, ~WINED3D_LOCATION_DRAWABLE); + } + +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 75cf863..cf6e3e3 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -785,9 +785,7 @@ static void texture2d_sub_resource_invalidate_location(struct wined3d_resource * + + static void texture2d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) + { +- struct wined3d_surface *surface = surface_from_resource(sub_resource); +- +- surface_validate_location(surface, location); ++ wined3d_resource_validate_location(sub_resource, location); + } + + static void texture2d_sub_resource_upload_data(struct wined3d_resource *sub_resource, +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 0aa218c..fa842fa 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2442,7 +2442,6 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, + const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN; + HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, + struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN; +-void surface_validate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; + HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, + GLenum target, unsigned int level, unsigned int layer, DWORD flags, + struct wined3d_surface **surface) DECLSPEC_HIDDEN; +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0015-wined3d-Move-invalidate_location-to-resource.c.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0015-wined3d-Move-invalidate_location-to-resource.c.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0015-wined3d-Move-invalidate_location-to-resource.c.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0015-wined3d-Move-invalidate_location-to-resource.c.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,159 @@ +From 025d8d22909fa65d7315f97042cc12efa5809657 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 3 Oct 2013 12:36:46 +0200 +Subject: wined3d: Move invalidate_location to resource.c. + +--- + dlls/wined3d/device.c | 2 +- + dlls/wined3d/resource.c | 7 +++++++ + dlls/wined3d/texture.c | 4 +--- + dlls/wined3d/volume.c | 21 +++++++-------------- + dlls/wined3d/wined3d_private.h | 3 +-- + 5 files changed, 17 insertions(+), 20 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 99f4e96..bde37b1 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -3487,7 +3487,7 @@ static HRESULT device_update_volume(struct wined3d_device *device, + data.buffer_object = 0; + data.addr = src.data; + wined3d_volume_upload_data(dst_volume, context, &data); +- wined3d_volume_invalidate_location(dst_volume, ~WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); + + context_release(context); + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 2731f27..89865ef 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -369,3 +369,10 @@ void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD + resource->locations |= location; + TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); + } ++ ++void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) ++{ ++ TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location)); ++ resource->locations &= ~location; ++ TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); ++} +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 6692118..522ffd6 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -1322,9 +1322,7 @@ static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource + + static void texture3d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) + { +- struct wined3d_volume *volume = volume_from_resource(sub_resource); +- +- wined3d_volume_invalidate_location(volume, location); ++ wined3d_resource_invalidate_location(sub_resource, location); + } + + static void texture3d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index e1fa454..722f92e 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -99,13 +99,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine + HeapFree(GetProcessHeap(), 0, converted_mem); + } + +-void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) +-{ +- TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location)); +- volume->resource.locations &= ~location; +- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations)); +-} +- + /* Context activation is done by the caller. */ + static void wined3d_volume_download_data(struct wined3d_volume *volume, + const struct wined3d_context *context, const struct wined3d_bo_address *data) +@@ -141,7 +134,7 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume, + static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) + { + wined3d_resource_free_sysmem(&volume->resource); +- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_SYSMEM); ++ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); + } + + static DWORD volume_access_from_location(DWORD location) +@@ -239,7 +232,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) + { + TRACE("Volume previously discarded, nothing to do.\n"); +- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED); ++ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); + } + else if (volume->resource.locations & WINED3D_LOCATION_SYSMEM) + { +@@ -278,7 +271,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) + { + TRACE("Volume previously discarded, nothing to do.\n"); +- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED); ++ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); + } + else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + { +@@ -308,7 +301,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) + { + TRACE("Volume previously discarded, nothing to do.\n"); +- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED); ++ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); + } + else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + { +@@ -401,13 +394,13 @@ static void volume_unload(struct wined3d_resource *resource) + context = context_acquire(device, NULL); + wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM); + context_release(context); +- wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_SYSMEM); ++ wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_SYSMEM); + } + else + { + ERR("Out of memory when unloading volume %p.\n", volume); + wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); +- wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_DISCARDED); ++ wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); + } + + if (volume->pbo) +@@ -641,7 +634,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) + { + wined3d_texture_set_dirty(volume->container); +- wined3d_volume_invalidate_location(volume, ~volume->resource.map_binding); ++ wined3d_resource_invalidate_location(&volume->resource, ~volume->resource.map_binding); + } + + volume->resource.map_count++; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 3e13ae8..fd82ec3 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2126,6 +2126,7 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_H + DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; + void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; ++void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; + + /* Tests show that the start address of resources is 32 byte aligned */ + #define RESOURCE_ALIGNMENT 16 +@@ -2269,8 +2270,6 @@ HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wi + void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; + void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, + BOOL srgb_mode) DECLSPEC_HIDDEN; +-void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; +-void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; + void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, + const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; + +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,318 +0,0 @@ -From 4f63b8a3415a44d16a20acfc6d4571fa10e19a55 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. - ---- - dlls/wined3d/arb_program_shader.c | 2 +- - dlls/wined3d/context.c | 2 +- - dlls/wined3d/device.c | 2 +- - dlls/wined3d/drawprim.c | 2 +- - dlls/wined3d/surface.c | 45 ++++++++++++++++----------------------- - dlls/wined3d/swapchain.c | 12 +++++------ - dlls/wined3d/texture.c | 6 ++---- - dlls/wined3d/wined3d_private.h | 1 - - 8 files changed, 30 insertions(+), 42 deletions(-) - -diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index 35637f2..0d61251 100644 ---- a/dlls/wined3d/arb_program_shader.c -+++ b/dlls/wined3d/arb_program_shader.c -@@ -7922,7 +7922,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter, - context_release(context); - - wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); -- surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); -+ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); - } - - static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface, -diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index ac4c7cb..167ea7d 100644 ---- a/dlls/wined3d/context.c -+++ b/dlls/wined3d/context.c -@@ -3192,7 +3192,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d - if (texture->texture_srgb.name) - wined3d_texture_load(texture, context, TRUE); - wined3d_texture_load(texture, context, FALSE); -- surface_invalidate_location(context->current_rt, WINED3D_LOCATION_DRAWABLE); -+ wined3d_resource_invalidate_location(&context->current_rt->resource, WINED3D_LOCATION_DRAWABLE); - } - } - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index f5fdad2..4e21f49 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 - if (rt) - { - wined3d_resource_validate_location(&rt->resource, rt->container->resource.draw_binding); -- surface_invalidate_location(rt, ~rt->container->resource.draw_binding); -+ wined3d_resource_invalidate_location(&rt->resource, ~rt->container->resource.draw_binding); - } - } - -diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index 567550e..6f226ce 100644 ---- a/dlls/wined3d/drawprim.c -+++ b/dlls/wined3d/drawprim.c -@@ -629,7 +629,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co - if (target) - { - surface_load_location(target, context, target->container->resource.draw_binding); -- surface_invalidate_location(target, ~target->container->resource.draw_binding); -+ wined3d_resource_invalidate_location(&target->resource, ~target->container->resource.draw_binding); - } - } - } -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 350a2b2..929ea5d 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -598,7 +598,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) - return; - - wined3d_resource_free_sysmem(&surface->resource); -- surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); - } - - static void surface_release_client_storage(struct wined3d_surface *surface) -@@ -1128,7 +1128,7 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win - checkGLcall("glDeleteBuffers(1, &surface->pbo)"); - - surface->pbo = 0; -- surface_invalidate_location(surface, WINED3D_LOCATION_BUFFER); -+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_BUFFER); - } - - static ULONG surface_resource_incref(struct wined3d_resource *resource) -@@ -1168,7 +1168,7 @@ static void surface_unload(struct wined3d_resource *resource) - surface_prepare_system_memory(surface); - memset(surface->resource.heap_memory, 0, surface->resource.size); - wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); -- surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_SYSMEM); - - /* We also get here when the ddraw swapchain is destroyed, for example - * for a mode switch. In this case this surface won't necessarily be -@@ -1180,7 +1180,7 @@ static void surface_unload(struct wined3d_resource *resource) - { - surface_prepare_map_memory(surface); - surface_load_location(surface, context, surface->resource.map_binding); -- surface_invalidate_location(surface, ~surface->resource.map_binding); -+ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); - } - - /* Destroy PBOs, but load them into real sysmem before */ -@@ -1218,7 +1218,10 @@ static void surface_unload(struct wined3d_resource *resource) - - static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location) - { -- ERR("Not yet implemented.\n"); -+ struct wined3d_surface *surface = surface_from_resource(resource); -+ -+ if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -+ wined3d_texture_set_dirty(surface->container); - } - - static const struct wined3d_resource_ops surface_resource_ops = -@@ -1686,7 +1689,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P - context_release(context); - - wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); -- surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); - - return WINED3D_OK; - } -@@ -2746,7 +2749,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - } - - if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) -- surface_invalidate_location(surface, ~surface->resource.map_binding); -+ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); - - switch (surface->resource.map_binding) - { -@@ -2862,7 +2865,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - } - - surface_load_location(surface, context, WINED3D_LOCATION_DIB); -- surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB); -+ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB); - - if (context) - context_release(context); -@@ -2911,7 +2914,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); -- surface_invalidate_location(surface, WINED3D_LOCATION_DIB); -+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); - if (context) - context_release(context); - } -@@ -3289,7 +3292,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); -- surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); - } - - /* Uses the hardware to stretch and flip the image */ -@@ -3357,7 +3360,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 */ -- src_surface->resource.locations &= ~WINED3D_LOCATION_TEXTURE_RGB; -+ wined3d_resource_invalidate_location(&src_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); - } - - /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3562,7 +3565,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); -- surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); - } - - /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -4064,18 +4067,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co - surface->ds_current_size.cy = surface->resource.height; - } - --void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) --{ -- TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -- -- if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -- wined3d_texture_set_dirty(surface->container); -- surface->resource.locations &= ~location; -- -- if (!surface->resource.locations) -- ERR("Surface %p does not have any up to date location.\n", surface); --} -- - static DWORD resource_access_from_location(DWORD location) - { - switch (location) -@@ -4627,7 +4618,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter, - (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); - - wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); -- surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); -+ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); - } - - const struct blit_shader ffp_blit = { -@@ -5599,7 +5590,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); -- surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); -+ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); - - return WINED3D_OK; - } -@@ -5727,7 +5718,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); -- surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); - } - - return hr; -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 075bffc..bd5348c 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -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); -- surface_invalidate_location(back_buffer, WINED3D_LOCATION_DRAWABLE); -+ wined3d_resource_invalidate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE); - swapchain->render_to_fbo = TRUE; - swapchain_update_draw_bindings(swapchain); - } -@@ -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); -- surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); -+ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE); - wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE); -- surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE); -+ wined3d_resource_invalidate_location(&back_buffer->resource, ~WINED3D_LOCATION_DRAWABLE); - } - } - else - { - wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); -- surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); -+ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE); - /* 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, -@@ -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); -- surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding); -+ wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding); - } - } - -@@ -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); -- surface_invalidate_location(front_buffer, ~WINED3D_LOCATION_DRAWABLE); -+ wined3d_resource_invalidate_location(&front_buffer->resource, ~WINED3D_LOCATION_DRAWABLE); - } - - /* 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 172e5c4..140124f 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -779,7 +779,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub - context = context_acquire(surface->resource.device, NULL); - surface_load_location(surface, context, surface->resource.map_binding); - context_release(context); -- surface_invalidate_location(surface, ~surface->resource.map_binding); -+ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); - } - - static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource) -@@ -791,9 +791,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource - - static void texture2d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) - { -- struct wined3d_surface *surface = surface_from_resource(sub_resource); -- -- surface_invalidate_location(surface, location); -+ wined3d_resource_invalidate_location(sub_resource, location); - } - - 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 27bba5b..19b8d31 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2391,7 +2391,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; --void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; - void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; - void surface_load_ds_location(struct wined3d_surface *surface, - struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0016-wined3d-Invalidate-containers-via-callback.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0016-wined3d-Invalidate-containers-via-callback.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0016-wined3d-Invalidate-containers-via-callback.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0016-wined3d-Invalidate-containers-via-callback.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,142 @@ +From 28ac147348a282c737e546db1c83c213060915a0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 17 Nov 2013 18:44:48 +0100 +Subject: wined3d: Invalidate containers via callback. + +--- + dlls/wined3d/buffer.c | 6 ++++++ + dlls/wined3d/resource.c | 2 ++ + dlls/wined3d/surface.c | 6 ++++++ + dlls/wined3d/texture.c | 6 ++++++ + dlls/wined3d/volume.c | 12 +++++++++--- + dlls/wined3d/wined3d_private.h | 1 + + 6 files changed, 30 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 989026f..d9bc820 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1123,11 +1123,17 @@ static ULONG buffer_resource_decref(struct wined3d_resource *resource) + return wined3d_buffer_decref(buffer_from_resource(resource)); + } + ++static void wined3d_buffer_location_invalidated(struct wined3d_resource *resource, DWORD location) ++{ ++ ERR("Not yet implemented.\n"); ++} ++ + static const struct wined3d_resource_ops buffer_resource_ops = + { + buffer_resource_incref, + buffer_resource_decref, + buffer_unload, ++ wined3d_buffer_location_invalidated, + }; + + static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 89865ef..a63eab8 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -375,4 +375,6 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO + TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location)); + resource->locations &= ~location; + TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); ++ ++ resource->resource_ops->resource_location_invalidated(resource, location); + } +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 909d405..1a57219 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -1273,11 +1273,17 @@ static void surface_unload(struct wined3d_resource *resource) + resource_unload(resource); + } + ++static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location) ++{ ++ ERR("Not yet implemented.\n"); ++} ++ + static const struct wined3d_resource_ops surface_resource_ops = + { + surface_resource_incref, + surface_resource_decref, + surface_unload, ++ wined3d_surface_location_invalidated, + }; + + static const struct wined3d_surface_ops surface_ops = +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 522ffd6..f2bba1a 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -1036,11 +1036,17 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) + wined3d_texture_unload_gl_texture(texture); + } + ++static void wined3d_texture_load_location_invalidated(struct wined3d_resource *resource, DWORD location) ++{ ++ ERR("Should not be called on textures.\n"); ++} ++ + static const struct wined3d_resource_ops texture_resource_ops = + { + texture_resource_incref, + texture_resource_decref, + wined3d_texture_unload, ++ wined3d_texture_load_location_invalidated, + }; + + 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 722f92e..2cc0baf 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -632,10 +632,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + } + + if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) +- { +- wined3d_texture_set_dirty(volume->container); + wined3d_resource_invalidate_location(&volume->resource, ~volume->resource.map_binding); +- } + + volume->resource.map_count++; + +@@ -689,11 +686,20 @@ static ULONG volume_resource_decref(struct wined3d_resource *resource) + return wined3d_volume_decref(volume_from_resource(resource)); + } + ++static void wined3d_volume_location_invalidated(struct wined3d_resource *resource, DWORD location) ++{ ++ struct wined3d_volume *volume = volume_from_resource(resource); ++ ++ if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) ++ wined3d_texture_set_dirty(volume->container); ++} ++ + static const struct wined3d_resource_ops volume_resource_ops = + { + volume_resource_incref, + volume_resource_decref, + volume_unload, ++ wined3d_volume_location_invalidated, + }; + + static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index fd82ec3..acee894 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2068,6 +2068,7 @@ struct wined3d_resource_ops + ULONG (*resource_incref)(struct wined3d_resource *resource); + ULONG (*resource_decref)(struct wined3d_resource *resource); + void (*resource_unload)(struct wined3d_resource *resource); ++ void (*resource_location_invalidated)(struct wined3d_resource *resource, DWORD location); + }; + + struct wined3d_resource +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0016-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0016-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0016-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0016-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,171 +0,0 @@ -From 2341723442d5ab7fb42bb82d066b306cc458813d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 16 Jan 2014 22:04:55 +0100 -Subject: wined3d: Move bitmap_data and user_memory into the resource. - -I may want to change this to keep this in the surface. Not sure yet. ---- - dlls/wined3d/surface.c | 32 ++++++++++++++++---------------- - dlls/wined3d/swapchain.c | 6 +++--- - dlls/wined3d/wined3d_private.h | 4 +--- - 3 files changed, 20 insertions(+), 22 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index ef52ed0..c689880 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -88,7 +88,7 @@ static void surface_cleanup(struct wined3d_surface *surface) - { - DeleteDC(surface->hDC); - DeleteObject(surface->dib.DIBsection); -- surface->dib.bitmap_data = NULL; -+ surface->resource.bitmap_data = NULL; - } - - if (surface->overlay_dest) -@@ -456,7 +456,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) - TRACE("Creating a DIB section with size %dx%dx%d, size=%d.\n", - b_info->bmiHeader.biWidth, b_info->bmiHeader.biHeight, - b_info->bmiHeader.biBitCount, b_info->bmiHeader.biSizeImage); -- surface->dib.DIBsection = CreateDIBSection(0, b_info, DIB_RGB_COLORS, &surface->dib.bitmap_data, 0, 0); -+ surface->dib.DIBsection = CreateDIBSection(0, b_info, DIB_RGB_COLORS, &surface->resource.bitmap_data, 0, 0); - - if (!surface->dib.DIBsection) - { -@@ -465,7 +465,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) - return HRESULT_FROM_WIN32(GetLastError()); - } - -- TRACE("DIBSection at %p.\n", surface->dib.bitmap_data); -+ TRACE("DIBSection at %p.\n", surface->resource.bitmap_data); - surface->dib.bitmap_size = b_info->bmiHeader.biSizeImage; - - HeapFree(GetProcessHeap(), 0, b_info); -@@ -490,13 +490,13 @@ static void surface_get_memory(const struct wined3d_surface *surface, struct win - } - if (location & WINED3D_LOCATION_USER_MEMORY) - { -- data->addr = surface->user_memory; -+ data->addr = surface->resource.user_memory; - data->buffer_object = 0; - return; - } - if (location & WINED3D_LOCATION_DIB) - { -- data->addr = surface->dib.bitmap_data; -+ data->addr = surface->resource.bitmap_data; - data->buffer_object = 0; - return; - } -@@ -569,13 +569,13 @@ void surface_prepare_map_memory(struct wined3d_surface *surface) - break; - - case WINED3D_LOCATION_USER_MEMORY: -- if (!surface->user_memory) -- ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but surface->user_memory is NULL.\n"); -+ if (!surface->resource.user_memory) -+ ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but surface->resource.user_memory is NULL.\n"); - break; - - case WINED3D_LOCATION_DIB: -- if (!surface->dib.bitmap_data) -- ERR("Map binding is set to WINED3D_LOCATION_DIB but surface->dib.bitmap_data is NULL.\n"); -+ if (!surface->resource.bitmap_data) -+ ERR("Map binding is set to WINED3D_LOCATION_DIB but surface->resource.bitmap_data is NULL.\n"); - break; - - case WINED3D_LOCATION_BUFFER: -@@ -2190,7 +2190,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, - { - DeleteDC(surface->hDC); - DeleteObject(surface->dib.DIBsection); -- surface->dib.bitmap_data = NULL; -+ surface->resource.bitmap_data = NULL; - surface->flags &= ~SFLAG_DIBSECTION; - create_dib = TRUE; - } -@@ -2222,7 +2222,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, - else - surface->flags &= ~SFLAG_NONPOW2; - -- if ((surface->user_memory = mem)) -+ if ((surface->resource.user_memory = mem)) - { - surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; - valid_location = WINED3D_LOCATION_USER_MEMORY; -@@ -2680,11 +2680,11 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - break; - - case WINED3D_LOCATION_USER_MEMORY: -- base_memory = surface->user_memory; -+ base_memory = surface->resource.user_memory; - break; - - case WINED3D_LOCATION_DIB: -- base_memory = surface->dib.bitmap_data; -+ base_memory = surface->resource.bitmap_data; - break; - - case WINED3D_LOCATION_BUFFER: -@@ -3052,9 +3052,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) - { - void* tmp; - -- tmp = front->dib.bitmap_data; -- front->dib.bitmap_data = back->dib.bitmap_data; -- back->dib.bitmap_data = tmp; -+ tmp = front->resource.bitmap_data; -+ front->resource.bitmap_data = back->resource.bitmap_data; -+ back->resource.bitmap_data = tmp; - - tmp = front->resource.heap_memory; - front->resource.heap_memory = back->resource.heap_memory; -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index e64715e..17f1afe 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -695,9 +695,9 @@ static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, const REC - { - void *tmp; - -- tmp = front->dib.bitmap_data; -- front->dib.bitmap_data = back->dib.bitmap_data; -- back->dib.bitmap_data = tmp; -+ tmp = front->resource.bitmap_data; -+ front->resource.bitmap_data = back->resource.bitmap_data; -+ back->resource.bitmap_data = tmp; - - if (front->resource.heap_memory) - ERR("GDI Surface %p has heap memory allocated.\n", front); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 640aa95..52280a7 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2080,7 +2080,7 @@ struct wined3d_resource - UINT depth; - UINT size; - DWORD priority; -- void *heap_memory; -+ void *heap_memory, *user_memory, *bitmap_data; - UINT custom_row_pitch, custom_slice_pitch; - struct list resource_list_entry; - DWORD locations; -@@ -2263,7 +2263,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine - struct wined3d_surface_dib - { - HBITMAP DIBsection; -- void *bitmap_data; - UINT bitmap_size; - }; - -@@ -2297,7 +2296,6 @@ struct wined3d_surface - struct wined3d_resource resource; - const struct wined3d_surface_ops *surface_ops; - struct wined3d_texture *container; -- void *user_memory; - - DWORD flags; - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,306 +0,0 @@ -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. - -The resource part of load_location will handle transfers between sysmem -locations (heap memory, user memory, dib) and buffers. Texture loading -and downloading from textures will be delegated to surfaces / volumes. ---- - dlls/wined3d/buffer.c | 8 +++++++ - dlls/wined3d/resource.c | 50 ++++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/surface.c | 12 ++++++++-- - dlls/wined3d/texture.c | 8 +++++++ - dlls/wined3d/volume.c | 42 ++++++++--------------------------- - dlls/wined3d/wined3d_private.h | 7 +++++- - 6 files changed, 91 insertions(+), 36 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -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 - ERR("Not yet implemented.\n"); - } - -+/* Context activation is done by the caller. */ -+static void wined3d_buffer_load_location(struct wined3d_resource *resource, -+ struct wined3d_context *context, DWORD location) -+{ -+ ERR("Not yet implemented.\n"); -+} -+ - static const struct wined3d_resource_ops buffer_resource_ops = - { - buffer_resource_incref, - buffer_resource_decref, - buffer_unload, - wined3d_buffer_location_invalidated, -+ wined3d_buffer_load_location, - }; - - static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index a63eab8..7f283f5 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -378,3 +378,53 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO - - resource->resource_ops->resource_location_invalidated(resource, location); - } -+ -+DWORD wined3d_resource_access_from_location(DWORD location) -+{ -+ switch (location) -+ { -+ case WINED3D_LOCATION_DISCARDED: -+ return 0; -+ -+ case WINED3D_LOCATION_SYSMEM: -+ case WINED3D_LOCATION_USER_MEMORY: -+ case WINED3D_LOCATION_DIB: -+ return WINED3D_RESOURCE_ACCESS_CPU; -+ -+ case WINED3D_LOCATION_BUFFER: -+ case WINED3D_LOCATION_TEXTURE_RGB: -+ case WINED3D_LOCATION_TEXTURE_SRGB: -+ case WINED3D_LOCATION_DRAWABLE: -+ case WINED3D_LOCATION_RB_MULTISAMPLE: -+ case WINED3D_LOCATION_RB_RESOLVED: -+ return WINED3D_RESOURCE_ACCESS_GPU; -+ -+ default: -+ FIXME("Unhandled location %#x.\n", location); -+ return 0; -+ } -+} -+ -+/* Context activation is optionally by the caller. Context may be NULL. */ -+void wined3d_resource_load_location(struct wined3d_resource *resource, -+ struct wined3d_context *context, DWORD location) -+{ -+ DWORD required_access = wined3d_resource_access_from_location(location); -+ -+ if ((resource->locations & location) == location) -+ { -+ TRACE("Location(s) already up to date.\n"); -+ return; -+ } -+ -+ /* Keep this a WARN for now until surfaces are cleaned up. */ -+ if ((resource->access_flags & required_access) != required_access) -+ WARN("Operation requires %#x access, but resource only has %#x.\n", -+ required_access, resource->access_flags); -+ -+ /* Context is NULL in ddraw-only operation without OpenGL. */ -+ if (!context) -+ ERR("A context is required for non-sysmem operation.\n"); -+ -+ resource->resource_ops->resource_load_location(resource, context, location); -+} -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -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 - wined3d_texture_set_dirty(surface->container); - } - -+/* Context activation is done by the caller. */ -+static void wined3d_surface_load_location(struct wined3d_resource *resource, -+ struct wined3d_context *context, DWORD location) -+{ -+ ERR("Not yet implemented.\n"); -+} -+ - static const struct wined3d_resource_ops surface_resource_ops = - { - surface_resource_incref, - surface_resource_decref, - surface_unload, - wined3d_surface_location_invalidated, -+ wined3d_surface_load_location, - }; - - static const struct wined3d_surface_ops surface_ops = -@@ -4195,7 +4203,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co - surface->ds_current_size.cy = surface->resource.height; - } - --static DWORD resource_access_from_location(DWORD location) -+static DWORD surface_access_from_location(DWORD location) - { - switch (location) - { -@@ -4535,7 +4543,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte - - if (WARN_ON(d3d_surface)) - { -- DWORD required_access = resource_access_from_location(location); -+ DWORD required_access = surface_access_from_location(location); - if ((surface->resource.access_flags & required_access) != required_access) - WARN("Operation requires %#x access, but surface only has %#x.\n", - required_access, surface->resource.access_flags); -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 6d82ce6..fc0f6d6 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -1039,12 +1039,20 @@ static void wined3d_texture_load_location_invalidated(struct wined3d_resource *r - ERR("Should not be called on textures.\n"); - } - -+/* Context activation is done by the caller. */ -+static void wined3d_texture_load_location(struct wined3d_resource *resource, -+ struct wined3d_context *context, DWORD location) -+{ -+ ERR("Should not be called on textures.\n"); -+} -+ - static const struct wined3d_resource_ops texture_resource_ops = - { - texture_resource_incref, - texture_resource_decref, - wined3d_texture_unload, - wined3d_texture_load_location_invalidated, -+ wined3d_texture_load_location, - }; - - 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 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) - wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); - } - --static DWORD volume_access_from_location(DWORD location) --{ -- switch (location) -- { -- case WINED3D_LOCATION_DISCARDED: -- return 0; -- -- case WINED3D_LOCATION_SYSMEM: -- return WINED3D_RESOURCE_ACCESS_CPU; -- -- case WINED3D_LOCATION_BUFFER: -- case WINED3D_LOCATION_TEXTURE_RGB: -- case WINED3D_LOCATION_TEXTURE_SRGB: -- return WINED3D_RESOURCE_ACCESS_GPU; -- -- default: -- FIXME("Unhandled location %#x.\n", location); -- return 0; -- } --} -- - /* Context activation is done by the caller. */ - static void wined3d_volume_srgb_transfer(struct wined3d_volume *volume, - struct wined3d_context *context, BOOL dest_is_srgb) -@@ -197,21 +176,17 @@ static BOOL wined3d_volume_can_evict(const struct wined3d_volume *volume) - - return TRUE; - } -+ - /* Context activation is done by the caller. */ --static void wined3d_volume_load_location(struct wined3d_volume *volume, -+static void wined3d_volume_load_location(struct wined3d_resource *resource, - struct wined3d_context *context, DWORD location) - { -- DWORD required_access = volume_access_from_location(location); -+ struct wined3d_volume *volume = volume_from_resource(resource); -+ DWORD required_access = wined3d_resource_access_from_location(location); - - TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location), - wined3d_debug_location(volume->resource.locations)); - -- if ((volume->resource.locations & location) == location) -- { -- TRACE("Location(s) already up to date.\n"); -- return; -- } -- - if ((volume->resource.access_flags & required_access) != required_access) - { - ERR("Operation requires %#x access, but volume only has %#x.\n", -@@ -333,7 +308,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, - void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode) - { - wined3d_texture_prepare_texture(volume->container, context, srgb_mode); -- wined3d_volume_load_location(volume, context, -+ wined3d_resource_load_location(&volume->resource, context, - srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); - } - -@@ -392,7 +367,7 @@ static void volume_unload(struct wined3d_resource *resource) - if (volume_prepare_system_memory(volume)) - { - context = context_acquire(device, NULL); -- wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM); - context_release(context); - wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_SYSMEM); - } -@@ -547,7 +522,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - if (flags & WINED3D_MAP_DISCARD) - wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER); - else -- wined3d_volume_load_location(volume, context, WINED3D_LOCATION_BUFFER); -+ wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_BUFFER); - - 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)) - { - context = context_acquire(device, NULL); -- wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM); - context_release(context); - } - base_memory = volume->resource.heap_memory; -@@ -700,6 +675,7 @@ static const struct wined3d_resource_ops volume_resource_ops = - volume_resource_decref, - volume_unload, - wined3d_volume_location_invalidated, -+ wined3d_volume_load_location, - }; - - static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index b533108..4db209a 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2069,6 +2069,8 @@ struct wined3d_resource_ops - ULONG (*resource_decref)(struct wined3d_resource *resource); - void (*resource_unload)(struct wined3d_resource *resource); - void (*resource_location_invalidated)(struct wined3d_resource *resource, DWORD location); -+ void (*resource_load_location)(struct wined3d_resource *resource, -+ struct wined3d_context *context, DWORD location); - }; - - struct wined3d_resource -@@ -2119,15 +2121,18 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * - void *parent, const struct wined3d_parent_ops *parent_ops, - const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN; - void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; - BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; - GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; -+void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; - BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+void wined3d_resource_load_location(struct wined3d_resource *resource, -+ struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; - DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; - void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; --void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; - - /* Tests show that the start address of resources is 32 byte aligned */ - #define RESOURCE_ALIGNMENT 16 --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0017-wined3d-Remove-surface_invalidate_location.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0017-wined3d-Remove-surface_invalidate_location.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0017-wined3d-Remove-surface_invalidate_location.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0017-wined3d-Remove-surface_invalidate_location.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,318 @@ +From 4f63b8a3415a44d16a20acfc6d4571fa10e19a55 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. + +--- + dlls/wined3d/arb_program_shader.c | 2 +- + dlls/wined3d/context.c | 2 +- + dlls/wined3d/device.c | 2 +- + dlls/wined3d/drawprim.c | 2 +- + dlls/wined3d/surface.c | 45 ++++++++++++++++----------------------- + dlls/wined3d/swapchain.c | 12 +++++------ + dlls/wined3d/texture.c | 6 ++---- + dlls/wined3d/wined3d_private.h | 1 - + 8 files changed, 30 insertions(+), 42 deletions(-) + +diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c +index 35637f2..0d61251 100644 +--- a/dlls/wined3d/arb_program_shader.c ++++ b/dlls/wined3d/arb_program_shader.c +@@ -7922,7 +7922,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter, + context_release(context); + + wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); +- surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); ++ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); + } + + static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface, +diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c +index ac4c7cb..167ea7d 100644 +--- a/dlls/wined3d/context.c ++++ b/dlls/wined3d/context.c +@@ -3192,7 +3192,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d + if (texture->texture_srgb.name) + wined3d_texture_load(texture, context, TRUE); + wined3d_texture_load(texture, context, FALSE); +- surface_invalidate_location(context->current_rt, WINED3D_LOCATION_DRAWABLE); ++ wined3d_resource_invalidate_location(&context->current_rt->resource, WINED3D_LOCATION_DRAWABLE); + } + } + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index f5fdad2..4e21f49 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 + if (rt) + { + wined3d_resource_validate_location(&rt->resource, rt->container->resource.draw_binding); +- surface_invalidate_location(rt, ~rt->container->resource.draw_binding); ++ wined3d_resource_invalidate_location(&rt->resource, ~rt->container->resource.draw_binding); + } + } + +diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c +index 567550e..6f226ce 100644 +--- a/dlls/wined3d/drawprim.c ++++ b/dlls/wined3d/drawprim.c +@@ -629,7 +629,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co + if (target) + { + surface_load_location(target, context, target->container->resource.draw_binding); +- surface_invalidate_location(target, ~target->container->resource.draw_binding); ++ wined3d_resource_invalidate_location(&target->resource, ~target->container->resource.draw_binding); + } + } + } +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 350a2b2..929ea5d 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -598,7 +598,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) + return; + + wined3d_resource_free_sysmem(&surface->resource); +- surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM); ++ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); + } + + static void surface_release_client_storage(struct wined3d_surface *surface) +@@ -1128,7 +1128,7 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win + checkGLcall("glDeleteBuffers(1, &surface->pbo)"); + + surface->pbo = 0; +- surface_invalidate_location(surface, WINED3D_LOCATION_BUFFER); ++ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_BUFFER); + } + + static ULONG surface_resource_incref(struct wined3d_resource *resource) +@@ -1168,7 +1168,7 @@ static void surface_unload(struct wined3d_resource *resource) + surface_prepare_system_memory(surface); + memset(surface->resource.heap_memory, 0, surface->resource.size); + wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); +- surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM); ++ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_SYSMEM); + + /* We also get here when the ddraw swapchain is destroyed, for example + * for a mode switch. In this case this surface won't necessarily be +@@ -1180,7 +1180,7 @@ static void surface_unload(struct wined3d_resource *resource) + { + surface_prepare_map_memory(surface); + surface_load_location(surface, context, surface->resource.map_binding); +- surface_invalidate_location(surface, ~surface->resource.map_binding); ++ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); + } + + /* Destroy PBOs, but load them into real sysmem before */ +@@ -1218,7 +1218,10 @@ static void surface_unload(struct wined3d_resource *resource) + + static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location) + { +- ERR("Not yet implemented.\n"); ++ struct wined3d_surface *surface = surface_from_resource(resource); ++ ++ if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) ++ wined3d_texture_set_dirty(surface->container); + } + + static const struct wined3d_resource_ops surface_resource_ops = +@@ -1686,7 +1689,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P + context_release(context); + + wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); +- surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); + + return WINED3D_OK; + } +@@ -2746,7 +2749,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + } + + if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) +- surface_invalidate_location(surface, ~surface->resource.map_binding); ++ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); + + switch (surface->resource.map_binding) + { +@@ -2862,7 +2865,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) + } + + surface_load_location(surface, context, WINED3D_LOCATION_DIB); +- surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB); ++ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB); + + if (context) + context_release(context); +@@ -2911,7 +2914,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); +- surface_invalidate_location(surface, WINED3D_LOCATION_DIB); ++ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); + if (context) + context_release(context); + } +@@ -3289,7 +3292,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); +- surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); + } + + /* Uses the hardware to stretch and flip the image */ +@@ -3357,7 +3360,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 */ +- src_surface->resource.locations &= ~WINED3D_LOCATION_TEXTURE_RGB; ++ wined3d_resource_invalidate_location(&src_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); + } + + /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag +@@ -3562,7 +3565,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); +- surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); + } + + /* Front buffer coordinates are always full screen coordinates, but our GL +@@ -4064,18 +4067,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co + surface->ds_current_size.cy = surface->resource.height; + } + +-void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) +-{ +- TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); +- +- if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) +- wined3d_texture_set_dirty(surface->container); +- surface->resource.locations &= ~location; +- +- if (!surface->resource.locations) +- ERR("Surface %p does not have any up to date location.\n", surface); +-} +- + static DWORD resource_access_from_location(DWORD location) + { + switch (location) +@@ -4627,7 +4618,7 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter, + (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); + + wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); +- surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); ++ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); + } + + const struct blit_shader ffp_blit = { +@@ -5599,7 +5590,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); +- surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); ++ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); + + return WINED3D_OK; + } +@@ -5727,7 +5718,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); +- surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM); ++ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); + } + + return hr; +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index 075bffc..bd5348c 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -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); +- surface_invalidate_location(back_buffer, WINED3D_LOCATION_DRAWABLE); ++ wined3d_resource_invalidate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE); + swapchain->render_to_fbo = TRUE; + swapchain_update_draw_bindings(swapchain); + } +@@ -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); +- surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); ++ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE); + wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE); +- surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE); ++ wined3d_resource_invalidate_location(&back_buffer->resource, ~WINED3D_LOCATION_DRAWABLE); + } + } + else + { + wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); +- surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); ++ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE); + /* 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, +@@ -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); +- surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding); ++ wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding); + } + } + +@@ -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); +- surface_invalidate_location(front_buffer, ~WINED3D_LOCATION_DRAWABLE); ++ wined3d_resource_invalidate_location(&front_buffer->resource, ~WINED3D_LOCATION_DRAWABLE); + } + + /* 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 172e5c4..140124f 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -779,7 +779,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub + context = context_acquire(surface->resource.device, NULL); + surface_load_location(surface, context, surface->resource.map_binding); + context_release(context); +- surface_invalidate_location(surface, ~surface->resource.map_binding); ++ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); + } + + static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource) +@@ -791,9 +791,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource + + static void texture2d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) + { +- struct wined3d_surface *surface = surface_from_resource(sub_resource); +- +- surface_invalidate_location(surface, location); ++ wined3d_resource_invalidate_location(sub_resource, location); + } + + 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 27bba5b..19b8d31 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2391,7 +2391,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; +-void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; + void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; + void surface_load_ds_location(struct wined3d_surface *surface, + struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0018-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0018-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0018-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0018-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,171 @@ +From 2341723442d5ab7fb42bb82d066b306cc458813d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 16 Jan 2014 22:04:55 +0100 +Subject: wined3d: Move bitmap_data and user_memory into the resource. + +I may want to change this to keep this in the surface. Not sure yet. +--- + dlls/wined3d/surface.c | 32 ++++++++++++++++---------------- + dlls/wined3d/swapchain.c | 6 +++--- + dlls/wined3d/wined3d_private.h | 4 +--- + 3 files changed, 20 insertions(+), 22 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index ef52ed0..c689880 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -88,7 +88,7 @@ static void surface_cleanup(struct wined3d_surface *surface) + { + DeleteDC(surface->hDC); + DeleteObject(surface->dib.DIBsection); +- surface->dib.bitmap_data = NULL; ++ surface->resource.bitmap_data = NULL; + } + + if (surface->overlay_dest) +@@ -456,7 +456,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) + TRACE("Creating a DIB section with size %dx%dx%d, size=%d.\n", + b_info->bmiHeader.biWidth, b_info->bmiHeader.biHeight, + b_info->bmiHeader.biBitCount, b_info->bmiHeader.biSizeImage); +- surface->dib.DIBsection = CreateDIBSection(0, b_info, DIB_RGB_COLORS, &surface->dib.bitmap_data, 0, 0); ++ surface->dib.DIBsection = CreateDIBSection(0, b_info, DIB_RGB_COLORS, &surface->resource.bitmap_data, 0, 0); + + if (!surface->dib.DIBsection) + { +@@ -465,7 +465,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) + return HRESULT_FROM_WIN32(GetLastError()); + } + +- TRACE("DIBSection at %p.\n", surface->dib.bitmap_data); ++ TRACE("DIBSection at %p.\n", surface->resource.bitmap_data); + surface->dib.bitmap_size = b_info->bmiHeader.biSizeImage; + + HeapFree(GetProcessHeap(), 0, b_info); +@@ -490,13 +490,13 @@ static void surface_get_memory(const struct wined3d_surface *surface, struct win + } + if (location & WINED3D_LOCATION_USER_MEMORY) + { +- data->addr = surface->user_memory; ++ data->addr = surface->resource.user_memory; + data->buffer_object = 0; + return; + } + if (location & WINED3D_LOCATION_DIB) + { +- data->addr = surface->dib.bitmap_data; ++ data->addr = surface->resource.bitmap_data; + data->buffer_object = 0; + return; + } +@@ -569,13 +569,13 @@ void surface_prepare_map_memory(struct wined3d_surface *surface) + break; + + case WINED3D_LOCATION_USER_MEMORY: +- if (!surface->user_memory) +- ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but surface->user_memory is NULL.\n"); ++ if (!surface->resource.user_memory) ++ ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but surface->resource.user_memory is NULL.\n"); + break; + + case WINED3D_LOCATION_DIB: +- if (!surface->dib.bitmap_data) +- ERR("Map binding is set to WINED3D_LOCATION_DIB but surface->dib.bitmap_data is NULL.\n"); ++ if (!surface->resource.bitmap_data) ++ ERR("Map binding is set to WINED3D_LOCATION_DIB but surface->resource.bitmap_data is NULL.\n"); + break; + + case WINED3D_LOCATION_BUFFER: +@@ -2190,7 +2190,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, + { + DeleteDC(surface->hDC); + DeleteObject(surface->dib.DIBsection); +- surface->dib.bitmap_data = NULL; ++ surface->resource.bitmap_data = NULL; + surface->flags &= ~SFLAG_DIBSECTION; + create_dib = TRUE; + } +@@ -2222,7 +2222,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, + else + surface->flags &= ~SFLAG_NONPOW2; + +- if ((surface->user_memory = mem)) ++ if ((surface->resource.user_memory = mem)) + { + surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; + valid_location = WINED3D_LOCATION_USER_MEMORY; +@@ -2680,11 +2680,11 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + break; + + case WINED3D_LOCATION_USER_MEMORY: +- base_memory = surface->user_memory; ++ base_memory = surface->resource.user_memory; + break; + + case WINED3D_LOCATION_DIB: +- base_memory = surface->dib.bitmap_data; ++ base_memory = surface->resource.bitmap_data; + break; + + case WINED3D_LOCATION_BUFFER: +@@ -3052,9 +3052,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) + { + void* tmp; + +- tmp = front->dib.bitmap_data; +- front->dib.bitmap_data = back->dib.bitmap_data; +- back->dib.bitmap_data = tmp; ++ tmp = front->resource.bitmap_data; ++ front->resource.bitmap_data = back->resource.bitmap_data; ++ back->resource.bitmap_data = tmp; + + tmp = front->resource.heap_memory; + front->resource.heap_memory = back->resource.heap_memory; +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index e64715e..17f1afe 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -695,9 +695,9 @@ static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, const REC + { + void *tmp; + +- tmp = front->dib.bitmap_data; +- front->dib.bitmap_data = back->dib.bitmap_data; +- back->dib.bitmap_data = tmp; ++ tmp = front->resource.bitmap_data; ++ front->resource.bitmap_data = back->resource.bitmap_data; ++ back->resource.bitmap_data = tmp; + + if (front->resource.heap_memory) + ERR("GDI Surface %p has heap memory allocated.\n", front); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 640aa95..52280a7 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2080,7 +2080,7 @@ struct wined3d_resource + UINT depth; + UINT size; + DWORD priority; +- void *heap_memory; ++ void *heap_memory, *user_memory, *bitmap_data; + UINT custom_row_pitch, custom_slice_pitch; + struct list resource_list_entry; + DWORD locations; +@@ -2263,7 +2263,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine + struct wined3d_surface_dib + { + HBITMAP DIBsection; +- void *bitmap_data; + UINT bitmap_size; + }; + +@@ -2297,7 +2296,6 @@ struct wined3d_surface + struct wined3d_resource resource; + const struct wined3d_surface_ops *surface_ops; + struct wined3d_texture *container; +- void *user_memory; + + DWORD flags; + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0018-wined3d-Replace-surface_load_location-with-resource_.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0018-wined3d-Replace-surface_load_location-with-resource_.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0018-wined3d-Replace-surface_load_location-with-resource_.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0018-wined3d-Replace-surface_load_location-with-resource_.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,402 +0,0 @@ -From d934f1879e55a8787562d4cc75ce2bd981f8b585 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 17 Nov 2013 20:33:17 +0100 -Subject: wined3d: Replace surface_load_location with resource_load_location. - -FIXME: Check if this patch is complete enough to make sense. ---- - dlls/wined3d/context.c | 2 +- - dlls/wined3d/device.c | 2 +- - dlls/wined3d/drawprim.c | 2 +- - dlls/wined3d/surface.c | 111 +++++++++++++---------------------------- - dlls/wined3d/swapchain.c | 8 +-- - dlls/wined3d/texture.c | 2 +- - dlls/wined3d/wined3d_private.h | 2 - - 7 files changed, 43 insertions(+), 86 deletions(-) - -diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 167ea7d..5644ea0 100644 ---- a/dlls/wined3d/context.c -+++ b/dlls/wined3d/context.c -@@ -2224,7 +2224,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, - WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); - - /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ -- surface_load_location(context->current_rt, context, WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_resource_load_location(&context->current_rt->resource, context, WINED3D_LOCATION_TEXTURE_RGB); - swapchain->render_to_fbo = TRUE; - swapchain_update_draw_bindings(swapchain); - context_set_render_offscreen(context, TRUE); -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 1874a2b..ab874de 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -323,7 +323,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c - { - struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(fb->render_targets[i]); - if (rt) -- surface_load_location(rt, context, rt->container->resource.draw_binding); -+ wined3d_resource_load_location(&rt->resource, context, rt->container->resource.draw_binding); - } - } - -diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index 6f226ce..f2c2f42 100644 ---- a/dlls/wined3d/drawprim.c -+++ b/dlls/wined3d/drawprim.c -@@ -628,7 +628,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co - struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]); - if (target) - { -- surface_load_location(target, context, target->container->resource.draw_binding); -+ wined3d_resource_load_location(&target->resource, context, target->container->resource.draw_binding); - wined3d_resource_invalidate_location(&target->resource, ~target->container->resource.draw_binding); - } - } -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 1fcbc98..f7171df 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -758,7 +758,7 @@ static void surface_unmap(struct wined3d_surface *surface) - - if (device->d3d_initialized) - context = context_acquire(device, surface); -- surface_load_location(surface, context, surface->container->resource.draw_binding); -+ wined3d_resource_load_location(&surface->resource, context, surface->container->resource.draw_binding); - if (context) - context_release(context); - } -@@ -824,9 +824,9 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, - - /* Make sure the locations are up-to-date. Loading the destination - * surface isn't required if the entire surface is overwritten. */ -- surface_load_location(src_surface, context, src_location); -+ wined3d_resource_load_location(&src_surface->resource, context, src_location); - if (!surface_is_full_rect(dst_surface, dst_rect)) -- surface_load_location(dst_surface, context, dst_location); -+ wined3d_resource_load_location(&dst_surface->resource, context, dst_location); - - gl_info = context->gl_info; - -@@ -915,9 +915,9 @@ static void surface_blt_fbo(const struct wined3d_device *device, - * surface isn't required if the entire surface is overwritten. (And is - * in fact harmful if we're being called by surface_load_location() with - * the purpose of loading the destination surface.) */ -- surface_load_location(src_surface, old_ctx, src_location); -+ wined3d_resource_load_location(&src_surface->resource, old_ctx, src_location); - if (!surface_is_full_rect(dst_surface, &dst_rect)) -- surface_load_location(dst_surface, old_ctx, dst_location); -+ wined3d_resource_load_location(&dst_surface->resource, old_ctx, dst_location); - - if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface; - else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface; -@@ -1179,7 +1179,7 @@ static void surface_unload(struct wined3d_resource *resource) - else - { - surface_prepare_map_memory(surface); -- surface_load_location(surface, context, surface->resource.map_binding); -+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); - } - -@@ -1224,22 +1224,6 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour - wined3d_texture_set_dirty(surface->container); - } - --/* Context activation is done by the caller. */ --static void wined3d_surface_load_location(struct wined3d_resource *resource, -- struct wined3d_context *context, DWORD location) --{ -- ERR("Not yet implemented.\n"); --} -- --static const struct wined3d_resource_ops surface_resource_ops = --{ -- surface_resource_incref, -- surface_resource_decref, -- surface_unload, -- wined3d_surface_location_invalidated, -- wined3d_surface_load_location, --}; -- - static const struct wined3d_surface_ops surface_ops = - { - surface_private_setup, -@@ -1683,7 +1667,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P - if (update_w == dst_w && update_h == dst_h) - wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); - else -- surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); - wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); - - surface_get_memory(src_surface, &data, src_surface->resource.locations); -@@ -1816,7 +1800,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte - } - TRACE("Reloading because surface is dirty.\n"); - -- surface_load_location(surface, context, location); -+ wined3d_resource_load_location(&surface->resource, context, location); - surface_evict_sysmem(surface); - } - -@@ -2749,7 +2733,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - - if (surface->resource.device->d3d_initialized) - context = context_acquire(surface->resource.device, NULL); -- surface_load_location(surface, context, surface->resource.map_binding); -+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - if (context) - context_release(context); - } -@@ -2854,7 +2838,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - { - if (surface->flags & SFLAG_CLIENT) - { -- surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); - surface_release_client_storage(surface); - } - hr = surface_create_dib_section(surface); -@@ -2870,7 +2854,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - surface->resource.map_binding = WINED3D_LOCATION_DIB; - } - -- surface_load_location(surface, context, WINED3D_LOCATION_DIB); -+ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_DIB); - wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB); - - if (context) -@@ -2919,7 +2903,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) - if (device->d3d_initialized) - context = context_acquire(device, NULL); - -- surface_load_location(surface, context, surface->resource.map_binding); -+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); - if (context) - context_release(context); -@@ -3634,8 +3618,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, - gl_info = context->gl_info; - - /* Make sure the surface is up-to-date. This should probably use -- * surface_load_location() and worry about the destination surface too, -- * unless we're overwriting it completely. */ -+ * wined3d_resource_load_location() and worry about the destination -+ * surface too, unless we're overwriting it completely. */ - wined3d_texture_load(src_surface->container, context, FALSE); - - /* Activate the destination context, set it up for blitting */ -@@ -4073,29 +4057,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co - surface->ds_current_size.cy = surface->resource.height; - } - --static DWORD surface_access_from_location(DWORD location) --{ -- switch (location) -- { -- case WINED3D_LOCATION_SYSMEM: -- case WINED3D_LOCATION_USER_MEMORY: -- case WINED3D_LOCATION_DIB: -- case WINED3D_LOCATION_BUFFER: -- return WINED3D_RESOURCE_ACCESS_CPU; -- -- case WINED3D_LOCATION_DRAWABLE: -- case WINED3D_LOCATION_TEXTURE_SRGB: -- case WINED3D_LOCATION_TEXTURE_RGB: -- case WINED3D_LOCATION_RB_MULTISAMPLE: -- case WINED3D_LOCATION_RB_RESOLVED: -- return WINED3D_RESOURCE_ACCESS_GPU; -- -- default: -- FIXME("Unhandled location %#x.\n", location); -- return 0; -- } --} -- - static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD location) - { - struct wined3d_device *device = surface->resource.device; -@@ -4145,7 +4106,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, - } - - if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) -- surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); - - /* Download the surface to system memory. */ - if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -@@ -4181,7 +4142,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, - } - - surface_get_rect(surface, NULL, &r); -- surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); - surface_blt_to_drawable(surface->resource.device, context, - WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); - -@@ -4254,7 +4215,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - /* Performance warning... */ - FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); - surface_prepare_map_memory(surface); -- surface_load_location(surface, context, surface->resource.map_binding); -+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - } - } - else -@@ -4265,7 +4226,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - /* Performance warning... */ - FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); - surface_prepare_map_memory(surface); -- surface_load_location(surface, context, surface->resource.map_binding); -+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - } - } - -@@ -4274,7 +4235,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); - /* Lets hope we get it from somewhere... */ - surface_prepare_system_memory(surface); -- surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM); -+ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); - } - - wined3d_texture_prepare_texture(texture, context, srgb); -@@ -4300,7 +4261,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; - - surface_prepare_map_memory(surface); -- surface_load_location(surface, context, surface->resource.map_binding); -+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - surface_remove_pbo(surface, gl_info); - } - -@@ -4368,9 +4329,11 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct - surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect); - } - --/* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ --void surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) -+/* Context activation is done by the caller. */ -+static void wined3d_surface_load_location(struct wined3d_resource *resource, -+ struct wined3d_context *context, DWORD location) - { -+ struct wined3d_surface *surface = surface_from_resource(resource); - HRESULT hr; - - TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4397,20 +4360,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte - } - } - -- if (surface->resource.locations & location) -- { -- TRACE("Location already up to date.\n"); -- return; -- } -- -- if (WARN_ON(d3d_surface)) -- { -- DWORD required_access = surface_access_from_location(location); -- if ((surface->resource.access_flags & required_access) != required_access) -- WARN("Operation requires %#x access, but surface only has %#x.\n", -- required_access, surface->resource.access_flags); -- } -- - if (!surface->resource.locations) - { - ERR("Surface %p does not have any up to date location.\n", surface); -@@ -5552,7 +5501,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) - { - struct wined3d_context *context = context_acquire(device, dst_surface); -- surface_load_location(dst_surface, context, dst_surface->container->resource.draw_binding); -+ wined3d_resource_load_location(&dst_surface->resource, context, -+ dst_surface->container->resource.draw_binding); - context_release(context); - } - return WINED3D_OK; -@@ -5625,6 +5575,15 @@ cpu: - return surface_cpu_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter); - } - -+static const struct wined3d_resource_ops surface_resource_ops = -+{ -+ surface_resource_incref, -+ surface_resource_decref, -+ surface_unload, -+ wined3d_surface_location_invalidated, -+ wined3d_surface_load_location, -+}; -+ - static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container, - const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) - { -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 6864a4a..15f7708 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -309,7 +309,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain, - if (backbuffer->resource.multisample_type) - { - location = WINED3D_LOCATION_RB_RESOLVED; -- surface_load_location(backbuffer, context, location); -+ wined3d_resource_load_location(&backbuffer->resource, context, location); - } - - context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, backbuffer, NULL, location); -@@ -511,14 +511,14 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - */ - if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO) - { -- surface_load_location(back_buffer, context, WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_resource_load_location(&back_buffer->resource, context, WINED3D_LOCATION_TEXTURE_RGB); - wined3d_resource_invalidate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE); - swapchain->render_to_fbo = TRUE; - swapchain_update_draw_bindings(swapchain); - } - else - { -- surface_load_location(back_buffer, context, back_buffer->container->resource.draw_binding); -+ wined3d_resource_load_location(&back_buffer->resource, context, back_buffer->container->resource.draw_binding); - } - - if (swapchain->render_to_fbo) -@@ -640,7 +640,7 @@ void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *r - - TRACE("Copying surface %p to screen.\n", front); - -- surface_load_location(front, NULL, WINED3D_LOCATION_DIB); -+ wined3d_resource_load_location(&front->resource, NULL, WINED3D_LOCATION_DIB); - - src_dc = front->hDC; - window = swapchain->win_handle; -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 0c64f39..9eb8da1 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -777,7 +777,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub - - surface_prepare_map_memory(surface); - context = context_acquire(surface->resource.device, NULL); -- surface_load_location(surface, context, surface->resource.map_binding); -+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - context_release(context); - wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 8e51f16..b8dbde3 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2391,8 +2391,6 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte - void surface_load_ds_location(struct wined3d_surface *surface, - struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; - void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN; --void surface_load_location(struct wined3d_surface *surface, -- struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; - void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; - void surface_prepare_rb(struct wined3d_surface *surface, - const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,213 +0,0 @@ -From e714feefbc666c34518c908acbc630e9a9f0b48e 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. - ---- - dlls/wined3d/volume.c | 157 ++++++++++++++++++++++++++++++-------------------- - 1 file changed, 96 insertions(+), 61 deletions(-) - -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index f82347d..17502ee 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -480,12 +480,67 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol - return TRUE; - } - -+/* Context activation is done by the caller. */ -+static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, struct wined3d_context *context) -+{ -+ switch (volume->resource.map_binding) -+ { -+ case WINED3D_LOCATION_BUFFER: -+ wined3d_volume_prepare_pbo(volume, context); -+ return TRUE; -+ -+ case WINED3D_LOCATION_SYSMEM: -+ return volume_prepare_system_memory(volume); -+ -+ default: -+ ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding)); -+ return FALSE; -+ } -+} -+ -+static BYTE *wined3d_volume_get_map_ptr(const struct wined3d_volume *volume, -+ const struct wined3d_context *context, DWORD flags) -+{ -+ const struct wined3d_gl_info *gl_info; -+ BYTE *ptr; -+ -+ switch (volume->resource.map_binding) -+ { -+ case WINED3D_LOCATION_BUFFER: -+ gl_info = context->gl_info; -+ 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, -+ 0, volume->resource.size, mapflags)); -+ } -+ else -+ { -+ GLenum access = wined3d_resource_gl_legacy_map_flags(flags); -+ ptr = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); -+ } -+ -+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); -+ checkGLcall("Map PBO"); -+ return ptr; -+ -+ case WINED3D_LOCATION_SYSMEM: -+ return volume->resource.heap_memory; -+ -+ default: -+ ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding)); -+ return NULL; -+ } -+} -+ - HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) - { - struct wined3d_device *device = volume->resource.device; - struct wined3d_context *context; -- const struct wined3d_gl_info *gl_info; - BYTE *base_memory; - const struct wined3d_format *format = volume->resource.format; - const unsigned int fmt_flags = volume->container->resource.format_flags; -@@ -518,58 +573,22 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - - flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags); - -- if (volume->resource.map_binding == WINED3D_LOCATION_BUFFER) -+ context = context_acquire(device, NULL); -+ if (!wined3d_volume_prepare_map_memory(volume, context)) - { -- context = context_acquire(device, NULL); -- gl_info = context->gl_info; -- -- wined3d_volume_prepare_pbo(volume, context); -- if (flags & WINED3D_MAP_DISCARD) -- wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER); -- else -- wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_BUFFER); -- -- 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, -- 0, volume->resource.size, mapflags)); -- } -- else -- { -- GLenum access = wined3d_resource_gl_legacy_map_flags(flags); -- base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); -- } -- -- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); -- checkGLcall("Map PBO"); -- -+ WARN("Out of memory.\n"); -+ map_desc->data = NULL; - context_release(context); -+ return E_OUTOFMEMORY; - } -+ -+ if (flags & WINED3D_MAP_DISCARD) -+ wined3d_resource_validate_location(&volume->resource, volume->resource.map_binding); - else -- { -- if (!volume_prepare_system_memory(volume)) -- { -- WARN("Out of memory.\n"); -- map_desc->data = NULL; -- return E_OUTOFMEMORY; -- } -+ wined3d_resource_load_location(&volume->resource, context, volume->resource.map_binding); - -- if (flags & WINED3D_MAP_DISCARD) -- { -- wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); -- } -- else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM)) -- { -- context = context_acquire(device, NULL); -- wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM); -- context_release(context); -- } -- base_memory = volume->resource.heap_memory; -- } -+ base_memory = wined3d_volume_get_map_ptr(volume, context, flags); -+ context_release(context); - - TRACE("Base memory pointer %p.\n", base_memory); - -@@ -627,8 +646,34 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour - return volume_from_resource(resource); - } - -+static void wined3d_volume_release_map_ptr(const struct wined3d_volume *volume, -+ const struct wined3d_context *context) -+{ -+ const struct wined3d_gl_info *gl_info; -+ -+ switch (volume->resource.map_binding) -+ { -+ case WINED3D_LOCATION_BUFFER: -+ gl_info = context->gl_info; -+ 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; -+ -+ case WINED3D_LOCATION_SYSMEM: -+ return; -+ -+ default: -+ ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding)); -+ return; -+ } -+} -+ - HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) - { -+ struct wined3d_device *device = volume->resource.device; -+ struct wined3d_context *context; - TRACE("volume %p.\n", volume); - - if (!volume->resource.map_count) -@@ -637,19 +682,9 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) - return WINED3DERR_INVALIDCALL; - } - -- if (volume->resource.map_binding == WINED3D_LOCATION_BUFFER) -- { -- struct wined3d_device *device = volume->resource.device; -- struct wined3d_context *context = context_acquire(device, NULL); -- const struct wined3d_gl_info *gl_info = context->gl_info; -- -- 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); -- } -+ context = context_acquire(device, NULL); -+ wined3d_volume_release_map_ptr(volume, context); -+ context_release(context); - - volume->resource.map_count--; - --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0019-wined3d-Move-load_location-into-the-resource.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0019-wined3d-Move-load_location-into-the-resource.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0019-wined3d-Move-load_location-into-the-resource.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0019-wined3d-Move-load_location-into-the-resource.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,308 @@ +From 0dd2ded31943d0729f811330cc2afa0d3b050dc8 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. + +The resource part of load_location will handle transfers between sysmem +locations (heap memory, user memory, dib) and buffers. Texture loading +and downloading from textures will be delegated to surfaces / volumes. +--- + dlls/wined3d/buffer.c | 8 +++++++ + dlls/wined3d/resource.c | 50 ++++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/surface.c | 12 ++++++++-- + dlls/wined3d/texture.c | 8 +++++++ + dlls/wined3d/volume.c | 42 ++++++++--------------------------- + dlls/wined3d/wined3d_private.h | 7 +++++- + 6 files changed, 91 insertions(+), 36 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 727e8be..3470a89 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 + ERR("Not yet implemented.\n"); + } + ++/* Context activation is done by the caller. */ ++static void wined3d_buffer_load_location(struct wined3d_resource *resource, ++ struct wined3d_context *context, DWORD location) ++{ ++ ERR("Not yet implemented.\n"); ++} ++ + static const struct wined3d_resource_ops buffer_resource_ops = + { + buffer_resource_incref, + buffer_resource_decref, + buffer_unload, + wined3d_buffer_location_invalidated, ++ wined3d_buffer_load_location, + }; + + static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 35a1a14..39df397 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -461,3 +461,53 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO + + resource->resource_ops->resource_location_invalidated(resource, location); + } ++ ++DWORD wined3d_resource_access_from_location(DWORD location) ++{ ++ switch (location) ++ { ++ case WINED3D_LOCATION_DISCARDED: ++ return 0; ++ ++ case WINED3D_LOCATION_SYSMEM: ++ case WINED3D_LOCATION_USER_MEMORY: ++ case WINED3D_LOCATION_DIB: ++ return WINED3D_RESOURCE_ACCESS_CPU; ++ ++ case WINED3D_LOCATION_BUFFER: ++ case WINED3D_LOCATION_TEXTURE_RGB: ++ case WINED3D_LOCATION_TEXTURE_SRGB: ++ case WINED3D_LOCATION_DRAWABLE: ++ case WINED3D_LOCATION_RB_MULTISAMPLE: ++ case WINED3D_LOCATION_RB_RESOLVED: ++ return WINED3D_RESOURCE_ACCESS_GPU; ++ ++ default: ++ FIXME("Unhandled location %#x.\n", location); ++ return 0; ++ } ++} ++ ++/* Context activation is optionally by the caller. Context may be NULL. */ ++void wined3d_resource_load_location(struct wined3d_resource *resource, ++ struct wined3d_context *context, DWORD location) ++{ ++ DWORD required_access = wined3d_resource_access_from_location(location); ++ ++ if ((resource->locations & location) == location) ++ { ++ TRACE("Location(s) already up to date.\n"); ++ return; ++ } ++ ++ /* Keep this a WARN for now until surfaces are cleaned up. */ ++ if ((resource->access_flags & required_access) != required_access) ++ WARN("Operation requires %#x access, but resource only has %#x.\n", ++ required_access, resource->access_flags); ++ ++ /* Context is NULL in ddraw-only operation without OpenGL. */ ++ if (!context) ++ ERR("A context is required for non-sysmem operation.\n"); ++ ++ resource->resource_ops->resource_load_location(resource, context, location); ++} +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index a59e401..9e46545 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -1227,12 +1227,20 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour + wined3d_texture_set_dirty(surface->container); + } + ++/* Context activation is done by the caller. */ ++static void wined3d_surface_load_location(struct wined3d_resource *resource, ++ struct wined3d_context *context, DWORD location) ++{ ++ ERR("Not yet implemented.\n"); ++} ++ + static const struct wined3d_resource_ops surface_resource_ops = + { + surface_resource_incref, + surface_resource_decref, + surface_unload, + wined3d_surface_location_invalidated, ++ wined3d_surface_load_location, + }; + + static const struct wined3d_surface_ops surface_ops = +@@ -4062,7 +4070,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co + surface->ds_current_size.cy = surface->resource.height; + } + +-static DWORD resource_access_from_location(DWORD location) ++static DWORD surface_access_from_location(DWORD location) + { + switch (location) + { +@@ -4394,7 +4402,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte + + if (WARN_ON(d3d_surface)) + { +- DWORD required_access = resource_access_from_location(location); ++ DWORD required_access = surface_access_from_location(location); + if ((surface->resource.access_flags & required_access) != required_access) + WARN("Operation requires %#x access, but surface only has %#x.\n", + required_access, surface->resource.access_flags); +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index fe7936d..89f94f3 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -950,12 +950,20 @@ static void wined3d_texture_load_location_invalidated(struct wined3d_resource *r + ERR("Should not be called on textures.\n"); + } + ++/* Context activation is done by the caller. */ ++static void wined3d_texture_load_location(struct wined3d_resource *resource, ++ struct wined3d_context *context, DWORD location) ++{ ++ ERR("Should not be called on textures.\n"); ++} ++ + static const struct wined3d_resource_ops texture_resource_ops = + { + texture_resource_incref, + texture_resource_decref, + wined3d_texture_unload, + wined3d_texture_load_location_invalidated, ++ wined3d_texture_load_location, + }; + + 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 94eb77e..f82347d 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) + wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); + } + +-static DWORD volume_access_from_location(DWORD location) +-{ +- switch (location) +- { +- case WINED3D_LOCATION_DISCARDED: +- return 0; +- +- case WINED3D_LOCATION_SYSMEM: +- return WINED3D_RESOURCE_ACCESS_CPU; +- +- case WINED3D_LOCATION_BUFFER: +- case WINED3D_LOCATION_TEXTURE_RGB: +- case WINED3D_LOCATION_TEXTURE_SRGB: +- return WINED3D_RESOURCE_ACCESS_GPU; +- +- default: +- FIXME("Unhandled location %#x.\n", location); +- return 0; +- } +-} +- + /* Context activation is done by the caller. */ + static void wined3d_volume_srgb_transfer(struct wined3d_volume *volume, + struct wined3d_context *context, BOOL dest_is_srgb) +@@ -197,21 +176,17 @@ static BOOL wined3d_volume_can_evict(const struct wined3d_volume *volume) + + return TRUE; + } ++ + /* Context activation is done by the caller. */ +-static void wined3d_volume_load_location(struct wined3d_volume *volume, ++static void wined3d_volume_load_location(struct wined3d_resource *resource, + struct wined3d_context *context, DWORD location) + { +- DWORD required_access = volume_access_from_location(location); ++ struct wined3d_volume *volume = volume_from_resource(resource); ++ DWORD required_access = wined3d_resource_access_from_location(location); + + TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location), + wined3d_debug_location(volume->resource.locations)); + +- if ((volume->resource.locations & location) == location) +- { +- TRACE("Location(s) already up to date.\n"); +- return; +- } +- + if ((volume->resource.access_flags & required_access) != required_access) + { + ERR("Operation requires %#x access, but volume only has %#x.\n", +@@ -337,7 +312,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, + void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode) + { + wined3d_texture_prepare_texture(volume->container, context, srgb_mode); +- wined3d_volume_load_location(volume, context, ++ wined3d_resource_load_location(&volume->resource, context, + srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); + } + +@@ -396,7 +371,7 @@ static void volume_unload(struct wined3d_resource *resource) + if (volume_prepare_system_memory(volume)) + { + context = context_acquire(device, NULL); +- wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM); ++ wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM); + context_release(context); + wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_SYSMEM); + } +@@ -552,7 +527,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + if (flags & WINED3D_MAP_DISCARD) + wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER); + else +- wined3d_volume_load_location(volume, context, WINED3D_LOCATION_BUFFER); ++ wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_BUFFER); + + GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo)); + +@@ -590,7 +565,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM)) + { + context = context_acquire(device, NULL); +- wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM); ++ wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM); + context_release(context); + } + base_memory = volume->resource.heap_memory; +@@ -705,6 +680,7 @@ static const struct wined3d_resource_ops volume_resource_ops = + volume_resource_decref, + volume_unload, + wined3d_volume_location_invalidated, ++ wined3d_volume_load_location, + }; + + static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 936950f..e1e490e 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2138,6 +2138,8 @@ struct wined3d_resource_ops + ULONG (*resource_decref)(struct wined3d_resource *resource); + void (*resource_unload)(struct wined3d_resource *resource); + void (*resource_location_invalidated)(struct wined3d_resource *resource, DWORD location); ++ void (*resource_load_location)(struct wined3d_resource *resource, ++ struct wined3d_context *context, DWORD location); + }; + + struct wined3d_resource +@@ -2190,17 +2192,20 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * + void *parent, const struct wined3d_parent_ops *parent_ops, + const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN; + void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; + BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, + UINT *slice_pitch) DECLSPEC_HIDDEN; + GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; + GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; ++void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; + BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_resource_load_location(struct wined3d_resource *resource, ++ struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; + DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; + void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; +-void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; + + /* Tests show that the start address of resources is 32 byte aligned */ + #define RESOURCE_ALIGNMENT 16 +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,308 +0,0 @@ -From 4dedb87fa2626251d0c7c0d5f861f8665bfa289b 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. - ---- - dlls/wined3d/resource.c | 64 +++++++++++++++++++++++++++++- - dlls/wined3d/volume.c | 90 +++++++----------------------------------- - dlls/wined3d/wined3d_private.h | 7 +++- - 3 files changed, 82 insertions(+), 79 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 61a829d..1fb2370 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -301,7 +301,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) - return ret; - } - --GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) -+static GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) - { - if (d3d_flags & WINED3D_MAP_READONLY) - return GL_READ_ONLY_ARB; -@@ -437,3 +437,65 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, - - resource->resource_ops->resource_load_location(resource, context, location); - } -+ -+BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, -+ const struct wined3d_context *context, DWORD flags) -+{ -+ const struct wined3d_gl_info *gl_info; -+ BYTE *ptr; -+ -+ switch (resource->map_binding) -+ { -+ case WINED3D_LOCATION_BUFFER: -+ gl_info = context->gl_info; -+ 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, -+ 0, resource->size, mapflags)); -+ } -+ else -+ { -+ GLenum access = wined3d_resource_gl_legacy_map_flags(flags); -+ ptr = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); -+ } -+ -+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); -+ checkGLcall("Map GL buffer"); -+ return ptr; -+ -+ case WINED3D_LOCATION_SYSMEM: -+ return resource->heap_memory; -+ -+ default: -+ ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); -+ return NULL; -+ } -+} -+ -+void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, -+ const struct wined3d_context *context) -+{ -+ const struct wined3d_gl_info *gl_info; -+ -+ switch (resource->map_binding) -+ { -+ case WINED3D_LOCATION_BUFFER: -+ gl_info = context->gl_info; -+ 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; -+ -+ case WINED3D_LOCATION_SYSMEM: -+ return; -+ -+ default: -+ ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); -+ return; -+ } -+} -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 99caab8..5fe223b 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -218,7 +218,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, - } - else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) - { -- struct wined3d_const_bo_address data = {volume->pbo, NULL}; -+ struct wined3d_const_bo_address data = {volume->resource.buffer_object, NULL}; - wined3d_texture_bind_and_dirtify(volume->container, context, - location == WINED3D_LOCATION_TEXTURE_SRGB); - wined3d_volume_upload_data(volume, context, &data); -@@ -274,7 +274,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, - break; - - case WINED3D_LOCATION_BUFFER: -- if (!volume->pbo) -+ if (!volume->resource.buffer_object) - ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); - - if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) -@@ -284,7 +284,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, - } - else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - { -- struct wined3d_bo_address data = {volume->pbo, NULL}; -+ struct wined3d_bo_address data = {volume->resource.buffer_object, NULL}; - - if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) - wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); -@@ -321,16 +321,16 @@ static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct win - { - const struct wined3d_gl_info *gl_info = context->gl_info; - -- if (volume->pbo) -+ if (volume->resource.buffer_object) - return; - -- 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); -+ TRACE("Created PBO %u for volume %p.\n", volume->resource.buffer_object, volume); - } - - static void wined3d_volume_free_pbo(struct wined3d_volume *volume) -@@ -338,10 +338,10 @@ static void wined3d_volume_free_pbo(struct wined3d_volume *volume) - struct wined3d_context *context = context_acquire(volume->resource.device, NULL); - const struct wined3d_gl_info *gl_info = context->gl_info; - -- TRACE("Deleting PBO %u belonging to volume %p.\n", volume->pbo, volume); -- GL_EXTCALL(glDeleteBuffers(1, &volume->pbo)); -+ TRACE("Deleting PBO %u belonging to volume %p.\n", volume->resource.buffer_object, volume); -+ GL_EXTCALL(glDeleteBuffers(1, &volume->resource.buffer_object)); - checkGLcall("glDeleteBuffers"); -- volume->pbo = 0; -+ volume->resource.buffer_object = 0; - context_release(context); - } - -@@ -349,7 +349,7 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) - { - TRACE("volume %p.\n", volume); - -- if (volume->pbo) -+ if (volume->resource.buffer_object) - wined3d_volume_free_pbo(volume); - - resource_cleanup(&volume->resource); -@@ -382,7 +382,7 @@ static void volume_unload(struct wined3d_resource *resource) - wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); - } - -- if (volume->pbo) -+ if (volume->resource.buffer_object) - { - /* Should not happen because only dynamic default pool volumes - * have a buffer, and those are not evicted by device_evit_managed_resources -@@ -498,44 +498,6 @@ static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, str - } - } - --static BYTE *wined3d_volume_get_map_ptr(const struct wined3d_volume *volume, -- const struct wined3d_context *context, DWORD flags) --{ -- const struct wined3d_gl_info *gl_info; -- BYTE *ptr; -- -- switch (volume->resource.map_binding) -- { -- case WINED3D_LOCATION_BUFFER: -- gl_info = context->gl_info; -- 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, -- 0, volume->resource.size, mapflags)); -- } -- else -- { -- GLenum access = wined3d_resource_gl_legacy_map_flags(flags); -- ptr = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); -- } -- -- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); -- checkGLcall("Map PBO"); -- return ptr; -- -- case WINED3D_LOCATION_SYSMEM: -- return volume->resource.heap_memory; -- -- default: -- ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding)); -- return NULL; -- } --} -- - HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) - { -@@ -586,7 +548,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - else - wined3d_resource_load_location(&volume->resource, context, volume->resource.map_binding); - -- base_memory = wined3d_volume_get_map_ptr(volume, context, flags); -+ base_memory = wined3d_resource_get_map_ptr(&volume->resource, context, flags); - context_release(context); - - TRACE("Base memory pointer %p.\n", base_memory); -@@ -645,30 +607,6 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour - return volume_from_resource(resource); - } - --static void wined3d_volume_release_map_ptr(const struct wined3d_volume *volume, -- const struct wined3d_context *context) --{ -- const struct wined3d_gl_info *gl_info; -- -- switch (volume->resource.map_binding) -- { -- case WINED3D_LOCATION_BUFFER: -- gl_info = context->gl_info; -- 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; -- -- case WINED3D_LOCATION_SYSMEM: -- return; -- -- default: -- ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding)); -- return; -- } --} -- - HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) - { - struct wined3d_device *device = volume->resource.device; -@@ -682,7 +620,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) - } - - context = context_acquire(device, NULL); -- wined3d_volume_release_map_ptr(volume, context); -+ wined3d_resource_release_map_ptr(&volume->resource, context); - context_release(context); - - volume->resource.map_count--; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index b8dbde3..460e861 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2125,6 +2125,7 @@ struct wined3d_resource - DWORD priority; - void *heap_memory, *user_memory, *bitmap_data; - UINT custom_row_pitch, custom_slice_pitch; -+ GLuint buffer_object; - struct list resource_list_entry; - DWORD locations; - -@@ -2154,12 +2155,15 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; - BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, -+ const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; - GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; --GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; - void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; - BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_load_location(struct wined3d_resource *resource, - struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; -+void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, -+ const struct wined3d_context *context) DECLSPEC_HIDDEN; - DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; - void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; -@@ -2283,7 +2287,6 @@ struct wined3d_volume - DWORD flags; - GLint texture_level; - DWORD download_count; -- GLuint pbo; - }; - - static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0020-wined3d-Replace-surface_load_location-with-resource_.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0020-wined3d-Replace-surface_load_location-with-resource_.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0020-wined3d-Replace-surface_load_location-with-resource_.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0020-wined3d-Replace-surface_load_location-with-resource_.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,402 @@ +From d934f1879e55a8787562d4cc75ce2bd981f8b585 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 17 Nov 2013 20:33:17 +0100 +Subject: wined3d: Replace surface_load_location with resource_load_location. + +FIXME: Check if this patch is complete enough to make sense. +--- + dlls/wined3d/context.c | 2 +- + dlls/wined3d/device.c | 2 +- + dlls/wined3d/drawprim.c | 2 +- + dlls/wined3d/surface.c | 111 +++++++++++++---------------------------- + dlls/wined3d/swapchain.c | 8 +-- + dlls/wined3d/texture.c | 2 +- + dlls/wined3d/wined3d_private.h | 2 - + 7 files changed, 43 insertions(+), 86 deletions(-) + +diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c +index 167ea7d..5644ea0 100644 +--- a/dlls/wined3d/context.c ++++ b/dlls/wined3d/context.c +@@ -2224,7 +2224,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, + WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); + + /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ +- surface_load_location(context->current_rt, context, WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_resource_load_location(&context->current_rt->resource, context, WINED3D_LOCATION_TEXTURE_RGB); + swapchain->render_to_fbo = TRUE; + swapchain_update_draw_bindings(swapchain); + context_set_render_offscreen(context, TRUE); +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 1874a2b..ab874de 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -323,7 +323,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c + { + struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(fb->render_targets[i]); + if (rt) +- surface_load_location(rt, context, rt->container->resource.draw_binding); ++ wined3d_resource_load_location(&rt->resource, context, rt->container->resource.draw_binding); + } + } + +diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c +index 6f226ce..f2c2f42 100644 +--- a/dlls/wined3d/drawprim.c ++++ b/dlls/wined3d/drawprim.c +@@ -628,7 +628,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co + struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]); + if (target) + { +- surface_load_location(target, context, target->container->resource.draw_binding); ++ wined3d_resource_load_location(&target->resource, context, target->container->resource.draw_binding); + wined3d_resource_invalidate_location(&target->resource, ~target->container->resource.draw_binding); + } + } +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 1fcbc98..f7171df 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -758,7 +758,7 @@ static void surface_unmap(struct wined3d_surface *surface) + + if (device->d3d_initialized) + context = context_acquire(device, surface); +- surface_load_location(surface, context, surface->container->resource.draw_binding); ++ wined3d_resource_load_location(&surface->resource, context, surface->container->resource.draw_binding); + if (context) + context_release(context); + } +@@ -824,9 +824,9 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, + + /* Make sure the locations are up-to-date. Loading the destination + * surface isn't required if the entire surface is overwritten. */ +- surface_load_location(src_surface, context, src_location); ++ wined3d_resource_load_location(&src_surface->resource, context, src_location); + if (!surface_is_full_rect(dst_surface, dst_rect)) +- surface_load_location(dst_surface, context, dst_location); ++ wined3d_resource_load_location(&dst_surface->resource, context, dst_location); + + gl_info = context->gl_info; + +@@ -915,9 +915,9 @@ static void surface_blt_fbo(const struct wined3d_device *device, + * surface isn't required if the entire surface is overwritten. (And is + * in fact harmful if we're being called by surface_load_location() with + * the purpose of loading the destination surface.) */ +- surface_load_location(src_surface, old_ctx, src_location); ++ wined3d_resource_load_location(&src_surface->resource, old_ctx, src_location); + if (!surface_is_full_rect(dst_surface, &dst_rect)) +- surface_load_location(dst_surface, old_ctx, dst_location); ++ wined3d_resource_load_location(&dst_surface->resource, old_ctx, dst_location); + + if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface; + else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface; +@@ -1179,7 +1179,7 @@ static void surface_unload(struct wined3d_resource *resource) + else + { + surface_prepare_map_memory(surface); +- surface_load_location(surface, context, surface->resource.map_binding); ++ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); + wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); + } + +@@ -1224,22 +1224,6 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour + wined3d_texture_set_dirty(surface->container); + } + +-/* Context activation is done by the caller. */ +-static void wined3d_surface_load_location(struct wined3d_resource *resource, +- struct wined3d_context *context, DWORD location) +-{ +- ERR("Not yet implemented.\n"); +-} +- +-static const struct wined3d_resource_ops surface_resource_ops = +-{ +- surface_resource_incref, +- surface_resource_decref, +- surface_unload, +- wined3d_surface_location_invalidated, +- wined3d_surface_load_location, +-}; +- + static const struct wined3d_surface_ops surface_ops = + { + surface_private_setup, +@@ -1683,7 +1667,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P + if (update_w == dst_w && update_h == dst_h) + wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); + else +- surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); + + surface_get_memory(src_surface, &data, src_surface->resource.locations); +@@ -1816,7 +1800,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte + } + TRACE("Reloading because surface is dirty.\n"); + +- surface_load_location(surface, context, location); ++ wined3d_resource_load_location(&surface->resource, context, location); + surface_evict_sysmem(surface); + } + +@@ -2749,7 +2733,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + + if (surface->resource.device->d3d_initialized) + context = context_acquire(surface->resource.device, NULL); +- surface_load_location(surface, context, surface->resource.map_binding); ++ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); + if (context) + context_release(context); + } +@@ -2854,7 +2838,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) + { + if (surface->flags & SFLAG_CLIENT) + { +- surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM); ++ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); + surface_release_client_storage(surface); + } + hr = surface_create_dib_section(surface); +@@ -2870,7 +2854,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) + surface->resource.map_binding = WINED3D_LOCATION_DIB; + } + +- surface_load_location(surface, context, WINED3D_LOCATION_DIB); ++ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_DIB); + wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB); + + if (context) +@@ -2919,7 +2903,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) + if (device->d3d_initialized) + context = context_acquire(device, NULL); + +- surface_load_location(surface, context, surface->resource.map_binding); ++ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); + wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB); + if (context) + context_release(context); +@@ -3634,8 +3618,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, + gl_info = context->gl_info; + + /* Make sure the surface is up-to-date. This should probably use +- * surface_load_location() and worry about the destination surface too, +- * unless we're overwriting it completely. */ ++ * wined3d_resource_load_location() and worry about the destination ++ * surface too, unless we're overwriting it completely. */ + wined3d_texture_load(src_surface->container, context, FALSE); + + /* Activate the destination context, set it up for blitting */ +@@ -4073,29 +4057,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co + surface->ds_current_size.cy = surface->resource.height; + } + +-static DWORD surface_access_from_location(DWORD location) +-{ +- switch (location) +- { +- case WINED3D_LOCATION_SYSMEM: +- case WINED3D_LOCATION_USER_MEMORY: +- case WINED3D_LOCATION_DIB: +- case WINED3D_LOCATION_BUFFER: +- return WINED3D_RESOURCE_ACCESS_CPU; +- +- case WINED3D_LOCATION_DRAWABLE: +- case WINED3D_LOCATION_TEXTURE_SRGB: +- case WINED3D_LOCATION_TEXTURE_RGB: +- case WINED3D_LOCATION_RB_MULTISAMPLE: +- case WINED3D_LOCATION_RB_RESOLVED: +- return WINED3D_RESOURCE_ACCESS_GPU; +- +- default: +- FIXME("Unhandled location %#x.\n", location); +- return 0; +- } +-} +- + static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD location) + { + struct wined3d_device *device = surface->resource.device; +@@ -4145,7 +4106,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, + } + + if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) +- surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); + + /* Download the surface to system memory. */ + if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) +@@ -4181,7 +4142,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, + } + + surface_get_rect(surface, NULL, &r); +- surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); + surface_blt_to_drawable(surface->resource.device, context, + WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); + +@@ -4254,7 +4215,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + /* Performance warning... */ + FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); + surface_prepare_map_memory(surface); +- surface_load_location(surface, context, surface->resource.map_binding); ++ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); + } + } + else +@@ -4265,7 +4226,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + /* Performance warning... */ + FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); + surface_prepare_map_memory(surface); +- surface_load_location(surface, context, surface->resource.map_binding); ++ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); + } + } + +@@ -4274,7 +4235,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); + /* Lets hope we get it from somewhere... */ + surface_prepare_system_memory(surface); +- surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM); ++ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); + } + + wined3d_texture_prepare_texture(texture, context, srgb); +@@ -4300,7 +4261,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; + + surface_prepare_map_memory(surface); +- surface_load_location(surface, context, surface->resource.map_binding); ++ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); + surface_remove_pbo(surface, gl_info); + } + +@@ -4368,9 +4329,11 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct + surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect); + } + +-/* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ +-void surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) ++/* Context activation is done by the caller. */ ++static void wined3d_surface_load_location(struct wined3d_resource *resource, ++ struct wined3d_context *context, DWORD location) + { ++ struct wined3d_surface *surface = surface_from_resource(resource); + HRESULT hr; + + TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); +@@ -4397,20 +4360,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte + } + } + +- if (surface->resource.locations & location) +- { +- TRACE("Location already up to date.\n"); +- return; +- } +- +- if (WARN_ON(d3d_surface)) +- { +- DWORD required_access = surface_access_from_location(location); +- if ((surface->resource.access_flags & required_access) != required_access) +- WARN("Operation requires %#x access, but surface only has %#x.\n", +- required_access, surface->resource.access_flags); +- } +- + if (!surface->resource.locations) + { + ERR("Surface %p does not have any up to date location.\n", surface); +@@ -5552,7 +5501,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) + { + struct wined3d_context *context = context_acquire(device, dst_surface); +- surface_load_location(dst_surface, context, dst_surface->container->resource.draw_binding); ++ wined3d_resource_load_location(&dst_surface->resource, context, ++ dst_surface->container->resource.draw_binding); + context_release(context); + } + return WINED3D_OK; +@@ -5625,6 +5575,15 @@ cpu: + return surface_cpu_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter); + } + ++static const struct wined3d_resource_ops surface_resource_ops = ++{ ++ surface_resource_incref, ++ surface_resource_decref, ++ surface_unload, ++ wined3d_surface_location_invalidated, ++ wined3d_surface_load_location, ++}; ++ + static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container, + const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) + { +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index 6864a4a..15f7708 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -309,7 +309,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain, + if (backbuffer->resource.multisample_type) + { + location = WINED3D_LOCATION_RB_RESOLVED; +- surface_load_location(backbuffer, context, location); ++ wined3d_resource_load_location(&backbuffer->resource, context, location); + } + + context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, backbuffer, NULL, location); +@@ -511,14 +511,14 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + */ + if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO) + { +- surface_load_location(back_buffer, context, WINED3D_LOCATION_TEXTURE_RGB); ++ wined3d_resource_load_location(&back_buffer->resource, context, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_resource_invalidate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE); + swapchain->render_to_fbo = TRUE; + swapchain_update_draw_bindings(swapchain); + } + else + { +- surface_load_location(back_buffer, context, back_buffer->container->resource.draw_binding); ++ wined3d_resource_load_location(&back_buffer->resource, context, back_buffer->container->resource.draw_binding); + } + + if (swapchain->render_to_fbo) +@@ -640,7 +640,7 @@ void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *r + + TRACE("Copying surface %p to screen.\n", front); + +- surface_load_location(front, NULL, WINED3D_LOCATION_DIB); ++ wined3d_resource_load_location(&front->resource, NULL, WINED3D_LOCATION_DIB); + + src_dc = front->hDC; + window = swapchain->win_handle; +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 0c64f39..9eb8da1 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -777,7 +777,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub + + surface_prepare_map_memory(surface); + context = context_acquire(surface->resource.device, NULL); +- surface_load_location(surface, context, surface->resource.map_binding); ++ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); + context_release(context); + wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 8e51f16..b8dbde3 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2391,8 +2391,6 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte + void surface_load_ds_location(struct wined3d_surface *surface, + struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; + void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN; +-void surface_load_location(struct wined3d_surface *surface, +- struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; + void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; + void surface_prepare_rb(struct wined3d_surface *surface, + const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0021-wined3d-Introduce-helper-functions-for-mapping-volum.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0021-wined3d-Introduce-helper-functions-for-mapping-volum.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0021-wined3d-Introduce-helper-functions-for-mapping-volum.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0021-wined3d-Introduce-helper-functions-for-mapping-volum.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,213 @@ +From e714feefbc666c34518c908acbc630e9a9f0b48e 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. + +--- + dlls/wined3d/volume.c | 157 ++++++++++++++++++++++++++++++-------------------- + 1 file changed, 96 insertions(+), 61 deletions(-) + +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index f82347d..17502ee 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -480,12 +480,67 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol + return TRUE; + } + ++/* Context activation is done by the caller. */ ++static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, struct wined3d_context *context) ++{ ++ switch (volume->resource.map_binding) ++ { ++ case WINED3D_LOCATION_BUFFER: ++ wined3d_volume_prepare_pbo(volume, context); ++ return TRUE; ++ ++ case WINED3D_LOCATION_SYSMEM: ++ return volume_prepare_system_memory(volume); ++ ++ default: ++ ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding)); ++ return FALSE; ++ } ++} ++ ++static BYTE *wined3d_volume_get_map_ptr(const struct wined3d_volume *volume, ++ const struct wined3d_context *context, DWORD flags) ++{ ++ const struct wined3d_gl_info *gl_info; ++ BYTE *ptr; ++ ++ switch (volume->resource.map_binding) ++ { ++ case WINED3D_LOCATION_BUFFER: ++ gl_info = context->gl_info; ++ 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, ++ 0, volume->resource.size, mapflags)); ++ } ++ else ++ { ++ GLenum access = wined3d_resource_gl_legacy_map_flags(flags); ++ ptr = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); ++ } ++ ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); ++ checkGLcall("Map PBO"); ++ return ptr; ++ ++ case WINED3D_LOCATION_SYSMEM: ++ return volume->resource.heap_memory; ++ ++ default: ++ ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding)); ++ return NULL; ++ } ++} ++ + HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) + { + struct wined3d_device *device = volume->resource.device; + struct wined3d_context *context; +- const struct wined3d_gl_info *gl_info; + BYTE *base_memory; + const struct wined3d_format *format = volume->resource.format; + const unsigned int fmt_flags = volume->container->resource.format_flags; +@@ -518,58 +573,22 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + + flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags); + +- if (volume->resource.map_binding == WINED3D_LOCATION_BUFFER) ++ context = context_acquire(device, NULL); ++ if (!wined3d_volume_prepare_map_memory(volume, context)) + { +- context = context_acquire(device, NULL); +- gl_info = context->gl_info; +- +- wined3d_volume_prepare_pbo(volume, context); +- if (flags & WINED3D_MAP_DISCARD) +- wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER); +- else +- wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_BUFFER); +- +- 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, +- 0, volume->resource.size, mapflags)); +- } +- else +- { +- GLenum access = wined3d_resource_gl_legacy_map_flags(flags); +- base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); +- } +- +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); +- checkGLcall("Map PBO"); +- ++ WARN("Out of memory.\n"); ++ map_desc->data = NULL; + context_release(context); ++ return E_OUTOFMEMORY; + } ++ ++ if (flags & WINED3D_MAP_DISCARD) ++ wined3d_resource_validate_location(&volume->resource, volume->resource.map_binding); + else +- { +- if (!volume_prepare_system_memory(volume)) +- { +- WARN("Out of memory.\n"); +- map_desc->data = NULL; +- return E_OUTOFMEMORY; +- } ++ wined3d_resource_load_location(&volume->resource, context, volume->resource.map_binding); + +- if (flags & WINED3D_MAP_DISCARD) +- { +- wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); +- } +- else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM)) +- { +- context = context_acquire(device, NULL); +- wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM); +- context_release(context); +- } +- base_memory = volume->resource.heap_memory; +- } ++ base_memory = wined3d_volume_get_map_ptr(volume, context, flags); ++ context_release(context); + + TRACE("Base memory pointer %p.\n", base_memory); + +@@ -627,8 +646,34 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour + return volume_from_resource(resource); + } + ++static void wined3d_volume_release_map_ptr(const struct wined3d_volume *volume, ++ const struct wined3d_context *context) ++{ ++ const struct wined3d_gl_info *gl_info; ++ ++ switch (volume->resource.map_binding) ++ { ++ case WINED3D_LOCATION_BUFFER: ++ gl_info = context->gl_info; ++ 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; ++ ++ case WINED3D_LOCATION_SYSMEM: ++ return; ++ ++ default: ++ ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding)); ++ return; ++ } ++} ++ + HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) + { ++ struct wined3d_device *device = volume->resource.device; ++ struct wined3d_context *context; + TRACE("volume %p.\n", volume); + + if (!volume->resource.map_count) +@@ -637,19 +682,9 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) + return WINED3DERR_INVALIDCALL; + } + +- if (volume->resource.map_binding == WINED3D_LOCATION_BUFFER) +- { +- struct wined3d_device *device = volume->resource.device; +- struct wined3d_context *context = context_acquire(device, NULL); +- const struct wined3d_gl_info *gl_info = context->gl_info; +- +- 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); +- } ++ context = context_acquire(device, NULL); ++ wined3d_volume_release_map_ptr(volume, context); ++ context_release(context); + + volume->resource.map_count--; + +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0021-wined3d-Remove-surface-pbo.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0021-wined3d-Remove-surface-pbo.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0021-wined3d-Remove-surface-pbo.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0021-wined3d-Remove-surface-pbo.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ -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. - ---- - dlls/wined3d/surface.c | 42 +++++++++++++++++++++--------------------- - dlls/wined3d/wined3d_private.h | 2 -- - 2 files changed, 21 insertions(+), 23 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -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) - - TRACE("surface %p.\n", surface); - -- if (surface->pbo || surface->rb_multisample -+ if (surface->resource.buffer_object || surface->rb_multisample - || surface->rb_resolved || !list_empty(&surface->renderbuffers)) - { - struct wined3d_renderbuffer_entry *entry, *entry2; -@@ -56,10 +56,10 @@ static void surface_cleanup(struct wined3d_surface *surface) - context = context_acquire(surface->resource.device, NULL); - gl_info = context->gl_info; - -- if (surface->pbo) -+ if (surface->resource.buffer_object) - { -- TRACE("Deleting PBO %u.\n", surface->pbo); -- GL_EXTCALL(glDeleteBuffers(1, &surface->pbo)); -+ TRACE("Deleting PBO %u.\n", surface->resource.buffer_object); -+ GL_EXTCALL(glDeleteBuffers(1, &surface->resource.buffer_object)); - } - - if (surface->rb_multisample) -@@ -485,7 +485,7 @@ static void surface_get_memory(const struct wined3d_surface *surface, struct win - if (location & WINED3D_LOCATION_BUFFER) - { - data->addr = NULL; -- data->buffer_object = surface->pbo; -+ data->buffer_object = surface->resource.buffer_object; - return; - } - if (location & WINED3D_LOCATION_USER_MEMORY) -@@ -518,20 +518,20 @@ static void surface_prepare_buffer(struct wined3d_surface *surface) - GLenum error; - const struct wined3d_gl_info *gl_info; - -- if (surface->pbo) -+ if (surface->resource.buffer_object) - return; - - context = context_acquire(surface->resource.device, NULL); - gl_info = context->gl_info; - -- 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) - ERR("Failed to create a PBO with error %s (%#x).\n", debug_glerror(error), error); - -- TRACE("Binding PBO %u.\n", surface->pbo); -+ TRACE("Binding PBO %u.\n", surface->resource.buffer_object); - -- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->pbo)); -+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->resource.buffer_object)); - checkGLcall("glBindBuffer"); - - 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(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(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; - wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_BUFFER); - } - -@@ -1241,7 +1241,7 @@ static void surface_unload(struct wined3d_resource *resource) - } - - /* Destroy PBOs, but load them into real sysmem before */ -- if (surface->pbo) -+ if (surface->resource.buffer_object) - surface_remove_pbo(surface, gl_info); - - /* Destroy fbo render buffers. This is needed for implicit render targets, for -@@ -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(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"); -@@ -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 -- || surface->pbo)) -+ || surface->resource.buffer_object)) - surface->resource.map_binding = WINED3D_LOCATION_DIB; - } - -@@ -3209,9 +3209,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) - - /* Flip the PBO */ - { -- GLuint tmp_pbo = front->pbo; -- front->pbo = back->pbo; -- back->pbo = tmp_pbo; -+ GLuint tmp_pbo = front->resource.buffer_object; -+ front->resource.buffer_object = back->resource.buffer_object; -+ back->resource.buffer_object = tmp_pbo; - } - - /* Flip the opengl texture */ -@@ -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. */ -- if ((format.convert || conversion) && surface->pbo) -+ if ((format.convert || conversion) && surface->resource.buffer_object) - { - 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 8cce2d9..7efecd4 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2324,8 +2324,6 @@ struct wined3d_surface - UINT pow2Width; - UINT pow2Height; - -- /* PBO */ -- GLuint pbo; - GLuint rb_multisample; - GLuint rb_resolved; - GLenum texture_target; --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0022-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0022-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0022-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0022-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,310 @@ +From 441b1121637291e4f7e87640911111c8f6398c4f 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. + +--- + dlls/wined3d/resource.c | 64 +++++++++++++++++++++++++++++- + dlls/wined3d/volume.c | 90 +++++++----------------------------------- + dlls/wined3d/wined3d_private.h | 7 +++- + 3 files changed, 82 insertions(+), 79 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 39df397..5f0a98e 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -373,7 +373,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) + return ret; + } + +-GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) ++static GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) + { + if (d3d_flags & WINED3D_MAP_READONLY) + return GL_READ_ONLY_ARB; +@@ -511,3 +511,65 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, + + resource->resource_ops->resource_load_location(resource, context, location); + } ++ ++BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, ++ const struct wined3d_context *context, DWORD flags) ++{ ++ const struct wined3d_gl_info *gl_info; ++ BYTE *ptr; ++ ++ switch (resource->map_binding) ++ { ++ case WINED3D_LOCATION_BUFFER: ++ gl_info = context->gl_info; ++ 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, ++ 0, resource->size, mapflags)); ++ } ++ else ++ { ++ GLenum access = wined3d_resource_gl_legacy_map_flags(flags); ++ ptr = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); ++ } ++ ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); ++ checkGLcall("Map GL buffer"); ++ return ptr; ++ ++ case WINED3D_LOCATION_SYSMEM: ++ return resource->heap_memory; ++ ++ default: ++ ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); ++ return NULL; ++ } ++} ++ ++void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, ++ const struct wined3d_context *context) ++{ ++ const struct wined3d_gl_info *gl_info; ++ ++ switch (resource->map_binding) ++ { ++ case WINED3D_LOCATION_BUFFER: ++ gl_info = context->gl_info; ++ 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; ++ ++ case WINED3D_LOCATION_SYSMEM: ++ return; ++ ++ default: ++ ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); ++ return; ++ } ++} +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 17502ee..de96508 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -218,7 +218,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, + } + else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) + { +- struct wined3d_const_bo_address data = {volume->pbo, NULL}; ++ struct wined3d_const_bo_address data = {volume->resource.buffer_object, NULL}; + wined3d_texture_bind_and_dirtify(volume->container, context, + location == WINED3D_LOCATION_TEXTURE_SRGB); + wined3d_volume_upload_data(volume, context, &data); +@@ -274,7 +274,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, + break; + + case WINED3D_LOCATION_BUFFER: +- if (!volume->pbo) ++ if (!volume->resource.buffer_object) + ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); + + if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) +@@ -284,7 +284,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, + } + else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + { +- struct wined3d_bo_address data = {volume->pbo, NULL}; ++ struct wined3d_bo_address data = {volume->resource.buffer_object, NULL}; + + if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) + wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); +@@ -321,16 +321,16 @@ static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct win + { + const struct wined3d_gl_info *gl_info = context->gl_info; + +- if (volume->pbo) ++ if (volume->resource.buffer_object) + return; + +- 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); ++ TRACE("Created PBO %u for volume %p.\n", volume->resource.buffer_object, volume); + } + + static void wined3d_volume_free_pbo(struct wined3d_volume *volume) +@@ -338,10 +338,10 @@ static void wined3d_volume_free_pbo(struct wined3d_volume *volume) + struct wined3d_context *context = context_acquire(volume->resource.device, NULL); + const struct wined3d_gl_info *gl_info = context->gl_info; + +- TRACE("Deleting PBO %u belonging to volume %p.\n", volume->pbo, volume); +- GL_EXTCALL(glDeleteBuffers(1, &volume->pbo)); ++ TRACE("Deleting PBO %u belonging to volume %p.\n", volume->resource.buffer_object, volume); ++ GL_EXTCALL(glDeleteBuffers(1, &volume->resource.buffer_object)); + checkGLcall("glDeleteBuffers"); +- volume->pbo = 0; ++ volume->resource.buffer_object = 0; + context_release(context); + } + +@@ -349,7 +349,7 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) + { + TRACE("volume %p.\n", volume); + +- if (volume->pbo) ++ if (volume->resource.buffer_object) + wined3d_volume_free_pbo(volume); + + resource_cleanup(&volume->resource); +@@ -382,7 +382,7 @@ static void volume_unload(struct wined3d_resource *resource) + wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); + } + +- if (volume->pbo) ++ if (volume->resource.buffer_object) + { + /* Should not happen because only dynamic default pool volumes + * have a buffer, and those are not evicted by device_evit_managed_resources +@@ -498,44 +498,6 @@ static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, str + } + } + +-static BYTE *wined3d_volume_get_map_ptr(const struct wined3d_volume *volume, +- const struct wined3d_context *context, DWORD flags) +-{ +- const struct wined3d_gl_info *gl_info; +- BYTE *ptr; +- +- switch (volume->resource.map_binding) +- { +- case WINED3D_LOCATION_BUFFER: +- gl_info = context->gl_info; +- 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, +- 0, volume->resource.size, mapflags)); +- } +- else +- { +- GLenum access = wined3d_resource_gl_legacy_map_flags(flags); +- ptr = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); +- } +- +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); +- checkGLcall("Map PBO"); +- return ptr; +- +- case WINED3D_LOCATION_SYSMEM: +- return volume->resource.heap_memory; +- +- default: +- ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding)); +- return NULL; +- } +-} +- + HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) + { +@@ -587,7 +549,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + else + wined3d_resource_load_location(&volume->resource, context, volume->resource.map_binding); + +- base_memory = wined3d_volume_get_map_ptr(volume, context, flags); ++ base_memory = wined3d_resource_get_map_ptr(&volume->resource, context, flags); + context_release(context); + + TRACE("Base memory pointer %p.\n", base_memory); +@@ -646,30 +608,6 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour + return volume_from_resource(resource); + } + +-static void wined3d_volume_release_map_ptr(const struct wined3d_volume *volume, +- const struct wined3d_context *context) +-{ +- const struct wined3d_gl_info *gl_info; +- +- switch (volume->resource.map_binding) +- { +- case WINED3D_LOCATION_BUFFER: +- gl_info = context->gl_info; +- 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; +- +- case WINED3D_LOCATION_SYSMEM: +- return; +- +- default: +- ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding)); +- return; +- } +-} +- + HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) + { + struct wined3d_device *device = volume->resource.device; +@@ -683,7 +621,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) + } + + context = context_acquire(device, NULL); +- wined3d_volume_release_map_ptr(volume, context); ++ wined3d_resource_release_map_ptr(&volume->resource, context); + context_release(context); + + volume->resource.map_count--; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 53fd864..c8c44d3 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2166,6 +2166,7 @@ struct wined3d_resource + DWORD priority; + void *heap_memory, *user_memory, *bitmap_data; + UINT custom_row_pitch, custom_slice_pitch; ++ GLuint buffer_object; + struct list resource_list_entry; + DWORD locations; + +@@ -2195,14 +2196,17 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; + BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, ++ const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; + void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, + UINT *slice_pitch) DECLSPEC_HIDDEN; + GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; +-GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; + void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; + BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_load_location(struct wined3d_resource *resource, + struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; ++void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, ++ const struct wined3d_context *context) DECLSPEC_HIDDEN; + DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; + void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; +@@ -2326,7 +2330,6 @@ struct wined3d_volume + DWORD flags; + GLint texture_level; + DWORD download_count; +- GLuint pbo; + }; + + static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,177 +0,0 @@ -From 68ee5f83114581754be6462ea029dfeea654206e 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. - ---- - dlls/wined3d/resource.c | 8 +++++ - dlls/wined3d/surface.c | 78 ++++++++++--------------------------------------- - 2 files changed, 23 insertions(+), 63 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 01bde00..41b222f 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -535,6 +535,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, - case WINED3D_LOCATION_SYSMEM: - return resource->heap_memory; - -+ case WINED3D_LOCATION_DIB: -+ return resource->bitmap_data; -+ -+ case WINED3D_LOCATION_USER_MEMORY: -+ return resource->user_memory; -+ - default: - ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); - return NULL; -@@ -557,6 +563,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, - return; - - case WINED3D_LOCATION_SYSMEM: -+ case WINED3D_LOCATION_DIB: -+ case WINED3D_LOCATION_USER_MEMORY: - return; - - default: -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index e85a68b..ee49f29 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -716,36 +716,10 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) - - static void surface_unmap(struct wined3d_surface *surface) - { -- struct wined3d_device *device = surface->resource.device; -- const struct wined3d_gl_info *gl_info; -- struct wined3d_context *context; -- - TRACE("surface %p.\n", surface); - - memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); - -- switch (surface->resource.map_binding) -- { -- case WINED3D_LOCATION_SYSMEM: -- case WINED3D_LOCATION_USER_MEMORY: -- case WINED3D_LOCATION_DIB: -- break; -- -- case WINED3D_LOCATION_BUFFER: -- context = context_acquire(device, NULL); -- gl_info = context->gl_info; -- -- 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; -- -- default: -- ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding)); -- } -- - if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)) - { - TRACE("Not dirtified, nothing to do.\n"); -@@ -2661,6 +2635,8 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso - - HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) - { -+ struct wined3d_device *device = surface->resource.device; -+ struct wined3d_context *context = NULL; - TRACE("surface %p.\n", surface); - - if (!surface->resource.map_count) -@@ -2670,6 +2646,12 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) - } - --surface->resource.map_count; - -+ if (device->d3d_initialized) -+ context = context_acquire(device, NULL); -+ wined3d_resource_release_map_ptr(&surface->resource, context); -+ if (context) -+ context_release(context); -+ - surface->surface_ops->surface_unmap(surface); - - return WINED3D_OK; -@@ -2681,8 +2663,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - const struct wined3d_format *format = surface->resource.format; - unsigned int fmt_flags = surface->container->resource.format_flags; - struct wined3d_device *device = surface->resource.device; -- struct wined3d_context *context; -- const struct wined3d_gl_info *gl_info; -+ struct wined3d_context *context = NULL; - BYTE *base_memory; - - TRACE("surface %p, map_desc %p, rect %s, flags %#x.\n", -@@ -2724,6 +2705,9 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - } - } - -+ if (device->d3d_initialized) -+ context = context_acquire(device, NULL); -+ - surface_prepare_map_memory(surface); - if (flags & WINED3D_MAP_DISCARD) - { -@@ -2733,51 +2717,19 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - } - else - { -- struct wined3d_context *context = NULL; -- - if (surface->resource.usage & WINED3DUSAGE_DYNAMIC) - WARN_(d3d_perf)("Mapping a dynamic surface without WINED3D_MAP_DISCARD.\n"); - -- if (surface->resource.device->d3d_initialized) -- context = context_acquire(surface->resource.device, NULL); - wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); -- if (context) -- context_release(context); - } - - if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) - wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); - -- switch (surface->resource.map_binding) -- { -- case WINED3D_LOCATION_SYSMEM: -- base_memory = surface->resource.heap_memory; -- break; -- -- case WINED3D_LOCATION_USER_MEMORY: -- base_memory = surface->resource.user_memory; -- break; -- -- case WINED3D_LOCATION_DIB: -- base_memory = surface->resource.bitmap_data; -- break; -- -- case WINED3D_LOCATION_BUFFER: -- context = context_acquire(device, NULL); -- gl_info = context->gl_info; -+ base_memory = wined3d_resource_get_map_ptr(&surface->resource, context, flags); - -- 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); -- break; -- -- default: -- ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding)); -- base_memory = NULL; -- } -+ if (context) -+ context_release(context); - - if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) - map_desc->row_pitch = surface->resource.width * format->byte_count; --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,255 +0,0 @@ -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. - -More code from volume_unload can be moved to resource_unload eventually. -Before doing that, surfaces and buffers have to be migrated to the new -location scheme. Otherwise the unimplemented buffer_load_location and -surface_load_location will write a lot of ERRs. ---- - dlls/wined3d/resource.c | 66 ++++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/texture.c | 2 +- - dlls/wined3d/volume.c | 63 ++-------------------------------------- - dlls/wined3d/wined3d_private.h | 4 ++- - 4 files changed, 72 insertions(+), 63 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -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 * - return WINED3D_OK; - } - -+static void wined3d_resource_free_bo(struct wined3d_resource *resource) -+{ -+ struct wined3d_context *context = context_acquire(resource->device, NULL); -+ 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(glDeleteBuffers(1, &resource->buffer_object)); -+ checkGLcall("glDeleteBuffers"); -+ resource->buffer_object = 0; -+ context_release(context); -+} -+ - void resource_cleanup(struct wined3d_resource *resource) - { - const struct wined3d *d3d = resource->device->wined3d; -@@ -154,6 +166,9 @@ void resource_cleanup(struct wined3d_resource *resource) - adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); - } - -+ if (resource->buffer_object) -+ wined3d_resource_free_bo(resource); -+ - wined3d_resource_free_sysmem(resource); - - device_resource_released(resource->device, resource); -@@ -164,6 +179,9 @@ void resource_unload(struct wined3d_resource *resource) - if (resource->map_count) - ERR("Resource %p is being unloaded while mapped.\n", resource); - -+ if (resource->buffer_object) -+ wined3d_resource_free_bo(resource); -+ - context_resource_unloaded(resource->device, - resource, resource->type); - } -@@ -498,3 +516,51 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, - return; - } - } -+ -+/* Context activation is done by the caller. */ -+static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, const struct wined3d_context *context) -+{ -+ const struct wined3d_gl_info *gl_info = context->gl_info; -+ -+ if (resource->buffer_object) -+ return; -+ -+ 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); -+} -+ -+BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) -+{ -+ if (resource->heap_memory) -+ return TRUE; -+ -+ if (!wined3d_resource_allocate_sysmem(resource)) -+ { -+ ERR("Failed to allocate system memory.\n"); -+ return FALSE; -+ } -+ return TRUE; -+} -+ -+/* Context activation is done by the caller. */ -+BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, struct wined3d_context *context) -+{ -+ switch (resource->map_binding) -+ { -+ case WINED3D_LOCATION_BUFFER: -+ wined3d_resource_prepare_bo(resource, context); -+ return TRUE; -+ -+ case WINED3D_LOCATION_SYSMEM: -+ return wined3d_resource_prepare_system_memory(resource); -+ -+ default: -+ ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); -+ return FALSE; -+ } -+} -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 066219d..9981703 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -1374,7 +1374,7 @@ static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wi - void *mem = NULL; - - if (gl_info->supported[APPLE_CLIENT_STORAGE] && !format->convert -- && volume_prepare_system_memory(volume)) -+ && wined3d_resource_prepare_system_memory(&volume->resource)) - { - TRACE("Enabling GL_UNPACK_CLIENT_STORAGE_APPLE for volume %p\n", volume); - gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 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 * - srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); - } - --/* Context activation is done by the caller. */ --static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct wined3d_context *context) --{ -- const struct wined3d_gl_info *gl_info = context->gl_info; -- -- if (volume->resource.buffer_object) -- return; -- -- 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); --} -- --static void wined3d_volume_free_pbo(struct wined3d_volume *volume) --{ -- struct wined3d_context *context = context_acquire(volume->resource.device, NULL); -- const struct wined3d_gl_info *gl_info = context->gl_info; -- -- TRACE("Deleting PBO %u belonging to volume %p.\n", volume->resource.buffer_object, volume); -- GL_EXTCALL(glDeleteBuffers(1, &volume->resource.buffer_object)); -- checkGLcall("glDeleteBuffers"); -- volume->resource.buffer_object = 0; -- context_release(context); --} -- - void wined3d_volume_destroy(struct wined3d_volume *volume) - { - TRACE("volume %p.\n", volume); - -- if (volume->resource.buffer_object) -- wined3d_volume_free_pbo(volume); -- - resource_cleanup(&volume->resource); - volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); - HeapFree(GetProcessHeap(), 0, volume); -@@ -364,7 +332,7 @@ static void volume_unload(struct wined3d_resource *resource) - - TRACE("texture %p.\n", resource); - -- if (volume_prepare_system_memory(volume)) -+ if (wined3d_resource_prepare_system_memory(&volume->resource)) - { - context = context_acquire(device, NULL); - wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM); -@@ -378,15 +346,6 @@ static void volume_unload(struct wined3d_resource *resource) - wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); - } - -- if (volume->resource.buffer_object) -- { -- /* Should not happen because only dynamic default pool volumes -- * have a buffer, and those are not evicted by device_evit_managed_resources -- * and must be freed before a non-ex device reset. */ -- ERR("Unloading a volume with a buffer\n"); -- wined3d_volume_free_pbo(volume); -- } -- - /* The texture name is managed by the container. */ - volume->flags &= ~WINED3D_VFLAG_CLIENT_STORAGE; - -@@ -476,24 +435,6 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol - return TRUE; - } - --/* Context activation is done by the caller. */ --static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, struct wined3d_context *context) --{ -- switch (volume->resource.map_binding) -- { -- case WINED3D_LOCATION_BUFFER: -- wined3d_volume_prepare_pbo(volume, context); -- return TRUE; -- -- case WINED3D_LOCATION_SYSMEM: -- return volume_prepare_system_memory(volume); -- -- default: -- ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding)); -- return FALSE; -- } --} -- - HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) - { -@@ -531,7 +472,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags); - - context = context_acquire(device, NULL); -- if (!wined3d_volume_prepare_map_memory(volume, context)) -+ if (!wined3d_resource_prepare_map_memory(&volume->resource, context)) - { - WARN("Out of memory.\n"); - map_desc->data = NULL; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7efecd4..4605542 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2132,6 +2132,9 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO - BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_load_location(struct wined3d_resource *resource, - struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; -+BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, -+ struct wined3d_context *context) DECLSPEC_HIDDEN; -+BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, - const struct wined3d_context *context) DECLSPEC_HIDDEN; - DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; -@@ -2273,7 +2276,6 @@ static inline struct wined3d_volume *volume_from_resource(struct wined3d_resourc - return CONTAINING_RECORD(resource, struct wined3d_volume, resource); - } - --BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN; - HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, - unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; - void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0023-wined3d-Remove-surface-pbo.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0023-wined3d-Remove-surface-pbo.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0023-wined3d-Remove-surface-pbo.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0023-wined3d-Remove-surface-pbo.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,160 @@ +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. + +--- + dlls/wined3d/surface.c | 42 +++++++++++++++++++++--------------------- + dlls/wined3d/wined3d_private.h | 2 -- + 2 files changed, 21 insertions(+), 23 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +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) + + TRACE("surface %p.\n", surface); + +- if (surface->pbo || surface->rb_multisample ++ if (surface->resource.buffer_object || surface->rb_multisample + || surface->rb_resolved || !list_empty(&surface->renderbuffers)) + { + struct wined3d_renderbuffer_entry *entry, *entry2; +@@ -56,10 +56,10 @@ static void surface_cleanup(struct wined3d_surface *surface) + context = context_acquire(surface->resource.device, NULL); + gl_info = context->gl_info; + +- if (surface->pbo) ++ if (surface->resource.buffer_object) + { +- TRACE("Deleting PBO %u.\n", surface->pbo); +- GL_EXTCALL(glDeleteBuffers(1, &surface->pbo)); ++ TRACE("Deleting PBO %u.\n", surface->resource.buffer_object); ++ GL_EXTCALL(glDeleteBuffers(1, &surface->resource.buffer_object)); + } + + if (surface->rb_multisample) +@@ -485,7 +485,7 @@ static void surface_get_memory(const struct wined3d_surface *surface, struct win + if (location & WINED3D_LOCATION_BUFFER) + { + data->addr = NULL; +- data->buffer_object = surface->pbo; ++ data->buffer_object = surface->resource.buffer_object; + return; + } + if (location & WINED3D_LOCATION_USER_MEMORY) +@@ -518,20 +518,20 @@ static void surface_prepare_buffer(struct wined3d_surface *surface) + GLenum error; + const struct wined3d_gl_info *gl_info; + +- if (surface->pbo) ++ if (surface->resource.buffer_object) + return; + + context = context_acquire(surface->resource.device, NULL); + gl_info = context->gl_info; + +- 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) + ERR("Failed to create a PBO with error %s (%#x).\n", debug_glerror(error), error); + +- TRACE("Binding PBO %u.\n", surface->pbo); ++ TRACE("Binding PBO %u.\n", surface->resource.buffer_object); + +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->pbo)); ++ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->resource.buffer_object)); + checkGLcall("glBindBuffer"); + + 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(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(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; + wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_BUFFER); + } + +@@ -1241,7 +1241,7 @@ static void surface_unload(struct wined3d_resource *resource) + } + + /* Destroy PBOs, but load them into real sysmem before */ +- if (surface->pbo) ++ if (surface->resource.buffer_object) + surface_remove_pbo(surface, gl_info); + + /* Destroy fbo render buffers. This is needed for implicit render targets, for +@@ -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(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"); +@@ -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 +- || surface->pbo)) ++ || surface->resource.buffer_object)) + surface->resource.map_binding = WINED3D_LOCATION_DIB; + } + +@@ -3209,9 +3209,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) + + /* Flip the PBO */ + { +- GLuint tmp_pbo = front->pbo; +- front->pbo = back->pbo; +- back->pbo = tmp_pbo; ++ GLuint tmp_pbo = front->resource.buffer_object; ++ front->resource.buffer_object = back->resource.buffer_object; ++ back->resource.buffer_object = tmp_pbo; + } + + /* Flip the opengl texture */ +@@ -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. */ +- if ((format.convert || conversion) && surface->pbo) ++ if ((format.convert || conversion) && surface->resource.buffer_object) + { + 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 8cce2d9..7efecd4 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2324,8 +2324,6 @@ struct wined3d_surface + UINT pow2Width; + UINT pow2Height; + +- /* PBO */ +- GLuint pbo; + GLuint rb_multisample; + GLuint rb_resolved; + GLenum texture_target; +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0024-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0024-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0024-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0024-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -From 34c2831af2c72f793ddb94da134f21f9cd613b5a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 19 Sep 2013 12:06:00 +0200 -Subject: wined3d: Handle WINED3D_LOCATION_DISCARDED in surface_load_texture. - -TODO: Move texture allocation to the caller, this way discarded locations can be handled in the resource. ---- - dlls/wined3d/surface.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 4be6a50..09bd72b 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -4091,6 +4091,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - POINT dst_point = {0, 0}; - BYTE *mem = NULL; - -+ if (surface->resource.locations & WINED3D_LOCATION_DISCARDED) -+ { -+ TRACE("Surface was discarded, nothing to do.\n"); -+ wined3d_texture_prepare_texture(texture, context, srgb); -+ return WINED3D_OK; -+ } -+ - if (wined3d_settings.offscreen_rendering_mode != ORM_FBO - && wined3d_resource_is_offscreen(&texture->resource) - && (surface->resource.locations & WINED3D_LOCATION_DRAWABLE)) --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0024-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0024-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0024-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0024-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,177 @@ +From 68ee5f83114581754be6462ea029dfeea654206e 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. + +--- + dlls/wined3d/resource.c | 8 +++++ + dlls/wined3d/surface.c | 78 ++++++++++--------------------------------------- + 2 files changed, 23 insertions(+), 63 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 01bde00..41b222f 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -535,6 +535,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, + case WINED3D_LOCATION_SYSMEM: + return resource->heap_memory; + ++ case WINED3D_LOCATION_DIB: ++ return resource->bitmap_data; ++ ++ case WINED3D_LOCATION_USER_MEMORY: ++ return resource->user_memory; ++ + default: + ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); + return NULL; +@@ -557,6 +563,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, + return; + + case WINED3D_LOCATION_SYSMEM: ++ case WINED3D_LOCATION_DIB: ++ case WINED3D_LOCATION_USER_MEMORY: + return; + + default: +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index e85a68b..ee49f29 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -716,36 +716,10 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) + + static void surface_unmap(struct wined3d_surface *surface) + { +- struct wined3d_device *device = surface->resource.device; +- const struct wined3d_gl_info *gl_info; +- struct wined3d_context *context; +- + TRACE("surface %p.\n", surface); + + memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); + +- switch (surface->resource.map_binding) +- { +- case WINED3D_LOCATION_SYSMEM: +- case WINED3D_LOCATION_USER_MEMORY: +- case WINED3D_LOCATION_DIB: +- break; +- +- case WINED3D_LOCATION_BUFFER: +- context = context_acquire(device, NULL); +- gl_info = context->gl_info; +- +- 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; +- +- default: +- ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding)); +- } +- + if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)) + { + TRACE("Not dirtified, nothing to do.\n"); +@@ -2661,6 +2635,8 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso + + HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + { ++ struct wined3d_device *device = surface->resource.device; ++ struct wined3d_context *context = NULL; + TRACE("surface %p.\n", surface); + + if (!surface->resource.map_count) +@@ -2670,6 +2646,12 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + } + --surface->resource.map_count; + ++ if (device->d3d_initialized) ++ context = context_acquire(device, NULL); ++ wined3d_resource_release_map_ptr(&surface->resource, context); ++ if (context) ++ context_release(context); ++ + surface->surface_ops->surface_unmap(surface); + + return WINED3D_OK; +@@ -2681,8 +2663,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + const struct wined3d_format *format = surface->resource.format; + unsigned int fmt_flags = surface->container->resource.format_flags; + struct wined3d_device *device = surface->resource.device; +- struct wined3d_context *context; +- const struct wined3d_gl_info *gl_info; ++ struct wined3d_context *context = NULL; + BYTE *base_memory; + + TRACE("surface %p, map_desc %p, rect %s, flags %#x.\n", +@@ -2724,6 +2705,9 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + } + } + ++ if (device->d3d_initialized) ++ context = context_acquire(device, NULL); ++ + surface_prepare_map_memory(surface); + if (flags & WINED3D_MAP_DISCARD) + { +@@ -2733,51 +2717,19 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + } + else + { +- struct wined3d_context *context = NULL; +- + if (surface->resource.usage & WINED3DUSAGE_DYNAMIC) + WARN_(d3d_perf)("Mapping a dynamic surface without WINED3D_MAP_DISCARD.\n"); + +- if (surface->resource.device->d3d_initialized) +- context = context_acquire(surface->resource.device, NULL); + wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); +- if (context) +- context_release(context); + } + + if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) + wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); + +- switch (surface->resource.map_binding) +- { +- case WINED3D_LOCATION_SYSMEM: +- base_memory = surface->resource.heap_memory; +- break; +- +- case WINED3D_LOCATION_USER_MEMORY: +- base_memory = surface->resource.user_memory; +- break; +- +- case WINED3D_LOCATION_DIB: +- base_memory = surface->resource.bitmap_data; +- break; +- +- case WINED3D_LOCATION_BUFFER: +- context = context_acquire(device, NULL); +- gl_info = context->gl_info; ++ base_memory = wined3d_resource_get_map_ptr(&surface->resource, context, flags); + +- 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); +- break; +- +- default: +- ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding)); +- base_memory = NULL; +- } ++ if (context) ++ context_release(context); + + if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + map_desc->row_pitch = surface->resource.width * format->byte_count; +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0025-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0025-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0025-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0025-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From 8f62fa5a9451ff5575e115758fcff80c7383aebe Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 19 Sep 2013 12:11:32 +0200 -Subject: wined3d: Handle LOCATION_DISCARDED in surface_load_drawable. - ---- - dlls/wined3d/surface.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 09bd72b..4a7e982 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -4062,6 +4062,12 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, - { - RECT r; - -+ if (surface->resource.locations & WINED3D_LOCATION_DISCARDED) -+ { -+ TRACE("Surface was discarded, nothing to do.\n"); -+ return WINED3D_OK; -+ } -+ - if (wined3d_settings.offscreen_rendering_mode == ORM_FBO - && wined3d_resource_is_offscreen(&surface->container->resource)) - { --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0025-wined3d-Move-buffer-creation-into-the-resource.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0025-wined3d-Move-buffer-creation-into-the-resource.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0025-wined3d-Move-buffer-creation-into-the-resource.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0025-wined3d-Move-buffer-creation-into-the-resource.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,255 @@ +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. + +More code from volume_unload can be moved to resource_unload eventually. +Before doing that, surfaces and buffers have to be migrated to the new +location scheme. Otherwise the unimplemented buffer_load_location and +surface_load_location will write a lot of ERRs. +--- + dlls/wined3d/resource.c | 66 ++++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/texture.c | 2 +- + dlls/wined3d/volume.c | 63 ++-------------------------------------- + dlls/wined3d/wined3d_private.h | 4 ++- + 4 files changed, 72 insertions(+), 63 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +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 * + return WINED3D_OK; + } + ++static void wined3d_resource_free_bo(struct wined3d_resource *resource) ++{ ++ struct wined3d_context *context = context_acquire(resource->device, NULL); ++ 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(glDeleteBuffers(1, &resource->buffer_object)); ++ checkGLcall("glDeleteBuffers"); ++ resource->buffer_object = 0; ++ context_release(context); ++} ++ + void resource_cleanup(struct wined3d_resource *resource) + { + const struct wined3d *d3d = resource->device->wined3d; +@@ -154,6 +166,9 @@ void resource_cleanup(struct wined3d_resource *resource) + adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); + } + ++ if (resource->buffer_object) ++ wined3d_resource_free_bo(resource); ++ + wined3d_resource_free_sysmem(resource); + + device_resource_released(resource->device, resource); +@@ -164,6 +179,9 @@ void resource_unload(struct wined3d_resource *resource) + if (resource->map_count) + ERR("Resource %p is being unloaded while mapped.\n", resource); + ++ if (resource->buffer_object) ++ wined3d_resource_free_bo(resource); ++ + context_resource_unloaded(resource->device, + resource, resource->type); + } +@@ -498,3 +516,51 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, + return; + } + } ++ ++/* Context activation is done by the caller. */ ++static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, const struct wined3d_context *context) ++{ ++ const struct wined3d_gl_info *gl_info = context->gl_info; ++ ++ if (resource->buffer_object) ++ return; ++ ++ 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); ++} ++ ++BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) ++{ ++ if (resource->heap_memory) ++ return TRUE; ++ ++ if (!wined3d_resource_allocate_sysmem(resource)) ++ { ++ ERR("Failed to allocate system memory.\n"); ++ return FALSE; ++ } ++ return TRUE; ++} ++ ++/* Context activation is done by the caller. */ ++BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, struct wined3d_context *context) ++{ ++ switch (resource->map_binding) ++ { ++ case WINED3D_LOCATION_BUFFER: ++ wined3d_resource_prepare_bo(resource, context); ++ return TRUE; ++ ++ case WINED3D_LOCATION_SYSMEM: ++ return wined3d_resource_prepare_system_memory(resource); ++ ++ default: ++ ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); ++ return FALSE; ++ } ++} +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 066219d..9981703 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -1374,7 +1374,7 @@ static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wi + void *mem = NULL; + + if (gl_info->supported[APPLE_CLIENT_STORAGE] && !format->convert +- && volume_prepare_system_memory(volume)) ++ && wined3d_resource_prepare_system_memory(&volume->resource)) + { + TRACE("Enabling GL_UNPACK_CLIENT_STORAGE_APPLE for volume %p\n", volume); + gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 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 * + srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); + } + +-/* Context activation is done by the caller. */ +-static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct wined3d_context *context) +-{ +- const struct wined3d_gl_info *gl_info = context->gl_info; +- +- if (volume->resource.buffer_object) +- return; +- +- 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); +-} +- +-static void wined3d_volume_free_pbo(struct wined3d_volume *volume) +-{ +- struct wined3d_context *context = context_acquire(volume->resource.device, NULL); +- const struct wined3d_gl_info *gl_info = context->gl_info; +- +- TRACE("Deleting PBO %u belonging to volume %p.\n", volume->resource.buffer_object, volume); +- GL_EXTCALL(glDeleteBuffers(1, &volume->resource.buffer_object)); +- checkGLcall("glDeleteBuffers"); +- volume->resource.buffer_object = 0; +- context_release(context); +-} +- + void wined3d_volume_destroy(struct wined3d_volume *volume) + { + TRACE("volume %p.\n", volume); + +- if (volume->resource.buffer_object) +- wined3d_volume_free_pbo(volume); +- + resource_cleanup(&volume->resource); + volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); + HeapFree(GetProcessHeap(), 0, volume); +@@ -364,7 +332,7 @@ static void volume_unload(struct wined3d_resource *resource) + + TRACE("texture %p.\n", resource); + +- if (volume_prepare_system_memory(volume)) ++ if (wined3d_resource_prepare_system_memory(&volume->resource)) + { + context = context_acquire(device, NULL); + wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM); +@@ -378,15 +346,6 @@ static void volume_unload(struct wined3d_resource *resource) + wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); + } + +- if (volume->resource.buffer_object) +- { +- /* Should not happen because only dynamic default pool volumes +- * have a buffer, and those are not evicted by device_evit_managed_resources +- * and must be freed before a non-ex device reset. */ +- ERR("Unloading a volume with a buffer\n"); +- wined3d_volume_free_pbo(volume); +- } +- + /* The texture name is managed by the container. */ + volume->flags &= ~WINED3D_VFLAG_CLIENT_STORAGE; + +@@ -476,24 +435,6 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol + return TRUE; + } + +-/* Context activation is done by the caller. */ +-static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, struct wined3d_context *context) +-{ +- switch (volume->resource.map_binding) +- { +- case WINED3D_LOCATION_BUFFER: +- wined3d_volume_prepare_pbo(volume, context); +- return TRUE; +- +- case WINED3D_LOCATION_SYSMEM: +- return volume_prepare_system_memory(volume); +- +- default: +- ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding)); +- return FALSE; +- } +-} +- + HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) + { +@@ -531,7 +472,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags); + + context = context_acquire(device, NULL); +- if (!wined3d_volume_prepare_map_memory(volume, context)) ++ if (!wined3d_resource_prepare_map_memory(&volume->resource, context)) + { + WARN("Out of memory.\n"); + map_desc->data = NULL; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 7efecd4..4605542 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2132,6 +2132,9 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO + BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_load_location(struct wined3d_resource *resource, + struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; ++BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, ++ struct wined3d_context *context) DECLSPEC_HIDDEN; ++BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, + const struct wined3d_context *context) DECLSPEC_HIDDEN; + DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; +@@ -2273,7 +2276,6 @@ static inline struct wined3d_volume *volume_from_resource(struct wined3d_resourc + return CONTAINING_RECORD(resource, struct wined3d_volume, resource); + } + +-BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN; + HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, + unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; + void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -From 73bc99a081af878150b2093f211239d44aab5444 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 19 Sep 2013 12:13:31 +0200 -Subject: wined3d: Handle WINED3D_LOCATION_DISCARDED for sysmem loads. - ---- - dlls/wined3d/resource.c | 12 ++++++++++++ - dlls/wined3d/volume.c | 14 ++------------ - 2 files changed, 14 insertions(+), 12 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index d5ec71f..051297c 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -397,6 +397,8 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, - struct wined3d_context *context, DWORD location) - { - DWORD required_access = wined3d_resource_access_from_location(location); -+ DWORD simple_locations = WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_USER_MEMORY -+ | WINED3D_LOCATION_DIB | WINED3D_LOCATION_BUFFER; - - if ((resource->locations & location) == location) - { -@@ -409,6 +411,16 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, - WARN("Operation requires %#x access, but resource only has %#x.\n", - required_access, resource->access_flags); - -+ if (location & simple_locations) -+ { -+ if (resource->locations & WINED3D_LOCATION_DISCARDED) -+ { -+ TRACE("Resource was discarded, nothing to do.\n"); -+ resource->locations |= location; -+ return; -+ } -+ } -+ - /* Context is NULL in ddraw-only operation without OpenGL. */ - if (!context) - ERR("A context is required for non-sysmem operation.\n"); -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index a40d9f0..9ad7d75 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -229,12 +229,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, - if (!volume->resource.heap_memory) - ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n"); - -- if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) -- { -- TRACE("Volume previously discarded, nothing to do.\n"); -- wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); -- } -- else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -+ if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - { - struct wined3d_bo_address data = {0, volume->resource.heap_memory}; - -@@ -259,12 +254,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, - if (!volume->resource.buffer_object) - ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); - -- if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) -- { -- TRACE("Volume previously discarded, nothing to do.\n"); -- wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); -- } -- else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -+ if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - { - struct wined3d_bo_address data = {volume->resource.buffer_object, NULL}; - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,31 @@ +From 34c2831af2c72f793ddb94da134f21f9cd613b5a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 19 Sep 2013 12:06:00 +0200 +Subject: wined3d: Handle WINED3D_LOCATION_DISCARDED in surface_load_texture. + +TODO: Move texture allocation to the caller, this way discarded locations can be handled in the resource. +--- + dlls/wined3d/surface.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 4be6a50..09bd72b 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -4091,6 +4091,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + POINT dst_point = {0, 0}; + BYTE *mem = NULL; + ++ if (surface->resource.locations & WINED3D_LOCATION_DISCARDED) ++ { ++ TRACE("Surface was discarded, nothing to do.\n"); ++ wined3d_texture_prepare_texture(texture, context, srgb); ++ return WINED3D_OK; ++ } ++ + if (wined3d_settings.offscreen_rendering_mode != ORM_FBO + && wined3d_resource_is_offscreen(&texture->resource) + && (surface->resource.locations & WINED3D_LOCATION_DRAWABLE)) +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0027-wined3d-Discard-implicit-surfaces-on-unload.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0027-wined3d-Discard-implicit-surfaces-on-unload.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0027-wined3d-Discard-implicit-surfaces-on-unload.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0027-wined3d-Discard-implicit-surfaces-on-unload.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -From 50e46931f38887d0164033482e502f90ef806ffd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 4 Jan 2014 13:20:25 +0100 -Subject: wined3d: Discard implicit surfaces on unload. - ---- - dlls/wined3d/surface.c | 13 +++---------- - 1 file changed, 3 insertions(+), 10 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 4a7e982..29f4563 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -1190,16 +1190,9 @@ static void surface_unload(struct wined3d_resource *resource) - /* Default pool resources are supposed to be destroyed before Reset is called. - * Implicit resources stay however. So this means we have an implicit render target - * or depth stencil. The content may be destroyed, but we still have to tear down -- * opengl resources, so we cannot leave early. -- * -- * Put the surfaces into sysmem, and reset the content. The D3D content is undefined, -- * but we can't set the sysmem INDRAWABLE because when we're rendering the swapchain -- * or the depth stencil into an FBO the texture or render buffer will be removed -- * and all flags get lost */ -- surface_prepare_system_memory(surface); -- memset(surface->resource.heap_memory, 0, surface->resource.size); -- wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); -- wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_SYSMEM); -+ * opengl resources, so we cannot leave early. */ -+ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DISCARDED); -+ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DISCARDED); - - /* We also get here when the ddraw swapchain is destroyed, for example - * for a mode switch. In this case this surface won't necessarily be --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0027-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0027-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0027-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0027-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,29 @@ +From 8f62fa5a9451ff5575e115758fcff80c7383aebe Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 19 Sep 2013 12:11:32 +0200 +Subject: wined3d: Handle LOCATION_DISCARDED in surface_load_drawable. + +--- + dlls/wined3d/surface.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 09bd72b..4a7e982 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -4062,6 +4062,12 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, + { + RECT r; + ++ if (surface->resource.locations & WINED3D_LOCATION_DISCARDED) ++ { ++ TRACE("Surface was discarded, nothing to do.\n"); ++ return WINED3D_OK; ++ } ++ + if (wined3d_settings.offscreen_rendering_mode == ORM_FBO + && wined3d_resource_is_offscreen(&surface->container->resource)) + { +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0028-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0028-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0028-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0028-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -From 33832b5fb0f7d3c8a0f93d4e3f3d7e1d4de0e6df Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 19 Sep 2013 13:08:33 +0200 -Subject: wined3d: Don't try to flip sysmem copies in swapchain_present. - -This was once an optimization for ddraw applications that mapped the -backbuffer to render movies. It doesn't work any more in the intended -fashion. ---- - dlls/wined3d/swapchain.c | 46 +++++++++------------------------------------- - 1 file changed, 9 insertions(+), 37 deletions(-) - -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index e1a5b8a..05f68f7 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -555,44 +555,16 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - } - - front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); -- if (!swapchain->render_to_fbo && ((front->resource.locations & WINED3D_LOCATION_SYSMEM) -- || (back_buffer->resource.locations & WINED3D_LOCATION_SYSMEM))) -+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); -+ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE); -+ /* 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, -+ * the texture / sysmem copy needs to be reloaded from the drawable. */ -+ if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) - { -- /* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying -- * Doesn't work with render_to_fbo because we're not flipping -- */ -- -- if (front->resource.size == back_buffer->resource.size) -- { -- flip_surface(front, back_buffer); -- -- /* Tell the front buffer surface that is has been modified. However, -- * the other locations were preserved during that, so keep the flags. -- * This serves to update the emulated overlay, if any. */ -- wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); -- } -- else -- { -- wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); -- wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE); -- wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE); -- wined3d_resource_invalidate_location(&back_buffer->resource, ~WINED3D_LOCATION_DRAWABLE); -- } -- } -- else -- { -- wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); -- wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE); -- /* 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, -- * the texture / sysmem copy needs to be reloaded from the drawable -- */ -- if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) -- { -- wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding); -- wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding); -- } -+ wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding); -+ wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding); - } - - if (fb->depth_stencil) --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0028-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0028-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0028-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0028-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,75 @@ +From 73bc99a081af878150b2093f211239d44aab5444 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 19 Sep 2013 12:13:31 +0200 +Subject: wined3d: Handle WINED3D_LOCATION_DISCARDED for sysmem loads. + +--- + dlls/wined3d/resource.c | 12 ++++++++++++ + dlls/wined3d/volume.c | 14 ++------------ + 2 files changed, 14 insertions(+), 12 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index d5ec71f..051297c 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -397,6 +397,8 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, + struct wined3d_context *context, DWORD location) + { + DWORD required_access = wined3d_resource_access_from_location(location); ++ DWORD simple_locations = WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_USER_MEMORY ++ | WINED3D_LOCATION_DIB | WINED3D_LOCATION_BUFFER; + + if ((resource->locations & location) == location) + { +@@ -409,6 +411,16 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, + WARN("Operation requires %#x access, but resource only has %#x.\n", + required_access, resource->access_flags); + ++ if (location & simple_locations) ++ { ++ if (resource->locations & WINED3D_LOCATION_DISCARDED) ++ { ++ TRACE("Resource was discarded, nothing to do.\n"); ++ resource->locations |= location; ++ return; ++ } ++ } ++ + /* Context is NULL in ddraw-only operation without OpenGL. */ + if (!context) + ERR("A context is required for non-sysmem operation.\n"); +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index a40d9f0..9ad7d75 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -229,12 +229,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, + if (!volume->resource.heap_memory) + ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n"); + +- if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) +- { +- TRACE("Volume previously discarded, nothing to do.\n"); +- wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); +- } +- else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) ++ if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + { + struct wined3d_bo_address data = {0, volume->resource.heap_memory}; + +@@ -259,12 +254,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, + if (!volume->resource.buffer_object) + ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); + +- if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) +- { +- TRACE("Volume previously discarded, nothing to do.\n"); +- wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); +- } +- else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) ++ if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + { + struct wined3d_bo_address data = {volume->resource.buffer_object, NULL}; + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0029-wined3d-Discard-implicit-surfaces-on-unload.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0029-wined3d-Discard-implicit-surfaces-on-unload.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0029-wined3d-Discard-implicit-surfaces-on-unload.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0029-wined3d-Discard-implicit-surfaces-on-unload.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,36 @@ +From 50e46931f38887d0164033482e502f90ef806ffd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 4 Jan 2014 13:20:25 +0100 +Subject: wined3d: Discard implicit surfaces on unload. + +--- + dlls/wined3d/surface.c | 13 +++---------- + 1 file changed, 3 insertions(+), 10 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 4a7e982..29f4563 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -1190,16 +1190,9 @@ static void surface_unload(struct wined3d_resource *resource) + /* Default pool resources are supposed to be destroyed before Reset is called. + * Implicit resources stay however. So this means we have an implicit render target + * or depth stencil. The content may be destroyed, but we still have to tear down +- * opengl resources, so we cannot leave early. +- * +- * Put the surfaces into sysmem, and reset the content. The D3D content is undefined, +- * but we can't set the sysmem INDRAWABLE because when we're rendering the swapchain +- * or the depth stencil into an FBO the texture or render buffer will be removed +- * and all flags get lost */ +- surface_prepare_system_memory(surface); +- memset(surface->resource.heap_memory, 0, surface->resource.size); +- wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); +- wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_SYSMEM); ++ * opengl resources, so we cannot leave early. */ ++ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DISCARDED); ++ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DISCARDED); + + /* We also get here when the ddraw swapchain is destroyed, for example + * for a mode switch. In this case this surface won't necessarily be +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0029-wined3d-Discard-the-backbuffer-in-discard-presents.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0029-wined3d-Discard-the-backbuffer-in-discard-presents.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0029-wined3d-Discard-the-backbuffer-in-discard-presents.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0029-wined3d-Discard-the-backbuffer-in-discard-presents.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -From bcd6f4338c70693ca49ce0775bdd08a2527db255 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 19 Sep 2013 13:09:58 +0200 -Subject: wined3d: Discard the backbuffer in discard presents. - ---- - dlls/wined3d/swapchain.c | 19 ++++++++++++------- - 1 file changed, 12 insertions(+), 7 deletions(-) - -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 05f68f7..dd7d2c7 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -557,14 +557,19 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); - wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); - wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE); -- /* 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, -- * the texture / sysmem copy needs to be reloaded from the drawable. */ -- if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) -+ switch (swapchain->desc.swap_effect) - { -- wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding); -- wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding); -+ case WINED3D_SWAP_EFFECT_DISCARD: -+ wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DISCARDED); -+ break; -+ -+ case WINED3D_SWAP_EFFECT_FLIP: -+ wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding); -+ wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding); -+ break; -+ -+ default: -+ break; - } - - if (fb->depth_stencil) --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0030-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0030-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0030-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0030-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -From d0f1f1278a8225075bd03c9586112bf29318563c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 16 Sep 2013 22:22:39 +0200 -Subject: wined3d: Allocate sysmem for client storage if it doesn't exist - already. - ---- - dlls/wined3d/texture.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 41cf61d..8298e53 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -904,8 +904,7 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi - if (gl_info->supported[APPLE_CLIENT_STORAGE]) - { - if (surface->flags & (SFLAG_NONPOW2 | SFLAG_DIBSECTION) -- || texture->flags & WINED3D_TEXTURE_CONVERTED -- || !surface->resource.heap_memory) -+ || texture->flags & WINED3D_TEXTURE_CONVERTED) - { - /* In some cases we want to disable client storage. - * SFLAG_NONPOW2 has a bigger opengl texture than the client memory, and different pitches -@@ -917,6 +916,9 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi - } - else - { -+ if (!surface->resource.heap_memory) -+ wined3d_resource_allocate_sysmem(&surface->resource); -+ - surface->flags |= SFLAG_CLIENT; - mem = surface->resource.heap_memory; - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0030-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0030-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0030-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0030-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,73 @@ +From 33832b5fb0f7d3c8a0f93d4e3f3d7e1d4de0e6df Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 19 Sep 2013 13:08:33 +0200 +Subject: wined3d: Don't try to flip sysmem copies in swapchain_present. + +This was once an optimization for ddraw applications that mapped the +backbuffer to render movies. It doesn't work any more in the intended +fashion. +--- + dlls/wined3d/swapchain.c | 46 +++++++++------------------------------------- + 1 file changed, 9 insertions(+), 37 deletions(-) + +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index e1a5b8a..05f68f7 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -555,44 +555,16 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + } + + front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); +- if (!swapchain->render_to_fbo && ((front->resource.locations & WINED3D_LOCATION_SYSMEM) +- || (back_buffer->resource.locations & WINED3D_LOCATION_SYSMEM))) ++ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); ++ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE); ++ /* 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, ++ * the texture / sysmem copy needs to be reloaded from the drawable. */ ++ if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) + { +- /* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying +- * Doesn't work with render_to_fbo because we're not flipping +- */ +- +- if (front->resource.size == back_buffer->resource.size) +- { +- flip_surface(front, back_buffer); +- +- /* Tell the front buffer surface that is has been modified. However, +- * the other locations were preserved during that, so keep the flags. +- * This serves to update the emulated overlay, if any. */ +- wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); +- } +- else +- { +- wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); +- wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE); +- wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE); +- wined3d_resource_invalidate_location(&back_buffer->resource, ~WINED3D_LOCATION_DRAWABLE); +- } +- } +- else +- { +- wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); +- wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE); +- /* 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, +- * the texture / sysmem copy needs to be reloaded from the drawable +- */ +- if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) +- { +- wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding); +- wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding); +- } ++ wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding); ++ wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding); + } + + if (fb->depth_stencil) +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0031-wined3d-Discard-the-backbuffer-in-discard-presents.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0031-wined3d-Discard-the-backbuffer-in-discard-presents.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0031-wined3d-Discard-the-backbuffer-in-discard-presents.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0031-wined3d-Discard-the-backbuffer-in-discard-presents.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,43 @@ +From bcd6f4338c70693ca49ce0775bdd08a2527db255 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 19 Sep 2013 13:09:58 +0200 +Subject: wined3d: Discard the backbuffer in discard presents. + +--- + dlls/wined3d/swapchain.c | 19 ++++++++++++------- + 1 file changed, 12 insertions(+), 7 deletions(-) + +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index 05f68f7..dd7d2c7 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -557,14 +557,19 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); + wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); + wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE); +- /* 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, +- * the texture / sysmem copy needs to be reloaded from the drawable. */ +- if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) ++ switch (swapchain->desc.swap_effect) + { +- wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding); +- wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding); ++ case WINED3D_SWAP_EFFECT_DISCARD: ++ wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DISCARDED); ++ break; ++ ++ case WINED3D_SWAP_EFFECT_FLIP: ++ wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding); ++ wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding); ++ break; ++ ++ default: ++ break; + } + + if (fb->depth_stencil) +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -From 240ba2fd70e0e8ed91785aca4e4bce8044d9f129 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 16 Sep 2013 22:44:33 +0200 -Subject: wined3d: Introduce a function to retrieve resource memory. - ---- - dlls/wined3d/resource.c | 30 ++++++++++++++++++++++++++++ - dlls/wined3d/surface.c | 45 ++++++------------------------------------ - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 38 insertions(+), 39 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 3308c82..7c915bd 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -497,6 +497,36 @@ DWORD wined3d_resource_access_from_location(DWORD location) - } - } - -+void wined3d_resource_get_memory(const struct wined3d_resource *resource, -+ DWORD location, struct wined3d_bo_address *data) -+{ -+ if (location & WINED3D_LOCATION_BUFFER) -+ { -+ data->buffer_object = resource->buffer_object; -+ data->addr = NULL; -+ return; -+ } -+ if (location & WINED3D_LOCATION_USER_MEMORY) -+ { -+ data->buffer_object = 0; -+ data->addr = resource->user_memory; -+ return; -+ } -+ if (location & WINED3D_LOCATION_DIB) -+ { -+ data->buffer_object = 0; -+ data->addr = resource->bitmap_data; -+ return; -+ } -+ if (location & WINED3D_LOCATION_SYSMEM) -+ { -+ data->buffer_object = 0; -+ data->addr = resource->heap_memory; -+ return; -+ } -+ ERR("Unexpected location %s.\n", wined3d_debug_location(location)); -+} -+ - /* Context activation is optionally by the caller. Context may be NULL. */ - void wined3d_resource_load_location(struct wined3d_resource *resource, - struct wined3d_context *context, DWORD location) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 7e2e6c4..3e9a8ef 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -479,39 +479,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) - return WINED3D_OK; - } - --static void surface_get_memory(const struct wined3d_surface *surface, struct wined3d_bo_address *data, -- DWORD location) --{ -- if (location & WINED3D_LOCATION_BUFFER) -- { -- data->addr = NULL; -- data->buffer_object = surface->resource.buffer_object; -- return; -- } -- if (location & WINED3D_LOCATION_USER_MEMORY) -- { -- data->addr = surface->resource.user_memory; -- data->buffer_object = 0; -- return; -- } -- if (location & WINED3D_LOCATION_DIB) -- { -- data->addr = surface->resource.bitmap_data; -- data->buffer_object = 0; -- return; -- } -- if (location & WINED3D_LOCATION_SYSMEM) -- { -- data->addr = surface->resource.heap_memory; -- data->buffer_object = 0; -- return; -- } -- -- ERR("Unexpected locations %s.\n", wined3d_debug_location(location)); -- data->addr = NULL; -- data->buffer_object = 0; --} -- - static void surface_prepare_buffer(struct wined3d_surface *surface) - { - struct wined3d_context *context; -@@ -1274,7 +1241,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct - return; - } - -- surface_get_memory(surface, &data, dst_location); -+ wined3d_resource_get_memory(&surface->resource, dst_location, &data); - - if (surface->container->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) - { -@@ -1643,7 +1610,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P - wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); - wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); - -- surface_get_memory(src_surface, &data, src_surface->resource.locations); -+ wined3d_resource_get_memory(&src_surface->resource, src_surface->resource.locations, &data); - wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); - - wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -@@ -2878,7 +2845,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, - struct wined3d_bo_address data; - UINT row_pitch, slice_pitch; - -- surface_get_memory(surface, &data, dst_location); -+ wined3d_resource_get_memory(&surface->resource, dst_location, &data); - - /* Context_release does not restore the original context in case of - * nested context_acquire calls. Only read_from_framebuffer and -@@ -4017,8 +3984,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD - struct wined3d_bo_address dst, src; - UINT size = surface->resource.size; - -- surface_get_memory(surface, &dst, location); -- surface_get_memory(surface, &src, surface->resource.locations); -+ wined3d_resource_get_memory(&surface->resource, location, &dst); -+ wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &src); - - if (dst.buffer_object) - { -@@ -4230,7 +4197,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - surface_remove_pbo(surface, gl_info); - } - -- surface_get_memory(surface, &data, surface->resource.locations); -+ wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); - if (format.convert) - { - /* This code is entered for texture formats which need a fixup. */ -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index f3e8f2a..f8733ad 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2172,6 +2172,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE - void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, - const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; -+void wined3d_resource_get_memory(const struct wined3d_resource *resource, -+ DWORD location, struct wined3d_bo_address *data) DECLSPEC_HIDDEN; - GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; - void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; - BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0032-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0032-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0032-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0032-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,37 @@ +From d0f1f1278a8225075bd03c9586112bf29318563c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Mon, 16 Sep 2013 22:22:39 +0200 +Subject: wined3d: Allocate sysmem for client storage if it doesn't exist + already. + +--- + dlls/wined3d/texture.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 41cf61d..8298e53 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -904,8 +904,7 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi + if (gl_info->supported[APPLE_CLIENT_STORAGE]) + { + if (surface->flags & (SFLAG_NONPOW2 | SFLAG_DIBSECTION) +- || texture->flags & WINED3D_TEXTURE_CONVERTED +- || !surface->resource.heap_memory) ++ || texture->flags & WINED3D_TEXTURE_CONVERTED) + { + /* In some cases we want to disable client storage. + * SFLAG_NONPOW2 has a bigger opengl texture than the client memory, and different pitches +@@ -917,6 +916,9 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi + } + else + { ++ if (!surface->resource.heap_memory) ++ wined3d_resource_allocate_sysmem(&surface->resource); ++ + surface->flags |= SFLAG_CLIENT; + mem = surface->resource.heap_memory; + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0032-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0032-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0032-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0032-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -From 10058dd5be622aefa90a05d8e793573da1140bf7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 19 Sep 2013 13:36:00 +0200 -Subject: wined3d: Make surface_ops->unmap specific for front buffers. - ---- - dlls/wined3d/surface.c | 45 +++++++++++++++--------------------------- - dlls/wined3d/wined3d_private.h | 2 +- - 2 files changed, 17 insertions(+), 30 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 3e9a8ef..175f05e 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -681,31 +681,22 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) - return WINED3D_OK; - } - --static void surface_unmap(struct wined3d_surface *surface) -+static void surface_frontbuffer_updated(struct wined3d_surface *surface) - { -- TRACE("surface %p.\n", surface); -- -- memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); -+ struct wined3d_context *context = NULL; -+ struct wined3d_device *device = surface->resource.device; - -- if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)) -+ if (surface->resource.locations & WINED3D_LOCATION_DRAWABLE) - { - TRACE("Not dirtified, nothing to do.\n"); - return; - } - -- if (surface->container->swapchain && surface->container->swapchain->front_buffer == surface->container) -- { -- struct wined3d_device *device = surface->resource.device; -- struct wined3d_context *context = NULL; -- -- if (device->d3d_initialized) -- context = context_acquire(device, surface); -- wined3d_resource_load_location(&surface->resource, context, surface->container->resource.draw_binding); -- if (context) -- context_release(context); -- } -- else if (surface->container->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) -- FIXME("Depth / stencil buffer locking is not implemented.\n"); -+ if (device->d3d_initialized) -+ context = context_acquire(surface->resource.device, NULL); -+ wined3d_resource_load_location(&surface->resource, context, surface->container->resource.draw_binding); -+ if (context) -+ context_release(context); - } - - static BOOL surface_is_full_rect(const struct wined3d_surface *surface, const RECT *r) -@@ -1164,7 +1155,7 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour - static const struct wined3d_surface_ops surface_ops = - { - surface_private_setup, -- surface_unmap, -+ surface_frontbuffer_updated, - }; - - /***************************************************************************** -@@ -1208,21 +1199,15 @@ static HRESULT gdi_surface_private_setup(struct wined3d_surface *surface) - return WINED3D_OK; - } - --static void gdi_surface_unmap(struct wined3d_surface *surface) -+static void gdi_surface_frontbuffer_updated(struct wined3d_surface *surface) - { -- TRACE("surface %p.\n", surface); -- -- /* Tell the swapchain to update the screen. */ -- if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) -- x11_copy_to_screen(surface->container->swapchain, &surface->lockedRect); -- -- memset(&surface->lockedRect, 0, sizeof(RECT)); -+ x11_copy_to_screen(surface->container->swapchain, &surface->lockedRect); - } - - static const struct wined3d_surface_ops gdi_surface_ops = - { - gdi_surface_private_setup, -- gdi_surface_unmap, -+ gdi_surface_frontbuffer_updated, - }; - - /* This call just downloads data, the caller is responsible for binding the -@@ -2612,7 +2597,9 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) - if (context) - context_release(context); - -- surface->surface_ops->surface_unmap(surface); -+ if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) -+ surface->surface_ops->surface_frontbuffer_updated(surface); -+ memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); - - return WINED3D_OK; - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index f8733ad..b0986cd 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2350,7 +2350,7 @@ struct fbo_entry - struct wined3d_surface_ops - { - HRESULT (*surface_private_setup)(struct wined3d_surface *surface); -- void (*surface_unmap)(struct wined3d_surface *surface); -+ void (*surface_frontbuffer_updated)(struct wined3d_surface *surface); - }; - - struct wined3d_surface --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0033-wined3d-Introduce-a-function-to-retrieve-resource-me.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0033-wined3d-Introduce-a-function-to-retrieve-resource-me.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0033-wined3d-Introduce-a-function-to-retrieve-resource-me.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0033-wined3d-Introduce-a-function-to-retrieve-resource-me.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,159 @@ +From ddfa60053cfc7b215fdf041cd0e0b8401bb1a86b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Mon, 16 Sep 2013 22:44:33 +0200 +Subject: wined3d: Introduce a function to retrieve resource memory. + +--- + dlls/wined3d/resource.c | 30 ++++++++++++++++++++++++++++ + dlls/wined3d/surface.c | 45 ++++++------------------------------------ + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 38 insertions(+), 39 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index b756bf1..40267e7 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -506,6 +506,36 @@ DWORD wined3d_resource_access_from_location(DWORD location) + } + } + ++void wined3d_resource_get_memory(const struct wined3d_resource *resource, ++ DWORD location, struct wined3d_bo_address *data) ++{ ++ if (location & WINED3D_LOCATION_BUFFER) ++ { ++ data->buffer_object = resource->buffer_object; ++ data->addr = NULL; ++ return; ++ } ++ if (location & WINED3D_LOCATION_USER_MEMORY) ++ { ++ data->buffer_object = 0; ++ data->addr = resource->user_memory; ++ return; ++ } ++ if (location & WINED3D_LOCATION_DIB) ++ { ++ data->buffer_object = 0; ++ data->addr = resource->bitmap_data; ++ return; ++ } ++ if (location & WINED3D_LOCATION_SYSMEM) ++ { ++ data->buffer_object = 0; ++ data->addr = resource->heap_memory; ++ return; ++ } ++ ERR("Unexpected location %s.\n", wined3d_debug_location(location)); ++} ++ + /* Context activation is optionally by the caller. Context may be NULL. */ + void wined3d_resource_load_location(struct wined3d_resource *resource, + struct wined3d_context *context, DWORD location) +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index cf21b54..a6b98f1 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -479,39 +479,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) + return WINED3D_OK; + } + +-static void surface_get_memory(const struct wined3d_surface *surface, struct wined3d_bo_address *data, +- DWORD location) +-{ +- if (location & WINED3D_LOCATION_BUFFER) +- { +- data->addr = NULL; +- data->buffer_object = surface->resource.buffer_object; +- return; +- } +- if (location & WINED3D_LOCATION_USER_MEMORY) +- { +- data->addr = surface->resource.user_memory; +- data->buffer_object = 0; +- return; +- } +- if (location & WINED3D_LOCATION_DIB) +- { +- data->addr = surface->resource.bitmap_data; +- data->buffer_object = 0; +- return; +- } +- if (location & WINED3D_LOCATION_SYSMEM) +- { +- data->addr = surface->resource.heap_memory; +- data->buffer_object = 0; +- return; +- } +- +- ERR("Unexpected locations %s.\n", wined3d_debug_location(location)); +- data->addr = NULL; +- data->buffer_object = 0; +-} +- + static void surface_prepare_buffer(struct wined3d_surface *surface) + { + struct wined3d_context *context; +@@ -1274,7 +1241,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct + return; + } + +- surface_get_memory(surface, &data, dst_location); ++ wined3d_resource_get_memory(&surface->resource, dst_location, &data); + + if (surface->container->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) + { +@@ -1643,7 +1610,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P + wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); + +- surface_get_memory(src_surface, &data, src_surface->resource.locations); ++ wined3d_resource_get_memory(&src_surface->resource, src_surface->resource.locations, &data); + wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); + + wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, +@@ -2865,7 +2832,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, + struct wined3d_bo_address data; + UINT row_pitch, slice_pitch; + +- surface_get_memory(surface, &data, dst_location); ++ wined3d_resource_get_memory(&surface->resource, dst_location, &data); + + /* Context_release does not restore the original context in case of + * nested context_acquire calls. Only read_from_framebuffer and +@@ -4007,8 +3974,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD + struct wined3d_bo_address dst, src; + UINT size = surface->resource.size; + +- surface_get_memory(surface, &dst, location); +- surface_get_memory(surface, &src, surface->resource.locations); ++ wined3d_resource_get_memory(&surface->resource, location, &dst); ++ wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &src); + + if (dst.buffer_object) + { +@@ -4220,7 +4187,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + surface_remove_pbo(surface, gl_info); + } + +- surface_get_memory(surface, &data, surface->resource.locations); ++ wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); + if (format.convert) + { + /* This code is entered for texture formats which need a fixup. */ +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index f28994d..a640145 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2198,6 +2198,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE + void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, + const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; ++void wined3d_resource_get_memory(const struct wined3d_resource *resource, ++ DWORD location, struct wined3d_bo_address *data) DECLSPEC_HIDDEN; + void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, + UINT *slice_pitch) DECLSPEC_HIDDEN; + GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0033-wined3d-Move-check_block_align-to-resource.c.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0033-wined3d-Move-check_block_align-to-resource.c.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0033-wined3d-Move-check_block_align-to-resource.c.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0033-wined3d-Move-check_block_align-to-resource.c.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,152 +0,0 @@ -From da397c28f35b9220eb4bf258a49b3a778732cd28 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 19 Sep 2013 14:55:00 +0200 -Subject: wined3d: Move check_block_align to resource.c - ---- - dlls/wined3d/resource.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/surface.c | 27 +++++++++++---------------- - dlls/wined3d/volume.c | 31 ++----------------------------- - dlls/wined3d/wined3d_private.h | 2 ++ - 4 files changed, 43 insertions(+), 45 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 0ef2155..ddcfdad 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -618,3 +618,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru - return FALSE; - } - } -+ -+BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, -+ const struct wined3d_box *box) -+{ -+ UINT width_mask, height_mask; -+ const struct wined3d_format *format = resource->format; -+ -+ if (!box) -+ return TRUE; -+ -+ /* This assumes power of two block sizes, but NPOT block sizes would be -+ * silly anyway. -+ * -+ * This also assumes that the format's block depth is 1. */ -+ width_mask = format->block_width - 1; -+ height_mask = format->block_height - 1; -+ -+ if (box->left & width_mask) -+ return FALSE; -+ if (box->top & height_mask) -+ return FALSE; -+ if (box->right & width_mask && box->right != resource->width) -+ return FALSE; -+ if (box->bottom & height_mask && box->bottom != resource->height) -+ return FALSE; -+ -+ return TRUE; -+} -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 178a949..0f58be1 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -1475,23 +1475,18 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w - - static BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) - { -- UINT width_mask, height_mask; -+ struct wined3d_box box; - -- if (!rect->left && !rect->top -- && rect->right == surface->resource.width -- && rect->bottom == surface->resource.height) -- return TRUE; -- -- /* This assumes power of two block sizes, but NPOT block sizes would be -- * silly anyway. */ -- width_mask = surface->resource.format->block_width - 1; -- height_mask = surface->resource.format->block_height - 1; -- -- if (!(rect->left & width_mask) && !(rect->top & height_mask) -- && !(rect->right & width_mask) && !(rect->bottom & height_mask)) -- return TRUE; -- -- return FALSE; -+ if (!rect) -+ return wined3d_resource_check_block_align(&surface->resource, NULL); -+ -+ box.left = rect->left; -+ box.top = rect->top; -+ box.front = 0; -+ box.right = rect->right; -+ box.bottom = rect->bottom; -+ box.back = 1; -+ return wined3d_resource_check_block_align(&surface->resource, &box); - } - - HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 1cfeb04..4d7b349 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -379,34 +379,6 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum - return &volume->resource; - } - --static BOOL volume_check_block_align(const struct wined3d_volume *volume, -- const struct wined3d_box *box) --{ -- UINT width_mask, height_mask; -- const struct wined3d_format *format = volume->resource.format; -- -- if (!box) -- return TRUE; -- -- /* This assumes power of two block sizes, but NPOT block sizes would be -- * silly anyway. -- * -- * This also assumes that the format's block depth is 1. */ -- width_mask = format->block_width - 1; -- height_mask = format->block_height - 1; -- -- if (box->left & width_mask) -- return FALSE; -- if (box->top & height_mask) -- return FALSE; -- if (box->right & width_mask && box->right != volume->resource.width) -- return FALSE; -- if (box->bottom & height_mask && box->bottom != volume->resource.height) -- return FALSE; -- -- return TRUE; --} -- - static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume, - const struct wined3d_box *box) - { -@@ -457,7 +429,8 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - WARN("Map box is invalid.\n"); - return WINED3DERR_INVALIDCALL; - } -- if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box)) -+ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && -+ !wined3d_resource_check_block_align(&volume->resource, box)) - { - WARN("Map box is misaligned for %ux%u blocks.\n", - format->block_width, format->block_height); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 96cdac5..855375d 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2155,6 +2155,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * - void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; - BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, -+ const struct wined3d_box *box) DECLSPEC_HIDDEN; - void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, - const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0034-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0034-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0034-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0034-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,116 @@ +From 10058dd5be622aefa90a05d8e793573da1140bf7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 19 Sep 2013 13:36:00 +0200 +Subject: wined3d: Make surface_ops->unmap specific for front buffers. + +--- + dlls/wined3d/surface.c | 45 +++++++++++++++--------------------------- + dlls/wined3d/wined3d_private.h | 2 +- + 2 files changed, 17 insertions(+), 30 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 3e9a8ef..175f05e 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -681,31 +681,22 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) + return WINED3D_OK; + } + +-static void surface_unmap(struct wined3d_surface *surface) ++static void surface_frontbuffer_updated(struct wined3d_surface *surface) + { +- TRACE("surface %p.\n", surface); +- +- memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); ++ struct wined3d_context *context = NULL; ++ struct wined3d_device *device = surface->resource.device; + +- if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)) ++ if (surface->resource.locations & WINED3D_LOCATION_DRAWABLE) + { + TRACE("Not dirtified, nothing to do.\n"); + return; + } + +- if (surface->container->swapchain && surface->container->swapchain->front_buffer == surface->container) +- { +- struct wined3d_device *device = surface->resource.device; +- struct wined3d_context *context = NULL; +- +- if (device->d3d_initialized) +- context = context_acquire(device, surface); +- wined3d_resource_load_location(&surface->resource, context, surface->container->resource.draw_binding); +- if (context) +- context_release(context); +- } +- else if (surface->container->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) +- FIXME("Depth / stencil buffer locking is not implemented.\n"); ++ if (device->d3d_initialized) ++ context = context_acquire(surface->resource.device, NULL); ++ wined3d_resource_load_location(&surface->resource, context, surface->container->resource.draw_binding); ++ if (context) ++ context_release(context); + } + + static BOOL surface_is_full_rect(const struct wined3d_surface *surface, const RECT *r) +@@ -1164,7 +1155,7 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour + static const struct wined3d_surface_ops surface_ops = + { + surface_private_setup, +- surface_unmap, ++ surface_frontbuffer_updated, + }; + + /***************************************************************************** +@@ -1208,21 +1199,15 @@ static HRESULT gdi_surface_private_setup(struct wined3d_surface *surface) + return WINED3D_OK; + } + +-static void gdi_surface_unmap(struct wined3d_surface *surface) ++static void gdi_surface_frontbuffer_updated(struct wined3d_surface *surface) + { +- TRACE("surface %p.\n", surface); +- +- /* Tell the swapchain to update the screen. */ +- if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) +- x11_copy_to_screen(surface->container->swapchain, &surface->lockedRect); +- +- memset(&surface->lockedRect, 0, sizeof(RECT)); ++ x11_copy_to_screen(surface->container->swapchain, &surface->lockedRect); + } + + static const struct wined3d_surface_ops gdi_surface_ops = + { + gdi_surface_private_setup, +- gdi_surface_unmap, ++ gdi_surface_frontbuffer_updated, + }; + + /* This call just downloads data, the caller is responsible for binding the +@@ -2612,7 +2597,9 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + if (context) + context_release(context); + +- surface->surface_ops->surface_unmap(surface); ++ if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) ++ surface->surface_ops->surface_frontbuffer_updated(surface); ++ memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); + + return WINED3D_OK; + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index f8733ad..b0986cd 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2350,7 +2350,7 @@ struct fbo_entry + struct wined3d_surface_ops + { + HRESULT (*surface_private_setup)(struct wined3d_surface *surface); +- void (*surface_unmap)(struct wined3d_surface *surface); ++ void (*surface_frontbuffer_updated)(struct wined3d_surface *surface); + }; + + struct wined3d_surface +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,221 +0,0 @@ -From 4345b09b18121021362ea09caa4232d1b97bcf37 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. - ---- - dlls/wined3d/resource.c | 10 +++++ - dlls/wined3d/surface.c | 89 ++++-------------------------------------- - dlls/wined3d/texture.c | 5 +-- - dlls/wined3d/wined3d_private.h | 1 - - 4 files changed, 19 insertions(+), 86 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 9b87d6b..1da4da5 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -610,6 +610,16 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru - case WINED3D_LOCATION_SYSMEM: - return wined3d_resource_prepare_system_memory(resource); - -+ case WINED3D_LOCATION_USER_MEMORY: -+ if (!resource->user_memory) -+ ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but resource->user_memory is NULL.\n"); -+ return TRUE; -+ -+ case WINED3D_LOCATION_DIB: -+ if (!resource->bitmap_data) -+ ERR("Map binding is set to WINED3D_LOCATION_DIB but resource->bitmap_data is NULL.\n"); -+ return TRUE; -+ - default: - ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); - return FALSE; -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 3bcf0ab..0a908b1 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -478,81 +478,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) - return WINED3D_OK; - } - --static void surface_prepare_buffer(struct wined3d_surface *surface) --{ -- struct wined3d_context *context; -- GLenum error; -- const struct wined3d_gl_info *gl_info; -- -- if (surface->resource.buffer_object) -- return; -- -- context = context_acquire(surface->resource.device, NULL); -- gl_info = context->gl_info; -- -- 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(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->resource.buffer_object)); -- checkGLcall("glBindBuffer"); -- -- GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, surface->resource.size + 4, -- NULL, GL_STREAM_DRAW)); -- checkGLcall("glBufferData"); -- -- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); -- checkGLcall("glBindBuffer"); -- -- context_release(context); --} -- --static void surface_prepare_system_memory(struct wined3d_surface *surface) --{ -- TRACE("surface %p.\n", surface); -- -- if (surface->resource.heap_memory) -- return; -- -- /* Whatever surface we have, make sure that there is memory allocated -- * for the downloaded copy, or a PBO to map. */ -- if (!wined3d_resource_allocate_sysmem(&surface->resource)) -- ERR("Failed to allocate system memory.\n"); -- -- if (surface->resource.locations & WINED3D_LOCATION_SYSMEM) -- ERR("Surface without system memory has WINED3D_LOCATION_SYSMEM set.\n"); --} -- --void surface_prepare_map_memory(struct wined3d_surface *surface) --{ -- switch (surface->resource.map_binding) -- { -- case WINED3D_LOCATION_SYSMEM: -- surface_prepare_system_memory(surface); -- break; -- -- case WINED3D_LOCATION_USER_MEMORY: -- if (!surface->resource.user_memory) -- ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but surface->resource.user_memory is NULL.\n"); -- break; -- -- case WINED3D_LOCATION_DIB: -- if (!surface->resource.bitmap_data) -- ERR("Map binding is set to WINED3D_LOCATION_DIB but surface->resource.bitmap_data is NULL.\n"); -- break; -- -- case WINED3D_LOCATION_BUFFER: -- surface_prepare_buffer(surface); -- break; -- -- default: -- ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding)); -- } --} -- - static void surface_evict_sysmem(struct wined3d_surface *surface) - { - /* In some conditions the surface memory must not be freed: -@@ -1159,7 +1084,7 @@ static void surface_unload(struct wined3d_resource *resource) - } - else - { -- surface_prepare_map_memory(surface); -+ wined3d_resource_prepare_map_memory(&surface->resource, context); - wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); - } -@@ -2139,7 +2064,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, - - if (!valid_location) - { -- surface_prepare_system_memory(surface); -+ wined3d_resource_prepare_system_memory(&surface->resource); - valid_location = WINED3D_LOCATION_SYSMEM; - } - -@@ -2695,7 +2620,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - if (device->d3d_initialized) - context = context_acquire(device, NULL); - -- surface_prepare_map_memory(surface); -+ wined3d_resource_prepare_map_memory(&surface->resource, context); - if (flags & WINED3D_MAP_DISCARD) - { - TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n", -@@ -4226,7 +4151,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - { - /* Performance warning... */ - FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); -- surface_prepare_map_memory(surface); -+ wined3d_resource_prepare_map_memory(&surface->resource, context); - wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - } - } -@@ -4237,7 +4162,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - { - /* Performance warning... */ - FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); -- surface_prepare_map_memory(surface); -+ wined3d_resource_prepare_map_memory(&surface->resource, context); - wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - } - } -@@ -4246,7 +4171,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - { - WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); - /* Lets hope we get it from somewhere... */ -- surface_prepare_system_memory(surface); -+ wined3d_resource_prepare_system_memory(&surface->resource); - wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); - } - -@@ -4272,7 +4197,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - else - surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; - -- surface_prepare_map_memory(surface); -+ wined3d_resource_prepare_map_memory(&surface->resource, context); - wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - surface_remove_pbo(surface, gl_info); - } -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 2ae36ef..8faeefa 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -783,8 +783,8 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub - struct wined3d_surface *surface = surface_from_resource(sub_resource); - struct wined3d_context *context; - -- surface_prepare_map_memory(surface); - context = context_acquire(surface->resource.device, NULL); -+ wined3d_resource_prepare_map_memory(&surface->resource, context); - wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); - context_release(context); - wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); -@@ -896,8 +896,7 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi - } - else - { -- if (!surface->resource.heap_memory) -- wined3d_resource_allocate_sysmem(&surface->resource); -+ wined3d_resource_prepare_system_memory(&surface->resource); - - surface->flags |= SFLAG_CLIENT; - mem = surface->resource.heap_memory; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 4540df1..bbf9128 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2397,7 +2397,6 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w - GLenum target, unsigned int level, unsigned int layer, DWORD flags, - struct wined3d_surface **surface) DECLSPEC_HIDDEN; - void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; --void surface_prepare_map_memory(struct wined3d_surface *surface) DECLSPEC_HIDDEN; - void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, - const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, - BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; --- -2.3.0 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0035-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0035-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0035-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0035-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -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. - ---- - dlls/wined3d/surface.c | 6 ------ - 1 file changed, 6 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -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) - context = context_acquire(surface->resource.device, NULL); - gl_info = context->gl_info; - -- if (surface->resource.buffer_object) -- { -- TRACE("Deleting PBO %u.\n", 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.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0035-wined3d-Move-check_block_align-to-resource.c.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0035-wined3d-Move-check_block_align-to-resource.c.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0035-wined3d-Move-check_block_align-to-resource.c.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0035-wined3d-Move-check_block_align-to-resource.c.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,152 @@ +From da397c28f35b9220eb4bf258a49b3a778732cd28 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 19 Sep 2013 14:55:00 +0200 +Subject: wined3d: Move check_block_align to resource.c + +--- + dlls/wined3d/resource.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/surface.c | 27 +++++++++++---------------- + dlls/wined3d/volume.c | 31 ++----------------------------- + dlls/wined3d/wined3d_private.h | 2 ++ + 4 files changed, 43 insertions(+), 45 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 0ef2155..ddcfdad 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -618,3 +618,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru + return FALSE; + } + } ++ ++BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, ++ const struct wined3d_box *box) ++{ ++ UINT width_mask, height_mask; ++ const struct wined3d_format *format = resource->format; ++ ++ if (!box) ++ return TRUE; ++ ++ /* This assumes power of two block sizes, but NPOT block sizes would be ++ * silly anyway. ++ * ++ * This also assumes that the format's block depth is 1. */ ++ width_mask = format->block_width - 1; ++ height_mask = format->block_height - 1; ++ ++ if (box->left & width_mask) ++ return FALSE; ++ if (box->top & height_mask) ++ return FALSE; ++ if (box->right & width_mask && box->right != resource->width) ++ return FALSE; ++ if (box->bottom & height_mask && box->bottom != resource->height) ++ return FALSE; ++ ++ return TRUE; ++} +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 178a949..0f58be1 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -1475,23 +1475,18 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w + + static BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) + { +- UINT width_mask, height_mask; ++ struct wined3d_box box; + +- if (!rect->left && !rect->top +- && rect->right == surface->resource.width +- && rect->bottom == surface->resource.height) +- return TRUE; +- +- /* This assumes power of two block sizes, but NPOT block sizes would be +- * silly anyway. */ +- width_mask = surface->resource.format->block_width - 1; +- height_mask = surface->resource.format->block_height - 1; +- +- if (!(rect->left & width_mask) && !(rect->top & height_mask) +- && !(rect->right & width_mask) && !(rect->bottom & height_mask)) +- return TRUE; +- +- return FALSE; ++ if (!rect) ++ return wined3d_resource_check_block_align(&surface->resource, NULL); ++ ++ box.left = rect->left; ++ box.top = rect->top; ++ box.front = 0; ++ box.right = rect->right; ++ box.bottom = rect->bottom; ++ box.back = 1; ++ return wined3d_resource_check_block_align(&surface->resource, &box); + } + + HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 1cfeb04..4d7b349 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -379,34 +379,6 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum + return &volume->resource; + } + +-static BOOL volume_check_block_align(const struct wined3d_volume *volume, +- const struct wined3d_box *box) +-{ +- UINT width_mask, height_mask; +- const struct wined3d_format *format = volume->resource.format; +- +- if (!box) +- return TRUE; +- +- /* This assumes power of two block sizes, but NPOT block sizes would be +- * silly anyway. +- * +- * This also assumes that the format's block depth is 1. */ +- width_mask = format->block_width - 1; +- height_mask = format->block_height - 1; +- +- if (box->left & width_mask) +- return FALSE; +- if (box->top & height_mask) +- return FALSE; +- if (box->right & width_mask && box->right != volume->resource.width) +- return FALSE; +- if (box->bottom & height_mask && box->bottom != volume->resource.height) +- return FALSE; +- +- return TRUE; +-} +- + static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume, + const struct wined3d_box *box) + { +@@ -457,7 +429,8 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + WARN("Map box is invalid.\n"); + return WINED3DERR_INVALIDCALL; + } +- if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box)) ++ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && ++ !wined3d_resource_check_block_align(&volume->resource, box)) + { + WARN("Map box is misaligned for %ux%u blocks.\n", + format->block_width, format->block_height); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 96cdac5..855375d 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2155,6 +2155,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * + void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; + BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, ++ const struct wined3d_box *box) DECLSPEC_HIDDEN; + void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, + const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0036-wined3d-Replace-surface-alloc-functions-with-resourc.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0036-wined3d-Replace-surface-alloc-functions-with-resourc.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0036-wined3d-Replace-surface-alloc-functions-with-resourc.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0036-wined3d-Replace-surface-alloc-functions-with-resourc.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,221 @@ +From 4345b09b18121021362ea09caa4232d1b97bcf37 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. + +--- + dlls/wined3d/resource.c | 10 +++++ + dlls/wined3d/surface.c | 89 ++++-------------------------------------- + dlls/wined3d/texture.c | 5 +-- + dlls/wined3d/wined3d_private.h | 1 - + 4 files changed, 19 insertions(+), 86 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 9b87d6b..1da4da5 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -610,6 +610,16 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru + case WINED3D_LOCATION_SYSMEM: + return wined3d_resource_prepare_system_memory(resource); + ++ case WINED3D_LOCATION_USER_MEMORY: ++ if (!resource->user_memory) ++ ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but resource->user_memory is NULL.\n"); ++ return TRUE; ++ ++ case WINED3D_LOCATION_DIB: ++ if (!resource->bitmap_data) ++ ERR("Map binding is set to WINED3D_LOCATION_DIB but resource->bitmap_data is NULL.\n"); ++ return TRUE; ++ + default: + ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); + return FALSE; +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 3bcf0ab..0a908b1 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -478,81 +478,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) + return WINED3D_OK; + } + +-static void surface_prepare_buffer(struct wined3d_surface *surface) +-{ +- struct wined3d_context *context; +- GLenum error; +- const struct wined3d_gl_info *gl_info; +- +- if (surface->resource.buffer_object) +- return; +- +- context = context_acquire(surface->resource.device, NULL); +- gl_info = context->gl_info; +- +- 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(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->resource.buffer_object)); +- checkGLcall("glBindBuffer"); +- +- GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, surface->resource.size + 4, +- NULL, GL_STREAM_DRAW)); +- checkGLcall("glBufferData"); +- +- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); +- checkGLcall("glBindBuffer"); +- +- context_release(context); +-} +- +-static void surface_prepare_system_memory(struct wined3d_surface *surface) +-{ +- TRACE("surface %p.\n", surface); +- +- if (surface->resource.heap_memory) +- return; +- +- /* Whatever surface we have, make sure that there is memory allocated +- * for the downloaded copy, or a PBO to map. */ +- if (!wined3d_resource_allocate_sysmem(&surface->resource)) +- ERR("Failed to allocate system memory.\n"); +- +- if (surface->resource.locations & WINED3D_LOCATION_SYSMEM) +- ERR("Surface without system memory has WINED3D_LOCATION_SYSMEM set.\n"); +-} +- +-void surface_prepare_map_memory(struct wined3d_surface *surface) +-{ +- switch (surface->resource.map_binding) +- { +- case WINED3D_LOCATION_SYSMEM: +- surface_prepare_system_memory(surface); +- break; +- +- case WINED3D_LOCATION_USER_MEMORY: +- if (!surface->resource.user_memory) +- ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but surface->resource.user_memory is NULL.\n"); +- break; +- +- case WINED3D_LOCATION_DIB: +- if (!surface->resource.bitmap_data) +- ERR("Map binding is set to WINED3D_LOCATION_DIB but surface->resource.bitmap_data is NULL.\n"); +- break; +- +- case WINED3D_LOCATION_BUFFER: +- surface_prepare_buffer(surface); +- break; +- +- default: +- ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding)); +- } +-} +- + static void surface_evict_sysmem(struct wined3d_surface *surface) + { + /* In some conditions the surface memory must not be freed: +@@ -1159,7 +1084,7 @@ static void surface_unload(struct wined3d_resource *resource) + } + else + { +- surface_prepare_map_memory(surface); ++ wined3d_resource_prepare_map_memory(&surface->resource, context); + wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); + wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); + } +@@ -2139,7 +2064,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, + + if (!valid_location) + { +- surface_prepare_system_memory(surface); ++ wined3d_resource_prepare_system_memory(&surface->resource); + valid_location = WINED3D_LOCATION_SYSMEM; + } + +@@ -2695,7 +2620,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + if (device->d3d_initialized) + context = context_acquire(device, NULL); + +- surface_prepare_map_memory(surface); ++ wined3d_resource_prepare_map_memory(&surface->resource, context); + if (flags & WINED3D_MAP_DISCARD) + { + TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n", +@@ -4226,7 +4151,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + { + /* Performance warning... */ + FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); +- surface_prepare_map_memory(surface); ++ wined3d_resource_prepare_map_memory(&surface->resource, context); + wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); + } + } +@@ -4237,7 +4162,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + { + /* Performance warning... */ + FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); +- surface_prepare_map_memory(surface); ++ wined3d_resource_prepare_map_memory(&surface->resource, context); + wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); + } + } +@@ -4246,7 +4171,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + { + WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); + /* Lets hope we get it from somewhere... */ +- surface_prepare_system_memory(surface); ++ wined3d_resource_prepare_system_memory(&surface->resource); + wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); + } + +@@ -4272,7 +4197,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + else + surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; + +- surface_prepare_map_memory(surface); ++ wined3d_resource_prepare_map_memory(&surface->resource, context); + wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); + surface_remove_pbo(surface, gl_info); + } +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 2ae36ef..8faeefa 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -783,8 +783,8 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub + struct wined3d_surface *surface = surface_from_resource(sub_resource); + struct wined3d_context *context; + +- surface_prepare_map_memory(surface); + context = context_acquire(surface->resource.device, NULL); ++ wined3d_resource_prepare_map_memory(&surface->resource, context); + wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); + context_release(context); + wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); +@@ -896,8 +896,7 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi + } + else + { +- if (!surface->resource.heap_memory) +- wined3d_resource_allocate_sysmem(&surface->resource); ++ wined3d_resource_prepare_system_memory(&surface->resource); + + surface->flags |= SFLAG_CLIENT; + mem = surface->resource.heap_memory; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 4540df1..bbf9128 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2397,7 +2397,6 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w + GLenum target, unsigned int level, unsigned int layer, DWORD flags, + struct wined3d_surface **surface) DECLSPEC_HIDDEN; + void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; +-void surface_prepare_map_memory(struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, + const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, + BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; +-- +2.3.0 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0036-wined3d-Use-resource-facilities-to-destroy-PBOs.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0036-wined3d-Use-resource-facilities-to-destroy-PBOs.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0036-wined3d-Use-resource-facilities-to-destroy-PBOs.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0036-wined3d-Use-resource-facilities-to-destroy-PBOs.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -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. - ---- - dlls/wined3d/resource.c | 2 +- - dlls/wined3d/surface.c | 17 ++--------------- - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 4 insertions(+), 16 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -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 * - return WINED3D_OK; - } - --static void wined3d_resource_free_bo(struct wined3d_resource *resource) -+void wined3d_resource_free_bo(struct wined3d_resource *resource) - { - 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 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 - return wined3d_surface_blt(surface, NULL, render_target, NULL, 0, NULL, WINED3D_TEXF_POINT); - } - --/* 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(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); --} -- - static ULONG surface_resource_incref(struct wined3d_resource *resource) - { - return wined3d_surface_incref(surface_from_resource(resource)); -@@ -1084,10 +1074,6 @@ static void surface_unload(struct wined3d_resource *resource) - wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); - } - -- /* Destroy PBOs, but load them into real sysmem before */ -- if (surface->resource.buffer_object) -- surface_remove_pbo(surface, gl_info); -- - /* 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 -@@ -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); -- surface_remove_pbo(surface, gl_info); -+ wined3d_resource_free_bo(&surface->resource); -+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_BUFFER); - } - - 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 beaf9bc..5e6d5d3 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -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; -+void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, - const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0037-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0037-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0037-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0037-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,29 @@ +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. + +--- + dlls/wined3d/surface.c | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +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) + context = context_acquire(surface->resource.device, NULL); + gl_info = context->gl_info; + +- if (surface->resource.buffer_object) +- { +- TRACE("Deleting PBO %u.\n", 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.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0037-wined3d-Move-simple-location-copying-to-the-resource.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0037-wined3d-Move-simple-location-copying-to-the-resource.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0037-wined3d-Move-simple-location-copying-to-the-resource.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0037-wined3d-Move-simple-location-copying-to-the-resource.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,158 +0,0 @@ -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. - ---- - dlls/wined3d/resource.c | 38 ++++++++++++++++++++++++++++++++++++ - dlls/wined3d/surface.c | 51 ++++--------------------------------------------- - 2 files changed, 42 insertions(+), 47 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 9783b78..939377f 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -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. */ -+static void wined3d_resource_copy_simple_location(struct wined3d_resource *resource, -+ struct wined3d_context *context, DWORD location) -+{ -+ const struct wined3d_gl_info *gl_info; -+ struct wined3d_bo_address dst, src; -+ UINT size = resource->size; -+ -+ wined3d_resource_get_memory(resource, location, &dst); -+ wined3d_resource_get_memory(resource, resource->locations, &src); -+ -+ if (dst.buffer_object) -+ { -+ gl_info = context->gl_info; -+ 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(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; -+ } -+ memcpy(dst.addr, src.addr, size); -+} -+ -+/* Context activation is optionally by the caller. Context may be NULL. */ - void wined3d_resource_load_location(struct wined3d_resource *resource, - struct wined3d_context *context, DWORD location) - { -@@ -480,6 +512,12 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, - resource->locations |= location; - return; - } -+ if (resource->locations & simple_locations) -+ { -+ wined3d_resource_copy_simple_location(resource, context, location); -+ resource->locations |= location; -+ return; -+ } - } - - /* Context is NULL in ddraw-only operation without OpenGL. */ -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index b197655..b620b02 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -36,10 +36,6 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); - - #define MAXLOCKCOUNT 50 /* After this amount of locks do not free the sysmem copy. */ - --static const DWORD surface_simple_locations = -- WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_USER_MEMORY -- | WINED3D_LOCATION_DIB | WINED3D_LOCATION_BUFFER; -- - static void surface_cleanup(struct wined3d_surface *surface) - { - struct wined3d_surface *overlay, *cur; -@@ -3986,54 +3982,12 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co - surface->ds_current_size.cy = surface->resource.height; - } - --static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD location) --{ -- struct wined3d_device *device = surface->resource.device; -- struct wined3d_context *context; -- const struct wined3d_gl_info *gl_info; -- struct wined3d_bo_address dst, src; -- UINT size = surface->resource.size; -- -- wined3d_resource_get_memory(&surface->resource, location, &dst); -- wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &src); -- -- if (dst.buffer_object) -- { -- context = context_acquire(device, NULL); -- gl_info = context->gl_info; -- 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; -- } -- if (src.buffer_object) -- { -- context = context_acquire(device, NULL); -- gl_info = context->gl_info; -- 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; -- } -- memcpy(dst.addr, src.addr, size); --} -- - /* Context activation is done by the caller. */ - static void surface_load_sysmem(struct wined3d_surface *surface, - struct wined3d_context *context, DWORD dst_location) - { - const struct wined3d_gl_info *gl_info = context->gl_info; - -- if (surface->resource.locations & surface_simple_locations) -- { -- surface_copy_simple_location(surface, dst_location); -- return; -- } -- - if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) - wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); - -@@ -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; -+ const DWORD simple_locations = -+ WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_USER_MEMORY -+ | WINED3D_LOCATION_DIB | WINED3D_LOCATION_BUFFER; - - if (surface->resource.locations & WINED3D_LOCATION_DISCARDED) - { -@@ -4172,7 +4129,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - } - } - -- if (!(surface->resource.locations & surface_simple_locations)) -+ if (!(surface->resource.locations & simple_locations)) - { - WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); - /* Lets hope we get it from somewhere... */ --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0038-wined3d-Move-most-of-volume_map-to-resource.c.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0038-wined3d-Move-most-of-volume_map-to-resource.c.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0038-wined3d-Move-most-of-volume_map-to-resource.c.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0038-wined3d-Move-most-of-volume_map-to-resource.c.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,296 +0,0 @@ -From 2ae05213ea4af0cb5725b2b88b51bd7ef2f893c5 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 19 Sep 2013 17:51:38 +0200 -Subject: wined3d: Move most of volume_map to resource.c - -The CPU access check can be moved once surfaces don't have to lock for -sysmem blits. Surfaces and volume have different block alignment and -boundary check behaviours. ---- - dlls/wined3d/resource.c | 115 +++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/volume.c | 101 +++--------------------------------- - dlls/wined3d/wined3d_private.h | 3 ++ - 3 files changed, 124 insertions(+), 95 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 11136de..ba18baa 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -756,3 +756,118 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, - - return TRUE; - } -+ -+HRESULT wined3d_resource_map(struct wined3d_resource *resource, -+ struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) -+{ -+ struct wined3d_device *device = resource->device; -+ struct wined3d_context *context = NULL; -+ BYTE *base_memory; -+ const struct wined3d_format *format = resource->format; -+ const unsigned int fmt_flags = resource->format_flags; -+ -+ TRACE("resource %p, map_desc %p, box %p, flags %#x.\n", -+ resource, map_desc, box, flags); -+ -+ if (resource->map_count) -+ { -+ WARN("Volume is already mapped.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ flags = wined3d_resource_sanitize_map_flags(resource, flags); -+ -+ if (device->d3d_initialized) -+ context = context_acquire(device, NULL); -+ -+ if (!wined3d_resource_prepare_map_memory(resource, context)) -+ { -+ WARN("Out of memory.\n"); -+ map_desc->data = NULL; -+ context_release(context); -+ return E_OUTOFMEMORY; -+ } -+ -+ if (flags & WINED3D_MAP_DISCARD) -+ wined3d_resource_validate_location(resource, resource->map_binding); -+ else -+ wined3d_resource_load_location(resource, context, resource->map_binding); -+ -+ base_memory = wined3d_resource_get_map_ptr(resource, context, flags); -+ -+ if (context) -+ context_release(context); -+ -+ TRACE("Base memory pointer %p.\n", base_memory); -+ -+ if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) -+ { -+ map_desc->row_pitch = resource->width * format->byte_count; -+ map_desc->slice_pitch = map_desc->row_pitch * resource->height; -+ } -+ else -+ { -+ wined3d_resource_get_pitch(resource, &map_desc->row_pitch, &map_desc->slice_pitch); -+ } -+ -+ if (!box) -+ { -+ TRACE("No box supplied - all is ok\n"); -+ map_desc->data = base_memory; -+ } -+ else -+ { -+ TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n", -+ box, box->left, box->top, box->right, box->bottom, box->front, box->back); -+ -+ if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) -+ { -+ /* Compressed textures are block based, so calculate the offset of -+ * the block that contains the top-left pixel of the locked rectangle. */ -+ map_desc->data = base_memory -+ + (box->front * map_desc->slice_pitch) -+ + ((box->top / format->block_height) * map_desc->row_pitch) -+ + ((box->left / format->block_width) * format->block_byte_count); -+ } -+ else -+ { -+ map_desc->data = base_memory -+ + (map_desc->slice_pitch * box->front) -+ + (map_desc->row_pitch * box->top) -+ + (box->left * format->byte_count); -+ } -+ } -+ -+ if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) -+ wined3d_resource_invalidate_location(resource, ~resource->map_binding); -+ -+ resource->map_count++; -+ -+ TRACE("Returning memory %p, row pitch %d, slice pitch %d.\n", -+ map_desc->data, map_desc->row_pitch, map_desc->slice_pitch); -+ -+ return WINED3D_OK; -+} -+ -+HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) -+{ -+ struct wined3d_device *device = resource->device; -+ struct wined3d_context *context = NULL; -+ TRACE("resource %p.\n", resource); -+ -+ if (!resource->map_count) -+ { -+ WARN("Trying to unlock an unlocked resource %p.\n", resource); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ if (device->d3d_initialized) -+ context = context_acquire(device, NULL); -+ wined3d_resource_release_map_ptr(resource, context); -+ if (context) -+ context_release(context); -+ -+ resource->map_count--; -+ -+ return WINED3D_OK; -+} -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index e70fcf4..dd49d01 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -404,26 +404,16 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol - HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) - { -- struct wined3d_device *device = volume->resource.device; -- struct wined3d_context *context; -- BYTE *base_memory; -+ HRESULT hr; - const struct wined3d_format *format = volume->resource.format; - const unsigned int fmt_flags = volume->container->resource.format_flags; - -- TRACE("volume %p, map_desc %p, box %p, flags %#x.\n", -- volume, map_desc, box, flags); -- - map_desc->data = NULL; - if (!(volume->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU)) - { - WARN("Volume %p is not CPU accessible.\n", volume); - return WINED3DERR_INVALIDCALL; - } -- if (volume->resource.map_count) -- { -- WARN("Volume is already mapped.\n"); -- return WINED3DERR_INVALIDCALL; -- } - if (!wined3d_volume_check_box_dimensions(volume, box)) - { - WARN("Map box is invalid.\n"); -@@ -437,74 +427,11 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, - return WINED3DERR_INVALIDCALL; - } - -- flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags); -- -- context = context_acquire(device, NULL); -- if (!wined3d_resource_prepare_map_memory(&volume->resource, context)) -- { -- WARN("Out of memory.\n"); -- map_desc->data = NULL; -- context_release(context); -- return E_OUTOFMEMORY; -- } -- -- if (flags & WINED3D_MAP_DISCARD) -- wined3d_resource_validate_location(&volume->resource, volume->resource.map_binding); -- else -- wined3d_resource_load_location(&volume->resource, context, volume->resource.map_binding); -- -- base_memory = wined3d_resource_get_map_ptr(&volume->resource, context, flags); -- context_release(context); -- -- TRACE("Base memory pointer %p.\n", base_memory); -- -- if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) -- { -- map_desc->row_pitch = volume->resource.width * format->byte_count; -- map_desc->slice_pitch = map_desc->row_pitch * volume->resource.height; -- } -- else -- { -- wined3d_resource_get_pitch(&volume->resource, &map_desc->row_pitch, &map_desc->slice_pitch); -- } -- -- if (!box) -- { -- TRACE("No box supplied - all is ok\n"); -- map_desc->data = base_memory; -- } -- else -- { -- TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n", -- box, box->left, box->top, box->right, box->bottom, box->front, box->back); -- -- if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) -- { -- /* Compressed textures are block based, so calculate the offset of -- * the block that contains the top-left pixel of the locked rectangle. */ -- map_desc->data = base_memory -- + (box->front * map_desc->slice_pitch) -- + ((box->top / format->block_height) * map_desc->row_pitch) -- + ((box->left / format->block_width) * format->block_byte_count); -- } -- else -- { -- map_desc->data = base_memory -- + (map_desc->slice_pitch * box->front) -- + (map_desc->row_pitch * box->top) -- + (box->left * volume->resource.format->byte_count); -- } -- } -- -- if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) -- wined3d_resource_invalidate_location(&volume->resource, ~volume->resource.map_binding); -- -- volume->resource.map_count++; -- -- TRACE("Returning memory %p, row pitch %d, slice pitch %d.\n", -- map_desc->data, map_desc->row_pitch, map_desc->slice_pitch); -+ hr = wined3d_resource_map(&volume->resource, map_desc, box, flags); -+ if (FAILED(hr)) -+ return hr; - -- return WINED3D_OK; -+ return hr; - } - - struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resource *resource) -@@ -514,23 +441,7 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour - - HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) - { -- struct wined3d_device *device = volume->resource.device; -- struct wined3d_context *context; -- TRACE("volume %p.\n", volume); -- -- if (!volume->resource.map_count) -- { -- WARN("Trying to unlock an unlocked volume %p.\n", volume); -- return WINED3DERR_INVALIDCALL; -- } -- -- context = context_acquire(device, NULL); -- wined3d_resource_release_map_ptr(&volume->resource, context); -- context_release(context); -- -- volume->resource.map_count--; -- -- return WINED3D_OK; -+ return wined3d_resource_unmap(&volume->resource); - } - - static ULONG volume_resource_incref(struct wined3d_resource *resource) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 8c511c1..9d33eb6 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2182,12 +2182,15 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO - BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_load_location(struct wined3d_resource *resource, - struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; -+HRESULT wined3d_resource_map(struct wined3d_resource *resource, struct wined3d_map_desc *map_desc, -+ const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN; - BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, - struct wined3d_context *context) DECLSPEC_HIDDEN; - BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, - const struct wined3d_context *context) DECLSPEC_HIDDEN; - DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; -+HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; - --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0038-wined3d-Use-resource-facilities-to-destroy-PBOs.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0038-wined3d-Use-resource-facilities-to-destroy-PBOs.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0038-wined3d-Use-resource-facilities-to-destroy-PBOs.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0038-wined3d-Use-resource-facilities-to-destroy-PBOs.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,81 @@ +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. + +--- + dlls/wined3d/resource.c | 2 +- + dlls/wined3d/surface.c | 17 ++--------------- + dlls/wined3d/wined3d_private.h | 1 + + 3 files changed, 4 insertions(+), 16 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +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 * + return WINED3D_OK; + } + +-static void wined3d_resource_free_bo(struct wined3d_resource *resource) ++void wined3d_resource_free_bo(struct wined3d_resource *resource) + { + 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 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 + return wined3d_surface_blt(surface, NULL, render_target, NULL, 0, NULL, WINED3D_TEXF_POINT); + } + +-/* 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(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); +-} +- + static ULONG surface_resource_incref(struct wined3d_resource *resource) + { + return wined3d_surface_incref(surface_from_resource(resource)); +@@ -1084,10 +1074,6 @@ static void surface_unload(struct wined3d_resource *resource) + wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); + } + +- /* Destroy PBOs, but load them into real sysmem before */ +- if (surface->resource.buffer_object) +- surface_remove_pbo(surface, gl_info); +- + /* 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 +@@ -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); +- surface_remove_pbo(surface, gl_info); ++ wined3d_resource_free_bo(&surface->resource); ++ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_BUFFER); + } + + 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 beaf9bc..5e6d5d3 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -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; ++void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, + const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0039-wined3d-Move-simple-location-copying-to-the-resource.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0039-wined3d-Move-simple-location-copying-to-the-resource.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0039-wined3d-Move-simple-location-copying-to-the-resource.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0039-wined3d-Move-simple-location-copying-to-the-resource.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,158 @@ +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. + +--- + dlls/wined3d/resource.c | 38 ++++++++++++++++++++++++++++++++++++ + dlls/wined3d/surface.c | 51 ++++--------------------------------------------- + 2 files changed, 42 insertions(+), 47 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 9783b78..939377f 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -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. */ ++static void wined3d_resource_copy_simple_location(struct wined3d_resource *resource, ++ struct wined3d_context *context, DWORD location) ++{ ++ const struct wined3d_gl_info *gl_info; ++ struct wined3d_bo_address dst, src; ++ UINT size = resource->size; ++ ++ wined3d_resource_get_memory(resource, location, &dst); ++ wined3d_resource_get_memory(resource, resource->locations, &src); ++ ++ if (dst.buffer_object) ++ { ++ gl_info = context->gl_info; ++ 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(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; ++ } ++ memcpy(dst.addr, src.addr, size); ++} ++ ++/* Context activation is optionally by the caller. Context may be NULL. */ + void wined3d_resource_load_location(struct wined3d_resource *resource, + struct wined3d_context *context, DWORD location) + { +@@ -480,6 +512,12 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, + resource->locations |= location; + return; + } ++ if (resource->locations & simple_locations) ++ { ++ wined3d_resource_copy_simple_location(resource, context, location); ++ resource->locations |= location; ++ return; ++ } + } + + /* Context is NULL in ddraw-only operation without OpenGL. */ +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index b197655..b620b02 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -36,10 +36,6 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); + + #define MAXLOCKCOUNT 50 /* After this amount of locks do not free the sysmem copy. */ + +-static const DWORD surface_simple_locations = +- WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_USER_MEMORY +- | WINED3D_LOCATION_DIB | WINED3D_LOCATION_BUFFER; +- + static void surface_cleanup(struct wined3d_surface *surface) + { + struct wined3d_surface *overlay, *cur; +@@ -3986,54 +3982,12 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co + surface->ds_current_size.cy = surface->resource.height; + } + +-static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD location) +-{ +- struct wined3d_device *device = surface->resource.device; +- struct wined3d_context *context; +- const struct wined3d_gl_info *gl_info; +- struct wined3d_bo_address dst, src; +- UINT size = surface->resource.size; +- +- wined3d_resource_get_memory(&surface->resource, location, &dst); +- wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &src); +- +- if (dst.buffer_object) +- { +- context = context_acquire(device, NULL); +- gl_info = context->gl_info; +- 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; +- } +- if (src.buffer_object) +- { +- context = context_acquire(device, NULL); +- gl_info = context->gl_info; +- 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; +- } +- memcpy(dst.addr, src.addr, size); +-} +- + /* Context activation is done by the caller. */ + static void surface_load_sysmem(struct wined3d_surface *surface, + struct wined3d_context *context, DWORD dst_location) + { + const struct wined3d_gl_info *gl_info = context->gl_info; + +- if (surface->resource.locations & surface_simple_locations) +- { +- surface_copy_simple_location(surface, dst_location); +- return; +- } +- + if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) + wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); + +@@ -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; ++ const DWORD simple_locations = ++ WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_USER_MEMORY ++ | WINED3D_LOCATION_DIB | WINED3D_LOCATION_BUFFER; + + if (surface->resource.locations & WINED3D_LOCATION_DISCARDED) + { +@@ -4172,7 +4129,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + } + } + +- if (!(surface->resource.locations & surface_simple_locations)) ++ if (!(surface->resource.locations & simple_locations)) + { + WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); + /* Lets hope we get it from somewhere... */ +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0039-wined3d-Use-resource_map-for-surface_map.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0039-wined3d-Use-resource_map-for-surface_map.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0039-wined3d-Use-resource_map-for-surface_map.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0039-wined3d-Use-resource_map-for-surface_map.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,197 +0,0 @@ -From 72f318318de11be998fbbf707dadeb204d51c899 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 19 Sep 2013 18:00:23 +0200 -Subject: wined3d: Use resource_map for surface_map. - ---- - dlls/wined3d/resource.c | 2 +- - dlls/wined3d/surface.c | 102 +++++++----------------------------------------- - dlls/wined3d/volume.c | 7 +++- - 3 files changed, 22 insertions(+), 89 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index ba18baa..e5644ce 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -858,7 +858,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - if (!resource->map_count) - { - WARN("Trying to unlock an unlocked resource %p.\n", resource); -- return WINED3DERR_INVALIDCALL; -+ return WINEDDERR_NOTLOCKED; - } - - if (device->d3d_initialized) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index f117013..a331e37 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -2476,47 +2476,26 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso - - HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) - { -- struct wined3d_device *device = surface->resource.device; -- struct wined3d_context *context = NULL; -+ HRESULT hr; - TRACE("surface %p.\n", surface); - -- if (!surface->resource.map_count) -- { -- WARN("Trying to unmap unmapped surface.\n"); -- return WINEDDERR_NOTLOCKED; -- } -- --surface->resource.map_count; -- -- if (device->d3d_initialized) -- context = context_acquire(device, NULL); -- wined3d_resource_release_map_ptr(&surface->resource, context); -- if (context) -- context_release(context); -+ hr = wined3d_resource_unmap(&surface->resource); -+ if (FAILED(hr)) -+ return hr; - - if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) - surface->surface_ops->surface_frontbuffer_updated(surface); - memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); - -- return WINED3D_OK; -+ return hr; - } - - HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - struct wined3d_map_desc *map_desc, const RECT *rect, DWORD flags) - { -+ struct wined3d_box box; - const struct wined3d_format *format = surface->resource.format; - unsigned int fmt_flags = surface->container->resource.format_flags; -- struct wined3d_device *device = surface->resource.device; -- struct wined3d_context *context = NULL; -- BYTE *base_memory; -- -- TRACE("surface %p, map_desc %p, rect %s, flags %#x.\n", -- surface, map_desc, wine_dbgstr_rect(rect), flags); -- -- if (surface->resource.map_count) -- { -- WARN("Surface is already mapped.\n"); -- return WINED3DERR_INVALIDCALL; -- } - - if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && rect - && !surface_check_block_align(surface, rect)) -@@ -2528,11 +2507,6 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - return WINED3DERR_INVALIDCALL; - } - -- ++surface->resource.map_count; -- -- if (!(surface->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU)) -- WARN("Trying to lock unlockable surface.\n"); -- - /* Performance optimization: Count how often a surface is mapped, if it is - * mapped regularly do not throw away the system memory copy. This avoids - * the need to download the surface from OpenGL all the time. The surface -@@ -2548,72 +2522,26 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - } - } - -- if (device->d3d_initialized) -- context = context_acquire(device, NULL); -- -- wined3d_resource_prepare_map_memory(&surface->resource, context); -- if (flags & WINED3D_MAP_DISCARD) -- { -- TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n", -- wined3d_debug_location(surface->resource.map_binding)); -- wined3d_resource_validate_location(&surface->resource, surface->resource.map_binding); -- } -- else -+ if (rect) - { -- if (surface->resource.usage & WINED3DUSAGE_DYNAMIC) -- WARN_(d3d_perf)("Mapping a dynamic surface without WINED3D_MAP_DISCARD.\n"); -+ surface->lockedRect = *rect; - -- wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); -+ box.left = rect->left; -+ box.top = rect->top; -+ box.front = 0; -+ box.right = rect->right; -+ box.bottom = rect->bottom; -+ box.back = 1; - } -- -- if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) -- wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); -- -- base_memory = wined3d_resource_get_map_ptr(&surface->resource, context, flags); -- -- if (context) -- context_release(context); -- -- if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) -- map_desc->row_pitch = surface->resource.width * format->byte_count; - else -- wined3d_resource_get_pitch(&surface->resource, &map_desc->row_pitch, &map_desc->slice_pitch); -- map_desc->slice_pitch = 0; -- -- if (!rect) - { -- map_desc->data = base_memory; - surface->lockedRect.left = 0; - surface->lockedRect.top = 0; - surface->lockedRect.right = surface->resource.width; - surface->lockedRect.bottom = surface->resource.height; - } -- else -- { -- if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) -- { -- /* Compressed textures are block based, so calculate the offset of -- * the block that contains the top-left pixel of the locked rectangle. */ -- map_desc->data = base_memory -- + ((rect->top / format->block_height) * map_desc->row_pitch) -- + ((rect->left / format->block_width) * format->block_byte_count); -- } -- else -- { -- map_desc->data = base_memory -- + (map_desc->row_pitch * rect->top) -- + (rect->left * format->byte_count); -- } -- surface->lockedRect.left = rect->left; -- surface->lockedRect.top = rect->top; -- surface->lockedRect.right = rect->right; -- surface->lockedRect.bottom = rect->bottom; -- } -- -- TRACE("Locked rect %s.\n", wine_dbgstr_rect(&surface->lockedRect)); -- TRACE("Returning memory %p, pitch %u.\n", map_desc->data, map_desc->row_pitch); - -- return WINED3D_OK; -+ return wined3d_resource_map(&surface->resource, map_desc, rect ? &box : NULL, flags); - } - - HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index dd49d01..01ee33c 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -441,7 +441,12 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour - - HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) - { -- return wined3d_resource_unmap(&volume->resource); -+ HRESULT hr; -+ -+ hr = wined3d_resource_unmap(&volume->resource); -+ if (hr == WINEDDERR_NOTLOCKED) -+ return WINED3DERR_INVALIDCALL; -+ return hr; - } - - static ULONG volume_resource_incref(struct wined3d_resource *resource) --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0040-wined3d-Move-most-of-volume_map-to-resource.c.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0040-wined3d-Move-most-of-volume_map-to-resource.c.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0040-wined3d-Move-most-of-volume_map-to-resource.c.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0040-wined3d-Move-most-of-volume_map-to-resource.c.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,296 @@ +From 2ae05213ea4af0cb5725b2b88b51bd7ef2f893c5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 19 Sep 2013 17:51:38 +0200 +Subject: wined3d: Move most of volume_map to resource.c + +The CPU access check can be moved once surfaces don't have to lock for +sysmem blits. Surfaces and volume have different block alignment and +boundary check behaviours. +--- + dlls/wined3d/resource.c | 115 +++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/volume.c | 101 +++--------------------------------- + dlls/wined3d/wined3d_private.h | 3 ++ + 3 files changed, 124 insertions(+), 95 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 11136de..ba18baa 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -756,3 +756,118 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, + + return TRUE; + } ++ ++HRESULT wined3d_resource_map(struct wined3d_resource *resource, ++ struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) ++{ ++ struct wined3d_device *device = resource->device; ++ struct wined3d_context *context = NULL; ++ BYTE *base_memory; ++ const struct wined3d_format *format = resource->format; ++ const unsigned int fmt_flags = resource->format_flags; ++ ++ TRACE("resource %p, map_desc %p, box %p, flags %#x.\n", ++ resource, map_desc, box, flags); ++ ++ if (resource->map_count) ++ { ++ WARN("Volume is already mapped.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ flags = wined3d_resource_sanitize_map_flags(resource, flags); ++ ++ if (device->d3d_initialized) ++ context = context_acquire(device, NULL); ++ ++ if (!wined3d_resource_prepare_map_memory(resource, context)) ++ { ++ WARN("Out of memory.\n"); ++ map_desc->data = NULL; ++ context_release(context); ++ return E_OUTOFMEMORY; ++ } ++ ++ if (flags & WINED3D_MAP_DISCARD) ++ wined3d_resource_validate_location(resource, resource->map_binding); ++ else ++ wined3d_resource_load_location(resource, context, resource->map_binding); ++ ++ base_memory = wined3d_resource_get_map_ptr(resource, context, flags); ++ ++ if (context) ++ context_release(context); ++ ++ TRACE("Base memory pointer %p.\n", base_memory); ++ ++ if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) ++ { ++ map_desc->row_pitch = resource->width * format->byte_count; ++ map_desc->slice_pitch = map_desc->row_pitch * resource->height; ++ } ++ else ++ { ++ wined3d_resource_get_pitch(resource, &map_desc->row_pitch, &map_desc->slice_pitch); ++ } ++ ++ if (!box) ++ { ++ TRACE("No box supplied - all is ok\n"); ++ map_desc->data = base_memory; ++ } ++ else ++ { ++ TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n", ++ box, box->left, box->top, box->right, box->bottom, box->front, box->back); ++ ++ if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) ++ { ++ /* Compressed textures are block based, so calculate the offset of ++ * the block that contains the top-left pixel of the locked rectangle. */ ++ map_desc->data = base_memory ++ + (box->front * map_desc->slice_pitch) ++ + ((box->top / format->block_height) * map_desc->row_pitch) ++ + ((box->left / format->block_width) * format->block_byte_count); ++ } ++ else ++ { ++ map_desc->data = base_memory ++ + (map_desc->slice_pitch * box->front) ++ + (map_desc->row_pitch * box->top) ++ + (box->left * format->byte_count); ++ } ++ } ++ ++ if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) ++ wined3d_resource_invalidate_location(resource, ~resource->map_binding); ++ ++ resource->map_count++; ++ ++ TRACE("Returning memory %p, row pitch %d, slice pitch %d.\n", ++ map_desc->data, map_desc->row_pitch, map_desc->slice_pitch); ++ ++ return WINED3D_OK; ++} ++ ++HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) ++{ ++ struct wined3d_device *device = resource->device; ++ struct wined3d_context *context = NULL; ++ TRACE("resource %p.\n", resource); ++ ++ if (!resource->map_count) ++ { ++ WARN("Trying to unlock an unlocked resource %p.\n", resource); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ if (device->d3d_initialized) ++ context = context_acquire(device, NULL); ++ wined3d_resource_release_map_ptr(resource, context); ++ if (context) ++ context_release(context); ++ ++ resource->map_count--; ++ ++ return WINED3D_OK; ++} +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index e70fcf4..dd49d01 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -404,26 +404,16 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol + HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) + { +- struct wined3d_device *device = volume->resource.device; +- struct wined3d_context *context; +- BYTE *base_memory; ++ HRESULT hr; + const struct wined3d_format *format = volume->resource.format; + const unsigned int fmt_flags = volume->container->resource.format_flags; + +- TRACE("volume %p, map_desc %p, box %p, flags %#x.\n", +- volume, map_desc, box, flags); +- + map_desc->data = NULL; + if (!(volume->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU)) + { + WARN("Volume %p is not CPU accessible.\n", volume); + return WINED3DERR_INVALIDCALL; + } +- if (volume->resource.map_count) +- { +- WARN("Volume is already mapped.\n"); +- return WINED3DERR_INVALIDCALL; +- } + if (!wined3d_volume_check_box_dimensions(volume, box)) + { + WARN("Map box is invalid.\n"); +@@ -437,74 +427,11 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + return WINED3DERR_INVALIDCALL; + } + +- flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags); +- +- context = context_acquire(device, NULL); +- if (!wined3d_resource_prepare_map_memory(&volume->resource, context)) +- { +- WARN("Out of memory.\n"); +- map_desc->data = NULL; +- context_release(context); +- return E_OUTOFMEMORY; +- } +- +- if (flags & WINED3D_MAP_DISCARD) +- wined3d_resource_validate_location(&volume->resource, volume->resource.map_binding); +- else +- wined3d_resource_load_location(&volume->resource, context, volume->resource.map_binding); +- +- base_memory = wined3d_resource_get_map_ptr(&volume->resource, context, flags); +- context_release(context); +- +- TRACE("Base memory pointer %p.\n", base_memory); +- +- if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) +- { +- map_desc->row_pitch = volume->resource.width * format->byte_count; +- map_desc->slice_pitch = map_desc->row_pitch * volume->resource.height; +- } +- else +- { +- wined3d_resource_get_pitch(&volume->resource, &map_desc->row_pitch, &map_desc->slice_pitch); +- } +- +- if (!box) +- { +- TRACE("No box supplied - all is ok\n"); +- map_desc->data = base_memory; +- } +- else +- { +- TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n", +- box, box->left, box->top, box->right, box->bottom, box->front, box->back); +- +- if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) +- { +- /* Compressed textures are block based, so calculate the offset of +- * the block that contains the top-left pixel of the locked rectangle. */ +- map_desc->data = base_memory +- + (box->front * map_desc->slice_pitch) +- + ((box->top / format->block_height) * map_desc->row_pitch) +- + ((box->left / format->block_width) * format->block_byte_count); +- } +- else +- { +- map_desc->data = base_memory +- + (map_desc->slice_pitch * box->front) +- + (map_desc->row_pitch * box->top) +- + (box->left * volume->resource.format->byte_count); +- } +- } +- +- if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) +- wined3d_resource_invalidate_location(&volume->resource, ~volume->resource.map_binding); +- +- volume->resource.map_count++; +- +- TRACE("Returning memory %p, row pitch %d, slice pitch %d.\n", +- map_desc->data, map_desc->row_pitch, map_desc->slice_pitch); ++ hr = wined3d_resource_map(&volume->resource, map_desc, box, flags); ++ if (FAILED(hr)) ++ return hr; + +- return WINED3D_OK; ++ return hr; + } + + struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resource *resource) +@@ -514,23 +441,7 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour + + HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) + { +- struct wined3d_device *device = volume->resource.device; +- struct wined3d_context *context; +- TRACE("volume %p.\n", volume); +- +- if (!volume->resource.map_count) +- { +- WARN("Trying to unlock an unlocked volume %p.\n", volume); +- return WINED3DERR_INVALIDCALL; +- } +- +- context = context_acquire(device, NULL); +- wined3d_resource_release_map_ptr(&volume->resource, context); +- context_release(context); +- +- volume->resource.map_count--; +- +- return WINED3D_OK; ++ return wined3d_resource_unmap(&volume->resource); + } + + static ULONG volume_resource_incref(struct wined3d_resource *resource) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 8c511c1..9d33eb6 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2182,12 +2182,15 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO + BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_load_location(struct wined3d_resource *resource, + struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; ++HRESULT wined3d_resource_map(struct wined3d_resource *resource, struct wined3d_map_desc *map_desc, ++ const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN; + BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, + struct wined3d_context *context) DECLSPEC_HIDDEN; + BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, + const struct wined3d_context *context) DECLSPEC_HIDDEN; + DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; ++HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; + +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0040-wined3d-Use-client-storage-with-DIB-sections.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0040-wined3d-Use-client-storage-with-DIB-sections.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0040-wined3d-Use-client-storage-with-DIB-sections.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0040-wined3d-Use-client-storage-with-DIB-sections.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -From e2500c76e7b1b762eeb610d580ce90eec9798773 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 21 Jan 2014 17:06:20 +0100 -Subject: wined3d: Use client storage with DIB sections. - -Now that DIBs are a separate location, we can keep the sysmem around for -OpenGL's use. ---- - dlls/wined3d/surface.c | 27 --------------------------- - dlls/wined3d/texture.c | 3 +-- - 2 files changed, 1 insertion(+), 29 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 16233d3..303a0dc 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -484,28 +484,6 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) - wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); - } - --static void surface_release_client_storage(struct wined3d_surface *surface) --{ -- struct wined3d_context *context = context_acquire(surface->resource.device, NULL); -- const struct wined3d_gl_info *gl_info = context->gl_info; -- -- if (surface->container->texture_rgb.name) -- { -- wined3d_texture_bind_and_dirtify(surface->container, context, FALSE); -- gl_info->gl_ops.gl.p_glTexImage2D(surface->texture_target, surface->texture_level, -- GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); -- } -- if (surface->container->texture_srgb.name) -- { -- wined3d_texture_bind_and_dirtify(surface->container, context, TRUE); -- gl_info->gl_ops.gl.p_glTexImage2D(surface->texture_target, surface->texture_level, -- GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); -- } -- wined3d_texture_force_reload(surface->container); -- -- context_release(context); --} -- - static BOOL surface_use_pbo(const struct wined3d_surface *surface) - { - const struct wined3d_gl_info *gl_info = &surface->resource.device->adapter->gl_info; -@@ -2483,11 +2461,6 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - /* Create a DIB section if there isn't a dc yet. */ - if (!surface->hDC) - { -- if (surface->flags & SFLAG_CLIENT) -- { -- wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); -- surface_release_client_storage(surface); -- } - hr = surface_create_dib_section(surface); - if (FAILED(hr)) - { -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 429eb89..ec5c847 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -903,12 +903,11 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi - - if (gl_info->supported[APPLE_CLIENT_STORAGE]) - { -- if (surface->flags & (SFLAG_NONPOW2 | SFLAG_DIBSECTION) -+ if (surface->flags & (SFLAG_NONPOW2) - || texture->flags & WINED3D_TEXTURE_CONVERTED) - { - /* In some cases we want to disable client storage. - * SFLAG_NONPOW2 has a bigger opengl texture than the client memory, and different pitches -- * SFLAG_DIBSECTION: Dibsections may have read / write protections on the memory. Avoid issues... - * WINED3D_TEXTURE_CONVERTED: The conversion destination memory is freed after loading the surface - * heap_memory == NULL: Not defined in the extension. Seems to disable client storage effectively - */ --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0041-wined3d-Don-t-call-the-public-map-function-in-surfac.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0041-wined3d-Don-t-call-the-public-map-function-in-surfac.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0041-wined3d-Don-t-call-the-public-map-function-in-surfac.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0041-wined3d-Don-t-call-the-public-map-function-in-surfac.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -From 89a2597787017d7bc966c2a146fa4c4fc59e9ebb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 23 Sep 2013 23:58:41 +0200 -Subject: wined3d: Don't call the public map function in - surface_convert_format. - -TODO: Creating a helper surface and releasing it won't work with the CS. -surface_cpu_blt will be called via the CS, so it can't call external -methods that enqueue commands in the stream. ---- - dlls/wined3d/surface.c | 57 +++++++++++++++++++++++++++++++++----------------- - 1 file changed, 38 insertions(+), 19 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 303a0dc..045ede5 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -2253,11 +2253,14 @@ static inline const struct d3dfmt_converter_desc *find_converter(enum wined3d_fo - - static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) - { -- struct wined3d_map_desc src_map, dst_map; -+ void *dst_data = NULL, *src_data = NULL; -+ UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; - const struct d3dfmt_converter_desc *conv; - struct wined3d_texture *ret = NULL; - struct wined3d_resource_desc desc; - struct wined3d_surface *dst; -+ struct wined3d_context *context = NULL; -+ struct wined3d_device *device = source->resource.device; - - conv = find_converter(source->resource.format->id, to_fmt); - if (!conv) -@@ -2281,30 +2284,46 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *so - } - dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); - -- memset(&src_map, 0, sizeof(src_map)); -- memset(&dst_map, 0, sizeof(dst_map)); -+ wined3d_resource_get_pitch(&source->resource, &src_row_pitch, &src_slice_pitch); -+ wined3d_resource_get_pitch(&ret->resource, &dst_row_pitch, &dst_slice_pitch); - -- if (FAILED(wined3d_surface_map(source, &src_map, NULL, WINED3D_MAP_READONLY))) -- { -- ERR("Failed to lock the source surface.\n"); -- wined3d_texture_decref(ret); -- return NULL; -- } -- if (FAILED(wined3d_surface_map(dst, &dst_map, NULL, 0))) -- { -- ERR("Failed to lock the destination surface.\n"); -- wined3d_surface_unmap(source); -- wined3d_texture_decref(ret); -- return NULL; -- } -+ if (device->d3d_initialized) -+ context = context_acquire(device, NULL); -+ -+ wined3d_resource_load_location(&source->resource, context, source->resource.map_binding); -+ src_data = wined3d_resource_get_map_ptr(&source->resource, context, WINED3D_MAP_READONLY); -+ if (!src_data) -+ goto error; - -- conv->convert(src_map.data, dst_map.data, src_map.row_pitch, dst_map.row_pitch, -+ if (!wined3d_resource_prepare_map_memory(&dst->resource, context)) -+ goto error; -+ dst_data = wined3d_resource_get_map_ptr(&dst->resource, context, 0); -+ if (!dst_data) -+ goto error; -+ -+ conv->convert(src_data, dst_data, src_row_pitch, dst_row_pitch, - source->resource.width, source->resource.height); - -- wined3d_surface_unmap(dst); -- wined3d_surface_unmap(source); -+ wined3d_resource_release_map_ptr(&dst->resource, context); -+ wined3d_resource_release_map_ptr(&source->resource, context); -+ -+ if (context) -+ context_release(context); - - return ret; -+ -+error: -+ ERR("Surface conversion failed.\n"); -+ -+ if (src_data) -+ wined3d_resource_release_map_ptr(&source->resource, context); -+ if (dst_data) -+ wined3d_resource_release_map_ptr(&ret->resource, context); -+ if (ret) -+ wined3d_texture_decref(ret); -+ if (context) -+ context_release(context); -+ return NULL; - } - - static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height, --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0041-wined3d-Use-resource_map-for-surface_map.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0041-wined3d-Use-resource_map-for-surface_map.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0041-wined3d-Use-resource_map-for-surface_map.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0041-wined3d-Use-resource_map-for-surface_map.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,197 @@ +From 72f318318de11be998fbbf707dadeb204d51c899 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 19 Sep 2013 18:00:23 +0200 +Subject: wined3d: Use resource_map for surface_map. + +--- + dlls/wined3d/resource.c | 2 +- + dlls/wined3d/surface.c | 102 +++++++----------------------------------------- + dlls/wined3d/volume.c | 7 +++- + 3 files changed, 22 insertions(+), 89 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index ba18baa..e5644ce 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -858,7 +858,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + if (!resource->map_count) + { + WARN("Trying to unlock an unlocked resource %p.\n", resource); +- return WINED3DERR_INVALIDCALL; ++ return WINEDDERR_NOTLOCKED; + } + + if (device->d3d_initialized) +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index f117013..a331e37 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -2476,47 +2476,26 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso + + HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + { +- struct wined3d_device *device = surface->resource.device; +- struct wined3d_context *context = NULL; ++ HRESULT hr; + TRACE("surface %p.\n", surface); + +- if (!surface->resource.map_count) +- { +- WARN("Trying to unmap unmapped surface.\n"); +- return WINEDDERR_NOTLOCKED; +- } +- --surface->resource.map_count; +- +- if (device->d3d_initialized) +- context = context_acquire(device, NULL); +- wined3d_resource_release_map_ptr(&surface->resource, context); +- if (context) +- context_release(context); ++ hr = wined3d_resource_unmap(&surface->resource); ++ if (FAILED(hr)) ++ return hr; + + if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) + surface->surface_ops->surface_frontbuffer_updated(surface); + memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); + +- return WINED3D_OK; ++ return hr; + } + + HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + struct wined3d_map_desc *map_desc, const RECT *rect, DWORD flags) + { ++ struct wined3d_box box; + const struct wined3d_format *format = surface->resource.format; + unsigned int fmt_flags = surface->container->resource.format_flags; +- struct wined3d_device *device = surface->resource.device; +- struct wined3d_context *context = NULL; +- BYTE *base_memory; +- +- TRACE("surface %p, map_desc %p, rect %s, flags %#x.\n", +- surface, map_desc, wine_dbgstr_rect(rect), flags); +- +- if (surface->resource.map_count) +- { +- WARN("Surface is already mapped.\n"); +- return WINED3DERR_INVALIDCALL; +- } + + if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && rect + && !surface_check_block_align(surface, rect)) +@@ -2528,11 +2507,6 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + return WINED3DERR_INVALIDCALL; + } + +- ++surface->resource.map_count; +- +- if (!(surface->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU)) +- WARN("Trying to lock unlockable surface.\n"); +- + /* Performance optimization: Count how often a surface is mapped, if it is + * mapped regularly do not throw away the system memory copy. This avoids + * the need to download the surface from OpenGL all the time. The surface +@@ -2548,72 +2522,26 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + } + } + +- if (device->d3d_initialized) +- context = context_acquire(device, NULL); +- +- wined3d_resource_prepare_map_memory(&surface->resource, context); +- if (flags & WINED3D_MAP_DISCARD) +- { +- TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n", +- wined3d_debug_location(surface->resource.map_binding)); +- wined3d_resource_validate_location(&surface->resource, surface->resource.map_binding); +- } +- else ++ if (rect) + { +- if (surface->resource.usage & WINED3DUSAGE_DYNAMIC) +- WARN_(d3d_perf)("Mapping a dynamic surface without WINED3D_MAP_DISCARD.\n"); ++ surface->lockedRect = *rect; + +- wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); ++ box.left = rect->left; ++ box.top = rect->top; ++ box.front = 0; ++ box.right = rect->right; ++ box.bottom = rect->bottom; ++ box.back = 1; + } +- +- if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) +- wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); +- +- base_memory = wined3d_resource_get_map_ptr(&surface->resource, context, flags); +- +- if (context) +- context_release(context); +- +- if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) +- map_desc->row_pitch = surface->resource.width * format->byte_count; + else +- wined3d_resource_get_pitch(&surface->resource, &map_desc->row_pitch, &map_desc->slice_pitch); +- map_desc->slice_pitch = 0; +- +- if (!rect) + { +- map_desc->data = base_memory; + surface->lockedRect.left = 0; + surface->lockedRect.top = 0; + surface->lockedRect.right = surface->resource.width; + surface->lockedRect.bottom = surface->resource.height; + } +- else +- { +- if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) +- { +- /* Compressed textures are block based, so calculate the offset of +- * the block that contains the top-left pixel of the locked rectangle. */ +- map_desc->data = base_memory +- + ((rect->top / format->block_height) * map_desc->row_pitch) +- + ((rect->left / format->block_width) * format->block_byte_count); +- } +- else +- { +- map_desc->data = base_memory +- + (map_desc->row_pitch * rect->top) +- + (rect->left * format->byte_count); +- } +- surface->lockedRect.left = rect->left; +- surface->lockedRect.top = rect->top; +- surface->lockedRect.right = rect->right; +- surface->lockedRect.bottom = rect->bottom; +- } +- +- TRACE("Locked rect %s.\n", wine_dbgstr_rect(&surface->lockedRect)); +- TRACE("Returning memory %p, pitch %u.\n", map_desc->data, map_desc->row_pitch); + +- return WINED3D_OK; ++ return wined3d_resource_map(&surface->resource, map_desc, rect ? &box : NULL, flags); + } + + HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index dd49d01..01ee33c 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -441,7 +441,12 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour + + HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) + { +- return wined3d_resource_unmap(&volume->resource); ++ HRESULT hr; ++ ++ hr = wined3d_resource_unmap(&volume->resource); ++ if (hr == WINEDDERR_NOTLOCKED) ++ return WINED3DERR_INVALIDCALL; ++ return hr; + } + + static ULONG volume_resource_incref(struct wined3d_resource *resource) +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0042-wined3d-Don-t-call-the-public-map-function-in-surfac.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0042-wined3d-Don-t-call-the-public-map-function-in-surfac.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0042-wined3d-Don-t-call-the-public-map-function-in-surfac.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0042-wined3d-Don-t-call-the-public-map-function-in-surfac.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,277 +0,0 @@ -From 9d0010d5add477e39747ac3e458d16b5b1fa101f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 24 Sep 2013 00:31:39 +0200 -Subject: wined3d: Don't call the public map function in surface_cpu_blt. - ---- - dlls/wined3d/surface.c | 107 +++++++++++++++++++++++++++++++++---------------- - 1 file changed, 72 insertions(+), 35 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index ff83f29..df8aea6 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -4428,21 +4428,36 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - const struct wined3d_format *src_format, *dst_format; - unsigned int src_fmt_flags, dst_fmt_flags; - struct wined3d_texture *src_texture = NULL; -- struct wined3d_map_desc dst_map, src_map; -+ void *src_data = NULL, *dst_data = NULL; -+ UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; - const BYTE *sbase = NULL; - HRESULT hr = WINED3D_OK; - const BYTE *sbuf; - BYTE *dbuf; - int x, y; -+ struct wined3d_device *device = dst_surface->resource.device; -+ struct wined3d_context *context = NULL; - - TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n", - dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), - flags, fx, debug_d3dtexturefiltertype(filter)); - -+ if (device->d3d_initialized) -+ context = context_acquire(device, NULL); -+ -+ if (!wined3d_resource_prepare_map_memory(&dst_surface->resource, context)) -+ { -+ hr = E_OUTOFMEMORY; -+ goto error; -+ } -+ wined3d_resource_load_location(&dst_surface->resource, context, dst_surface->resource.map_binding); -+ - if (src_surface == dst_surface) - { -- wined3d_surface_map(dst_surface, &dst_map, NULL, 0); -- src_map = dst_map; -+ dst_data = wined3d_resource_get_map_ptr(&dst_surface->resource, context, 0); -+ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); -+ src_data = dst_data; -+ src_row_pitch = dst_row_pitch; - src_format = dst_surface->resource.format; - dst_format = src_format; - dst_fmt_flags = dst_surface->container->resource.format_flags; -@@ -4454,6 +4469,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - dst_fmt_flags = dst_surface->container->resource.format_flags; - if (src_surface) - { -+ if (!wined3d_resource_prepare_map_memory(&src_surface->resource, context)) -+ { -+ hr = E_OUTOFMEMORY; -+ goto error; -+ } -+ - if (dst_surface->resource.format->id != src_surface->resource.format->id) - { - if (!(src_texture = surface_convert_format(src_surface, dst_format->id))) -@@ -4464,7 +4485,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - } - src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); - } -- wined3d_surface_map(src_surface, &src_map, NULL, WINED3D_MAP_READONLY); -+ wined3d_resource_load_location(&src_surface->resource, context, src_surface->resource.map_binding); -+ wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); -+ src_data = wined3d_resource_get_map_ptr(&src_surface->resource, context, 0); - src_format = src_surface->resource.format; - src_fmt_flags = src_surface->container->resource.format_flags; - } -@@ -4474,7 +4497,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - src_fmt_flags = dst_fmt_flags; - } - -- wined3d_surface_map(dst_surface, &dst_map, dst_rect, 0); -+ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); -+ dst_data = wined3d_resource_get_map_ptr(&dst_surface->resource, context, 0); - } - - bpp = dst_surface->resource.format->byte_count; -@@ -4485,15 +4509,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - width = (dst_rect->right - dst_rect->left) * bpp; - - if (src_surface) -- sbase = (BYTE *)src_map.data -- + ((src_rect->top / src_format->block_height) * src_map.row_pitch) -+ sbase = (BYTE *)src_data -+ + ((src_rect->top / src_format->block_height) * src_row_pitch) - + ((src_rect->left / src_format->block_width) * src_format->block_byte_count); -- if (src_surface != dst_surface) -- dbuf = dst_map.data; -- else -- dbuf = (BYTE *)dst_map.data -- + ((dst_rect->top / dst_format->block_height) * dst_map.row_pitch) -- + ((dst_rect->left / dst_format->block_width) * dst_format->block_byte_count); -+ dbuf = (BYTE *)dst_data -+ + ((dst_rect->top / dst_format->block_height) * dst_row_pitch) -+ + ((dst_rect->left / dst_format->block_width) * dst_format->block_byte_count); - - if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) - { -@@ -4528,7 +4549,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - } - - hr = surface_cpu_blt_compressed(sbase, dbuf, -- src_map.row_pitch, dst_map.row_pitch, dstwidth, dstheight, -+ src_row_pitch, dst_row_pitch, dstwidth, dstheight, - src_format, flags, fx); - goto release; - } -@@ -4536,7 +4557,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - /* First, all the 'source-less' blits */ - if (flags & WINEDDBLT_COLORFILL) - { -- hr = _Blt_ColorFill(dbuf, dstwidth, dstheight, bpp, dst_map.row_pitch, fx->u5.dwFillColor); -+ hr = _Blt_ColorFill(dbuf, dstwidth, dstheight, bpp, dst_row_pitch, fx->u5.dwFillColor); - flags &= ~WINEDDBLT_COLORFILL; - } - -@@ -4585,19 +4606,19 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - for (y = 0; y < dstheight; ++y) - { - memcpy(dbuf, sbuf, width); -- sbuf += src_map.row_pitch; -- dbuf += dst_map.row_pitch; -+ sbuf += src_row_pitch; -+ dbuf += dst_row_pitch; - } - } - else if (dst_rect->top > src_rect->top) - { - /* Copy from bottom upwards. */ -- sbuf += src_map.row_pitch * dstheight; -- dbuf += dst_map.row_pitch * dstheight; -+ sbuf += src_row_pitch * dstheight; -+ dbuf += dst_row_pitch * dstheight; - for (y = 0; y < dstheight; ++y) - { -- sbuf -= src_map.row_pitch; -- dbuf -= dst_map.row_pitch; -+ sbuf -= src_row_pitch; -+ dbuf -= dst_row_pitch; - memcpy(dbuf, sbuf, width); - } - } -@@ -4607,8 +4628,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - for (y = 0; y < dstheight; ++y) - { - memmove(dbuf, sbuf, width); -- sbuf += src_map.row_pitch; -- dbuf += dst_map.row_pitch; -+ sbuf += src_row_pitch; -+ dbuf += dst_row_pitch; - } - } - } -@@ -4617,9 +4638,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - /* Stretching in y direction only. */ - for (y = sy = 0; y < dstheight; ++y, sy += yinc) - { -- sbuf = sbase + (sy >> 16) * src_map.row_pitch; -+ sbuf = sbase + (sy >> 16) * src_row_pitch; - memcpy(dbuf, sbuf, width); -- dbuf += dst_map.row_pitch; -+ dbuf += dst_row_pitch; - } - } - } -@@ -4629,13 +4650,13 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * - int last_sy = -1; - for (y = sy = 0; y < dstheight; ++y, sy += yinc) - { -- sbuf = sbase + (sy >> 16) * src_map.row_pitch; -+ sbuf = sbase + (sy >> 16) * src_row_pitch; - - if ((sy >> 16) == (last_sy >> 16)) - { - /* This source row is the same as last source row - - * Copy the already stretched row. */ -- memcpy(dbuf, dbuf - dst_map.row_pitch, width); -+ memcpy(dbuf, dbuf - dst_row_pitch, width); - } - else - { -@@ -4682,14 +4703,14 @@ do { \ - } - #undef STRETCH_ROW - } -- dbuf += dst_map.row_pitch; -+ dbuf += dst_row_pitch; - last_sy = sy; - } - } - } - else - { -- LONG dstyinc = dst_map.row_pitch, dstxinc = bpp; -+ LONG dstyinc = dst_row_pitch, dstxinc = bpp; - DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff; - DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff; - if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE)) -@@ -4739,7 +4760,7 @@ do { \ - LONG tmpxy; - dTopLeft = dbuf; - dTopRight = dbuf + ((dstwidth - 1) * bpp); -- dBottomLeft = dTopLeft + ((dstheight - 1) * dst_map.row_pitch); -+ dBottomLeft = dTopLeft + ((dstheight - 1) * dst_row_pitch); - dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); - - if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4822,7 +4843,7 @@ do { \ - type *d = (type *)dbuf, *dx, tmp; \ - for (y = sy = 0; y < dstheight; ++y, sy += yinc) \ - { \ -- s = (const type *)(sbase + (sy >> 16) * src_map.row_pitch); \ -+ s = (const type *)(sbase + (sy >> 16) * src_row_pitch); \ - dx = d; \ - for (x = sx = 0; x < dstwidth; ++x, sx += xinc) \ - { \ -@@ -4855,7 +4876,7 @@ do { \ - BYTE *d = dbuf, *dx; - for (y = sy = 0; y < dstheight; ++y, sy += yinc) - { -- sbuf = sbase + (sy >> 16) * src_map.row_pitch; -+ sbuf = sbase + (sy >> 16) * src_row_pitch; - dx = d; - for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) - { -@@ -4886,6 +4907,10 @@ do { \ - } - } - -+ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->resource.map_binding); -+ if (dst_surface->container) -+ wined3d_texture_set_dirty(dst_surface->container); -+ - error: - if (flags && FIXME_ON(d3d_surface)) - { -@@ -4893,12 +4918,24 @@ error: - } - - release: -- wined3d_surface_unmap(dst_surface); -- if (src_surface && src_surface != dst_surface) -- wined3d_surface_unmap(src_surface); -+ if (dst_data) -+ { -+ wined3d_resource_release_map_ptr(&dst_surface->resource, context); -+ -+ if (dst_surface->container->swapchain -+ && dst_surface->container == dst_surface->container->swapchain->front_buffer) -+ { -+ dst_surface->lockedRect = *dst_rect; -+ dst_surface->surface_ops->surface_frontbuffer_updated(dst_surface); -+ } -+ } -+ if (src_surface && src_surface != dst_surface && src_data) -+ wined3d_resource_release_map_ptr(&src_surface->resource, context); - /* Release the converted surface, if any. */ - if (src_texture) - wined3d_texture_decref(src_texture); -+ if (context) -+ context_release(context); - - return hr; - } --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0042-wined3d-Use-client-storage-with-DIB-sections.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0042-wined3d-Use-client-storage-with-DIB-sections.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0042-wined3d-Use-client-storage-with-DIB-sections.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0042-wined3d-Use-client-storage-with-DIB-sections.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,78 @@ +From e2500c76e7b1b762eeb610d580ce90eec9798773 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 21 Jan 2014 17:06:20 +0100 +Subject: wined3d: Use client storage with DIB sections. + +Now that DIBs are a separate location, we can keep the sysmem around for +OpenGL's use. +--- + dlls/wined3d/surface.c | 27 --------------------------- + dlls/wined3d/texture.c | 3 +-- + 2 files changed, 1 insertion(+), 29 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 16233d3..303a0dc 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -484,28 +484,6 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) + wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); + } + +-static void surface_release_client_storage(struct wined3d_surface *surface) +-{ +- struct wined3d_context *context = context_acquire(surface->resource.device, NULL); +- const struct wined3d_gl_info *gl_info = context->gl_info; +- +- if (surface->container->texture_rgb.name) +- { +- wined3d_texture_bind_and_dirtify(surface->container, context, FALSE); +- gl_info->gl_ops.gl.p_glTexImage2D(surface->texture_target, surface->texture_level, +- GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); +- } +- if (surface->container->texture_srgb.name) +- { +- wined3d_texture_bind_and_dirtify(surface->container, context, TRUE); +- gl_info->gl_ops.gl.p_glTexImage2D(surface->texture_target, surface->texture_level, +- GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); +- } +- wined3d_texture_force_reload(surface->container); +- +- context_release(context); +-} +- + static BOOL surface_use_pbo(const struct wined3d_surface *surface) + { + const struct wined3d_gl_info *gl_info = &surface->resource.device->adapter->gl_info; +@@ -2483,11 +2461,6 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) + /* Create a DIB section if there isn't a dc yet. */ + if (!surface->hDC) + { +- if (surface->flags & SFLAG_CLIENT) +- { +- wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); +- surface_release_client_storage(surface); +- } + hr = surface_create_dib_section(surface); + if (FAILED(hr)) + { +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 429eb89..ec5c847 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -903,12 +903,11 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi + + if (gl_info->supported[APPLE_CLIENT_STORAGE]) + { +- if (surface->flags & (SFLAG_NONPOW2 | SFLAG_DIBSECTION) ++ if (surface->flags & (SFLAG_NONPOW2) + || texture->flags & WINED3D_TEXTURE_CONVERTED) + { + /* In some cases we want to disable client storage. + * SFLAG_NONPOW2 has a bigger opengl texture than the client memory, and different pitches +- * SFLAG_DIBSECTION: Dibsections may have read / write protections on the memory. Avoid issues... + * WINED3D_TEXTURE_CONVERTED: The conversion destination memory is freed after loading the surface + * heap_memory == NULL: Not defined in the extension. Seems to disable client storage effectively + */ +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0043-wined3d-Don-t-call-the-public-map-function-in-surfac.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0043-wined3d-Don-t-call-the-public-map-function-in-surfac.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0043-wined3d-Don-t-call-the-public-map-function-in-surfac.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0043-wined3d-Don-t-call-the-public-map-function-in-surfac.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,101 @@ +From 89a2597787017d7bc966c2a146fa4c4fc59e9ebb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Mon, 23 Sep 2013 23:58:41 +0200 +Subject: wined3d: Don't call the public map function in + surface_convert_format. + +TODO: Creating a helper surface and releasing it won't work with the CS. +surface_cpu_blt will be called via the CS, so it can't call external +methods that enqueue commands in the stream. +--- + dlls/wined3d/surface.c | 57 +++++++++++++++++++++++++++++++++----------------- + 1 file changed, 38 insertions(+), 19 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 303a0dc..045ede5 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -2253,11 +2253,14 @@ static inline const struct d3dfmt_converter_desc *find_converter(enum wined3d_fo + + static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) + { +- struct wined3d_map_desc src_map, dst_map; ++ void *dst_data = NULL, *src_data = NULL; ++ UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; + const struct d3dfmt_converter_desc *conv; + struct wined3d_texture *ret = NULL; + struct wined3d_resource_desc desc; + struct wined3d_surface *dst; ++ struct wined3d_context *context = NULL; ++ struct wined3d_device *device = source->resource.device; + + conv = find_converter(source->resource.format->id, to_fmt); + if (!conv) +@@ -2281,30 +2284,46 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *so + } + dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); + +- memset(&src_map, 0, sizeof(src_map)); +- memset(&dst_map, 0, sizeof(dst_map)); ++ wined3d_resource_get_pitch(&source->resource, &src_row_pitch, &src_slice_pitch); ++ wined3d_resource_get_pitch(&ret->resource, &dst_row_pitch, &dst_slice_pitch); + +- if (FAILED(wined3d_surface_map(source, &src_map, NULL, WINED3D_MAP_READONLY))) +- { +- ERR("Failed to lock the source surface.\n"); +- wined3d_texture_decref(ret); +- return NULL; +- } +- if (FAILED(wined3d_surface_map(dst, &dst_map, NULL, 0))) +- { +- ERR("Failed to lock the destination surface.\n"); +- wined3d_surface_unmap(source); +- wined3d_texture_decref(ret); +- return NULL; +- } ++ if (device->d3d_initialized) ++ context = context_acquire(device, NULL); ++ ++ wined3d_resource_load_location(&source->resource, context, source->resource.map_binding); ++ src_data = wined3d_resource_get_map_ptr(&source->resource, context, WINED3D_MAP_READONLY); ++ if (!src_data) ++ goto error; + +- conv->convert(src_map.data, dst_map.data, src_map.row_pitch, dst_map.row_pitch, ++ if (!wined3d_resource_prepare_map_memory(&dst->resource, context)) ++ goto error; ++ dst_data = wined3d_resource_get_map_ptr(&dst->resource, context, 0); ++ if (!dst_data) ++ goto error; ++ ++ conv->convert(src_data, dst_data, src_row_pitch, dst_row_pitch, + source->resource.width, source->resource.height); + +- wined3d_surface_unmap(dst); +- wined3d_surface_unmap(source); ++ wined3d_resource_release_map_ptr(&dst->resource, context); ++ wined3d_resource_release_map_ptr(&source->resource, context); ++ ++ if (context) ++ context_release(context); + + return ret; ++ ++error: ++ ERR("Surface conversion failed.\n"); ++ ++ if (src_data) ++ wined3d_resource_release_map_ptr(&source->resource, context); ++ if (dst_data) ++ wined3d_resource_release_map_ptr(&ret->resource, context); ++ if (ret) ++ wined3d_texture_decref(ret); ++ if (context) ++ context_release(context); ++ return NULL; + } + + static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height, +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,942 +0,0 @@ -From 99ec63d5b866c832fd8dce4b249a338dd80a505e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 20 Dec 2012 13:09:17 +0100 -Subject: wined3d: Move the framebuffer into wined3d_state - ---- - dlls/wined3d/arb_program_shader.c | 4 +- - dlls/wined3d/context.c | 20 +++++-- - dlls/wined3d/cs.c | 21 ++----- - dlls/wined3d/device.c | 117 +++++++++++++++++--------------------- - dlls/wined3d/drawprim.c | 14 ++--- - dlls/wined3d/glsl_shader.c | 2 +- - dlls/wined3d/shader.c | 2 +- - dlls/wined3d/state.c | 20 +++---- - dlls/wined3d/stateblock.c | 45 +++++++++++++-- - dlls/wined3d/surface.c | 2 +- - dlls/wined3d/swapchain.c | 2 +- - dlls/wined3d/utils.c | 4 +- - dlls/wined3d/wined3d_private.h | 46 +++++++++++---- - 13 files changed, 172 insertions(+), 127 deletions(-) - -diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index eb46f8c..34e210a 100644 ---- a/dlls/wined3d/arb_program_shader.c -+++ b/dlls/wined3d/arb_program_shader.c -@@ -684,7 +684,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, - { - const struct wined3d_shader *pshader = state->shader[WINED3D_SHADER_TYPE_PIXEL]; - const struct arb_ps_compiled_shader *gl_shader = priv->compiled_fprog; -- UINT rt_height = state->fb->render_targets[0]->height; -+ UINT rt_height = state->fb.render_targets[0]->height; - - /* Load DirectX 9 float constants for pixel shader */ - priv->highest_dirty_ps_const = shader_arb_load_constantsF(pshader, gl_info, GL_FRAGMENT_PROGRAM_ARB, -@@ -4702,7 +4702,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context - } - else - { -- UINT rt_height = state->fb->render_targets[0]->height; -+ UINT rt_height = state->fb.render_targets[0]->height; - shader_arb_ps_local_constants(compiled, context, state, rt_height); - } - -diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index fb065cd..42a221c 100644 ---- a/dlls/wined3d/context.c -+++ b/dlls/wined3d/context.c -@@ -1475,6 +1475,12 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, - goto out; - } - -+ ret->current_fb.render_targets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, -+ sizeof(*ret->current_fb.render_targets) * gl_info->limits.buffers); -+ ret->current_fb.rt_size = gl_info->limits.buffers; -+ if (!ret->current_fb.render_targets) -+ goto out; -+ - /* Initialize the texture unit mapping to a 1:1 mapping */ - for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s) - { -@@ -1793,6 +1799,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, - out: - device->shader_backend->shader_free_context_data(ret); - device->adapter->fragment_pipe->free_context_data(ret); -+ HeapFree(GetProcessHeap(), 0, ret->current_fb.render_targets); - HeapFree(GetProcessHeap(), 0, ret->free_event_queries); - HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries); - HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries); -@@ -1827,6 +1834,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont - - device->shader_backend->shader_free_context_data(context); - device->adapter->fragment_pipe->free_context_data(context); -+ HeapFree(GetProcessHeap(), 0, context->current_fb.render_targets); - HeapFree(GetProcessHeap(), 0, context->draw_buffers); - HeapFree(GetProcessHeap(), 0, context->blit_targets); - device_context_remove(device, context); -@@ -2342,7 +2350,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win - DWORD rt_mask = 0, *cur_mask; - UINT i; - -- if (isStateDirty(context, STATE_FRAMEBUFFER) || fb != &device->fb -+ if (isStateDirty(context, STATE_FRAMEBUFFER) || !wined3d_fb_equal(fb, &context->current_fb) - || rt_count != context->gl_info->limits.buffers) - { - if (!context_validate_rt_config(rt_count, rts, dsv)) -@@ -2387,6 +2395,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win - rt_mask = context_generate_rt_mask_no_fbo(device, - rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); - } -+ -+ wined3d_fb_copy(&context->current_fb, fb); - } - else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO - && (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource))) -@@ -2437,7 +2447,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win - static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_device *device) - { - const struct wined3d_state *state = &device->state; -- struct wined3d_rendertarget_view **rts = state->fb->render_targets; -+ struct wined3d_rendertarget_view **rts = state->fb.render_targets; - struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL]; - DWORD rt_mask, rt_mask_bits; - unsigned int i; -@@ -2467,7 +2477,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const - void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) - { - const struct wined3d_device *device = context->swapchain->device; -- const struct wined3d_fb_state *fb = state->fb; -+ const struct wined3d_fb_state *fb = &state->fb; - DWORD rt_mask = find_draw_buffers_mask(context, device); - DWORD *cur_mask; - -@@ -2499,6 +2509,8 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat - context_apply_draw_buffers(context, rt_mask); - *cur_mask = rt_mask; - } -+ -+ wined3d_fb_copy(&context->current_fb, &state->fb); - } - - static void context_map_stage(struct wined3d_context *context, DWORD stage, DWORD unit) -@@ -3087,7 +3099,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de - { - const struct wined3d_state *state = &device->state; - const struct StateEntry *state_table = context->state_table; -- const struct wined3d_fb_state *fb = state->fb; -+ const struct wined3d_fb_state *fb = &state->fb; - unsigned int i, j; - WORD map; - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 874129a..22a2de8 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -290,7 +290,7 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) - device = cs->device; - wined3d_get_draw_rect(&device->state, &draw_rect); - device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, -- &device->fb, op->rect_count, op->rects, &draw_rect, op->flags, -+ &cs->state.fb, op->rect_count, op->rects, &draw_rect, op->flags, - op->color, op->depth, op->stencil); - } - -@@ -397,7 +397,7 @@ static void wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const v - { - const struct wined3d_cs_set_rendertarget_view *op = data; - -- cs->state.fb->render_targets[op->view_idx] = op->view; -+ cs->state.fb.render_targets[op->view_idx] = op->view; - device_invalidate_state(cs->device, STATE_FRAMEBUFFER); - } - -@@ -420,7 +420,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const - struct wined3d_device *device = cs->device; - struct wined3d_rendertarget_view *prev; - -- if ((prev = cs->state.fb->depth_stencil)) -+ if ((prev = cs->state.fb.depth_stencil)) - { - struct wined3d_surface *prev_surface = wined3d_rendertarget_view_get_surface(prev); - -@@ -436,7 +436,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const - } - } - -- cs->fb.depth_stencil = op->view; -+ cs->state.fb.depth_stencil = op->view; - - if (!prev != !op->view) - { -@@ -1004,7 +1004,7 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) - - state_cleanup(&cs->state); - memset(&cs->state, 0, sizeof(cs->state)); -- if (FAILED(hr = state_init(&cs->state, &cs->fb, &adapter->gl_info, &adapter->d3d_info, -+ if (FAILED(hr = state_init(&cs->state, &adapter->gl_info, &adapter->d3d_info, - WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT))) - ERR("Failed to initialize CS state, hr %#x.\n", hr); - } -@@ -1087,17 +1087,9 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) - if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs)))) - return NULL; - -- if (!(cs->fb.render_targets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, -- sizeof(*cs->fb.render_targets) * gl_info->limits.buffers))) -- { -- HeapFree(GetProcessHeap(), 0, cs); -- return NULL; -- } -- -- if (FAILED(state_init(&cs->state, &cs->fb, gl_info, &device->adapter->d3d_info, -+ if (FAILED(state_init(&cs->state, gl_info, &device->adapter->d3d_info, - WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT))) - { -- HeapFree(GetProcessHeap(), 0, cs->fb.render_targets); - HeapFree(GetProcessHeap(), 0, cs); - return NULL; - } -@@ -1118,7 +1110,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) - void wined3d_cs_destroy(struct wined3d_cs *cs) - { - state_cleanup(&cs->state); -- HeapFree(GetProcessHeap(), 0, cs->fb.render_targets); - HeapFree(GetProcessHeap(), 0, cs->data); - HeapFree(GetProcessHeap(), 0, cs); - } -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index a13fb54..990545d 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -860,7 +860,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi - BOOL ds_enable = !!swapchain->desc.enable_auto_depth_stencil; - unsigned int i; - -- if (device->fb.render_targets) -+ if (device->state.fb.render_targets) - { - for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) - { -@@ -878,7 +878,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - struct wined3d_swapchain_desc *swapchain_desc) - { - static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f}; -- const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - struct wined3d_swapchain *swapchain = NULL; - struct wined3d_context *context; - DWORD clear_flags = 0; -@@ -891,9 +890,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - if (device->wined3d->flags & WINED3D_NO3D) - return WINED3DERR_INVALIDCALL; - -- device->fb.render_targets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, -- sizeof(*device->fb.render_targets) * gl_info->limits.buffers); -- - if (FAILED(hr = device->shader_backend->shader_alloc_private(device, - device->adapter->vertex_pipe, device->adapter->fragment_pipe))) - { -@@ -981,7 +977,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - return WINED3D_OK; - - err_out: -- HeapFree(GetProcessHeap(), 0, device->fb.render_targets); - HeapFree(GetProcessHeap(), 0, device->swapchains); - device->swapchain_count = 0; - if (device->back_buffer_view) -@@ -1060,8 +1055,25 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - if (device->cursor_texture) - wined3d_texture_decref(device->cursor_texture); - -+ /* Release the buffers (with sanity checks). -+ * FIXME: Move this move into a separate patch. I think the idea -+ * behind this is that those surfaces should be freed before unloading -+ * remaining resources below. */ -+ if (device->onscreen_depth_stencil) -+ { -+ surface = device->onscreen_depth_stencil; -+ device->onscreen_depth_stencil = NULL; -+ wined3d_surface_decref(surface); -+ } -+ - state_unbind_resources(&device->state); - -+ if (device->auto_depth_stencil_view) -+ { -+ wined3d_rendertarget_view_decref(device->auto_depth_stencil_view); -+ device->auto_depth_stencil_view = NULL; -+ } -+ - /* Unload resources */ - LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) - { -@@ -1092,37 +1104,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - * destroy the context. */ - context_release(context); - -- /* Release the buffers (with sanity checks)*/ -- if (device->onscreen_depth_stencil) -- { -- surface = device->onscreen_depth_stencil; -- device->onscreen_depth_stencil = NULL; -- wined3d_surface_decref(surface); -- } -- -- if (device->fb.depth_stencil) -- { -- struct wined3d_rendertarget_view *view = device->fb.depth_stencil; -- -- TRACE("Releasing depth/stencil view %p.\n", view); -- -- device->fb.depth_stencil = NULL; -- wined3d_rendertarget_view_decref(view); -- } -- -- if (device->auto_depth_stencil_view) -- { -- struct wined3d_rendertarget_view *view = device->auto_depth_stencil_view; -- -- device->auto_depth_stencil_view = NULL; -- if (wined3d_rendertarget_view_decref(view)) -- ERR("Something's still holding the auto depth/stencil view (%p).\n", view); -- } -- -- for (i = 0; i < gl_info->limits.buffers; ++i) -- { -- wined3d_device_set_rendertarget_view(device, i, NULL, FALSE); -- } - if (device->back_buffer_view) - { - wined3d_rendertarget_view_decref(device->back_buffer_view); -@@ -1140,9 +1121,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - device->swapchains = NULL; - device->swapchain_count = 0; - -- HeapFree(GetProcessHeap(), 0, device->fb.render_targets); -- device->fb.render_targets = NULL; -- - device->d3d_initialized = FALSE; - - return WINED3D_OK; -@@ -1939,7 +1917,7 @@ static void resolve_depth_buffer(struct wined3d_state *state) - || !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) - return; - surface = surface_from_resource(texture->sub_resources[0]); -- if (!(depth_stencil = wined3d_rendertarget_view_get_surface(state->fb->depth_stencil))) -+ if (!(depth_stencil = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil))) - return; - - wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT); -@@ -3328,6 +3306,8 @@ HRESULT CDECL wined3d_device_present(const struct wined3d_device *device, const - HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, - const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) - { -+ const struct wined3d_fb_state *fb = &device->state.fb; -+ - TRACE("device %p, rect_count %u, rects %p, flags %#x, color {%.8e, %.8e, %.8e, %.8e}, depth %.8e, stencil %u.\n", - device, rect_count, rects, flags, color->r, color->g, color->b, color->a, depth, stencil); - -@@ -3339,7 +3319,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou - - if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) - { -- struct wined3d_rendertarget_view *ds = device->fb.depth_stencil; -+ struct wined3d_rendertarget_view *ds = fb->depth_stencil; - if (!ds) - { - WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n"); -@@ -3348,8 +3328,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou - } - else if (flags & WINED3DCLEAR_TARGET) - { -- if (ds->width < device->fb.render_targets[0]->width -- || ds->height < device->fb.render_targets[0]->height) -+ if (ds->width < fb->render_targets[0]->width -+ || ds->height < fb->render_targets[0]->height) - { - WARN("Silently ignoring depth and target clear with mismatching sizes\n"); - return WINED3D_OK; -@@ -3725,8 +3705,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device - if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] - || state->render_states[WINED3D_RS_STENCILENABLE]) - { -- struct wined3d_rendertarget_view *rt = device->fb.render_targets[0]; -- struct wined3d_rendertarget_view *ds = device->fb.depth_stencil; -+ struct wined3d_rendertarget_view *rt = state->fb.render_targets[0]; -+ struct wined3d_rendertarget_view *ds = state->fb.depth_stencil; - - if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) - { -@@ -3952,20 +3932,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co - return NULL; - } - -- return device->fb.render_targets[view_idx]; -+ return device->state.fb.render_targets[view_idx]; - } - - struct wined3d_rendertarget_view * CDECL wined3d_device_get_depth_stencil_view(const struct wined3d_device *device) - { - TRACE("device %p.\n", device); - -- return device->fb.depth_stencil; -+ return device->state.fb.depth_stencil; - } - - HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device, - unsigned int view_idx, struct wined3d_rendertarget_view *view, BOOL set_viewport) - { - struct wined3d_rendertarget_view *prev; -+ struct wined3d_fb_state *fb = &device->state.fb; - - TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n", - device, view_idx, view, set_viewport); -@@ -4005,13 +3986,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device - } - - -- prev = device->fb.render_targets[view_idx]; -+ prev = fb->render_targets[view_idx]; - if (view == prev) - return WINED3D_OK; - - if (view) - wined3d_rendertarget_view_incref(view); -- device->fb.render_targets[view_idx] = view; -+ fb->render_targets[view_idx] = view; - wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view); - /* Release after the assignment, to prevent device_resource_released() - * from seeing the surface as still in use. */ -@@ -4023,18 +4004,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device - - void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) - { -+ struct wined3d_fb_state *fb = &device->state.fb; - struct wined3d_rendertarget_view *prev; - - TRACE("device %p, view %p.\n", device, view); - -- prev = device->fb.depth_stencil; -+ prev = fb->depth_stencil; - if (prev == view) - { - TRACE("Trying to do a NOP SetRenderTarget operation.\n"); - return; - } - -- if ((device->fb.depth_stencil = view)) -+ if ((fb->depth_stencil = view)) - wined3d_rendertarget_view_incref(view); - wined3d_cs_emit_set_depth_stencil_view(device->cs, view); - if (prev) -@@ -4391,10 +4373,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - wined3d_texture_decref(device->cursor_texture); - device->cursor_texture = NULL; - } -- state_unbind_resources(&device->state); - } - -- if (device->fb.render_targets) -+ if (device->state.fb.render_targets) - { - for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) - { -@@ -4403,6 +4384,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - } - wined3d_device_set_depth_stencil_view(device, NULL); - -+ if (reset_state) -+ { -+ state_unbind_resources(&device->state); -+ } -+ - if (device->onscreen_depth_stencil) - { - wined3d_surface_decref(device->onscreen_depth_stencil); -@@ -4693,7 +4679,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - if (device->d3d_initialized) - delete_opengl_contexts(device, swapchain); - -- if (FAILED(hr = state_init(&device->state, &device->fb, &device->adapter->gl_info, -+ if (FAILED(hr = state_init(&device->state, &device->adapter->gl_info, - &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) - ERR("Failed to initialize device state, hr %#x.\n", hr); - device->update_state = &device->state; -@@ -4702,22 +4688,21 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - } - else if (device->back_buffer_view) - { -- struct wined3d_rendertarget_view *view = device->back_buffer_view; - struct wined3d_state *state = &device->state; - -- wined3d_device_set_rendertarget_view(device, 0, view, FALSE); -+ wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE); - - /* Note the min_z / max_z is not reset. */ - state->viewport.x = 0; - state->viewport.y = 0; -- state->viewport.width = view->width; -- state->viewport.height = view->height; -+ state->viewport.width = swapchain->desc.backbuffer_width; -+ state->viewport.height = swapchain->desc.backbuffer_height; - wined3d_cs_emit_set_viewport(device->cs, &state->viewport); - - state->scissor_rect.top = 0; - state->scissor_rect.left = 0; -- state->scissor_rect.right = view->width; -- state->scissor_rect.bottom = view->height; -+ state->scissor_rect.right = swapchain->desc.backbuffer_width; -+ state->scissor_rect.bottom = swapchain->desc.backbuffer_height; - wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); - } - -@@ -4808,17 +4793,17 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso - - for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) - { -- if (wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]) == surface) -+ if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface) - { - ERR("Surface %p is still in use as render target %u.\n", surface, i); -- device->fb.render_targets[i] = NULL; -+ device->state.fb.render_targets[i] = NULL; - } - } - -- if (wined3d_rendertarget_view_get_surface(device->fb.depth_stencil) == surface) -+ if (wined3d_rendertarget_view_get_surface(device->state.fb.depth_stencil) == surface) - { - ERR("Surface %p is still in use as depth/stencil buffer.\n", surface); -- device->fb.depth_stencil = NULL; -+ device->state.fb.depth_stencil = NULL; - } - } - break; -@@ -4981,7 +4966,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, - - device->blitter = adapter->blitter; - -- if (FAILED(hr = state_init(&device->state, &device->fb, &adapter->gl_info, -+ if (FAILED(hr = state_init(&device->state, &adapter->gl_info, - &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) - { - ERR("Failed to initialize device state, hr %#x.\n", hr); -diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index f2c2f42..c6a72fc 100644 ---- a/dlls/wined3d/drawprim.c -+++ b/dlls/wined3d/drawprim.c -@@ -611,7 +611,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co - - if (!index_count) return; - -- context = context_acquire(device, wined3d_rendertarget_view_get_surface(device->fb.render_targets[0])); -+ context = context_acquire(device, wined3d_rendertarget_view_get_surface(state->fb.render_targets[0])); - if (!context->valid) - { - context_release(context); -@@ -625,7 +625,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co - /* Invalidate the back buffer memory so LockRect will read it the next time */ - for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) - { -- struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]); -+ struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(state->fb.render_targets[i]); - if (target) - { - wined3d_resource_load_location(&target->resource, context, target->container->resource.draw_binding); -@@ -634,18 +634,18 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co - } - } - -- if (device->fb.depth_stencil) -+ if (state->fb.depth_stencil) - { - /* Note that this depends on the context_acquire() call above to set - * context->render_offscreen properly. We don't currently take the - * Z-compare function into account, but we could skip loading the - * depthstencil for D3DCMP_NEVER and D3DCMP_ALWAYS as well. Also note - * that we never copy the stencil data.*/ -- DWORD location = context->render_offscreen ? device->fb.depth_stencil->resource->draw_binding -+ DWORD location = context->render_offscreen ? state->fb.depth_stencil->resource->draw_binding - : WINED3D_LOCATION_DRAWABLE; - if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE]) - { -- struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(device->fb.depth_stencil); -+ struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil); - RECT current_rect, draw_rect, r; - - if (!context->render_offscreen && ds != device->onscreen_depth_stencil) -@@ -671,9 +671,9 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co - return; - } - -- if (device->fb.depth_stencil && state->render_states[WINED3D_RS_ZWRITEENABLE]) -+ if (state->fb.depth_stencil && state->render_states[WINED3D_RS_ZWRITEENABLE]) - { -- struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(device->fb.depth_stencil); -+ struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil); - DWORD location = context->render_offscreen ? ds->container->resource.draw_binding : WINED3D_LOCATION_DRAWABLE; - - surface_modify_ds_location(ds, location, ds->ds_current_size.cx, ds->ds_current_size.cy); -diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c -index 5ba246e..4775ff9 100644 ---- a/dlls/wined3d/glsl_shader.c -+++ b/dlls/wined3d/glsl_shader.c -@@ -1531,7 +1531,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont - const struct vs_compile_args *vs_args = ctx_priv->cur_vs_args; - const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args; - const struct wined3d_gl_info *gl_info = context->gl_info; -- const struct wined3d_fb_state *fb = &shader->device->fb; -+ const struct wined3d_fb_state *fb = &state->fb; - unsigned int i, extra_constants_needed = 0; - const struct wined3d_shader_lconst *lconst; - const char *prefix; -diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c -index 5b32528..1c401c4 100644 ---- a/dlls/wined3d/shader.c -+++ b/dlls/wined3d/shader.c -@@ -2411,7 +2411,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 - memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */ - if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && state->render_states[WINED3D_RS_SRGBWRITEENABLE]) - { -- unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags; -+ unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags; - if (rt_fmt_flags & WINED3DFMT_FLAG_SRGB_WRITE) - { - static unsigned int warned = 0; -diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index b7d7f92..59f9fd8 100644 ---- a/dlls/wined3d/state.c -+++ b/dlls/wined3d/state.c -@@ -105,7 +105,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_ - const struct wined3d_gl_info *gl_info = context->gl_info; - - /* No z test without depth stencil buffers */ -- if (!state->fb->depth_stencil) -+ if (!state->fb.depth_stencil) - { - TRACE("No Z buffer - disabling depth test\n"); - zenable = WINED3D_ZB_FALSE; -@@ -367,8 +367,8 @@ static GLenum gl_blend_factor(enum wined3d_blend factor, const struct wined3d_fo - - static void state_blend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) - { -- const struct wined3d_format *rt_format = state->fb->render_targets[0]->format; -- unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags; -+ const struct wined3d_format *rt_format = state->fb.render_targets[0]->format; -+ unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags; - const struct wined3d_gl_info *gl_info = context->gl_info; - GLenum srcBlend, dstBlend; - enum wined3d_blend d3d_blend; -@@ -813,7 +813,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ - GLint depthFail_ccw; - - /* No stencil test without a stencil buffer. */ -- if (!state->fb->depth_stencil) -+ if (!state->fb.depth_stencil) - { - gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST); - checkGLcall("glDisable GL_STENCIL_TEST"); -@@ -909,7 +909,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ - - static void state_stencilwrite2s(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) - { -- DWORD mask = state->fb->depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0; -+ DWORD mask = state->fb.depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0; - const struct wined3d_gl_info *gl_info = context->gl_info; - - GL_EXTCALL(glActiveStencilFaceEXT(GL_BACK)); -@@ -923,7 +923,7 @@ static void state_stencilwrite2s(struct wined3d_context *context, const struct w - - static void state_stencilwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) - { -- DWORD mask = state->fb->depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0; -+ DWORD mask = state->fb.depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0; - const struct wined3d_gl_info *gl_info = context->gl_info; - - gl_info->gl_ops.gl.p_glStencilMask(mask); -@@ -1644,7 +1644,7 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 - if (state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS] - || state->render_states[WINED3D_RS_DEPTHBIAS]) - { -- const struct wined3d_rendertarget_view *depth = state->fb->depth_stencil; -+ const struct wined3d_rendertarget_view *depth = state->fb.depth_stencil; - float scale; - - union -@@ -4542,7 +4542,7 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine - - static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) - { -- const struct wined3d_rendertarget_view *target = state->fb->render_targets[0]; -+ const struct wined3d_rendertarget_view *target = state->fb.render_targets[0]; - const struct wined3d_gl_info *gl_info = context->gl_info; - struct wined3d_viewport vp = state->viewport; - -@@ -4720,7 +4720,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st - } - else - { -- const struct wined3d_rendertarget_view *target = state->fb->render_targets[0]; -+ const struct wined3d_rendertarget_view *target = state->fb.render_targets[0]; - UINT height; - UINT width; - -@@ -4784,7 +4784,7 @@ static void psorigin(struct wined3d_context *context, const struct wined3d_state - - void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) - { -- unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags; -+ unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags; - const struct wined3d_gl_info *gl_info = context->gl_info; - - TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); -diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c -index 763a5f9..790d769 100644 ---- a/dlls/wined3d/stateblock.c -+++ b/dlls/wined3d/stateblock.c -@@ -464,6 +464,7 @@ void state_unbind_resources(struct wined3d_state *state) - struct wined3d_texture *texture; - struct wined3d_buffer *buffer; - struct wined3d_shader *shader; -+ struct wined3d_rendertarget_view *view; - unsigned int i, j; - - if ((decl = state->vertex_declaration)) -@@ -540,6 +541,31 @@ void state_unbind_resources(struct wined3d_state *state) - } - } - } -+ -+ if (state->fb.depth_stencil) -+ { -+ view = state->fb.depth_stencil; -+ -+ TRACE("Releasing depth/stencil buffer %p.\n", view); -+ -+ state->fb.depth_stencil = NULL; -+ wined3d_rendertarget_view_decref(view); -+ } -+ -+ if (state->fb.render_targets) -+ { -+ for (i = 0; i < state->fb.rt_size; i++) -+ { -+ view = state->fb.render_targets[i]; -+ TRACE("Setting rendertarget %u to NULL\n", i); -+ state->fb.render_targets[i] = NULL; -+ if (view) -+ { -+ TRACE("Releasing the rendertarget view at %p\n", view); -+ wined3d_rendertarget_view_decref(view); -+ } -+ } -+ } - } - - void state_cleanup(struct wined3d_state *state) -@@ -567,6 +593,7 @@ void state_cleanup(struct wined3d_state *state) - - HeapFree(GetProcessHeap(), 0, state->vs_consts_f); - HeapFree(GetProcessHeap(), 0, state->ps_consts_f); -+ HeapFree(GetProcessHeap(), 0, state->fb.render_targets); - } - - ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock) -@@ -1310,14 +1337,12 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d - } - } - --HRESULT state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, -- const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, -- DWORD flags) -+HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, -+ const struct wined3d_d3d_info *d3d_info, DWORD flags) - { - unsigned int i; - - state->flags = flags; -- state->fb = fb; - - for (i = 0; i < LIGHTMAP_SIZE; i++) - { -@@ -1335,6 +1360,15 @@ HRESULT state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, - return E_OUTOFMEMORY; - } - -+ if (!(state->fb.render_targets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, -+ sizeof(*state->fb.render_targets) * gl_info->limits.buffers))) -+ { -+ HeapFree(GetProcessHeap(), 0, state->ps_consts_f); -+ HeapFree(GetProcessHeap(), 0, state->vs_consts_f); -+ return E_OUTOFMEMORY; -+ } -+ state->fb.rt_size = gl_info->limits.buffers; -+ - if (flags & WINED3D_STATE_INIT_DEFAULT) - state_init_default(state, gl_info); - -@@ -1345,12 +1379,13 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, - struct wined3d_device *device, enum wined3d_stateblock_type type) - { - HRESULT hr; -+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; - - stateblock->ref = 1; - stateblock->device = device; - -- if (FAILED(hr = state_init(&stateblock->state, NULL, &device->adapter->gl_info, d3d_info, 0))) -+ if (FAILED(hr = state_init(&stateblock->state, gl_info, d3d_info, 0))) - return hr; - - if (FAILED(hr = stateblock_allocate_shader_constants(stateblock))) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index f415b56..1808153 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -3418,8 +3418,8 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE - enum wined3d_texture_filter_type filter) - { - struct wined3d_device *device = dst_surface->resource.device; -- const struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(device->fb.render_targets[0]); - struct wined3d_swapchain *src_swapchain, *dst_swapchain; -+ const struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[0]); - - TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, blt_fx %p, filter %s.\n", - dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 1ac5e7a..454cb21 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -421,7 +421,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - { - struct wined3d_surface *back_buffer = surface_from_resource( - wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)); -- const struct wined3d_fb_state *fb = &swapchain->device->fb; -+ const struct wined3d_fb_state *fb = &swapchain->device->state.fb; - const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; - struct wined3d_surface *front; -diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c -index 44ba7ad..ade92b2 100644 ---- a/dlls/wined3d/utils.c -+++ b/dlls/wined3d/utils.c -@@ -3514,7 +3514,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w - float y_offset = context->render_offscreen - ? (center_offset - (2.0f * y) - h) / h - : (center_offset - (2.0f * y) - h) / -h; -- enum wined3d_depth_buffer_type zenable = state->fb->depth_stencil ? -+ enum wined3d_depth_buffer_type zenable = state->fb.depth_stencil ? - state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE; - float z_scale = zenable ? 2.0f : 0.0f; - float z_offset = zenable ? -1.0f : 0.0f; -@@ -4104,7 +4104,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d - unsigned int i; - DWORD ttff; - DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2; -- unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags; -+ unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags; - const struct wined3d_gl_info *gl_info = context->gl_info; - const struct wined3d_d3d_info *d3d_info = context->d3d_info; - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7f9436a..a19fabe 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -1137,6 +1137,36 @@ struct wined3d_timestamp_query - void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; - void context_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; - -+struct wined3d_fb_state -+{ -+ struct wined3d_rendertarget_view **render_targets; -+ struct wined3d_rendertarget_view *depth_stencil; -+ UINT rt_size; -+}; -+ -+static inline BOOL wined3d_fb_equal(const struct wined3d_fb_state *fb1, const struct wined3d_fb_state *fb2) -+{ -+ UINT i; -+ -+ if (fb1->depth_stencil != fb2->depth_stencil) -+ return FALSE; -+ if (fb1->rt_size != fb2->rt_size) -+ return FALSE; -+ for (i = 0; i < fb1->rt_size; i++) -+ if (fb1->render_targets[i] != fb2->render_targets[i]) -+ return FALSE; -+ return TRUE; -+} -+ -+static inline void wined3d_fb_copy(struct wined3d_fb_state *dst, const struct wined3d_fb_state *src) -+{ -+ UINT i; -+ -+ dst->depth_stencil = src->depth_stencil; -+ for (i = 0; i < min(dst->rt_size, src->rt_size); i++) -+ dst->render_targets[i] = src->render_targets[i]; -+} -+ - struct wined3d_context - { - const struct wined3d_gl_info *gl_info; -@@ -1151,6 +1181,7 @@ struct wined3d_context - DWORD dirtyArray[STATE_HIGHEST + 1]; /* Won't get bigger than that, a state is never marked dirty 2 times */ - DWORD numDirtyEntries; - DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */ -+ struct wined3d_fb_state current_fb; - - struct wined3d_swapchain *swapchain; - struct wined3d_surface *current_rt; -@@ -1252,12 +1283,6 @@ struct wined3d_context - GLuint dummy_arbfp_prog; - }; - --struct wined3d_fb_state --{ -- struct wined3d_rendertarget_view **render_targets; -- struct wined3d_rendertarget_view *depth_stencil; --}; -- - typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); - - struct StateEntry -@@ -1941,7 +1966,7 @@ struct wined3d_stream_state - struct wined3d_state - { - DWORD flags; -- const struct wined3d_fb_state *fb; -+ struct wined3d_fb_state fb; - - struct wined3d_vertex_declaration *vertex_declaration; - struct wined3d_stream_output stream_output[MAX_STREAM_OUT]; -@@ -2047,7 +2072,6 @@ struct wined3d_device - struct wine_rb_tree samplers; - - /* Render Target Support */ -- struct wined3d_fb_state fb; - struct wined3d_surface *onscreen_depth_stencil; - struct wined3d_rendertarget_view *auto_depth_stencil_view; - -@@ -2553,9 +2577,8 @@ struct wined3d_stateblock - void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; - - void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; --HRESULT state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, -- const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, -- DWORD flags) DECLSPEC_HIDDEN; -+HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, -+ const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; - void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; - - struct wined3d_cs_ops -@@ -2568,7 +2591,6 @@ struct wined3d_cs - { - const struct wined3d_cs_ops *ops; - struct wined3d_device *device; -- struct wined3d_fb_state fb; - struct wined3d_state state; - - size_t data_size; --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0044-wined3d-Don-t-call-the-public-map-function-in-surfac.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0044-wined3d-Don-t-call-the-public-map-function-in-surfac.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0044-wined3d-Don-t-call-the-public-map-function-in-surfac.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0044-wined3d-Don-t-call-the-public-map-function-in-surfac.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,277 @@ +From 9d0010d5add477e39747ac3e458d16b5b1fa101f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 24 Sep 2013 00:31:39 +0200 +Subject: wined3d: Don't call the public map function in surface_cpu_blt. + +--- + dlls/wined3d/surface.c | 107 +++++++++++++++++++++++++++++++++---------------- + 1 file changed, 72 insertions(+), 35 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index ff83f29..df8aea6 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -4428,21 +4428,36 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * + const struct wined3d_format *src_format, *dst_format; + unsigned int src_fmt_flags, dst_fmt_flags; + struct wined3d_texture *src_texture = NULL; +- struct wined3d_map_desc dst_map, src_map; ++ void *src_data = NULL, *dst_data = NULL; ++ UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; + const BYTE *sbase = NULL; + HRESULT hr = WINED3D_OK; + const BYTE *sbuf; + BYTE *dbuf; + int x, y; ++ struct wined3d_device *device = dst_surface->resource.device; ++ struct wined3d_context *context = NULL; + + TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n", + dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), + flags, fx, debug_d3dtexturefiltertype(filter)); + ++ if (device->d3d_initialized) ++ context = context_acquire(device, NULL); ++ ++ if (!wined3d_resource_prepare_map_memory(&dst_surface->resource, context)) ++ { ++ hr = E_OUTOFMEMORY; ++ goto error; ++ } ++ wined3d_resource_load_location(&dst_surface->resource, context, dst_surface->resource.map_binding); ++ + if (src_surface == dst_surface) + { +- wined3d_surface_map(dst_surface, &dst_map, NULL, 0); +- src_map = dst_map; ++ dst_data = wined3d_resource_get_map_ptr(&dst_surface->resource, context, 0); ++ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); ++ src_data = dst_data; ++ src_row_pitch = dst_row_pitch; + src_format = dst_surface->resource.format; + dst_format = src_format; + dst_fmt_flags = dst_surface->container->resource.format_flags; +@@ -4454,6 +4469,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * + dst_fmt_flags = dst_surface->container->resource.format_flags; + if (src_surface) + { ++ if (!wined3d_resource_prepare_map_memory(&src_surface->resource, context)) ++ { ++ hr = E_OUTOFMEMORY; ++ goto error; ++ } ++ + if (dst_surface->resource.format->id != src_surface->resource.format->id) + { + if (!(src_texture = surface_convert_format(src_surface, dst_format->id))) +@@ -4464,7 +4485,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * + } + src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); + } +- wined3d_surface_map(src_surface, &src_map, NULL, WINED3D_MAP_READONLY); ++ wined3d_resource_load_location(&src_surface->resource, context, src_surface->resource.map_binding); ++ wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); ++ src_data = wined3d_resource_get_map_ptr(&src_surface->resource, context, 0); + src_format = src_surface->resource.format; + src_fmt_flags = src_surface->container->resource.format_flags; + } +@@ -4474,7 +4497,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * + src_fmt_flags = dst_fmt_flags; + } + +- wined3d_surface_map(dst_surface, &dst_map, dst_rect, 0); ++ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); ++ dst_data = wined3d_resource_get_map_ptr(&dst_surface->resource, context, 0); + } + + bpp = dst_surface->resource.format->byte_count; +@@ -4485,15 +4509,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * + width = (dst_rect->right - dst_rect->left) * bpp; + + if (src_surface) +- sbase = (BYTE *)src_map.data +- + ((src_rect->top / src_format->block_height) * src_map.row_pitch) ++ sbase = (BYTE *)src_data ++ + ((src_rect->top / src_format->block_height) * src_row_pitch) + + ((src_rect->left / src_format->block_width) * src_format->block_byte_count); +- if (src_surface != dst_surface) +- dbuf = dst_map.data; +- else +- dbuf = (BYTE *)dst_map.data +- + ((dst_rect->top / dst_format->block_height) * dst_map.row_pitch) +- + ((dst_rect->left / dst_format->block_width) * dst_format->block_byte_count); ++ dbuf = (BYTE *)dst_data ++ + ((dst_rect->top / dst_format->block_height) * dst_row_pitch) ++ + ((dst_rect->left / dst_format->block_width) * dst_format->block_byte_count); + + if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) + { +@@ -4528,7 +4549,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * + } + + hr = surface_cpu_blt_compressed(sbase, dbuf, +- src_map.row_pitch, dst_map.row_pitch, dstwidth, dstheight, ++ src_row_pitch, dst_row_pitch, dstwidth, dstheight, + src_format, flags, fx); + goto release; + } +@@ -4536,7 +4557,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * + /* First, all the 'source-less' blits */ + if (flags & WINEDDBLT_COLORFILL) + { +- hr = _Blt_ColorFill(dbuf, dstwidth, dstheight, bpp, dst_map.row_pitch, fx->u5.dwFillColor); ++ hr = _Blt_ColorFill(dbuf, dstwidth, dstheight, bpp, dst_row_pitch, fx->u5.dwFillColor); + flags &= ~WINEDDBLT_COLORFILL; + } + +@@ -4585,19 +4606,19 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * + for (y = 0; y < dstheight; ++y) + { + memcpy(dbuf, sbuf, width); +- sbuf += src_map.row_pitch; +- dbuf += dst_map.row_pitch; ++ sbuf += src_row_pitch; ++ dbuf += dst_row_pitch; + } + } + else if (dst_rect->top > src_rect->top) + { + /* Copy from bottom upwards. */ +- sbuf += src_map.row_pitch * dstheight; +- dbuf += dst_map.row_pitch * dstheight; ++ sbuf += src_row_pitch * dstheight; ++ dbuf += dst_row_pitch * dstheight; + for (y = 0; y < dstheight; ++y) + { +- sbuf -= src_map.row_pitch; +- dbuf -= dst_map.row_pitch; ++ sbuf -= src_row_pitch; ++ dbuf -= dst_row_pitch; + memcpy(dbuf, sbuf, width); + } + } +@@ -4607,8 +4628,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * + for (y = 0; y < dstheight; ++y) + { + memmove(dbuf, sbuf, width); +- sbuf += src_map.row_pitch; +- dbuf += dst_map.row_pitch; ++ sbuf += src_row_pitch; ++ dbuf += dst_row_pitch; + } + } + } +@@ -4617,9 +4638,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * + /* Stretching in y direction only. */ + for (y = sy = 0; y < dstheight; ++y, sy += yinc) + { +- sbuf = sbase + (sy >> 16) * src_map.row_pitch; ++ sbuf = sbase + (sy >> 16) * src_row_pitch; + memcpy(dbuf, sbuf, width); +- dbuf += dst_map.row_pitch; ++ dbuf += dst_row_pitch; + } + } + } +@@ -4629,13 +4650,13 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT * + int last_sy = -1; + for (y = sy = 0; y < dstheight; ++y, sy += yinc) + { +- sbuf = sbase + (sy >> 16) * src_map.row_pitch; ++ sbuf = sbase + (sy >> 16) * src_row_pitch; + + if ((sy >> 16) == (last_sy >> 16)) + { + /* This source row is the same as last source row - + * Copy the already stretched row. */ +- memcpy(dbuf, dbuf - dst_map.row_pitch, width); ++ memcpy(dbuf, dbuf - dst_row_pitch, width); + } + else + { +@@ -4682,14 +4703,14 @@ do { \ + } + #undef STRETCH_ROW + } +- dbuf += dst_map.row_pitch; ++ dbuf += dst_row_pitch; + last_sy = sy; + } + } + } + else + { +- LONG dstyinc = dst_map.row_pitch, dstxinc = bpp; ++ LONG dstyinc = dst_row_pitch, dstxinc = bpp; + DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff; + DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff; + if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE)) +@@ -4739,7 +4760,7 @@ do { \ + LONG tmpxy; + dTopLeft = dbuf; + dTopRight = dbuf + ((dstwidth - 1) * bpp); +- dBottomLeft = dTopLeft + ((dstheight - 1) * dst_map.row_pitch); ++ dBottomLeft = dTopLeft + ((dstheight - 1) * dst_row_pitch); + dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); + + if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) +@@ -4822,7 +4843,7 @@ do { \ + type *d = (type *)dbuf, *dx, tmp; \ + for (y = sy = 0; y < dstheight; ++y, sy += yinc) \ + { \ +- s = (const type *)(sbase + (sy >> 16) * src_map.row_pitch); \ ++ s = (const type *)(sbase + (sy >> 16) * src_row_pitch); \ + dx = d; \ + for (x = sx = 0; x < dstwidth; ++x, sx += xinc) \ + { \ +@@ -4855,7 +4876,7 @@ do { \ + BYTE *d = dbuf, *dx; + for (y = sy = 0; y < dstheight; ++y, sy += yinc) + { +- sbuf = sbase + (sy >> 16) * src_map.row_pitch; ++ sbuf = sbase + (sy >> 16) * src_row_pitch; + dx = d; + for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) + { +@@ -4886,6 +4907,10 @@ do { \ + } + } + ++ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->resource.map_binding); ++ if (dst_surface->container) ++ wined3d_texture_set_dirty(dst_surface->container); ++ + error: + if (flags && FIXME_ON(d3d_surface)) + { +@@ -4893,12 +4918,24 @@ error: + } + + release: +- wined3d_surface_unmap(dst_surface); +- if (src_surface && src_surface != dst_surface) +- wined3d_surface_unmap(src_surface); ++ if (dst_data) ++ { ++ wined3d_resource_release_map_ptr(&dst_surface->resource, context); ++ ++ if (dst_surface->container->swapchain ++ && dst_surface->container == dst_surface->container->swapchain->front_buffer) ++ { ++ dst_surface->lockedRect = *dst_rect; ++ dst_surface->surface_ops->surface_frontbuffer_updated(dst_surface); ++ } ++ } ++ if (src_surface && src_surface != dst_surface && src_data) ++ wined3d_resource_release_map_ptr(&src_surface->resource, context); + /* Release the converted surface, if any. */ + if (src_texture) + wined3d_texture_decref(src_texture); ++ if (context) ++ context_release(context); + + return hr; + } +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0044-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0044-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0044-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0044-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -From a605e2c29345026b85ef529bb72bb83422423d14 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 20 Dec 2012 14:19:52 +0100 -Subject: wined3d: Get rid of state access in shader_generate_glsl_declarations - ---- - dlls/wined3d/glsl_shader.c | 21 ++++++--------------- - 1 file changed, 6 insertions(+), 15 deletions(-) - -diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c -index 76d2c35..5b0b174 100644 ---- a/dlls/wined3d/glsl_shader.c -+++ b/dlls/wined3d/glsl_shader.c -@@ -1497,11 +1497,9 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont - const struct wined3d_shader_reg_maps *reg_maps, const struct shader_glsl_ctx_priv *ctx_priv) - { - const struct wined3d_shader_version *version = ®_maps->shader_version; -- const struct wined3d_state *state = &shader->device->state; - const struct vs_compile_args *vs_args = ctx_priv->cur_vs_args; - const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args; - const struct wined3d_gl_info *gl_info = context->gl_info; -- const struct wined3d_fb_state *fb = &state->fb; - unsigned int i, extra_constants_needed = 0; - const struct wined3d_shader_lconst *lconst; - const char *prefix; -@@ -1751,7 +1749,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont - { - UINT in_count = min(vec4_varyings(version->major, gl_info), shader->limits->packed_input); - -- if (use_vs(state)) -+ if (ps_args->vp_mode == vertexshader) - shader_addline(buffer, "varying vec4 %s_link[%u];\n", prefix, in_count); - shader_addline(buffer, "vec4 %s_in[%u];\n", prefix, in_count); - } -@@ -1792,21 +1790,14 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont - } - else - { -- float ycorrection[] = -- { -- context->render_offscreen ? 0.0f : fb->render_targets[0]->height, -- context->render_offscreen ? 1.0f : -1.0f, -- 0.0f, -- 0.0f, -- }; -- - /* This happens because we do not have proper tracking of the - * constant registers that are actually used, only the max -- * limit of the shader version. */ -+ * limit of the shader version. -+ * -+ * FIXME 2: This is wrong, there's no need to do this. Get rid of -+ * it and just create the uniform. -+ */ - FIXME("Cannot find a free uniform for vpos correction params\n"); -- shader_addline(buffer, "const vec4 ycorrection = "); -- shader_glsl_append_imm_vec4(buffer, ycorrection); -- shader_addline(buffer, ";\n"); - } - shader_addline(buffer, "vec4 vpos;\n"); - } --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0045-wined3d-Move-the-framebuffer-into-wined3d_state.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0045-wined3d-Move-the-framebuffer-into-wined3d_state.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0045-wined3d-Move-the-framebuffer-into-wined3d_state.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0045-wined3d-Move-the-framebuffer-into-wined3d_state.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,942 @@ +From 99ec63d5b866c832fd8dce4b249a338dd80a505e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 20 Dec 2012 13:09:17 +0100 +Subject: wined3d: Move the framebuffer into wined3d_state + +--- + dlls/wined3d/arb_program_shader.c | 4 +- + dlls/wined3d/context.c | 20 +++++-- + dlls/wined3d/cs.c | 21 ++----- + dlls/wined3d/device.c | 117 +++++++++++++++++--------------------- + dlls/wined3d/drawprim.c | 14 ++--- + dlls/wined3d/glsl_shader.c | 2 +- + dlls/wined3d/shader.c | 2 +- + dlls/wined3d/state.c | 20 +++---- + dlls/wined3d/stateblock.c | 45 +++++++++++++-- + dlls/wined3d/surface.c | 2 +- + dlls/wined3d/swapchain.c | 2 +- + dlls/wined3d/utils.c | 4 +- + dlls/wined3d/wined3d_private.h | 46 +++++++++++---- + 13 files changed, 172 insertions(+), 127 deletions(-) + +diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c +index eb46f8c..34e210a 100644 +--- a/dlls/wined3d/arb_program_shader.c ++++ b/dlls/wined3d/arb_program_shader.c +@@ -684,7 +684,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, + { + const struct wined3d_shader *pshader = state->shader[WINED3D_SHADER_TYPE_PIXEL]; + const struct arb_ps_compiled_shader *gl_shader = priv->compiled_fprog; +- UINT rt_height = state->fb->render_targets[0]->height; ++ UINT rt_height = state->fb.render_targets[0]->height; + + /* Load DirectX 9 float constants for pixel shader */ + priv->highest_dirty_ps_const = shader_arb_load_constantsF(pshader, gl_info, GL_FRAGMENT_PROGRAM_ARB, +@@ -4702,7 +4702,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context + } + else + { +- UINT rt_height = state->fb->render_targets[0]->height; ++ UINT rt_height = state->fb.render_targets[0]->height; + shader_arb_ps_local_constants(compiled, context, state, rt_height); + } + +diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c +index fb065cd..42a221c 100644 +--- a/dlls/wined3d/context.c ++++ b/dlls/wined3d/context.c +@@ -1475,6 +1475,12 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, + goto out; + } + ++ ret->current_fb.render_targets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ++ sizeof(*ret->current_fb.render_targets) * gl_info->limits.buffers); ++ ret->current_fb.rt_size = gl_info->limits.buffers; ++ if (!ret->current_fb.render_targets) ++ goto out; ++ + /* Initialize the texture unit mapping to a 1:1 mapping */ + for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s) + { +@@ -1793,6 +1799,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, + out: + device->shader_backend->shader_free_context_data(ret); + device->adapter->fragment_pipe->free_context_data(ret); ++ HeapFree(GetProcessHeap(), 0, ret->current_fb.render_targets); + HeapFree(GetProcessHeap(), 0, ret->free_event_queries); + HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries); + HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries); +@@ -1827,6 +1834,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont + + device->shader_backend->shader_free_context_data(context); + device->adapter->fragment_pipe->free_context_data(context); ++ HeapFree(GetProcessHeap(), 0, context->current_fb.render_targets); + HeapFree(GetProcessHeap(), 0, context->draw_buffers); + HeapFree(GetProcessHeap(), 0, context->blit_targets); + device_context_remove(device, context); +@@ -2342,7 +2350,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win + DWORD rt_mask = 0, *cur_mask; + UINT i; + +- if (isStateDirty(context, STATE_FRAMEBUFFER) || fb != &device->fb ++ if (isStateDirty(context, STATE_FRAMEBUFFER) || !wined3d_fb_equal(fb, &context->current_fb) + || rt_count != context->gl_info->limits.buffers) + { + if (!context_validate_rt_config(rt_count, rts, dsv)) +@@ -2387,6 +2395,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win + rt_mask = context_generate_rt_mask_no_fbo(device, + rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); + } ++ ++ wined3d_fb_copy(&context->current_fb, fb); + } + else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO + && (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource))) +@@ -2437,7 +2447,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win + static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_device *device) + { + const struct wined3d_state *state = &device->state; +- struct wined3d_rendertarget_view **rts = state->fb->render_targets; ++ struct wined3d_rendertarget_view **rts = state->fb.render_targets; + struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL]; + DWORD rt_mask, rt_mask_bits; + unsigned int i; +@@ -2467,7 +2477,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const + void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) + { + const struct wined3d_device *device = context->swapchain->device; +- const struct wined3d_fb_state *fb = state->fb; ++ const struct wined3d_fb_state *fb = &state->fb; + DWORD rt_mask = find_draw_buffers_mask(context, device); + DWORD *cur_mask; + +@@ -2499,6 +2509,8 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat + context_apply_draw_buffers(context, rt_mask); + *cur_mask = rt_mask; + } ++ ++ wined3d_fb_copy(&context->current_fb, &state->fb); + } + + static void context_map_stage(struct wined3d_context *context, DWORD stage, DWORD unit) +@@ -3087,7 +3099,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de + { + const struct wined3d_state *state = &device->state; + const struct StateEntry *state_table = context->state_table; +- const struct wined3d_fb_state *fb = state->fb; ++ const struct wined3d_fb_state *fb = &state->fb; + unsigned int i, j; + WORD map; + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 874129a..22a2de8 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -290,7 +290,7 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) + device = cs->device; + wined3d_get_draw_rect(&device->state, &draw_rect); + device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, +- &device->fb, op->rect_count, op->rects, &draw_rect, op->flags, ++ &cs->state.fb, op->rect_count, op->rects, &draw_rect, op->flags, + op->color, op->depth, op->stencil); + } + +@@ -397,7 +397,7 @@ static void wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const v + { + const struct wined3d_cs_set_rendertarget_view *op = data; + +- cs->state.fb->render_targets[op->view_idx] = op->view; ++ cs->state.fb.render_targets[op->view_idx] = op->view; + device_invalidate_state(cs->device, STATE_FRAMEBUFFER); + } + +@@ -420,7 +420,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const + struct wined3d_device *device = cs->device; + struct wined3d_rendertarget_view *prev; + +- if ((prev = cs->state.fb->depth_stencil)) ++ if ((prev = cs->state.fb.depth_stencil)) + { + struct wined3d_surface *prev_surface = wined3d_rendertarget_view_get_surface(prev); + +@@ -436,7 +436,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const + } + } + +- cs->fb.depth_stencil = op->view; ++ cs->state.fb.depth_stencil = op->view; + + if (!prev != !op->view) + { +@@ -1004,7 +1004,7 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) + + state_cleanup(&cs->state); + memset(&cs->state, 0, sizeof(cs->state)); +- if (FAILED(hr = state_init(&cs->state, &cs->fb, &adapter->gl_info, &adapter->d3d_info, ++ if (FAILED(hr = state_init(&cs->state, &adapter->gl_info, &adapter->d3d_info, + WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT))) + ERR("Failed to initialize CS state, hr %#x.\n", hr); + } +@@ -1087,17 +1087,9 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) + if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs)))) + return NULL; + +- if (!(cs->fb.render_targets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, +- sizeof(*cs->fb.render_targets) * gl_info->limits.buffers))) +- { +- HeapFree(GetProcessHeap(), 0, cs); +- return NULL; +- } +- +- if (FAILED(state_init(&cs->state, &cs->fb, gl_info, &device->adapter->d3d_info, ++ if (FAILED(state_init(&cs->state, gl_info, &device->adapter->d3d_info, + WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT))) + { +- HeapFree(GetProcessHeap(), 0, cs->fb.render_targets); + HeapFree(GetProcessHeap(), 0, cs); + return NULL; + } +@@ -1118,7 +1110,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) + void wined3d_cs_destroy(struct wined3d_cs *cs) + { + state_cleanup(&cs->state); +- HeapFree(GetProcessHeap(), 0, cs->fb.render_targets); + HeapFree(GetProcessHeap(), 0, cs->data); + HeapFree(GetProcessHeap(), 0, cs); + } +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index a13fb54..990545d 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -860,7 +860,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi + BOOL ds_enable = !!swapchain->desc.enable_auto_depth_stencil; + unsigned int i; + +- if (device->fb.render_targets) ++ if (device->state.fb.render_targets) + { + for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) + { +@@ -878,7 +878,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + struct wined3d_swapchain_desc *swapchain_desc) + { + static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f}; +- const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + struct wined3d_swapchain *swapchain = NULL; + struct wined3d_context *context; + DWORD clear_flags = 0; +@@ -891,9 +890,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + if (device->wined3d->flags & WINED3D_NO3D) + return WINED3DERR_INVALIDCALL; + +- device->fb.render_targets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, +- sizeof(*device->fb.render_targets) * gl_info->limits.buffers); +- + if (FAILED(hr = device->shader_backend->shader_alloc_private(device, + device->adapter->vertex_pipe, device->adapter->fragment_pipe))) + { +@@ -981,7 +977,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + return WINED3D_OK; + + err_out: +- HeapFree(GetProcessHeap(), 0, device->fb.render_targets); + HeapFree(GetProcessHeap(), 0, device->swapchains); + device->swapchain_count = 0; + if (device->back_buffer_view) +@@ -1060,8 +1055,25 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + if (device->cursor_texture) + wined3d_texture_decref(device->cursor_texture); + ++ /* Release the buffers (with sanity checks). ++ * FIXME: Move this move into a separate patch. I think the idea ++ * behind this is that those surfaces should be freed before unloading ++ * remaining resources below. */ ++ if (device->onscreen_depth_stencil) ++ { ++ surface = device->onscreen_depth_stencil; ++ device->onscreen_depth_stencil = NULL; ++ wined3d_surface_decref(surface); ++ } ++ + state_unbind_resources(&device->state); + ++ if (device->auto_depth_stencil_view) ++ { ++ wined3d_rendertarget_view_decref(device->auto_depth_stencil_view); ++ device->auto_depth_stencil_view = NULL; ++ } ++ + /* Unload resources */ + LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) + { +@@ -1092,37 +1104,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + * destroy the context. */ + context_release(context); + +- /* Release the buffers (with sanity checks)*/ +- if (device->onscreen_depth_stencil) +- { +- surface = device->onscreen_depth_stencil; +- device->onscreen_depth_stencil = NULL; +- wined3d_surface_decref(surface); +- } +- +- if (device->fb.depth_stencil) +- { +- struct wined3d_rendertarget_view *view = device->fb.depth_stencil; +- +- TRACE("Releasing depth/stencil view %p.\n", view); +- +- device->fb.depth_stencil = NULL; +- wined3d_rendertarget_view_decref(view); +- } +- +- if (device->auto_depth_stencil_view) +- { +- struct wined3d_rendertarget_view *view = device->auto_depth_stencil_view; +- +- device->auto_depth_stencil_view = NULL; +- if (wined3d_rendertarget_view_decref(view)) +- ERR("Something's still holding the auto depth/stencil view (%p).\n", view); +- } +- +- for (i = 0; i < gl_info->limits.buffers; ++i) +- { +- wined3d_device_set_rendertarget_view(device, i, NULL, FALSE); +- } + if (device->back_buffer_view) + { + wined3d_rendertarget_view_decref(device->back_buffer_view); +@@ -1140,9 +1121,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + device->swapchains = NULL; + device->swapchain_count = 0; + +- HeapFree(GetProcessHeap(), 0, device->fb.render_targets); +- device->fb.render_targets = NULL; +- + device->d3d_initialized = FALSE; + + return WINED3D_OK; +@@ -1939,7 +1917,7 @@ static void resolve_depth_buffer(struct wined3d_state *state) + || !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) + return; + surface = surface_from_resource(texture->sub_resources[0]); +- if (!(depth_stencil = wined3d_rendertarget_view_get_surface(state->fb->depth_stencil))) ++ if (!(depth_stencil = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil))) + return; + + wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT); +@@ -3328,6 +3306,8 @@ HRESULT CDECL wined3d_device_present(const struct wined3d_device *device, const + HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, + const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) + { ++ const struct wined3d_fb_state *fb = &device->state.fb; ++ + TRACE("device %p, rect_count %u, rects %p, flags %#x, color {%.8e, %.8e, %.8e, %.8e}, depth %.8e, stencil %u.\n", + device, rect_count, rects, flags, color->r, color->g, color->b, color->a, depth, stencil); + +@@ -3339,7 +3319,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou + + if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) + { +- struct wined3d_rendertarget_view *ds = device->fb.depth_stencil; ++ struct wined3d_rendertarget_view *ds = fb->depth_stencil; + if (!ds) + { + WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n"); +@@ -3348,8 +3328,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou + } + else if (flags & WINED3DCLEAR_TARGET) + { +- if (ds->width < device->fb.render_targets[0]->width +- || ds->height < device->fb.render_targets[0]->height) ++ if (ds->width < fb->render_targets[0]->width ++ || ds->height < fb->render_targets[0]->height) + { + WARN("Silently ignoring depth and target clear with mismatching sizes\n"); + return WINED3D_OK; +@@ -3725,8 +3705,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device + if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] + || state->render_states[WINED3D_RS_STENCILENABLE]) + { +- struct wined3d_rendertarget_view *rt = device->fb.render_targets[0]; +- struct wined3d_rendertarget_view *ds = device->fb.depth_stencil; ++ struct wined3d_rendertarget_view *rt = state->fb.render_targets[0]; ++ struct wined3d_rendertarget_view *ds = state->fb.depth_stencil; + + if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) + { +@@ -3952,20 +3932,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co + return NULL; + } + +- return device->fb.render_targets[view_idx]; ++ return device->state.fb.render_targets[view_idx]; + } + + struct wined3d_rendertarget_view * CDECL wined3d_device_get_depth_stencil_view(const struct wined3d_device *device) + { + TRACE("device %p.\n", device); + +- return device->fb.depth_stencil; ++ return device->state.fb.depth_stencil; + } + + HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device, + unsigned int view_idx, struct wined3d_rendertarget_view *view, BOOL set_viewport) + { + struct wined3d_rendertarget_view *prev; ++ struct wined3d_fb_state *fb = &device->state.fb; + + TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n", + device, view_idx, view, set_viewport); +@@ -4005,13 +3986,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device + } + + +- prev = device->fb.render_targets[view_idx]; ++ prev = fb->render_targets[view_idx]; + if (view == prev) + return WINED3D_OK; + + if (view) + wined3d_rendertarget_view_incref(view); +- device->fb.render_targets[view_idx] = view; ++ fb->render_targets[view_idx] = view; + wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view); + /* Release after the assignment, to prevent device_resource_released() + * from seeing the surface as still in use. */ +@@ -4023,18 +4004,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device + + void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) + { ++ struct wined3d_fb_state *fb = &device->state.fb; + struct wined3d_rendertarget_view *prev; + + TRACE("device %p, view %p.\n", device, view); + +- prev = device->fb.depth_stencil; ++ prev = fb->depth_stencil; + if (prev == view) + { + TRACE("Trying to do a NOP SetRenderTarget operation.\n"); + return; + } + +- if ((device->fb.depth_stencil = view)) ++ if ((fb->depth_stencil = view)) + wined3d_rendertarget_view_incref(view); + wined3d_cs_emit_set_depth_stencil_view(device->cs, view); + if (prev) +@@ -4391,10 +4373,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + wined3d_texture_decref(device->cursor_texture); + device->cursor_texture = NULL; + } +- state_unbind_resources(&device->state); + } + +- if (device->fb.render_targets) ++ if (device->state.fb.render_targets) + { + for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) + { +@@ -4403,6 +4384,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + } + wined3d_device_set_depth_stencil_view(device, NULL); + ++ if (reset_state) ++ { ++ state_unbind_resources(&device->state); ++ } ++ + if (device->onscreen_depth_stencil) + { + wined3d_surface_decref(device->onscreen_depth_stencil); +@@ -4693,7 +4679,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + if (device->d3d_initialized) + delete_opengl_contexts(device, swapchain); + +- if (FAILED(hr = state_init(&device->state, &device->fb, &device->adapter->gl_info, ++ if (FAILED(hr = state_init(&device->state, &device->adapter->gl_info, + &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) + ERR("Failed to initialize device state, hr %#x.\n", hr); + device->update_state = &device->state; +@@ -4702,22 +4688,21 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + } + else if (device->back_buffer_view) + { +- struct wined3d_rendertarget_view *view = device->back_buffer_view; + struct wined3d_state *state = &device->state; + +- wined3d_device_set_rendertarget_view(device, 0, view, FALSE); ++ wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE); + + /* Note the min_z / max_z is not reset. */ + state->viewport.x = 0; + state->viewport.y = 0; +- state->viewport.width = view->width; +- state->viewport.height = view->height; ++ state->viewport.width = swapchain->desc.backbuffer_width; ++ state->viewport.height = swapchain->desc.backbuffer_height; + wined3d_cs_emit_set_viewport(device->cs, &state->viewport); + + state->scissor_rect.top = 0; + state->scissor_rect.left = 0; +- state->scissor_rect.right = view->width; +- state->scissor_rect.bottom = view->height; ++ state->scissor_rect.right = swapchain->desc.backbuffer_width; ++ state->scissor_rect.bottom = swapchain->desc.backbuffer_height; + wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); + } + +@@ -4808,17 +4793,17 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso + + for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) + { +- if (wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]) == surface) ++ if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface) + { + ERR("Surface %p is still in use as render target %u.\n", surface, i); +- device->fb.render_targets[i] = NULL; ++ device->state.fb.render_targets[i] = NULL; + } + } + +- if (wined3d_rendertarget_view_get_surface(device->fb.depth_stencil) == surface) ++ if (wined3d_rendertarget_view_get_surface(device->state.fb.depth_stencil) == surface) + { + ERR("Surface %p is still in use as depth/stencil buffer.\n", surface); +- device->fb.depth_stencil = NULL; ++ device->state.fb.depth_stencil = NULL; + } + } + break; +@@ -4981,7 +4966,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, + + device->blitter = adapter->blitter; + +- if (FAILED(hr = state_init(&device->state, &device->fb, &adapter->gl_info, ++ if (FAILED(hr = state_init(&device->state, &adapter->gl_info, + &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) + { + ERR("Failed to initialize device state, hr %#x.\n", hr); +diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c +index f2c2f42..c6a72fc 100644 +--- a/dlls/wined3d/drawprim.c ++++ b/dlls/wined3d/drawprim.c +@@ -611,7 +611,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co + + if (!index_count) return; + +- context = context_acquire(device, wined3d_rendertarget_view_get_surface(device->fb.render_targets[0])); ++ context = context_acquire(device, wined3d_rendertarget_view_get_surface(state->fb.render_targets[0])); + if (!context->valid) + { + context_release(context); +@@ -625,7 +625,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co + /* Invalidate the back buffer memory so LockRect will read it the next time */ + for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) + { +- struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]); ++ struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(state->fb.render_targets[i]); + if (target) + { + wined3d_resource_load_location(&target->resource, context, target->container->resource.draw_binding); +@@ -634,18 +634,18 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co + } + } + +- if (device->fb.depth_stencil) ++ if (state->fb.depth_stencil) + { + /* Note that this depends on the context_acquire() call above to set + * context->render_offscreen properly. We don't currently take the + * Z-compare function into account, but we could skip loading the + * depthstencil for D3DCMP_NEVER and D3DCMP_ALWAYS as well. Also note + * that we never copy the stencil data.*/ +- DWORD location = context->render_offscreen ? device->fb.depth_stencil->resource->draw_binding ++ DWORD location = context->render_offscreen ? state->fb.depth_stencil->resource->draw_binding + : WINED3D_LOCATION_DRAWABLE; + if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE]) + { +- struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(device->fb.depth_stencil); ++ struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil); + RECT current_rect, draw_rect, r; + + if (!context->render_offscreen && ds != device->onscreen_depth_stencil) +@@ -671,9 +671,9 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co + return; + } + +- if (device->fb.depth_stencil && state->render_states[WINED3D_RS_ZWRITEENABLE]) ++ if (state->fb.depth_stencil && state->render_states[WINED3D_RS_ZWRITEENABLE]) + { +- struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(device->fb.depth_stencil); ++ struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil); + DWORD location = context->render_offscreen ? ds->container->resource.draw_binding : WINED3D_LOCATION_DRAWABLE; + + surface_modify_ds_location(ds, location, ds->ds_current_size.cx, ds->ds_current_size.cy); +diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c +index 5ba246e..4775ff9 100644 +--- a/dlls/wined3d/glsl_shader.c ++++ b/dlls/wined3d/glsl_shader.c +@@ -1531,7 +1531,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont + const struct vs_compile_args *vs_args = ctx_priv->cur_vs_args; + const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args; + const struct wined3d_gl_info *gl_info = context->gl_info; +- const struct wined3d_fb_state *fb = &shader->device->fb; ++ const struct wined3d_fb_state *fb = &state->fb; + unsigned int i, extra_constants_needed = 0; + const struct wined3d_shader_lconst *lconst; + const char *prefix; +diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c +index 5b32528..1c401c4 100644 +--- a/dlls/wined3d/shader.c ++++ b/dlls/wined3d/shader.c +@@ -2411,7 +2411,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 + memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */ + if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && state->render_states[WINED3D_RS_SRGBWRITEENABLE]) + { +- unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags; ++ unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags; + if (rt_fmt_flags & WINED3DFMT_FLAG_SRGB_WRITE) + { + static unsigned int warned = 0; +diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c +index b7d7f92..59f9fd8 100644 +--- a/dlls/wined3d/state.c ++++ b/dlls/wined3d/state.c +@@ -105,7 +105,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_ + const struct wined3d_gl_info *gl_info = context->gl_info; + + /* No z test without depth stencil buffers */ +- if (!state->fb->depth_stencil) ++ if (!state->fb.depth_stencil) + { + TRACE("No Z buffer - disabling depth test\n"); + zenable = WINED3D_ZB_FALSE; +@@ -367,8 +367,8 @@ static GLenum gl_blend_factor(enum wined3d_blend factor, const struct wined3d_fo + + static void state_blend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) + { +- const struct wined3d_format *rt_format = state->fb->render_targets[0]->format; +- unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags; ++ const struct wined3d_format *rt_format = state->fb.render_targets[0]->format; ++ unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags; + const struct wined3d_gl_info *gl_info = context->gl_info; + GLenum srcBlend, dstBlend; + enum wined3d_blend d3d_blend; +@@ -813,7 +813,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ + GLint depthFail_ccw; + + /* No stencil test without a stencil buffer. */ +- if (!state->fb->depth_stencil) ++ if (!state->fb.depth_stencil) + { + gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST); + checkGLcall("glDisable GL_STENCIL_TEST"); +@@ -909,7 +909,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ + + static void state_stencilwrite2s(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) + { +- DWORD mask = state->fb->depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0; ++ DWORD mask = state->fb.depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0; + const struct wined3d_gl_info *gl_info = context->gl_info; + + GL_EXTCALL(glActiveStencilFaceEXT(GL_BACK)); +@@ -923,7 +923,7 @@ static void state_stencilwrite2s(struct wined3d_context *context, const struct w + + static void state_stencilwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) + { +- DWORD mask = state->fb->depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0; ++ DWORD mask = state->fb.depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0; + const struct wined3d_gl_info *gl_info = context->gl_info; + + gl_info->gl_ops.gl.p_glStencilMask(mask); +@@ -1644,7 +1644,7 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 + if (state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS] + || state->render_states[WINED3D_RS_DEPTHBIAS]) + { +- const struct wined3d_rendertarget_view *depth = state->fb->depth_stencil; ++ const struct wined3d_rendertarget_view *depth = state->fb.depth_stencil; + float scale; + + union +@@ -4542,7 +4542,7 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine + + static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) + { +- const struct wined3d_rendertarget_view *target = state->fb->render_targets[0]; ++ const struct wined3d_rendertarget_view *target = state->fb.render_targets[0]; + const struct wined3d_gl_info *gl_info = context->gl_info; + struct wined3d_viewport vp = state->viewport; + +@@ -4720,7 +4720,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st + } + else + { +- const struct wined3d_rendertarget_view *target = state->fb->render_targets[0]; ++ const struct wined3d_rendertarget_view *target = state->fb.render_targets[0]; + UINT height; + UINT width; + +@@ -4784,7 +4784,7 @@ static void psorigin(struct wined3d_context *context, const struct wined3d_state + + void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) + { +- unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags; ++ unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags; + const struct wined3d_gl_info *gl_info = context->gl_info; + + TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); +diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c +index 763a5f9..790d769 100644 +--- a/dlls/wined3d/stateblock.c ++++ b/dlls/wined3d/stateblock.c +@@ -464,6 +464,7 @@ void state_unbind_resources(struct wined3d_state *state) + struct wined3d_texture *texture; + struct wined3d_buffer *buffer; + struct wined3d_shader *shader; ++ struct wined3d_rendertarget_view *view; + unsigned int i, j; + + if ((decl = state->vertex_declaration)) +@@ -540,6 +541,31 @@ void state_unbind_resources(struct wined3d_state *state) + } + } + } ++ ++ if (state->fb.depth_stencil) ++ { ++ view = state->fb.depth_stencil; ++ ++ TRACE("Releasing depth/stencil buffer %p.\n", view); ++ ++ state->fb.depth_stencil = NULL; ++ wined3d_rendertarget_view_decref(view); ++ } ++ ++ if (state->fb.render_targets) ++ { ++ for (i = 0; i < state->fb.rt_size; i++) ++ { ++ view = state->fb.render_targets[i]; ++ TRACE("Setting rendertarget %u to NULL\n", i); ++ state->fb.render_targets[i] = NULL; ++ if (view) ++ { ++ TRACE("Releasing the rendertarget view at %p\n", view); ++ wined3d_rendertarget_view_decref(view); ++ } ++ } ++ } + } + + void state_cleanup(struct wined3d_state *state) +@@ -567,6 +593,7 @@ void state_cleanup(struct wined3d_state *state) + + HeapFree(GetProcessHeap(), 0, state->vs_consts_f); + HeapFree(GetProcessHeap(), 0, state->ps_consts_f); ++ HeapFree(GetProcessHeap(), 0, state->fb.render_targets); + } + + ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock) +@@ -1310,14 +1337,12 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d + } + } + +-HRESULT state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, +- const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, +- DWORD flags) ++HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, ++ const struct wined3d_d3d_info *d3d_info, DWORD flags) + { + unsigned int i; + + state->flags = flags; +- state->fb = fb; + + for (i = 0; i < LIGHTMAP_SIZE; i++) + { +@@ -1335,6 +1360,15 @@ HRESULT state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, + return E_OUTOFMEMORY; + } + ++ if (!(state->fb.render_targets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ++ sizeof(*state->fb.render_targets) * gl_info->limits.buffers))) ++ { ++ HeapFree(GetProcessHeap(), 0, state->ps_consts_f); ++ HeapFree(GetProcessHeap(), 0, state->vs_consts_f); ++ return E_OUTOFMEMORY; ++ } ++ state->fb.rt_size = gl_info->limits.buffers; ++ + if (flags & WINED3D_STATE_INIT_DEFAULT) + state_init_default(state, gl_info); + +@@ -1345,12 +1379,13 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, + struct wined3d_device *device, enum wined3d_stateblock_type type) + { + HRESULT hr; ++ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; + + stateblock->ref = 1; + stateblock->device = device; + +- if (FAILED(hr = state_init(&stateblock->state, NULL, &device->adapter->gl_info, d3d_info, 0))) ++ if (FAILED(hr = state_init(&stateblock->state, gl_info, d3d_info, 0))) + return hr; + + if (FAILED(hr = stateblock_allocate_shader_constants(stateblock))) +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index f415b56..1808153 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -3418,8 +3418,8 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE + enum wined3d_texture_filter_type filter) + { + struct wined3d_device *device = dst_surface->resource.device; +- const struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(device->fb.render_targets[0]); + struct wined3d_swapchain *src_swapchain, *dst_swapchain; ++ const struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[0]); + + TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, blt_fx %p, filter %s.\n", + dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index 1ac5e7a..454cb21 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -421,7 +421,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + { + struct wined3d_surface *back_buffer = surface_from_resource( + wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)); +- const struct wined3d_fb_state *fb = &swapchain->device->fb; ++ const struct wined3d_fb_state *fb = &swapchain->device->state.fb; + const struct wined3d_gl_info *gl_info; + struct wined3d_context *context; + struct wined3d_surface *front; +diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c +index 44ba7ad..ade92b2 100644 +--- a/dlls/wined3d/utils.c ++++ b/dlls/wined3d/utils.c +@@ -3514,7 +3514,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w + float y_offset = context->render_offscreen + ? (center_offset - (2.0f * y) - h) / h + : (center_offset - (2.0f * y) - h) / -h; +- enum wined3d_depth_buffer_type zenable = state->fb->depth_stencil ? ++ enum wined3d_depth_buffer_type zenable = state->fb.depth_stencil ? + state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE; + float z_scale = zenable ? 2.0f : 0.0f; + float z_offset = zenable ? -1.0f : 0.0f; +@@ -4104,7 +4104,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d + unsigned int i; + DWORD ttff; + DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2; +- unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags; ++ unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags; + const struct wined3d_gl_info *gl_info = context->gl_info; + const struct wined3d_d3d_info *d3d_info = context->d3d_info; + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 7f9436a..a19fabe 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -1137,6 +1137,36 @@ struct wined3d_timestamp_query + void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; + void context_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; + ++struct wined3d_fb_state ++{ ++ struct wined3d_rendertarget_view **render_targets; ++ struct wined3d_rendertarget_view *depth_stencil; ++ UINT rt_size; ++}; ++ ++static inline BOOL wined3d_fb_equal(const struct wined3d_fb_state *fb1, const struct wined3d_fb_state *fb2) ++{ ++ UINT i; ++ ++ if (fb1->depth_stencil != fb2->depth_stencil) ++ return FALSE; ++ if (fb1->rt_size != fb2->rt_size) ++ return FALSE; ++ for (i = 0; i < fb1->rt_size; i++) ++ if (fb1->render_targets[i] != fb2->render_targets[i]) ++ return FALSE; ++ return TRUE; ++} ++ ++static inline void wined3d_fb_copy(struct wined3d_fb_state *dst, const struct wined3d_fb_state *src) ++{ ++ UINT i; ++ ++ dst->depth_stencil = src->depth_stencil; ++ for (i = 0; i < min(dst->rt_size, src->rt_size); i++) ++ dst->render_targets[i] = src->render_targets[i]; ++} ++ + struct wined3d_context + { + const struct wined3d_gl_info *gl_info; +@@ -1151,6 +1181,7 @@ struct wined3d_context + DWORD dirtyArray[STATE_HIGHEST + 1]; /* Won't get bigger than that, a state is never marked dirty 2 times */ + DWORD numDirtyEntries; + DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */ ++ struct wined3d_fb_state current_fb; + + struct wined3d_swapchain *swapchain; + struct wined3d_surface *current_rt; +@@ -1252,12 +1283,6 @@ struct wined3d_context + GLuint dummy_arbfp_prog; + }; + +-struct wined3d_fb_state +-{ +- struct wined3d_rendertarget_view **render_targets; +- struct wined3d_rendertarget_view *depth_stencil; +-}; +- + typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); + + struct StateEntry +@@ -1941,7 +1966,7 @@ struct wined3d_stream_state + struct wined3d_state + { + DWORD flags; +- const struct wined3d_fb_state *fb; ++ struct wined3d_fb_state fb; + + struct wined3d_vertex_declaration *vertex_declaration; + struct wined3d_stream_output stream_output[MAX_STREAM_OUT]; +@@ -2047,7 +2072,6 @@ struct wined3d_device + struct wine_rb_tree samplers; + + /* Render Target Support */ +- struct wined3d_fb_state fb; + struct wined3d_surface *onscreen_depth_stencil; + struct wined3d_rendertarget_view *auto_depth_stencil_view; + +@@ -2553,9 +2577,8 @@ struct wined3d_stateblock + void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; + + void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; +-HRESULT state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, +- const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, +- DWORD flags) DECLSPEC_HIDDEN; ++HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, ++ const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; + void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; + + struct wined3d_cs_ops +@@ -2568,7 +2591,6 @@ struct wined3d_cs + { + const struct wined3d_cs_ops *ops; + struct wined3d_device *device; +- struct wined3d_fb_state fb; + struct wined3d_state state; + + size_t data_size; +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0045-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0045-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0045-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0045-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -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 - -FIXME: Merge this with the preload calls done by -context_update_stream_info, preload only used buffers - -FIXME2: Merge this patch with the patch that removes -PreLoad from buffer_unmap - -FIXME3: There may be more unintended consequences of calling preload -here... ---- - dlls/wined3d/buffer.c | 2 +- - dlls/wined3d/context.c | 6 +++++- - dlls/wined3d/wined3d_private.h | 1 - - 3 files changed, 6 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -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("glUnmapBuffer"); - } - --void buffer_mark_used(struct wined3d_buffer *buffer) -+static void buffer_mark_used(struct wined3d_buffer *buffer) - { - buffer->flags &= ~(WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); - } -diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -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 - for (i = 0, map = context->stream_info.use_map; map; map >>= 1, ++i) - { - if (map & 1) -- buffer_mark_used(state->streams[context->stream_info.elements[i].stream_idx].buffer); -+ buffer_internal_preload(state->streams[context->stream_info.elements[i].stream_idx].buffer, -+ context, state); - } -+ /* PreLoad may kick buffers out of vram. */ -+ if (isStateDirty(context, STATE_STREAMSRC)) -+ context_update_stream_info(context, state); - } - if (state->index_buffer) - { -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index fd7e8f9..69c984ba 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2686,7 +2686,6 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co - BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; - void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, - const struct wined3d_state *state) DECLSPEC_HIDDEN; --void buffer_mark_used(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - - struct wined3d_rendertarget_view - { --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0046-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0046-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0046-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0046-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,64 @@ +From a605e2c29345026b85ef529bb72bb83422423d14 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 20 Dec 2012 14:19:52 +0100 +Subject: wined3d: Get rid of state access in shader_generate_glsl_declarations + +--- + dlls/wined3d/glsl_shader.c | 21 ++++++--------------- + 1 file changed, 6 insertions(+), 15 deletions(-) + +diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c +index 76d2c35..5b0b174 100644 +--- a/dlls/wined3d/glsl_shader.c ++++ b/dlls/wined3d/glsl_shader.c +@@ -1497,11 +1497,9 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont + const struct wined3d_shader_reg_maps *reg_maps, const struct shader_glsl_ctx_priv *ctx_priv) + { + const struct wined3d_shader_version *version = ®_maps->shader_version; +- const struct wined3d_state *state = &shader->device->state; + const struct vs_compile_args *vs_args = ctx_priv->cur_vs_args; + const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args; + const struct wined3d_gl_info *gl_info = context->gl_info; +- const struct wined3d_fb_state *fb = &state->fb; + unsigned int i, extra_constants_needed = 0; + const struct wined3d_shader_lconst *lconst; + const char *prefix; +@@ -1751,7 +1749,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont + { + UINT in_count = min(vec4_varyings(version->major, gl_info), shader->limits->packed_input); + +- if (use_vs(state)) ++ if (ps_args->vp_mode == vertexshader) + shader_addline(buffer, "varying vec4 %s_link[%u];\n", prefix, in_count); + shader_addline(buffer, "vec4 %s_in[%u];\n", prefix, in_count); + } +@@ -1792,21 +1790,14 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont + } + else + { +- float ycorrection[] = +- { +- context->render_offscreen ? 0.0f : fb->render_targets[0]->height, +- context->render_offscreen ? 1.0f : -1.0f, +- 0.0f, +- 0.0f, +- }; +- + /* This happens because we do not have proper tracking of the + * constant registers that are actually used, only the max +- * limit of the shader version. */ ++ * limit of the shader version. ++ * ++ * FIXME 2: This is wrong, there's no need to do this. Get rid of ++ * it and just create the uniform. ++ */ + FIXME("Cannot find a free uniform for vpos correction params\n"); +- shader_addline(buffer, "const vec4 ycorrection = "); +- shader_glsl_append_imm_vec4(buffer, ycorrection); +- shader_addline(buffer, ";\n"); + } + shader_addline(buffer, "vec4 vpos;\n"); + } +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0046-wined3d-Hackily-introduce-a-multithreaded-command-st.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0046-wined3d-Hackily-introduce-a-multithreaded-command-st.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0046-wined3d-Hackily-introduce-a-multithreaded-command-st.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0046-wined3d-Hackily-introduce-a-multithreaded-command-st.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,888 +0,0 @@ -From 37df70888f1e9c12f63d5fc3a511ec34fce4b10d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 1 Oct 2013 14:31:56 +0200 -Subject: wined3d: Hackily introduce a multithreaded command stream - ---- - dlls/wined3d/cs.c | 380 ++++++++++++++++++++++++++++++++++++----- - dlls/wined3d/wined3d_main.c | 9 + - dlls/wined3d/wined3d_private.h | 18 ++ - 3 files changed, 368 insertions(+), 39 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index daebc94..40c04db 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -24,8 +24,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); - - #define WINED3D_INITIAL_CS_SIZE 4096 - -+static CRITICAL_SECTION wined3d_cs_list_mutex; -+static CRITICAL_SECTION_DEBUG wined3d_cs_list_mutex_debug = -+{ -+ 0, 0, &wined3d_cs_list_mutex, -+ {&wined3d_cs_list_mutex_debug.ProcessLocksList, -+ &wined3d_cs_list_mutex_debug.ProcessLocksList}, -+ 0, 0, {(DWORD_PTR)(__FILE__ ": wined3d_cs_list_mutex")} -+}; -+static CRITICAL_SECTION wined3d_cs_list_mutex = {&wined3d_cs_list_mutex_debug, -1, 0, 0, 0, 0}; -+ - enum wined3d_cs_op - { -+ WINED3D_CS_OP_FENCE, - WINED3D_CS_OP_PRESENT, - WINED3D_CS_OP_CLEAR, - WINED3D_CS_OP_DRAW, -@@ -52,6 +63,18 @@ enum wined3d_cs_op - WINED3D_CS_OP_SET_COLOR_KEY, - WINED3D_CS_OP_SET_MATERIAL, - WINED3D_CS_OP_RESET_STATE, -+ WINED3D_CS_OP_STOP, -+}; -+ -+struct wined3d_cs_stop -+{ -+ enum wined3d_cs_op opcode; -+}; -+ -+struct wined3d_cs_fence -+{ -+ enum wined3d_cs_op opcode; -+ BOOL *signalled; - }; - - struct wined3d_cs_present -@@ -102,7 +125,7 @@ struct wined3d_cs_set_viewport - struct wined3d_cs_set_scissor_rect - { - enum wined3d_cs_op opcode; -- const RECT *rect; -+ RECT rect; - }; - - struct wined3d_cs_set_rendertarget_view -@@ -230,20 +253,20 @@ struct wined3d_cs_set_transform - { - enum wined3d_cs_op opcode; - enum wined3d_transform_state state; -- const struct wined3d_matrix *matrix; -+ struct wined3d_matrix matrix; - }; - - struct wined3d_cs_set_clip_plane - { - enum wined3d_cs_op opcode; - UINT plane_idx; -- const struct wined3d_vec4 *plane; -+ struct wined3d_vec4 plane; - }; - - struct wined3d_cs_set_material - { - enum wined3d_cs_op opcode; -- const struct wined3d_material *material; -+ struct wined3d_material material; - }; - - struct wined3d_cs_reset_state -@@ -251,7 +274,134 @@ struct wined3d_cs_reset_state - enum wined3d_cs_op opcode; - }; - --static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) -+/* FIXME: The list synchronization probably isn't particularly fast. */ -+static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) -+{ -+ EnterCriticalSection(&wined3d_cs_list_mutex); -+ list_add_tail(&list->blocks, &block->entry); -+ LeaveCriticalSection(&wined3d_cs_list_mutex); -+} -+ -+static struct wined3d_cs_block *wined3d_cs_list_dequeue(struct wined3d_cs_list *list) -+{ -+ struct list *head; -+ -+ EnterCriticalSection(&wined3d_cs_list_mutex); -+ if (!(head = list_head(&list->blocks))) -+ { -+ LeaveCriticalSection(&wined3d_cs_list_mutex); -+ return NULL; -+ } -+ list_remove(head); -+ LeaveCriticalSection(&wined3d_cs_list_mutex); -+ -+ return LIST_ENTRY(head, struct wined3d_cs_block, entry); -+} -+ -+static struct wined3d_cs_block *wined3d_cs_list_dequeue_blocking(struct wined3d_cs_list *list) -+{ -+ struct wined3d_cs_block *block; -+ -+ /* FIXME: Use an event to wait after a couple of spins. */ -+ for (;;) -+ { -+ if ((block = wined3d_cs_list_dequeue(list))) -+ return block; -+ } -+} -+ -+static void wined3d_cs_list_init(struct wined3d_cs_list *list) -+{ -+ list_init(&list->blocks); -+} -+ -+static struct wined3d_cs_block *wined3d_cs_get_thread_block(const struct wined3d_cs *cs) -+{ -+ return TlsGetValue(cs->tls_idx); -+} -+ -+static void wined3d_cs_set_thread_block(const struct wined3d_cs *cs, struct wined3d_cs_block *block) -+{ -+ if (!TlsSetValue(cs->tls_idx, block)) -+ ERR("Failed to set thread block.\n"); -+} -+ -+static void wined3d_cs_flush(struct wined3d_cs *cs) -+{ -+ wined3d_cs_list_enqueue(&cs->exec_list, wined3d_cs_get_thread_block(cs)); -+ wined3d_cs_set_thread_block(cs, NULL); -+} -+ -+static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs) -+{ -+ struct wined3d_cs_block *block; -+ -+ if (!(block = wined3d_cs_list_dequeue(&cs->free_list))) -+ { -+ if (!(block = HeapAlloc(GetProcessHeap(), 0, sizeof(*block)))) -+ { -+ ERR("Failed to get new block.\n"); -+ return NULL; -+ } -+ } -+ -+ block->pos = 0; -+ -+ return block; -+} -+ -+static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) -+{ -+ struct wined3d_cs_block *block = wined3d_cs_get_thread_block(cs); -+ void *data; -+ -+ if (!block || block->pos + size > sizeof(block->data)) -+ { -+ if (block) -+ wined3d_cs_flush(cs); -+ block = wined3d_cs_get_block(cs); -+ wined3d_cs_set_thread_block(cs, block); -+ } -+ -+ data = &block->data[block->pos]; -+ block->pos += size; -+ -+ return data; -+} -+ -+static UINT wined3d_cs_exec_fence(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_fence *op = data; -+ -+ InterlockedExchange(op->signalled, TRUE); -+ -+ return sizeof(*op); -+} -+ -+static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled) -+{ -+ struct wined3d_cs_fence *op; -+ -+ *signalled = FALSE; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_FENCE; -+ op->signalled = signalled; -+} -+ -+static void wined3d_cs_flush_and_wait(struct wined3d_cs *cs) -+{ -+ BOOL fence; -+ -+ wined3d_cs_emit_fence(cs, &fence); -+ wined3d_cs_flush(cs); -+ -+ /* A busy wait should be fine, we're not supposed to have to wait very -+ * long. */ -+ while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); -+} -+ -+static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_present *op = data; - struct wined3d_swapchain *swapchain; -@@ -261,6 +411,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) - - swapchain->swapchain_ops->swapchain_present(swapchain, - op->src_rect, op->dst_rect, op->dirty_region, op->flags); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, -@@ -281,7 +433,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_clear *op = data; - struct wined3d_device *device; -@@ -292,6 +444,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) - device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, - &cs->state.fb, op->rect_count, op->rects, &draw_rect, op->flags, - op->color, op->depth, op->stencil); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, -@@ -311,12 +465,14 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_draw *op = data; - - draw_primitive(cs->device, op->start_idx, op->index_count, - op->start_instance, op->instance_count, op->indexed); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_count, -@@ -335,12 +491,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_predication *op = data; - - cs->state.predicate = op->predicate; - cs->state.predicate_value = op->value; -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value) -@@ -355,12 +513,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_viewport *op = data; - - cs->state.viewport = *op->viewport; - device_invalidate_state(cs->device, STATE_VIEWPORT); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) -@@ -374,12 +534,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_scissor_rect *op = data; - -- cs->state.scissor_rect = *op->rect; -+ cs->state.scissor_rect = op->rect; - device_invalidate_state(cs->device, STATE_SCISSORRECT); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) -@@ -388,17 +550,19 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) - - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT; -- op->rect = rect; -+ op->rect = *rect; - - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_rendertarget_view *op = data; - - cs->state.fb.render_targets[op->view_idx] = op->view; - device_invalidate_state(cs->device, STATE_FRAMEBUFFER); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx, -@@ -414,7 +578,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_depth_stencil_view *op = data; - struct wined3d_device *device = cs->device; -@@ -452,6 +616,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const - } - - device_invalidate_state(device, STATE_FRAMEBUFFER); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) -@@ -465,12 +631,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_vertex_declaration *op = data; - - cs->state.vertex_declaration = op->declaration; - device_invalidate_state(cs->device, STATE_VDECL); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) -@@ -484,7 +652,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_stream_source *op = data; - struct wined3d_stream_state *stream; -@@ -502,6 +670,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void - InterlockedDecrement(&prev->resource.bind_count); - - device_invalidate_state(cs->device, STATE_STREAMSRC); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, -@@ -519,7 +689,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_stream_source_freq *op = data; - struct wined3d_stream_state *stream; -@@ -529,6 +699,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const - stream->flags = op->flags; - - device_invalidate_state(cs->device, STATE_STREAMSRC); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags) -@@ -544,7 +716,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_stream_output *op = data; - struct wined3d_stream_output *stream; -@@ -559,6 +731,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void - InterlockedIncrement(&op->buffer->resource.bind_count); - if (prev) - InterlockedDecrement(&prev->resource.bind_count); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, -@@ -575,7 +749,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_index_buffer *op = data; - struct wined3d_buffer *prev; -@@ -590,6 +764,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * - InterlockedDecrement(&prev->resource.bind_count); - - device_invalidate_state(cs->device, STATE_INDEXBUFFER); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, -@@ -605,7 +781,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_constant_buffer *op = data; - struct wined3d_buffer *prev; -@@ -619,6 +795,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi - InterlockedDecrement(&prev->resource.bind_count); - - device_invalidate_state(cs->device, STATE_CONSTANT_BUFFER(op->type)); -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -635,7 +812,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info; - const struct wined3d_cs_set_texture *op = data; -@@ -710,6 +887,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) - - if (new_use_color_key) - device_invalidate_state(cs->device, STATE_COLOR_KEY); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture) -@@ -724,12 +903,14 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_shader_resource_view *op = data; - - cs->state.shader_resource_view[op->type][op->view_idx] = op->view; - device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -746,12 +927,14 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_sampler *op = data; - - cs->state.sampler[op->type][op->sampler_idx] = op->sampler; - device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -768,13 +951,15 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_shader *op = data; - - cs->state.shader[op->type] = op->shader; - device_invalidate_state(cs->device, STATE_SHADER(op->type)); - device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader) -@@ -789,12 +974,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_render_state *op = data; - - cs->state.render_states[op->state] = op->value; - device_invalidate_state(cs->device, STATE_RENDER(op->state)); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value) -@@ -809,12 +996,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_texture_state *op = data; - - cs->state.texture_states[op->stage][op->state] = op->value; - device_invalidate_state(cs->device, STATE_TEXTURESTAGE(op->stage, op->state)); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, -@@ -831,12 +1020,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_sampler_state *op = data; - - cs->state.sampler_states[op->sampler_idx][op->state] = op->value; - device_invalidate_state(cs->device, STATE_SAMPLER(op->sampler_idx)); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, -@@ -853,13 +1044,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_transform *op = data; - -- cs->state.transforms[op->state] = *op->matrix; -+ cs->state.transforms[op->state] = op->matrix; - if (op->state < WINED3D_TS_WORLD_MATRIX(cs->device->adapter->d3d_info.limits.ffp_vertex_blend_matrices)) - device_invalidate_state(cs->device, STATE_TRANSFORM(op->state)); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state, -@@ -870,17 +1063,19 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_SET_TRANSFORM; - op->state = state; -- op->matrix = matrix; -+ op->matrix = *matrix; - - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_clip_plane *op = data; - -- cs->state.clip_planes[op->plane_idx] = *op->plane; -+ cs->state.clip_planes[op->plane_idx] = op->plane; - device_invalidate_state(cs->device, STATE_CLIPPLANE(op->plane_idx)); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane) -@@ -890,12 +1085,12 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_SET_CLIP_PLANE; - op->plane_idx = plane_idx; -- op->plane = plane; -+ op->plane = *plane; - - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_color_key *op = data; - struct wined3d_texture *texture = op->texture; -@@ -956,6 +1151,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat - break; - } - } -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture, -@@ -978,12 +1175,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_material *op = data; - -- cs->state.material = *op->material; -+ cs->state.material = op->material; - device_invalidate_state(cs->device, STATE_MATERIAL); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material) -@@ -992,12 +1191,12 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma - - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_SET_MATERIAL; -- op->material = material; -+ op->material = *material; - - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) - { - struct wined3d_adapter *adapter = cs->device->adapter; - HRESULT hr; -@@ -1007,6 +1206,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) - if (FAILED(hr = state_init(&cs->state, &adapter->gl_info, &adapter->d3d_info, - WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT))) - ERR("Failed to initialize CS state, hr %#x.\n", hr); -+ -+ return sizeof(struct wined3d_cs_reset_state); - } - - void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) -@@ -1019,8 +1220,9 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) - cs->ops->submit(cs); - } - --static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = -+static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { -+ /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, - /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, - /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, - /* WINED3D_CS_OP_DRAW */ wined3d_cs_exec_draw, -@@ -1079,6 +1281,58 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = - wined3d_cs_st_submit, - }; - -+static const struct wined3d_cs_ops wined3d_cs_mt_ops = -+{ -+ wined3d_cs_mt_require_space, -+ wined3d_cs_flush_and_wait, -+}; -+ -+/* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an -+ * OP itself. */ -+static void wined3d_cs_emit_stop(struct wined3d_cs *cs) -+{ -+ struct wined3d_cs_stop *op; -+ -+ op = wined3d_cs_mt_require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_STOP; -+ -+ wined3d_cs_flush(cs); -+} -+ -+static DWORD WINAPI wined3d_cs_run(void *thread_param) -+{ -+ struct wined3d_cs *cs = thread_param; -+ -+ TRACE("Started.\n"); -+ -+ for (;;) -+ { -+ struct wined3d_cs_block *block; -+ UINT pos = 0; -+ -+ block = wined3d_cs_list_dequeue_blocking(&cs->exec_list); -+ while (pos < block->pos) -+ { -+ enum wined3d_cs_op opcode = *(const enum wined3d_cs_op *)&block->data[pos]; -+ -+ if (opcode >= WINED3D_CS_OP_STOP) -+ { -+ if (opcode > WINED3D_CS_OP_STOP) -+ ERR("Invalid opcode %#x.\n", opcode); -+ goto done; -+ } -+ -+ pos += wined3d_cs_op_handlers[opcode](cs, &block->data[pos]); -+ } -+ -+ wined3d_cs_list_enqueue(&cs->free_list, block); -+ } -+ -+done: -+ TRACE("Stopped.\n"); -+ return 0; -+} -+ - struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) - { - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -1104,12 +1358,60 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) - return NULL; - } - -+ if ((cs->tls_idx = TlsAlloc()) == TLS_OUT_OF_INDEXES) -+ { -+ ERR("Failed to allocate cs TLS index, err %#x.\n", GetLastError()); -+ HeapFree(GetProcessHeap(), 0, cs->data); -+ HeapFree(GetProcessHeap(), 0, cs); -+ return NULL; -+ } -+ -+ if (wined3d_settings.cs_multithreaded) -+ { -+ cs->ops = &wined3d_cs_mt_ops; -+ -+ wined3d_cs_list_init(&cs->free_list); -+ wined3d_cs_list_init(&cs->exec_list); -+ -+ if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL))) -+ { -+ ERR("Failed to create wined3d command stream thread.\n"); -+ if (!TlsFree(cs->tls_idx)) -+ ERR("Failed to free cs TLS index, err %#x.\n", GetLastError()); -+ HeapFree(GetProcessHeap(), 0, cs->data); -+ HeapFree(GetProcessHeap(), 0, cs); -+ return NULL; -+ } -+ } -+ - return cs; - } - - void wined3d_cs_destroy(struct wined3d_cs *cs) - { -+ DWORD ret; -+ - state_cleanup(&cs->state); -+ -+ if (wined3d_settings.cs_multithreaded) -+ { -+ wined3d_cs_emit_stop(cs); -+ -+ ret = WaitForSingleObject(cs->thread, INFINITE); -+ CloseHandle(cs->thread); -+ if (ret != WAIT_OBJECT_0) -+ ERR("Wait failed (%#x).\n", ret); -+ -+ /* FIXME: Cleanup the block lists on thread exit. */ -+#if 0 -+ wined3d_cs_list_cleanup(&cs->exec_list); -+ wined3d_cs_list_cleanup(&cs->free_list); -+#endif -+ } -+ -+ if (!TlsFree(cs->tls_idx)) -+ ERR("Failed to free cs TLS index, err %#x.\n", GetLastError()); -+ - HeapFree(GetProcessHeap(), 0, cs->data); - HeapFree(GetProcessHeap(), 0, cs); - } -diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c -index 08021a2..088e59a 100644 ---- a/dlls/wined3d/wined3d_main.c -+++ b/dlls/wined3d/wined3d_main.c -@@ -85,6 +85,7 @@ struct wined3d_settings wined3d_settings = - ~0U, /* No GS shader model limit by default. */ - ~0U, /* No PS shader model limit by default. */ - FALSE, /* 3D support enabled by default. */ -+ FALSE, /* No multithreaded CS by default. */ - }; - - struct wined3d * CDECL wined3d_create(DWORD flags) -@@ -304,6 +305,14 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) - TRACE("Disabling 3D support.\n"); - wined3d_settings.no_3d = TRUE; - } -+ if (!get_config_key(hkey, appkey, "CSMT", buffer, size) -+ && !strcmp(buffer,"enabled")) -+ { -+ TRACE("Enabling multithreaded command stream.\n"); -+ wined3d_settings.cs_multithreaded = TRUE; -+ TRACE("Enforcing strict draw ordering for multithreaded command stream.\n"); -+ wined3d_settings.strict_draw_ordering = TRUE; -+ } - } - - if (appkey) RegCloseKey( appkey ); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 59f9772..01c045b 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -279,6 +279,7 @@ struct wined3d_settings - unsigned int max_sm_gs; - unsigned int max_sm_ps; - BOOL no_3d; -+ BOOL cs_multithreaded; - }; - - extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; -@@ -2589,6 +2590,18 @@ HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl - const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; - void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; - -+struct wined3d_cs_list -+{ -+ struct list blocks; -+}; -+ -+struct wined3d_cs_block -+{ -+ struct list entry; -+ UINT pos; -+ BYTE data[4000]; /* FIXME? The size is somewhat arbitrary. */ -+}; -+ - struct wined3d_cs_ops - { - void *(*require_space)(struct wined3d_cs *cs, size_t size); -@@ -2600,9 +2613,14 @@ struct wined3d_cs - const struct wined3d_cs_ops *ops; - struct wined3d_device *device; - struct wined3d_state state; -+ HANDLE thread; -+ DWORD tls_idx; - - size_t data_size; - void *data; -+ -+ struct wined3d_cs_list free_list; -+ struct wined3d_cs_list exec_list; - }; - - struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; --- -2.4.4 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0047-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0047-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0047-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0047-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,65 @@ +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 + +FIXME: Merge this with the preload calls done by +context_update_stream_info, preload only used buffers + +FIXME2: Merge this patch with the patch that removes +PreLoad from buffer_unmap + +FIXME3: There may be more unintended consequences of calling preload +here... +--- + dlls/wined3d/buffer.c | 2 +- + dlls/wined3d/context.c | 6 +++++- + dlls/wined3d/wined3d_private.h | 1 - + 3 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +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("glUnmapBuffer"); + } + +-void buffer_mark_used(struct wined3d_buffer *buffer) ++static void buffer_mark_used(struct wined3d_buffer *buffer) + { + buffer->flags &= ~(WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); + } +diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c +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 + for (i = 0, map = context->stream_info.use_map; map; map >>= 1, ++i) + { + if (map & 1) +- buffer_mark_used(state->streams[context->stream_info.elements[i].stream_idx].buffer); ++ buffer_internal_preload(state->streams[context->stream_info.elements[i].stream_idx].buffer, ++ context, state); + } ++ /* PreLoad may kick buffers out of vram. */ ++ if (isStateDirty(context, STATE_STREAMSRC)) ++ context_update_stream_info(context, state); + } + if (state->index_buffer) + { +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index fd7e8f9..69c984ba 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2686,7 +2686,6 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co + BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; + void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, + const struct wined3d_state *state) DECLSPEC_HIDDEN; +-void buffer_mark_used(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + + struct wined3d_rendertarget_view + { +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0047-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0047-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0047-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0047-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +0,0 @@ -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 - multithreaded command stream. - -As opposed to just making sure they're submitted to the GPU for -"StrictDrawOrdering". This will eventually be disabled by default, but even -then it's probably useful for debugging. ---- - dlls/wined3d/arb_program_shader.c | 4 +++- - dlls/wined3d/buffer.c | 4 +++- - dlls/wined3d/device.c | 9 +++++++-- - dlls/wined3d/drawprim.c | 4 +++- - dlls/wined3d/surface.c | 28 +++++++++++++++++++++------- - dlls/wined3d/swapchain.c | 4 +++- - 6 files changed, 40 insertions(+), 13 deletions(-) - -diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -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, - /* Leave the opengl state valid for blitting */ - arbfp_blit_unset(context->gl_info); - -- if (wined3d_settings.strict_draw_ordering -+ if (wined3d_settings.cs_multithreaded) -+ context->gl_info->gl_ops.gl.p_glFinish(); -+ else if (wined3d_settings.strict_draw_ordering - || (dst_surface->container->swapchain - && (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 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(glUnmapBuffer(buffer->buffer_type_hint)); -- if (wined3d_settings.strict_draw_ordering) -+ if (wined3d_settings.cs_multithreaded) -+ gl_info->gl_ops.gl.p_glFinish(); -+ else if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - context_release(context); - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -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 - } - } - -- if (wined3d_settings.strict_draw_ordering || (flags & WINED3DCLEAR_TARGET -+ if (wined3d_settings.cs_multithreaded) -+ gl_info->gl_ops.gl.p_glFinish(); -+ else if (wined3d_settings.strict_draw_ordering || (flags & WINED3DCLEAR_TARGET - && target->container->swapchain && target->container->swapchain->front_buffer == target->container)) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - -@@ -3247,7 +3249,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) - - context = context_acquire(device, NULL); - /* We only have to do this if we need to read the, swapbuffers performs a flush for us */ -- context->gl_info->gl_ops.gl.p_glFlush(); -+ if (wined3d_settings.cs_multithreaded) -+ context->gl_info->gl_ops.gl.p_glFinish(); -+ else -+ context->gl_info->gl_ops.gl.p_glFlush(); - /* No checkGLcall here to avoid locking the lock just for checking a call that hardly ever - * fails. */ - context_release(context); -diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index 98261f9..d3a9e03 100644 ---- a/dlls/wined3d/drawprim.c -+++ b/dlls/wined3d/drawprim.c -@@ -781,7 +781,9 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co - wined3d_event_query_issue(context->buffer_queries[i], device); - } - -- if (wined3d_settings.strict_draw_ordering) -+ if (wined3d_settings.cs_multithreaded) -+ gl_info->gl_ops.gl.p_glFinish(); -+ else if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - - context_release(context); -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -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, - dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, gl_mask, GL_NEAREST); - checkGLcall("glBlitFramebuffer()"); - -- if (wined3d_settings.strict_draw_ordering) -+ if (wined3d_settings.cs_multithreaded) -+ gl_info->gl_ops.gl.p_glFinish(); -+ else if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - - context_release(context); -@@ -816,7 +818,9 @@ static void surface_blt_fbo(const struct wined3d_device *device, - dst_rect.left, dst_rect.top, dst_rect.right, dst_rect.bottom, GL_COLOR_BUFFER_BIT, gl_filter); - checkGLcall("glBlitFramebuffer()"); - -- if (wined3d_settings.strict_draw_ordering -+ if (wined3d_settings.cs_multithreaded) -+ gl_info->gl_ops.gl.p_glFinish(); -+ else if (wined3d_settings.strict_draw_ordering - || (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 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w - checkGLcall("glBindBuffer"); - } - -- if (wined3d_settings.strict_draw_ordering) -+ if (wined3d_settings.cs_multithreaded) -+ gl_info->gl_ops.gl.p_glFinish(); -+ else if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); - - if (gl_info->quirks & WINED3D_QUIRK_FBO_TEX_UPDATE) -@@ -3337,7 +3343,9 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st - checkGLcall("glDeleteTextures(1, &backup)"); - } - -- if (wined3d_settings.strict_draw_ordering) -+ if (wined3d_settings.cs_multithreaded) -+ gl_info->gl_ops.gl.p_glFinish(); -+ else if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - - context_release(context); -@@ -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); - -- if (wined3d_settings.strict_draw_ordering -+ if (wined3d_settings.cs_multithreaded) -+ gl_info->gl_ops.gl.p_glFinish(); -+ else if (wined3d_settings.strict_draw_ordering - || (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. */ -@@ -3873,7 +3883,9 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co - - context_invalidate_state(context, STATE_FRAMEBUFFER); - -- if (wined3d_settings.strict_draw_ordering) -+ if (wined3d_settings.cs_multithreaded) -+ gl_info->gl_ops.gl.p_glFinish(); -+ else if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - } - else if (location == WINED3D_LOCATION_DRAWABLE) -@@ -3889,7 +3901,9 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co - - context_invalidate_state(context, STATE_FRAMEBUFFER); - -- if (wined3d_settings.strict_draw_ordering) -+ if (wined3d_settings.cs_multithreaded) -+ gl_info->gl_ops.gl.p_glFinish(); -+ else if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - } - else -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index ed2964e..60504ef 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -531,8 +531,10 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - swapchain_blit(swapchain, context, &src_rect, &dst_rect); - } - -- if (swapchain->num_contexts > 1) -+ if (wined3d_settings.cs_multithreaded) - gl_info->gl_ops.gl.p_glFinish(); -+ else if (swapchain->num_contexts > 1) -+ gl_info->gl_ops.gl.p_glFlush(); - - /* 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.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0048-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0048-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0048-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0048-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -From 72ea1f2801924c3856ae7a2b8045beef511b6e9e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 12 Mar 2013 11:34:58 -0700 -Subject: wined3d: Don't store pointers in struct wined3d_cs_present - ---- - dlls/wined3d/cs.c | 34 +++++++++++++++++++++++++++------- - 1 file changed, 27 insertions(+), 7 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 1122073..b30e62a 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -76,15 +76,19 @@ struct wined3d_cs_fence - BOOL *signalled; - }; - -+#define CS_PRESENT_SRC_RECT 1 -+#define CS_PRESENT_DST_RECT 2 -+#define CS_PRESENT_DIRTY_RGN 4 - struct wined3d_cs_present - { - enum wined3d_cs_op opcode; - HWND dst_window_override; - struct wined3d_swapchain *swapchain; -- const RECT *src_rect; -- const RECT *dst_rect; -- const RGNDATA *dirty_region; -+ RECT src_rect; -+ RECT dst_rect; -+ RGNDATA dirty_region; - DWORD flags; -+ DWORD set_data; - }; - - struct wined3d_cs_clear -@@ -395,12 +399,15 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_present *op = data; - struct wined3d_swapchain *swapchain; -+ const RECT *src_rect = op->set_data & CS_PRESENT_SRC_RECT ? &op->src_rect : NULL; -+ const RECT *dst_rect = op->set_data & CS_PRESENT_DST_RECT ? &op->dst_rect : NULL; -+ const RGNDATA *dirty_region = op->set_data & CS_PRESENT_DIRTY_RGN ? &op->dirty_region : NULL; - - swapchain = op->swapchain; - wined3d_swapchain_set_window(swapchain, op->dst_window_override); - - swapchain->swapchain_ops->swapchain_present(swapchain, -- op->src_rect, op->dst_rect, op->dirty_region, op->flags); -+ src_rect, dst_rect, dirty_region, op->flags); - - return sizeof(*op); - } -@@ -415,9 +422,22 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw - op->opcode = WINED3D_CS_OP_PRESENT; - op->dst_window_override = dst_window_override; - op->swapchain = swapchain; -- op->src_rect = src_rect; -- op->dst_rect = dst_rect; -- op->dirty_region = dirty_region; -+ op->set_data = 0; -+ if (src_rect) -+ { -+ op->src_rect = *src_rect; -+ op->set_data |= CS_PRESENT_SRC_RECT; -+ } -+ if (dst_rect) -+ { -+ op->dst_rect = *dst_rect; -+ op->set_data |= CS_PRESENT_DST_RECT; -+ } -+ if (dirty_region) -+ { -+ op->dirty_region = *dirty_region; -+ op->set_data = CS_PRESENT_DIRTY_RGN; -+ } - op->flags = flags; - - cs->ops->submit(cs); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0048-wined3d-Hackily-introduce-a-multithreaded-command-st.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0048-wined3d-Hackily-introduce-a-multithreaded-command-st.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0048-wined3d-Hackily-introduce-a-multithreaded-command-st.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0048-wined3d-Hackily-introduce-a-multithreaded-command-st.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,888 @@ +From 37df70888f1e9c12f63d5fc3a511ec34fce4b10d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 1 Oct 2013 14:31:56 +0200 +Subject: wined3d: Hackily introduce a multithreaded command stream + +--- + dlls/wined3d/cs.c | 380 ++++++++++++++++++++++++++++++++++++----- + dlls/wined3d/wined3d_main.c | 9 + + dlls/wined3d/wined3d_private.h | 18 ++ + 3 files changed, 368 insertions(+), 39 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index daebc94..40c04db 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -24,8 +24,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); + + #define WINED3D_INITIAL_CS_SIZE 4096 + ++static CRITICAL_SECTION wined3d_cs_list_mutex; ++static CRITICAL_SECTION_DEBUG wined3d_cs_list_mutex_debug = ++{ ++ 0, 0, &wined3d_cs_list_mutex, ++ {&wined3d_cs_list_mutex_debug.ProcessLocksList, ++ &wined3d_cs_list_mutex_debug.ProcessLocksList}, ++ 0, 0, {(DWORD_PTR)(__FILE__ ": wined3d_cs_list_mutex")} ++}; ++static CRITICAL_SECTION wined3d_cs_list_mutex = {&wined3d_cs_list_mutex_debug, -1, 0, 0, 0, 0}; ++ + enum wined3d_cs_op + { ++ WINED3D_CS_OP_FENCE, + WINED3D_CS_OP_PRESENT, + WINED3D_CS_OP_CLEAR, + WINED3D_CS_OP_DRAW, +@@ -52,6 +63,18 @@ enum wined3d_cs_op + WINED3D_CS_OP_SET_COLOR_KEY, + WINED3D_CS_OP_SET_MATERIAL, + WINED3D_CS_OP_RESET_STATE, ++ WINED3D_CS_OP_STOP, ++}; ++ ++struct wined3d_cs_stop ++{ ++ enum wined3d_cs_op opcode; ++}; ++ ++struct wined3d_cs_fence ++{ ++ enum wined3d_cs_op opcode; ++ BOOL *signalled; + }; + + struct wined3d_cs_present +@@ -102,7 +125,7 @@ struct wined3d_cs_set_viewport + struct wined3d_cs_set_scissor_rect + { + enum wined3d_cs_op opcode; +- const RECT *rect; ++ RECT rect; + }; + + struct wined3d_cs_set_rendertarget_view +@@ -230,20 +253,20 @@ struct wined3d_cs_set_transform + { + enum wined3d_cs_op opcode; + enum wined3d_transform_state state; +- const struct wined3d_matrix *matrix; ++ struct wined3d_matrix matrix; + }; + + struct wined3d_cs_set_clip_plane + { + enum wined3d_cs_op opcode; + UINT plane_idx; +- const struct wined3d_vec4 *plane; ++ struct wined3d_vec4 plane; + }; + + struct wined3d_cs_set_material + { + enum wined3d_cs_op opcode; +- const struct wined3d_material *material; ++ struct wined3d_material material; + }; + + struct wined3d_cs_reset_state +@@ -251,7 +274,134 @@ struct wined3d_cs_reset_state + enum wined3d_cs_op opcode; + }; + +-static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) ++/* FIXME: The list synchronization probably isn't particularly fast. */ ++static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) ++{ ++ EnterCriticalSection(&wined3d_cs_list_mutex); ++ list_add_tail(&list->blocks, &block->entry); ++ LeaveCriticalSection(&wined3d_cs_list_mutex); ++} ++ ++static struct wined3d_cs_block *wined3d_cs_list_dequeue(struct wined3d_cs_list *list) ++{ ++ struct list *head; ++ ++ EnterCriticalSection(&wined3d_cs_list_mutex); ++ if (!(head = list_head(&list->blocks))) ++ { ++ LeaveCriticalSection(&wined3d_cs_list_mutex); ++ return NULL; ++ } ++ list_remove(head); ++ LeaveCriticalSection(&wined3d_cs_list_mutex); ++ ++ return LIST_ENTRY(head, struct wined3d_cs_block, entry); ++} ++ ++static struct wined3d_cs_block *wined3d_cs_list_dequeue_blocking(struct wined3d_cs_list *list) ++{ ++ struct wined3d_cs_block *block; ++ ++ /* FIXME: Use an event to wait after a couple of spins. */ ++ for (;;) ++ { ++ if ((block = wined3d_cs_list_dequeue(list))) ++ return block; ++ } ++} ++ ++static void wined3d_cs_list_init(struct wined3d_cs_list *list) ++{ ++ list_init(&list->blocks); ++} ++ ++static struct wined3d_cs_block *wined3d_cs_get_thread_block(const struct wined3d_cs *cs) ++{ ++ return TlsGetValue(cs->tls_idx); ++} ++ ++static void wined3d_cs_set_thread_block(const struct wined3d_cs *cs, struct wined3d_cs_block *block) ++{ ++ if (!TlsSetValue(cs->tls_idx, block)) ++ ERR("Failed to set thread block.\n"); ++} ++ ++static void wined3d_cs_flush(struct wined3d_cs *cs) ++{ ++ wined3d_cs_list_enqueue(&cs->exec_list, wined3d_cs_get_thread_block(cs)); ++ wined3d_cs_set_thread_block(cs, NULL); ++} ++ ++static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs) ++{ ++ struct wined3d_cs_block *block; ++ ++ if (!(block = wined3d_cs_list_dequeue(&cs->free_list))) ++ { ++ if (!(block = HeapAlloc(GetProcessHeap(), 0, sizeof(*block)))) ++ { ++ ERR("Failed to get new block.\n"); ++ return NULL; ++ } ++ } ++ ++ block->pos = 0; ++ ++ return block; ++} ++ ++static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) ++{ ++ struct wined3d_cs_block *block = wined3d_cs_get_thread_block(cs); ++ void *data; ++ ++ if (!block || block->pos + size > sizeof(block->data)) ++ { ++ if (block) ++ wined3d_cs_flush(cs); ++ block = wined3d_cs_get_block(cs); ++ wined3d_cs_set_thread_block(cs, block); ++ } ++ ++ data = &block->data[block->pos]; ++ block->pos += size; ++ ++ return data; ++} ++ ++static UINT wined3d_cs_exec_fence(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_fence *op = data; ++ ++ InterlockedExchange(op->signalled, TRUE); ++ ++ return sizeof(*op); ++} ++ ++static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled) ++{ ++ struct wined3d_cs_fence *op; ++ ++ *signalled = FALSE; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_FENCE; ++ op->signalled = signalled; ++} ++ ++static void wined3d_cs_flush_and_wait(struct wined3d_cs *cs) ++{ ++ BOOL fence; ++ ++ wined3d_cs_emit_fence(cs, &fence); ++ wined3d_cs_flush(cs); ++ ++ /* A busy wait should be fine, we're not supposed to have to wait very ++ * long. */ ++ while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); ++} ++ ++static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_present *op = data; + struct wined3d_swapchain *swapchain; +@@ -261,6 +411,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) + + swapchain->swapchain_ops->swapchain_present(swapchain, + op->src_rect, op->dst_rect, op->dirty_region, op->flags); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, +@@ -281,7 +433,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_clear *op = data; + struct wined3d_device *device; +@@ -292,6 +444,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) + device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, + &cs->state.fb, op->rect_count, op->rects, &draw_rect, op->flags, + op->color, op->depth, op->stencil); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, +@@ -311,12 +465,14 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_draw *op = data; + + draw_primitive(cs->device, op->start_idx, op->index_count, + op->start_instance, op->instance_count, op->indexed); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_count, +@@ -335,12 +491,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_predication *op = data; + + cs->state.predicate = op->predicate; + cs->state.predicate_value = op->value; ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value) +@@ -355,12 +513,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_viewport *op = data; + + cs->state.viewport = *op->viewport; + device_invalidate_state(cs->device, STATE_VIEWPORT); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) +@@ -374,12 +534,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_scissor_rect *op = data; + +- cs->state.scissor_rect = *op->rect; ++ cs->state.scissor_rect = op->rect; + device_invalidate_state(cs->device, STATE_SCISSORRECT); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) +@@ -388,17 +550,19 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT; +- op->rect = rect; ++ op->rect = *rect; + + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_rendertarget_view *op = data; + + cs->state.fb.render_targets[op->view_idx] = op->view; + device_invalidate_state(cs->device, STATE_FRAMEBUFFER); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx, +@@ -414,7 +578,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_depth_stencil_view *op = data; + struct wined3d_device *device = cs->device; +@@ -452,6 +616,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const + } + + device_invalidate_state(device, STATE_FRAMEBUFFER); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) +@@ -465,12 +631,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_vertex_declaration *op = data; + + cs->state.vertex_declaration = op->declaration; + device_invalidate_state(cs->device, STATE_VDECL); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) +@@ -484,7 +652,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_stream_source *op = data; + struct wined3d_stream_state *stream; +@@ -502,6 +670,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void + InterlockedDecrement(&prev->resource.bind_count); + + device_invalidate_state(cs->device, STATE_STREAMSRC); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, +@@ -519,7 +689,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_stream_source_freq *op = data; + struct wined3d_stream_state *stream; +@@ -529,6 +699,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const + stream->flags = op->flags; + + device_invalidate_state(cs->device, STATE_STREAMSRC); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags) +@@ -544,7 +716,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_stream_output *op = data; + struct wined3d_stream_output *stream; +@@ -559,6 +731,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void + InterlockedIncrement(&op->buffer->resource.bind_count); + if (prev) + InterlockedDecrement(&prev->resource.bind_count); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, +@@ -575,7 +749,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_index_buffer *op = data; + struct wined3d_buffer *prev; +@@ -590,6 +764,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * + InterlockedDecrement(&prev->resource.bind_count); + + device_invalidate_state(cs->device, STATE_INDEXBUFFER); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, +@@ -605,7 +781,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_constant_buffer *op = data; + struct wined3d_buffer *prev; +@@ -619,6 +795,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi + InterlockedDecrement(&prev->resource.bind_count); + + device_invalidate_state(cs->device, STATE_CONSTANT_BUFFER(op->type)); ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, +@@ -635,7 +812,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info; + const struct wined3d_cs_set_texture *op = data; +@@ -710,6 +887,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) + + if (new_use_color_key) + device_invalidate_state(cs->device, STATE_COLOR_KEY); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture) +@@ -724,12 +903,14 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_shader_resource_view *op = data; + + cs->state.shader_resource_view[op->type][op->view_idx] = op->view; + device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type, +@@ -746,12 +927,14 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_sampler *op = data; + + cs->state.sampler[op->type][op->sampler_idx] = op->sampler; + device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type, +@@ -768,13 +951,15 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_shader *op = data; + + cs->state.shader[op->type] = op->shader; + device_invalidate_state(cs->device, STATE_SHADER(op->type)); + device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader) +@@ -789,12 +974,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_render_state *op = data; + + cs->state.render_states[op->state] = op->value; + device_invalidate_state(cs->device, STATE_RENDER(op->state)); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value) +@@ -809,12 +996,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_texture_state *op = data; + + cs->state.texture_states[op->stage][op->state] = op->value; + device_invalidate_state(cs->device, STATE_TEXTURESTAGE(op->stage, op->state)); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, +@@ -831,12 +1020,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_sampler_state *op = data; + + cs->state.sampler_states[op->sampler_idx][op->state] = op->value; + device_invalidate_state(cs->device, STATE_SAMPLER(op->sampler_idx)); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, +@@ -853,13 +1044,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_transform *op = data; + +- cs->state.transforms[op->state] = *op->matrix; ++ cs->state.transforms[op->state] = op->matrix; + if (op->state < WINED3D_TS_WORLD_MATRIX(cs->device->adapter->d3d_info.limits.ffp_vertex_blend_matrices)) + device_invalidate_state(cs->device, STATE_TRANSFORM(op->state)); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state, +@@ -870,17 +1063,19 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_SET_TRANSFORM; + op->state = state; +- op->matrix = matrix; ++ op->matrix = *matrix; + + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_clip_plane *op = data; + +- cs->state.clip_planes[op->plane_idx] = *op->plane; ++ cs->state.clip_planes[op->plane_idx] = op->plane; + device_invalidate_state(cs->device, STATE_CLIPPLANE(op->plane_idx)); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane) +@@ -890,12 +1085,12 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_SET_CLIP_PLANE; + op->plane_idx = plane_idx; +- op->plane = plane; ++ op->plane = *plane; + + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_color_key *op = data; + struct wined3d_texture *texture = op->texture; +@@ -956,6 +1151,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat + break; + } + } ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture, +@@ -978,12 +1175,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_material *op = data; + +- cs->state.material = *op->material; ++ cs->state.material = op->material; + device_invalidate_state(cs->device, STATE_MATERIAL); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material) +@@ -992,12 +1191,12 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_SET_MATERIAL; +- op->material = material; ++ op->material = *material; + + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) + { + struct wined3d_adapter *adapter = cs->device->adapter; + HRESULT hr; +@@ -1007,6 +1206,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) + if (FAILED(hr = state_init(&cs->state, &adapter->gl_info, &adapter->d3d_info, + WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT))) + ERR("Failed to initialize CS state, hr %#x.\n", hr); ++ ++ return sizeof(struct wined3d_cs_reset_state); + } + + void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) +@@ -1019,8 +1220,9 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) + cs->ops->submit(cs); + } + +-static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = ++static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { ++ /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, + /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, + /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, + /* WINED3D_CS_OP_DRAW */ wined3d_cs_exec_draw, +@@ -1079,6 +1281,58 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = + wined3d_cs_st_submit, + }; + ++static const struct wined3d_cs_ops wined3d_cs_mt_ops = ++{ ++ wined3d_cs_mt_require_space, ++ wined3d_cs_flush_and_wait, ++}; ++ ++/* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an ++ * OP itself. */ ++static void wined3d_cs_emit_stop(struct wined3d_cs *cs) ++{ ++ struct wined3d_cs_stop *op; ++ ++ op = wined3d_cs_mt_require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_STOP; ++ ++ wined3d_cs_flush(cs); ++} ++ ++static DWORD WINAPI wined3d_cs_run(void *thread_param) ++{ ++ struct wined3d_cs *cs = thread_param; ++ ++ TRACE("Started.\n"); ++ ++ for (;;) ++ { ++ struct wined3d_cs_block *block; ++ UINT pos = 0; ++ ++ block = wined3d_cs_list_dequeue_blocking(&cs->exec_list); ++ while (pos < block->pos) ++ { ++ enum wined3d_cs_op opcode = *(const enum wined3d_cs_op *)&block->data[pos]; ++ ++ if (opcode >= WINED3D_CS_OP_STOP) ++ { ++ if (opcode > WINED3D_CS_OP_STOP) ++ ERR("Invalid opcode %#x.\n", opcode); ++ goto done; ++ } ++ ++ pos += wined3d_cs_op_handlers[opcode](cs, &block->data[pos]); ++ } ++ ++ wined3d_cs_list_enqueue(&cs->free_list, block); ++ } ++ ++done: ++ TRACE("Stopped.\n"); ++ return 0; ++} ++ + struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) + { + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; +@@ -1104,12 +1358,60 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) + return NULL; + } + ++ if ((cs->tls_idx = TlsAlloc()) == TLS_OUT_OF_INDEXES) ++ { ++ ERR("Failed to allocate cs TLS index, err %#x.\n", GetLastError()); ++ HeapFree(GetProcessHeap(), 0, cs->data); ++ HeapFree(GetProcessHeap(), 0, cs); ++ return NULL; ++ } ++ ++ if (wined3d_settings.cs_multithreaded) ++ { ++ cs->ops = &wined3d_cs_mt_ops; ++ ++ wined3d_cs_list_init(&cs->free_list); ++ wined3d_cs_list_init(&cs->exec_list); ++ ++ if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL))) ++ { ++ ERR("Failed to create wined3d command stream thread.\n"); ++ if (!TlsFree(cs->tls_idx)) ++ ERR("Failed to free cs TLS index, err %#x.\n", GetLastError()); ++ HeapFree(GetProcessHeap(), 0, cs->data); ++ HeapFree(GetProcessHeap(), 0, cs); ++ return NULL; ++ } ++ } ++ + return cs; + } + + void wined3d_cs_destroy(struct wined3d_cs *cs) + { ++ DWORD ret; ++ + state_cleanup(&cs->state); ++ ++ if (wined3d_settings.cs_multithreaded) ++ { ++ wined3d_cs_emit_stop(cs); ++ ++ ret = WaitForSingleObject(cs->thread, INFINITE); ++ CloseHandle(cs->thread); ++ if (ret != WAIT_OBJECT_0) ++ ERR("Wait failed (%#x).\n", ret); ++ ++ /* FIXME: Cleanup the block lists on thread exit. */ ++#if 0 ++ wined3d_cs_list_cleanup(&cs->exec_list); ++ wined3d_cs_list_cleanup(&cs->free_list); ++#endif ++ } ++ ++ if (!TlsFree(cs->tls_idx)) ++ ERR("Failed to free cs TLS index, err %#x.\n", GetLastError()); ++ + HeapFree(GetProcessHeap(), 0, cs->data); + HeapFree(GetProcessHeap(), 0, cs); + } +diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c +index 08021a2..088e59a 100644 +--- a/dlls/wined3d/wined3d_main.c ++++ b/dlls/wined3d/wined3d_main.c +@@ -85,6 +85,7 @@ struct wined3d_settings wined3d_settings = + ~0U, /* No GS shader model limit by default. */ + ~0U, /* No PS shader model limit by default. */ + FALSE, /* 3D support enabled by default. */ ++ FALSE, /* No multithreaded CS by default. */ + }; + + struct wined3d * CDECL wined3d_create(DWORD flags) +@@ -304,6 +305,14 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) + TRACE("Disabling 3D support.\n"); + wined3d_settings.no_3d = TRUE; + } ++ if (!get_config_key(hkey, appkey, "CSMT", buffer, size) ++ && !strcmp(buffer,"enabled")) ++ { ++ TRACE("Enabling multithreaded command stream.\n"); ++ wined3d_settings.cs_multithreaded = TRUE; ++ TRACE("Enforcing strict draw ordering for multithreaded command stream.\n"); ++ wined3d_settings.strict_draw_ordering = TRUE; ++ } + } + + if (appkey) RegCloseKey( appkey ); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 59f9772..01c045b 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -279,6 +279,7 @@ struct wined3d_settings + unsigned int max_sm_gs; + unsigned int max_sm_ps; + BOOL no_3d; ++ BOOL cs_multithreaded; + }; + + extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; +@@ -2589,6 +2590,18 @@ HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl + const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; + void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; + ++struct wined3d_cs_list ++{ ++ struct list blocks; ++}; ++ ++struct wined3d_cs_block ++{ ++ struct list entry; ++ UINT pos; ++ BYTE data[4000]; /* FIXME? The size is somewhat arbitrary. */ ++}; ++ + struct wined3d_cs_ops + { + void *(*require_space)(struct wined3d_cs *cs, size_t size); +@@ -2600,9 +2613,14 @@ struct wined3d_cs + const struct wined3d_cs_ops *ops; + struct wined3d_device *device; + struct wined3d_state state; ++ HANDLE thread; ++ DWORD tls_idx; + + size_t data_size; + void *data; ++ ++ struct wined3d_cs_list free_list; ++ struct wined3d_cs_list exec_list; + }; + + struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; +-- +2.4.4 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0049-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0049-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0049-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0049-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -From 6a9d163ab416a7d1c44a11b75716ee32fb3c9f0b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 2 Apr 2013 16:17:34 +0200 -Subject: wined3d: Don't put rectangle pointers into wined3d_cs_clear - ---- - dlls/wined3d/cs.c | 13 ++++++++----- - dlls/wined3d/device.c | 2 ++ - 2 files changed, 10 insertions(+), 5 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index b30e62a..bac3fdb 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -95,11 +95,11 @@ struct wined3d_cs_clear - { - enum wined3d_cs_op opcode; - DWORD rect_count; -- const RECT *rects; - DWORD flags; - const struct wined3d_color *color; - float depth; - DWORD stencil; -+ RECT rects[1]; - }; - - struct wined3d_cs_draw -@@ -448,25 +448,28 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) - const struct wined3d_cs_clear *op = data; - struct wined3d_device *device; - RECT draw_rect; -+ unsigned int extra_rects = op->rect_count ? op->rect_count - 1 : 0; - - device = cs->device; - wined3d_get_draw_rect(&device->state, &draw_rect); - device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, -- &cs->state.fb, op->rect_count, op->rects, &draw_rect, op->flags, -+ &cs->state.fb, op->rect_count, op->rect_count ? op->rects : NULL, &draw_rect, op->flags, - op->color, op->depth, op->stencil); - -- return sizeof(*op); -+ return sizeof(*op) + sizeof(*op->rects) * extra_rects; - } - - void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, - DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) - { - struct wined3d_cs_clear *op; -+ unsigned int extra_rects = rect_count ? rect_count - 1 : 0; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space(cs, sizeof(*op) + sizeof(*op->rects) * extra_rects); - op->opcode = WINED3D_CS_OP_CLEAR; - op->rect_count = rect_count; -- op->rects = rects; -+ if (rect_count) -+ memcpy(op->rects, rects, rect_count * sizeof(*rects)); - op->flags = flags; - op->color = color; - op->depth = depth; -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 08422ad..3bb3cf0 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -3292,6 +3292,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou - WARN("Rects is %p, but rect_count is 0, ignoring clear\n", rects); - return WINED3D_OK; - } -+ if (rect_count && !rects) -+ rect_count = 0; - - if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) - { --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0049-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0049-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0049-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0049-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,190 @@ +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 + multithreaded command stream. + +As opposed to just making sure they're submitted to the GPU for +"StrictDrawOrdering". This will eventually be disabled by default, but even +then it's probably useful for debugging. +--- + dlls/wined3d/arb_program_shader.c | 4 +++- + dlls/wined3d/buffer.c | 4 +++- + dlls/wined3d/device.c | 9 +++++++-- + dlls/wined3d/drawprim.c | 4 +++- + dlls/wined3d/surface.c | 28 +++++++++++++++++++++------- + dlls/wined3d/swapchain.c | 4 +++- + 6 files changed, 40 insertions(+), 13 deletions(-) + +diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c +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, + /* Leave the opengl state valid for blitting */ + arbfp_blit_unset(context->gl_info); + +- if (wined3d_settings.strict_draw_ordering ++ if (wined3d_settings.cs_multithreaded) ++ context->gl_info->gl_ops.gl.p_glFinish(); ++ else if (wined3d_settings.strict_draw_ordering + || (dst_surface->container->swapchain + && (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 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(glUnmapBuffer(buffer->buffer_type_hint)); +- if (wined3d_settings.strict_draw_ordering) ++ if (wined3d_settings.cs_multithreaded) ++ gl_info->gl_ops.gl.p_glFinish(); ++ else if (wined3d_settings.strict_draw_ordering) + gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + context_release(context); + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +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 + } + } + +- if (wined3d_settings.strict_draw_ordering || (flags & WINED3DCLEAR_TARGET ++ if (wined3d_settings.cs_multithreaded) ++ gl_info->gl_ops.gl.p_glFinish(); ++ else if (wined3d_settings.strict_draw_ordering || (flags & WINED3DCLEAR_TARGET + && target->container->swapchain && target->container->swapchain->front_buffer == target->container)) + gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + +@@ -3247,7 +3249,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) + + context = context_acquire(device, NULL); + /* We only have to do this if we need to read the, swapbuffers performs a flush for us */ +- context->gl_info->gl_ops.gl.p_glFlush(); ++ if (wined3d_settings.cs_multithreaded) ++ context->gl_info->gl_ops.gl.p_glFinish(); ++ else ++ context->gl_info->gl_ops.gl.p_glFlush(); + /* No checkGLcall here to avoid locking the lock just for checking a call that hardly ever + * fails. */ + context_release(context); +diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c +index 98261f9..d3a9e03 100644 +--- a/dlls/wined3d/drawprim.c ++++ b/dlls/wined3d/drawprim.c +@@ -781,7 +781,9 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co + wined3d_event_query_issue(context->buffer_queries[i], device); + } + +- if (wined3d_settings.strict_draw_ordering) ++ if (wined3d_settings.cs_multithreaded) ++ gl_info->gl_ops.gl.p_glFinish(); ++ else if (wined3d_settings.strict_draw_ordering) + gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + + context_release(context); +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +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, + dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, gl_mask, GL_NEAREST); + checkGLcall("glBlitFramebuffer()"); + +- if (wined3d_settings.strict_draw_ordering) ++ if (wined3d_settings.cs_multithreaded) ++ gl_info->gl_ops.gl.p_glFinish(); ++ else if (wined3d_settings.strict_draw_ordering) + gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + + context_release(context); +@@ -816,7 +818,9 @@ static void surface_blt_fbo(const struct wined3d_device *device, + dst_rect.left, dst_rect.top, dst_rect.right, dst_rect.bottom, GL_COLOR_BUFFER_BIT, gl_filter); + checkGLcall("glBlitFramebuffer()"); + +- if (wined3d_settings.strict_draw_ordering ++ if (wined3d_settings.cs_multithreaded) ++ gl_info->gl_ops.gl.p_glFinish(); ++ else if (wined3d_settings.strict_draw_ordering + || (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 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w + checkGLcall("glBindBuffer"); + } + +- if (wined3d_settings.strict_draw_ordering) ++ if (wined3d_settings.cs_multithreaded) ++ gl_info->gl_ops.gl.p_glFinish(); ++ else if (wined3d_settings.strict_draw_ordering) + gl_info->gl_ops.gl.p_glFlush(); + + if (gl_info->quirks & WINED3D_QUIRK_FBO_TEX_UPDATE) +@@ -3337,7 +3343,9 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st + checkGLcall("glDeleteTextures(1, &backup)"); + } + +- if (wined3d_settings.strict_draw_ordering) ++ if (wined3d_settings.cs_multithreaded) ++ gl_info->gl_ops.gl.p_glFinish(); ++ else if (wined3d_settings.strict_draw_ordering) + gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + + context_release(context); +@@ -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); + +- if (wined3d_settings.strict_draw_ordering ++ if (wined3d_settings.cs_multithreaded) ++ gl_info->gl_ops.gl.p_glFinish(); ++ else if (wined3d_settings.strict_draw_ordering + || (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. */ +@@ -3873,7 +3883,9 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co + + context_invalidate_state(context, STATE_FRAMEBUFFER); + +- if (wined3d_settings.strict_draw_ordering) ++ if (wined3d_settings.cs_multithreaded) ++ gl_info->gl_ops.gl.p_glFinish(); ++ else if (wined3d_settings.strict_draw_ordering) + gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + } + else if (location == WINED3D_LOCATION_DRAWABLE) +@@ -3889,7 +3901,9 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co + + context_invalidate_state(context, STATE_FRAMEBUFFER); + +- if (wined3d_settings.strict_draw_ordering) ++ if (wined3d_settings.cs_multithreaded) ++ gl_info->gl_ops.gl.p_glFinish(); ++ else if (wined3d_settings.strict_draw_ordering) + gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + } + else +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index ed2964e..60504ef 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -531,8 +531,10 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + swapchain_blit(swapchain, context, &src_rect, &dst_rect); + } + +- if (swapchain->num_contexts > 1) ++ if (wined3d_settings.cs_multithreaded) + gl_info->gl_ops.gl.p_glFinish(); ++ else if (swapchain->num_contexts > 1) ++ gl_info->gl_ops.gl.p_glFlush(); + + /* 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.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0050-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0050-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0050-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0050-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,82 @@ +From 72ea1f2801924c3856ae7a2b8045beef511b6e9e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 12 Mar 2013 11:34:58 -0700 +Subject: wined3d: Don't store pointers in struct wined3d_cs_present + +--- + dlls/wined3d/cs.c | 34 +++++++++++++++++++++++++++------- + 1 file changed, 27 insertions(+), 7 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 1122073..b30e62a 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -76,15 +76,19 @@ struct wined3d_cs_fence + BOOL *signalled; + }; + ++#define CS_PRESENT_SRC_RECT 1 ++#define CS_PRESENT_DST_RECT 2 ++#define CS_PRESENT_DIRTY_RGN 4 + struct wined3d_cs_present + { + enum wined3d_cs_op opcode; + HWND dst_window_override; + struct wined3d_swapchain *swapchain; +- const RECT *src_rect; +- const RECT *dst_rect; +- const RGNDATA *dirty_region; ++ RECT src_rect; ++ RECT dst_rect; ++ RGNDATA dirty_region; + DWORD flags; ++ DWORD set_data; + }; + + struct wined3d_cs_clear +@@ -395,12 +399,15 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_present *op = data; + struct wined3d_swapchain *swapchain; ++ const RECT *src_rect = op->set_data & CS_PRESENT_SRC_RECT ? &op->src_rect : NULL; ++ const RECT *dst_rect = op->set_data & CS_PRESENT_DST_RECT ? &op->dst_rect : NULL; ++ const RGNDATA *dirty_region = op->set_data & CS_PRESENT_DIRTY_RGN ? &op->dirty_region : NULL; + + swapchain = op->swapchain; + wined3d_swapchain_set_window(swapchain, op->dst_window_override); + + swapchain->swapchain_ops->swapchain_present(swapchain, +- op->src_rect, op->dst_rect, op->dirty_region, op->flags); ++ src_rect, dst_rect, dirty_region, op->flags); + + return sizeof(*op); + } +@@ -415,9 +422,22 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw + op->opcode = WINED3D_CS_OP_PRESENT; + op->dst_window_override = dst_window_override; + op->swapchain = swapchain; +- op->src_rect = src_rect; +- op->dst_rect = dst_rect; +- op->dirty_region = dirty_region; ++ op->set_data = 0; ++ if (src_rect) ++ { ++ op->src_rect = *src_rect; ++ op->set_data |= CS_PRESENT_SRC_RECT; ++ } ++ if (dst_rect) ++ { ++ op->dst_rect = *dst_rect; ++ op->set_data |= CS_PRESENT_DST_RECT; ++ } ++ if (dirty_region) ++ { ++ op->dirty_region = *dirty_region; ++ op->set_data = CS_PRESENT_DIRTY_RGN; ++ } + op->flags = flags; + + cs->ops->submit(cs); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0050-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0050-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0050-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0050-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -From 95126fce6331a34c71f5ff736192d25e78e67dde Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 2 Apr 2013 16:20:13 +0200 -Subject: wined3d: Store the color in clear ops instead of a pointer - ---- - dlls/wined3d/cs.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index bac3fdb..fa1ee3a 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -96,7 +96,7 @@ struct wined3d_cs_clear - enum wined3d_cs_op opcode; - DWORD rect_count; - DWORD flags; -- const struct wined3d_color *color; -+ struct wined3d_color color; - float depth; - DWORD stencil; - RECT rects[1]; -@@ -454,7 +454,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) - wined3d_get_draw_rect(&device->state, &draw_rect); - device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, - &cs->state.fb, op->rect_count, op->rect_count ? op->rects : NULL, &draw_rect, op->flags, -- op->color, op->depth, op->stencil); -+ &op->color, op->depth, op->stencil); - - return sizeof(*op) + sizeof(*op->rects) * extra_rects; - } -@@ -471,7 +471,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * - if (rect_count) - memcpy(op->rects, rects, rect_count * sizeof(*rects)); - op->flags = flags; -- op->color = color; -+ op->color = *color; - op->depth = depth; - op->stencil = stencil; - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0051-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0051-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0051-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0051-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,76 @@ +From 6a9d163ab416a7d1c44a11b75716ee32fb3c9f0b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 2 Apr 2013 16:17:34 +0200 +Subject: wined3d: Don't put rectangle pointers into wined3d_cs_clear + +--- + dlls/wined3d/cs.c | 13 ++++++++----- + dlls/wined3d/device.c | 2 ++ + 2 files changed, 10 insertions(+), 5 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index b30e62a..bac3fdb 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -95,11 +95,11 @@ struct wined3d_cs_clear + { + enum wined3d_cs_op opcode; + DWORD rect_count; +- const RECT *rects; + DWORD flags; + const struct wined3d_color *color; + float depth; + DWORD stencil; ++ RECT rects[1]; + }; + + struct wined3d_cs_draw +@@ -448,25 +448,28 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) + const struct wined3d_cs_clear *op = data; + struct wined3d_device *device; + RECT draw_rect; ++ unsigned int extra_rects = op->rect_count ? op->rect_count - 1 : 0; + + device = cs->device; + wined3d_get_draw_rect(&device->state, &draw_rect); + device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, +- &cs->state.fb, op->rect_count, op->rects, &draw_rect, op->flags, ++ &cs->state.fb, op->rect_count, op->rect_count ? op->rects : NULL, &draw_rect, op->flags, + op->color, op->depth, op->stencil); + +- return sizeof(*op); ++ return sizeof(*op) + sizeof(*op->rects) * extra_rects; + } + + void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, + DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) + { + struct wined3d_cs_clear *op; ++ unsigned int extra_rects = rect_count ? rect_count - 1 : 0; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space(cs, sizeof(*op) + sizeof(*op->rects) * extra_rects); + op->opcode = WINED3D_CS_OP_CLEAR; + op->rect_count = rect_count; +- op->rects = rects; ++ if (rect_count) ++ memcpy(op->rects, rects, rect_count * sizeof(*rects)); + op->flags = flags; + op->color = color; + op->depth = depth; +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 08422ad..3bb3cf0 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -3292,6 +3292,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou + WARN("Rects is %p, but rect_count is 0, ignoring clear\n", rects); + return WINED3D_OK; + } ++ if (rect_count && !rects) ++ rect_count = 0; + + if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) + { +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0051-wined3d-Pass-the-state-to-draw_primitive.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0051-wined3d-Pass-the-state-to-draw_primitive.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0051-wined3d-Pass-the-state-to-draw_primitive.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0051-wined3d-Pass-the-state-to-draw_primitive.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,263 +0,0 @@ -From ede3d178fc2a2ddde4b50913afca7920472c83c5 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 2 Apr 2013 17:25:19 +0200 -Subject: wined3d: Pass the state to draw_primitive - ---- - dlls/wined3d/buffer.c | 6 +++--- - dlls/wined3d/context.c | 6 +++--- - dlls/wined3d/cs.c | 2 +- - dlls/wined3d/directx.c | 2 +- - dlls/wined3d/drawprim.c | 27 +++++++++++++-------------- - dlls/wined3d/state.c | 4 ++-- - dlls/wined3d/utils.c | 2 +- - dlls/wined3d/wined3d_private.h | 8 +++++--- - 8 files changed, 29 insertions(+), 28 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 50dbb2d..206e969 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -423,7 +423,7 @@ static inline void fixup_d3dcolor(DWORD *dst_color) - { - DWORD src_color = *dst_color; - -- /* Color conversion like in drawStridedSlow. watch out for little endianity -+ /* Color conversion like in draw_strided_slow. watch out for little endianity - * If we want that stuff to work on big endian machines too we have to consider more things - * - * 0xff000000: Alpha mask -@@ -1184,11 +1184,11 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device - - dynamic_buffer_ok = gl_info->supported[APPLE_FLUSH_BUFFER_RANGE] || gl_info->supported[ARB_MAP_BUFFER_RANGE]; - -- /* Observations show that drawStridedSlow is faster on dynamic VBs than converting + -+ /* Observations show that draw_strided_slow is faster on dynamic VBs than converting + - * drawStridedFast (half-life 2 and others). - * - * Basically converting the vertices in the buffer is quite expensive, and observations -- * show that drawStridedSlow is faster than converting + uploading + drawStridedFast. -+ * show that draw_strided_slow is faster than converting + uploading + drawStridedFast. - * Therefore do not create a VBO for WINED3DUSAGE_DYNAMIC buffers. - */ - if (!gl_info->supported[ARB_VERTEX_BUFFER_OBJECT]) -diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 9be96dc..097e0e9 100644 ---- a/dlls/wined3d/context.c -+++ b/dlls/wined3d/context.c -@@ -2955,7 +2955,7 @@ static void context_update_stream_info(struct wined3d_context *context, const st - { - if (state->vertex_declaration->half_float_conv_needed && !stream_info->all_vbo) - { -- TRACE("Using drawStridedSlow with vertex shaders for FLOAT16 conversion.\n"); -+ TRACE("Using draw_strided_slow with vertex shaders for FLOAT16 conversion.\n"); - context->use_immediate_mode_draw = TRUE; - } - else -@@ -3095,9 +3095,9 @@ static void context_bind_shader_resources(struct wined3d_context *context, const - } - - /* Context activation is done by the caller. */ --BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_device *device) -+BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, -+ const struct wined3d_state *state) - { -- const struct wined3d_state *state = &device->state; - const struct StateEntry *state_table = context->state_table; - const struct wined3d_fb_state *fb = &state->fb; - unsigned int i, j; -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 8f1a016..84007cc 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -492,7 +492,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_draw *op = data; - -- draw_primitive(cs->device, op->start_idx, op->index_count, -+ draw_primitive(cs->device, &cs->device->state, op->start_idx, op->index_count, - op->start_instance, op->instance_count, op->indexed); - - return sizeof(*op); -diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c -index f238fc0..abc4aee 100644 ---- a/dlls/wined3d/directx.c -+++ b/dlls/wined3d/directx.c -@@ -5329,7 +5329,7 @@ static void WINE_GLAPI invalid_texcoord_func(GLenum unit, const void *data) - } - - /* Helper functions for providing vertex data to opengl. The arrays are initialized based on -- * the extension detection and are used in drawStridedSlow -+ * the extension detection and are used in draw_strided_slow - */ - static void WINE_GLAPI position_d3dcolor(const void *data) - { -diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index b10bc45..529bcd6 100644 ---- a/dlls/wined3d/drawprim.c -+++ b/dlls/wined3d/drawprim.c -@@ -36,7 +36,7 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); - #include - - /* Context activation is done by the caller. */ --static void drawStridedFast(const struct wined3d_gl_info *gl_info, GLenum primitive_type, UINT count, UINT idx_size, -+static void draw_strided_fast(const struct wined3d_gl_info *gl_info, GLenum primitive_type, UINT count, UINT idx_size, - const void *idx_data, UINT start_idx, INT base_vertex_index, UINT start_instance, UINT instance_count) - { - if (idx_size) -@@ -95,7 +95,7 @@ static void drawStridedFast(const struct wined3d_gl_info *gl_info, GLenum primit - */ - - /* Context activation is done by the caller. */ --static void drawStridedSlow(const struct wined3d_device *device, struct wined3d_context *context, -+static void draw_strided_slow(const struct wined3d_state *state, struct wined3d_context *context, - const struct wined3d_stream_info *si, UINT NumVertexes, GLenum glPrimType, - const void *idxData, UINT idxSize, UINT startIdx) - { -@@ -103,7 +103,6 @@ static void drawStridedSlow(const struct wined3d_device *device, struct wined3d_ - const WORD *pIdxBufS = NULL; - const DWORD *pIdxBufL = NULL; - UINT vx_index; -- const struct wined3d_state *state = &device->state; - LONG SkipnStrides = startIdx; - BOOL pixelShader = use_ps(state); - BOOL specular_fog = FALSE; -@@ -453,7 +452,7 @@ static inline void send_attribute(const struct wined3d_gl_info *gl_info, - } - - /* Context activation is done by the caller. */ --static void drawStridedSlowVs(struct wined3d_context *context, const struct wined3d_state *state, -+static void draw_strided_slow_vs(struct wined3d_context *context, const struct wined3d_state *state, - const struct wined3d_stream_info *si, UINT numberOfVertices, GLenum glPrimitiveType, - const void *idxData, UINT idxSize, UINT startIdx) - { -@@ -510,7 +509,7 @@ static void drawStridedSlowVs(struct wined3d_context *context, const struct wine - } - - /* Context activation is done by the caller. */ --static void drawStridedInstanced(struct wined3d_context *context, const struct wined3d_state *state, -+static void draw_strided_instanced(struct wined3d_context *context, const struct wined3d_state *state, - const struct wined3d_stream_info *si, UINT numberOfVertices, GLenum glPrimitiveType, - const void *idxData, UINT idxSize, UINT startIdx, UINT base_vertex_index, UINT instance_count) - { -@@ -595,10 +594,10 @@ static void remove_vbos(struct wined3d_context *context, - } - - /* Routine common to the draw primitive and draw indexed primitive routines */ --void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count, -- UINT start_instance, UINT instance_count, BOOL indexed) -+void draw_primitive(struct wined3d_device *device, const struct wined3d_state *state, -+ UINT start_idx, UINT index_count, UINT start_instance, UINT instance_count, -+ BOOL indexed) - { -- const struct wined3d_state *state = &device->state; - const struct wined3d_stream_info *stream_info; - struct wined3d_event_query *ib_query = NULL; - struct wined3d_stream_info si_emulated; -@@ -664,7 +663,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co - } - } - -- if (!context_apply_draw_state(context, device)) -+ if (!context_apply_draw_state(context, device, state)) - { - context_release(context); - WARN("Unable to apply draw state, skipping draw.\n"); -@@ -756,28 +755,28 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co - else - WARN_(d3d_perf)("Using immediate mode with vertex shaders for half float emulation.\n"); - -- drawStridedSlowVs(context, state, stream_info, index_count, -+ draw_strided_slow_vs(context, state, stream_info, index_count, - state->gl_primitive_type, idx_data, idx_size, start_idx); - } - else - { - if (context->d3d_info->ffp_generic_attributes) -- drawStridedSlowVs(context, state, stream_info, index_count, -+ draw_strided_slow_vs(context, state, stream_info, index_count, - state->gl_primitive_type, idx_data, idx_size, start_idx); - else -- drawStridedSlow(device, context, stream_info, index_count, -+ draw_strided_slow(state, context, stream_info, index_count, - state->gl_primitive_type, idx_data, idx_size, start_idx); - } - } - else if (!gl_info->supported[ARB_INSTANCED_ARRAYS] && instance_count) - { - /* Instancing emulation by mixing immediate mode and arrays. */ -- drawStridedInstanced(context, state, stream_info, index_count, state->gl_primitive_type, -+ draw_strided_instanced(context, state, stream_info, index_count, state->gl_primitive_type, - idx_data, idx_size, start_idx, state->base_vertex_index, instance_count); - } - else - { -- drawStridedFast(gl_info, state->gl_primitive_type, index_count, idx_size, idx_data, -+ draw_strided_fast(gl_info, state->gl_primitive_type, index_count, idx_size, idx_data, - start_idx, state->base_vertex_index, start_instance, instance_count); - } - -diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index e2fcc5d..be26f8f 100644 ---- a/dlls/wined3d/state.c -+++ b/dlls/wined3d/state.c -@@ -1126,7 +1126,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st - - case WINED3D_FOG_NONE: - /* Both are none? According to msdn the alpha channel of the specular -- * color contains a fog factor. Set it in drawStridedSlow. -+ * color contains a fog factor. Set it in draw_strided_slow. - * Same happens with Vertexfog on transformed vertices - */ - new_source = FOGSOURCE_COORD; -@@ -4190,7 +4190,7 @@ static void load_vertex_data(struct wined3d_context *context, - } - } - } else { -- /* TODO: support blends in drawStridedSlow -+ /* TODO: support blends in draw_strided_slow - * No need to write a FIXME here, this is done after the general vertex decl decoding - */ - WARN("unsupported blending in openGl\n"); -diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c -index 3465299..dfa9ee4 100644 ---- a/dlls/wined3d/utils.c -+++ b/dlls/wined3d/utils.c -@@ -3647,7 +3647,7 @@ static void compute_texture_matrix(const struct wined3d_gl_info *gl_info, const - * check for pixel shaders, and the shader has to undo the default gl divide. - * - * A more serious problem occurs if the app passes 4 coordinates in, and the -- * 4th is != 1.0(opengl default). This would have to be fixed in drawStridedSlow -+ * 4th is != 1.0(opengl default). This would have to be fixed in draw_strided_slow - * or a replacement shader. */ - default: - mat._14 = mat._24 = mat._34 = 0.0f; mat._44 = 1.0f; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index f9bb9d0..a8af32e 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -1010,8 +1010,9 @@ struct wined3d_stream_info - WORD use_map; /* MAX_ATTRIBS, 16 */ - }; - --void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count, -- UINT start_instance, UINT instance_count, BOOL indexed) DECLSPEC_HIDDEN; -+void draw_primitive(struct wined3d_device *device, const struct wined3d_state *state, -+ UINT start_idx, UINT index_count, UINT start_instance, UINT instance_count, -+ BOOL indexed) DECLSPEC_HIDDEN; - DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN; - - #define eps 1e-8f -@@ -1417,7 +1418,8 @@ void context_alloc_occlusion_query(struct wined3d_context *context, - void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN; - BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_device *device, - UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN; --BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_device *device) DECLSPEC_HIDDEN; -+BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, -+ const struct wined3d_state *state) DECLSPEC_HIDDEN; - void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, - struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN; - void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info, --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0052-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0052-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0052-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0052-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,43 @@ +From 95126fce6331a34c71f5ff736192d25e78e67dde Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 2 Apr 2013 16:20:13 +0200 +Subject: wined3d: Store the color in clear ops instead of a pointer + +--- + dlls/wined3d/cs.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index bac3fdb..fa1ee3a 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -96,7 +96,7 @@ struct wined3d_cs_clear + enum wined3d_cs_op opcode; + DWORD rect_count; + DWORD flags; +- const struct wined3d_color *color; ++ struct wined3d_color color; + float depth; + DWORD stencil; + RECT rects[1]; +@@ -454,7 +454,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) + wined3d_get_draw_rect(&device->state, &draw_rect); + device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, + &cs->state.fb, op->rect_count, op->rect_count ? op->rects : NULL, &draw_rect, op->flags, +- op->color, op->depth, op->stencil); ++ &op->color, op->depth, op->stencil); + + return sizeof(*op) + sizeof(*op->rects) * extra_rects; + } +@@ -471,7 +471,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * + if (rect_count) + memcpy(op->rects, rects, rect_count * sizeof(*rects)); + op->flags = flags; +- op->color = color; ++ op->color = *color; + op->depth = depth; + op->stencil = stencil; + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0052-wined3d-Wait-for-the-cs-before-destroying-objects.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0052-wined3d-Wait-for-the-cs-before-destroying-objects.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0052-wined3d-Wait-for-the-cs-before-destroying-objects.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0052-wined3d-Wait-for-the-cs-before-destroying-objects.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -From 534d7a18db58161682a42210ced42e8e7cf55ba8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 3 Apr 2013 18:01:34 +0200 -Subject: wined3d: Wait for the cs before destroying objects - -This is to avoid destroying objects that are still referenced in -commands in the cs. Later patches will migrate resource destruction to -the CS. ---- - dlls/wined3d/buffer.c | 6 ++++++ - dlls/wined3d/cs.c | 2 ++ - dlls/wined3d/shader.c | 5 +++++ - dlls/wined3d/surface.c | 6 ++++++ - dlls/wined3d/texture.c | 6 ++++++ - dlls/wined3d/vertexdeclaration.c | 5 +++++ - dlls/wined3d/wined3d_private.h | 1 + - 7 files changed, 31 insertions(+) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 8165d6b..bc34050 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -552,6 +552,12 @@ ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer) - - if (!refcount) - { -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); -+ } -+ - if (buffer->buffer_object) - { - context = context_acquire(buffer->resource.device, NULL); -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index eac7739..8823c9a 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1188,12 +1188,14 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = - { - wined3d_cs_st_require_space, - wined3d_cs_st_submit, -+ wined3d_cs_st_submit, - }; - - static const struct wined3d_cs_ops wined3d_cs_mt_ops = - { - wined3d_cs_mt_require_space, - wined3d_cs_flush_and_wait, -+ wined3d_cs_flush_and_wait, - }; - - /* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an -diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c -index cc969b8..0faabaa 100644 ---- a/dlls/wined3d/shader.c -+++ b/dlls/wined3d/shader.c -@@ -1957,6 +1957,11 @@ ULONG CDECL wined3d_shader_decref(struct wined3d_shader *shader) - - if (!refcount) - { -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ shader->device->cs->ops->finish(shader->device->cs); -+ } - shader_cleanup(shader); - shader->parent_ops->wined3d_object_destroyed(shader->parent); - HeapFree(GetProcessHeap(), 0, shader); -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 8fa2c9f..8f8af4d 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -42,6 +42,12 @@ static void surface_cleanup(struct wined3d_surface *surface) - - TRACE("surface %p.\n", surface); - -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ surface->resource.device->cs->ops->finish(surface->resource.device->cs); -+ } -+ - if (surface->resource.buffer_object || surface->rb_multisample - || surface->rb_resolved || !list_empty(&surface->renderbuffers)) - { -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index ec5c847..68889e5 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -136,6 +136,12 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) - - TRACE("texture %p.\n", texture); - -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ texture->resource.device->cs->ops->finish(texture->resource.device->cs); -+ } -+ - for (i = 0; i < sub_count; ++i) - { - struct wined3d_resource *sub_resource = texture->sub_resources[i]; -diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c -index cf5378c..3f4d5e4 100644 ---- a/dlls/wined3d/vertexdeclaration.c -+++ b/dlls/wined3d/vertexdeclaration.c -@@ -56,6 +56,11 @@ ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration - - if (!refcount) - { -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ declaration->device->cs->ops->finish(declaration->device->cs); -+ } - HeapFree(GetProcessHeap(), 0, declaration->elements); - declaration->parent_ops->wined3d_object_destroyed(declaration->parent); - HeapFree(GetProcessHeap(), 0, declaration); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index a48cc7d..b856b6f 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2544,6 +2544,7 @@ struct wined3d_cs_ops - { - void *(*require_space)(struct wined3d_cs *cs, size_t size); - void (*submit)(struct wined3d_cs *cs); -+ void (*finish)(struct wined3d_cs *cs); - }; - - struct wined3d_cs --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0053-wined3d-Give-the-cs-its-own-state.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0053-wined3d-Give-the-cs-its-own-state.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0053-wined3d-Give-the-cs-its-own-state.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0053-wined3d-Give-the-cs-its-own-state.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,255 +0,0 @@ -From 35f36ec3b2bf7fa8bdfabd7d698b118ba2030ccf Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 1 Oct 2013 15:30:26 +0200 -Subject: wined3d: Give the cs its own state - ---- - dlls/wined3d/cs.c | 108 +++++++++++++++++++++++++++++++++++------ - dlls/wined3d/device.c | 3 ++ - dlls/wined3d/wined3d_private.h | 4 +- - 3 files changed, 99 insertions(+), 16 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index a8327d1..1b466c3 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -63,6 +63,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SET_COLOR_KEY, - WINED3D_CS_OP_SET_MATERIAL, - WINED3D_CS_OP_RESET_STATE, -+ WINED3D_CS_OP_STATEBLOCK, - WINED3D_CS_OP_STOP, - }; - -@@ -278,6 +279,13 @@ struct wined3d_cs_reset_state - enum wined3d_cs_op opcode; - }; - -+struct wined3d_cs_stateblock -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_state state; -+ float vs_consts_f[256 * 4], ps_consts_f[256 * 4]; -+}; -+ - /* FIXME: The list synchronization probably isn't particularly fast. */ - static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) - { -@@ -461,7 +469,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) - unsigned int extra_rects = op->rect_count ? op->rect_count - 1 : 0; - - device = cs->device; -- wined3d_get_draw_rect(&device->state, &draw_rect); -+ wined3d_get_draw_rect(&cs->state, &draw_rect); - device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, - &cs->state.fb, op->rect_count, op->rect_count ? op->rects : NULL, &draw_rect, op->flags, - &op->color, op->depth, op->stencil); -@@ -492,7 +500,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_draw *op = data; - -- draw_primitive(cs->device, &cs->device->state, op->start_idx, op->index_count, -+ draw_primitive(cs->device, &cs->state, op->start_idx, op->index_count, - op->start_instance, op->instance_count, op->indexed); - - return sizeof(*op); -@@ -907,6 +915,72 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined - op->opcode = WINED3D_CS_OP_SET_TEXTURE; - op->stage = stage; - op->texture = texture; -+ cs->ops->submit(cs); -+} -+ -+static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_adapter *adapter = cs->device->adapter; -+ const struct wined3d_cs_stateblock *op = data; -+ UINT num_vs_consts_f = sizeof(op->vs_consts_f) / sizeof(*op->vs_consts_f) / 4; -+ UINT num_ps_consts_f = sizeof(op->ps_consts_f) / sizeof(*op->ps_consts_f) / 4; -+ -+ num_vs_consts_f = min(num_vs_consts_f, adapter->d3d_info.limits.vs_uniform_count); -+ num_ps_consts_f = min(num_ps_consts_f, adapter->d3d_info.limits.ps_uniform_count); -+ -+ /* Don't memcpy the entire struct, we'll remove single items as we add dedicated -+ * ops for setting states */ -+ -+ cs->state.base_vertex_index = op->state.base_vertex_index; -+ cs->state.load_base_vertex_index = op->state.load_base_vertex_index; -+ cs->state.gl_primitive_type = op->state.gl_primitive_type; -+ -+ memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b)); -+ memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i)); -+ memcpy(cs->state.vs_consts_f, op->state.vs_consts_f, sizeof(*cs->state.vs_consts_f) * num_vs_consts_f); -+ -+ memcpy(cs->state.ps_consts_b, op->state.ps_consts_b, sizeof(cs->state.ps_consts_b)); -+ memcpy(cs->state.ps_consts_i, op->state.ps_consts_i, sizeof(cs->state.ps_consts_i)); -+ memcpy(cs->state.ps_consts_f, op->state.ps_consts_f, sizeof(*cs->state.ps_consts_f) * num_ps_consts_f); -+ -+ memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights)); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct wined3d_state *state) -+{ -+ const struct wined3d_device *device = cs->device; -+ const struct wined3d_adapter *adapter = device->adapter; -+ struct wined3d_cs_stateblock *op; -+ UINT num_vs_consts_f = sizeof(op->vs_consts_f) / sizeof(*op->vs_consts_f) / 4; -+ UINT num_ps_consts_f = sizeof(op->ps_consts_f) / sizeof(*op->ps_consts_f) / 4; -+ -+ num_vs_consts_f = min(num_vs_consts_f, adapter->d3d_info.limits.vs_uniform_count); -+ num_ps_consts_f = min(num_ps_consts_f, adapter->d3d_info.limits.ps_uniform_count); -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_STATEBLOCK; -+ -+ /* Don't memcpy the entire struct, we'll remove single items as we add dedicated -+ * ops for setting states */ -+ op->state.base_vertex_index = state->base_vertex_index; -+ op->state.load_base_vertex_index = state->load_base_vertex_index; -+ op->state.gl_primitive_type = state->gl_primitive_type; -+ -+ memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b)); -+ memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i)); -+ op->state.vs_consts_f = op->vs_consts_f; -+ memcpy(op->state.vs_consts_f, state->vs_consts_f, sizeof(*op->state.vs_consts_f) * num_vs_consts_f); -+ -+ memcpy(op->state.ps_consts_b, state->ps_consts_b, sizeof(op->state.ps_consts_b)); -+ memcpy(op->state.ps_consts_i, state->ps_consts_i, sizeof(op->state.ps_consts_i)); -+ op->state.ps_consts_f = op->ps_consts_f; -+ memcpy(op->state.ps_consts_f, state->ps_consts_f, sizeof(*op->state.ps_consts_f) * num_ps_consts_f); -+ -+ /* FIXME: This is not ideal. CS is still running synchronously, so this is ok. -+ * It will go away soon anyway. */ -+ memcpy(op->state.lights, state->lights, sizeof(op->state.lights)); - - cs->ops->submit(cs); - } -@@ -1250,6 +1324,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_COLOR_KEY */ wined3d_cs_exec_set_color_key, - /* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material, - /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, -+ /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, - }; - - static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -@@ -1339,7 +1414,7 @@ done: - struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) - { - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -- struct wined3d_cs *cs; -+ struct wined3d_cs *cs = NULL; - - if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs)))) - return NULL; -@@ -1347,8 +1422,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) - if (FAILED(state_init(&cs->state, gl_info, &device->adapter->d3d_info, - WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT))) - { -- HeapFree(GetProcessHeap(), 0, cs); -- return NULL; -+ goto err; - } - - cs->ops = &wined3d_cs_st_ops; -@@ -1357,16 +1431,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) - cs->data_size = WINED3D_INITIAL_CS_SIZE; - if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size))) - { -- HeapFree(GetProcessHeap(), 0, cs); -- return NULL; -+ goto err; - } - - if ((cs->tls_idx = TlsAlloc()) == TLS_OUT_OF_INDEXES) - { - ERR("Failed to allocate cs TLS index, err %#x.\n", GetLastError()); -- HeapFree(GetProcessHeap(), 0, cs->data); -- HeapFree(GetProcessHeap(), 0, cs); -- return NULL; -+ goto err; - } - - if (wined3d_settings.cs_multithreaded) -@@ -1379,15 +1450,22 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) - if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL))) - { - ERR("Failed to create wined3d command stream thread.\n"); -- if (!TlsFree(cs->tls_idx)) -- ERR("Failed to free cs TLS index, err %#x.\n", GetLastError()); -- HeapFree(GetProcessHeap(), 0, cs->data); -- HeapFree(GetProcessHeap(), 0, cs); -- return NULL; -+ goto err; - } - } - - return cs; -+ -+err: -+ if (cs) -+ { -+ state_cleanup(&cs->state); -+ if (cs->tls_idx != TLS_OUT_OF_INDEXES && !TlsFree(cs->tls_idx)) -+ ERR("Failed to free cs TLS index, err %#x.\n", GetLastError()); -+ HeapFree(GetProcessHeap(), 0, cs->data); -+ } -+ HeapFree(GetProcessHeap(), 0, cs); -+ return NULL; - } - - void wined3d_cs_destroy(struct wined3d_cs *cs) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 3bd45da..b936039 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -3409,6 +3409,7 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT - device_invalidate_state(device, STATE_BASEVERTEXINDEX); - } - -+ wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); - wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE); - - return WINED3D_OK; -@@ -3452,6 +3453,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic - device_invalidate_state(device, STATE_BASEVERTEXINDEX); - } - -+ wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); - wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE); - - return WINED3D_OK; -@@ -3463,6 +3465,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device - TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n", - device, start_idx, index_count, start_instance, instance_count); - -+ wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); - wined3d_cs_emit_draw(device->cs, start_idx, index_count, start_instance, instance_count, TRUE); - } - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 1f95a50..d8b24a5 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2584,7 +2584,7 @@ struct wined3d_cs_block - { - struct list entry; - UINT pos; -- BYTE data[4000]; /* FIXME? The size is somewhat arbitrary. */ -+ BYTE data[sizeof(struct wined3d_state) * 2]; /* FIXME? The size is somewhat arbitrary. */ - }; - - struct wined3d_cs_ops -@@ -2626,6 +2626,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture - WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, - UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, -+ const struct wined3d_state *state) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, - struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0053-wined3d-Pass-the-state-to-draw_primitive.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0053-wined3d-Pass-the-state-to-draw_primitive.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0053-wined3d-Pass-the-state-to-draw_primitive.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0053-wined3d-Pass-the-state-to-draw_primitive.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,263 @@ +From ede3d178fc2a2ddde4b50913afca7920472c83c5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 2 Apr 2013 17:25:19 +0200 +Subject: wined3d: Pass the state to draw_primitive + +--- + dlls/wined3d/buffer.c | 6 +++--- + dlls/wined3d/context.c | 6 +++--- + dlls/wined3d/cs.c | 2 +- + dlls/wined3d/directx.c | 2 +- + dlls/wined3d/drawprim.c | 27 +++++++++++++-------------- + dlls/wined3d/state.c | 4 ++-- + dlls/wined3d/utils.c | 2 +- + dlls/wined3d/wined3d_private.h | 8 +++++--- + 8 files changed, 29 insertions(+), 28 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 50dbb2d..206e969 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -423,7 +423,7 @@ static inline void fixup_d3dcolor(DWORD *dst_color) + { + DWORD src_color = *dst_color; + +- /* Color conversion like in drawStridedSlow. watch out for little endianity ++ /* Color conversion like in draw_strided_slow. watch out for little endianity + * If we want that stuff to work on big endian machines too we have to consider more things + * + * 0xff000000: Alpha mask +@@ -1184,11 +1184,11 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + + dynamic_buffer_ok = gl_info->supported[APPLE_FLUSH_BUFFER_RANGE] || gl_info->supported[ARB_MAP_BUFFER_RANGE]; + +- /* Observations show that drawStridedSlow is faster on dynamic VBs than converting + ++ /* Observations show that draw_strided_slow is faster on dynamic VBs than converting + + * drawStridedFast (half-life 2 and others). + * + * Basically converting the vertices in the buffer is quite expensive, and observations +- * show that drawStridedSlow is faster than converting + uploading + drawStridedFast. ++ * show that draw_strided_slow is faster than converting + uploading + drawStridedFast. + * Therefore do not create a VBO for WINED3DUSAGE_DYNAMIC buffers. + */ + if (!gl_info->supported[ARB_VERTEX_BUFFER_OBJECT]) +diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c +index 9be96dc..097e0e9 100644 +--- a/dlls/wined3d/context.c ++++ b/dlls/wined3d/context.c +@@ -2955,7 +2955,7 @@ static void context_update_stream_info(struct wined3d_context *context, const st + { + if (state->vertex_declaration->half_float_conv_needed && !stream_info->all_vbo) + { +- TRACE("Using drawStridedSlow with vertex shaders for FLOAT16 conversion.\n"); ++ TRACE("Using draw_strided_slow with vertex shaders for FLOAT16 conversion.\n"); + context->use_immediate_mode_draw = TRUE; + } + else +@@ -3095,9 +3095,9 @@ static void context_bind_shader_resources(struct wined3d_context *context, const + } + + /* Context activation is done by the caller. */ +-BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_device *device) ++BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, ++ const struct wined3d_state *state) + { +- const struct wined3d_state *state = &device->state; + const struct StateEntry *state_table = context->state_table; + const struct wined3d_fb_state *fb = &state->fb; + unsigned int i, j; +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 8f1a016..84007cc 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -492,7 +492,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_draw *op = data; + +- draw_primitive(cs->device, op->start_idx, op->index_count, ++ draw_primitive(cs->device, &cs->device->state, op->start_idx, op->index_count, + op->start_instance, op->instance_count, op->indexed); + + return sizeof(*op); +diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c +index f238fc0..abc4aee 100644 +--- a/dlls/wined3d/directx.c ++++ b/dlls/wined3d/directx.c +@@ -5329,7 +5329,7 @@ static void WINE_GLAPI invalid_texcoord_func(GLenum unit, const void *data) + } + + /* Helper functions for providing vertex data to opengl. The arrays are initialized based on +- * the extension detection and are used in drawStridedSlow ++ * the extension detection and are used in draw_strided_slow + */ + static void WINE_GLAPI position_d3dcolor(const void *data) + { +diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c +index b10bc45..529bcd6 100644 +--- a/dlls/wined3d/drawprim.c ++++ b/dlls/wined3d/drawprim.c +@@ -36,7 +36,7 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); + #include + + /* Context activation is done by the caller. */ +-static void drawStridedFast(const struct wined3d_gl_info *gl_info, GLenum primitive_type, UINT count, UINT idx_size, ++static void draw_strided_fast(const struct wined3d_gl_info *gl_info, GLenum primitive_type, UINT count, UINT idx_size, + const void *idx_data, UINT start_idx, INT base_vertex_index, UINT start_instance, UINT instance_count) + { + if (idx_size) +@@ -95,7 +95,7 @@ static void drawStridedFast(const struct wined3d_gl_info *gl_info, GLenum primit + */ + + /* Context activation is done by the caller. */ +-static void drawStridedSlow(const struct wined3d_device *device, struct wined3d_context *context, ++static void draw_strided_slow(const struct wined3d_state *state, struct wined3d_context *context, + const struct wined3d_stream_info *si, UINT NumVertexes, GLenum glPrimType, + const void *idxData, UINT idxSize, UINT startIdx) + { +@@ -103,7 +103,6 @@ static void drawStridedSlow(const struct wined3d_device *device, struct wined3d_ + const WORD *pIdxBufS = NULL; + const DWORD *pIdxBufL = NULL; + UINT vx_index; +- const struct wined3d_state *state = &device->state; + LONG SkipnStrides = startIdx; + BOOL pixelShader = use_ps(state); + BOOL specular_fog = FALSE; +@@ -453,7 +452,7 @@ static inline void send_attribute(const struct wined3d_gl_info *gl_info, + } + + /* Context activation is done by the caller. */ +-static void drawStridedSlowVs(struct wined3d_context *context, const struct wined3d_state *state, ++static void draw_strided_slow_vs(struct wined3d_context *context, const struct wined3d_state *state, + const struct wined3d_stream_info *si, UINT numberOfVertices, GLenum glPrimitiveType, + const void *idxData, UINT idxSize, UINT startIdx) + { +@@ -510,7 +509,7 @@ static void drawStridedSlowVs(struct wined3d_context *context, const struct wine + } + + /* Context activation is done by the caller. */ +-static void drawStridedInstanced(struct wined3d_context *context, const struct wined3d_state *state, ++static void draw_strided_instanced(struct wined3d_context *context, const struct wined3d_state *state, + const struct wined3d_stream_info *si, UINT numberOfVertices, GLenum glPrimitiveType, + const void *idxData, UINT idxSize, UINT startIdx, UINT base_vertex_index, UINT instance_count) + { +@@ -595,10 +594,10 @@ static void remove_vbos(struct wined3d_context *context, + } + + /* Routine common to the draw primitive and draw indexed primitive routines */ +-void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count, +- UINT start_instance, UINT instance_count, BOOL indexed) ++void draw_primitive(struct wined3d_device *device, const struct wined3d_state *state, ++ UINT start_idx, UINT index_count, UINT start_instance, UINT instance_count, ++ BOOL indexed) + { +- const struct wined3d_state *state = &device->state; + const struct wined3d_stream_info *stream_info; + struct wined3d_event_query *ib_query = NULL; + struct wined3d_stream_info si_emulated; +@@ -664,7 +663,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co + } + } + +- if (!context_apply_draw_state(context, device)) ++ if (!context_apply_draw_state(context, device, state)) + { + context_release(context); + WARN("Unable to apply draw state, skipping draw.\n"); +@@ -756,28 +755,28 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co + else + WARN_(d3d_perf)("Using immediate mode with vertex shaders for half float emulation.\n"); + +- drawStridedSlowVs(context, state, stream_info, index_count, ++ draw_strided_slow_vs(context, state, stream_info, index_count, + state->gl_primitive_type, idx_data, idx_size, start_idx); + } + else + { + if (context->d3d_info->ffp_generic_attributes) +- drawStridedSlowVs(context, state, stream_info, index_count, ++ draw_strided_slow_vs(context, state, stream_info, index_count, + state->gl_primitive_type, idx_data, idx_size, start_idx); + else +- drawStridedSlow(device, context, stream_info, index_count, ++ draw_strided_slow(state, context, stream_info, index_count, + state->gl_primitive_type, idx_data, idx_size, start_idx); + } + } + else if (!gl_info->supported[ARB_INSTANCED_ARRAYS] && instance_count) + { + /* Instancing emulation by mixing immediate mode and arrays. */ +- drawStridedInstanced(context, state, stream_info, index_count, state->gl_primitive_type, ++ draw_strided_instanced(context, state, stream_info, index_count, state->gl_primitive_type, + idx_data, idx_size, start_idx, state->base_vertex_index, instance_count); + } + else + { +- drawStridedFast(gl_info, state->gl_primitive_type, index_count, idx_size, idx_data, ++ draw_strided_fast(gl_info, state->gl_primitive_type, index_count, idx_size, idx_data, + start_idx, state->base_vertex_index, start_instance, instance_count); + } + +diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c +index e2fcc5d..be26f8f 100644 +--- a/dlls/wined3d/state.c ++++ b/dlls/wined3d/state.c +@@ -1126,7 +1126,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st + + case WINED3D_FOG_NONE: + /* Both are none? According to msdn the alpha channel of the specular +- * color contains a fog factor. Set it in drawStridedSlow. ++ * color contains a fog factor. Set it in draw_strided_slow. + * Same happens with Vertexfog on transformed vertices + */ + new_source = FOGSOURCE_COORD; +@@ -4190,7 +4190,7 @@ static void load_vertex_data(struct wined3d_context *context, + } + } + } else { +- /* TODO: support blends in drawStridedSlow ++ /* TODO: support blends in draw_strided_slow + * No need to write a FIXME here, this is done after the general vertex decl decoding + */ + WARN("unsupported blending in openGl\n"); +diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c +index 3465299..dfa9ee4 100644 +--- a/dlls/wined3d/utils.c ++++ b/dlls/wined3d/utils.c +@@ -3647,7 +3647,7 @@ static void compute_texture_matrix(const struct wined3d_gl_info *gl_info, const + * check for pixel shaders, and the shader has to undo the default gl divide. + * + * A more serious problem occurs if the app passes 4 coordinates in, and the +- * 4th is != 1.0(opengl default). This would have to be fixed in drawStridedSlow ++ * 4th is != 1.0(opengl default). This would have to be fixed in draw_strided_slow + * or a replacement shader. */ + default: + mat._14 = mat._24 = mat._34 = 0.0f; mat._44 = 1.0f; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index f9bb9d0..a8af32e 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -1010,8 +1010,9 @@ struct wined3d_stream_info + WORD use_map; /* MAX_ATTRIBS, 16 */ + }; + +-void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count, +- UINT start_instance, UINT instance_count, BOOL indexed) DECLSPEC_HIDDEN; ++void draw_primitive(struct wined3d_device *device, const struct wined3d_state *state, ++ UINT start_idx, UINT index_count, UINT start_instance, UINT instance_count, ++ BOOL indexed) DECLSPEC_HIDDEN; + DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN; + + #define eps 1e-8f +@@ -1417,7 +1418,8 @@ void context_alloc_occlusion_query(struct wined3d_context *context, + void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN; + BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_device *device, + UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN; +-BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_device *device) DECLSPEC_HIDDEN; ++BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, ++ const struct wined3d_state *state) DECLSPEC_HIDDEN; + void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, + struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN; + void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info, +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0054-wined3d-Send-float-constant-updates-through-the-comm.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0054-wined3d-Send-float-constant-updates-through-the-comm.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0054-wined3d-Send-float-constant-updates-through-the-comm.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0054-wined3d-Send-float-constant-updates-through-the-comm.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,208 +0,0 @@ -From bbd02a077bf5ba977724ada68709f46150e482fb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 20 Aug 2013 15:12:26 +0200 -Subject: wined3d: Send float constant updates through the command stream - ---- - dlls/wined3d/cs.c | 88 ++++++++++++++++++++++++++++++++---------- - dlls/wined3d/device.c | 7 ++-- - dlls/wined3d/wined3d_private.h | 2 + - 3 files changed, 74 insertions(+), 23 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index d252773..56cbcb6 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -63,6 +63,8 @@ enum wined3d_cs_op - WINED3D_CS_OP_SET_MATERIAL, - WINED3D_CS_OP_RESET_STATE, - WINED3D_CS_OP_STATEBLOCK, -+ WINED3D_CS_OP_SET_VS_CONSTS_F, -+ WINED3D_CS_OP_SET_PS_CONSTS_F, - WINED3D_CS_OP_STOP, - }; - -@@ -273,7 +275,13 @@ struct wined3d_cs_stateblock - { - enum wined3d_cs_op opcode; - struct wined3d_state state; -- float vs_consts_f[256 * 4], ps_consts_f[256 * 4]; -+}; -+ -+struct wined3d_cs_set_consts_f -+{ -+ enum wined3d_cs_op opcode; -+ UINT start_register, vector4f_count; -+ float constants[4]; - }; - - /* FIXME: The list synchronization probably isn't particularly fast. */ -@@ -910,13 +918,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined - - static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const void *data) - { -- const struct wined3d_adapter *adapter = cs->device->adapter; - const struct wined3d_cs_stateblock *op = data; -- UINT num_vs_consts_f = sizeof(op->vs_consts_f) / sizeof(*op->vs_consts_f) / 4; -- UINT num_ps_consts_f = sizeof(op->ps_consts_f) / sizeof(*op->ps_consts_f) / 4; -- -- num_vs_consts_f = min(num_vs_consts_f, adapter->d3d_info.limits.vs_uniform_count); -- num_ps_consts_f = min(num_ps_consts_f, adapter->d3d_info.limits.ps_uniform_count); - - /* Don't memcpy the entire struct, we'll remove single items as we add dedicated - * ops for setting states */ -@@ -927,11 +929,9 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi - - memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b)); - memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i)); -- memcpy(cs->state.vs_consts_f, op->state.vs_consts_f, sizeof(*cs->state.vs_consts_f) * num_vs_consts_f); - - memcpy(cs->state.ps_consts_b, op->state.ps_consts_b, sizeof(cs->state.ps_consts_b)); - memcpy(cs->state.ps_consts_i, op->state.ps_consts_i, sizeof(cs->state.ps_consts_i)); -- memcpy(cs->state.ps_consts_f, op->state.ps_consts_f, sizeof(*cs->state.ps_consts_f) * num_ps_consts_f); - - memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights)); - -@@ -940,14 +940,7 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi - - void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct wined3d_state *state) - { -- const struct wined3d_device *device = cs->device; -- const struct wined3d_adapter *adapter = device->adapter; - struct wined3d_cs_stateblock *op; -- UINT num_vs_consts_f = sizeof(op->vs_consts_f) / sizeof(*op->vs_consts_f) / 4; -- UINT num_ps_consts_f = sizeof(op->ps_consts_f) / sizeof(*op->ps_consts_f) / 4; -- -- num_vs_consts_f = min(num_vs_consts_f, adapter->d3d_info.limits.vs_uniform_count); -- num_ps_consts_f = min(num_ps_consts_f, adapter->d3d_info.limits.ps_uniform_count); - - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_STATEBLOCK; -@@ -960,13 +953,9 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win - - memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b)); - memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i)); -- op->state.vs_consts_f = op->vs_consts_f; -- memcpy(op->state.vs_consts_f, state->vs_consts_f, sizeof(*op->state.vs_consts_f) * num_vs_consts_f); - - memcpy(op->state.ps_consts_b, state->ps_consts_b, sizeof(op->state.ps_consts_b)); - memcpy(op->state.ps_consts_i, state->ps_consts_i, sizeof(op->state.ps_consts_i)); -- op->state.ps_consts_f = op->ps_consts_f; -- memcpy(op->state.ps_consts_f, state->ps_consts_f, sizeof(*op->state.ps_consts_f) * num_ps_consts_f); - - /* FIXME: This is not ideal. CS is still running synchronously, so this is ok. - * It will go away soon anyway. */ -@@ -1039,6 +1028,63 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type - op->opcode = WINED3D_CS_OP_SET_SHADER; - op->type = type; - op->shader = shader; -+} -+ -+static UINT wined3d_cs_exec_set_vs_consts_f(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_consts_f *op = data; -+ struct wined3d_device *device = cs->device; -+ -+ memcpy(cs->state.vs_consts_f + op->start_register * 4, op->constants, -+ sizeof(*cs->state.vs_consts_f) * 4 * op->vector4f_count); -+ -+ device->shader_backend->shader_update_float_vertex_constants(device, -+ op->start_register, op->vector4f_count); -+ -+ return sizeof(*op) + sizeof(op->constants) * (op->vector4f_count - 1); -+} -+ -+static UINT wined3d_cs_exec_set_ps_consts_f(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_consts_f *op = data; -+ struct wined3d_device *device = cs->device; -+ -+ memcpy(cs->state.ps_consts_f + op->start_register * 4, op->constants, -+ sizeof(*cs->state.ps_consts_f) * 4 * op->vector4f_count); -+ -+ device->shader_backend->shader_update_float_pixel_constants(device, -+ op->start_register, op->vector4f_count); -+ -+ return sizeof(*op) + sizeof(op->constants) * (op->vector4f_count - 1); -+} -+ -+void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, -+ const float *constants, UINT vector4f_count, enum wined3d_shader_type type) -+{ -+ struct wined3d_cs_set_consts_f *op; -+ UINT extra_space = vector4f_count - 1; -+ -+ op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space); -+ switch (type) -+ { -+ case WINED3D_SHADER_TYPE_PIXEL: -+ op->opcode = WINED3D_CS_OP_SET_PS_CONSTS_F; -+ break; -+ -+ case WINED3D_SHADER_TYPE_VERTEX: -+ op->opcode = WINED3D_CS_OP_SET_VS_CONSTS_F; -+ break; -+ -+ case WINED3D_SHADER_TYPE_GEOMETRY: -+ FIXME("Invalid for geometry shaders\n"); -+ return; -+ -+ case WINED3D_SHADER_TYPE_COUNT: -+ break; -+ } -+ op->start_register = start_register; -+ op->vector4f_count = vector4f_count; -+ memcpy(op->constants, constants, sizeof(*constants) * 4 * vector4f_count); - - cs->ops->submit(cs); - } -@@ -1233,6 +1279,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material, - /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, - /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, -+ /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, -+ /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, - }; - - static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 6ea0b9a..2aba2a4 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -2341,8 +2341,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, - memset(device->recording->changed.vertexShaderConstantsF + start_register, 1, - sizeof(*device->recording->changed.vertexShaderConstantsF) * vector4f_count); - else -- device->shader_backend->shader_update_float_vertex_constants(device, start_register, vector4f_count); -- -+ wined3d_cs_emit_set_consts_f(device->cs, start_register, constants, vector4f_count, -+ WINED3D_SHADER_TYPE_VERTEX); - - return WINED3D_OK; - } -@@ -2576,7 +2576,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, - memset(device->recording->changed.pixelShaderConstantsF + start_register, 1, - sizeof(*device->recording->changed.pixelShaderConstantsF) * vector4f_count); - else -- device->shader_backend->shader_update_float_pixel_constants(device, start_register, vector4f_count); -+ wined3d_cs_emit_set_consts_f(device->cs, start_register, constants, vector4f_count, -+ WINED3D_SHADER_TYPE_PIXEL); - - return WINED3D_OK; - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 02104ce..d673a8f 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2613,6 +2613,8 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform - void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, - struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, -+ UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0054-wined3d-Wait-for-the-cs-before-destroying-objects.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0054-wined3d-Wait-for-the-cs-before-destroying-objects.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0054-wined3d-Wait-for-the-cs-before-destroying-objects.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0054-wined3d-Wait-for-the-cs-before-destroying-objects.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,135 @@ +From 534d7a18db58161682a42210ced42e8e7cf55ba8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 3 Apr 2013 18:01:34 +0200 +Subject: wined3d: Wait for the cs before destroying objects + +This is to avoid destroying objects that are still referenced in +commands in the cs. Later patches will migrate resource destruction to +the CS. +--- + dlls/wined3d/buffer.c | 6 ++++++ + dlls/wined3d/cs.c | 2 ++ + dlls/wined3d/shader.c | 5 +++++ + dlls/wined3d/surface.c | 6 ++++++ + dlls/wined3d/texture.c | 6 ++++++ + dlls/wined3d/vertexdeclaration.c | 5 +++++ + dlls/wined3d/wined3d_private.h | 1 + + 7 files changed, 31 insertions(+) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 8165d6b..bc34050 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -552,6 +552,12 @@ ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer) + + if (!refcount) + { ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); ++ } ++ + if (buffer->buffer_object) + { + context = context_acquire(buffer->resource.device, NULL); +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index eac7739..8823c9a 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1188,12 +1188,14 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = + { + wined3d_cs_st_require_space, + wined3d_cs_st_submit, ++ wined3d_cs_st_submit, + }; + + static const struct wined3d_cs_ops wined3d_cs_mt_ops = + { + wined3d_cs_mt_require_space, + wined3d_cs_flush_and_wait, ++ wined3d_cs_flush_and_wait, + }; + + /* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an +diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c +index cc969b8..0faabaa 100644 +--- a/dlls/wined3d/shader.c ++++ b/dlls/wined3d/shader.c +@@ -1957,6 +1957,11 @@ ULONG CDECL wined3d_shader_decref(struct wined3d_shader *shader) + + if (!refcount) + { ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ shader->device->cs->ops->finish(shader->device->cs); ++ } + shader_cleanup(shader); + shader->parent_ops->wined3d_object_destroyed(shader->parent); + HeapFree(GetProcessHeap(), 0, shader); +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 8fa2c9f..8f8af4d 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -42,6 +42,12 @@ static void surface_cleanup(struct wined3d_surface *surface) + + TRACE("surface %p.\n", surface); + ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ surface->resource.device->cs->ops->finish(surface->resource.device->cs); ++ } ++ + if (surface->resource.buffer_object || surface->rb_multisample + || surface->rb_resolved || !list_empty(&surface->renderbuffers)) + { +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index ec5c847..68889e5 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -136,6 +136,12 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) + + TRACE("texture %p.\n", texture); + ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ texture->resource.device->cs->ops->finish(texture->resource.device->cs); ++ } ++ + for (i = 0; i < sub_count; ++i) + { + struct wined3d_resource *sub_resource = texture->sub_resources[i]; +diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c +index cf5378c..3f4d5e4 100644 +--- a/dlls/wined3d/vertexdeclaration.c ++++ b/dlls/wined3d/vertexdeclaration.c +@@ -56,6 +56,11 @@ ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration + + if (!refcount) + { ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ declaration->device->cs->ops->finish(declaration->device->cs); ++ } + HeapFree(GetProcessHeap(), 0, declaration->elements); + declaration->parent_ops->wined3d_object_destroyed(declaration->parent); + HeapFree(GetProcessHeap(), 0, declaration); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index a48cc7d..b856b6f 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2544,6 +2544,7 @@ struct wined3d_cs_ops + { + void *(*require_space)(struct wined3d_cs *cs, size_t size); + void (*submit)(struct wined3d_cs *cs); ++ void (*finish)(struct wined3d_cs *cs); + }; + + struct wined3d_cs +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0055-wined3d-Give-the-cs-its-own-state.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0055-wined3d-Give-the-cs-its-own-state.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0055-wined3d-Give-the-cs-its-own-state.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0055-wined3d-Give-the-cs-its-own-state.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,255 @@ +From 35f36ec3b2bf7fa8bdfabd7d698b118ba2030ccf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 1 Oct 2013 15:30:26 +0200 +Subject: wined3d: Give the cs its own state + +--- + dlls/wined3d/cs.c | 108 +++++++++++++++++++++++++++++++++++------ + dlls/wined3d/device.c | 3 ++ + dlls/wined3d/wined3d_private.h | 4 +- + 3 files changed, 99 insertions(+), 16 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index a8327d1..1b466c3 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -63,6 +63,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_SET_COLOR_KEY, + WINED3D_CS_OP_SET_MATERIAL, + WINED3D_CS_OP_RESET_STATE, ++ WINED3D_CS_OP_STATEBLOCK, + WINED3D_CS_OP_STOP, + }; + +@@ -278,6 +279,13 @@ struct wined3d_cs_reset_state + enum wined3d_cs_op opcode; + }; + ++struct wined3d_cs_stateblock ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_state state; ++ float vs_consts_f[256 * 4], ps_consts_f[256 * 4]; ++}; ++ + /* FIXME: The list synchronization probably isn't particularly fast. */ + static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) + { +@@ -461,7 +469,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) + unsigned int extra_rects = op->rect_count ? op->rect_count - 1 : 0; + + device = cs->device; +- wined3d_get_draw_rect(&device->state, &draw_rect); ++ wined3d_get_draw_rect(&cs->state, &draw_rect); + device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, + &cs->state.fb, op->rect_count, op->rect_count ? op->rects : NULL, &draw_rect, op->flags, + &op->color, op->depth, op->stencil); +@@ -492,7 +500,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_draw *op = data; + +- draw_primitive(cs->device, &cs->device->state, op->start_idx, op->index_count, ++ draw_primitive(cs->device, &cs->state, op->start_idx, op->index_count, + op->start_instance, op->instance_count, op->indexed); + + return sizeof(*op); +@@ -907,6 +915,72 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined + op->opcode = WINED3D_CS_OP_SET_TEXTURE; + op->stage = stage; + op->texture = texture; ++ cs->ops->submit(cs); ++} ++ ++static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_adapter *adapter = cs->device->adapter; ++ const struct wined3d_cs_stateblock *op = data; ++ UINT num_vs_consts_f = sizeof(op->vs_consts_f) / sizeof(*op->vs_consts_f) / 4; ++ UINT num_ps_consts_f = sizeof(op->ps_consts_f) / sizeof(*op->ps_consts_f) / 4; ++ ++ num_vs_consts_f = min(num_vs_consts_f, adapter->d3d_info.limits.vs_uniform_count); ++ num_ps_consts_f = min(num_ps_consts_f, adapter->d3d_info.limits.ps_uniform_count); ++ ++ /* Don't memcpy the entire struct, we'll remove single items as we add dedicated ++ * ops for setting states */ ++ ++ cs->state.base_vertex_index = op->state.base_vertex_index; ++ cs->state.load_base_vertex_index = op->state.load_base_vertex_index; ++ cs->state.gl_primitive_type = op->state.gl_primitive_type; ++ ++ memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b)); ++ memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i)); ++ memcpy(cs->state.vs_consts_f, op->state.vs_consts_f, sizeof(*cs->state.vs_consts_f) * num_vs_consts_f); ++ ++ memcpy(cs->state.ps_consts_b, op->state.ps_consts_b, sizeof(cs->state.ps_consts_b)); ++ memcpy(cs->state.ps_consts_i, op->state.ps_consts_i, sizeof(cs->state.ps_consts_i)); ++ memcpy(cs->state.ps_consts_f, op->state.ps_consts_f, sizeof(*cs->state.ps_consts_f) * num_ps_consts_f); ++ ++ memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights)); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct wined3d_state *state) ++{ ++ const struct wined3d_device *device = cs->device; ++ const struct wined3d_adapter *adapter = device->adapter; ++ struct wined3d_cs_stateblock *op; ++ UINT num_vs_consts_f = sizeof(op->vs_consts_f) / sizeof(*op->vs_consts_f) / 4; ++ UINT num_ps_consts_f = sizeof(op->ps_consts_f) / sizeof(*op->ps_consts_f) / 4; ++ ++ num_vs_consts_f = min(num_vs_consts_f, adapter->d3d_info.limits.vs_uniform_count); ++ num_ps_consts_f = min(num_ps_consts_f, adapter->d3d_info.limits.ps_uniform_count); ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_STATEBLOCK; ++ ++ /* Don't memcpy the entire struct, we'll remove single items as we add dedicated ++ * ops for setting states */ ++ op->state.base_vertex_index = state->base_vertex_index; ++ op->state.load_base_vertex_index = state->load_base_vertex_index; ++ op->state.gl_primitive_type = state->gl_primitive_type; ++ ++ memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b)); ++ memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i)); ++ op->state.vs_consts_f = op->vs_consts_f; ++ memcpy(op->state.vs_consts_f, state->vs_consts_f, sizeof(*op->state.vs_consts_f) * num_vs_consts_f); ++ ++ memcpy(op->state.ps_consts_b, state->ps_consts_b, sizeof(op->state.ps_consts_b)); ++ memcpy(op->state.ps_consts_i, state->ps_consts_i, sizeof(op->state.ps_consts_i)); ++ op->state.ps_consts_f = op->ps_consts_f; ++ memcpy(op->state.ps_consts_f, state->ps_consts_f, sizeof(*op->state.ps_consts_f) * num_ps_consts_f); ++ ++ /* FIXME: This is not ideal. CS is still running synchronously, so this is ok. ++ * It will go away soon anyway. */ ++ memcpy(op->state.lights, state->lights, sizeof(op->state.lights)); + + cs->ops->submit(cs); + } +@@ -1250,6 +1324,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_COLOR_KEY */ wined3d_cs_exec_set_color_key, + /* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material, + /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, ++ /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, + }; + + static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) +@@ -1339,7 +1414,7 @@ done: + struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) + { + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; +- struct wined3d_cs *cs; ++ struct wined3d_cs *cs = NULL; + + if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs)))) + return NULL; +@@ -1347,8 +1422,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) + if (FAILED(state_init(&cs->state, gl_info, &device->adapter->d3d_info, + WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT))) + { +- HeapFree(GetProcessHeap(), 0, cs); +- return NULL; ++ goto err; + } + + cs->ops = &wined3d_cs_st_ops; +@@ -1357,16 +1431,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) + cs->data_size = WINED3D_INITIAL_CS_SIZE; + if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size))) + { +- HeapFree(GetProcessHeap(), 0, cs); +- return NULL; ++ goto err; + } + + if ((cs->tls_idx = TlsAlloc()) == TLS_OUT_OF_INDEXES) + { + ERR("Failed to allocate cs TLS index, err %#x.\n", GetLastError()); +- HeapFree(GetProcessHeap(), 0, cs->data); +- HeapFree(GetProcessHeap(), 0, cs); +- return NULL; ++ goto err; + } + + if (wined3d_settings.cs_multithreaded) +@@ -1379,15 +1450,22 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) + if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL))) + { + ERR("Failed to create wined3d command stream thread.\n"); +- if (!TlsFree(cs->tls_idx)) +- ERR("Failed to free cs TLS index, err %#x.\n", GetLastError()); +- HeapFree(GetProcessHeap(), 0, cs->data); +- HeapFree(GetProcessHeap(), 0, cs); +- return NULL; ++ goto err; + } + } + + return cs; ++ ++err: ++ if (cs) ++ { ++ state_cleanup(&cs->state); ++ if (cs->tls_idx != TLS_OUT_OF_INDEXES && !TlsFree(cs->tls_idx)) ++ ERR("Failed to free cs TLS index, err %#x.\n", GetLastError()); ++ HeapFree(GetProcessHeap(), 0, cs->data); ++ } ++ HeapFree(GetProcessHeap(), 0, cs); ++ return NULL; + } + + void wined3d_cs_destroy(struct wined3d_cs *cs) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 3bd45da..b936039 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -3409,6 +3409,7 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT + device_invalidate_state(device, STATE_BASEVERTEXINDEX); + } + ++ wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); + wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE); + + return WINED3D_OK; +@@ -3452,6 +3453,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic + device_invalidate_state(device, STATE_BASEVERTEXINDEX); + } + ++ wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); + wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE); + + return WINED3D_OK; +@@ -3463,6 +3465,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device + TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n", + device, start_idx, index_count, start_instance, instance_count); + ++ wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); + wined3d_cs_emit_draw(device->cs, start_idx, index_count, start_instance, instance_count, TRUE); + } + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 1f95a50..d8b24a5 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2584,7 +2584,7 @@ struct wined3d_cs_block + { + struct list entry; + UINT pos; +- BYTE data[4000]; /* FIXME? The size is somewhat arbitrary. */ ++ BYTE data[sizeof(struct wined3d_state) * 2]; /* FIXME? The size is somewhat arbitrary. */ + }; + + struct wined3d_cs_ops +@@ -2626,6 +2626,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture + WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, + UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, ++ const struct wined3d_state *state) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, + struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0055-wined3d-Request-a-glFinish-before-modifying-resource.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0055-wined3d-Request-a-glFinish-before-modifying-resource.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0055-wined3d-Request-a-glFinish-before-modifying-resource.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0055-wined3d-Request-a-glFinish-before-modifying-resource.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,253 +0,0 @@ -From 76b683f536da9f8465eca14ed1505dff8596bf5c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Apr 2013 11:50:09 +0200 -Subject: wined3d: Request a glFinish before modifying resources outside the cs - ---- - dlls/wined3d/buffer.c | 17 +++++++++++++++++ - dlls/wined3d/cs.c | 30 ++++++++++++++++++++++++++++++ - dlls/wined3d/device.c | 42 ++++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/resource.c | 7 +++++++ - dlls/wined3d/surface.c | 7 +++++++ - dlls/wined3d/wined3d_private.h | 1 + - 6 files changed, 104 insertions(+) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index df82bd2..e1c40bb 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -931,6 +931,15 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte - void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) - { - struct wined3d_context *context; -+ struct wined3d_device *device = buffer->resource.device; -+ -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - context = context_acquire(buffer->resource.device, NULL); - buffer_internal_preload(buffer, context, NULL); - context_release(context); -@@ -947,9 +956,17 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - { - LONG count; - BYTE *base; -+ struct wined3d_device *device = buffer->resource.device; - - TRACE("buffer %p, offset %u, size %u, data %p, flags %#x\n", buffer, offset, size, data, flags); - -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); - /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture - * fill rate test seems to depend on this. When we map a buffer with -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 410a431..b2d087d 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -66,6 +66,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_STATEBLOCK, - WINED3D_CS_OP_SET_VS_CONSTS_F, - WINED3D_CS_OP_SET_PS_CONSTS_F, -+ WINED3D_CS_OP_GLFINISH, - WINED3D_CS_OP_STOP, - }; - -@@ -294,6 +295,11 @@ struct wined3d_cs_set_consts_f - float constants[4]; - }; - -+struct wined3d_cs_finish -+{ -+ enum wined3d_cs_op opcode; -+}; -+ - /* FIXME: The list synchronization probably isn't particularly fast. */ - static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) - { -@@ -1363,6 +1369,29 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) - cs->ops->submit(cs); - } - -+static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_finish *op = data; -+ struct wined3d_device *device = cs->device; -+ struct wined3d_context *context; -+ -+ context = context_acquire(device, NULL); -+ context->gl_info->gl_ops.gl.p_glFinish(); -+ context_release(context); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) -+{ -+ struct wined3d_cs_finish *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_GLFINISH; -+ -+ cs->ops->submit(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -@@ -1395,6 +1424,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, - /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, - /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, -+ /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, - }; - - static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index a6a88ae..7ab8fc0 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -2759,6 +2759,13 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO - return hr; - } - -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat); - wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat); - wined3d_device_get_transform(device, WINED3D_TS_WORLD_MATRIX(0), &world_mat); -@@ -3572,6 +3579,13 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, - ++src_skip_levels; - } - -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - /* Make sure that the destination texture is loaded. */ - context = context_acquire(device, NULL); - wined3d_texture_load(dst_texture, context, FALSE); -@@ -3818,6 +3832,13 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, - return WINED3DERR_INVALIDCALL; - } - -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - return surface_upload_from_surface(dst_surface, dst_point, src_surface, src_rect); - } - -@@ -3920,6 +3941,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi - rect = &r; - } - -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - resource = wined3d_texture_get_sub_resource(wined3d_texture_from_resource(resource), view->sub_resource_idx); - - return surface_color_fill(surface_from_resource(resource), rect, color); -@@ -4233,6 +4261,13 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) - - TRACE("device %p.\n", device); - -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) - { - TRACE("Checking resource %p for eviction.\n", resource); -@@ -4358,6 +4393,13 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - - TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback); - -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - if (!(swapchain = wined3d_device_get_swapchain(device, 0))) - { - ERR("Failed to get the first implicit swapchain.\n"); -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 568f2cb..f379bbc 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -716,6 +716,13 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - - flags = wined3d_resource_sanitize_map_flags(resource, flags); - -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - if (device->d3d_initialized) - context = context_acquire(device, NULL); - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index ef683f7..b81d137 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -5119,6 +5119,13 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - flags &= ~WINEDDBLT_DONOTWAIT; - } - -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - if (!device->d3d_initialized) - { - WARN("D3D not initialized, using fallback.\n"); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 4f232be..6116a5a 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2663,6 +2663,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, - void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, - UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0056-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0056-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0056-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0056-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -From 58db2f20f55fd78d4831475a5bdce14339c1e66f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 10 Apr 2013 19:53:44 +0200 -Subject: wined3d: Finish the cs before changing the texture lod - ---- - dlls/wined3d/texture.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 6381613..0eb191e 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -510,6 +510,13 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod) - - if (texture->lod != lod) - { -+ if (wined3d_settings.cs_multithreaded) -+ { -+ struct wined3d_device *device = texture->resource.device; -+ FIXME("Waiting for cs.\n"); -+ device->cs->ops->finish(device->cs); -+ } -+ - texture->lod = lod; - - texture->texture_rgb.base_level = ~0u; --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0056-wined3d-Send-float-constant-updates-through-the-comm.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0056-wined3d-Send-float-constant-updates-through-the-comm.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0056-wined3d-Send-float-constant-updates-through-the-comm.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0056-wined3d-Send-float-constant-updates-through-the-comm.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,208 @@ +From bbd02a077bf5ba977724ada68709f46150e482fb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 20 Aug 2013 15:12:26 +0200 +Subject: wined3d: Send float constant updates through the command stream + +--- + dlls/wined3d/cs.c | 88 ++++++++++++++++++++++++++++++++---------- + dlls/wined3d/device.c | 7 ++-- + dlls/wined3d/wined3d_private.h | 2 + + 3 files changed, 74 insertions(+), 23 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index d252773..56cbcb6 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -63,6 +63,8 @@ enum wined3d_cs_op + WINED3D_CS_OP_SET_MATERIAL, + WINED3D_CS_OP_RESET_STATE, + WINED3D_CS_OP_STATEBLOCK, ++ WINED3D_CS_OP_SET_VS_CONSTS_F, ++ WINED3D_CS_OP_SET_PS_CONSTS_F, + WINED3D_CS_OP_STOP, + }; + +@@ -273,7 +275,13 @@ struct wined3d_cs_stateblock + { + enum wined3d_cs_op opcode; + struct wined3d_state state; +- float vs_consts_f[256 * 4], ps_consts_f[256 * 4]; ++}; ++ ++struct wined3d_cs_set_consts_f ++{ ++ enum wined3d_cs_op opcode; ++ UINT start_register, vector4f_count; ++ float constants[4]; + }; + + /* FIXME: The list synchronization probably isn't particularly fast. */ +@@ -910,13 +918,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined + + static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const void *data) + { +- const struct wined3d_adapter *adapter = cs->device->adapter; + const struct wined3d_cs_stateblock *op = data; +- UINT num_vs_consts_f = sizeof(op->vs_consts_f) / sizeof(*op->vs_consts_f) / 4; +- UINT num_ps_consts_f = sizeof(op->ps_consts_f) / sizeof(*op->ps_consts_f) / 4; +- +- num_vs_consts_f = min(num_vs_consts_f, adapter->d3d_info.limits.vs_uniform_count); +- num_ps_consts_f = min(num_ps_consts_f, adapter->d3d_info.limits.ps_uniform_count); + + /* Don't memcpy the entire struct, we'll remove single items as we add dedicated + * ops for setting states */ +@@ -927,11 +929,9 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi + + memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b)); + memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i)); +- memcpy(cs->state.vs_consts_f, op->state.vs_consts_f, sizeof(*cs->state.vs_consts_f) * num_vs_consts_f); + + memcpy(cs->state.ps_consts_b, op->state.ps_consts_b, sizeof(cs->state.ps_consts_b)); + memcpy(cs->state.ps_consts_i, op->state.ps_consts_i, sizeof(cs->state.ps_consts_i)); +- memcpy(cs->state.ps_consts_f, op->state.ps_consts_f, sizeof(*cs->state.ps_consts_f) * num_ps_consts_f); + + memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights)); + +@@ -940,14 +940,7 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi + + void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct wined3d_state *state) + { +- const struct wined3d_device *device = cs->device; +- const struct wined3d_adapter *adapter = device->adapter; + struct wined3d_cs_stateblock *op; +- UINT num_vs_consts_f = sizeof(op->vs_consts_f) / sizeof(*op->vs_consts_f) / 4; +- UINT num_ps_consts_f = sizeof(op->ps_consts_f) / sizeof(*op->ps_consts_f) / 4; +- +- num_vs_consts_f = min(num_vs_consts_f, adapter->d3d_info.limits.vs_uniform_count); +- num_ps_consts_f = min(num_ps_consts_f, adapter->d3d_info.limits.ps_uniform_count); + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_STATEBLOCK; +@@ -960,13 +953,9 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win + + memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b)); + memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i)); +- op->state.vs_consts_f = op->vs_consts_f; +- memcpy(op->state.vs_consts_f, state->vs_consts_f, sizeof(*op->state.vs_consts_f) * num_vs_consts_f); + + memcpy(op->state.ps_consts_b, state->ps_consts_b, sizeof(op->state.ps_consts_b)); + memcpy(op->state.ps_consts_i, state->ps_consts_i, sizeof(op->state.ps_consts_i)); +- op->state.ps_consts_f = op->ps_consts_f; +- memcpy(op->state.ps_consts_f, state->ps_consts_f, sizeof(*op->state.ps_consts_f) * num_ps_consts_f); + + /* FIXME: This is not ideal. CS is still running synchronously, so this is ok. + * It will go away soon anyway. */ +@@ -1039,6 +1028,63 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type + op->opcode = WINED3D_CS_OP_SET_SHADER; + op->type = type; + op->shader = shader; ++} ++ ++static UINT wined3d_cs_exec_set_vs_consts_f(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_set_consts_f *op = data; ++ struct wined3d_device *device = cs->device; ++ ++ memcpy(cs->state.vs_consts_f + op->start_register * 4, op->constants, ++ sizeof(*cs->state.vs_consts_f) * 4 * op->vector4f_count); ++ ++ device->shader_backend->shader_update_float_vertex_constants(device, ++ op->start_register, op->vector4f_count); ++ ++ return sizeof(*op) + sizeof(op->constants) * (op->vector4f_count - 1); ++} ++ ++static UINT wined3d_cs_exec_set_ps_consts_f(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_set_consts_f *op = data; ++ struct wined3d_device *device = cs->device; ++ ++ memcpy(cs->state.ps_consts_f + op->start_register * 4, op->constants, ++ sizeof(*cs->state.ps_consts_f) * 4 * op->vector4f_count); ++ ++ device->shader_backend->shader_update_float_pixel_constants(device, ++ op->start_register, op->vector4f_count); ++ ++ return sizeof(*op) + sizeof(op->constants) * (op->vector4f_count - 1); ++} ++ ++void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, ++ const float *constants, UINT vector4f_count, enum wined3d_shader_type type) ++{ ++ struct wined3d_cs_set_consts_f *op; ++ UINT extra_space = vector4f_count - 1; ++ ++ op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space); ++ switch (type) ++ { ++ case WINED3D_SHADER_TYPE_PIXEL: ++ op->opcode = WINED3D_CS_OP_SET_PS_CONSTS_F; ++ break; ++ ++ case WINED3D_SHADER_TYPE_VERTEX: ++ op->opcode = WINED3D_CS_OP_SET_VS_CONSTS_F; ++ break; ++ ++ case WINED3D_SHADER_TYPE_GEOMETRY: ++ FIXME("Invalid for geometry shaders\n"); ++ return; ++ ++ case WINED3D_SHADER_TYPE_COUNT: ++ break; ++ } ++ op->start_register = start_register; ++ op->vector4f_count = vector4f_count; ++ memcpy(op->constants, constants, sizeof(*constants) * 4 * vector4f_count); + + cs->ops->submit(cs); + } +@@ -1233,6 +1279,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material, + /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, + /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, ++ /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, ++ /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, + }; + + static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 6ea0b9a..2aba2a4 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -2341,8 +2341,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, + memset(device->recording->changed.vertexShaderConstantsF + start_register, 1, + sizeof(*device->recording->changed.vertexShaderConstantsF) * vector4f_count); + else +- device->shader_backend->shader_update_float_vertex_constants(device, start_register, vector4f_count); +- ++ wined3d_cs_emit_set_consts_f(device->cs, start_register, constants, vector4f_count, ++ WINED3D_SHADER_TYPE_VERTEX); + + return WINED3D_OK; + } +@@ -2576,7 +2576,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, + memset(device->recording->changed.pixelShaderConstantsF + start_register, 1, + sizeof(*device->recording->changed.pixelShaderConstantsF) * vector4f_count); + else +- device->shader_backend->shader_update_float_pixel_constants(device, start_register, vector4f_count); ++ wined3d_cs_emit_set_consts_f(device->cs, start_register, constants, vector4f_count, ++ WINED3D_SHADER_TYPE_PIXEL); + + return WINED3D_OK; + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 02104ce..d673a8f 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2613,6 +2613,8 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform + void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, + struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, ++ UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0057-wined3d-Don-t-call-glFinish-after-clears.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0057-wined3d-Don-t-call-glFinish-after-clears.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0057-wined3d-Don-t-call-glFinish-after-clears.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0057-wined3d-Don-t-call-glFinish-after-clears.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -From d4014863c602be40898af0f2be9b718ee6abe7d0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Apr 2013 11:51:13 +0200 -Subject: wined3d: Don't call glFinish after clears - ---- - dlls/wined3d/device.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 4d15518..98c0717 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -463,9 +463,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c - } - } - -- if (wined3d_settings.cs_multithreaded) -- gl_info->gl_ops.gl.p_glFinish(); -- else if (wined3d_settings.strict_draw_ordering || (flags & WINED3DCLEAR_TARGET -+ if (wined3d_settings.strict_draw_ordering || (flags & WINED3DCLEAR_TARGET - && target->container->swapchain && target->container->swapchain->front_buffer == target->container)) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0057-wined3d-Request-a-glFinish-before-modifying-resource.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0057-wined3d-Request-a-glFinish-before-modifying-resource.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0057-wined3d-Request-a-glFinish-before-modifying-resource.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0057-wined3d-Request-a-glFinish-before-modifying-resource.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,253 @@ +From 76b683f536da9f8465eca14ed1505dff8596bf5c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Apr 2013 11:50:09 +0200 +Subject: wined3d: Request a glFinish before modifying resources outside the cs + +--- + dlls/wined3d/buffer.c | 17 +++++++++++++++++ + dlls/wined3d/cs.c | 30 ++++++++++++++++++++++++++++++ + dlls/wined3d/device.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/resource.c | 7 +++++++ + dlls/wined3d/surface.c | 7 +++++++ + dlls/wined3d/wined3d_private.h | 1 + + 6 files changed, 104 insertions(+) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index df82bd2..e1c40bb 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -931,6 +931,15 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte + void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) + { + struct wined3d_context *context; ++ struct wined3d_device *device = buffer->resource.device; ++ ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + context = context_acquire(buffer->resource.device, NULL); + buffer_internal_preload(buffer, context, NULL); + context_release(context); +@@ -947,9 +956,17 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + { + LONG count; + BYTE *base; ++ struct wined3d_device *device = buffer->resource.device; + + TRACE("buffer %p, offset %u, size %u, data %p, flags %#x\n", buffer, offset, size, data, flags); + ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); + /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture + * fill rate test seems to depend on this. When we map a buffer with +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 410a431..b2d087d 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -66,6 +66,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_STATEBLOCK, + WINED3D_CS_OP_SET_VS_CONSTS_F, + WINED3D_CS_OP_SET_PS_CONSTS_F, ++ WINED3D_CS_OP_GLFINISH, + WINED3D_CS_OP_STOP, + }; + +@@ -294,6 +295,11 @@ struct wined3d_cs_set_consts_f + float constants[4]; + }; + ++struct wined3d_cs_finish ++{ ++ enum wined3d_cs_op opcode; ++}; ++ + /* FIXME: The list synchronization probably isn't particularly fast. */ + static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) + { +@@ -1363,6 +1369,29 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) + cs->ops->submit(cs); + } + ++static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_finish *op = data; ++ struct wined3d_device *device = cs->device; ++ struct wined3d_context *context; ++ ++ context = context_acquire(device, NULL); ++ context->gl_info->gl_ops.gl.p_glFinish(); ++ context_release(context); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) ++{ ++ struct wined3d_cs_finish *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_GLFINISH; ++ ++ cs->ops->submit(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, +@@ -1395,6 +1424,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, + /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, + /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, ++ /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, + }; + + static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index a6a88ae..7ab8fc0 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -2759,6 +2759,13 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO + return hr; + } + ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat); + wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat); + wined3d_device_get_transform(device, WINED3D_TS_WORLD_MATRIX(0), &world_mat); +@@ -3572,6 +3579,13 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, + ++src_skip_levels; + } + ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + /* Make sure that the destination texture is loaded. */ + context = context_acquire(device, NULL); + wined3d_texture_load(dst_texture, context, FALSE); +@@ -3818,6 +3832,13 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, + return WINED3DERR_INVALIDCALL; + } + ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + return surface_upload_from_surface(dst_surface, dst_point, src_surface, src_rect); + } + +@@ -3920,6 +3941,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi + rect = &r; + } + ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + resource = wined3d_texture_get_sub_resource(wined3d_texture_from_resource(resource), view->sub_resource_idx); + + return surface_color_fill(surface_from_resource(resource), rect, color); +@@ -4233,6 +4261,13 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) + + TRACE("device %p.\n", device); + ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) + { + TRACE("Checking resource %p for eviction.\n", resource); +@@ -4358,6 +4393,13 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + + TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback); + ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + if (!(swapchain = wined3d_device_get_swapchain(device, 0))) + { + ERR("Failed to get the first implicit swapchain.\n"); +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 568f2cb..f379bbc 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -716,6 +716,13 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + + flags = wined3d_resource_sanitize_map_flags(resource, flags); + ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + if (device->d3d_initialized) + context = context_acquire(device, NULL); + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index ef683f7..b81d137 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -5119,6 +5119,13 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + flags &= ~WINEDDBLT_DONOTWAIT; + } + ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + if (!device->d3d_initialized) + { + WARN("D3D not initialized, using fallback.\n"); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 4f232be..6116a5a 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2663,6 +2663,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, + void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, + UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0058-wined3d-Don-t-call-glFinish-after-draws.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0058-wined3d-Don-t-call-glFinish-after-draws.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0058-wined3d-Don-t-call-glFinish-after-draws.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0058-wined3d-Don-t-call-glFinish-after-draws.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -From 7fd4d602c8a324c5f474370457363910e074296f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Apr 2013 11:53:10 +0200 -Subject: wined3d: Don't call glFinish after draws - ---- - dlls/wined3d/drawprim.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index 1627cfa..43d867d 100644 ---- a/dlls/wined3d/drawprim.c -+++ b/dlls/wined3d/drawprim.c -@@ -780,9 +780,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s - wined3d_event_query_issue(context->buffer_queries[i], device); - } - -- if (wined3d_settings.cs_multithreaded) -- gl_info->gl_ops.gl.p_glFinish(); -- else if (wined3d_settings.strict_draw_ordering) -+ if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - - context_release(context); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0058-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0058-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0058-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0058-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,30 @@ +From 58db2f20f55fd78d4831475a5bdce14339c1e66f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 10 Apr 2013 19:53:44 +0200 +Subject: wined3d: Finish the cs before changing the texture lod + +--- + dlls/wined3d/texture.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 6381613..0eb191e 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -510,6 +510,13 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod) + + if (texture->lod != lod) + { ++ if (wined3d_settings.cs_multithreaded) ++ { ++ struct wined3d_device *device = texture->resource.device; ++ FIXME("Waiting for cs.\n"); ++ device->cs->ops->finish(device->cs); ++ } ++ + texture->lod = lod; + + texture->texture_rgb.base_level = ~0u; +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0059-wined3d-Don-t-call-glFinish-after-clears.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0059-wined3d-Don-t-call-glFinish-after-clears.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0059-wined3d-Don-t-call-glFinish-after-clears.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0059-wined3d-Don-t-call-glFinish-after-clears.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,27 @@ +From d4014863c602be40898af0f2be9b718ee6abe7d0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Apr 2013 11:51:13 +0200 +Subject: wined3d: Don't call glFinish after clears + +--- + dlls/wined3d/device.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 4d15518..98c0717 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -463,9 +463,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c + } + } + +- if (wined3d_settings.cs_multithreaded) +- gl_info->gl_ops.gl.p_glFinish(); +- else if (wined3d_settings.strict_draw_ordering || (flags & WINED3DCLEAR_TARGET ++ if (wined3d_settings.strict_draw_ordering || (flags & WINED3DCLEAR_TARGET + && target->container->swapchain && target->container->swapchain->front_buffer == target->container)) + gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0059-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0059-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0059-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0059-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -From e0c083d32b61b7a5bee9371bcf8a1b03964303a0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Apr 2013 14:40:47 +0200 -Subject: wined3d: Shadow device->offscreenBuffer in the context - -Meh. Should probably go into the adapter, or non-fbo ORM should just die -TODO 2: See what this is actually used for. ---- - dlls/wined3d/context.c | 2 ++ - dlls/wined3d/device.c | 1 + - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 5 insertions(+) - -diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 7ba4086..fc66ff1 100644 ---- a/dlls/wined3d/context.c -+++ b/dlls/wined3d/context.c -@@ -1453,6 +1453,8 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, - ret->current_fb.rt_size = gl_info->limits.buffers; - if (!ret->current_fb.render_targets) - goto out; -+ if (device->context_count) -+ ret->offscreenBuffer = device->contexts[0]->offscreenBuffer; - - /* Initialize the texture unit mapping to a 1:1 mapping */ - for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 98c0717..ee8b418 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -948,6 +948,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - } - } - } -+ device->contexts[0]->offscreenBuffer = device->offscreenBuffer; - - TRACE("All defaults now set up, leaving 3D init.\n"); - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ba0ce26..a16909c 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -1232,6 +1232,8 @@ struct wined3d_context - GLfloat fog_coord_value; - GLfloat color[4], fogstart, fogend, fogcolor[4]; - GLuint dummy_arbfp_prog; -+ -+ GLenum offscreenBuffer; - }; - - typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0060-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0060-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0060-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0060-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -From 61077043981635623c0f2eda20aa252c18fc4104 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Apr 2013 14:43:23 +0200 -Subject: wined3d: Don't access the stateblock in find_draw_buffers_mask - ---- - dlls/wined3d/context.c | 21 +++++++++------------ - 1 file changed, 9 insertions(+), 12 deletions(-) - -diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index fc66ff1..39c9464 100644 ---- a/dlls/wined3d/context.c -+++ b/dlls/wined3d/context.c -@@ -2231,14 +2231,14 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, - context_set_render_offscreen(context, TRUE); - } - --static DWORD context_generate_rt_mask_no_fbo(const struct wined3d_device *device, const struct wined3d_surface *rt) -+static DWORD context_generate_rt_mask_no_fbo(const struct wined3d_context *context, const struct wined3d_surface *rt) - { - if (!rt || rt->resource.format->id == WINED3DFMT_NULL) - return 0; - else if (rt->container->swapchain) - return context_generate_rt_mask_from_surface(rt); - else -- return context_generate_rt_mask(device->offscreenBuffer); -+ return context_generate_rt_mask(context->offscreenBuffer); - } - - /* Context activation is done by the caller. */ -@@ -2270,7 +2270,7 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wine - } - else - { -- rt_mask = context_generate_rt_mask_no_fbo(device, rt); -+ rt_mask = context_generate_rt_mask_no_fbo(context, rt); - } - - cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask; -@@ -2356,7 +2356,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win - } - else - { -- rt_mask = context_generate_rt_mask_no_fbo(device, -+ rt_mask = context_generate_rt_mask_no_fbo(context, - rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); - } - -@@ -2373,7 +2373,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win - } - else - { -- rt_mask = context_generate_rt_mask_no_fbo(device, -+ rt_mask = context_generate_rt_mask_no_fbo(context, - rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); - } - -@@ -2408,16 +2408,15 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win - return TRUE; - } - --static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_device *device) -+static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_state *state) - { -- const struct wined3d_state *state = &device->state; - struct wined3d_rendertarget_view **rts = state->fb.render_targets; - struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL]; - DWORD rt_mask, rt_mask_bits; - unsigned int i; - - if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) -- return context_generate_rt_mask_no_fbo(device, wined3d_rendertarget_view_get_surface(rts[0])); -+ return context_generate_rt_mask_no_fbo(context, wined3d_rendertarget_view_get_surface(rts[0])); - else if (!context->render_offscreen) - return context_generate_rt_mask_from_surface(wined3d_rendertarget_view_get_surface(rts[0])); - -@@ -2440,9 +2439,8 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const - /* Context activation is done by the caller. */ - void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) - { -- const struct wined3d_device *device = context->swapchain->device; - const struct wined3d_fb_state *fb = &state->fb; -- DWORD rt_mask = find_draw_buffers_mask(context, device); -+ DWORD rt_mask = find_draw_buffers_mask(context, state); - DWORD *cur_mask; - - if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) -@@ -2710,13 +2708,12 @@ static void context_update_tex_unit_map(struct wined3d_context *context, const s - /* Context activation is done by the caller. */ - void context_state_drawbuf(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) - { -- const struct wined3d_device *device = context->swapchain->device; - DWORD rt_mask, *cur_mask; - - if (isStateDirty(context, STATE_FRAMEBUFFER)) return; - - cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask; -- rt_mask = find_draw_buffers_mask(context, device); -+ rt_mask = find_draw_buffers_mask(context, state); - if (rt_mask != *cur_mask) - { - context_apply_draw_buffers(context, rt_mask); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0060-wined3d-Don-t-call-glFinish-after-draws.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0060-wined3d-Don-t-call-glFinish-after-draws.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0060-wined3d-Don-t-call-glFinish-after-draws.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0060-wined3d-Don-t-call-glFinish-after-draws.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,27 @@ +From 7fd4d602c8a324c5f474370457363910e074296f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Apr 2013 11:53:10 +0200 +Subject: wined3d: Don't call glFinish after draws + +--- + dlls/wined3d/drawprim.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c +index 1627cfa..43d867d 100644 +--- a/dlls/wined3d/drawprim.c ++++ b/dlls/wined3d/drawprim.c +@@ -780,9 +780,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s + wined3d_event_query_issue(context->buffer_queries[i], device); + } + +- if (wined3d_settings.cs_multithreaded) +- gl_info->gl_ops.gl.p_glFinish(); +- else if (wined3d_settings.strict_draw_ordering) ++ if (wined3d_settings.strict_draw_ordering) + gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + + context_release(context); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0061-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0061-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0061-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0061-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -From 7b57d279336b852ad0286bdb865deeba2e55f3eb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Apr 2013 14:52:24 +0200 -Subject: wined3d: Pass the depth stencil to swapchain->present - -TODO: Test if D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL discards the current -DS or the implicit DS. ---- - dlls/wined3d/cs.c | 3 ++- - dlls/wined3d/swapchain.c | 21 ++++++++++----------- - dlls/wined3d/wined3d_private.h | 3 ++- - 3 files changed, 14 insertions(+), 13 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 8b24e73..03e760d 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -429,7 +429,8 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) - wined3d_swapchain_set_window(swapchain, op->dst_window_override); - - swapchain->swapchain_ops->swapchain_present(swapchain, -- src_rect, dst_rect, dirty_region, op->flags); -+ src_rect, dst_rect, dirty_region, op->flags, -+ wined3d_rendertarget_view_get_surface(cs->state.fb.depth_stencil)); - - return sizeof(*op); - } -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 60504ef..e190892 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -417,11 +417,11 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain, - } - - static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT *src_rect_in, -- const RECT *dst_rect_in, const RGNDATA *dirty_region, DWORD flags) -+ const RECT *dst_rect_in, const RGNDATA *dirty_region, DWORD flags, -+ struct wined3d_surface *depth_stencil) - { - struct wined3d_surface *back_buffer = surface_from_resource( - wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)); -- const struct wined3d_fb_state *fb = &swapchain->device->state.fb; - const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; - struct wined3d_surface *front; -@@ -574,16 +574,14 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - break; - } - -- if (fb->depth_stencil) -+ if (depth_stencil) - { -- struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(fb->depth_stencil); -- -- if (ds && (swapchain->desc.flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL -- || ds->flags & SFLAG_DISCARD)) -+ if (swapchain->desc.flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL -+ || depth_stencil->flags & SFLAG_DISCARD) - { -- surface_modify_ds_location(ds, WINED3D_LOCATION_DISCARDED, -- fb->depth_stencil->width, fb->depth_stencil->height); -- if (ds == swapchain->device->onscreen_depth_stencil) -+ surface_modify_ds_location(depth_stencil, WINED3D_LOCATION_DISCARDED, -+ depth_stencil->resource.width, depth_stencil->resource.height); -+ if (depth_stencil == swapchain->device->onscreen_depth_stencil) - { - wined3d_surface_decref(swapchain->device->onscreen_depth_stencil); - swapchain->device->onscreen_depth_stencil = NULL; -@@ -647,7 +645,8 @@ void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *r - } - - static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, const RECT *src_rect_in, -- const RECT *dst_rect_in, const RGNDATA *dirty_region, DWORD flags) -+ const RECT *dst_rect_in, const RGNDATA *dirty_region, DWORD flags, -+ struct wined3d_surface *depth_stencil) - { - struct wined3d_surface *front, *back; - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index a16909c..024b55b 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2746,7 +2746,8 @@ struct wined3d_shader_resource_view - struct wined3d_swapchain_ops - { - void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, -- const RECT *dst_rect, const RGNDATA *dirty_region, DWORD flags); -+ const RECT *dst_rect, const RGNDATA *dirty_region, DWORD flags, -+ struct wined3d_surface *depth_stencil); - }; - - struct wined3d_swapchain --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0061-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0061-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0061-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0061-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,54 @@ +From e0c083d32b61b7a5bee9371bcf8a1b03964303a0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Apr 2013 14:40:47 +0200 +Subject: wined3d: Shadow device->offscreenBuffer in the context + +Meh. Should probably go into the adapter, or non-fbo ORM should just die +TODO 2: See what this is actually used for. +--- + dlls/wined3d/context.c | 2 ++ + dlls/wined3d/device.c | 1 + + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 5 insertions(+) + +diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c +index 7ba4086..fc66ff1 100644 +--- a/dlls/wined3d/context.c ++++ b/dlls/wined3d/context.c +@@ -1453,6 +1453,8 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, + ret->current_fb.rt_size = gl_info->limits.buffers; + if (!ret->current_fb.render_targets) + goto out; ++ if (device->context_count) ++ ret->offscreenBuffer = device->contexts[0]->offscreenBuffer; + + /* Initialize the texture unit mapping to a 1:1 mapping */ + for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 98c0717..ee8b418 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -948,6 +948,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + } + } + } ++ device->contexts[0]->offscreenBuffer = device->offscreenBuffer; + + TRACE("All defaults now set up, leaving 3D init.\n"); + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index ba0ce26..a16909c 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -1232,6 +1232,8 @@ struct wined3d_context + GLfloat fog_coord_value; + GLfloat color[4], fogstart, fogend, fogcolor[4]; + GLuint dummy_arbfp_prog; ++ ++ GLenum offscreenBuffer; + }; + + typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0062-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0062-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0062-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0062-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,105 @@ +From 61077043981635623c0f2eda20aa252c18fc4104 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Apr 2013 14:43:23 +0200 +Subject: wined3d: Don't access the stateblock in find_draw_buffers_mask + +--- + dlls/wined3d/context.c | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c +index fc66ff1..39c9464 100644 +--- a/dlls/wined3d/context.c ++++ b/dlls/wined3d/context.c +@@ -2231,14 +2231,14 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, + context_set_render_offscreen(context, TRUE); + } + +-static DWORD context_generate_rt_mask_no_fbo(const struct wined3d_device *device, const struct wined3d_surface *rt) ++static DWORD context_generate_rt_mask_no_fbo(const struct wined3d_context *context, const struct wined3d_surface *rt) + { + if (!rt || rt->resource.format->id == WINED3DFMT_NULL) + return 0; + else if (rt->container->swapchain) + return context_generate_rt_mask_from_surface(rt); + else +- return context_generate_rt_mask(device->offscreenBuffer); ++ return context_generate_rt_mask(context->offscreenBuffer); + } + + /* Context activation is done by the caller. */ +@@ -2270,7 +2270,7 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wine + } + else + { +- rt_mask = context_generate_rt_mask_no_fbo(device, rt); ++ rt_mask = context_generate_rt_mask_no_fbo(context, rt); + } + + cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask; +@@ -2356,7 +2356,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win + } + else + { +- rt_mask = context_generate_rt_mask_no_fbo(device, ++ rt_mask = context_generate_rt_mask_no_fbo(context, + rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); + } + +@@ -2373,7 +2373,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win + } + else + { +- rt_mask = context_generate_rt_mask_no_fbo(device, ++ rt_mask = context_generate_rt_mask_no_fbo(context, + rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); + } + +@@ -2408,16 +2408,15 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win + return TRUE; + } + +-static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_device *device) ++static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_state *state) + { +- const struct wined3d_state *state = &device->state; + struct wined3d_rendertarget_view **rts = state->fb.render_targets; + struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL]; + DWORD rt_mask, rt_mask_bits; + unsigned int i; + + if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) +- return context_generate_rt_mask_no_fbo(device, wined3d_rendertarget_view_get_surface(rts[0])); ++ return context_generate_rt_mask_no_fbo(context, wined3d_rendertarget_view_get_surface(rts[0])); + else if (!context->render_offscreen) + return context_generate_rt_mask_from_surface(wined3d_rendertarget_view_get_surface(rts[0])); + +@@ -2440,9 +2439,8 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const + /* Context activation is done by the caller. */ + void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) + { +- const struct wined3d_device *device = context->swapchain->device; + const struct wined3d_fb_state *fb = &state->fb; +- DWORD rt_mask = find_draw_buffers_mask(context, device); ++ DWORD rt_mask = find_draw_buffers_mask(context, state); + DWORD *cur_mask; + + if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) +@@ -2710,13 +2708,12 @@ static void context_update_tex_unit_map(struct wined3d_context *context, const s + /* Context activation is done by the caller. */ + void context_state_drawbuf(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) + { +- const struct wined3d_device *device = context->swapchain->device; + DWORD rt_mask, *cur_mask; + + if (isStateDirty(context, STATE_FRAMEBUFFER)) return; + + cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask; +- rt_mask = find_draw_buffers_mask(context, device); ++ rt_mask = find_draw_buffers_mask(context, state); + if (rt_mask != *cur_mask) + { + context_apply_draw_buffers(context, rt_mask); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0062-wined3d-Don-t-store-viewport-pointers-in-the-command.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0062-wined3d-Don-t-store-viewport-pointers-in-the-command.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0062-wined3d-Don-t-store-viewport-pointers-in-the-command.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0062-wined3d-Don-t-store-viewport-pointers-in-the-command.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -From eb236d88cef3c5c73289c1147466a1cc85657500 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 5 Apr 2013 10:12:06 +0200 -Subject: wined3d: Don't store viewport pointers in the command stream. - ---- - dlls/wined3d/cs.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 03e760d..4b1ed18 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -126,7 +126,7 @@ struct wined3d_cs_set_predication - struct wined3d_cs_set_viewport - { - enum wined3d_cs_op opcode; -- const struct wined3d_viewport *viewport; -+ struct wined3d_viewport viewport; - }; - - struct wined3d_cs_set_scissor_rect -@@ -552,9 +552,10 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query - static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_viewport *op = data; -+ struct wined3d_device *device = cs->device; - -- cs->state.viewport = *op->viewport; -- device_invalidate_state(cs->device, STATE_VIEWPORT); -+ cs->state.viewport = op->viewport; -+ device_invalidate_state(device, STATE_VIEWPORT); - - return sizeof(*op); - } -@@ -565,7 +566,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi - - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_SET_VIEWPORT; -- op->viewport = viewport; -+ op->viewport = *viewport; - - cs->ops->submit(cs); - } --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0063-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0063-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0063-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0063-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,217 +0,0 @@ -From 3d851db23b85050b91b68a9556fd5b3407166089 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 5 Apr 2013 14:37:44 +0200 -Subject: wined3d: Keep track of the onscreen depth stencil in the command - stream instead of the device. - -Based on a patch by Henri Verbeet. - -TODO: Not sure if its the right way to go. There are certainly some -missing bits, e.g. accessing the cs via the device in all but one places -defeats the point of this at the moment. - -Since the GL onscreen depth stencil is part of the WGL framebuffer, -which belongs to the swapchain, storing this info in the swapchain might -be the right thing to do. This should help multi-window or multi-head -configurations. ---- - dlls/wined3d/cs.c | 22 +++++++++++++++++++--- - dlls/wined3d/device.c | 35 ++++++++++------------------------- - dlls/wined3d/drawprim.c | 4 ++-- - dlls/wined3d/swapchain.c | 6 +++--- - dlls/wined3d/wined3d_private.h | 10 ++++------ - 5 files changed, 38 insertions(+), 39 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 4b1ed18..236e2f2 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -629,10 +629,10 @@ static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const - || prev_surface->flags & SFLAG_DISCARD)) - { - surface_modify_ds_location(prev_surface, WINED3D_LOCATION_DISCARDED, prev->width, prev->height); -- if (prev_surface == device->onscreen_depth_stencil) -+ if (prev_surface == cs->onscreen_depth_stencil) - { -- wined3d_surface_decref(device->onscreen_depth_stencil); -- device->onscreen_depth_stencil = NULL; -+ wined3d_surface_decref(cs->onscreen_depth_stencil); -+ cs->onscreen_depth_stencil = NULL; - } - } - } -@@ -1365,6 +1365,22 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs) - wined3d_cs_flush(cs); - } - -+void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, -+ struct wined3d_context *context, struct wined3d_surface *depth_stencil) -+{ -+ if (cs->onscreen_depth_stencil) -+ { -+ surface_load_ds_location(cs->onscreen_depth_stencil, context, WINED3D_LOCATION_TEXTURE_RGB); -+ -+ surface_modify_ds_location(cs->onscreen_depth_stencil, WINED3D_LOCATION_TEXTURE_RGB, -+ cs->onscreen_depth_stencil->ds_current_size.cx, -+ cs->onscreen_depth_stencil->ds_current_size.cy); -+ wined3d_surface_decref(cs->onscreen_depth_stencil); -+ } -+ cs->onscreen_depth_stencil = depth_stencil; -+ wined3d_surface_incref(cs->onscreen_depth_stencil); -+} -+ - static DWORD WINAPI wined3d_cs_run(void *thread_param) - { - struct wined3d_cs *cs = thread_param; -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index c3e7d33..9fe7760 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -198,22 +198,6 @@ void device_context_remove(struct wined3d_device *device, struct wined3d_context - device->contexts = new_array; - } - --void device_switch_onscreen_ds(struct wined3d_device *device, -- struct wined3d_context *context, struct wined3d_surface *depth_stencil) --{ -- if (device->onscreen_depth_stencil) -- { -- surface_load_ds_location(device->onscreen_depth_stencil, context, WINED3D_LOCATION_TEXTURE_RGB); -- -- surface_modify_ds_location(device->onscreen_depth_stencil, WINED3D_LOCATION_TEXTURE_RGB, -- device->onscreen_depth_stencil->ds_current_size.cx, -- device->onscreen_depth_stencil->ds_current_size.cy); -- wined3d_surface_decref(device->onscreen_depth_stencil); -- } -- device->onscreen_depth_stencil = depth_stencil; -- wined3d_surface_incref(device->onscreen_depth_stencil); --} -- - static BOOL is_full_clear(const struct wined3d_surface *target, const RECT *draw_rect, const RECT *clear_rect) - { - /* partial draw rect */ -@@ -343,8 +327,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c - { - DWORD location = render_offscreen ? fb->depth_stencil->resource->draw_binding : WINED3D_LOCATION_DRAWABLE; - -- if (!render_offscreen && depth_stencil != device->onscreen_depth_stencil) -- device_switch_onscreen_ds(device, context, depth_stencil); -+ if (!render_offscreen && depth_stencil != device->cs->onscreen_depth_stencil) -+ wined3d_cs_switch_onscreen_ds(device->cs, context, depth_stencil); - prepare_ds_clear(depth_stencil, context, location, - draw_rect, rect_count, clear_rect, &ds_rect); - } -@@ -1060,11 +1044,12 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - /* Release the buffers (with sanity checks). - * FIXME: Move this move into a separate patch. I think the idea - * behind this is that those surfaces should be freed before unloading -- * remaining resources below. */ -- if (device->onscreen_depth_stencil) -+ * remaining resources below. -+ * FIXME 2: Shouldn't the cs take care of onscreen_depth_stencil? */ -+ if (device->cs->onscreen_depth_stencil) - { -- surface = device->onscreen_depth_stencil; -- device->onscreen_depth_stencil = NULL; -+ surface = device->cs->onscreen_depth_stencil; -+ device->cs->onscreen_depth_stencil = NULL; - wined3d_surface_decref(surface); - } - -@@ -4402,10 +4387,10 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - state_unbind_resources(&device->state); - } - -- if (device->onscreen_depth_stencil) -+ if (device->cs->onscreen_depth_stencil) - { -- wined3d_surface_decref(device->onscreen_depth_stencil); -- device->onscreen_depth_stencil = NULL; -+ wined3d_surface_decref(device->cs->onscreen_depth_stencil); -+ device->cs->onscreen_depth_stencil = NULL; - } - - if (reset_state) -diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index 43d867d..5eb80f0 100644 ---- a/dlls/wined3d/drawprim.c -+++ b/dlls/wined3d/drawprim.c -@@ -644,8 +644,8 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s - struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil); - RECT current_rect, draw_rect, r; - -- if (!context->render_offscreen && ds != device->onscreen_depth_stencil) -- device_switch_onscreen_ds(device, context, ds); -+ if (!context->render_offscreen && ds != device->cs->onscreen_depth_stencil) -+ wined3d_cs_switch_onscreen_ds(device->cs, context, ds); - - if (ds->resource.locations & location) - SetRect(¤t_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy); -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index e190892..fa0c241 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -581,10 +581,10 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - { - surface_modify_ds_location(depth_stencil, WINED3D_LOCATION_DISCARDED, - depth_stencil->resource.width, depth_stencil->resource.height); -- if (depth_stencil == swapchain->device->onscreen_depth_stencil) -+ if (depth_stencil == swapchain->device->cs->onscreen_depth_stencil) - { -- wined3d_surface_decref(swapchain->device->onscreen_depth_stencil); -- swapchain->device->onscreen_depth_stencil = NULL; -+ wined3d_surface_decref(swapchain->device->cs->onscreen_depth_stencil); -+ swapchain->device->cs->onscreen_depth_stencil = NULL; - } - } - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 0aed164..aadb8db 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2021,15 +2021,12 @@ struct wined3d_device - struct wined3d_rendertarget_view *back_buffer_view; - struct wined3d_swapchain **swapchains; - UINT swapchain_count; -+ struct wined3d_rendertarget_view *auto_depth_stencil_view; - - struct list resources; /* a linked list to track resources created by the device */ - struct list shaders; /* a linked list to track shaders (pixel and vertex) */ - struct wine_rb_tree samplers; - -- /* Render Target Support */ -- struct wined3d_surface *onscreen_depth_stencil; -- struct wined3d_rendertarget_view *auto_depth_stencil_view; -- - /* For rendering to a texture using glCopyTexImage */ - GLuint depth_blt_texture; - -@@ -2071,8 +2068,6 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL - UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN; - void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; --void device_switch_onscreen_ds(struct wined3d_device *device, struct wined3d_context *context, -- struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; - void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; - - static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) -@@ -2559,6 +2554,7 @@ struct wined3d_cs - struct wined3d_state state; - HANDLE thread; - DWORD tls_idx; -+ struct wined3d_surface *onscreen_depth_stencil; - - size_t data_size; - void *data; -@@ -2569,6 +2565,8 @@ struct wined3d_cs - - struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; - void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; -+void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, -+ struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; - - void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, - DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0063-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0063-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0063-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0063-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,95 @@ +From 7b57d279336b852ad0286bdb865deeba2e55f3eb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Apr 2013 14:52:24 +0200 +Subject: wined3d: Pass the depth stencil to swapchain->present + +TODO: Test if D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL discards the current +DS or the implicit DS. +--- + dlls/wined3d/cs.c | 3 ++- + dlls/wined3d/swapchain.c | 21 ++++++++++----------- + dlls/wined3d/wined3d_private.h | 3 ++- + 3 files changed, 14 insertions(+), 13 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 8b24e73..03e760d 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -429,7 +429,8 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) + wined3d_swapchain_set_window(swapchain, op->dst_window_override); + + swapchain->swapchain_ops->swapchain_present(swapchain, +- src_rect, dst_rect, dirty_region, op->flags); ++ src_rect, dst_rect, dirty_region, op->flags, ++ wined3d_rendertarget_view_get_surface(cs->state.fb.depth_stencil)); + + return sizeof(*op); + } +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index 60504ef..e190892 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -417,11 +417,11 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain, + } + + static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT *src_rect_in, +- const RECT *dst_rect_in, const RGNDATA *dirty_region, DWORD flags) ++ const RECT *dst_rect_in, const RGNDATA *dirty_region, DWORD flags, ++ struct wined3d_surface *depth_stencil) + { + struct wined3d_surface *back_buffer = surface_from_resource( + wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)); +- const struct wined3d_fb_state *fb = &swapchain->device->state.fb; + const struct wined3d_gl_info *gl_info; + struct wined3d_context *context; + struct wined3d_surface *front; +@@ -574,16 +574,14 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + break; + } + +- if (fb->depth_stencil) ++ if (depth_stencil) + { +- struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(fb->depth_stencil); +- +- if (ds && (swapchain->desc.flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL +- || ds->flags & SFLAG_DISCARD)) ++ if (swapchain->desc.flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL ++ || depth_stencil->flags & SFLAG_DISCARD) + { +- surface_modify_ds_location(ds, WINED3D_LOCATION_DISCARDED, +- fb->depth_stencil->width, fb->depth_stencil->height); +- if (ds == swapchain->device->onscreen_depth_stencil) ++ surface_modify_ds_location(depth_stencil, WINED3D_LOCATION_DISCARDED, ++ depth_stencil->resource.width, depth_stencil->resource.height); ++ if (depth_stencil == swapchain->device->onscreen_depth_stencil) + { + wined3d_surface_decref(swapchain->device->onscreen_depth_stencil); + swapchain->device->onscreen_depth_stencil = NULL; +@@ -647,7 +645,8 @@ void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *r + } + + static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, const RECT *src_rect_in, +- const RECT *dst_rect_in, const RGNDATA *dirty_region, DWORD flags) ++ const RECT *dst_rect_in, const RGNDATA *dirty_region, DWORD flags, ++ struct wined3d_surface *depth_stencil) + { + struct wined3d_surface *front, *back; + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index a16909c..024b55b 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2746,7 +2746,8 @@ struct wined3d_shader_resource_view + struct wined3d_swapchain_ops + { + void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, +- const RECT *dst_rect, const RGNDATA *dirty_region, DWORD flags); ++ const RECT *dst_rect, const RGNDATA *dirty_region, DWORD flags, ++ struct wined3d_surface *depth_stencil); + }; + + struct wined3d_swapchain +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0064-wined3d-Don-t-store-viewport-pointers-in-the-command.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0064-wined3d-Don-t-store-viewport-pointers-in-the-command.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0064-wined3d-Don-t-store-viewport-pointers-in-the-command.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0064-wined3d-Don-t-store-viewport-pointers-in-the-command.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,47 @@ +From eb236d88cef3c5c73289c1147466a1cc85657500 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 5 Apr 2013 10:12:06 +0200 +Subject: wined3d: Don't store viewport pointers in the command stream. + +--- + dlls/wined3d/cs.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 03e760d..4b1ed18 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -126,7 +126,7 @@ struct wined3d_cs_set_predication + struct wined3d_cs_set_viewport + { + enum wined3d_cs_op opcode; +- const struct wined3d_viewport *viewport; ++ struct wined3d_viewport viewport; + }; + + struct wined3d_cs_set_scissor_rect +@@ -552,9 +552,10 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query + static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_viewport *op = data; ++ struct wined3d_device *device = cs->device; + +- cs->state.viewport = *op->viewport; +- device_invalidate_state(cs->device, STATE_VIEWPORT); ++ cs->state.viewport = op->viewport; ++ device_invalidate_state(device, STATE_VIEWPORT); + + return sizeof(*op); + } +@@ -565,7 +566,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_SET_VIEWPORT; +- op->viewport = viewport; ++ op->viewport = *viewport; + + cs->ops->submit(cs); + } +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0064-wined3d-Send-base-vertex-index-updates-through-the-c.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0064-wined3d-Send-base-vertex-index-updates-through-the-c.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0064-wined3d-Send-base-vertex-index-updates-through-the-c.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0064-wined3d-Send-base-vertex-index-updates-through-the-c.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,178 +0,0 @@ -From 4b5e47ede0b1ac538b6439e8b1888e4da542ceee Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 7 Apr 2013 17:33:20 +0200 -Subject: wined3d: Send base vertex index updates through the cs - ---- - dlls/wined3d/cs.c | 49 ++++++++++++++++++++++++++++++++++++++---- - dlls/wined3d/device.c | 17 +++------------ - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 50 insertions(+), 18 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 236e2f2..0525a59 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -66,6 +66,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SET_VS_CONSTS_F, - WINED3D_CS_OP_SET_PS_CONSTS_F, - WINED3D_CS_OP_GLFINISH, -+ WINED3D_CS_OP_SET_BASE_VERTEX_INDEX, - WINED3D_CS_OP_STOP, - }; - -@@ -290,6 +291,12 @@ struct wined3d_cs_finish - enum wined3d_cs_op opcode; - }; - -+struct wined3d_cs_set_base_vertex_index -+{ -+ enum wined3d_cs_op opcode; -+ UINT base_vertex_index; -+}; -+ - /* FIXME: The list synchronization probably isn't particularly fast. */ - static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) - { -@@ -504,6 +511,21 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * - static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_draw *op = data; -+ const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; -+ -+ if (op->indexed && !gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]) -+ { -+ if (cs->state.load_base_vertex_index != cs->state.base_vertex_index) -+ { -+ cs->state.load_base_vertex_index = cs->state.base_vertex_index; -+ device_invalidate_state(cs->device, STATE_BASEVERTEXINDEX); -+ } -+ } -+ else if (cs->state.load_base_vertex_index) -+ { -+ cs->state.load_base_vertex_index = 0; -+ device_invalidate_state(cs->device, STATE_BASEVERTEXINDEX); -+ } - - draw_primitive(cs->device, &cs->state, op->start_idx, op->index_count, - op->start_instance, op->instance_count, op->indexed); -@@ -931,8 +953,6 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi - /* Don't memcpy the entire struct, we'll remove single items as we add dedicated - * ops for setting states */ - -- cs->state.base_vertex_index = op->state.base_vertex_index; -- cs->state.load_base_vertex_index = op->state.load_base_vertex_index; - cs->state.gl_primitive_type = op->state.gl_primitive_type; - - memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b)); -@@ -955,8 +975,6 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win - - /* Don't memcpy the entire struct, we'll remove single items as we add dedicated - * ops for setting states */ -- op->state.base_vertex_index = state->base_vertex_index; -- op->state.load_base_vertex_index = state->load_base_vertex_index; - op->state.gl_primitive_type = state->gl_primitive_type; - - memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b)); -@@ -1281,6 +1299,28 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) - cs->ops->submit(cs); - } - -+static UINT wined3d_cs_exec_set_base_vertex_index(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_base_vertex_index *op = data; -+ -+ cs->state.base_vertex_index = op->base_vertex_index; -+ device_invalidate_state(cs->device, STATE_BASEVERTEXINDEX); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, -+ UINT base_vertex_index) -+{ -+ struct wined3d_cs_set_base_vertex_index *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SET_BASE_VERTEX_INDEX; -+ op->base_vertex_index = base_vertex_index; -+ -+ cs->ops->submit(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -@@ -1313,6 +1353,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, - /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, - /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, -+ /* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index, - }; - - static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index dfc0619..a80784b 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -1830,6 +1830,9 @@ void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, I - TRACE("device %p, base_index %d.\n", device, base_index); - - device->update_state->base_vertex_index = base_index; -+ -+ if (!device->recording) -+ wined3d_cs_emit_set_base_vertex_index(device->cs, base_index); - } - - INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device) -@@ -3377,12 +3380,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT - return WINED3DERR_INVALIDCALL; - } - -- if (device->state.load_base_vertex_index) -- { -- device->state.load_base_vertex_index = 0; -- device_invalidate_state(device, STATE_BASEVERTEXINDEX); -- } -- - wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); - wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE); - -@@ -3391,8 +3388,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT - - HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) - { -- const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -- - TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count); - - if (!device->state.index_buffer) -@@ -3411,12 +3406,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic - return WINED3DERR_INVALIDCALL; - } - -- if (!gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX] && -- device->state.load_base_vertex_index != device->state.base_vertex_index) -- { -- device->state.load_base_vertex_index = device->state.base_vertex_index; -- device_invalidate_state(device, STATE_BASEVERTEXINDEX); -- } - - wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); - wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index e4dbd9d..382c120 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2616,6 +2616,8 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi - void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, - UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; - void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, -+ UINT base_vertex_index) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0065-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0065-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0065-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0065-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,217 @@ +From 3d851db23b85050b91b68a9556fd5b3407166089 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 5 Apr 2013 14:37:44 +0200 +Subject: wined3d: Keep track of the onscreen depth stencil in the command + stream instead of the device. + +Based on a patch by Henri Verbeet. + +TODO: Not sure if its the right way to go. There are certainly some +missing bits, e.g. accessing the cs via the device in all but one places +defeats the point of this at the moment. + +Since the GL onscreen depth stencil is part of the WGL framebuffer, +which belongs to the swapchain, storing this info in the swapchain might +be the right thing to do. This should help multi-window or multi-head +configurations. +--- + dlls/wined3d/cs.c | 22 +++++++++++++++++++--- + dlls/wined3d/device.c | 35 ++++++++++------------------------- + dlls/wined3d/drawprim.c | 4 ++-- + dlls/wined3d/swapchain.c | 6 +++--- + dlls/wined3d/wined3d_private.h | 10 ++++------ + 5 files changed, 38 insertions(+), 39 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 4b1ed18..236e2f2 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -629,10 +629,10 @@ static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const + || prev_surface->flags & SFLAG_DISCARD)) + { + surface_modify_ds_location(prev_surface, WINED3D_LOCATION_DISCARDED, prev->width, prev->height); +- if (prev_surface == device->onscreen_depth_stencil) ++ if (prev_surface == cs->onscreen_depth_stencil) + { +- wined3d_surface_decref(device->onscreen_depth_stencil); +- device->onscreen_depth_stencil = NULL; ++ wined3d_surface_decref(cs->onscreen_depth_stencil); ++ cs->onscreen_depth_stencil = NULL; + } + } + } +@@ -1365,6 +1365,22 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs) + wined3d_cs_flush(cs); + } + ++void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, ++ struct wined3d_context *context, struct wined3d_surface *depth_stencil) ++{ ++ if (cs->onscreen_depth_stencil) ++ { ++ surface_load_ds_location(cs->onscreen_depth_stencil, context, WINED3D_LOCATION_TEXTURE_RGB); ++ ++ surface_modify_ds_location(cs->onscreen_depth_stencil, WINED3D_LOCATION_TEXTURE_RGB, ++ cs->onscreen_depth_stencil->ds_current_size.cx, ++ cs->onscreen_depth_stencil->ds_current_size.cy); ++ wined3d_surface_decref(cs->onscreen_depth_stencil); ++ } ++ cs->onscreen_depth_stencil = depth_stencil; ++ wined3d_surface_incref(cs->onscreen_depth_stencil); ++} ++ + static DWORD WINAPI wined3d_cs_run(void *thread_param) + { + struct wined3d_cs *cs = thread_param; +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index c3e7d33..9fe7760 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -198,22 +198,6 @@ void device_context_remove(struct wined3d_device *device, struct wined3d_context + device->contexts = new_array; + } + +-void device_switch_onscreen_ds(struct wined3d_device *device, +- struct wined3d_context *context, struct wined3d_surface *depth_stencil) +-{ +- if (device->onscreen_depth_stencil) +- { +- surface_load_ds_location(device->onscreen_depth_stencil, context, WINED3D_LOCATION_TEXTURE_RGB); +- +- surface_modify_ds_location(device->onscreen_depth_stencil, WINED3D_LOCATION_TEXTURE_RGB, +- device->onscreen_depth_stencil->ds_current_size.cx, +- device->onscreen_depth_stencil->ds_current_size.cy); +- wined3d_surface_decref(device->onscreen_depth_stencil); +- } +- device->onscreen_depth_stencil = depth_stencil; +- wined3d_surface_incref(device->onscreen_depth_stencil); +-} +- + static BOOL is_full_clear(const struct wined3d_surface *target, const RECT *draw_rect, const RECT *clear_rect) + { + /* partial draw rect */ +@@ -343,8 +327,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c + { + DWORD location = render_offscreen ? fb->depth_stencil->resource->draw_binding : WINED3D_LOCATION_DRAWABLE; + +- if (!render_offscreen && depth_stencil != device->onscreen_depth_stencil) +- device_switch_onscreen_ds(device, context, depth_stencil); ++ if (!render_offscreen && depth_stencil != device->cs->onscreen_depth_stencil) ++ wined3d_cs_switch_onscreen_ds(device->cs, context, depth_stencil); + prepare_ds_clear(depth_stencil, context, location, + draw_rect, rect_count, clear_rect, &ds_rect); + } +@@ -1060,11 +1044,12 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + /* Release the buffers (with sanity checks). + * FIXME: Move this move into a separate patch. I think the idea + * behind this is that those surfaces should be freed before unloading +- * remaining resources below. */ +- if (device->onscreen_depth_stencil) ++ * remaining resources below. ++ * FIXME 2: Shouldn't the cs take care of onscreen_depth_stencil? */ ++ if (device->cs->onscreen_depth_stencil) + { +- surface = device->onscreen_depth_stencil; +- device->onscreen_depth_stencil = NULL; ++ surface = device->cs->onscreen_depth_stencil; ++ device->cs->onscreen_depth_stencil = NULL; + wined3d_surface_decref(surface); + } + +@@ -4402,10 +4387,10 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + state_unbind_resources(&device->state); + } + +- if (device->onscreen_depth_stencil) ++ if (device->cs->onscreen_depth_stencil) + { +- wined3d_surface_decref(device->onscreen_depth_stencil); +- device->onscreen_depth_stencil = NULL; ++ wined3d_surface_decref(device->cs->onscreen_depth_stencil); ++ device->cs->onscreen_depth_stencil = NULL; + } + + if (reset_state) +diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c +index 43d867d..5eb80f0 100644 +--- a/dlls/wined3d/drawprim.c ++++ b/dlls/wined3d/drawprim.c +@@ -644,8 +644,8 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s + struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(state->fb.depth_stencil); + RECT current_rect, draw_rect, r; + +- if (!context->render_offscreen && ds != device->onscreen_depth_stencil) +- device_switch_onscreen_ds(device, context, ds); ++ if (!context->render_offscreen && ds != device->cs->onscreen_depth_stencil) ++ wined3d_cs_switch_onscreen_ds(device->cs, context, ds); + + if (ds->resource.locations & location) + SetRect(¤t_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy); +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index e190892..fa0c241 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -581,10 +581,10 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + { + surface_modify_ds_location(depth_stencil, WINED3D_LOCATION_DISCARDED, + depth_stencil->resource.width, depth_stencil->resource.height); +- if (depth_stencil == swapchain->device->onscreen_depth_stencil) ++ if (depth_stencil == swapchain->device->cs->onscreen_depth_stencil) + { +- wined3d_surface_decref(swapchain->device->onscreen_depth_stencil); +- swapchain->device->onscreen_depth_stencil = NULL; ++ wined3d_surface_decref(swapchain->device->cs->onscreen_depth_stencil); ++ swapchain->device->cs->onscreen_depth_stencil = NULL; + } + } + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 0aed164..aadb8db 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2021,15 +2021,12 @@ struct wined3d_device + struct wined3d_rendertarget_view *back_buffer_view; + struct wined3d_swapchain **swapchains; + UINT swapchain_count; ++ struct wined3d_rendertarget_view *auto_depth_stencil_view; + + struct list resources; /* a linked list to track resources created by the device */ + struct list shaders; /* a linked list to track shaders (pixel and vertex) */ + struct wine_rb_tree samplers; + +- /* Render Target Support */ +- struct wined3d_surface *onscreen_depth_stencil; +- struct wined3d_rendertarget_view *auto_depth_stencil_view; +- + /* For rendering to a texture using glCopyTexImage */ + GLuint depth_blt_texture; + +@@ -2071,8 +2068,6 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL + UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN; + void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; +-void device_switch_onscreen_ds(struct wined3d_device *device, struct wined3d_context *context, +- struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; + void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; + + static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) +@@ -2559,6 +2554,7 @@ struct wined3d_cs + struct wined3d_state state; + HANDLE thread; + DWORD tls_idx; ++ struct wined3d_surface *onscreen_depth_stencil; + + size_t data_size; + void *data; +@@ -2569,6 +2565,8 @@ struct wined3d_cs + + struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; + void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; ++void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, ++ struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; + + void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, + DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0065-wined3d-Send-primitive-type-updates-through-the-comm.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0065-wined3d-Send-primitive-type-updates-through-the-comm.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0065-wined3d-Send-primitive-type-updates-through-the-comm.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0065-wined3d-Send-primitive-type-updates-through-the-comm.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,151 +0,0 @@ -From 3f7a369ba516a2ebe970a5160293d190f806f65e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 7 Apr 2013 17:53:43 +0200 -Subject: wined3d: Send primitive type updates through the command stream - ---- - dlls/wined3d/cs.c | 39 ++++++++++++++++++++++++++++++++++----- - dlls/wined3d/device.c | 5 ++--- - dlls/wined3d/stateblock.c | 4 ++-- - dlls/wined3d/wined3d_private.h | 2 ++ - 4 files changed, 40 insertions(+), 10 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index f385449..8a28c40 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -68,6 +68,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SET_PS_CONSTS_F, - WINED3D_CS_OP_GLFINISH, - WINED3D_CS_OP_SET_BASE_VERTEX_INDEX, -+ WINED3D_CS_OP_SET_PRIMITIVE_TYPE, - WINED3D_CS_OP_STOP, - }; - -@@ -307,6 +308,12 @@ struct wined3d_cs_set_base_vertex_index - UINT base_vertex_index; - }; - -+struct wined3d_cs_set_primitive_type -+{ -+ enum wined3d_cs_op opcode; -+ GLenum gl_primitive_type; -+}; -+ - /* FIXME: The list synchronization probably isn't particularly fast. */ - static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) - { -@@ -977,9 +984,6 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi - - /* Don't memcpy the entire struct, we'll remove single items as we add dedicated - * ops for setting states */ -- -- cs->state.gl_primitive_type = op->state.gl_primitive_type; -- - memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b)); - memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i)); - -@@ -1000,8 +1004,6 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win - - /* Don't memcpy the entire struct, we'll remove single items as we add dedicated - * ops for setting states */ -- op->state.gl_primitive_type = state->gl_primitive_type; -- - memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b)); - memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i)); - -@@ -1434,6 +1436,32 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, - cs->ops->submit(cs); - } - -+static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_primitive_type *op = data; -+ GLenum prev; -+ -+ prev = cs->state.gl_primitive_type; -+ -+ if (op->gl_primitive_type == GL_POINTS || prev == GL_POINTS) -+ device_invalidate_state(cs->device, STATE_POINT_ENABLE); -+ -+ cs->state.gl_primitive_type = op->gl_primitive_type; -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_type) -+{ -+ struct wined3d_cs_set_primitive_type *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE; -+ op->gl_primitive_type = primitive_type; -+ -+ cs->ops->submit(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -@@ -1468,6 +1496,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, - /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, - /* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index, -+ /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, - }; - - static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 939d525..49ec1dc 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -3377,7 +3377,6 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, - enum wined3d_primitive_type primitive_type) - { - GLenum gl_primitive_type, prev; -- - TRACE("device %p, primitive_type %s\n", device, debug_d3dprimitivetype(primitive_type)); - - gl_primitive_type = gl_primitive_type_from_d3d(primitive_type); -@@ -3385,8 +3384,8 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, - device->update_state->gl_primitive_type = gl_primitive_type; - if (device->recording) - device->recording->changed.primitive_type = TRUE; -- else if (gl_primitive_type != prev && (gl_primitive_type == GL_POINTS || prev == GL_POINTS)) -- device_invalidate_state(device, STATE_POINT_ENABLE); -+ else if (gl_primitive_type != prev) -+ wined3d_cs_emit_set_primitive_type(device->cs, gl_primitive_type); - } - - void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device, -diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c -index 790d769..cd07055 100644 ---- a/dlls/wined3d/stateblock.c -+++ b/dlls/wined3d/stateblock.c -@@ -1075,8 +1075,8 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) - gl_primitive_type = stateblock->state.gl_primitive_type; - prev = device->update_state->gl_primitive_type; - device->update_state->gl_primitive_type = gl_primitive_type; -- if (gl_primitive_type != prev && (gl_primitive_type == GL_POINTS || prev == GL_POINTS)) -- device_invalidate_state(device, STATE_POINT_ENABLE); -+ if (gl_primitive_type != prev) -+ wined3d_cs_emit_set_primitive_type(device->cs, gl_primitive_type); - } - - if (stateblock->changed.indices) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 3d65d93..bae0336 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2675,6 +2675,8 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, co - void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, - UINT base_vertex_index) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, -+ GLenum primitive_type) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0066-wined3d-Send-base-vertex-index-updates-through-the-c.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0066-wined3d-Send-base-vertex-index-updates-through-the-c.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0066-wined3d-Send-base-vertex-index-updates-through-the-c.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0066-wined3d-Send-base-vertex-index-updates-through-the-c.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,178 @@ +From 4b5e47ede0b1ac538b6439e8b1888e4da542ceee Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 7 Apr 2013 17:33:20 +0200 +Subject: wined3d: Send base vertex index updates through the cs + +--- + dlls/wined3d/cs.c | 49 ++++++++++++++++++++++++++++++++++++++---- + dlls/wined3d/device.c | 17 +++------------ + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 50 insertions(+), 18 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 236e2f2..0525a59 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -66,6 +66,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_SET_VS_CONSTS_F, + WINED3D_CS_OP_SET_PS_CONSTS_F, + WINED3D_CS_OP_GLFINISH, ++ WINED3D_CS_OP_SET_BASE_VERTEX_INDEX, + WINED3D_CS_OP_STOP, + }; + +@@ -290,6 +291,12 @@ struct wined3d_cs_finish + enum wined3d_cs_op opcode; + }; + ++struct wined3d_cs_set_base_vertex_index ++{ ++ enum wined3d_cs_op opcode; ++ UINT base_vertex_index; ++}; ++ + /* FIXME: The list synchronization probably isn't particularly fast. */ + static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) + { +@@ -504,6 +511,21 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * + static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_draw *op = data; ++ const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; ++ ++ if (op->indexed && !gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]) ++ { ++ if (cs->state.load_base_vertex_index != cs->state.base_vertex_index) ++ { ++ cs->state.load_base_vertex_index = cs->state.base_vertex_index; ++ device_invalidate_state(cs->device, STATE_BASEVERTEXINDEX); ++ } ++ } ++ else if (cs->state.load_base_vertex_index) ++ { ++ cs->state.load_base_vertex_index = 0; ++ device_invalidate_state(cs->device, STATE_BASEVERTEXINDEX); ++ } + + draw_primitive(cs->device, &cs->state, op->start_idx, op->index_count, + op->start_instance, op->instance_count, op->indexed); +@@ -931,8 +953,6 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi + /* Don't memcpy the entire struct, we'll remove single items as we add dedicated + * ops for setting states */ + +- cs->state.base_vertex_index = op->state.base_vertex_index; +- cs->state.load_base_vertex_index = op->state.load_base_vertex_index; + cs->state.gl_primitive_type = op->state.gl_primitive_type; + + memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b)); +@@ -955,8 +975,6 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win + + /* Don't memcpy the entire struct, we'll remove single items as we add dedicated + * ops for setting states */ +- op->state.base_vertex_index = state->base_vertex_index; +- op->state.load_base_vertex_index = state->load_base_vertex_index; + op->state.gl_primitive_type = state->gl_primitive_type; + + memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b)); +@@ -1281,6 +1299,28 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) + cs->ops->submit(cs); + } + ++static UINT wined3d_cs_exec_set_base_vertex_index(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_set_base_vertex_index *op = data; ++ ++ cs->state.base_vertex_index = op->base_vertex_index; ++ device_invalidate_state(cs->device, STATE_BASEVERTEXINDEX); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, ++ UINT base_vertex_index) ++{ ++ struct wined3d_cs_set_base_vertex_index *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_SET_BASE_VERTEX_INDEX; ++ op->base_vertex_index = base_vertex_index; ++ ++ cs->ops->submit(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, +@@ -1313,6 +1353,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, + /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, + /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, ++ /* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index, + }; + + static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index dfc0619..a80784b 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -1830,6 +1830,9 @@ void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, I + TRACE("device %p, base_index %d.\n", device, base_index); + + device->update_state->base_vertex_index = base_index; ++ ++ if (!device->recording) ++ wined3d_cs_emit_set_base_vertex_index(device->cs, base_index); + } + + INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device) +@@ -3377,12 +3380,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT + return WINED3DERR_INVALIDCALL; + } + +- if (device->state.load_base_vertex_index) +- { +- device->state.load_base_vertex_index = 0; +- device_invalidate_state(device, STATE_BASEVERTEXINDEX); +- } +- + wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); + wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE); + +@@ -3391,8 +3388,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT + + HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) + { +- const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; +- + TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count); + + if (!device->state.index_buffer) +@@ -3411,12 +3406,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic + return WINED3DERR_INVALIDCALL; + } + +- if (!gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX] && +- device->state.load_base_vertex_index != device->state.base_vertex_index) +- { +- device->state.load_base_vertex_index = device->state.base_vertex_index; +- device_invalidate_state(device, STATE_BASEVERTEXINDEX); +- } + + wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); + wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index e4dbd9d..382c120 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2616,6 +2616,8 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi + void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, + UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; + void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, ++ UINT base_vertex_index) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0066-wined3d-Send-bool-constant-updates-through-the-comma.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0066-wined3d-Send-bool-constant-updates-through-the-comma.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0066-wined3d-Send-bool-constant-updates-through-the-comma.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0066-wined3d-Send-bool-constant-updates-through-the-comma.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,192 +0,0 @@ -From 870ae689d58feb0e2c28603ab7a5c202dc1bf6c2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 9 Apr 2013 21:50:30 +0200 -Subject: wined3d: Send bool constant updates through the command stream - ---- - dlls/wined3d/cs.c | 72 +++++++++++++++++++++++++++++++++++++++--- - dlls/wined3d/device.c | 8 +++-- - dlls/wined3d/wined3d_private.h | 3 ++ - 3 files changed, 76 insertions(+), 7 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index a7ba2b4..9d8491a 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -64,7 +64,9 @@ enum wined3d_cs_op - WINED3D_CS_OP_RESET_STATE, - WINED3D_CS_OP_STATEBLOCK, - WINED3D_CS_OP_SET_VS_CONSTS_F, -+ WINED3D_CS_OP_SET_VS_CONSTS_B, - WINED3D_CS_OP_SET_PS_CONSTS_F, -+ WINED3D_CS_OP_SET_PS_CONSTS_B, - WINED3D_CS_OP_GLFINISH, - WINED3D_CS_OP_SET_BASE_VERTEX_INDEX, - WINED3D_CS_OP_SET_PRIMITIVE_TYPE, -@@ -287,6 +289,13 @@ struct wined3d_cs_set_consts_f - float constants[4]; - }; - -+struct wined3d_cs_set_consts_b -+{ -+ enum wined3d_cs_op opcode; -+ UINT start_register, bool_count; -+ BOOL constants[1]; -+}; -+ - struct wined3d_cs_finish - { - enum wined3d_cs_op opcode; -@@ -959,10 +968,8 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi - - /* Don't memcpy the entire struct, we'll remove single items as we add dedicated - * ops for setting states */ -- memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b)); - memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i)); - -- memcpy(cs->state.ps_consts_b, op->state.ps_consts_b, sizeof(cs->state.ps_consts_b)); - memcpy(cs->state.ps_consts_i, op->state.ps_consts_i, sizeof(cs->state.ps_consts_i)); - - memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights)); -@@ -979,10 +986,8 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win - - /* Don't memcpy the entire struct, we'll remove single items as we add dedicated - * ops for setting states */ -- memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b)); - memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i)); - -- memcpy(op->state.ps_consts_b, state->ps_consts_b, sizeof(op->state.ps_consts_b)); - memcpy(op->state.ps_consts_i, state->ps_consts_i, sizeof(op->state.ps_consts_i)); - - /* FIXME: This is not ideal. CS is still running synchronously, so this is ok. -@@ -1137,6 +1142,63 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render - op->value = value; - - cs->ops->submit(cs); -+}; -+ -+static UINT wined3d_cs_exec_set_vs_consts_b(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_consts_b *op = data; -+ struct wined3d_device *device = cs->device; -+ -+ memcpy(&cs->state.vs_consts_b[op->start_register], op->constants, -+ sizeof(*cs->state.vs_consts_b) * op->bool_count); -+ -+ device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_B); -+ -+ return sizeof(*op) + sizeof(op->constants) * (op->bool_count - 1); -+} -+ -+static UINT wined3d_cs_exec_set_ps_consts_b(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_consts_b *op = data; -+ struct wined3d_device *device = cs->device; -+ -+ memcpy(&cs->state.ps_consts_b[op->start_register], op->constants, -+ sizeof(*cs->state.ps_consts_b) * op->bool_count); -+ -+ device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_B); -+ -+ return sizeof(*op) + sizeof(op->constants) * (op->bool_count - 1); -+} -+ -+void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, -+ const BOOL *constants, UINT bool_count, enum wined3d_shader_type type) -+{ -+ struct wined3d_cs_set_consts_b *op; -+ UINT extra_space = bool_count - 1; -+ -+ op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space); -+ switch (type) -+ { -+ case WINED3D_SHADER_TYPE_PIXEL: -+ op->opcode = WINED3D_CS_OP_SET_PS_CONSTS_B; -+ break; -+ -+ case WINED3D_SHADER_TYPE_VERTEX: -+ op->opcode = WINED3D_CS_OP_SET_VS_CONSTS_B; -+ break; -+ -+ case WINED3D_SHADER_TYPE_GEOMETRY: -+ FIXME("Invalid for geometry shaders\n"); -+ return; -+ -+ case WINED3D_SHADER_TYPE_COUNT: -+ break; -+ } -+ op->start_register = start_register; -+ op->bool_count = bool_count; -+ memcpy(op->constants, constants, sizeof(op->constants) * bool_count); -+ -+ cs->ops->submit(cs); - } - - static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) -@@ -1379,7 +1441,9 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, - /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, - /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, -+ /* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b, - /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, -+ /* WINED3D_CS_OP_SET_PS_CONSTS_B */ wined3d_cs_exec_set_ps_consts_b, - /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, - /* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index, - /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index e87a52c..14d3080 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -2197,7 +2197,7 @@ struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3 - return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx]; - } - --static void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) -+void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) - { - UINT i; - -@@ -2230,7 +2230,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, - } - else - { -- device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_B); -+ wined3d_cs_emit_set_consts_b(device->cs, start_register, constants, -+ bool_count, WINED3D_SHADER_TYPE_VERTEX); - } - - return WINED3D_OK; -@@ -2464,7 +2465,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, - } - else - { -- device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_B); -+ wined3d_cs_emit_set_consts_b(device->cs, start_register, constants, -+ bool_count, WINED3D_SHADER_TYPE_PIXEL); - } - - return WINED3D_OK; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index a647ca9..4ecb626 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2058,6 +2058,7 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL - void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; -+void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; - - static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) - { -@@ -2615,6 +2616,8 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, - void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, - UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, -+ const BOOL *constants, UINT bool_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; - void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, - UINT base_vertex_index) DECLSPEC_HIDDEN; --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0067-wined3d-Send-int-constant-updates-through-the-comman.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0067-wined3d-Send-int-constant-updates-through-the-comman.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0067-wined3d-Send-int-constant-updates-through-the-comman.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0067-wined3d-Send-int-constant-updates-through-the-comman.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ -From 68141ab2e84252e99bcf6801a5bcc629b1494665 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 10 Apr 2013 14:20:47 +0200 -Subject: wined3d: Send int constant updates through the command stream - ---- - dlls/wined3d/cs.c | 74 ++++++++++++++++++++++++++++++++++++++---- - dlls/wined3d/device.c | 6 ++-- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 74 insertions(+), 8 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 9d8491a..cf3a523 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -65,8 +65,10 @@ enum wined3d_cs_op - WINED3D_CS_OP_STATEBLOCK, - WINED3D_CS_OP_SET_VS_CONSTS_F, - WINED3D_CS_OP_SET_VS_CONSTS_B, -+ WINED3D_CS_OP_SET_VS_CONSTS_I, - WINED3D_CS_OP_SET_PS_CONSTS_F, - WINED3D_CS_OP_SET_PS_CONSTS_B, -+ WINED3D_CS_OP_SET_PS_CONSTS_I, - WINED3D_CS_OP_GLFINISH, - WINED3D_CS_OP_SET_BASE_VERTEX_INDEX, - WINED3D_CS_OP_SET_PRIMITIVE_TYPE, -@@ -296,6 +298,13 @@ struct wined3d_cs_set_consts_b - BOOL constants[1]; - }; - -+struct wined3d_cs_set_consts_i -+{ -+ enum wined3d_cs_op opcode; -+ UINT start_register, vector4i_count; -+ int constants[4]; -+}; -+ - struct wined3d_cs_finish - { - enum wined3d_cs_op opcode; -@@ -968,9 +977,6 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi - - /* Don't memcpy the entire struct, we'll remove single items as we add dedicated - * ops for setting states */ -- memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i)); -- -- memcpy(cs->state.ps_consts_i, op->state.ps_consts_i, sizeof(cs->state.ps_consts_i)); - - memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights)); - -@@ -986,9 +992,6 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win - - /* Don't memcpy the entire struct, we'll remove single items as we add dedicated - * ops for setting states */ -- memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i)); -- -- memcpy(op->state.ps_consts_i, state->ps_consts_i, sizeof(op->state.ps_consts_i)); - - /* FIXME: This is not ideal. CS is still running synchronously, so this is ok. - * It will go away soon anyway. */ -@@ -1201,6 +1204,63 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, - cs->ops->submit(cs); - } - -+static UINT wined3d_cs_exec_set_vs_consts_i(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_consts_i *op = data; -+ struct wined3d_device *device = cs->device; -+ -+ memcpy(&cs->state.vs_consts_i[op->start_register * 4], op->constants, -+ sizeof(*cs->state.vs_consts_i) * 4 * op->vector4i_count); -+ -+ device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_I); -+ -+ return sizeof(*op) + sizeof(op->constants) * (op->vector4i_count - 1); -+} -+ -+static UINT wined3d_cs_exec_set_ps_consts_i(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_consts_i *op = data; -+ struct wined3d_device *device = cs->device; -+ -+ memcpy(&cs->state.ps_consts_i[op->start_register * 4], op->constants, -+ sizeof(*cs->state.ps_consts_i) * 4 * op->vector4i_count); -+ -+ device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_I); -+ -+ return sizeof(*op) + sizeof(op->constants) * (op->vector4i_count - 1); -+} -+ -+void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, UINT start_register, -+ const int *constants, UINT vector4i_count, enum wined3d_shader_type type) -+{ -+ struct wined3d_cs_set_consts_i *op; -+ UINT extra_space = vector4i_count - 1; -+ -+ op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space); -+ switch (type) -+ { -+ case WINED3D_SHADER_TYPE_PIXEL: -+ op->opcode = WINED3D_CS_OP_SET_PS_CONSTS_I; -+ break; -+ -+ case WINED3D_SHADER_TYPE_VERTEX: -+ op->opcode = WINED3D_CS_OP_SET_VS_CONSTS_I; -+ break; -+ -+ case WINED3D_SHADER_TYPE_GEOMETRY: -+ ERR("Invalid for geometry shaders\n"); -+ return; -+ -+ case WINED3D_SHADER_TYPE_COUNT: -+ break; -+ } -+ op->start_register = start_register; -+ op->vector4i_count = vector4i_count; -+ memcpy(op->constants, constants, sizeof(op->constants) * vector4i_count); -+ -+ cs->ops->submit(cs); -+} -+ - static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_texture_state *op = data; -@@ -1442,8 +1502,10 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, - /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, - /* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b, -+ /* WINED3D_CS_OP_SET_VS_CONSTS_I */ wined3d_cs_exec_set_vs_consts_i, - /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, - /* WINED3D_CS_OP_SET_PS_CONSTS_B */ wined3d_cs_exec_set_ps_consts_b, -+ /* WINED3D_CS_OP_SET_PS_CONSTS_I */ wined3d_cs_exec_set_ps_consts_i, - /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, - /* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index, - /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 14d3080..9ba40df 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -2278,7 +2278,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, - } - else - { -- device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_I); -+ wined3d_cs_emit_set_consts_i(device->cs, start_register, constants, -+ vector4i_count, WINED3D_SHADER_TYPE_VERTEX); - } - - return WINED3D_OK; -@@ -2513,7 +2514,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, - } - else - { -- device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_I); -+ wined3d_cs_emit_set_consts_i(device->cs, start_register, constants, -+ vector4i_count, WINED3D_SHADER_TYPE_PIXEL); - } - - return WINED3D_OK; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 4ecb626..59149bd 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2618,6 +2618,8 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, co - UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, - const BOOL *constants, UINT bool_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, UINT start_register, -+ const int *constants, UINT vector4i_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; - void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, - UINT base_vertex_index) DECLSPEC_HIDDEN; --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0067-wined3d-Send-primitive-type-updates-through-the-comm.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0067-wined3d-Send-primitive-type-updates-through-the-comm.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0067-wined3d-Send-primitive-type-updates-through-the-comm.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0067-wined3d-Send-primitive-type-updates-through-the-comm.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,151 @@ +From 3f7a369ba516a2ebe970a5160293d190f806f65e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 7 Apr 2013 17:53:43 +0200 +Subject: wined3d: Send primitive type updates through the command stream + +--- + dlls/wined3d/cs.c | 39 ++++++++++++++++++++++++++++++++++----- + dlls/wined3d/device.c | 5 ++--- + dlls/wined3d/stateblock.c | 4 ++-- + dlls/wined3d/wined3d_private.h | 2 ++ + 4 files changed, 40 insertions(+), 10 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index f385449..8a28c40 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -68,6 +68,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_SET_PS_CONSTS_F, + WINED3D_CS_OP_GLFINISH, + WINED3D_CS_OP_SET_BASE_VERTEX_INDEX, ++ WINED3D_CS_OP_SET_PRIMITIVE_TYPE, + WINED3D_CS_OP_STOP, + }; + +@@ -307,6 +308,12 @@ struct wined3d_cs_set_base_vertex_index + UINT base_vertex_index; + }; + ++struct wined3d_cs_set_primitive_type ++{ ++ enum wined3d_cs_op opcode; ++ GLenum gl_primitive_type; ++}; ++ + /* FIXME: The list synchronization probably isn't particularly fast. */ + static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) + { +@@ -977,9 +984,6 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi + + /* Don't memcpy the entire struct, we'll remove single items as we add dedicated + * ops for setting states */ +- +- cs->state.gl_primitive_type = op->state.gl_primitive_type; +- + memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b)); + memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i)); + +@@ -1000,8 +1004,6 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win + + /* Don't memcpy the entire struct, we'll remove single items as we add dedicated + * ops for setting states */ +- op->state.gl_primitive_type = state->gl_primitive_type; +- + memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b)); + memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i)); + +@@ -1434,6 +1436,32 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, + cs->ops->submit(cs); + } + ++static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_set_primitive_type *op = data; ++ GLenum prev; ++ ++ prev = cs->state.gl_primitive_type; ++ ++ if (op->gl_primitive_type == GL_POINTS || prev == GL_POINTS) ++ device_invalidate_state(cs->device, STATE_POINT_ENABLE); ++ ++ cs->state.gl_primitive_type = op->gl_primitive_type; ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_type) ++{ ++ struct wined3d_cs_set_primitive_type *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE; ++ op->gl_primitive_type = primitive_type; ++ ++ cs->ops->submit(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, +@@ -1468,6 +1496,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, + /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, + /* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index, ++ /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, + }; + + static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 939d525..49ec1dc 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -3377,7 +3377,6 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, + enum wined3d_primitive_type primitive_type) + { + GLenum gl_primitive_type, prev; +- + TRACE("device %p, primitive_type %s\n", device, debug_d3dprimitivetype(primitive_type)); + + gl_primitive_type = gl_primitive_type_from_d3d(primitive_type); +@@ -3385,8 +3384,8 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, + device->update_state->gl_primitive_type = gl_primitive_type; + if (device->recording) + device->recording->changed.primitive_type = TRUE; +- else if (gl_primitive_type != prev && (gl_primitive_type == GL_POINTS || prev == GL_POINTS)) +- device_invalidate_state(device, STATE_POINT_ENABLE); ++ else if (gl_primitive_type != prev) ++ wined3d_cs_emit_set_primitive_type(device->cs, gl_primitive_type); + } + + void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device, +diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c +index 790d769..cd07055 100644 +--- a/dlls/wined3d/stateblock.c ++++ b/dlls/wined3d/stateblock.c +@@ -1075,8 +1075,8 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) + gl_primitive_type = stateblock->state.gl_primitive_type; + prev = device->update_state->gl_primitive_type; + device->update_state->gl_primitive_type = gl_primitive_type; +- if (gl_primitive_type != prev && (gl_primitive_type == GL_POINTS || prev == GL_POINTS)) +- device_invalidate_state(device, STATE_POINT_ENABLE); ++ if (gl_primitive_type != prev) ++ wined3d_cs_emit_set_primitive_type(device->cs, gl_primitive_type); + } + + if (stateblock->changed.indices) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 3d65d93..bae0336 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2675,6 +2675,8 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, co + void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, + UINT base_vertex_index) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, ++ GLenum primitive_type) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0068-wined3d-Send-bool-constant-updates-through-the-comma.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0068-wined3d-Send-bool-constant-updates-through-the-comma.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0068-wined3d-Send-bool-constant-updates-through-the-comma.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0068-wined3d-Send-bool-constant-updates-through-the-comma.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,192 @@ +From 870ae689d58feb0e2c28603ab7a5c202dc1bf6c2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 9 Apr 2013 21:50:30 +0200 +Subject: wined3d: Send bool constant updates through the command stream + +--- + dlls/wined3d/cs.c | 72 +++++++++++++++++++++++++++++++++++++++--- + dlls/wined3d/device.c | 8 +++-- + dlls/wined3d/wined3d_private.h | 3 ++ + 3 files changed, 76 insertions(+), 7 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index a7ba2b4..9d8491a 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -64,7 +64,9 @@ enum wined3d_cs_op + WINED3D_CS_OP_RESET_STATE, + WINED3D_CS_OP_STATEBLOCK, + WINED3D_CS_OP_SET_VS_CONSTS_F, ++ WINED3D_CS_OP_SET_VS_CONSTS_B, + WINED3D_CS_OP_SET_PS_CONSTS_F, ++ WINED3D_CS_OP_SET_PS_CONSTS_B, + WINED3D_CS_OP_GLFINISH, + WINED3D_CS_OP_SET_BASE_VERTEX_INDEX, + WINED3D_CS_OP_SET_PRIMITIVE_TYPE, +@@ -287,6 +289,13 @@ struct wined3d_cs_set_consts_f + float constants[4]; + }; + ++struct wined3d_cs_set_consts_b ++{ ++ enum wined3d_cs_op opcode; ++ UINT start_register, bool_count; ++ BOOL constants[1]; ++}; ++ + struct wined3d_cs_finish + { + enum wined3d_cs_op opcode; +@@ -959,10 +968,8 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi + + /* Don't memcpy the entire struct, we'll remove single items as we add dedicated + * ops for setting states */ +- memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b)); + memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i)); + +- memcpy(cs->state.ps_consts_b, op->state.ps_consts_b, sizeof(cs->state.ps_consts_b)); + memcpy(cs->state.ps_consts_i, op->state.ps_consts_i, sizeof(cs->state.ps_consts_i)); + + memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights)); +@@ -979,10 +986,8 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win + + /* Don't memcpy the entire struct, we'll remove single items as we add dedicated + * ops for setting states */ +- memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b)); + memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i)); + +- memcpy(op->state.ps_consts_b, state->ps_consts_b, sizeof(op->state.ps_consts_b)); + memcpy(op->state.ps_consts_i, state->ps_consts_i, sizeof(op->state.ps_consts_i)); + + /* FIXME: This is not ideal. CS is still running synchronously, so this is ok. +@@ -1137,6 +1142,63 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render + op->value = value; + + cs->ops->submit(cs); ++}; ++ ++static UINT wined3d_cs_exec_set_vs_consts_b(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_set_consts_b *op = data; ++ struct wined3d_device *device = cs->device; ++ ++ memcpy(&cs->state.vs_consts_b[op->start_register], op->constants, ++ sizeof(*cs->state.vs_consts_b) * op->bool_count); ++ ++ device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_B); ++ ++ return sizeof(*op) + sizeof(op->constants) * (op->bool_count - 1); ++} ++ ++static UINT wined3d_cs_exec_set_ps_consts_b(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_set_consts_b *op = data; ++ struct wined3d_device *device = cs->device; ++ ++ memcpy(&cs->state.ps_consts_b[op->start_register], op->constants, ++ sizeof(*cs->state.ps_consts_b) * op->bool_count); ++ ++ device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_B); ++ ++ return sizeof(*op) + sizeof(op->constants) * (op->bool_count - 1); ++} ++ ++void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, ++ const BOOL *constants, UINT bool_count, enum wined3d_shader_type type) ++{ ++ struct wined3d_cs_set_consts_b *op; ++ UINT extra_space = bool_count - 1; ++ ++ op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space); ++ switch (type) ++ { ++ case WINED3D_SHADER_TYPE_PIXEL: ++ op->opcode = WINED3D_CS_OP_SET_PS_CONSTS_B; ++ break; ++ ++ case WINED3D_SHADER_TYPE_VERTEX: ++ op->opcode = WINED3D_CS_OP_SET_VS_CONSTS_B; ++ break; ++ ++ case WINED3D_SHADER_TYPE_GEOMETRY: ++ FIXME("Invalid for geometry shaders\n"); ++ return; ++ ++ case WINED3D_SHADER_TYPE_COUNT: ++ break; ++ } ++ op->start_register = start_register; ++ op->bool_count = bool_count; ++ memcpy(op->constants, constants, sizeof(op->constants) * bool_count); ++ ++ cs->ops->submit(cs); + } + + static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) +@@ -1379,7 +1441,9 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, + /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, + /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, ++ /* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b, + /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, ++ /* WINED3D_CS_OP_SET_PS_CONSTS_B */ wined3d_cs_exec_set_ps_consts_b, + /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, + /* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index, + /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index e87a52c..14d3080 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -2197,7 +2197,7 @@ struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3 + return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx]; + } + +-static void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) ++void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) + { + UINT i; + +@@ -2230,7 +2230,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, + } + else + { +- device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_B); ++ wined3d_cs_emit_set_consts_b(device->cs, start_register, constants, ++ bool_count, WINED3D_SHADER_TYPE_VERTEX); + } + + return WINED3D_OK; +@@ -2464,7 +2465,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, + } + else + { +- device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_B); ++ wined3d_cs_emit_set_consts_b(device->cs, start_register, constants, ++ bool_count, WINED3D_SHADER_TYPE_PIXEL); + } + + return WINED3D_OK; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index a647ca9..4ecb626 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2058,6 +2058,7 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL + void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; ++void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; + + static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) + { +@@ -2615,6 +2616,8 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, + void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, + UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, ++ const BOOL *constants, UINT bool_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; + void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, + UINT base_vertex_index) DECLSPEC_HIDDEN; +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0068-wined3d-Send-light-updates-through-the-command-strea.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0068-wined3d-Send-light-updates-through-the-command-strea.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0068-wined3d-Send-light-updates-through-the-command-strea.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0068-wined3d-Send-light-updates-through-the-command-strea.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,394 +0,0 @@ -From a1458d85e82bcde47262c579ef3be209a1ee1324 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 10 Apr 2013 17:16:02 +0200 -Subject: wined3d: Send light updates through the command stream - ---- - dlls/wined3d/cs.c | 200 +++++++++++++++++++++++++++++++++-------- - dlls/wined3d/device.c | 31 ++----- - dlls/wined3d/wined3d_private.h | 8 +- - 3 files changed, 174 insertions(+), 65 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 85bc039..cff6212 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -63,7 +63,6 @@ enum wined3d_cs_op - WINED3D_CS_OP_SET_COLOR_KEY, - WINED3D_CS_OP_SET_MATERIAL, - WINED3D_CS_OP_RESET_STATE, -- WINED3D_CS_OP_STATEBLOCK, - WINED3D_CS_OP_SET_VS_CONSTS_F, - WINED3D_CS_OP_SET_VS_CONSTS_B, - WINED3D_CS_OP_SET_VS_CONSTS_I, -@@ -73,6 +72,8 @@ enum wined3d_cs_op - WINED3D_CS_OP_GLFINISH, - WINED3D_CS_OP_SET_BASE_VERTEX_INDEX, - WINED3D_CS_OP_SET_PRIMITIVE_TYPE, -+ WINED3D_CS_OP_SET_LIGHT, -+ WINED3D_CS_OP_SET_LIGHT_ENABLE, - WINED3D_CS_OP_STOP, - }; - -@@ -288,12 +289,6 @@ struct wined3d_cs_reset_state - enum wined3d_cs_op opcode; - }; - --struct wined3d_cs_stateblock --{ -- enum wined3d_cs_op opcode; -- struct wined3d_state state; --}; -- - struct wined3d_cs_set_consts_f - { - enum wined3d_cs_op opcode; -@@ -332,6 +327,19 @@ struct wined3d_cs_set_primitive_type - GLenum gl_primitive_type; - }; - -+struct wined3d_cs_set_light -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_light_info light; -+}; -+ -+struct wined3d_cs_set_light_enable -+{ -+ enum wined3d_cs_op opcode; -+ UINT idx; -+ BOOL enable; -+}; -+ - /* FIXME: The list synchronization probably isn't particularly fast. */ - static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) - { -@@ -996,35 +1004,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined - cs->ops->submit(cs); - } - --static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const void *data) --{ -- const struct wined3d_cs_stateblock *op = data; -- -- /* Don't memcpy the entire struct, we'll remove single items as we add dedicated -- * ops for setting states */ -- -- memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights)); -- -- return sizeof(*op); --} -- --void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct wined3d_state *state) --{ -- struct wined3d_cs_stateblock *op; -- -- op = cs->ops->require_space(cs, sizeof(*op)); -- op->opcode = WINED3D_CS_OP_STATEBLOCK; -- -- /* Don't memcpy the entire struct, we'll remove single items as we add dedicated -- * ops for setting states */ -- -- /* FIXME: This is not ideal. CS is still running synchronously, so this is ok. -- * It will go away soon anyway. */ -- memcpy(op->state.lights, state->lights, sizeof(op->state.lights)); -- -- cs->ops->submit(cs); --} -- - static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_shader_resource_view *op = data; -@@ -1584,6 +1563,152 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ - cs->ops->submit(cs); - } - -+static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_light *op = data; -+ -+ UINT light_idx = op->light.OriginalIndex; -+ UINT hash_idx = LIGHTMAP_HASHFUNC(op->light.OriginalIndex); -+ struct wined3d_light_info *object = NULL; -+ struct list *e; -+ -+ LIST_FOR_EACH(e, &cs->state.light_map[hash_idx]) -+ { -+ object = LIST_ENTRY(e, struct wined3d_light_info, entry); -+ if (object->OriginalIndex == light_idx) -+ break; -+ object = NULL; -+ } -+ -+ if (!object) -+ { -+ TRACE("Adding new light\n"); -+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); -+ if (!object) -+ return E_OUTOFMEMORY; -+ -+ list_add_head(&cs->state.light_map[hash_idx], &object->entry); -+ object->glIndex = -1; -+ object->OriginalIndex = light_idx; -+ } -+ -+ object->OriginalParms = op->light.OriginalParms; -+ memcpy(&object->position, &op->light.position, sizeof(object->position)); -+ memcpy(&object->direction, &op->light.direction, sizeof(object->direction)); -+ object->exponent = op->light.exponent; -+ object->cutoff = op->light.cutoff; -+ -+ /* Update the live definitions if the light is currently assigned a glIndex. */ -+ if (object->glIndex != -1) -+ { -+ if (object->OriginalParms.type != op->light.OriginalParms.type) -+ device_invalidate_state(cs->device, STATE_LIGHT_TYPE); -+ device_invalidate_state(cs->device, STATE_ACTIVELIGHT(object->glIndex)); -+ } -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) -+{ -+ struct wined3d_cs_set_light *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SET_LIGHT; -+ op->light = *light; -+ -+ cs->ops->submit(cs); -+} -+ -+static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_light_enable *op = data; -+ UINT hash_idx = LIGHTMAP_HASHFUNC(op->idx); -+ struct wined3d_light_info *light_info = NULL; -+ struct list *e; -+ struct wined3d_device *device = cs->device; -+ -+ LIST_FOR_EACH(e, &cs->state.light_map[hash_idx]) -+ { -+ light_info = LIST_ENTRY(e, struct wined3d_light_info, entry); -+ if (light_info->OriginalIndex == op->idx) -+ break; -+ light_info = NULL; -+ } -+ TRACE("Found light %p.\n", light_info); -+ -+ /* Should be handled by the device by emitting a set_light op */ -+ if (!light_info) -+ { -+ ERR("Light enabled requested but light not defined in cs state!\n"); -+ return sizeof(*op); -+ } -+ -+ if (!op->enable) -+ { -+ if (light_info->glIndex != -1) -+ { -+ device_invalidate_state(device, STATE_LIGHT_TYPE); -+ device_invalidate_state(device, STATE_ACTIVELIGHT(light_info->glIndex)); -+ cs->state.lights[light_info->glIndex] = NULL; -+ light_info->glIndex = -1; -+ } -+ else -+ { -+ TRACE("Light already disabled, nothing to do\n"); -+ } -+ light_info->enabled = FALSE; -+ } -+ else -+ { -+ light_info->enabled = TRUE; -+ if (light_info->glIndex != -1) -+ { -+ TRACE("Nothing to do as light was enabled\n"); -+ } -+ else -+ { -+ unsigned int i; -+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -+ /* Find a free GL light. */ -+ for (i = 0; i < gl_info->limits.lights; ++i) -+ { -+ if (!cs->state.lights[i]) -+ { -+ cs->state.lights[i] = light_info; -+ light_info->glIndex = i; -+ break; -+ } -+ } -+ if (light_info->glIndex == -1) -+ { -+ /* Should be caught by the device before emitting -+ * the light_enable op */ -+ ERR("Too many concurrently active lights in cs\n"); -+ return sizeof(*op); -+ } -+ -+ /* i == light_info->glIndex */ -+ device_invalidate_state(device, STATE_LIGHT_TYPE); -+ device_invalidate_state(device, STATE_ACTIVELIGHT(i)); -+ } -+ } -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) -+{ -+ struct wined3d_cs_set_light_enable *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SET_LIGHT_ENABLE; -+ op->idx = idx; -+ op->enable = enable; -+ -+ cs->ops->submit(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -@@ -1613,7 +1738,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_COLOR_KEY */ wined3d_cs_exec_set_color_key, - /* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material, - /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, -- /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, - /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, - /* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b, - /* WINED3D_CS_OP_SET_VS_CONSTS_I */ wined3d_cs_exec_set_vs_consts_i, -@@ -1623,6 +1747,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, - /* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index, - /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, -+ /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, -+ /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, - }; - - static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 2a40538..de1bbfb 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -1470,14 +1470,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, - TRACE("... Range(%f), Falloff(%f), Theta(%f), Phi(%f)\n", - light->range, light->falloff, light->theta, light->phi); - -- /* Update the live definitions if the light is currently assigned a glIndex. */ -- if (object->glIndex != -1 && !device->recording) -- { -- if (object->OriginalParms.type != light->type) -- device_invalidate_state(device, STATE_LIGHT_TYPE); -- device_invalidate_state(device, STATE_ACTIVELIGHT(object->glIndex)); -- } -- - /* Save away the information. */ - object->OriginalParms = *light; - -@@ -1550,6 +1542,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, - FIXME("Unrecognized light type %#x.\n", light->type); - } - -+ if (!device->recording) -+ wined3d_cs_emit_set_light(device->cs, object); -+ - return WINED3D_OK; - } - -@@ -1622,12 +1617,6 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN - { - if (light_info->glIndex != -1) - { -- if (!device->recording) -- { -- device_invalidate_state(device, STATE_LIGHT_TYPE); -- device_invalidate_state(device, STATE_ACTIVELIGHT(light_info->glIndex)); -- } -- - device->update_state->lights[light_info->glIndex] = NULL; - light_info->glIndex = -1; - } -@@ -1669,16 +1658,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN - WARN("Too many concurrently active lights\n"); - return WINED3D_OK; - } -- -- /* i == light_info->glIndex */ -- if (!device->recording) -- { -- device_invalidate_state(device, STATE_LIGHT_TYPE); -- device_invalidate_state(device, STATE_ACTIVELIGHT(i)); -- } - } - } - -+ if (!device->recording) -+ wined3d_cs_emit_set_light_enable(device->cs, light_idx, enable); -+ - return WINED3D_OK; - } - -@@ -3405,7 +3390,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT - return WINED3DERR_INVALIDCALL; - } - -- wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); - wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE); - - return WINED3D_OK; -@@ -3440,8 +3424,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic - return WINED3DERR_INVALIDCALL; - } - -- -- wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); - wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE); - - return WINED3D_OK; -@@ -3453,7 +3435,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device - TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n", - device, start_idx, index_count, start_instance, instance_count); - -- wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); - wined3d_cs_emit_draw(device->cs, start_idx, index_count, start_instance, instance_count, TRUE); - } - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 9eb612d..7b2eaec 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2581,7 +2581,9 @@ struct wined3d_cs_block - { - struct list entry; - UINT pos; -- BYTE data[sizeof(struct wined3d_state) * 2]; /* FIXME? The size is somewhat arbitrary. */ -+ /* FIXME? The size is somewhat arbitrary. It's big enough for huge -+ * shader constant set calls though */ -+ BYTE data[sizeof(float) * 4 * 256 * 2]; - }; - - struct wined3d_cs_ops -@@ -2626,8 +2628,6 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture - WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, - UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; --void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, -- const struct wined3d_state *state) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, - struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, -@@ -2673,6 +2673,8 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, - UINT base_vertex_index) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, - GLenum primitive_type) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0069-wined3d-Prevent-the-command-stream-from-running-ahea.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0069-wined3d-Prevent-the-command-stream-from-running-ahea.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0069-wined3d-Prevent-the-command-stream-from-running-ahea.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0069-wined3d-Prevent-the-command-stream-from-running-ahea.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -From 0fe58ec92cc169b54b6d1f579ee59f70aa4554d0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 10 Apr 2013 19:10:41 +0200 -Subject: wined3d: Prevent the command stream from running ahead too far - ---- - dlls/wined3d/cs.c | 8 ++++++++ - dlls/wined3d/wined3d_private.h | 2 ++ - 2 files changed, 10 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index f48d14a..dbfd86d 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -472,6 +472,8 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) - src_rect, dst_rect, dirty_region, op->flags, - wined3d_rendertarget_view_get_surface(cs->state.fb.depth_stencil)); - -+ InterlockedDecrement(&cs->pending_presents); -+ - return sizeof(*op); - } - -@@ -480,6 +482,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw - const RGNDATA *dirty_region, DWORD flags) - { - struct wined3d_cs_present *op; -+ LONG pending; - - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_PRESENT; -@@ -503,7 +506,12 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw - } - op->flags = flags; - -+ pending = InterlockedIncrement(&cs->pending_presents); -+ - cs->ops->submit(cs); -+ -+ while (pending > 1) -+ pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0); - } - - static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 54cf7b5..ab3d07f 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2561,6 +2561,8 @@ struct wined3d_cs - - struct wined3d_cs_list free_list; - struct wined3d_cs_list exec_list; -+ -+ LONG pending_presents; - }; - - struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0069-wined3d-Send-int-constant-updates-through-the-comman.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0069-wined3d-Send-int-constant-updates-through-the-comman.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0069-wined3d-Send-int-constant-updates-through-the-comman.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0069-wined3d-Send-int-constant-updates-through-the-comman.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,175 @@ +From 68141ab2e84252e99bcf6801a5bcc629b1494665 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 10 Apr 2013 14:20:47 +0200 +Subject: wined3d: Send int constant updates through the command stream + +--- + dlls/wined3d/cs.c | 74 ++++++++++++++++++++++++++++++++++++++---- + dlls/wined3d/device.c | 6 ++-- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 74 insertions(+), 8 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 9d8491a..cf3a523 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -65,8 +65,10 @@ enum wined3d_cs_op + WINED3D_CS_OP_STATEBLOCK, + WINED3D_CS_OP_SET_VS_CONSTS_F, + WINED3D_CS_OP_SET_VS_CONSTS_B, ++ WINED3D_CS_OP_SET_VS_CONSTS_I, + WINED3D_CS_OP_SET_PS_CONSTS_F, + WINED3D_CS_OP_SET_PS_CONSTS_B, ++ WINED3D_CS_OP_SET_PS_CONSTS_I, + WINED3D_CS_OP_GLFINISH, + WINED3D_CS_OP_SET_BASE_VERTEX_INDEX, + WINED3D_CS_OP_SET_PRIMITIVE_TYPE, +@@ -296,6 +298,13 @@ struct wined3d_cs_set_consts_b + BOOL constants[1]; + }; + ++struct wined3d_cs_set_consts_i ++{ ++ enum wined3d_cs_op opcode; ++ UINT start_register, vector4i_count; ++ int constants[4]; ++}; ++ + struct wined3d_cs_finish + { + enum wined3d_cs_op opcode; +@@ -968,9 +977,6 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi + + /* Don't memcpy the entire struct, we'll remove single items as we add dedicated + * ops for setting states */ +- memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i)); +- +- memcpy(cs->state.ps_consts_i, op->state.ps_consts_i, sizeof(cs->state.ps_consts_i)); + + memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights)); + +@@ -986,9 +992,6 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win + + /* Don't memcpy the entire struct, we'll remove single items as we add dedicated + * ops for setting states */ +- memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i)); +- +- memcpy(op->state.ps_consts_i, state->ps_consts_i, sizeof(op->state.ps_consts_i)); + + /* FIXME: This is not ideal. CS is still running synchronously, so this is ok. + * It will go away soon anyway. */ +@@ -1201,6 +1204,63 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, + cs->ops->submit(cs); + } + ++static UINT wined3d_cs_exec_set_vs_consts_i(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_set_consts_i *op = data; ++ struct wined3d_device *device = cs->device; ++ ++ memcpy(&cs->state.vs_consts_i[op->start_register * 4], op->constants, ++ sizeof(*cs->state.vs_consts_i) * 4 * op->vector4i_count); ++ ++ device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_I); ++ ++ return sizeof(*op) + sizeof(op->constants) * (op->vector4i_count - 1); ++} ++ ++static UINT wined3d_cs_exec_set_ps_consts_i(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_set_consts_i *op = data; ++ struct wined3d_device *device = cs->device; ++ ++ memcpy(&cs->state.ps_consts_i[op->start_register * 4], op->constants, ++ sizeof(*cs->state.ps_consts_i) * 4 * op->vector4i_count); ++ ++ device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_I); ++ ++ return sizeof(*op) + sizeof(op->constants) * (op->vector4i_count - 1); ++} ++ ++void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, UINT start_register, ++ const int *constants, UINT vector4i_count, enum wined3d_shader_type type) ++{ ++ struct wined3d_cs_set_consts_i *op; ++ UINT extra_space = vector4i_count - 1; ++ ++ op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space); ++ switch (type) ++ { ++ case WINED3D_SHADER_TYPE_PIXEL: ++ op->opcode = WINED3D_CS_OP_SET_PS_CONSTS_I; ++ break; ++ ++ case WINED3D_SHADER_TYPE_VERTEX: ++ op->opcode = WINED3D_CS_OP_SET_VS_CONSTS_I; ++ break; ++ ++ case WINED3D_SHADER_TYPE_GEOMETRY: ++ ERR("Invalid for geometry shaders\n"); ++ return; ++ ++ case WINED3D_SHADER_TYPE_COUNT: ++ break; ++ } ++ op->start_register = start_register; ++ op->vector4i_count = vector4i_count; ++ memcpy(op->constants, constants, sizeof(op->constants) * vector4i_count); ++ ++ cs->ops->submit(cs); ++} ++ + static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_texture_state *op = data; +@@ -1442,8 +1502,10 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, + /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, + /* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b, ++ /* WINED3D_CS_OP_SET_VS_CONSTS_I */ wined3d_cs_exec_set_vs_consts_i, + /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, + /* WINED3D_CS_OP_SET_PS_CONSTS_B */ wined3d_cs_exec_set_ps_consts_b, ++ /* WINED3D_CS_OP_SET_PS_CONSTS_I */ wined3d_cs_exec_set_ps_consts_i, + /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, + /* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index, + /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 14d3080..9ba40df 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -2278,7 +2278,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, + } + else + { +- device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_I); ++ wined3d_cs_emit_set_consts_i(device->cs, start_register, constants, ++ vector4i_count, WINED3D_SHADER_TYPE_VERTEX); + } + + return WINED3D_OK; +@@ -2513,7 +2514,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, + } + else + { +- device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_I); ++ wined3d_cs_emit_set_consts_i(device->cs, start_register, constants, ++ vector4i_count, WINED3D_SHADER_TYPE_PIXEL); + } + + return WINED3D_OK; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 4ecb626..59149bd 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2618,6 +2618,8 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, co + UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, + const BOOL *constants, UINT bool_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, UINT start_register, ++ const int *constants, UINT vector4i_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; + void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, + UINT base_vertex_index) DECLSPEC_HIDDEN; +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0070-wined3d-Send-light-updates-through-the-command-strea.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0070-wined3d-Send-light-updates-through-the-command-strea.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0070-wined3d-Send-light-updates-through-the-command-strea.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0070-wined3d-Send-light-updates-through-the-command-strea.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,394 @@ +From a1458d85e82bcde47262c579ef3be209a1ee1324 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 10 Apr 2013 17:16:02 +0200 +Subject: wined3d: Send light updates through the command stream + +--- + dlls/wined3d/cs.c | 200 +++++++++++++++++++++++++++++++++-------- + dlls/wined3d/device.c | 31 ++----- + dlls/wined3d/wined3d_private.h | 8 +- + 3 files changed, 174 insertions(+), 65 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 85bc039..cff6212 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -63,7 +63,6 @@ enum wined3d_cs_op + WINED3D_CS_OP_SET_COLOR_KEY, + WINED3D_CS_OP_SET_MATERIAL, + WINED3D_CS_OP_RESET_STATE, +- WINED3D_CS_OP_STATEBLOCK, + WINED3D_CS_OP_SET_VS_CONSTS_F, + WINED3D_CS_OP_SET_VS_CONSTS_B, + WINED3D_CS_OP_SET_VS_CONSTS_I, +@@ -73,6 +72,8 @@ enum wined3d_cs_op + WINED3D_CS_OP_GLFINISH, + WINED3D_CS_OP_SET_BASE_VERTEX_INDEX, + WINED3D_CS_OP_SET_PRIMITIVE_TYPE, ++ WINED3D_CS_OP_SET_LIGHT, ++ WINED3D_CS_OP_SET_LIGHT_ENABLE, + WINED3D_CS_OP_STOP, + }; + +@@ -288,12 +289,6 @@ struct wined3d_cs_reset_state + enum wined3d_cs_op opcode; + }; + +-struct wined3d_cs_stateblock +-{ +- enum wined3d_cs_op opcode; +- struct wined3d_state state; +-}; +- + struct wined3d_cs_set_consts_f + { + enum wined3d_cs_op opcode; +@@ -332,6 +327,19 @@ struct wined3d_cs_set_primitive_type + GLenum gl_primitive_type; + }; + ++struct wined3d_cs_set_light ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_light_info light; ++}; ++ ++struct wined3d_cs_set_light_enable ++{ ++ enum wined3d_cs_op opcode; ++ UINT idx; ++ BOOL enable; ++}; ++ + /* FIXME: The list synchronization probably isn't particularly fast. */ + static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) + { +@@ -996,35 +1004,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined + cs->ops->submit(cs); + } + +-static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const void *data) +-{ +- const struct wined3d_cs_stateblock *op = data; +- +- /* Don't memcpy the entire struct, we'll remove single items as we add dedicated +- * ops for setting states */ +- +- memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights)); +- +- return sizeof(*op); +-} +- +-void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct wined3d_state *state) +-{ +- struct wined3d_cs_stateblock *op; +- +- op = cs->ops->require_space(cs, sizeof(*op)); +- op->opcode = WINED3D_CS_OP_STATEBLOCK; +- +- /* Don't memcpy the entire struct, we'll remove single items as we add dedicated +- * ops for setting states */ +- +- /* FIXME: This is not ideal. CS is still running synchronously, so this is ok. +- * It will go away soon anyway. */ +- memcpy(op->state.lights, state->lights, sizeof(op->state.lights)); +- +- cs->ops->submit(cs); +-} +- + static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_shader_resource_view *op = data; +@@ -1584,6 +1563,152 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ + cs->ops->submit(cs); + } + ++static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_set_light *op = data; ++ ++ UINT light_idx = op->light.OriginalIndex; ++ UINT hash_idx = LIGHTMAP_HASHFUNC(op->light.OriginalIndex); ++ struct wined3d_light_info *object = NULL; ++ struct list *e; ++ ++ LIST_FOR_EACH(e, &cs->state.light_map[hash_idx]) ++ { ++ object = LIST_ENTRY(e, struct wined3d_light_info, entry); ++ if (object->OriginalIndex == light_idx) ++ break; ++ object = NULL; ++ } ++ ++ if (!object) ++ { ++ TRACE("Adding new light\n"); ++ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); ++ if (!object) ++ return E_OUTOFMEMORY; ++ ++ list_add_head(&cs->state.light_map[hash_idx], &object->entry); ++ object->glIndex = -1; ++ object->OriginalIndex = light_idx; ++ } ++ ++ object->OriginalParms = op->light.OriginalParms; ++ memcpy(&object->position, &op->light.position, sizeof(object->position)); ++ memcpy(&object->direction, &op->light.direction, sizeof(object->direction)); ++ object->exponent = op->light.exponent; ++ object->cutoff = op->light.cutoff; ++ ++ /* Update the live definitions if the light is currently assigned a glIndex. */ ++ if (object->glIndex != -1) ++ { ++ if (object->OriginalParms.type != op->light.OriginalParms.type) ++ device_invalidate_state(cs->device, STATE_LIGHT_TYPE); ++ device_invalidate_state(cs->device, STATE_ACTIVELIGHT(object->glIndex)); ++ } ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) ++{ ++ struct wined3d_cs_set_light *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_SET_LIGHT; ++ op->light = *light; ++ ++ cs->ops->submit(cs); ++} ++ ++static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_set_light_enable *op = data; ++ UINT hash_idx = LIGHTMAP_HASHFUNC(op->idx); ++ struct wined3d_light_info *light_info = NULL; ++ struct list *e; ++ struct wined3d_device *device = cs->device; ++ ++ LIST_FOR_EACH(e, &cs->state.light_map[hash_idx]) ++ { ++ light_info = LIST_ENTRY(e, struct wined3d_light_info, entry); ++ if (light_info->OriginalIndex == op->idx) ++ break; ++ light_info = NULL; ++ } ++ TRACE("Found light %p.\n", light_info); ++ ++ /* Should be handled by the device by emitting a set_light op */ ++ if (!light_info) ++ { ++ ERR("Light enabled requested but light not defined in cs state!\n"); ++ return sizeof(*op); ++ } ++ ++ if (!op->enable) ++ { ++ if (light_info->glIndex != -1) ++ { ++ device_invalidate_state(device, STATE_LIGHT_TYPE); ++ device_invalidate_state(device, STATE_ACTIVELIGHT(light_info->glIndex)); ++ cs->state.lights[light_info->glIndex] = NULL; ++ light_info->glIndex = -1; ++ } ++ else ++ { ++ TRACE("Light already disabled, nothing to do\n"); ++ } ++ light_info->enabled = FALSE; ++ } ++ else ++ { ++ light_info->enabled = TRUE; ++ if (light_info->glIndex != -1) ++ { ++ TRACE("Nothing to do as light was enabled\n"); ++ } ++ else ++ { ++ unsigned int i; ++ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; ++ /* Find a free GL light. */ ++ for (i = 0; i < gl_info->limits.lights; ++i) ++ { ++ if (!cs->state.lights[i]) ++ { ++ cs->state.lights[i] = light_info; ++ light_info->glIndex = i; ++ break; ++ } ++ } ++ if (light_info->glIndex == -1) ++ { ++ /* Should be caught by the device before emitting ++ * the light_enable op */ ++ ERR("Too many concurrently active lights in cs\n"); ++ return sizeof(*op); ++ } ++ ++ /* i == light_info->glIndex */ ++ device_invalidate_state(device, STATE_LIGHT_TYPE); ++ device_invalidate_state(device, STATE_ACTIVELIGHT(i)); ++ } ++ } ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) ++{ ++ struct wined3d_cs_set_light_enable *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_SET_LIGHT_ENABLE; ++ op->idx = idx; ++ op->enable = enable; ++ ++ cs->ops->submit(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, +@@ -1613,7 +1738,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_COLOR_KEY */ wined3d_cs_exec_set_color_key, + /* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material, + /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, +- /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, + /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, + /* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b, + /* WINED3D_CS_OP_SET_VS_CONSTS_I */ wined3d_cs_exec_set_vs_consts_i, +@@ -1623,6 +1747,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, + /* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index, + /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, ++ /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, ++ /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, + }; + + static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 2a40538..de1bbfb 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -1470,14 +1470,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, + TRACE("... Range(%f), Falloff(%f), Theta(%f), Phi(%f)\n", + light->range, light->falloff, light->theta, light->phi); + +- /* Update the live definitions if the light is currently assigned a glIndex. */ +- if (object->glIndex != -1 && !device->recording) +- { +- if (object->OriginalParms.type != light->type) +- device_invalidate_state(device, STATE_LIGHT_TYPE); +- device_invalidate_state(device, STATE_ACTIVELIGHT(object->glIndex)); +- } +- + /* Save away the information. */ + object->OriginalParms = *light; + +@@ -1550,6 +1542,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, + FIXME("Unrecognized light type %#x.\n", light->type); + } + ++ if (!device->recording) ++ wined3d_cs_emit_set_light(device->cs, object); ++ + return WINED3D_OK; + } + +@@ -1622,12 +1617,6 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN + { + if (light_info->glIndex != -1) + { +- if (!device->recording) +- { +- device_invalidate_state(device, STATE_LIGHT_TYPE); +- device_invalidate_state(device, STATE_ACTIVELIGHT(light_info->glIndex)); +- } +- + device->update_state->lights[light_info->glIndex] = NULL; + light_info->glIndex = -1; + } +@@ -1669,16 +1658,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN + WARN("Too many concurrently active lights\n"); + return WINED3D_OK; + } +- +- /* i == light_info->glIndex */ +- if (!device->recording) +- { +- device_invalidate_state(device, STATE_LIGHT_TYPE); +- device_invalidate_state(device, STATE_ACTIVELIGHT(i)); +- } + } + } + ++ if (!device->recording) ++ wined3d_cs_emit_set_light_enable(device->cs, light_idx, enable); ++ + return WINED3D_OK; + } + +@@ -3405,7 +3390,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT + return WINED3DERR_INVALIDCALL; + } + +- wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); + wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE); + + return WINED3D_OK; +@@ -3440,8 +3424,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic + return WINED3DERR_INVALIDCALL; + } + +- +- wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); + wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE); + + return WINED3D_OK; +@@ -3453,7 +3435,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device + TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n", + device, start_idx, index_count, start_instance, instance_count); + +- wined3d_cs_emit_transfer_stateblock(device->cs, &device->state); + wined3d_cs_emit_draw(device->cs, start_idx, index_count, start_instance, instance_count, TRUE); + } + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 9eb612d..7b2eaec 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2581,7 +2581,9 @@ struct wined3d_cs_block + { + struct list entry; + UINT pos; +- BYTE data[sizeof(struct wined3d_state) * 2]; /* FIXME? The size is somewhat arbitrary. */ ++ /* FIXME? The size is somewhat arbitrary. It's big enough for huge ++ * shader constant set calls though */ ++ BYTE data[sizeof(float) * 4 * 256 * 2]; + }; + + struct wined3d_cs_ops +@@ -2626,8 +2628,6 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture + WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, + UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; +-void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, +- const struct wined3d_state *state) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, + struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, +@@ -2673,6 +2673,8 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, + UINT base_vertex_index) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, + GLenum primitive_type) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0070-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0070-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0070-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0070-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From 0f21b13a057d684fa30678d8c08e87614eca066a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 10 Apr 2013 20:09:55 +0200 -Subject: wined3d: Wait for the cs to finish before destroying the device - ---- - dlls/wined3d/device.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 05a353c..9ef99b2 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -1013,6 +1013,9 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - if (!device->d3d_initialized) - return WINED3DERR_INVALIDCALL; - -+ if (wined3d_settings.cs_multithreaded) -+ device->cs->ops->finish(device->cs); -+ - /* I don't think that the interface guarantees that the device is destroyed from the same thread - * it was created. Thus make sure a context is active for the glDelete* calls - */ --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0071-wined3d-Prevent-the-command-stream-from-running-ahea.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0071-wined3d-Prevent-the-command-stream-from-running-ahea.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0071-wined3d-Prevent-the-command-stream-from-running-ahea.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0071-wined3d-Prevent-the-command-stream-from-running-ahea.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,60 @@ +From 0fe58ec92cc169b54b6d1f579ee59f70aa4554d0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 10 Apr 2013 19:10:41 +0200 +Subject: wined3d: Prevent the command stream from running ahead too far + +--- + dlls/wined3d/cs.c | 8 ++++++++ + dlls/wined3d/wined3d_private.h | 2 ++ + 2 files changed, 10 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index f48d14a..dbfd86d 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -472,6 +472,8 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) + src_rect, dst_rect, dirty_region, op->flags, + wined3d_rendertarget_view_get_surface(cs->state.fb.depth_stencil)); + ++ InterlockedDecrement(&cs->pending_presents); ++ + return sizeof(*op); + } + +@@ -480,6 +482,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw + const RGNDATA *dirty_region, DWORD flags) + { + struct wined3d_cs_present *op; ++ LONG pending; + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_PRESENT; +@@ -503,7 +506,12 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw + } + op->flags = flags; + ++ pending = InterlockedIncrement(&cs->pending_presents); ++ + cs->ops->submit(cs); ++ ++ while (pending > 1) ++ pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0); + } + + static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 54cf7b5..ab3d07f 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2561,6 +2561,8 @@ struct wined3d_cs + + struct wined3d_cs_list free_list; + struct wined3d_cs_list exec_list; ++ ++ LONG pending_presents; + }; + + struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0071-wined3d-Run-the-cs-asynchronously.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0071-wined3d-Run-the-cs-asynchronously.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0071-wined3d-Run-the-cs-asynchronously.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0071-wined3d-Run-the-cs-asynchronously.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From ae49b3a304769185e9f2a92ec21975d44a389654 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 10 Apr 2013 20:12:27 +0200 -Subject: wined3d: Run the cs asynchronously - ---- - dlls/wined3d/cs.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index dbfd86d..949bd6b 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1679,7 +1679,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = - static const struct wined3d_cs_ops wined3d_cs_mt_ops = - { - wined3d_cs_mt_require_space, -- wined3d_cs_flush_and_wait, -+ wined3d_cs_flush, - wined3d_cs_flush_and_wait, - }; - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,554 +0,0 @@ -From 3783cc16737b9ebebc9b00d90e981207843bc01e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 29 Apr 2013 18:49:53 +0200 -Subject: wined3d: Send blits through the command stream. - -This needs more work. This patch breaks error handling, and the split -between surface_blt and surface_blt_ugly isn't particularly nice. ---- - dlls/wined3d/cs.c | 50 +++++++ - dlls/wined3d/surface.c | 307 ++++++++++++++++++++++------------------- - dlls/wined3d/wined3d_private.h | 8 ++ - 3 files changed, 226 insertions(+), 139 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 77bb485..b5b5ece 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -74,6 +74,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SET_PRIMITIVE_TYPE, - WINED3D_CS_OP_SET_LIGHT, - WINED3D_CS_OP_SET_LIGHT_ENABLE, -+ WINED3D_CS_OP_BLT, - WINED3D_CS_OP_STOP, - }; - -@@ -340,6 +341,18 @@ struct wined3d_cs_set_light_enable - BOOL enable; - }; - -+struct wined3d_cs_blt -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_surface *dst_surface; -+ RECT dst_rect; -+ struct wined3d_surface *src_surface; -+ RECT src_rect; -+ DWORD flags; -+ WINEDDBLTFX fx; -+ enum wined3d_texture_filter_type filter; -+}; -+ - /* FIXME: The list synchronization probably isn't particularly fast. */ - static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) - { -@@ -1506,6 +1519,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) - struct wined3d_device *device = cs->device; - struct wined3d_context *context; - -+ if (!device->d3d_initialized) -+ return sizeof(*op); -+ - context = context_acquire(device, NULL); - context->gl_info->gl_ops.gl.p_glFinish(); - context_release(context); -@@ -1717,6 +1733,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab - cs->ops->submit(cs); - } - -+static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_blt *op = data; -+ -+ surface_blt_ugly(op->dst_surface, &op->dst_rect, -+ op->src_surface, &op->src_rect, -+ op->flags, &op->fx, op->filter); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surface, -+ const RECT *dst_rect, struct wined3d_surface *src_surface, -+ const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, -+ enum wined3d_texture_filter_type filter) -+{ -+ struct wined3d_cs_blt *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_BLT; -+ op->dst_surface = dst_surface; -+ op->dst_rect = *dst_rect; -+ op->src_surface = src_surface; -+ op->src_rect = *src_rect; -+ op->flags = flags; -+ op->filter = filter; -+ if (fx) -+ op->fx = *fx; -+ -+ cs->ops->submit(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -@@ -1757,6 +1805,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, - /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, - /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, -+ /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, - }; - - static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -@@ -1831,6 +1880,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) - - TRACE("Started.\n"); - -+ cs->thread_id = GetCurrentThreadId(); - for (;;) - { - struct wined3d_cs_block *block; -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 0c25884..8883c9c 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -5003,14 +5003,13 @@ const struct blit_shader cpu_blit = { - cpu_blit_blit_surface, - }; - --HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, -- struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, -+void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, -+ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, - const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) - { - struct wined3d_swapchain *src_swapchain, *dst_swapchain; - struct wined3d_device *device = dst_surface->resource.device; - DWORD src_ds_flags, dst_ds_flags; -- RECT src_rect, dst_rect; - BOOL scale, convert; - - static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -5021,111 +5020,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - | WINEDDBLT_DEPTHFILL - | WINEDDBLT_DONOTWAIT; - -- TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n", -- dst_surface, wine_dbgstr_rect(dst_rect_in), src_surface, wine_dbgstr_rect(src_rect_in), -- flags, fx, debug_d3dtexturefiltertype(filter)); -- TRACE("Usage is %s.\n", debug_d3dusage(dst_surface->resource.usage)); -- -- if (fx) -- { -- TRACE("dwSize %#x.\n", fx->dwSize); -- TRACE("dwDDFX %#x.\n", fx->dwDDFX); -- TRACE("dwROP %#x.\n", fx->dwROP); -- TRACE("dwDDROP %#x.\n", fx->dwDDROP); -- TRACE("dwRotationAngle %#x.\n", fx->dwRotationAngle); -- TRACE("dwZBufferOpCode %#x.\n", fx->dwZBufferOpCode); -- TRACE("dwZBufferLow %#x.\n", fx->dwZBufferLow); -- TRACE("dwZBufferHigh %#x.\n", fx->dwZBufferHigh); -- TRACE("dwZBufferBaseDest %#x.\n", fx->dwZBufferBaseDest); -- TRACE("dwZDestConstBitDepth %#x.\n", fx->dwZDestConstBitDepth); -- TRACE("lpDDSZBufferDest %p.\n", fx->u1.lpDDSZBufferDest); -- TRACE("dwZSrcConstBitDepth %#x.\n", fx->dwZSrcConstBitDepth); -- TRACE("lpDDSZBufferSrc %p.\n", fx->u2.lpDDSZBufferSrc); -- TRACE("dwAlphaEdgeBlendBitDepth %#x.\n", fx->dwAlphaEdgeBlendBitDepth); -- TRACE("dwAlphaEdgeBlend %#x.\n", fx->dwAlphaEdgeBlend); -- TRACE("dwReserved %#x.\n", fx->dwReserved); -- TRACE("dwAlphaDestConstBitDepth %#x.\n", fx->dwAlphaDestConstBitDepth); -- TRACE("lpDDSAlphaDest %p.\n", fx->u3.lpDDSAlphaDest); -- TRACE("dwAlphaSrcConstBitDepth %#x.\n", fx->dwAlphaSrcConstBitDepth); -- TRACE("lpDDSAlphaSrc %p.\n", fx->u4.lpDDSAlphaSrc); -- TRACE("lpDDSPattern %p.\n", fx->u5.lpDDSPattern); -- TRACE("ddckDestColorkey {%#x, %#x}.\n", -- fx->ddckDestColorkey.color_space_low_value, -- fx->ddckDestColorkey.color_space_high_value); -- TRACE("ddckSrcColorkey {%#x, %#x}.\n", -- fx->ddckSrcColorkey.color_space_low_value, -- fx->ddckSrcColorkey.color_space_high_value); -- } -- -- if (dst_surface->resource.map_count || (src_surface && src_surface->resource.map_count)) -- { -- WARN("Surface is busy, returning WINEDDERR_SURFACEBUSY.\n"); -- return WINEDDERR_SURFACEBUSY; -- } -- -- surface_get_rect(dst_surface, dst_rect_in, &dst_rect); -- -- if (dst_rect.left >= dst_rect.right || dst_rect.top >= dst_rect.bottom -- || dst_rect.left > dst_surface->resource.width || dst_rect.left < 0 -- || dst_rect.top > dst_surface->resource.height || dst_rect.top < 0 -- || dst_rect.right > dst_surface->resource.width || dst_rect.right < 0 -- || dst_rect.bottom > dst_surface->resource.height || dst_rect.bottom < 0) -- { -- WARN("The application gave us a bad destination rectangle.\n"); -- return WINEDDERR_INVALIDRECT; -- } -- -- if (src_surface) -- { -- surface_get_rect(src_surface, src_rect_in, &src_rect); -- -- if (src_rect.left >= src_rect.right || src_rect.top >= src_rect.bottom -- || src_rect.left > src_surface->resource.width || src_rect.left < 0 -- || src_rect.top > src_surface->resource.height || src_rect.top < 0 -- || src_rect.right > src_surface->resource.width || src_rect.right < 0 -- || src_rect.bottom > src_surface->resource.height || src_rect.bottom < 0) -- { -- WARN("Application gave us bad source rectangle for Blt.\n"); -- return WINEDDERR_INVALIDRECT; -- } -- } -- else -- { -- memset(&src_rect, 0, sizeof(src_rect)); -- } -- -- if (!fx || !(fx->dwDDFX)) -- flags &= ~WINEDDBLT_DDFX; -- -- if (flags & WINEDDBLT_WAIT) -- flags &= ~WINEDDBLT_WAIT; -- -- if (flags & WINEDDBLT_ASYNC) -- { -- static unsigned int once; -- -- if (!once++) -- FIXME("Can't handle WINEDDBLT_ASYNC flag.\n"); -- flags &= ~WINEDDBLT_ASYNC; -- } -- -- /* WINEDDBLT_DONOTWAIT appeared in DX7. */ -- if (flags & WINEDDBLT_DONOTWAIT) -- { -- static unsigned int once; -- -- if (!once++) -- FIXME("Can't handle WINEDDBLT_DONOTWAIT flag.\n"); -- flags &= ~WINEDDBLT_DONOTWAIT; -- } -- -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -- - if (!device->d3d_initialized) - { - WARN("D3D not initialized, using fallback.\n"); -@@ -5168,8 +5062,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - } - - scale = src_surface -- && (src_rect.right - src_rect.left != dst_rect.right - dst_rect.left -- || src_rect.bottom - src_rect.top != dst_rect.bottom - dst_rect.top); -+ && (src_rect->right - src_rect->left != dst_rect->right - dst_rect->left -+ || src_rect->bottom - src_rect->top != dst_rect->bottom - dst_rect->top); - convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; - - dst_ds_flags = dst_surface->container->resource.format_flags -@@ -5189,22 +5083,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - TRACE("Depth fill.\n"); - - if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) -- return WINED3DERR_INVALIDCALL; -+ return; - -- if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, &dst_rect, depth))) -- return WINED3D_OK; -+ if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) -+ return; - } - else - { -- if (src_ds_flags != dst_ds_flags) -- { -- WARN("Rejecting depth / stencil blit between incompatible formats.\n"); -- return WINED3DERR_INVALIDCALL; -- } -- - if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding, -- &src_rect, dst_surface, dst_surface->container->resource.draw_binding, &dst_rect))) -- return WINED3D_OK; -+ src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect))) -+ return; - } - } - else -@@ -5235,8 +5123,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - palette, fx->u5.dwFillColor, &color)) - goto fallback; - -- if (SUCCEEDED(surface_color_fill(dst_surface, &dst_rect, &color))) -- return WINED3D_OK; -+ if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) -+ return; - } - else - { -@@ -5264,9 +5152,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - TRACE("Not doing upload because of format conversion.\n"); - else - { -- POINT dst_point = {dst_rect.left, dst_rect.top}; -+ POINT dst_point = {dst_rect->left, dst_rect->top}; - -- if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, &src_rect))) -+ if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect))) - { - if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) - { -@@ -5275,7 +5163,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - dst_surface->container->resource.draw_binding); - context_release(context); - } -- return WINED3D_OK; -+ return; - } - } - } -@@ -5299,50 +5187,191 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); - dst_swapchain->desc.swap_effect = swap_effect; - -- return WINED3D_OK; -+ return; - } - - if (fbo_blit_supported(&device->adapter->gl_info, blit_op, -- &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, -- &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) -+ src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, -+ dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) - { - struct wined3d_context *context; - TRACE("Using FBO blit.\n"); - - context = context_acquire(device, NULL); - surface_blt_fbo(device, context, filter, -- src_surface, src_surface->container->resource.draw_binding, &src_rect, -- dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); -+ src_surface, src_surface->container->resource.draw_binding, src_rect, -+ dst_surface, dst_surface->container->resource.draw_binding, dst_rect); - context_release(context); - - wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); - wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); - -- return WINED3D_OK; -+ return; - } - - blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op, -- &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, -- &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format); -+ src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, -+ dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format); - if (blitter) - { -- blitter->blit_surface(device, filter, src_surface, &src_rect, dst_surface, &dst_rect, color_key); -- return WINED3D_OK; -+ blitter->blit_surface(device, filter, src_surface, src_rect, dst_surface, dst_rect, color_key); -+ return; - } - } - } - - fallback: - /* Special cases for render targets. */ -- if (SUCCEEDED(surface_blt_special(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter))) -- return WINED3D_OK; -+ if ((dst_surface->resource.usage & WINED3DUSAGE_RENDERTARGET) -+ || (src_surface && (src_surface->resource.usage & WINED3DUSAGE_RENDERTARGET))) -+ { -+ if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter))) -+ return; -+ } - - cpu: - - /* For the rest call the X11 surface implementation. For render targets - * this should be implemented OpenGL accelerated in surface_blt_special(), - * other blits are rather rare. */ -- return surface_cpu_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter); -+ surface_cpu_blt(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter); -+ return; -+} -+ -+HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, -+ struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, -+ const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) -+{ -+ struct wined3d_device *device = dst_surface->resource.device; -+ RECT src_rect, dst_rect; -+ -+ TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n", -+ dst_surface, wine_dbgstr_rect(dst_rect_in), src_surface, wine_dbgstr_rect(src_rect_in), -+ flags, fx, debug_d3dtexturefiltertype(filter)); -+ TRACE("Usage is %s.\n", debug_d3dusage(dst_surface->resource.usage)); -+ -+ if (fx) -+ { -+ TRACE("dwSize %#x.\n", fx->dwSize); -+ TRACE("dwDDFX %#x.\n", fx->dwDDFX); -+ TRACE("dwROP %#x.\n", fx->dwROP); -+ TRACE("dwDDROP %#x.\n", fx->dwDDROP); -+ TRACE("dwRotationAngle %#x.\n", fx->dwRotationAngle); -+ TRACE("dwZBufferOpCode %#x.\n", fx->dwZBufferOpCode); -+ TRACE("dwZBufferLow %#x.\n", fx->dwZBufferLow); -+ TRACE("dwZBufferHigh %#x.\n", fx->dwZBufferHigh); -+ TRACE("dwZBufferBaseDest %#x.\n", fx->dwZBufferBaseDest); -+ TRACE("dwZDestConstBitDepth %#x.\n", fx->dwZDestConstBitDepth); -+ TRACE("lpDDSZBufferDest %p.\n", fx->u1.lpDDSZBufferDest); -+ TRACE("dwZSrcConstBitDepth %#x.\n", fx->dwZSrcConstBitDepth); -+ TRACE("lpDDSZBufferSrc %p.\n", fx->u2.lpDDSZBufferSrc); -+ TRACE("dwAlphaEdgeBlendBitDepth %#x.\n", fx->dwAlphaEdgeBlendBitDepth); -+ TRACE("dwAlphaEdgeBlend %#x.\n", fx->dwAlphaEdgeBlend); -+ TRACE("dwReserved %#x.\n", fx->dwReserved); -+ TRACE("dwAlphaDestConstBitDepth %#x.\n", fx->dwAlphaDestConstBitDepth); -+ TRACE("lpDDSAlphaDest %p.\n", fx->u3.lpDDSAlphaDest); -+ TRACE("dwAlphaSrcConstBitDepth %#x.\n", fx->dwAlphaSrcConstBitDepth); -+ TRACE("lpDDSAlphaSrc %p.\n", fx->u4.lpDDSAlphaSrc); -+ TRACE("lpDDSPattern %p.\n", fx->u5.lpDDSPattern); -+ TRACE("ddckDestColorkey {%#x, %#x}.\n", -+ fx->ddckDestColorkey.color_space_low_value, -+ fx->ddckDestColorkey.color_space_high_value); -+ TRACE("ddckSrcColorkey {%#x, %#x}.\n", -+ fx->ddckSrcColorkey.color_space_low_value, -+ fx->ddckSrcColorkey.color_space_high_value); -+ } -+ -+ if (dst_surface->resource.map_count || (src_surface && src_surface->resource.map_count)) -+ { -+ /* TODO: Separate application maps from internal maps */ -+ if (!wined3d_settings.cs_multithreaded) -+ { -+ WARN("Surface is busy, returning WINEDDERR_SURFACEBUSY.\n"); -+ return WINEDDERR_SURFACEBUSY; -+ } -+ -+ wined3d_cs_emit_glfinish(dst_surface->resource.device->cs); -+ dst_surface->resource.device->cs->ops->finish(dst_surface->resource.device->cs); -+ -+ if (dst_surface->resource.map_count || (src_surface && src_surface->resource.map_count)) -+ { -+ WARN("Surface is busy, returning WINEDDERR_SURFACEBUSY.\n"); -+ return WINEDDERR_SURFACEBUSY; -+ } -+ } -+ -+ surface_get_rect(dst_surface, dst_rect_in, &dst_rect); -+ -+ if (dst_rect.left >= dst_rect.right || dst_rect.top >= dst_rect.bottom -+ || dst_rect.left > dst_surface->resource.width || dst_rect.left < 0 -+ || dst_rect.top > dst_surface->resource.height || dst_rect.top < 0 -+ || dst_rect.right > dst_surface->resource.width || dst_rect.right < 0 -+ || dst_rect.bottom > dst_surface->resource.height || dst_rect.bottom < 0) -+ { -+ WARN("The application gave us a bad destination rectangle.\n"); -+ return WINEDDERR_INVALIDRECT; -+ } -+ -+ if (src_surface) -+ { -+ DWORD src_ds_flags, dst_ds_flags; -+ -+ surface_get_rect(src_surface, src_rect_in, &src_rect); -+ -+ if (src_rect.left >= src_rect.right || src_rect.top >= src_rect.bottom -+ || src_rect.left > src_surface->resource.width || src_rect.left < 0 -+ || src_rect.top > src_surface->resource.height || src_rect.top < 0 -+ || src_rect.right > src_surface->resource.width || src_rect.right < 0 -+ || src_rect.bottom > src_surface->resource.height || src_rect.bottom < 0) -+ { -+ WARN("Application gave us bad source rectangle for Blt.\n"); -+ return WINEDDERR_INVALIDRECT; -+ } -+ -+ dst_ds_flags = dst_surface->container->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); -+ src_ds_flags = src_surface->container->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); -+ if (src_ds_flags != dst_ds_flags) -+ { -+ WARN("Rejecting depth / stencil blit between incompatible formats.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ } -+ else -+ { -+ memset(&src_rect, 0, sizeof(src_rect)); -+ } -+ -+ if (!fx || !(fx->dwDDFX)) -+ flags &= ~WINEDDBLT_DDFX; -+ -+ if (flags & WINEDDBLT_WAIT) -+ flags &= ~WINEDDBLT_WAIT; -+ -+ if (flags & WINEDDBLT_ASYNC) -+ { -+ static unsigned int once; -+ -+ if (!once++) -+ FIXME("Can't handle WINEDDBLT_ASYNC flag.\n"); -+ flags &= ~WINEDDBLT_ASYNC; -+ } -+ -+ /* WINEDDBLT_DONOTWAIT appeared in DX7. */ -+ if (flags & WINEDDBLT_DONOTWAIT) -+ { -+ static unsigned int once; -+ -+ if (!once++) -+ FIXME("Can't handle WINEDDBLT_DONOTWAIT flag.\n"); -+ flags &= ~WINEDDBLT_DONOTWAIT; -+ } -+ -+ TRACE("Emitting blit %p <== %p\n", dst_surface, src_surface); -+ wined3d_cs_emit_blt(device->cs, dst_surface, &dst_rect, src_surface, &src_rect, -+ flags, fx, filter); -+ -+ return WINED3D_OK; - } - - static const struct wined3d_resource_ops surface_resource_ops = -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ff3d49b..9fc2181 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2463,6 +2463,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; - void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, - const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, - BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; -+void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, -+ struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, -+ const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; - - void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, - const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -@@ -2612,6 +2615,7 @@ struct wined3d_cs - struct wined3d_device *device; - struct wined3d_state state; - HANDLE thread; -+ DWORD thread_id; - DWORD tls_idx; - struct wined3d_surface *onscreen_depth_stencil; - -@@ -2690,6 +2694,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, - GLenum primitive_type) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surface, -+ const RECT *dst_rect, struct wined3d_surface *src_surface, -+ const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, -+ enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0072-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0072-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0072-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0072-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,26 @@ +From 0f21b13a057d684fa30678d8c08e87614eca066a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 10 Apr 2013 20:09:55 +0200 +Subject: wined3d: Wait for the cs to finish before destroying the device + +--- + dlls/wined3d/device.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 05a353c..9ef99b2 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -1013,6 +1013,9 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + if (!device->d3d_initialized) + return WINED3DERR_INVALIDCALL; + ++ if (wined3d_settings.cs_multithreaded) ++ device->cs->ops->finish(device->cs); ++ + /* I don't think that the interface guarantees that the device is destroyed from the same thread + * it was created. Thus make sure a context is active for the glDelete* calls + */ +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ -From b642658723b5728d3ea2384f6f40680436bcdeb0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 20 Aug 2014 14:14:23 +0200 -Subject: wined3d: Put update_surface checks back in place - -Unfortunately I can't remove the code from surface_update_from_surface -yet because blits depend on them. ---- - dlls/wined3d/device.c | 66 ++++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/surface.c | 2 +- - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 68 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 65a34a5..71be9eb 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -3788,6 +3788,13 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, - struct wined3d_surface *src_surface, const RECT *src_rect, - struct wined3d_surface *dst_surface, const POINT *dst_point) - { -+ const struct wined3d_format *src_format = src_surface->resource.format; -+ const struct wined3d_format *dst_format = dst_surface->resource.format; -+ UINT update_w, update_h; -+ UINT dst_w, dst_h; -+ RECT r, dst_rect; -+ POINT p; -+ - TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n", - device, src_surface, wine_dbgstr_rect(src_rect), - dst_surface, wine_dbgstr_point(dst_point)); -@@ -3799,6 +3806,65 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, - return WINED3DERR_INVALIDCALL; - } - -+ if (src_format->id != dst_format->id) -+ { -+ WARN("Source and destination surfaces should have the same format.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ if (!dst_point) -+ { -+ p.x = 0; -+ p.y = 0; -+ dst_point = &p; -+ } -+ else if (dst_point->x < 0 || dst_point->y < 0) -+ { -+ WARN("Invalid destination point.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ if (!src_rect) -+ { -+ r.left = 0; -+ r.top = 0; -+ r.right = src_surface->resource.width; -+ r.bottom = src_surface->resource.height; -+ src_rect = &r; -+ } -+ else if (src_rect->left < 0 || src_rect->left >= src_rect->right -+ || src_rect->top < 0 || src_rect->top >= src_rect->bottom) -+ { -+ WARN("Invalid source rectangle.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ dst_w = dst_surface->resource.width; -+ dst_h = dst_surface->resource.height; -+ -+ update_w = src_rect->right - src_rect->left; -+ update_h = src_rect->bottom - src_rect->top; -+ -+ if (update_w > dst_w || dst_point->x > dst_w - update_w -+ || update_h > dst_h || dst_point->y > dst_h - update_h) -+ { -+ WARN("Destination out of bounds.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ if ((src_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) && !surface_check_block_align(src_surface, src_rect)) -+ { -+ WARN("Source rectangle not block-aligned.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ SetRect(&dst_rect, dst_point->x, dst_point->y, dst_point->x + update_w, dst_point->y + update_h); -+ if ((dst_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) && !surface_check_block_align(dst_surface, &dst_rect)) -+ { -+ WARN("Destination rectangle not block-aligned.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ - if (wined3d_settings.cs_multithreaded) - { - FIXME("Waiting for cs.\n"); -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 8883c9c..676200d 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -1366,7 +1366,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w - } - } - --static BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) -+BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) - { - struct wined3d_box box; - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 9fc2181..5828bd3 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2466,6 +2466,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w - void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, - struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, - const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -+BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; - - void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, - const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0073-wined3d-Run-the-cs-asynchronously.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0073-wined3d-Run-the-cs-asynchronously.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0073-wined3d-Run-the-cs-asynchronously.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0073-wined3d-Run-the-cs-asynchronously.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,25 @@ +From ae49b3a304769185e9f2a92ec21975d44a389654 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 10 Apr 2013 20:12:27 +0200 +Subject: wined3d: Run the cs asynchronously + +--- + dlls/wined3d/cs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index dbfd86d..949bd6b 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1679,7 +1679,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = + static const struct wined3d_cs_ops wined3d_cs_mt_ops = + { + wined3d_cs_mt_require_space, +- wined3d_cs_flush_and_wait, ++ wined3d_cs_flush, + wined3d_cs_flush_and_wait, + }; + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0074-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0074-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0074-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0074-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -From 7a25ed307d8aa08209a3e56ad4aa0bfc5995a5f3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 7 May 2013 14:53:48 +0200 -Subject: wined3d: Get rid of WINED3D_BUFFER_FLUSH - ---- - dlls/wined3d/buffer.c | 13 +++++-------- - 1 file changed, 5 insertions(+), 8 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index d2c1d62..5544640 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -32,10 +32,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); - #define WINED3D_BUFFER_HASDESC 0x01 /* A vertex description has been found. */ - #define WINED3D_BUFFER_CREATEBO 0x02 /* Create a buffer object for this buffer. */ - #define WINED3D_BUFFER_DOUBLEBUFFER 0x04 /* Keep both a buffer object and a system memory copy for this buffer. */ --#define WINED3D_BUFFER_FLUSH 0x08 /* Manual unmap flushing. */ --#define WINED3D_BUFFER_DISCARD 0x10 /* A DISCARD lock has occurred since the last preload. */ --#define WINED3D_BUFFER_SYNC 0x20 /* There has been at least one synchronized map since the last preload. */ --#define WINED3D_BUFFER_APPLESYNC 0x40 /* Using sync as in GL_APPLE_flush_buffer_range. */ -+#define WINED3D_BUFFER_DISCARD 0x08 /* A DISCARD lock has occurred since the last preload. */ -+#define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */ -+#define WINED3D_BUFFER_APPLESYNC 0x20 /* Using sync as in GL_APPLE_flush_buffer_range. */ - - #define VB_MAXDECLCHANGES 100 /* After that number of decl changes we stop converting */ - #define VB_RESETDECLCHANGE 1000 /* Reset the decl changecount after that number of draws */ -@@ -167,8 +166,6 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine - { - GL_EXTCALL(glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE)); - checkGLcall("glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE)"); -- This->flags |= WINED3D_BUFFER_FLUSH; -- - GL_EXTCALL(glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE)); - checkGLcall("glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE)"); - This->flags |= WINED3D_BUFFER_APPLESYNC; -@@ -707,7 +704,7 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined - GL_EXTCALL(glFlushMappedBufferRange(This->buffer_type_hint, start, len)); - checkGLcall("glFlushMappedBufferRange"); - } -- else if (This->flags & WINED3D_BUFFER_FLUSH) -+ else if (This->flags & WINED3D_BUFFER_APPLESYNC) - { - GL_EXTCALL(glFlushMappedBufferRangeAPPLE(This->buffer_type_hint, start, len)); - checkGLcall("glFlushMappedBufferRangeAPPLE"); -@@ -1112,7 +1109,7 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) - checkGLcall("glFlushMappedBufferRange"); - } - } -- else if (buffer->flags & WINED3D_BUFFER_FLUSH) -+ else if (buffer->flags & WINED3D_BUFFER_APPLESYNC) - { - for (i = 0; i < buffer->modified_areas; ++i) - { --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0074-wined3d-Send-blits-through-the-command-stream.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0074-wined3d-Send-blits-through-the-command-stream.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0074-wined3d-Send-blits-through-the-command-stream.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0074-wined3d-Send-blits-through-the-command-stream.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,554 @@ +From 3783cc16737b9ebebc9b00d90e981207843bc01e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Mon, 29 Apr 2013 18:49:53 +0200 +Subject: wined3d: Send blits through the command stream. + +This needs more work. This patch breaks error handling, and the split +between surface_blt and surface_blt_ugly isn't particularly nice. +--- + dlls/wined3d/cs.c | 50 +++++++ + dlls/wined3d/surface.c | 307 ++++++++++++++++++++++------------------- + dlls/wined3d/wined3d_private.h | 8 ++ + 3 files changed, 226 insertions(+), 139 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 77bb485..b5b5ece 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -74,6 +74,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_SET_PRIMITIVE_TYPE, + WINED3D_CS_OP_SET_LIGHT, + WINED3D_CS_OP_SET_LIGHT_ENABLE, ++ WINED3D_CS_OP_BLT, + WINED3D_CS_OP_STOP, + }; + +@@ -340,6 +341,18 @@ struct wined3d_cs_set_light_enable + BOOL enable; + }; + ++struct wined3d_cs_blt ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_surface *dst_surface; ++ RECT dst_rect; ++ struct wined3d_surface *src_surface; ++ RECT src_rect; ++ DWORD flags; ++ WINEDDBLTFX fx; ++ enum wined3d_texture_filter_type filter; ++}; ++ + /* FIXME: The list synchronization probably isn't particularly fast. */ + static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) + { +@@ -1506,6 +1519,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) + struct wined3d_device *device = cs->device; + struct wined3d_context *context; + ++ if (!device->d3d_initialized) ++ return sizeof(*op); ++ + context = context_acquire(device, NULL); + context->gl_info->gl_ops.gl.p_glFinish(); + context_release(context); +@@ -1717,6 +1733,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab + cs->ops->submit(cs); + } + ++static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_blt *op = data; ++ ++ surface_blt_ugly(op->dst_surface, &op->dst_rect, ++ op->src_surface, &op->src_rect, ++ op->flags, &op->fx, op->filter); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surface, ++ const RECT *dst_rect, struct wined3d_surface *src_surface, ++ const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, ++ enum wined3d_texture_filter_type filter) ++{ ++ struct wined3d_cs_blt *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_BLT; ++ op->dst_surface = dst_surface; ++ op->dst_rect = *dst_rect; ++ op->src_surface = src_surface; ++ op->src_rect = *src_rect; ++ op->flags = flags; ++ op->filter = filter; ++ if (fx) ++ op->fx = *fx; ++ ++ cs->ops->submit(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, +@@ -1757,6 +1805,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, + /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, + /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, ++ /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, + }; + + static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) +@@ -1831,6 +1880,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) + + TRACE("Started.\n"); + ++ cs->thread_id = GetCurrentThreadId(); + for (;;) + { + struct wined3d_cs_block *block; +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 0c25884..8883c9c 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -5003,14 +5003,13 @@ const struct blit_shader cpu_blit = { + cpu_blit_blit_surface, + }; + +-HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, +- struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, ++void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, ++ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, + const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) + { + struct wined3d_swapchain *src_swapchain, *dst_swapchain; + struct wined3d_device *device = dst_surface->resource.device; + DWORD src_ds_flags, dst_ds_flags; +- RECT src_rect, dst_rect; + BOOL scale, convert; + + static const DWORD simple_blit = WINEDDBLT_ASYNC +@@ -5021,111 +5020,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + | WINEDDBLT_DEPTHFILL + | WINEDDBLT_DONOTWAIT; + +- TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n", +- dst_surface, wine_dbgstr_rect(dst_rect_in), src_surface, wine_dbgstr_rect(src_rect_in), +- flags, fx, debug_d3dtexturefiltertype(filter)); +- TRACE("Usage is %s.\n", debug_d3dusage(dst_surface->resource.usage)); +- +- if (fx) +- { +- TRACE("dwSize %#x.\n", fx->dwSize); +- TRACE("dwDDFX %#x.\n", fx->dwDDFX); +- TRACE("dwROP %#x.\n", fx->dwROP); +- TRACE("dwDDROP %#x.\n", fx->dwDDROP); +- TRACE("dwRotationAngle %#x.\n", fx->dwRotationAngle); +- TRACE("dwZBufferOpCode %#x.\n", fx->dwZBufferOpCode); +- TRACE("dwZBufferLow %#x.\n", fx->dwZBufferLow); +- TRACE("dwZBufferHigh %#x.\n", fx->dwZBufferHigh); +- TRACE("dwZBufferBaseDest %#x.\n", fx->dwZBufferBaseDest); +- TRACE("dwZDestConstBitDepth %#x.\n", fx->dwZDestConstBitDepth); +- TRACE("lpDDSZBufferDest %p.\n", fx->u1.lpDDSZBufferDest); +- TRACE("dwZSrcConstBitDepth %#x.\n", fx->dwZSrcConstBitDepth); +- TRACE("lpDDSZBufferSrc %p.\n", fx->u2.lpDDSZBufferSrc); +- TRACE("dwAlphaEdgeBlendBitDepth %#x.\n", fx->dwAlphaEdgeBlendBitDepth); +- TRACE("dwAlphaEdgeBlend %#x.\n", fx->dwAlphaEdgeBlend); +- TRACE("dwReserved %#x.\n", fx->dwReserved); +- TRACE("dwAlphaDestConstBitDepth %#x.\n", fx->dwAlphaDestConstBitDepth); +- TRACE("lpDDSAlphaDest %p.\n", fx->u3.lpDDSAlphaDest); +- TRACE("dwAlphaSrcConstBitDepth %#x.\n", fx->dwAlphaSrcConstBitDepth); +- TRACE("lpDDSAlphaSrc %p.\n", fx->u4.lpDDSAlphaSrc); +- TRACE("lpDDSPattern %p.\n", fx->u5.lpDDSPattern); +- TRACE("ddckDestColorkey {%#x, %#x}.\n", +- fx->ddckDestColorkey.color_space_low_value, +- fx->ddckDestColorkey.color_space_high_value); +- TRACE("ddckSrcColorkey {%#x, %#x}.\n", +- fx->ddckSrcColorkey.color_space_low_value, +- fx->ddckSrcColorkey.color_space_high_value); +- } +- +- if (dst_surface->resource.map_count || (src_surface && src_surface->resource.map_count)) +- { +- WARN("Surface is busy, returning WINEDDERR_SURFACEBUSY.\n"); +- return WINEDDERR_SURFACEBUSY; +- } +- +- surface_get_rect(dst_surface, dst_rect_in, &dst_rect); +- +- if (dst_rect.left >= dst_rect.right || dst_rect.top >= dst_rect.bottom +- || dst_rect.left > dst_surface->resource.width || dst_rect.left < 0 +- || dst_rect.top > dst_surface->resource.height || dst_rect.top < 0 +- || dst_rect.right > dst_surface->resource.width || dst_rect.right < 0 +- || dst_rect.bottom > dst_surface->resource.height || dst_rect.bottom < 0) +- { +- WARN("The application gave us a bad destination rectangle.\n"); +- return WINEDDERR_INVALIDRECT; +- } +- +- if (src_surface) +- { +- surface_get_rect(src_surface, src_rect_in, &src_rect); +- +- if (src_rect.left >= src_rect.right || src_rect.top >= src_rect.bottom +- || src_rect.left > src_surface->resource.width || src_rect.left < 0 +- || src_rect.top > src_surface->resource.height || src_rect.top < 0 +- || src_rect.right > src_surface->resource.width || src_rect.right < 0 +- || src_rect.bottom > src_surface->resource.height || src_rect.bottom < 0) +- { +- WARN("Application gave us bad source rectangle for Blt.\n"); +- return WINEDDERR_INVALIDRECT; +- } +- } +- else +- { +- memset(&src_rect, 0, sizeof(src_rect)); +- } +- +- if (!fx || !(fx->dwDDFX)) +- flags &= ~WINEDDBLT_DDFX; +- +- if (flags & WINEDDBLT_WAIT) +- flags &= ~WINEDDBLT_WAIT; +- +- if (flags & WINEDDBLT_ASYNC) +- { +- static unsigned int once; +- +- if (!once++) +- FIXME("Can't handle WINEDDBLT_ASYNC flag.\n"); +- flags &= ~WINEDDBLT_ASYNC; +- } +- +- /* WINEDDBLT_DONOTWAIT appeared in DX7. */ +- if (flags & WINEDDBLT_DONOTWAIT) +- { +- static unsigned int once; +- +- if (!once++) +- FIXME("Can't handle WINEDDBLT_DONOTWAIT flag.\n"); +- flags &= ~WINEDDBLT_DONOTWAIT; +- } +- +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } +- + if (!device->d3d_initialized) + { + WARN("D3D not initialized, using fallback.\n"); +@@ -5168,8 +5062,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + } + + scale = src_surface +- && (src_rect.right - src_rect.left != dst_rect.right - dst_rect.left +- || src_rect.bottom - src_rect.top != dst_rect.bottom - dst_rect.top); ++ && (src_rect->right - src_rect->left != dst_rect->right - dst_rect->left ++ || src_rect->bottom - src_rect->top != dst_rect->bottom - dst_rect->top); + convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; + + dst_ds_flags = dst_surface->container->resource.format_flags +@@ -5189,22 +5083,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + TRACE("Depth fill.\n"); + + if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) +- return WINED3DERR_INVALIDCALL; ++ return; + +- if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, &dst_rect, depth))) +- return WINED3D_OK; ++ if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) ++ return; + } + else + { +- if (src_ds_flags != dst_ds_flags) +- { +- WARN("Rejecting depth / stencil blit between incompatible formats.\n"); +- return WINED3DERR_INVALIDCALL; +- } +- + if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding, +- &src_rect, dst_surface, dst_surface->container->resource.draw_binding, &dst_rect))) +- return WINED3D_OK; ++ src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect))) ++ return; + } + } + else +@@ -5235,8 +5123,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + palette, fx->u5.dwFillColor, &color)) + goto fallback; + +- if (SUCCEEDED(surface_color_fill(dst_surface, &dst_rect, &color))) +- return WINED3D_OK; ++ if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) ++ return; + } + else + { +@@ -5264,9 +5152,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + TRACE("Not doing upload because of format conversion.\n"); + else + { +- POINT dst_point = {dst_rect.left, dst_rect.top}; ++ POINT dst_point = {dst_rect->left, dst_rect->top}; + +- if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, &src_rect))) ++ if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect))) + { + if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) + { +@@ -5275,7 +5163,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + dst_surface->container->resource.draw_binding); + context_release(context); + } +- return WINED3D_OK; ++ return; + } + } + } +@@ -5299,50 +5187,191 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); + dst_swapchain->desc.swap_effect = swap_effect; + +- return WINED3D_OK; ++ return; + } + + if (fbo_blit_supported(&device->adapter->gl_info, blit_op, +- &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, +- &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) ++ src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, ++ dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) + { + struct wined3d_context *context; + TRACE("Using FBO blit.\n"); + + context = context_acquire(device, NULL); + surface_blt_fbo(device, context, filter, +- src_surface, src_surface->container->resource.draw_binding, &src_rect, +- dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); ++ src_surface, src_surface->container->resource.draw_binding, src_rect, ++ dst_surface, dst_surface->container->resource.draw_binding, dst_rect); + context_release(context); + + wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); + wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); + +- return WINED3D_OK; ++ return; + } + + blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op, +- &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, +- &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format); ++ src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, ++ dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format); + if (blitter) + { +- blitter->blit_surface(device, filter, src_surface, &src_rect, dst_surface, &dst_rect, color_key); +- return WINED3D_OK; ++ blitter->blit_surface(device, filter, src_surface, src_rect, dst_surface, dst_rect, color_key); ++ return; + } + } + } + + fallback: + /* Special cases for render targets. */ +- if (SUCCEEDED(surface_blt_special(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter))) +- return WINED3D_OK; ++ if ((dst_surface->resource.usage & WINED3DUSAGE_RENDERTARGET) ++ || (src_surface && (src_surface->resource.usage & WINED3DUSAGE_RENDERTARGET))) ++ { ++ if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter))) ++ return; ++ } + + cpu: + + /* For the rest call the X11 surface implementation. For render targets + * this should be implemented OpenGL accelerated in surface_blt_special(), + * other blits are rather rare. */ +- return surface_cpu_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter); ++ surface_cpu_blt(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter); ++ return; ++} ++ ++HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, ++ struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, ++ const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) ++{ ++ struct wined3d_device *device = dst_surface->resource.device; ++ RECT src_rect, dst_rect; ++ ++ TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n", ++ dst_surface, wine_dbgstr_rect(dst_rect_in), src_surface, wine_dbgstr_rect(src_rect_in), ++ flags, fx, debug_d3dtexturefiltertype(filter)); ++ TRACE("Usage is %s.\n", debug_d3dusage(dst_surface->resource.usage)); ++ ++ if (fx) ++ { ++ TRACE("dwSize %#x.\n", fx->dwSize); ++ TRACE("dwDDFX %#x.\n", fx->dwDDFX); ++ TRACE("dwROP %#x.\n", fx->dwROP); ++ TRACE("dwDDROP %#x.\n", fx->dwDDROP); ++ TRACE("dwRotationAngle %#x.\n", fx->dwRotationAngle); ++ TRACE("dwZBufferOpCode %#x.\n", fx->dwZBufferOpCode); ++ TRACE("dwZBufferLow %#x.\n", fx->dwZBufferLow); ++ TRACE("dwZBufferHigh %#x.\n", fx->dwZBufferHigh); ++ TRACE("dwZBufferBaseDest %#x.\n", fx->dwZBufferBaseDest); ++ TRACE("dwZDestConstBitDepth %#x.\n", fx->dwZDestConstBitDepth); ++ TRACE("lpDDSZBufferDest %p.\n", fx->u1.lpDDSZBufferDest); ++ TRACE("dwZSrcConstBitDepth %#x.\n", fx->dwZSrcConstBitDepth); ++ TRACE("lpDDSZBufferSrc %p.\n", fx->u2.lpDDSZBufferSrc); ++ TRACE("dwAlphaEdgeBlendBitDepth %#x.\n", fx->dwAlphaEdgeBlendBitDepth); ++ TRACE("dwAlphaEdgeBlend %#x.\n", fx->dwAlphaEdgeBlend); ++ TRACE("dwReserved %#x.\n", fx->dwReserved); ++ TRACE("dwAlphaDestConstBitDepth %#x.\n", fx->dwAlphaDestConstBitDepth); ++ TRACE("lpDDSAlphaDest %p.\n", fx->u3.lpDDSAlphaDest); ++ TRACE("dwAlphaSrcConstBitDepth %#x.\n", fx->dwAlphaSrcConstBitDepth); ++ TRACE("lpDDSAlphaSrc %p.\n", fx->u4.lpDDSAlphaSrc); ++ TRACE("lpDDSPattern %p.\n", fx->u5.lpDDSPattern); ++ TRACE("ddckDestColorkey {%#x, %#x}.\n", ++ fx->ddckDestColorkey.color_space_low_value, ++ fx->ddckDestColorkey.color_space_high_value); ++ TRACE("ddckSrcColorkey {%#x, %#x}.\n", ++ fx->ddckSrcColorkey.color_space_low_value, ++ fx->ddckSrcColorkey.color_space_high_value); ++ } ++ ++ if (dst_surface->resource.map_count || (src_surface && src_surface->resource.map_count)) ++ { ++ /* TODO: Separate application maps from internal maps */ ++ if (!wined3d_settings.cs_multithreaded) ++ { ++ WARN("Surface is busy, returning WINEDDERR_SURFACEBUSY.\n"); ++ return WINEDDERR_SURFACEBUSY; ++ } ++ ++ wined3d_cs_emit_glfinish(dst_surface->resource.device->cs); ++ dst_surface->resource.device->cs->ops->finish(dst_surface->resource.device->cs); ++ ++ if (dst_surface->resource.map_count || (src_surface && src_surface->resource.map_count)) ++ { ++ WARN("Surface is busy, returning WINEDDERR_SURFACEBUSY.\n"); ++ return WINEDDERR_SURFACEBUSY; ++ } ++ } ++ ++ surface_get_rect(dst_surface, dst_rect_in, &dst_rect); ++ ++ if (dst_rect.left >= dst_rect.right || dst_rect.top >= dst_rect.bottom ++ || dst_rect.left > dst_surface->resource.width || dst_rect.left < 0 ++ || dst_rect.top > dst_surface->resource.height || dst_rect.top < 0 ++ || dst_rect.right > dst_surface->resource.width || dst_rect.right < 0 ++ || dst_rect.bottom > dst_surface->resource.height || dst_rect.bottom < 0) ++ { ++ WARN("The application gave us a bad destination rectangle.\n"); ++ return WINEDDERR_INVALIDRECT; ++ } ++ ++ if (src_surface) ++ { ++ DWORD src_ds_flags, dst_ds_flags; ++ ++ surface_get_rect(src_surface, src_rect_in, &src_rect); ++ ++ if (src_rect.left >= src_rect.right || src_rect.top >= src_rect.bottom ++ || src_rect.left > src_surface->resource.width || src_rect.left < 0 ++ || src_rect.top > src_surface->resource.height || src_rect.top < 0 ++ || src_rect.right > src_surface->resource.width || src_rect.right < 0 ++ || src_rect.bottom > src_surface->resource.height || src_rect.bottom < 0) ++ { ++ WARN("Application gave us bad source rectangle for Blt.\n"); ++ return WINEDDERR_INVALIDRECT; ++ } ++ ++ dst_ds_flags = dst_surface->container->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); ++ src_ds_flags = src_surface->container->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); ++ if (src_ds_flags != dst_ds_flags) ++ { ++ WARN("Rejecting depth / stencil blit between incompatible formats.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ } ++ else ++ { ++ memset(&src_rect, 0, sizeof(src_rect)); ++ } ++ ++ if (!fx || !(fx->dwDDFX)) ++ flags &= ~WINEDDBLT_DDFX; ++ ++ if (flags & WINEDDBLT_WAIT) ++ flags &= ~WINEDDBLT_WAIT; ++ ++ if (flags & WINEDDBLT_ASYNC) ++ { ++ static unsigned int once; ++ ++ if (!once++) ++ FIXME("Can't handle WINEDDBLT_ASYNC flag.\n"); ++ flags &= ~WINEDDBLT_ASYNC; ++ } ++ ++ /* WINEDDBLT_DONOTWAIT appeared in DX7. */ ++ if (flags & WINEDDBLT_DONOTWAIT) ++ { ++ static unsigned int once; ++ ++ if (!once++) ++ FIXME("Can't handle WINEDDBLT_DONOTWAIT flag.\n"); ++ flags &= ~WINEDDBLT_DONOTWAIT; ++ } ++ ++ TRACE("Emitting blit %p <== %p\n", dst_surface, src_surface); ++ wined3d_cs_emit_blt(device->cs, dst_surface, &dst_rect, src_surface, &src_rect, ++ flags, fx, filter); ++ ++ return WINED3D_OK; + } + + static const struct wined3d_resource_ops surface_resource_ops = +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index ff3d49b..9fc2181 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2463,6 +2463,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, + const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, + BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; ++void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, ++ struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, ++ const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; + + void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, + const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +@@ -2612,6 +2615,7 @@ struct wined3d_cs + struct wined3d_device *device; + struct wined3d_state state; + HANDLE thread; ++ DWORD thread_id; + DWORD tls_idx; + struct wined3d_surface *onscreen_depth_stencil; + +@@ -2690,6 +2694,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, + GLenum primitive_type) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN; + void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surface, ++ const RECT *dst_rect, struct wined3d_surface *src_surface, ++ const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, ++ enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0075-wined3d-Add-cs-waiting-debug-code.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0075-wined3d-Add-cs-waiting-debug-code.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0075-wined3d-Add-cs-waiting-debug-code.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0075-wined3d-Add-cs-waiting-debug-code.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -From b41844b91cb9817f378c3c666b3129c3c870d014 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Jul 2013 20:40:39 +0200 -Subject: wined3d: Add cs waiting debug code - ---- - dlls/wined3d/texture.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index eb4996b..240e8fa 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -610,6 +610,14 @@ HRESULT CDECL wined3d_texture_set_color_key(struct wined3d_texture *texture, - return WINED3DERR_INVALIDCALL; - } - -+ /* -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("waiting for cs\n"); -+ texture->resource.device->cs->ops->finish(texture->resource.device->cs); -+ } -+ */ -+ - wined3d_cs_emit_set_color_key(device->cs, texture, flags, color_key); - - return WINED3D_OK; --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0075-wined3d-Put-update_surface-checks-back-in-place.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0075-wined3d-Put-update_surface-checks-back-in-place.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0075-wined3d-Put-update_surface-checks-back-in-place.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0075-wined3d-Put-update_surface-checks-back-in-place.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,125 @@ +From b642658723b5728d3ea2384f6f40680436bcdeb0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 20 Aug 2014 14:14:23 +0200 +Subject: wined3d: Put update_surface checks back in place + +Unfortunately I can't remove the code from surface_update_from_surface +yet because blits depend on them. +--- + dlls/wined3d/device.c | 66 ++++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/surface.c | 2 +- + dlls/wined3d/wined3d_private.h | 1 + + 3 files changed, 68 insertions(+), 1 deletion(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 65a34a5..71be9eb 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -3788,6 +3788,13 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, + struct wined3d_surface *src_surface, const RECT *src_rect, + struct wined3d_surface *dst_surface, const POINT *dst_point) + { ++ const struct wined3d_format *src_format = src_surface->resource.format; ++ const struct wined3d_format *dst_format = dst_surface->resource.format; ++ UINT update_w, update_h; ++ UINT dst_w, dst_h; ++ RECT r, dst_rect; ++ POINT p; ++ + TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n", + device, src_surface, wine_dbgstr_rect(src_rect), + dst_surface, wine_dbgstr_point(dst_point)); +@@ -3799,6 +3806,65 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, + return WINED3DERR_INVALIDCALL; + } + ++ if (src_format->id != dst_format->id) ++ { ++ WARN("Source and destination surfaces should have the same format.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ if (!dst_point) ++ { ++ p.x = 0; ++ p.y = 0; ++ dst_point = &p; ++ } ++ else if (dst_point->x < 0 || dst_point->y < 0) ++ { ++ WARN("Invalid destination point.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ if (!src_rect) ++ { ++ r.left = 0; ++ r.top = 0; ++ r.right = src_surface->resource.width; ++ r.bottom = src_surface->resource.height; ++ src_rect = &r; ++ } ++ else if (src_rect->left < 0 || src_rect->left >= src_rect->right ++ || src_rect->top < 0 || src_rect->top >= src_rect->bottom) ++ { ++ WARN("Invalid source rectangle.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ dst_w = dst_surface->resource.width; ++ dst_h = dst_surface->resource.height; ++ ++ update_w = src_rect->right - src_rect->left; ++ update_h = src_rect->bottom - src_rect->top; ++ ++ if (update_w > dst_w || dst_point->x > dst_w - update_w ++ || update_h > dst_h || dst_point->y > dst_h - update_h) ++ { ++ WARN("Destination out of bounds.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ if ((src_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) && !surface_check_block_align(src_surface, src_rect)) ++ { ++ WARN("Source rectangle not block-aligned.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ SetRect(&dst_rect, dst_point->x, dst_point->y, dst_point->x + update_w, dst_point->y + update_h); ++ if ((dst_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) && !surface_check_block_align(dst_surface, &dst_rect)) ++ { ++ WARN("Destination rectangle not block-aligned.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ + if (wined3d_settings.cs_multithreaded) + { + FIXME("Waiting for cs.\n"); +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 8883c9c..676200d 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -1366,7 +1366,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w + } + } + +-static BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) ++BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) + { + struct wined3d_box box; + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 9fc2181..5828bd3 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2466,6 +2466,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w + void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, + struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, + const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; ++BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; + + void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, + const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0076-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0076-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0076-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0076-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From 6464090c8161886fba8637324b7714d67accf7c9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Jul 2013 21:00:17 +0200 -Subject: wined3d: Don't force strict draw ordering for multithreaded CS - -Shouldn't be needed any more ---- - dlls/wined3d/wined3d_main.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c -index 5471e6e..e6dc444 100644 ---- a/dlls/wined3d/wined3d_main.c -+++ b/dlls/wined3d/wined3d_main.c -@@ -310,8 +310,6 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) - { - TRACE("Enabling multithreaded command stream.\n"); - wined3d_settings.cs_multithreaded = TRUE; -- TRACE("Enforcing strict draw ordering for multithreaded command stream.\n"); -- wined3d_settings.strict_draw_ordering = TRUE; - } - } - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0076-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0076-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0076-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0076-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,57 @@ +From 7a25ed307d8aa08209a3e56ad4aa0bfc5995a5f3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 7 May 2013 14:53:48 +0200 +Subject: wined3d: Get rid of WINED3D_BUFFER_FLUSH + +--- + dlls/wined3d/buffer.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index d2c1d62..5544640 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -32,10 +32,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); + #define WINED3D_BUFFER_HASDESC 0x01 /* A vertex description has been found. */ + #define WINED3D_BUFFER_CREATEBO 0x02 /* Create a buffer object for this buffer. */ + #define WINED3D_BUFFER_DOUBLEBUFFER 0x04 /* Keep both a buffer object and a system memory copy for this buffer. */ +-#define WINED3D_BUFFER_FLUSH 0x08 /* Manual unmap flushing. */ +-#define WINED3D_BUFFER_DISCARD 0x10 /* A DISCARD lock has occurred since the last preload. */ +-#define WINED3D_BUFFER_SYNC 0x20 /* There has been at least one synchronized map since the last preload. */ +-#define WINED3D_BUFFER_APPLESYNC 0x40 /* Using sync as in GL_APPLE_flush_buffer_range. */ ++#define WINED3D_BUFFER_DISCARD 0x08 /* A DISCARD lock has occurred since the last preload. */ ++#define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */ ++#define WINED3D_BUFFER_APPLESYNC 0x20 /* Using sync as in GL_APPLE_flush_buffer_range. */ + + #define VB_MAXDECLCHANGES 100 /* After that number of decl changes we stop converting */ + #define VB_RESETDECLCHANGE 1000 /* Reset the decl changecount after that number of draws */ +@@ -167,8 +166,6 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine + { + GL_EXTCALL(glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE)); + checkGLcall("glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE)"); +- This->flags |= WINED3D_BUFFER_FLUSH; +- + GL_EXTCALL(glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE)); + checkGLcall("glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE)"); + This->flags |= WINED3D_BUFFER_APPLESYNC; +@@ -707,7 +704,7 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined + GL_EXTCALL(glFlushMappedBufferRange(This->buffer_type_hint, start, len)); + checkGLcall("glFlushMappedBufferRange"); + } +- else if (This->flags & WINED3D_BUFFER_FLUSH) ++ else if (This->flags & WINED3D_BUFFER_APPLESYNC) + { + GL_EXTCALL(glFlushMappedBufferRangeAPPLE(This->buffer_type_hint, start, len)); + checkGLcall("glFlushMappedBufferRangeAPPLE"); +@@ -1112,7 +1109,7 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) + checkGLcall("glFlushMappedBufferRange"); + } + } +- else if (buffer->flags & WINED3D_BUFFER_FLUSH) ++ else if (buffer->flags & WINED3D_BUFFER_APPLESYNC) + { + for (i = 0; i < buffer->modified_areas; ++i) + { +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0077-wined3d-Add-cs-waiting-debug-code.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0077-wined3d-Add-cs-waiting-debug-code.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0077-wined3d-Add-cs-waiting-debug-code.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0077-wined3d-Add-cs-waiting-debug-code.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,31 @@ +From b41844b91cb9817f378c3c666b3129c3c870d014 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Jul 2013 20:40:39 +0200 +Subject: wined3d: Add cs waiting debug code + +--- + dlls/wined3d/texture.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index eb4996b..240e8fa 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -610,6 +610,14 @@ HRESULT CDECL wined3d_texture_set_color_key(struct wined3d_texture *texture, + return WINED3DERR_INVALIDCALL; + } + ++ /* ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("waiting for cs\n"); ++ texture->resource.device->cs->ops->finish(texture->resource.device->cs); ++ } ++ */ ++ + wined3d_cs_emit_set_color_key(device->cs, texture, flags, color_key); + + return WINED3D_OK; +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0077-wined3d-Send-render-target-view-clears-through-the-c.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0077-wined3d-Send-render-target-view-clears-through-the-c.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0077-wined3d-Send-render-target-view-clears-through-the-c.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0077-wined3d-Send-render-target-view-clears-through-the-c.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -From 793b7f174651b67263e170e1144b3c293eac651f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Jul 2013 21:10:16 +0200 -Subject: wined3d: Send render target view clears through the command stream - ---- - dlls/wined3d/cs.c | 36 ++++++++++++++++++++++++++++++++++++ - dlls/wined3d/device.c | 12 ++---------- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 40 insertions(+), 10 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index dcaedfd..366a4d3 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -74,6 +74,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SET_LIGHT, - WINED3D_CS_OP_SET_LIGHT_ENABLE, - WINED3D_CS_OP_BLT, -+ WINED3D_CS_OP_CLEAR_RTV, - WINED3D_CS_OP_STOP, - }; - -@@ -343,6 +344,14 @@ struct wined3d_cs_blt - enum wined3d_texture_filter_type filter; - }; - -+struct wined3d_cs_clear_rtv -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_rendertarget_view *view; -+ RECT rect; -+ struct wined3d_color color; -+}; -+ - /* FIXME: The list synchronization probably isn't particularly fast. */ - static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) - { -@@ -1652,6 +1661,32 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf - cs->ops->submit(cs); - } - -+static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_clear_rtv *op = data; -+ struct wined3d_resource *resource = op->view->resource; -+ -+ resource = wined3d_texture_get_sub_resource(wined3d_texture_from_resource(resource), op->view->sub_resource_idx); -+ -+ surface_color_fill(surface_from_resource(resource), &op->rect, &op->color); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, -+ const RECT *rect, const struct wined3d_color *color) -+{ -+ struct wined3d_cs_clear_rtv *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_CLEAR_RTV; -+ op->view = view; -+ op->rect = *rect; -+ op->color = *color; -+ -+ cs->ops->submit(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -@@ -1692,6 +1727,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, - /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, - /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, -+ /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, - }; - - static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 599a25d..b2e7ec3 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -3917,16 +3917,8 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi - rect = &r; - } - -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -- -- resource = wined3d_texture_get_sub_resource(wined3d_texture_from_resource(resource), view->sub_resource_idx); -- -- return surface_color_fill(surface_from_resource(resource), rect, color); -+ wined3d_cs_emit_clear_rtv(device->cs, view, rect, color); -+ return WINED3D_OK; - } - - struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 0d76377..e554099 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2638,6 +2638,8 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf - const RECT *dst_rect, struct wined3d_surface *src_surface, - const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, - 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; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0078-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0078-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0078-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0078-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,26 @@ +From 6464090c8161886fba8637324b7714d67accf7c9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Jul 2013 21:00:17 +0200 +Subject: wined3d: Don't force strict draw ordering for multithreaded CS + +Shouldn't be needed any more +--- + dlls/wined3d/wined3d_main.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c +index 5471e6e..e6dc444 100644 +--- a/dlls/wined3d/wined3d_main.c ++++ b/dlls/wined3d/wined3d_main.c +@@ -310,8 +310,6 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) + { + TRACE("Enabling multithreaded command stream.\n"); + wined3d_settings.cs_multithreaded = TRUE; +- TRACE("Enforcing strict draw ordering for multithreaded command stream.\n"); +- wined3d_settings.strict_draw_ordering = TRUE; + } + } + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0078-wined3d-Wait-for-the-CS-in-GetDC.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0078-wined3d-Wait-for-the-CS-in-GetDC.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0078-wined3d-Wait-for-the-CS-in-GetDC.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0078-wined3d-Wait-for-the-CS-in-GetDC.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -From 045f2277ef36b36927912fd153e251bc60ba290c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 26 Sep 2013 16:40:34 +0200 -Subject: wined3d: Wait for the CS in GetDC. - ---- - dlls/wined3d/surface.c | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 676200d..4d68292 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -2561,6 +2561,20 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - - TRACE("surface %p, dc %p.\n", surface, dc); - -+ if (!(surface->container->resource.format_flags & WINED3DFMT_FLAG_GETDC)) -+ { -+ WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->container->resource.format->id)); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ if (wined3d_settings.cs_multithreaded) -+ { -+ struct wined3d_device *device = surface->resource.device; -+ FIXME("Waiting for cs.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - /* Give more detailed info for ddraw. */ - if (surface->flags & SFLAG_DCINUSE) - return WINEDDERR_DCALREADYCREATED; --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0079-wined3d-Send-render-target-view-clears-through-the-c.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0079-wined3d-Send-render-target-view-clears-through-the-c.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0079-wined3d-Send-render-target-view-clears-through-the-c.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0079-wined3d-Send-render-target-view-clears-through-the-c.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,118 @@ +From 793b7f174651b67263e170e1144b3c293eac651f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Jul 2013 21:10:16 +0200 +Subject: wined3d: Send render target view clears through the command stream + +--- + dlls/wined3d/cs.c | 36 ++++++++++++++++++++++++++++++++++++ + dlls/wined3d/device.c | 12 ++---------- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 40 insertions(+), 10 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index dcaedfd..366a4d3 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -74,6 +74,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_SET_LIGHT, + WINED3D_CS_OP_SET_LIGHT_ENABLE, + WINED3D_CS_OP_BLT, ++ WINED3D_CS_OP_CLEAR_RTV, + WINED3D_CS_OP_STOP, + }; + +@@ -343,6 +344,14 @@ struct wined3d_cs_blt + enum wined3d_texture_filter_type filter; + }; + ++struct wined3d_cs_clear_rtv ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_rendertarget_view *view; ++ RECT rect; ++ struct wined3d_color color; ++}; ++ + /* FIXME: The list synchronization probably isn't particularly fast. */ + static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) + { +@@ -1652,6 +1661,32 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf + cs->ops->submit(cs); + } + ++static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_clear_rtv *op = data; ++ struct wined3d_resource *resource = op->view->resource; ++ ++ resource = wined3d_texture_get_sub_resource(wined3d_texture_from_resource(resource), op->view->sub_resource_idx); ++ ++ surface_color_fill(surface_from_resource(resource), &op->rect, &op->color); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, ++ const RECT *rect, const struct wined3d_color *color) ++{ ++ struct wined3d_cs_clear_rtv *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_CLEAR_RTV; ++ op->view = view; ++ op->rect = *rect; ++ op->color = *color; ++ ++ cs->ops->submit(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, +@@ -1692,6 +1727,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, + /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, + /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, ++ /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, + }; + + static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 599a25d..b2e7ec3 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -3917,16 +3917,8 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi + rect = &r; + } + +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } +- +- resource = wined3d_texture_get_sub_resource(wined3d_texture_from_resource(resource), view->sub_resource_idx); +- +- return surface_color_fill(surface_from_resource(resource), rect, color); ++ wined3d_cs_emit_clear_rtv(device->cs, view, rect, color); ++ return WINED3D_OK; + } + + struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 0d76377..e554099 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2638,6 +2638,8 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf + const RECT *dst_rect, struct wined3d_surface *src_surface, + const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, + 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; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0079-wined3d-send-resource-maps-through-the-command-strea.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0079-wined3d-send-resource-maps-through-the-command-strea.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0079-wined3d-send-resource-maps-through-the-command-strea.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0079-wined3d-send-resource-maps-through-the-command-strea.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,275 +0,0 @@ -From 872dc7c0c6fd6f54f1522bad4787fdd358eb69af Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 26 Sep 2013 16:41:00 +0200 -Subject: wined3d: send resource maps through the command stream - -Slow version only. Good enough to dodge some Nvidia bugs in the ddraw tests. ---- - dlls/wined3d/cs.c | 69 ++++++++++++++++++++++++++++++++++++ - dlls/wined3d/resource.c | 79 ++++++++++++++++++++++++------------------ - dlls/wined3d/wined3d_private.h | 5 +++ - 3 files changed, 120 insertions(+), 33 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 25d92a1..f920107 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -76,6 +76,8 @@ enum wined3d_cs_op - WINED3D_CS_OP_SET_LIGHT_ENABLE, - WINED3D_CS_OP_BLT, - WINED3D_CS_OP_CLEAR_RTV, -+ WINED3D_CS_OP_RESOURCE_MAP, -+ WINED3D_CS_OP_RESOURCE_UNMAP, - WINED3D_CS_OP_STOP, - }; - -@@ -362,6 +364,20 @@ struct wined3d_cs_clear_rtv - struct wined3d_color color; - }; - -+struct wined3d_cs_resource_map -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_resource *resource; -+ DWORD flags; -+ void **mem; -+}; -+ -+struct wined3d_cs_resource_unmap -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_resource *resource; -+}; -+ - /* FIXME: The list synchronization probably isn't particularly fast. */ - static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) - { -@@ -1800,6 +1816,57 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge - cs->ops->submit(cs); - } - -+static UINT wined3d_cs_exec_resource_map(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_resource_map *op = data; -+ -+ *op->mem = wined3d_resource_map_internal(op->resource, op->flags); -+ -+ return sizeof(*op); -+} -+ -+void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, -+ DWORD flags) -+{ -+ struct wined3d_cs_resource_map *op; -+ void *ret; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_RESOURCE_MAP; -+ op->resource = resource; -+ op->flags = flags; -+ op->mem = &ret; -+ -+ cs->ops->finish(cs); -+ -+ if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) -+ { -+ FIXME("Dynamic resource map is inefficient\n"); -+ } -+ return ret; -+} -+ -+static UINT wined3d_cs_exec_resource_unmap(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_resource_unmap *op = data; -+ struct wined3d_resource *resource = op->resource; -+ -+ wined3d_resource_unmap_internal(resource); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) -+{ -+ struct wined3d_cs_resource_unmap *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_RESOURCE_UNMAP; -+ op->resource = resource; -+ -+ cs->ops->submit(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -@@ -1842,6 +1909,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, - /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, - /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, -+ /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, -+ /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, - }; - - static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 39b7c32..083fd70 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -695,32 +695,11 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, - return TRUE; - } - --HRESULT wined3d_resource_map(struct wined3d_resource *resource, -- struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) -+void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD flags) - { - struct wined3d_device *device = resource->device; - struct wined3d_context *context = NULL; -- BYTE *base_memory; -- const struct wined3d_format *format = resource->format; -- const unsigned int fmt_flags = resource->format_flags; -- -- TRACE("resource %p, map_desc %p, box %p, flags %#x.\n", -- resource, map_desc, box, flags); -- -- if (resource->map_count) -- { -- WARN("Volume is already mapped.\n"); -- return WINED3DERR_INVALIDCALL; -- } -- -- flags = wined3d_resource_sanitize_map_flags(resource, flags); -- -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -+ void *mem; - - if (device->d3d_initialized) - context = context_acquire(device, NULL); -@@ -728,9 +707,8 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - if (!wined3d_resource_prepare_map_memory(resource, context)) - { - WARN("Out of memory.\n"); -- map_desc->data = NULL; - context_release(context); -- return E_OUTOFMEMORY; -+ return NULL; - } - - if (flags & WINED3D_MAP_DISCARD) -@@ -738,11 +716,40 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - else - wined3d_resource_load_location(resource, context, resource->map_binding); - -- base_memory = wined3d_resource_get_map_ptr(resource, context, flags); -+ mem = wined3d_resource_get_map_ptr(resource, context, flags); - - if (context) - context_release(context); - -+ return mem; -+} -+ -+HRESULT wined3d_resource_map(struct wined3d_resource *resource, -+ struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) -+{ -+ struct wined3d_device *device = resource->device; -+ BYTE *base_memory; -+ const struct wined3d_format *format = resource->format; -+ const unsigned int fmt_flags = resource->format_flags; -+ -+ TRACE("resource %p, map_desc %p, box %p, flags %#x.\n", -+ resource, map_desc, box, flags); -+ -+ if (resource->map_count) -+ { -+ WARN("Volume is already mapped.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ flags = wined3d_resource_sanitize_map_flags(resource, flags); -+ -+ base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); -+ if (!base_memory) -+ { -+ WARN("Map failed.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ - TRACE("Base memory pointer %p.\n", base_memory); - - if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) -@@ -794,10 +801,21 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - return WINED3D_OK; - } - --HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) -+void wined3d_resource_unmap_internal(struct wined3d_resource *resource) - { - struct wined3d_device *device = resource->device; - struct wined3d_context *context = NULL; -+ -+ if (device->d3d_initialized) -+ context = context_acquire(device, NULL); -+ wined3d_resource_release_map_ptr(resource, context); -+ if (context) -+ context_release(context); -+} -+ -+HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) -+{ -+ struct wined3d_device *device = resource->device; - TRACE("resource %p.\n", resource); - - if (!resource->map_count) -@@ -806,12 +824,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - return WINEDDERR_NOTLOCKED; - } - -- if (device->d3d_initialized) -- context = context_acquire(device, NULL); -- wined3d_resource_release_map_ptr(resource, context); -- if (context) -- context_release(context); -- -+ wined3d_cs_emit_resource_unmap(device->cs, resource); - resource->map_count--; - - return WINED3D_OK; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 26fb1cf..d2bfc21 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2193,6 +2193,7 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, - struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; - HRESULT wined3d_resource_map(struct wined3d_resource *resource, struct wined3d_map_desc *map_desc, - const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN; -+void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; - BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, - struct wined3d_context *context) DECLSPEC_HIDDEN; - BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -@@ -2200,6 +2201,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, - const struct wined3d_context *context) DECLSPEC_HIDDEN; - DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; - HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+void wined3d_resource_unmap_internal(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; - -@@ -2682,6 +2684,9 @@ 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; -+void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, -+ DWORD flags) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0080-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0080-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0080-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0080-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -From 907befb9104d166a5423d92c8aec0e8d6835bb92 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Jul 2013 22:59:33 +0200 -Subject: wined3d: Get rid of the end_scene flush and finish - -Either keep the patch this way, or send a flush through the CS. I'm not -sure it's worth it though, this has never had any real performance -impact. ---- - dlls/wined3d/device.c | 12 ------------ - 1 file changed, 12 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index b2e7ec3..cd90c76 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -3224,8 +3224,6 @@ HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device) - - HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) - { -- struct wined3d_context *context; -- - TRACE("device %p.\n", device); - - if (!device->inScene) -@@ -3234,16 +3232,6 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) - return WINED3DERR_INVALIDCALL; - } - -- context = context_acquire(device, NULL); -- /* We only have to do this if we need to read the, swapbuffers performs a flush for us */ -- if (wined3d_settings.cs_multithreaded) -- context->gl_info->gl_ops.gl.p_glFinish(); -- else -- context->gl_info->gl_ops.gl.p_glFlush(); -- /* No checkGLcall here to avoid locking the lock just for checking a call that hardly ever -- * fails. */ -- context_release(context); -- - device->inScene = FALSE; - return WINED3D_OK; - } --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0080-wined3d-Wait-for-the-CS-in-GetDC.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0080-wined3d-Wait-for-the-CS-in-GetDC.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0080-wined3d-Wait-for-the-CS-in-GetDC.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0080-wined3d-Wait-for-the-CS-in-GetDC.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,37 @@ +From 045f2277ef36b36927912fd153e251bc60ba290c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 26 Sep 2013 16:40:34 +0200 +Subject: wined3d: Wait for the CS in GetDC. + +--- + dlls/wined3d/surface.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 676200d..4d68292 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -2561,6 +2561,20 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) + + TRACE("surface %p, dc %p.\n", surface, dc); + ++ if (!(surface->container->resource.format_flags & WINED3DFMT_FLAG_GETDC)) ++ { ++ WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->container->resource.format->id)); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ if (wined3d_settings.cs_multithreaded) ++ { ++ struct wined3d_device *device = surface->resource.device; ++ FIXME("Waiting for cs.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + /* Give more detailed info for ddraw. */ + if (surface->flags & SFLAG_DCINUSE) + return WINEDDERR_DCALREADYCREATED; +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0081-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0081-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0081-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0081-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,852 +0,0 @@ -From c115a25b8aba4ade5fa04cfb469b030eb29b941a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Jul 2013 23:33:14 +0200 -Subject: wined3d: Replace the linked lists with a ringbuffer - ---- - dlls/wined3d/cs.c | 362 ++++++++++++++++++----------------------- - dlls/wined3d/wined3d_private.h | 20 +-- - 2 files changed, 162 insertions(+), 220 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 6204e57..66c784b 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -22,20 +22,10 @@ - - WINE_DEFAULT_DEBUG_CHANNEL(d3d); - --#define WINED3D_INITIAL_CS_SIZE 4096 -- --static CRITICAL_SECTION wined3d_cs_list_mutex; --static CRITICAL_SECTION_DEBUG wined3d_cs_list_mutex_debug = --{ -- 0, 0, &wined3d_cs_list_mutex, -- {&wined3d_cs_list_mutex_debug.ProcessLocksList, -- &wined3d_cs_list_mutex_debug.ProcessLocksList}, -- 0, 0, {(DWORD_PTR)(__FILE__ ": wined3d_cs_list_mutex")} --}; --static CRITICAL_SECTION wined3d_cs_list_mutex = {&wined3d_cs_list_mutex_debug, -1, 0, 0, 0, 0}; -- - enum wined3d_cs_op - { -+ WINED3D_CS_OP_NOP, -+ WINED3D_CS_OP_SKIP, - WINED3D_CS_OP_FENCE, - WINED3D_CS_OP_PRESENT, - WINED3D_CS_OP_CLEAR, -@@ -378,99 +368,30 @@ struct wined3d_cs_resource_unmap - struct wined3d_resource *resource; - }; - --/* FIXME: The list synchronization probably isn't particularly fast. */ --static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) --{ -- EnterCriticalSection(&wined3d_cs_list_mutex); -- list_add_tail(&list->blocks, &block->entry); -- LeaveCriticalSection(&wined3d_cs_list_mutex); --} -- --static struct wined3d_cs_block *wined3d_cs_list_dequeue(struct wined3d_cs_list *list) --{ -- struct list *head; -- -- EnterCriticalSection(&wined3d_cs_list_mutex); -- if (!(head = list_head(&list->blocks))) -- { -- LeaveCriticalSection(&wined3d_cs_list_mutex); -- return NULL; -- } -- list_remove(head); -- LeaveCriticalSection(&wined3d_cs_list_mutex); -- -- return LIST_ENTRY(head, struct wined3d_cs_block, entry); --} -- --static struct wined3d_cs_block *wined3d_cs_list_dequeue_blocking(struct wined3d_cs_list *list) --{ -- struct wined3d_cs_block *block; -- -- /* FIXME: Use an event to wait after a couple of spins. */ -- for (;;) -- { -- if ((block = wined3d_cs_list_dequeue(list))) -- return block; -- } --} -- --static void wined3d_cs_list_init(struct wined3d_cs_list *list) --{ -- list_init(&list->blocks); --} -- --static struct wined3d_cs_block *wined3d_cs_get_thread_block(const struct wined3d_cs *cs) --{ -- return TlsGetValue(cs->tls_idx); --} -- --static void wined3d_cs_set_thread_block(const struct wined3d_cs *cs, struct wined3d_cs_block *block) -+struct wined3d_cs_skip - { -- if (!TlsSetValue(cs->tls_idx, block)) -- ERR("Failed to set thread block.\n"); --} -+ enum wined3d_cs_op opcode; -+ DWORD size; -+}; - --static void wined3d_cs_flush(struct wined3d_cs *cs) -+static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) - { -- wined3d_cs_list_enqueue(&cs->exec_list, wined3d_cs_get_thread_block(cs)); -- wined3d_cs_set_thread_block(cs, NULL); -+ LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -+ /* There is only one thread writing to queue.head, InterlockedExchange -+ * is used for the memory barrier. */ -+ InterlockedExchange(&cs->queue.head, new_val); - } - --static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs) -+static UINT wined3d_cs_exec_nop(struct wined3d_cs *cs, const void *data) - { -- struct wined3d_cs_block *block; -- -- if (!(block = wined3d_cs_list_dequeue(&cs->free_list))) -- { -- if (!(block = HeapAlloc(GetProcessHeap(), 0, sizeof(*block)))) -- { -- ERR("Failed to get new block.\n"); -- return NULL; -- } -- } -- -- block->pos = 0; -- -- return block; -+ return sizeof(enum wined3d_cs_op); - } - --static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) -+static UINT wined3d_cs_exec_skip(struct wined3d_cs *cs, const void *data) - { -- struct wined3d_cs_block *block = wined3d_cs_get_thread_block(cs); -- void *data; -- -- if (!block || block->pos + size > sizeof(block->data)) -- { -- if (block) -- wined3d_cs_flush(cs); -- block = wined3d_cs_get_block(cs); -- wined3d_cs_set_thread_block(cs, block); -- } -+ const struct wined3d_cs_skip *op = data; - -- data = &block->data[block->pos]; -- block->pos += size; -- -- return data; -+ return op->size; - } - - static UINT wined3d_cs_exec_fence(struct wined3d_cs *cs, const void *data) -@@ -491,14 +412,14 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled) - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_FENCE; - op->signalled = signalled; -+ cs->ops->submit(cs, sizeof(*op)); - } - --static void wined3d_cs_flush_and_wait(struct wined3d_cs *cs) -+static void wined3d_cs_finish(struct wined3d_cs *cs) - { - BOOL fence; - - wined3d_cs_emit_fence(cs, &fence); -- wined3d_cs_flush(cs); - - /* A busy wait should be fine, we're not supposed to have to wait very - * long. */ -@@ -556,7 +477,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw - - pending = InterlockedIncrement(&cs->pending_presents); - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - - while (pending > 1) - pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0); -@@ -583,8 +504,9 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * - { - struct wined3d_cs_clear *op; - unsigned int extra_rects = rect_count ? rect_count - 1 : 0; -+ size_t size = sizeof(*op) + sizeof(*op->rects) * extra_rects; - -- op = cs->ops->require_space(cs, sizeof(*op) + sizeof(*op->rects) * extra_rects); -+ op = cs->ops->require_space(cs, size); - op->opcode = WINED3D_CS_OP_CLEAR; - op->rect_count = rect_count; - if (rect_count) -@@ -594,7 +516,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * - op->depth = depth; - op->stencil = stencil; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, size); - } - - static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) -@@ -635,7 +557,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun - op->instance_count = instance_count; - op->indexed = indexed; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data) -@@ -657,7 +579,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query - op->predicate = predicate; - op->value = value; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data) -@@ -679,7 +601,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi - op->opcode = WINED3D_CS_OP_SET_VIEWPORT; - op->viewport = *viewport; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data) -@@ -700,7 +622,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) - op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT; - op->rect = *rect; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data) -@@ -723,7 +645,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v - op->view_idx = view_idx; - op->view = view; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data) -@@ -776,7 +698,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 - op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW; - op->view = view; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data) -@@ -797,7 +719,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 - op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION; - op->declaration = declaration; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data) -@@ -834,7 +756,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, - op->offset = offset; - op->stride = stride; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data) -@@ -861,7 +783,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i - op->frequency = frequency; - op->flags = flags; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data) -@@ -894,7 +816,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, - op->buffer = buffer; - op->offset = offset; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data) -@@ -926,7 +848,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff - op->buffer = buffer; - op->format_id = format_id; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data) -@@ -957,7 +879,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha - op->cb_idx = cb_idx; - op->buffer = buffer; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) -@@ -1032,7 +954,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined - op->opcode = WINED3D_CS_OP_SET_TEXTURE; - op->stage = stage; - op->texture = texture; -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data) -@@ -1056,7 +978,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 - op->view_idx = view_idx; - op->view = view; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) -@@ -1080,7 +1002,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type - op->sampler_idx = sampler_idx; - op->sampler = sampler; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) -@@ -1102,6 +1024,8 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type - op->opcode = WINED3D_CS_OP_SET_SHADER; - op->type = type; - op->shader = shader; -+ -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_vs_consts_f(struct wined3d_cs *cs, const void *data) -@@ -1137,8 +1061,9 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, - { - struct wined3d_cs_set_consts_f *op; - UINT extra_space = vector4f_count - 1; -+ size_t size = sizeof(*op) + sizeof(op->constants) * extra_space; - -- op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space); -+ op = cs->ops->require_space(cs, size); - switch (type) - { - case WINED3D_SHADER_TYPE_PIXEL: -@@ -1160,7 +1085,7 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, - op->vector4f_count = vector4f_count; - memcpy(op->constants, constants, sizeof(*constants) * 4 * vector4f_count); - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, size); - } - - static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data) -@@ -1182,8 +1107,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render - op->state = state; - op->value = value; - -- cs->ops->submit(cs); --}; -+ cs->ops->submit(cs, sizeof(*op)); -+} - - static UINT wined3d_cs_exec_set_vs_consts_b(struct wined3d_cs *cs, const void *data) - { -@@ -1216,8 +1141,9 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, - { - struct wined3d_cs_set_consts_b *op; - UINT extra_space = bool_count - 1; -+ size_t size = sizeof(*op) + sizeof(op->constants) * extra_space; - -- op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space); -+ op = cs->ops->require_space(cs, size); - switch (type) - { - case WINED3D_SHADER_TYPE_PIXEL: -@@ -1239,7 +1165,7 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, - op->bool_count = bool_count; - memcpy(op->constants, constants, sizeof(op->constants) * bool_count); - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, size); - } - - static UINT wined3d_cs_exec_set_vs_consts_i(struct wined3d_cs *cs, const void *data) -@@ -1273,8 +1199,9 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, UINT start_register, - { - struct wined3d_cs_set_consts_i *op; - UINT extra_space = vector4i_count - 1; -+ size_t size = sizeof(*op) + sizeof(op->constants) * extra_space; - -- op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space); -+ op = cs->ops->require_space(cs, size); - switch (type) - { - case WINED3D_SHADER_TYPE_PIXEL: -@@ -1296,7 +1223,7 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, UINT start_register, - op->vector4i_count = vector4i_count; - memcpy(op->constants, constants, sizeof(op->constants) * vector4i_count); - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, size); - } - - static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) -@@ -1320,7 +1247,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, - op->state = state; - op->value = value; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data) -@@ -1344,7 +1271,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, - op->state = state; - op->value = value; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data) -@@ -1368,7 +1295,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform - op->state = state; - op->matrix = *matrix; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data) -@@ -1390,7 +1317,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const - op->plane_idx = plane_idx; - op->plane = *plane; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data) -@@ -1468,7 +1395,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture - else - op->set = 0; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data) -@@ -1489,7 +1416,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma - op->opcode = WINED3D_CS_OP_SET_MATERIAL; - op->material = *material; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) -@@ -1513,7 +1440,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_RESET_STATE; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) -@@ -1539,7 +1466,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_GLFINISH; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_base_vertex_index(struct wined3d_cs *cs, const void *data) -@@ -1561,7 +1488,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, - op->opcode = WINED3D_CS_OP_SET_BASE_VERTEX_INDEX; - op->base_vertex_index = base_vertex_index; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data) -@@ -1587,7 +1514,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ - op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE; - op->gl_primitive_type = primitive_type; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) -@@ -1644,7 +1571,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light - op->opcode = WINED3D_CS_OP_SET_LIGHT; - op->light = *light; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) -@@ -1733,7 +1660,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab - op->idx = idx; - op->enable = enable; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) -@@ -1765,7 +1692,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf - if (fx) - op->fx = *fx; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data) -@@ -1791,7 +1718,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge - op->rect = *rect; - op->color = *color; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_resource_map(struct wined3d_cs *cs, const void *data) -@@ -1815,12 +1742,14 @@ void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resourc - op->flags = flags; - op->mem = &ret; - -- cs->ops->finish(cs); -+ cs->ops->submit(cs, sizeof(*op)); - - if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) - { - FIXME("Dynamic resource map is inefficient\n"); - } -+ cs->ops->finish(cs); -+ - return ret; - } - -@@ -1842,11 +1771,13 @@ void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resour - op->opcode = WINED3D_CS_OP_RESOURCE_UNMAP; - op->resource = resource; - -- cs->ops->submit(cs); -+ cs->ops->submit(cs, sizeof(*op)); - } - - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { -+ /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -+ /* WINED3D_CS_OP_SKIP */ wined3d_cs_exec_skip, - /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, - /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, - /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, -@@ -1891,42 +1822,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, - }; - --static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -+static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) - { -- if (size > cs->data_size) -+ struct wined3d_cs_queue *queue = &cs->queue; -+ size_t queue_size = sizeof(queue->data) / sizeof(*queue->data); -+ -+ if (queue_size - size < queue->head) - { -- void *new_data; -+ struct wined3d_cs_skip *skip; -+ size_t nop_size = queue_size - queue->head; - -- size = max( size, cs->data_size * 2 ); -- if (!(new_data = HeapReAlloc(GetProcessHeap(), 0, cs->data, size))) -- return NULL; -+ skip = wined3d_cs_mt_require_space(cs, nop_size); -+ if (nop_size < sizeof(*skip)) -+ { -+ skip->opcode = WINED3D_CS_OP_NOP; -+ } -+ else -+ { -+ skip->opcode = WINED3D_CS_OP_SKIP; -+ skip->size = nop_size; -+ } - -- cs->data_size = size; -- cs->data = new_data; -+ cs->ops->submit(cs, nop_size); -+ assert(!queue->head); - } - -- return cs->data; --} -+ while(1) -+ { -+ LONG head = queue->head; -+ LONG tail = *((volatile LONG *)&queue->tail); -+ LONG new_pos; -+ /* Empty */ -+ if (head == tail) -+ break; -+ /* Head ahead of tail, take care of wrap-around */ -+ new_pos = (head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -+ if (head > tail && (new_pos || tail)) -+ break; -+ /* Tail ahead of head, but still enough space */ -+ if (new_pos < tail && new_pos) -+ break; - --static void wined3d_cs_st_submit(struct wined3d_cs *cs) --{ -- enum wined3d_cs_op opcode = *(const enum wined3d_cs_op *)cs->data; -+ TRACE("Waiting for free space. Head %u, tail %u, want %u\n", head, tail, -+ (unsigned int) size); -+ } - -- wined3d_cs_op_handlers[opcode](cs, cs->data); -+ return &queue->data[queue->head]; - } - --static const struct wined3d_cs_ops wined3d_cs_st_ops = --{ -- wined3d_cs_st_require_space, -- wined3d_cs_st_submit, -- wined3d_cs_st_submit, --}; -- - static const struct wined3d_cs_ops wined3d_cs_mt_ops = - { - wined3d_cs_mt_require_space, -- wined3d_cs_flush, -- wined3d_cs_flush_and_wait, -+ wined3d_cs_submit, -+ wined3d_cs_finish, - }; - - /* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an -@@ -1938,9 +1886,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs) - op = wined3d_cs_mt_require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_STOP; - -- wined3d_cs_flush(cs); -+ wined3d_cs_submit(cs, sizeof(*op)); -+} -+ -+static void wined3d_cs_st_submit(struct wined3d_cs *cs, size_t size) -+{ -+ enum wined3d_cs_op opcode = *(const enum wined3d_cs_op *)&cs->queue.data; -+ -+ if (opcode >= WINED3D_CS_OP_STOP) -+ { -+ ERR("Invalid opcode %#x.\n", opcode); -+ return; -+ } -+ -+ wined3d_cs_op_handlers[opcode](cs, &cs->queue.data); - } - -+static void wined3d_cs_st_finish(struct wined3d_cs *cs) -+{ -+} -+ -+static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -+{ -+ return cs->queue.data; -+} -+ -+static const struct wined3d_cs_ops wined3d_cs_st_ops = -+{ -+ wined3d_cs_st_require_space, -+ wined3d_cs_st_submit, -+ wined3d_cs_st_finish, -+}; -+ - void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, - struct wined3d_context *context, struct wined3d_surface *depth_stencil) - { -@@ -1960,31 +1937,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, - static DWORD WINAPI wined3d_cs_run(void *thread_param) - { - struct wined3d_cs *cs = thread_param; -+ enum wined3d_cs_op opcode; -+ LONG tail; - - TRACE("Started.\n"); - - cs->thread_id = GetCurrentThreadId(); - for (;;) - { -- struct wined3d_cs_block *block; -- UINT pos = 0; -- -- block = wined3d_cs_list_dequeue_blocking(&cs->exec_list); -- while (pos < block->pos) -+ if (*((volatile LONG *)&cs->queue.head) == cs->queue.tail) - { -- enum wined3d_cs_op opcode = *(const enum wined3d_cs_op *)&block->data[pos]; -+ continue; -+ } - -- if (opcode >= WINED3D_CS_OP_STOP) -- { -- if (opcode > WINED3D_CS_OP_STOP) -- ERR("Invalid opcode %#x.\n", opcode); -- goto done; -- } -+ tail = cs->queue.tail; -+ opcode = *(const enum wined3d_cs_op *)&cs->queue.data[tail]; - -- pos += wined3d_cs_op_handlers[opcode](cs, &block->data[pos]); -+ if (opcode >= WINED3D_CS_OP_STOP) -+ { -+ if (opcode > WINED3D_CS_OP_STOP) -+ ERR("Invalid opcode %#x.\n", opcode); -+ goto done; - } - -- wined3d_cs_list_enqueue(&cs->free_list, block); -+ tail += wined3d_cs_op_handlers[opcode](cs, &cs->queue.data[tail]); -+ tail &= (WINED3D_CS_QUEUE_SIZE - 1); -+ InterlockedExchange(&cs->queue.tail, tail); - } - - done: -@@ -2009,25 +1987,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) - cs->ops = &wined3d_cs_st_ops; - cs->device = device; - -- cs->data_size = WINED3D_INITIAL_CS_SIZE; -- if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size))) -- { -- goto err; -- } -- -- if ((cs->tls_idx = TlsAlloc()) == TLS_OUT_OF_INDEXES) -- { -- ERR("Failed to allocate cs TLS index, err %#x.\n", GetLastError()); -- goto err; -- } -- - if (wined3d_settings.cs_multithreaded) - { - cs->ops = &wined3d_cs_mt_ops; - -- wined3d_cs_list_init(&cs->free_list); -- wined3d_cs_list_init(&cs->exec_list); -- - if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL))) - { - ERR("Failed to create wined3d command stream thread.\n"); -@@ -2039,12 +2002,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) - - err: - if (cs) -- { - state_cleanup(&cs->state); -- if (cs->tls_idx != TLS_OUT_OF_INDEXES && !TlsFree(cs->tls_idx)) -- ERR("Failed to free cs TLS index, err %#x.\n", GetLastError()); -- HeapFree(GetProcessHeap(), 0, cs->data); -- } - HeapFree(GetProcessHeap(), 0, cs); - return NULL; - } -@@ -2063,17 +2021,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) - CloseHandle(cs->thread); - if (ret != WAIT_OBJECT_0) - ERR("Wait failed (%#x).\n", ret); -- -- /* FIXME: Cleanup the block lists on thread exit. */ --#if 0 -- wined3d_cs_list_cleanup(&cs->exec_list); -- wined3d_cs_list_cleanup(&cs->free_list); --#endif - } - -- if (!TlsFree(cs->tls_idx)) -- ERR("Failed to free cs TLS index, err %#x.\n", GetLastError()); -- -- HeapFree(GetProcessHeap(), 0, cs->data); - HeapFree(GetProcessHeap(), 0, cs); - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ed4d94b..35384e1 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -31,6 +31,7 @@ - #define WINE_GLAPI - #endif - -+#include - #include - #include - #include -@@ -2584,19 +2585,17 @@ struct wined3d_cs_list - struct list blocks; - }; - --struct wined3d_cs_block -+#define WINED3D_CS_QUEUE_SIZE 0x100000 -+struct wined3d_cs_queue - { -- struct list entry; -- UINT pos; -- /* FIXME? The size is somewhat arbitrary. It's big enough for huge -- * shader constant set calls though */ -- BYTE data[sizeof(float) * 4 * 256 * 2]; -+ LONG head, tail; -+ BYTE data[WINED3D_CS_QUEUE_SIZE]; - }; - - struct wined3d_cs_ops - { - void *(*require_space)(struct wined3d_cs *cs, size_t size); -- void (*submit)(struct wined3d_cs *cs); -+ void (*submit)(struct wined3d_cs *cs, size_t size); - void (*finish)(struct wined3d_cs *cs); - }; - -@@ -2607,14 +2606,9 @@ struct wined3d_cs - struct wined3d_state state; - HANDLE thread; - DWORD thread_id; -- DWORD tls_idx; - struct wined3d_surface *onscreen_depth_stencil; - -- size_t data_size; -- void *data; -- -- struct wined3d_cs_list free_list; -- struct wined3d_cs_list exec_list; -+ struct wined3d_cs_queue queue; - - LONG pending_presents; - }; --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0081-wined3d-send-resource-maps-through-the-command-strea.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0081-wined3d-send-resource-maps-through-the-command-strea.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0081-wined3d-send-resource-maps-through-the-command-strea.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0081-wined3d-send-resource-maps-through-the-command-strea.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,275 @@ +From 872dc7c0c6fd6f54f1522bad4787fdd358eb69af Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 26 Sep 2013 16:41:00 +0200 +Subject: wined3d: send resource maps through the command stream + +Slow version only. Good enough to dodge some Nvidia bugs in the ddraw tests. +--- + dlls/wined3d/cs.c | 69 ++++++++++++++++++++++++++++++++++++ + dlls/wined3d/resource.c | 79 ++++++++++++++++++++++++------------------ + dlls/wined3d/wined3d_private.h | 5 +++ + 3 files changed, 120 insertions(+), 33 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 25d92a1..f920107 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -76,6 +76,8 @@ enum wined3d_cs_op + WINED3D_CS_OP_SET_LIGHT_ENABLE, + WINED3D_CS_OP_BLT, + WINED3D_CS_OP_CLEAR_RTV, ++ WINED3D_CS_OP_RESOURCE_MAP, ++ WINED3D_CS_OP_RESOURCE_UNMAP, + WINED3D_CS_OP_STOP, + }; + +@@ -362,6 +364,20 @@ struct wined3d_cs_clear_rtv + struct wined3d_color color; + }; + ++struct wined3d_cs_resource_map ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_resource *resource; ++ DWORD flags; ++ void **mem; ++}; ++ ++struct wined3d_cs_resource_unmap ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_resource *resource; ++}; ++ + /* FIXME: The list synchronization probably isn't particularly fast. */ + static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) + { +@@ -1800,6 +1816,57 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge + cs->ops->submit(cs); + } + ++static UINT wined3d_cs_exec_resource_map(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_resource_map *op = data; ++ ++ *op->mem = wined3d_resource_map_internal(op->resource, op->flags); ++ ++ return sizeof(*op); ++} ++ ++void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, ++ DWORD flags) ++{ ++ struct wined3d_cs_resource_map *op; ++ void *ret; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_RESOURCE_MAP; ++ op->resource = resource; ++ op->flags = flags; ++ op->mem = &ret; ++ ++ cs->ops->finish(cs); ++ ++ if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) ++ { ++ FIXME("Dynamic resource map is inefficient\n"); ++ } ++ return ret; ++} ++ ++static UINT wined3d_cs_exec_resource_unmap(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_resource_unmap *op = data; ++ struct wined3d_resource *resource = op->resource; ++ ++ wined3d_resource_unmap_internal(resource); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) ++{ ++ struct wined3d_cs_resource_unmap *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_RESOURCE_UNMAP; ++ op->resource = resource; ++ ++ cs->ops->submit(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, +@@ -1842,6 +1909,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, + /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, + /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, ++ /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, ++ /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, + }; + + static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 39b7c32..083fd70 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -695,32 +695,11 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, + return TRUE; + } + +-HRESULT wined3d_resource_map(struct wined3d_resource *resource, +- struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) ++void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD flags) + { + struct wined3d_device *device = resource->device; + struct wined3d_context *context = NULL; +- BYTE *base_memory; +- const struct wined3d_format *format = resource->format; +- const unsigned int fmt_flags = resource->format_flags; +- +- TRACE("resource %p, map_desc %p, box %p, flags %#x.\n", +- resource, map_desc, box, flags); +- +- if (resource->map_count) +- { +- WARN("Volume is already mapped.\n"); +- return WINED3DERR_INVALIDCALL; +- } +- +- flags = wined3d_resource_sanitize_map_flags(resource, flags); +- +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } ++ void *mem; + + if (device->d3d_initialized) + context = context_acquire(device, NULL); +@@ -728,9 +707,8 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + if (!wined3d_resource_prepare_map_memory(resource, context)) + { + WARN("Out of memory.\n"); +- map_desc->data = NULL; + context_release(context); +- return E_OUTOFMEMORY; ++ return NULL; + } + + if (flags & WINED3D_MAP_DISCARD) +@@ -738,11 +716,40 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + else + wined3d_resource_load_location(resource, context, resource->map_binding); + +- base_memory = wined3d_resource_get_map_ptr(resource, context, flags); ++ mem = wined3d_resource_get_map_ptr(resource, context, flags); + + if (context) + context_release(context); + ++ return mem; ++} ++ ++HRESULT wined3d_resource_map(struct wined3d_resource *resource, ++ struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) ++{ ++ struct wined3d_device *device = resource->device; ++ BYTE *base_memory; ++ const struct wined3d_format *format = resource->format; ++ const unsigned int fmt_flags = resource->format_flags; ++ ++ TRACE("resource %p, map_desc %p, box %p, flags %#x.\n", ++ resource, map_desc, box, flags); ++ ++ if (resource->map_count) ++ { ++ WARN("Volume is already mapped.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ flags = wined3d_resource_sanitize_map_flags(resource, flags); ++ ++ base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); ++ if (!base_memory) ++ { ++ WARN("Map failed.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ + TRACE("Base memory pointer %p.\n", base_memory); + + if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) +@@ -794,10 +801,21 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + return WINED3D_OK; + } + +-HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) ++void wined3d_resource_unmap_internal(struct wined3d_resource *resource) + { + struct wined3d_device *device = resource->device; + struct wined3d_context *context = NULL; ++ ++ if (device->d3d_initialized) ++ context = context_acquire(device, NULL); ++ wined3d_resource_release_map_ptr(resource, context); ++ if (context) ++ context_release(context); ++} ++ ++HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) ++{ ++ struct wined3d_device *device = resource->device; + TRACE("resource %p.\n", resource); + + if (!resource->map_count) +@@ -806,12 +824,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + return WINEDDERR_NOTLOCKED; + } + +- if (device->d3d_initialized) +- context = context_acquire(device, NULL); +- wined3d_resource_release_map_ptr(resource, context); +- if (context) +- context_release(context); +- ++ wined3d_cs_emit_resource_unmap(device->cs, resource); + resource->map_count--; + + return WINED3D_OK; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 26fb1cf..d2bfc21 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2193,6 +2193,7 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, + struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; + HRESULT wined3d_resource_map(struct wined3d_resource *resource, struct wined3d_map_desc *map_desc, + const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN; ++void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; + BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, + struct wined3d_context *context) DECLSPEC_HIDDEN; + BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) DECLSPEC_HIDDEN; +@@ -2200,6 +2201,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, + const struct wined3d_context *context) DECLSPEC_HIDDEN; + DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; + HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_resource_unmap_internal(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; + +@@ -2682,6 +2684,9 @@ 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; ++void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, ++ DWORD flags) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0082-wined3d-Don-t-preload-buffers-on-unmap.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0082-wined3d-Don-t-preload-buffers-on-unmap.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0082-wined3d-Don-t-preload-buffers-on-unmap.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0082-wined3d-Don-t-preload-buffers-on-unmap.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -From 0603f71135885ebf0666d406380385936ed5ff7b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Jul 2013 23:40:56 +0200 -Subject: wined3d: Don't preload buffers on unmap - ---- - dlls/wined3d/buffer.c | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 5544640..b76a07d 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1129,10 +1129,6 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) - buffer_clear_dirty_areas(buffer); - buffer->map_ptr = NULL; - } -- else if (buffer->flags & WINED3D_BUFFER_HASDESC) -- { -- wined3d_buffer_preload(buffer); -- } - } - - static ULONG buffer_resource_incref(struct wined3d_resource *resource) --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0082-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0082-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0082-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0082-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,45 @@ +From 907befb9104d166a5423d92c8aec0e8d6835bb92 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Jul 2013 22:59:33 +0200 +Subject: wined3d: Get rid of the end_scene flush and finish + +Either keep the patch this way, or send a flush through the CS. I'm not +sure it's worth it though, this has never had any real performance +impact. +--- + dlls/wined3d/device.c | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index b2e7ec3..cd90c76 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -3224,8 +3224,6 @@ HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device) + + HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) + { +- struct wined3d_context *context; +- + TRACE("device %p.\n", device); + + if (!device->inScene) +@@ -3234,16 +3232,6 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) + return WINED3DERR_INVALIDCALL; + } + +- context = context_acquire(device, NULL); +- /* We only have to do this if we need to read the, swapbuffers performs a flush for us */ +- if (wined3d_settings.cs_multithreaded) +- context->gl_info->gl_ops.gl.p_glFinish(); +- else +- context->gl_info->gl_ops.gl.p_glFlush(); +- /* No checkGLcall here to avoid locking the lock just for checking a call that hardly ever +- * fails. */ +- context_release(context); +- + device->inScene = FALSE; + return WINED3D_OK; + } +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0083-wined3d-Don-t-call-glFinish-before-swapping.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0083-wined3d-Don-t-call-glFinish-before-swapping.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0083-wined3d-Don-t-call-glFinish-before-swapping.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0083-wined3d-Don-t-call-glFinish-before-swapping.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From 808198079459086ac70236bacaacd85aa717f7ff Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Jul 2013 23:50:20 +0200 -Subject: wined3d: Don't call glFinish before swapping - -The code is probably not ready yet, so delay this patch until everything -is CSified. Right now I need it for performance testing. ---- - dlls/wined3d/swapchain.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index fa0c241..7ebdd1b 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -531,9 +531,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - swapchain_blit(swapchain, context, &src_rect, &dst_rect); - } - -- if (wined3d_settings.cs_multithreaded) -- gl_info->gl_ops.gl.p_glFinish(); -- else if (swapchain->num_contexts > 1) -+ if (swapchain->num_contexts > 1 && !wined3d_settings.cs_multithreaded) - gl_info->gl_ops.gl.p_glFlush(); - - /* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */ --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0083-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0083-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0083-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0083-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,852 @@ +From c115a25b8aba4ade5fa04cfb469b030eb29b941a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Jul 2013 23:33:14 +0200 +Subject: wined3d: Replace the linked lists with a ringbuffer + +--- + dlls/wined3d/cs.c | 362 ++++++++++++++++++----------------------- + dlls/wined3d/wined3d_private.h | 20 +-- + 2 files changed, 162 insertions(+), 220 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 6204e57..66c784b 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -22,20 +22,10 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(d3d); + +-#define WINED3D_INITIAL_CS_SIZE 4096 +- +-static CRITICAL_SECTION wined3d_cs_list_mutex; +-static CRITICAL_SECTION_DEBUG wined3d_cs_list_mutex_debug = +-{ +- 0, 0, &wined3d_cs_list_mutex, +- {&wined3d_cs_list_mutex_debug.ProcessLocksList, +- &wined3d_cs_list_mutex_debug.ProcessLocksList}, +- 0, 0, {(DWORD_PTR)(__FILE__ ": wined3d_cs_list_mutex")} +-}; +-static CRITICAL_SECTION wined3d_cs_list_mutex = {&wined3d_cs_list_mutex_debug, -1, 0, 0, 0, 0}; +- + enum wined3d_cs_op + { ++ WINED3D_CS_OP_NOP, ++ WINED3D_CS_OP_SKIP, + WINED3D_CS_OP_FENCE, + WINED3D_CS_OP_PRESENT, + WINED3D_CS_OP_CLEAR, +@@ -378,99 +368,30 @@ struct wined3d_cs_resource_unmap + struct wined3d_resource *resource; + }; + +-/* FIXME: The list synchronization probably isn't particularly fast. */ +-static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) +-{ +- EnterCriticalSection(&wined3d_cs_list_mutex); +- list_add_tail(&list->blocks, &block->entry); +- LeaveCriticalSection(&wined3d_cs_list_mutex); +-} +- +-static struct wined3d_cs_block *wined3d_cs_list_dequeue(struct wined3d_cs_list *list) +-{ +- struct list *head; +- +- EnterCriticalSection(&wined3d_cs_list_mutex); +- if (!(head = list_head(&list->blocks))) +- { +- LeaveCriticalSection(&wined3d_cs_list_mutex); +- return NULL; +- } +- list_remove(head); +- LeaveCriticalSection(&wined3d_cs_list_mutex); +- +- return LIST_ENTRY(head, struct wined3d_cs_block, entry); +-} +- +-static struct wined3d_cs_block *wined3d_cs_list_dequeue_blocking(struct wined3d_cs_list *list) +-{ +- struct wined3d_cs_block *block; +- +- /* FIXME: Use an event to wait after a couple of spins. */ +- for (;;) +- { +- if ((block = wined3d_cs_list_dequeue(list))) +- return block; +- } +-} +- +-static void wined3d_cs_list_init(struct wined3d_cs_list *list) +-{ +- list_init(&list->blocks); +-} +- +-static struct wined3d_cs_block *wined3d_cs_get_thread_block(const struct wined3d_cs *cs) +-{ +- return TlsGetValue(cs->tls_idx); +-} +- +-static void wined3d_cs_set_thread_block(const struct wined3d_cs *cs, struct wined3d_cs_block *block) ++struct wined3d_cs_skip + { +- if (!TlsSetValue(cs->tls_idx, block)) +- ERR("Failed to set thread block.\n"); +-} ++ enum wined3d_cs_op opcode; ++ DWORD size; ++}; + +-static void wined3d_cs_flush(struct wined3d_cs *cs) ++static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) + { +- wined3d_cs_list_enqueue(&cs->exec_list, wined3d_cs_get_thread_block(cs)); +- wined3d_cs_set_thread_block(cs, NULL); ++ LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); ++ /* There is only one thread writing to queue.head, InterlockedExchange ++ * is used for the memory barrier. */ ++ InterlockedExchange(&cs->queue.head, new_val); + } + +-static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs) ++static UINT wined3d_cs_exec_nop(struct wined3d_cs *cs, const void *data) + { +- struct wined3d_cs_block *block; +- +- if (!(block = wined3d_cs_list_dequeue(&cs->free_list))) +- { +- if (!(block = HeapAlloc(GetProcessHeap(), 0, sizeof(*block)))) +- { +- ERR("Failed to get new block.\n"); +- return NULL; +- } +- } +- +- block->pos = 0; +- +- return block; ++ return sizeof(enum wined3d_cs_op); + } + +-static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) ++static UINT wined3d_cs_exec_skip(struct wined3d_cs *cs, const void *data) + { +- struct wined3d_cs_block *block = wined3d_cs_get_thread_block(cs); +- void *data; +- +- if (!block || block->pos + size > sizeof(block->data)) +- { +- if (block) +- wined3d_cs_flush(cs); +- block = wined3d_cs_get_block(cs); +- wined3d_cs_set_thread_block(cs, block); +- } ++ const struct wined3d_cs_skip *op = data; + +- data = &block->data[block->pos]; +- block->pos += size; +- +- return data; ++ return op->size; + } + + static UINT wined3d_cs_exec_fence(struct wined3d_cs *cs, const void *data) +@@ -491,14 +412,14 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled) + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_FENCE; + op->signalled = signalled; ++ cs->ops->submit(cs, sizeof(*op)); + } + +-static void wined3d_cs_flush_and_wait(struct wined3d_cs *cs) ++static void wined3d_cs_finish(struct wined3d_cs *cs) + { + BOOL fence; + + wined3d_cs_emit_fence(cs, &fence); +- wined3d_cs_flush(cs); + + /* A busy wait should be fine, we're not supposed to have to wait very + * long. */ +@@ -556,7 +477,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw + + pending = InterlockedIncrement(&cs->pending_presents); + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + + while (pending > 1) + pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0); +@@ -583,8 +504,9 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * + { + struct wined3d_cs_clear *op; + unsigned int extra_rects = rect_count ? rect_count - 1 : 0; ++ size_t size = sizeof(*op) + sizeof(*op->rects) * extra_rects; + +- op = cs->ops->require_space(cs, sizeof(*op) + sizeof(*op->rects) * extra_rects); ++ op = cs->ops->require_space(cs, size); + op->opcode = WINED3D_CS_OP_CLEAR; + op->rect_count = rect_count; + if (rect_count) +@@ -594,7 +516,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * + op->depth = depth; + op->stencil = stencil; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, size); + } + + static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) +@@ -635,7 +557,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun + op->instance_count = instance_count; + op->indexed = indexed; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data) +@@ -657,7 +579,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query + op->predicate = predicate; + op->value = value; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data) +@@ -679,7 +601,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi + op->opcode = WINED3D_CS_OP_SET_VIEWPORT; + op->viewport = *viewport; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data) +@@ -700,7 +622,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) + op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT; + op->rect = *rect; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data) +@@ -723,7 +645,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v + op->view_idx = view_idx; + op->view = view; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data) +@@ -776,7 +698,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 + op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW; + op->view = view; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data) +@@ -797,7 +719,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 + op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION; + op->declaration = declaration; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data) +@@ -834,7 +756,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, + op->offset = offset; + op->stride = stride; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data) +@@ -861,7 +783,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i + op->frequency = frequency; + op->flags = flags; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data) +@@ -894,7 +816,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, + op->buffer = buffer; + op->offset = offset; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data) +@@ -926,7 +848,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff + op->buffer = buffer; + op->format_id = format_id; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data) +@@ -957,7 +879,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha + op->cb_idx = cb_idx; + op->buffer = buffer; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) +@@ -1032,7 +954,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined + op->opcode = WINED3D_CS_OP_SET_TEXTURE; + op->stage = stage; + op->texture = texture; +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data) +@@ -1056,7 +978,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 + op->view_idx = view_idx; + op->view = view; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) +@@ -1080,7 +1002,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type + op->sampler_idx = sampler_idx; + op->sampler = sampler; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) +@@ -1102,6 +1024,8 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type + op->opcode = WINED3D_CS_OP_SET_SHADER; + op->type = type; + op->shader = shader; ++ ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_vs_consts_f(struct wined3d_cs *cs, const void *data) +@@ -1137,8 +1061,9 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, + { + struct wined3d_cs_set_consts_f *op; + UINT extra_space = vector4f_count - 1; ++ size_t size = sizeof(*op) + sizeof(op->constants) * extra_space; + +- op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space); ++ op = cs->ops->require_space(cs, size); + switch (type) + { + case WINED3D_SHADER_TYPE_PIXEL: +@@ -1160,7 +1085,7 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, + op->vector4f_count = vector4f_count; + memcpy(op->constants, constants, sizeof(*constants) * 4 * vector4f_count); + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, size); + } + + static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data) +@@ -1182,8 +1107,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render + op->state = state; + op->value = value; + +- cs->ops->submit(cs); +-}; ++ cs->ops->submit(cs, sizeof(*op)); ++} + + static UINT wined3d_cs_exec_set_vs_consts_b(struct wined3d_cs *cs, const void *data) + { +@@ -1216,8 +1141,9 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, + { + struct wined3d_cs_set_consts_b *op; + UINT extra_space = bool_count - 1; ++ size_t size = sizeof(*op) + sizeof(op->constants) * extra_space; + +- op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space); ++ op = cs->ops->require_space(cs, size); + switch (type) + { + case WINED3D_SHADER_TYPE_PIXEL: +@@ -1239,7 +1165,7 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, + op->bool_count = bool_count; + memcpy(op->constants, constants, sizeof(op->constants) * bool_count); + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, size); + } + + static UINT wined3d_cs_exec_set_vs_consts_i(struct wined3d_cs *cs, const void *data) +@@ -1273,8 +1199,9 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, UINT start_register, + { + struct wined3d_cs_set_consts_i *op; + UINT extra_space = vector4i_count - 1; ++ size_t size = sizeof(*op) + sizeof(op->constants) * extra_space; + +- op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space); ++ op = cs->ops->require_space(cs, size); + switch (type) + { + case WINED3D_SHADER_TYPE_PIXEL: +@@ -1296,7 +1223,7 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, UINT start_register, + op->vector4i_count = vector4i_count; + memcpy(op->constants, constants, sizeof(op->constants) * vector4i_count); + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, size); + } + + static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) +@@ -1320,7 +1247,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, + op->state = state; + op->value = value; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data) +@@ -1344,7 +1271,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, + op->state = state; + op->value = value; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data) +@@ -1368,7 +1295,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform + op->state = state; + op->matrix = *matrix; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data) +@@ -1390,7 +1317,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const + op->plane_idx = plane_idx; + op->plane = *plane; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data) +@@ -1468,7 +1395,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture + else + op->set = 0; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data) +@@ -1489,7 +1416,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma + op->opcode = WINED3D_CS_OP_SET_MATERIAL; + op->material = *material; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) +@@ -1513,7 +1440,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_RESET_STATE; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) +@@ -1539,7 +1466,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_GLFINISH; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_base_vertex_index(struct wined3d_cs *cs, const void *data) +@@ -1561,7 +1488,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, + op->opcode = WINED3D_CS_OP_SET_BASE_VERTEX_INDEX; + op->base_vertex_index = base_vertex_index; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data) +@@ -1587,7 +1514,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ + op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE; + op->gl_primitive_type = primitive_type; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) +@@ -1644,7 +1571,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light + op->opcode = WINED3D_CS_OP_SET_LIGHT; + op->light = *light; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) +@@ -1733,7 +1660,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab + op->idx = idx; + op->enable = enable; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) +@@ -1765,7 +1692,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf + if (fx) + op->fx = *fx; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data) +@@ -1791,7 +1718,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge + op->rect = *rect; + op->color = *color; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_resource_map(struct wined3d_cs *cs, const void *data) +@@ -1815,12 +1742,14 @@ void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resourc + op->flags = flags; + op->mem = &ret; + +- cs->ops->finish(cs); ++ cs->ops->submit(cs, sizeof(*op)); + + if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) + { + FIXME("Dynamic resource map is inefficient\n"); + } ++ cs->ops->finish(cs); ++ + return ret; + } + +@@ -1842,11 +1771,13 @@ void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resour + op->opcode = WINED3D_CS_OP_RESOURCE_UNMAP; + op->resource = resource; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { ++ /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, ++ /* WINED3D_CS_OP_SKIP */ wined3d_cs_exec_skip, + /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, + /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, + /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, +@@ -1891,42 +1822,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, + }; + +-static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) ++static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) + { +- if (size > cs->data_size) ++ struct wined3d_cs_queue *queue = &cs->queue; ++ size_t queue_size = sizeof(queue->data) / sizeof(*queue->data); ++ ++ if (queue_size - size < queue->head) + { +- void *new_data; ++ struct wined3d_cs_skip *skip; ++ size_t nop_size = queue_size - queue->head; + +- size = max( size, cs->data_size * 2 ); +- if (!(new_data = HeapReAlloc(GetProcessHeap(), 0, cs->data, size))) +- return NULL; ++ skip = wined3d_cs_mt_require_space(cs, nop_size); ++ if (nop_size < sizeof(*skip)) ++ { ++ skip->opcode = WINED3D_CS_OP_NOP; ++ } ++ else ++ { ++ skip->opcode = WINED3D_CS_OP_SKIP; ++ skip->size = nop_size; ++ } + +- cs->data_size = size; +- cs->data = new_data; ++ cs->ops->submit(cs, nop_size); ++ assert(!queue->head); + } + +- return cs->data; +-} ++ while(1) ++ { ++ LONG head = queue->head; ++ LONG tail = *((volatile LONG *)&queue->tail); ++ LONG new_pos; ++ /* Empty */ ++ if (head == tail) ++ break; ++ /* Head ahead of tail, take care of wrap-around */ ++ new_pos = (head + size) & (WINED3D_CS_QUEUE_SIZE - 1); ++ if (head > tail && (new_pos || tail)) ++ break; ++ /* Tail ahead of head, but still enough space */ ++ if (new_pos < tail && new_pos) ++ break; + +-static void wined3d_cs_st_submit(struct wined3d_cs *cs) +-{ +- enum wined3d_cs_op opcode = *(const enum wined3d_cs_op *)cs->data; ++ TRACE("Waiting for free space. Head %u, tail %u, want %u\n", head, tail, ++ (unsigned int) size); ++ } + +- wined3d_cs_op_handlers[opcode](cs, cs->data); ++ return &queue->data[queue->head]; + } + +-static const struct wined3d_cs_ops wined3d_cs_st_ops = +-{ +- wined3d_cs_st_require_space, +- wined3d_cs_st_submit, +- wined3d_cs_st_submit, +-}; +- + static const struct wined3d_cs_ops wined3d_cs_mt_ops = + { + wined3d_cs_mt_require_space, +- wined3d_cs_flush, +- wined3d_cs_flush_and_wait, ++ wined3d_cs_submit, ++ wined3d_cs_finish, + }; + + /* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an +@@ -1938,9 +1886,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs) + op = wined3d_cs_mt_require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_STOP; + +- wined3d_cs_flush(cs); ++ wined3d_cs_submit(cs, sizeof(*op)); ++} ++ ++static void wined3d_cs_st_submit(struct wined3d_cs *cs, size_t size) ++{ ++ enum wined3d_cs_op opcode = *(const enum wined3d_cs_op *)&cs->queue.data; ++ ++ if (opcode >= WINED3D_CS_OP_STOP) ++ { ++ ERR("Invalid opcode %#x.\n", opcode); ++ return; ++ } ++ ++ wined3d_cs_op_handlers[opcode](cs, &cs->queue.data); + } + ++static void wined3d_cs_st_finish(struct wined3d_cs *cs) ++{ ++} ++ ++static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) ++{ ++ return cs->queue.data; ++} ++ ++static const struct wined3d_cs_ops wined3d_cs_st_ops = ++{ ++ wined3d_cs_st_require_space, ++ wined3d_cs_st_submit, ++ wined3d_cs_st_finish, ++}; ++ + void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, + struct wined3d_context *context, struct wined3d_surface *depth_stencil) + { +@@ -1960,31 +1937,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, + static DWORD WINAPI wined3d_cs_run(void *thread_param) + { + struct wined3d_cs *cs = thread_param; ++ enum wined3d_cs_op opcode; ++ LONG tail; + + TRACE("Started.\n"); + + cs->thread_id = GetCurrentThreadId(); + for (;;) + { +- struct wined3d_cs_block *block; +- UINT pos = 0; +- +- block = wined3d_cs_list_dequeue_blocking(&cs->exec_list); +- while (pos < block->pos) ++ if (*((volatile LONG *)&cs->queue.head) == cs->queue.tail) + { +- enum wined3d_cs_op opcode = *(const enum wined3d_cs_op *)&block->data[pos]; ++ continue; ++ } + +- if (opcode >= WINED3D_CS_OP_STOP) +- { +- if (opcode > WINED3D_CS_OP_STOP) +- ERR("Invalid opcode %#x.\n", opcode); +- goto done; +- } ++ tail = cs->queue.tail; ++ opcode = *(const enum wined3d_cs_op *)&cs->queue.data[tail]; + +- pos += wined3d_cs_op_handlers[opcode](cs, &block->data[pos]); ++ if (opcode >= WINED3D_CS_OP_STOP) ++ { ++ if (opcode > WINED3D_CS_OP_STOP) ++ ERR("Invalid opcode %#x.\n", opcode); ++ goto done; + } + +- wined3d_cs_list_enqueue(&cs->free_list, block); ++ tail += wined3d_cs_op_handlers[opcode](cs, &cs->queue.data[tail]); ++ tail &= (WINED3D_CS_QUEUE_SIZE - 1); ++ InterlockedExchange(&cs->queue.tail, tail); + } + + done: +@@ -2009,25 +1987,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) + cs->ops = &wined3d_cs_st_ops; + cs->device = device; + +- cs->data_size = WINED3D_INITIAL_CS_SIZE; +- if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size))) +- { +- goto err; +- } +- +- if ((cs->tls_idx = TlsAlloc()) == TLS_OUT_OF_INDEXES) +- { +- ERR("Failed to allocate cs TLS index, err %#x.\n", GetLastError()); +- goto err; +- } +- + if (wined3d_settings.cs_multithreaded) + { + cs->ops = &wined3d_cs_mt_ops; + +- wined3d_cs_list_init(&cs->free_list); +- wined3d_cs_list_init(&cs->exec_list); +- + if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL))) + { + ERR("Failed to create wined3d command stream thread.\n"); +@@ -2039,12 +2002,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) + + err: + if (cs) +- { + state_cleanup(&cs->state); +- if (cs->tls_idx != TLS_OUT_OF_INDEXES && !TlsFree(cs->tls_idx)) +- ERR("Failed to free cs TLS index, err %#x.\n", GetLastError()); +- HeapFree(GetProcessHeap(), 0, cs->data); +- } + HeapFree(GetProcessHeap(), 0, cs); + return NULL; + } +@@ -2063,17 +2021,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) + CloseHandle(cs->thread); + if (ret != WAIT_OBJECT_0) + ERR("Wait failed (%#x).\n", ret); +- +- /* FIXME: Cleanup the block lists on thread exit. */ +-#if 0 +- wined3d_cs_list_cleanup(&cs->exec_list); +- wined3d_cs_list_cleanup(&cs->free_list); +-#endif + } + +- if (!TlsFree(cs->tls_idx)) +- ERR("Failed to free cs TLS index, err %#x.\n", GetLastError()); +- +- HeapFree(GetProcessHeap(), 0, cs->data); + HeapFree(GetProcessHeap(), 0, cs); + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index ed4d94b..35384e1 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -31,6 +31,7 @@ + #define WINE_GLAPI + #endif + ++#include + #include + #include + #include +@@ -2584,19 +2585,17 @@ struct wined3d_cs_list + struct list blocks; + }; + +-struct wined3d_cs_block ++#define WINED3D_CS_QUEUE_SIZE 0x100000 ++struct wined3d_cs_queue + { +- struct list entry; +- UINT pos; +- /* FIXME? The size is somewhat arbitrary. It's big enough for huge +- * shader constant set calls though */ +- BYTE data[sizeof(float) * 4 * 256 * 2]; ++ LONG head, tail; ++ BYTE data[WINED3D_CS_QUEUE_SIZE]; + }; + + struct wined3d_cs_ops + { + void *(*require_space)(struct wined3d_cs *cs, size_t size); +- void (*submit)(struct wined3d_cs *cs); ++ void (*submit)(struct wined3d_cs *cs, size_t size); + void (*finish)(struct wined3d_cs *cs); + }; + +@@ -2607,14 +2606,9 @@ struct wined3d_cs + struct wined3d_state state; + HANDLE thread; + DWORD thread_id; +- DWORD tls_idx; + struct wined3d_surface *onscreen_depth_stencil; + +- size_t data_size; +- void *data; +- +- struct wined3d_cs_list free_list; +- struct wined3d_cs_list exec_list; ++ struct wined3d_cs_queue queue; + + LONG pending_presents; + }; +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0084-wined3d-Don-t-preload-buffers-on-unmap.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0084-wined3d-Don-t-preload-buffers-on-unmap.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0084-wined3d-Don-t-preload-buffers-on-unmap.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0084-wined3d-Don-t-preload-buffers-on-unmap.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,27 @@ +From 0603f71135885ebf0666d406380385936ed5ff7b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Jul 2013 23:40:56 +0200 +Subject: wined3d: Don't preload buffers on unmap + +--- + dlls/wined3d/buffer.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 5544640..b76a07d 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1129,10 +1129,6 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) + buffer_clear_dirty_areas(buffer); + buffer->map_ptr = NULL; + } +- else if (buffer->flags & WINED3D_BUFFER_HASDESC) +- { +- wined3d_buffer_preload(buffer); +- } + } + + static ULONG buffer_resource_incref(struct wined3d_resource *resource) +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0084-wined3d-wined3d_-_query_issue-never-fails.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0084-wined3d-wined3d_-_query_issue-never-fails.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0084-wined3d-wined3d_-_query_issue-never-fails.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0084-wined3d-wined3d_-_query_issue-never-fails.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -From ea0804eca5b9d5df9eeb4a435d11ad1e6f4227b1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 18:15:00 +0200 -Subject: wined3d: wined3d_*_query_issue never fails - ---- - dlls/wined3d/query.c | 21 ++++++++------------- - dlls/wined3d/wined3d_private.h | 2 +- - 2 files changed, 9 insertions(+), 14 deletions(-) - -diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index e755764..3de4282 100644 ---- a/dlls/wined3d/query.c -+++ b/dlls/wined3d/query.c -@@ -292,7 +292,8 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); - -- return query->query_ops->query_issue(query, flags); -+ query->query_ops->query_issue(query, flags); -+ return WINED3D_OK; - } - - static void fill_query_data(void *out, unsigned int out_size, const void *result, unsigned int result_size) -@@ -435,7 +436,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query - return query->type; - } - --static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags) -+static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); - -@@ -445,7 +446,7 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD - struct wined3d_event_query *event_query = query->extendedData; - - /* Faked event query support */ -- if (!event_query) return WINED3D_OK; -+ if (!event_query) return; - - wined3d_event_query_issue(event_query, query->device); - } -@@ -459,11 +460,9 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD - query->state = QUERY_BUILDING; - else - query->state = QUERY_SIGNALLED; -- -- return WINED3D_OK; - } - --static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) -+static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - struct wined3d_device *device = query->device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -542,7 +541,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW - else - query->state = QUERY_SIGNALLED; - -- return WINED3D_OK; /* can be WINED3DERR_INVALIDCALL. */ -+ return; - } - - static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, -@@ -605,7 +604,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, - return res; - } - --static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) -+static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - struct wined3d_device *device = query->device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -639,8 +638,6 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW - - if (flags & WINED3DISSUE_END) - query->state = QUERY_SIGNALLED; -- -- return WINED3D_OK; - } - - static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, -@@ -669,7 +666,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer - return S_OK; - } - --static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) -+static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); - -@@ -677,8 +674,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query * - query->state = QUERY_BUILDING; - if (flags & WINED3DISSUE_END) - query->state = QUERY_SIGNALLED; -- -- return WINED3D_OK; - } - - static const struct wined3d_query_ops event_query_ops = -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 59d9753..ff05a97 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2653,7 +2653,7 @@ enum query_state { - struct wined3d_query_ops - { - HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); -- HRESULT (*query_issue)(struct wined3d_query *query, DWORD flags); -+ void (*query_issue)(struct wined3d_query *query, DWORD flags); - }; - - struct wined3d_query --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0085-wined3d-Add-query-support-to-the-command-stream.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0085-wined3d-Add-query-support-to-the-command-stream.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0085-wined3d-Add-query-support-to-the-command-stream.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0085-wined3d-Add-query-support-to-the-command-stream.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,163 +0,0 @@ -From c0687b2ce9d0056bce2fc514f25baa20ab834f1e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 18:26:11 +0200 -Subject: wined3d: Add query support to the command stream - ---- - dlls/wined3d/cs.c | 73 ++++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/query.c | 8 +++-- - dlls/wined3d/wined3d_private.h | 4 +++ - 3 files changed, 83 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index d35f114..e4d60d8 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -67,6 +67,8 @@ enum wined3d_cs_op - WINED3D_CS_OP_CLEAR_RTV, - WINED3D_CS_OP_RESOURCE_MAP, - WINED3D_CS_OP_RESOURCE_UNMAP, -+ WINED3D_CS_OP_QUERY_ISSUE, -+ WINED3D_CS_OP_QUERY_GET_DATA, - WINED3D_CS_OP_STOP, - }; - -@@ -364,6 +366,23 @@ struct wined3d_cs_skip - DWORD size; - }; - -+struct wined3d_cs_query_issue -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_query *query; -+ DWORD flags; -+}; -+ -+struct wined3d_cs_query_get_data -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_query *query; -+ void *data; -+ UINT data_size; -+ DWORD flags; -+ HRESULT *ret; -+}; -+ - static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -1683,6 +1702,58 @@ void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resour - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_query_issue *op = data; -+ -+ op->query->query_ops->query_issue(op->query, op->flags); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) -+{ -+ struct wined3d_cs_query_issue *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_QUERY_ISSUE; -+ op->query = query; -+ op->flags = flags; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ -+static UINT wined3d_cs_exec_query_get_data(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_query_get_data *op = data; -+ struct wined3d_query *query = op->query; -+ -+ *op->ret = query->query_ops->query_get_data(query, op->data, op->data_size, op->flags); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, -+ UINT data_size, DWORD flags, HRESULT *ret) -+{ -+ struct wined3d_cs_query_get_data *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_QUERY_GET_DATA; -+ op->query = query; -+ op->data = data; -+ op->data_size = data_size; -+ op->flags = flags; -+ op->ret = ret; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+ -+ if (wined3d_settings.cs_multithreaded) -+ FIXME("Query handling is not particularly fast yet\n"); -+ -+ cs->ops->finish(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -1728,6 +1799,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, - /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, - /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, -+ /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, -+ /* WINED3D_CS_OP_QUERY_GET_DATA */ wined3d_cs_exec_query_get_data, - }; - - static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) -diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 3de4282..6436bd7 100644 ---- a/dlls/wined3d/query.c -+++ b/dlls/wined3d/query.c -@@ -275,10 +275,14 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) - HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, - void *data, UINT data_size, DWORD flags) - { -+ HRESULT hr; - TRACE("query %p, data %p, data_size %u, flags %#x.\n", - query, data, data_size, flags); - -- return query->query_ops->query_get_data(query, data, data_size, flags); -+ wined3d_cs_emit_query_get_data(query->device->cs, query, data, data_size, -+ flags, &hr); -+ -+ return hr; - } - - UINT CDECL wined3d_query_get_data_size(const struct wined3d_query *query) -@@ -292,7 +296,7 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); - -- query->query_ops->query_issue(query, flags); -+ wined3d_cs_emit_query_issue(query->device->cs, query, flags); - return WINED3D_OK; - } - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ff05a97..6175f13 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2639,6 +2639,10 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge - void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, - DWORD flags) DECLSPEC_HIDDEN; - void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, -+ DWORD flags) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, -+ UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0085-wined3d-Don-t-call-glFinish-before-swapping.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0085-wined3d-Don-t-call-glFinish-before-swapping.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0085-wined3d-Don-t-call-glFinish-before-swapping.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0085-wined3d-Don-t-call-glFinish-before-swapping.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,29 @@ +From 808198079459086ac70236bacaacd85aa717f7ff Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Jul 2013 23:50:20 +0200 +Subject: wined3d: Don't call glFinish before swapping + +The code is probably not ready yet, so delay this patch until everything +is CSified. Right now I need it for performance testing. +--- + dlls/wined3d/swapchain.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index fa0c241..7ebdd1b 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -531,9 +531,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + swapchain_blit(swapchain, context, &src_rect, &dst_rect); + } + +- if (wined3d_settings.cs_multithreaded) +- gl_info->gl_ops.gl.p_glFinish(); +- else if (swapchain->num_contexts > 1) ++ if (swapchain->num_contexts > 1 && !wined3d_settings.cs_multithreaded) + gl_info->gl_ops.gl.p_glFlush(); + + /* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */ +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0086-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0086-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0086-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0086-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -From ed3e1f3c0fb3ed7d687235e0683039169d412c99 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 18:31:41 +0200 -Subject: wined3d: Check our CS state to find out if a query is done - ---- - dlls/wined3d/cs.c | 6 +++++- - dlls/wined3d/query.c | 9 +++++++++ - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 16 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index e4d60d8..ba8e840 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1705,8 +1705,12 @@ void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resour - static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_query_issue *op = data; -+ struct wined3d_query *query = op->query; -+ -+ query->query_ops->query_issue(query, op->flags); - -- op->query->query_ops->query_issue(op->query, op->flags); -+ if (op->flags & WINED3DISSUE_END) -+ InterlockedIncrement(&query->counter_worker); - - return sizeof(*op); - } -diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 6436bd7..bea03ed 100644 ---- a/dlls/wined3d/query.c -+++ b/dlls/wined3d/query.c -@@ -279,6 +279,12 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, - TRACE("query %p, data %p, data_size %u, flags %#x.\n", - query, data, data_size, flags); - -+ if (query->counter_main != query->counter_worker) -+ { -+ TRACE("D3DISSUE_END command not submitted to GL yet\n"); -+ return S_FALSE; -+ } -+ - wined3d_cs_emit_query_get_data(query->device->cs, query, data, data_size, - flags, &hr); - -@@ -296,6 +302,9 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); - -+ if (flags & WINED3DISSUE_END) -+ query->counter_main++; -+ - wined3d_cs_emit_query_issue(query->device->cs, query, flags); - return WINED3D_OK; - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 6175f13..3fd7fa7 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2671,6 +2671,8 @@ struct wined3d_query - enum wined3d_query_type type; - DWORD data_size; - void *extendedData; -+ -+ LONG counter_main, counter_worker; - }; - - /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0086-wined3d-wined3d_-_query_issue-never-fails.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0086-wined3d-wined3d_-_query_issue-never-fails.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0086-wined3d-wined3d_-_query_issue-never-fails.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0086-wined3d-wined3d_-_query_issue-never-fails.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,116 @@ +From ea0804eca5b9d5df9eeb4a435d11ad1e6f4227b1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 18:15:00 +0200 +Subject: wined3d: wined3d_*_query_issue never fails + +--- + dlls/wined3d/query.c | 21 ++++++++------------- + dlls/wined3d/wined3d_private.h | 2 +- + 2 files changed, 9 insertions(+), 14 deletions(-) + +diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +index e755764..3de4282 100644 +--- a/dlls/wined3d/query.c ++++ b/dlls/wined3d/query.c +@@ -292,7 +292,8 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) + { + TRACE("query %p, flags %#x.\n", query, flags); + +- return query->query_ops->query_issue(query, flags); ++ query->query_ops->query_issue(query, flags); ++ return WINED3D_OK; + } + + static void fill_query_data(void *out, unsigned int out_size, const void *result, unsigned int result_size) +@@ -435,7 +436,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query + return query->type; + } + +-static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags) ++static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags) + { + TRACE("query %p, flags %#x.\n", query, flags); + +@@ -445,7 +446,7 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD + struct wined3d_event_query *event_query = query->extendedData; + + /* Faked event query support */ +- if (!event_query) return WINED3D_OK; ++ if (!event_query) return; + + wined3d_event_query_issue(event_query, query->device); + } +@@ -459,11 +460,9 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD + query->state = QUERY_BUILDING; + else + query->state = QUERY_SIGNALLED; +- +- return WINED3D_OK; + } + +-static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) ++static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) + { + struct wined3d_device *device = query->device; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; +@@ -542,7 +541,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW + else + query->state = QUERY_SIGNALLED; + +- return WINED3D_OK; /* can be WINED3DERR_INVALIDCALL. */ ++ return; + } + + static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, +@@ -605,7 +604,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, + return res; + } + +-static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) ++static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) + { + struct wined3d_device *device = query->device; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; +@@ -639,8 +638,6 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW + + if (flags & WINED3DISSUE_END) + query->state = QUERY_SIGNALLED; +- +- return WINED3D_OK; + } + + static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, +@@ -669,7 +666,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer + return S_OK; + } + +-static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) ++static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) + { + TRACE("query %p, flags %#x.\n", query, flags); + +@@ -677,8 +674,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query * + query->state = QUERY_BUILDING; + if (flags & WINED3DISSUE_END) + query->state = QUERY_SIGNALLED; +- +- return WINED3D_OK; + } + + static const struct wined3d_query_ops event_query_ops = +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 59d9753..ff05a97 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2653,7 +2653,7 @@ enum query_state { + struct wined3d_query_ops + { + HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); +- HRESULT (*query_issue)(struct wined3d_query *query, DWORD flags); ++ void (*query_issue)(struct wined3d_query *query, DWORD flags); + }; + + struct wined3d_query +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0087-wined3d-Add-query-support-to-the-command-stream.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0087-wined3d-Add-query-support-to-the-command-stream.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0087-wined3d-Add-query-support-to-the-command-stream.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0087-wined3d-Add-query-support-to-the-command-stream.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,163 @@ +From c0687b2ce9d0056bce2fc514f25baa20ab834f1e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 18:26:11 +0200 +Subject: wined3d: Add query support to the command stream + +--- + dlls/wined3d/cs.c | 73 ++++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/query.c | 8 +++-- + dlls/wined3d/wined3d_private.h | 4 +++ + 3 files changed, 83 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index d35f114..e4d60d8 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -67,6 +67,8 @@ enum wined3d_cs_op + WINED3D_CS_OP_CLEAR_RTV, + WINED3D_CS_OP_RESOURCE_MAP, + WINED3D_CS_OP_RESOURCE_UNMAP, ++ WINED3D_CS_OP_QUERY_ISSUE, ++ WINED3D_CS_OP_QUERY_GET_DATA, + WINED3D_CS_OP_STOP, + }; + +@@ -364,6 +366,23 @@ struct wined3d_cs_skip + DWORD size; + }; + ++struct wined3d_cs_query_issue ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_query *query; ++ DWORD flags; ++}; ++ ++struct wined3d_cs_query_get_data ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_query *query; ++ void *data; ++ UINT data_size; ++ DWORD flags; ++ HRESULT *ret; ++}; ++ + static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -1683,6 +1702,58 @@ void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resour + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_query_issue *op = data; ++ ++ op->query->query_ops->query_issue(op->query, op->flags); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) ++{ ++ struct wined3d_cs_query_issue *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_QUERY_ISSUE; ++ op->query = query; ++ op->flags = flags; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ ++static UINT wined3d_cs_exec_query_get_data(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_query_get_data *op = data; ++ struct wined3d_query *query = op->query; ++ ++ *op->ret = query->query_ops->query_get_data(query, op->data, op->data_size, op->flags); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, ++ UINT data_size, DWORD flags, HRESULT *ret) ++{ ++ struct wined3d_cs_query_get_data *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_QUERY_GET_DATA; ++ op->query = query; ++ op->data = data; ++ op->data_size = data_size; ++ op->flags = flags; ++ op->ret = ret; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++ ++ if (wined3d_settings.cs_multithreaded) ++ FIXME("Query handling is not particularly fast yet\n"); ++ ++ cs->ops->finish(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -1728,6 +1799,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, + /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, + /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, ++ /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, ++ /* WINED3D_CS_OP_QUERY_GET_DATA */ wined3d_cs_exec_query_get_data, + }; + + static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) +diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +index 3de4282..6436bd7 100644 +--- a/dlls/wined3d/query.c ++++ b/dlls/wined3d/query.c +@@ -275,10 +275,14 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) + HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, + void *data, UINT data_size, DWORD flags) + { ++ HRESULT hr; + TRACE("query %p, data %p, data_size %u, flags %#x.\n", + query, data, data_size, flags); + +- return query->query_ops->query_get_data(query, data, data_size, flags); ++ wined3d_cs_emit_query_get_data(query->device->cs, query, data, data_size, ++ flags, &hr); ++ ++ return hr; + } + + UINT CDECL wined3d_query_get_data_size(const struct wined3d_query *query) +@@ -292,7 +296,7 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) + { + TRACE("query %p, flags %#x.\n", query, flags); + +- query->query_ops->query_issue(query, flags); ++ wined3d_cs_emit_query_issue(query->device->cs, query, flags); + return WINED3D_OK; + } + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index ff05a97..6175f13 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2639,6 +2639,10 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge + void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, + DWORD flags) DECLSPEC_HIDDEN; + void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, ++ DWORD flags) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, ++ UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0087-wined3d-Poll-queries-automatically-in-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0087-wined3d-Poll-queries-automatically-in-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0087-wined3d-Poll-queries-automatically-in-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0087-wined3d-Poll-queries-automatically-in-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,576 +0,0 @@ -From 3c2152778b13105e423a33889692c3b12f58653b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 19:18:48 +0200 -Subject: wined3d: Poll queries automatically in the CS - ---- - dlls/wined3d/cs.c | 76 ++++++-------- - dlls/wined3d/query.c | 221 ++++++++++++++++++++++++++--------------- - dlls/wined3d/wined3d_private.h | 7 +- - 3 files changed, 178 insertions(+), 126 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index d97ef5b..8256707 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -69,7 +69,6 @@ enum wined3d_cs_op - WINED3D_CS_OP_RESOURCE_MAP, - WINED3D_CS_OP_RESOURCE_UNMAP, - WINED3D_CS_OP_QUERY_ISSUE, -- WINED3D_CS_OP_QUERY_GET_DATA, - WINED3D_CS_OP_STOP, - }; - -@@ -383,16 +382,6 @@ struct wined3d_cs_query_issue - DWORD flags; - }; - --struct wined3d_cs_query_get_data --{ -- enum wined3d_cs_op opcode; -- struct wined3d_query *query; -- void *data; -- UINT data_size; -- DWORD flags; -- HRESULT *ret; --}; -- - static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -1822,8 +1811,9 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) - - query->query_ops->query_issue(query, op->flags); - -- if (op->flags & WINED3DISSUE_END) -- InterlockedIncrement(&query->counter_worker); -+ if (wined3d_settings.cs_multithreaded && op->flags & WINED3DISSUE_END -+ && list_empty(&query->poll_list_entry)) -+ list_add_tail(&cs->query_poll_list, &query->poll_list_entry); - - return sizeof(*op); - } -@@ -1840,37 +1830,6 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu - cs->ops->submit(cs, sizeof(*op)); - } - --static UINT wined3d_cs_exec_query_get_data(struct wined3d_cs *cs, const void *data) --{ -- const struct wined3d_cs_query_get_data *op = data; -- struct wined3d_query *query = op->query; -- -- *op->ret = query->query_ops->query_get_data(query, op->data, op->data_size, op->flags); -- -- return sizeof(*op); --} -- --void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, -- UINT data_size, DWORD flags, HRESULT *ret) --{ -- struct wined3d_cs_query_get_data *op; -- -- op = cs->ops->require_space(cs, sizeof(*op)); -- op->opcode = WINED3D_CS_OP_QUERY_GET_DATA; -- op->query = query; -- op->data = data; -- op->data_size = data_size; -- op->flags = flags; -- op->ret = ret; -- -- cs->ops->submit(cs, sizeof(*op)); -- -- if (wined3d_settings.cs_multithreaded) -- FIXME("Query handling is not particularly fast yet\n"); -- -- cs->ops->finish(cs); --} -- - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -1918,7 +1877,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, - /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, - /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, -- /* WINED3D_CS_OP_QUERY_GET_DATA */ wined3d_cs_exec_query_get_data, - }; - - static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) -@@ -2033,17 +1991,45 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, - wined3d_surface_incref(cs->onscreen_depth_stencil); - } - -+static inline void poll_queries(struct wined3d_cs *cs) -+{ -+ struct wined3d_query *query, *cursor; -+ -+ LIST_FOR_EACH_ENTRY_SAFE(query, cursor, &cs->query_poll_list, struct wined3d_query, poll_list_entry) -+ { -+ BOOL ret; -+ -+ ret = query->query_ops->query_poll(query); -+ if (ret) -+ { -+ list_remove(&query->poll_list_entry); -+ list_init(&query->poll_list_entry); -+ InterlockedIncrement(&query->counter_retrieved); -+ } -+ } -+} -+ - static DWORD WINAPI wined3d_cs_run(void *thread_param) - { - struct wined3d_cs *cs = thread_param; - enum wined3d_cs_op opcode; - LONG tail; -+ char poll = 0; - - TRACE("Started.\n"); - -+ list_init(&cs->query_poll_list); - cs->thread_id = GetCurrentThreadId(); - for (;;) - { -+ if (poll == 10) -+ { -+ poll = 0; -+ poll_queries(cs); -+ } -+ else -+ poll++; -+ - if (*((volatile LONG *)&cs->queue.head) == cs->queue.tail) - { - continue; -diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 9bdb35e..9f1f5ad 100644 ---- a/dlls/wined3d/query.c -+++ b/dlls/wined3d/query.c -@@ -241,6 +241,15 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) - - if (!refcount) - { -+ if (wined3d_settings.cs_multithreaded) -+ { -+ struct wined3d_device *device = query->device; -+ -+ FIXME("waiting for cs\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - /* Queries are specific to the GL context that created them. Not - * deleting the query will obviously leak it, but that's still better - * than potentially deleting a different query with the same id in this -@@ -275,20 +284,10 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) - HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, - void *data, UINT data_size, DWORD flags) - { -- HRESULT hr; - TRACE("query %p, data %p, data_size %u, flags %#x.\n", - query, data, data_size, flags); - -- if (query->counter_main != query->counter_worker) -- { -- TRACE("D3DISSUE_END command not submitted to GL yet\n"); -- return S_FALSE; -- } -- -- wined3d_cs_emit_query_get_data(query->device->cs, query, data, data_size, -- flags, &hr); -- -- return hr; -+ return query->query_ops->query_get_data(query, data, data_size, flags); - } - - UINT CDECL wined3d_query_get_data_size(const struct wined3d_query *query) -@@ -317,15 +316,10 @@ static void fill_query_data(void *out, unsigned int out_size, const void *result - static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - void *data, DWORD size, DWORD flags) - { -- struct wined3d_occlusion_query *oq = query->extendedData; - struct wined3d_device *device = query->device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -- struct wined3d_context *context; -- GLuint available; -+ struct wined3d_occlusion_query *oq = query->extendedData; - GLuint samples; -- HRESULT res; -- -- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); - - if (!oq->context) - query->state = QUERY_CREATED; -@@ -339,6 +333,8 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - return S_OK; - } - -+ TRACE("(%p) : type D3DQUERY_OCCLUSION, data %p, size %#x, flags %#x.\n", query, data, size, flags); -+ - if (query->state == QUERY_BUILDING) - { - /* Msdn says this returns an error, but our tests show that S_FALSE is returned */ -@@ -354,12 +350,37 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - return S_OK; - } - -+ if (!wined3d_settings.cs_multithreaded) -+ { -+ if (!query->query_ops->query_poll(query)) -+ return S_FALSE; -+ } -+ else if (query->counter_main != query->counter_retrieved) -+ { -+ return S_FALSE; -+ } -+ -+ if (data) -+ fill_query_data(data, size, &oq->samples, sizeof(oq->samples)); -+ -+ return S_OK; -+} -+ -+static BOOL wined3d_occlusion_query_ops_poll(struct wined3d_query *query) -+{ -+ struct wined3d_occlusion_query *oq = query->extendedData; -+ struct wined3d_device *device = query->device; -+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -+ struct wined3d_context *context; -+ GLuint available; -+ GLuint samples; -+ BOOL ret; -+ - if (oq->context->tid != GetCurrentThreadId()) - { - FIXME("%p Wrong thread, returning 1.\n", query); -- samples = 1; -- fill_query_data(data, size, &samples, sizeof(samples)); -- return S_OK; -+ oq->samples = 1; -+ return TRUE; - } - - context = context_acquire(query->device, oq->context->current_rt); -@@ -370,68 +391,78 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - - if (available) - { -- if (size) -- { -- GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &samples)); -- checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT)"); -- TRACE("Returning %d samples.\n", samples); -- fill_query_data(data, size, &samples, sizeof(samples)); -- } -- res = S_OK; -+ GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &samples)); -+ checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT)"); -+ TRACE("Returning %d samples.\n", samples); -+ oq->samples = samples; -+ ret = TRUE; - } - else - { -- res = S_FALSE; -+ ret = FALSE; - } - - context_release(context); - -- return res; -+ return ret; - } - --static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, -- void *data, DWORD size, DWORD flags) -+static BOOL wined3d_event_query_ops_poll(struct wined3d_query *query) - { - struct wined3d_event_query *event_query = query->extendedData; -- BOOL signaled; - enum wined3d_event_query_result ret; - -- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); -- -- if (!data || !size) return S_OK; -- if (!event_query) -- { -- WARN("Event query not supported by GL, reporting GPU idle.\n"); -- signaled = TRUE; -- fill_query_data(data, size, &signaled, sizeof(signaled)); -- return S_OK; -- } -- - ret = wined3d_event_query_test(event_query, query->device); - switch(ret) - { - case WINED3D_EVENT_QUERY_OK: - case WINED3D_EVENT_QUERY_NOT_STARTED: -- signaled = TRUE; -- fill_query_data(data, size, &signaled, sizeof(signaled)); -- break; -+ return TRUE; - - case WINED3D_EVENT_QUERY_WAITING: -- signaled = FALSE; -- fill_query_data(data, size, &signaled, sizeof(signaled)); -- break; -+ return FALSE; - - case WINED3D_EVENT_QUERY_WRONG_THREAD: - FIXME("(%p) Wrong thread, reporting GPU idle.\n", query); -- signaled = TRUE; -- fill_query_data(data, size, &signaled, sizeof(signaled)); -- break; -+ return TRUE; - - case WINED3D_EVENT_QUERY_ERROR: - ERR("The GL event query failed, returning D3DERR_INVALIDCALL\n"); -- return WINED3DERR_INVALIDCALL; -+ return TRUE; -+ -+ default: -+ ERR("Unexpected wined3d_event_query_test result %u\n", ret); -+ return TRUE; -+ } -+} -+ -+static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, -+ void *pData, DWORD dwSize, DWORD flags) -+{ -+ struct wined3d_event_query *event_query = query->extendedData; -+ BOOL *data = pData; -+ enum wined3d_event_query_result ret; -+ -+ TRACE("query %p, pData %p, dwSize %#x, flags %#x.\n", query, pData, dwSize, flags); -+ -+ if (!pData || !dwSize) return S_OK; -+ if (!event_query) -+ { -+ WARN("Event query not supported by GL, reporting GPU idle.\n"); -+ *data = TRUE; -+ return S_OK; - } - -+ if (!wined3d_settings.cs_multithreaded) -+ ret = query->query_ops->query_poll(query); -+ else if (query->counter_main != query->counter_retrieved) -+ ret = FALSE; -+ else -+ ret = TRUE; -+ -+ if (data) -+ fill_query_data(data, dwSize, &ret, sizeof(ret)); -+ - return S_OK; - } - -@@ -561,33 +592,57 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, - void *data, DWORD size, DWORD flags) - { - struct wined3d_timestamp_query *tq = query->extendedData; -+ -+ TRACE("(%p) : type D3DQUERY_TIMESTAMP, data %p, size %#x, flags %#x.\n", query, data, size, flags); -+ -+ if (query->state == QUERY_CREATED) -+ { -+ UINT64 zero = 0; -+ /* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves */ -+ TRACE("Query wasn't yet started, returning S_OK.\n"); -+ if (data) -+ fill_query_data(data, size, &zero, sizeof(zero)); -+ return S_OK; -+ } -+ -+ if (!wined3d_settings.cs_multithreaded) -+ { -+ if (!query->query_ops->query_poll(query)) -+ return S_FALSE; -+ } -+ else if (query->counter_main != query->counter_retrieved) -+ { -+ return S_FALSE; -+ } -+ -+ if (data) -+ fill_query_data(data, size, &tq->timestamp, sizeof(tq->timestamp)); -+ -+ return S_OK; -+} -+ -+static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) -+{ -+ struct wined3d_timestamp_query *tq = query->extendedData; - struct wined3d_device *device = query->device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - struct wined3d_context *context; - GLuint available; - GLuint64 timestamp; -- HRESULT res; -- -- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); -+ BOOL ret; - -- if (!tq->context) -- query->state = QUERY_CREATED; -- -- if (query->state == QUERY_CREATED) -+ if (!gl_info->supported[ARB_TIMER_QUERY]) - { -- /* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves. */ -- TRACE("Query wasn't yet started, returning S_OK.\n"); -- timestamp = 0; -- fill_query_data(data, size, ×tamp, sizeof(timestamp)); -- return S_OK; -+ TRACE("Faking timestamp.\n"); -+ QueryPerformanceCounter((LARGE_INTEGER *)&tq->timestamp); -+ return TRUE; - } - - if (tq->context->tid != GetCurrentThreadId()) - { - FIXME("%p Wrong thread, returning 1.\n", query); -- timestamp = 1; -- fill_query_data(data, size, ×tamp, sizeof(timestamp)); -- return S_OK; -+ tq->timestamp = 1; -+ return TRUE; - } - - context = context_acquire(query->device, tq->context->current_rt); -@@ -598,23 +653,20 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, - - if (available) - { -- if (size) -- { -- GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT, ×tamp)); -- checkGLcall("glGetQueryObjectui64v(GL_QUERY_RESULT)"); -- TRACE("Returning timestamp %s.\n", wine_dbgstr_longlong(timestamp)); -- fill_query_data(data, size, ×tamp, sizeof(timestamp)); -- } -- res = S_OK; -+ GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT, ×tamp)); -+ checkGLcall("glGetQueryObjectui64v(GL_QUERY_RESULT)"); -+ TRACE("Returning timestamp %s.\n", wine_dbgstr_longlong(timestamp)); -+ tq->timestamp = timestamp; -+ ret = TRUE; - } - else - { -- res = S_FALSE; -+ ret = FALSE; - } - - context_release(context); - -- return res; -+ return ret; - } - - static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) -@@ -657,7 +709,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer - void *data, DWORD size, DWORD flags) - { - TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); -- - if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) - { - static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE}; -@@ -679,6 +730,11 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer - return S_OK; - } - -+static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *query) -+{ -+ return TRUE; -+} -+ - static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); -@@ -692,24 +748,28 @@ static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *que - static const struct wined3d_query_ops event_query_ops = - { - wined3d_event_query_ops_get_data, -+ wined3d_event_query_ops_poll, - wined3d_event_query_ops_issue, - }; - - static const struct wined3d_query_ops occlusion_query_ops = - { - wined3d_occlusion_query_ops_get_data, -+ wined3d_occlusion_query_ops_poll, - wined3d_occlusion_query_ops_issue, - }; - - static const struct wined3d_query_ops timestamp_query_ops = - { - wined3d_timestamp_query_ops_get_data, -+ wined3d_timestamp_query_ops_poll, - wined3d_timestamp_query_ops_issue, - }; - - static const struct wined3d_query_ops timestamp_disjoint_query_ops = - { - wined3d_timestamp_disjoint_query_ops_get_data, -+ wined3d_timestamp_disjoint_query_ops_poll, - wined3d_timestamp_disjoint_query_ops_issue, - }; - -@@ -810,6 +870,7 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de - query->state = QUERY_CREATED; - query->device = device; - query->ref = 1; -+ list_init(&query->poll_list_entry); - - return WINED3D_OK; - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 56d9b0c..4c4ee51 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -1090,6 +1090,7 @@ struct wined3d_occlusion_query - struct list entry; - GLuint id; - struct wined3d_context *context; -+ DWORD samples; - }; - - union wined3d_gl_query_object -@@ -1125,6 +1126,7 @@ struct wined3d_timestamp_query - struct list entry; - GLuint id; - struct wined3d_context *context; -+ UINT64 timestamp; - }; - - void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; -@@ -2610,6 +2612,7 @@ struct wined3d_cs - struct wined3d_cs_queue queue; - - LONG pending_presents; -+ struct list query_poll_list; - }; - - struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; -@@ -2705,6 +2708,7 @@ enum query_state { - struct wined3d_query_ops - { - HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); -+ BOOL (*query_poll)(struct wined3d_query *query); - void (*query_issue)(struct wined3d_query *query, DWORD flags); - }; - -@@ -2720,7 +2724,8 @@ struct wined3d_query - DWORD data_size; - void *extendedData; - -- LONG counter_main, counter_worker; -+ LONG counter_main, counter_retrieved; -+ struct list poll_list_entry; - }; - - /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other --- -2.3.7 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0088-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0088-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0088-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0088-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,72 @@ +From ed3e1f3c0fb3ed7d687235e0683039169d412c99 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 18:31:41 +0200 +Subject: wined3d: Check our CS state to find out if a query is done + +--- + dlls/wined3d/cs.c | 6 +++++- + dlls/wined3d/query.c | 9 +++++++++ + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index e4d60d8..ba8e840 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1705,8 +1705,12 @@ void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resour + static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_query_issue *op = data; ++ struct wined3d_query *query = op->query; ++ ++ query->query_ops->query_issue(query, op->flags); + +- op->query->query_ops->query_issue(op->query, op->flags); ++ if (op->flags & WINED3DISSUE_END) ++ InterlockedIncrement(&query->counter_worker); + + return sizeof(*op); + } +diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +index 6436bd7..bea03ed 100644 +--- a/dlls/wined3d/query.c ++++ b/dlls/wined3d/query.c +@@ -279,6 +279,12 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, + TRACE("query %p, data %p, data_size %u, flags %#x.\n", + query, data, data_size, flags); + ++ if (query->counter_main != query->counter_worker) ++ { ++ TRACE("D3DISSUE_END command not submitted to GL yet\n"); ++ return S_FALSE; ++ } ++ + wined3d_cs_emit_query_get_data(query->device->cs, query, data, data_size, + flags, &hr); + +@@ -296,6 +302,9 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) + { + TRACE("query %p, flags %#x.\n", query, flags); + ++ if (flags & WINED3DISSUE_END) ++ query->counter_main++; ++ + wined3d_cs_emit_query_issue(query->device->cs, query, flags); + return WINED3D_OK; + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 6175f13..3fd7fa7 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2671,6 +2671,8 @@ struct wined3d_query + enum wined3d_query_type type; + DWORD data_size; + void *extendedData; ++ ++ LONG counter_main, counter_worker; + }; + + /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0088-wined3d-Introduce-a-separate-queue-for-priority-comm.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0088-wined3d-Introduce-a-separate-queue-for-priority-comm.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0088-wined3d-Introduce-a-separate-queue-for-priority-comm.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0088-wined3d-Introduce-a-separate-queue-for-priority-comm.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,268 +0,0 @@ -From 0a14b53f4dcb38e852db14d186d14c8526f3549a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 19:18:03 +0200 -Subject: wined3d: Introduce a separate queue for priority commands - ---- - dlls/wined3d/cs.c | 128 ++++++++++++++++++++++++++++++++++------- - dlls/wined3d/wined3d_private.h | 5 +- - 2 files changed, 110 insertions(+), 23 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 68e1ed7..a7f7694 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -372,7 +372,7 @@ struct wined3d_cs_query_issue - DWORD flags; - }; - --static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) -+static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); - /* There is only one thread writing to queue.head, InterlockedExchange -@@ -380,6 +380,14 @@ static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) - InterlockedExchange(&cs->queue.head, new_val); - } - -+static void wined3d_cs_mt_submit_prio(struct wined3d_cs *cs, size_t size) -+{ -+ LONG new_val = (cs->prio_queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -+ /* There is only one thread writing to queue.head, InterlockedExchange -+ * is used for the memory barrier. */ -+ InterlockedExchange(&cs->prio_queue.head, new_val); -+} -+ - static UINT wined3d_cs_exec_nop(struct wined3d_cs *cs, const void *data) - { - return sizeof(enum wined3d_cs_op); -@@ -413,15 +421,16 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled) - cs->ops->submit(cs, sizeof(*op)); - } - --static void wined3d_cs_finish(struct wined3d_cs *cs) -+static void wined3d_cs_emit_fence_prio(struct wined3d_cs *cs, BOOL *signalled) - { -- BOOL fence; -+ struct wined3d_cs_fence *op; - -- wined3d_cs_emit_fence(cs, &fence); -+ *signalled = FALSE; - -- /* A busy wait should be fine, we're not supposed to have to wait very -- * long. */ -- while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); -+ op = cs->ops->require_space_prio(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_FENCE; -+ op->signalled = signalled; -+ cs->ops->submit_prio(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) -@@ -1765,9 +1774,9 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, - }; - --static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) -+static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) - { -- struct wined3d_cs_queue *queue = &cs->queue; -+ struct wined3d_cs_queue *queue = prio ? &cs->prio_queue : &cs->queue; - size_t queue_size = sizeof(queue->data) / sizeof(*queue->data); - - if (queue_size - size < queue->head) -@@ -1775,7 +1784,7 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) - struct wined3d_cs_skip *skip; - size_t nop_size = queue_size - queue->head; - -- skip = wined3d_cs_mt_require_space(cs, nop_size); -+ skip = _wined3d_cs_mt_require_space(cs, nop_size, prio); - if (nop_size < sizeof(*skip)) - { - skip->opcode = WINED3D_CS_OP_NOP; -@@ -1786,7 +1795,11 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) - skip->size = nop_size; - } - -- cs->ops->submit(cs, nop_size); -+ if (prio) -+ cs->ops->submit_prio(cs, nop_size); -+ else -+ cs->ops->submit(cs, nop_size); -+ - assert(!queue->head); - } - -@@ -1813,12 +1826,15 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) - return &queue->data[queue->head]; - } - --static const struct wined3d_cs_ops wined3d_cs_mt_ops = -+static inline void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) - { -- wined3d_cs_mt_require_space, -- wined3d_cs_submit, -- wined3d_cs_finish, --}; -+ return _wined3d_cs_mt_require_space(cs, size, FALSE); -+} -+ -+static inline void *wined3d_cs_mt_require_space_prio(struct wined3d_cs *cs, size_t size) -+{ -+ return _wined3d_cs_mt_require_space(cs, size, TRUE); -+} - - /* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an - * OP itself. */ -@@ -1829,9 +1845,63 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs) - op = wined3d_cs_mt_require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_STOP; - -- wined3d_cs_submit(cs, sizeof(*op)); -+ wined3d_cs_mt_submit(cs, sizeof(*op)); - } - -+static void wined3d_cs_mt_finish(struct wined3d_cs *cs) -+{ -+ BOOL fence; -+ -+ if (cs->thread_id == GetCurrentThreadId()) -+ { -+ static BOOL once; -+ if (!once) -+ { -+ FIXME("flush_and_wait called from cs thread\n"); -+ once = TRUE; -+ } -+ return; -+ } -+ -+ wined3d_cs_emit_fence(cs, &fence); -+ -+ /* A busy wait should be fine, we're not supposed to have to wait very -+ * long. */ -+ while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); -+} -+ -+static void wined3d_cs_mt_finish_prio(struct wined3d_cs *cs) -+{ -+ BOOL fence; -+ -+ if (cs->thread_id == GetCurrentThreadId()) -+ { -+ static BOOL once; -+ if (!once) -+ { -+ FIXME("flush_and_wait called from cs thread\n"); -+ once = TRUE; -+ } -+ return; -+ } -+ -+ wined3d_cs_emit_fence_prio(cs, &fence); -+ -+ /* A busy wait should be fine, we're not supposed to have to wait very -+ * long. */ -+ while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); -+} -+ -+static const struct wined3d_cs_ops wined3d_cs_mt_ops = -+{ -+ wined3d_cs_mt_require_space, -+ wined3d_cs_mt_require_space_prio, -+ wined3d_cs_mt_submit, -+ wined3d_cs_mt_submit_prio, -+ wined3d_cs_mt_finish, -+ wined3d_cs_mt_finish_prio, -+}; -+ - static void wined3d_cs_st_submit(struct wined3d_cs *cs, size_t size) - { - enum wined3d_cs_op opcode = *(const enum wined3d_cs_op *)&cs->queue.data; -@@ -1857,8 +1927,11 @@ static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) - static const struct wined3d_cs_ops wined3d_cs_st_ops = - { - wined3d_cs_st_require_space, -+ wined3d_cs_st_require_space, -+ wined3d_cs_st_submit, - wined3d_cs_st_submit, - wined3d_cs_st_finish, -+ wined3d_cs_st_finish, - }; - - void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, -@@ -1901,6 +1974,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) - enum wined3d_cs_op opcode; - LONG tail; - char poll = 0; -+ struct wined3d_cs_queue *queue; - - TRACE("Started.\n"); - -@@ -1916,13 +1990,23 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) - else - poll++; - -- if (*((volatile LONG *)&cs->queue.head) == cs->queue.tail) -+ if (*((volatile LONG *)&cs->prio_queue.head) != cs->prio_queue.tail) -+ { -+ queue = &cs->prio_queue; -+ } -+ else if (*((volatile LONG *)&cs->queue.head) != cs->queue.tail) -+ { -+ queue = &cs->queue; -+ if (*((volatile LONG *)&cs->prio_queue.head) != cs->prio_queue.tail) -+ queue = &cs->prio_queue; -+ } -+ else - { - continue; - } - -- tail = cs->queue.tail; -- opcode = *(const enum wined3d_cs_op *)&cs->queue.data[tail]; -+ tail = queue->tail; -+ opcode = *(const enum wined3d_cs_op *)&queue->data[tail]; - - if (opcode >= WINED3D_CS_OP_STOP) - { -@@ -1931,9 +2015,9 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) - goto done; - } - -- tail += wined3d_cs_op_handlers[opcode](cs, &cs->queue.data[tail]); -+ tail += wined3d_cs_op_handlers[opcode](cs, &queue->data[tail]); - tail &= (WINED3D_CS_QUEUE_SIZE - 1); -- InterlockedExchange(&cs->queue.tail, tail); -+ InterlockedExchange(&queue->tail, tail); - } - - done: -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7bda9f0..cf01a6a 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2550,8 +2550,11 @@ struct wined3d_cs_queue - struct wined3d_cs_ops - { - void *(*require_space)(struct wined3d_cs *cs, size_t size); -+ void *(*require_space_prio)(struct wined3d_cs *cs, size_t size); - void (*submit)(struct wined3d_cs *cs, size_t size); -+ void (*submit_prio)(struct wined3d_cs *cs, size_t size); - void (*finish)(struct wined3d_cs *cs); -+ void (*finish_prio)(struct wined3d_cs *cs); - }; - - struct wined3d_cs -@@ -2563,7 +2566,7 @@ struct wined3d_cs - DWORD thread_id; - struct wined3d_surface *onscreen_depth_stencil; - -- struct wined3d_cs_queue queue; -+ struct wined3d_cs_queue queue, prio_queue; - - LONG pending_presents; - struct list query_poll_list; --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Destroy-queries-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Destroy-queries-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Destroy-queries-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Destroy-queries-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,183 +0,0 @@ -From ef12b024a49a4390df02fad20938e04d5cfae35e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 21:54:45 +0200 -Subject: wined3d: Destroy queries through the CS - ---- - dlls/wined3d/cs.c | 31 ++++++++++++++++++++ - dlls/wined3d/query.c | 66 +++++++++++++++++++----------------------- - dlls/wined3d/wined3d_private.h | 3 ++ - 3 files changed, 64 insertions(+), 36 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index a7f7694..b2af05b 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -68,6 +68,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_RESOURCE_MAP, - WINED3D_CS_OP_RESOURCE_UNMAP, - WINED3D_CS_OP_QUERY_ISSUE, -+ WINED3D_CS_OP_QUERY_DESTROY, - WINED3D_CS_OP_STOP, - }; - -@@ -372,6 +373,12 @@ struct wined3d_cs_query_issue - DWORD flags; - }; - -+struct wined3d_cs_query_destroy -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_query *query; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -1726,6 +1733,29 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_query_destroy(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_query_destroy *op = data; -+ -+ if (!list_empty(&op->query->poll_list_entry)) -+ list_remove(&op->query->poll_list_entry); -+ -+ wined3d_query_destroy(op->query); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *query) -+{ -+ struct wined3d_cs_query_destroy *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_QUERY_DESTROY; -+ op->query = query; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -1772,6 +1802,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, - /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, - /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, -+ /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 621a9d7..f377eea 100644 ---- a/dlls/wined3d/query.c -+++ b/dlls/wined3d/query.c -@@ -233,50 +233,44 @@ ULONG CDECL wined3d_query_incref(struct wined3d_query *query) - return refcount; - } - --ULONG CDECL wined3d_query_decref(struct wined3d_query *query) -+void wined3d_query_destroy(struct wined3d_query *query) - { -- ULONG refcount = InterlockedDecrement(&query->ref); -- -- TRACE("%p decreasing refcount to %u.\n", query, refcount); -+ /* Queries are specific to the GL context that created them. Not -+ * deleting the query will obviously leak it, but that's still better -+ * than potentially deleting a different query with the same id in this -+ * context, and (still) leaking the actual query. */ -+ if (query->type == WINED3D_QUERY_TYPE_EVENT) -+ { -+ struct wined3d_event_query *event_query = query->extendedData; -+ if (event_query) wined3d_event_query_destroy(event_query); -+ } -+ else if (query->type == WINED3D_QUERY_TYPE_OCCLUSION) -+ { -+ struct wined3d_occlusion_query *oq = query->extendedData; - -- if (!refcount) -+ if (oq->context) context_free_occlusion_query(oq); -+ HeapFree(GetProcessHeap(), 0, query->extendedData); -+ } -+ else if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP) - { -- if (wined3d_settings.cs_multithreaded) -- { -- struct wined3d_device *device = query->device; -+ struct wined3d_timestamp_query *tq = query->extendedData; - -- FIXME("waiting for cs\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -+ if (tq->context) -+ context_free_timestamp_query(tq); -+ HeapFree(GetProcessHeap(), 0, query->extendedData); -+ } - -- /* Queries are specific to the GL context that created them. Not -- * deleting the query will obviously leak it, but that's still better -- * than potentially deleting a different query with the same id in this -- * context, and (still) leaking the actual query. */ -- if (query->type == WINED3D_QUERY_TYPE_EVENT) -- { -- struct wined3d_event_query *event_query = query->extendedData; -- if (event_query) wined3d_event_query_destroy(event_query); -- } -- else if (query->type == WINED3D_QUERY_TYPE_OCCLUSION) -- { -- struct wined3d_occlusion_query *oq = query->extendedData; -+ HeapFree(GetProcessHeap(), 0, query); -+} - -- if (oq->context) context_free_occlusion_query(oq); -- HeapFree(GetProcessHeap(), 0, query->extendedData); -- } -- else if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP) -- { -- struct wined3d_timestamp_query *tq = query->extendedData; -+ULONG CDECL wined3d_query_decref(struct wined3d_query *query) -+{ -+ ULONG refcount = InterlockedDecrement(&query->ref); - -- if (tq->context) -- context_free_timestamp_query(tq); -- HeapFree(GetProcessHeap(), 0, query->extendedData); -- } -+ TRACE("%p decreasing refcount to %u.\n", query, refcount); - -- HeapFree(GetProcessHeap(), 0, query); -- } -+ if (!refcount) -+ wined3d_cs_emit_query_destroy(query->device->cs, query); - - return refcount; - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index cf01a6a..28badf6 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2649,6 +2649,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu - DWORD flags) DECLSPEC_HIDDEN; - void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, - UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *query) DECLSPEC_HIDDEN; - - /* 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 -@@ -2683,6 +2684,8 @@ struct wined3d_query - struct list poll_list_entry; - }; - -+void wined3d_query_destroy(struct wined3d_query *query) DECLSPEC_HIDDEN; -+ - /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other - * fixed function semantics as D3DCOLOR or FLOAT16 */ - enum wined3d_buffer_conversion_type --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Poll-queries-automatically-in-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Poll-queries-automatically-in-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Poll-queries-automatically-in-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0089-wined3d-Poll-queries-automatically-in-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,576 @@ +From 3c2152778b13105e423a33889692c3b12f58653b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 19:18:48 +0200 +Subject: wined3d: Poll queries automatically in the CS + +--- + dlls/wined3d/cs.c | 76 ++++++-------- + dlls/wined3d/query.c | 221 ++++++++++++++++++++++++++--------------- + dlls/wined3d/wined3d_private.h | 7 +- + 3 files changed, 178 insertions(+), 126 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index d97ef5b..8256707 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -69,7 +69,6 @@ enum wined3d_cs_op + WINED3D_CS_OP_RESOURCE_MAP, + WINED3D_CS_OP_RESOURCE_UNMAP, + WINED3D_CS_OP_QUERY_ISSUE, +- WINED3D_CS_OP_QUERY_GET_DATA, + WINED3D_CS_OP_STOP, + }; + +@@ -383,16 +382,6 @@ struct wined3d_cs_query_issue + DWORD flags; + }; + +-struct wined3d_cs_query_get_data +-{ +- enum wined3d_cs_op opcode; +- struct wined3d_query *query; +- void *data; +- UINT data_size; +- DWORD flags; +- HRESULT *ret; +-}; +- + static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -1822,8 +1811,9 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) + + query->query_ops->query_issue(query, op->flags); + +- if (op->flags & WINED3DISSUE_END) +- InterlockedIncrement(&query->counter_worker); ++ if (wined3d_settings.cs_multithreaded && op->flags & WINED3DISSUE_END ++ && list_empty(&query->poll_list_entry)) ++ list_add_tail(&cs->query_poll_list, &query->poll_list_entry); + + return sizeof(*op); + } +@@ -1840,37 +1830,6 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu + cs->ops->submit(cs, sizeof(*op)); + } + +-static UINT wined3d_cs_exec_query_get_data(struct wined3d_cs *cs, const void *data) +-{ +- const struct wined3d_cs_query_get_data *op = data; +- struct wined3d_query *query = op->query; +- +- *op->ret = query->query_ops->query_get_data(query, op->data, op->data_size, op->flags); +- +- return sizeof(*op); +-} +- +-void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, +- UINT data_size, DWORD flags, HRESULT *ret) +-{ +- struct wined3d_cs_query_get_data *op; +- +- op = cs->ops->require_space(cs, sizeof(*op)); +- op->opcode = WINED3D_CS_OP_QUERY_GET_DATA; +- op->query = query; +- op->data = data; +- op->data_size = data_size; +- op->flags = flags; +- op->ret = ret; +- +- cs->ops->submit(cs, sizeof(*op)); +- +- if (wined3d_settings.cs_multithreaded) +- FIXME("Query handling is not particularly fast yet\n"); +- +- cs->ops->finish(cs); +-} +- + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -1918,7 +1877,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, + /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, +- /* WINED3D_CS_OP_QUERY_GET_DATA */ wined3d_cs_exec_query_get_data, + }; + + static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) +@@ -2033,17 +1991,45 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, + wined3d_surface_incref(cs->onscreen_depth_stencil); + } + ++static inline void poll_queries(struct wined3d_cs *cs) ++{ ++ struct wined3d_query *query, *cursor; ++ ++ LIST_FOR_EACH_ENTRY_SAFE(query, cursor, &cs->query_poll_list, struct wined3d_query, poll_list_entry) ++ { ++ BOOL ret; ++ ++ ret = query->query_ops->query_poll(query); ++ if (ret) ++ { ++ list_remove(&query->poll_list_entry); ++ list_init(&query->poll_list_entry); ++ InterlockedIncrement(&query->counter_retrieved); ++ } ++ } ++} ++ + static DWORD WINAPI wined3d_cs_run(void *thread_param) + { + struct wined3d_cs *cs = thread_param; + enum wined3d_cs_op opcode; + LONG tail; ++ char poll = 0; + + TRACE("Started.\n"); + ++ list_init(&cs->query_poll_list); + cs->thread_id = GetCurrentThreadId(); + for (;;) + { ++ if (poll == 10) ++ { ++ poll = 0; ++ poll_queries(cs); ++ } ++ else ++ poll++; ++ + if (*((volatile LONG *)&cs->queue.head) == cs->queue.tail) + { + continue; +diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +index 9bdb35e..9f1f5ad 100644 +--- a/dlls/wined3d/query.c ++++ b/dlls/wined3d/query.c +@@ -241,6 +241,15 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) + + if (!refcount) + { ++ if (wined3d_settings.cs_multithreaded) ++ { ++ struct wined3d_device *device = query->device; ++ ++ FIXME("waiting for cs\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + /* Queries are specific to the GL context that created them. Not + * deleting the query will obviously leak it, but that's still better + * than potentially deleting a different query with the same id in this +@@ -275,20 +284,10 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) + HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, + void *data, UINT data_size, DWORD flags) + { +- HRESULT hr; + TRACE("query %p, data %p, data_size %u, flags %#x.\n", + query, data, data_size, flags); + +- if (query->counter_main != query->counter_worker) +- { +- TRACE("D3DISSUE_END command not submitted to GL yet\n"); +- return S_FALSE; +- } +- +- wined3d_cs_emit_query_get_data(query->device->cs, query, data, data_size, +- flags, &hr); +- +- return hr; ++ return query->query_ops->query_get_data(query, data, data_size, flags); + } + + UINT CDECL wined3d_query_get_data_size(const struct wined3d_query *query) +@@ -317,15 +316,10 @@ static void fill_query_data(void *out, unsigned int out_size, const void *result + static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, + void *data, DWORD size, DWORD flags) + { +- struct wined3d_occlusion_query *oq = query->extendedData; + struct wined3d_device *device = query->device; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; +- struct wined3d_context *context; +- GLuint available; ++ struct wined3d_occlusion_query *oq = query->extendedData; + GLuint samples; +- HRESULT res; +- +- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); + + if (!oq->context) + query->state = QUERY_CREATED; +@@ -339,6 +333,8 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, + return S_OK; + } + ++ TRACE("(%p) : type D3DQUERY_OCCLUSION, data %p, size %#x, flags %#x.\n", query, data, size, flags); ++ + if (query->state == QUERY_BUILDING) + { + /* Msdn says this returns an error, but our tests show that S_FALSE is returned */ +@@ -354,12 +350,37 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, + return S_OK; + } + ++ if (!wined3d_settings.cs_multithreaded) ++ { ++ if (!query->query_ops->query_poll(query)) ++ return S_FALSE; ++ } ++ else if (query->counter_main != query->counter_retrieved) ++ { ++ return S_FALSE; ++ } ++ ++ if (data) ++ fill_query_data(data, size, &oq->samples, sizeof(oq->samples)); ++ ++ return S_OK; ++} ++ ++static BOOL wined3d_occlusion_query_ops_poll(struct wined3d_query *query) ++{ ++ struct wined3d_occlusion_query *oq = query->extendedData; ++ struct wined3d_device *device = query->device; ++ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; ++ struct wined3d_context *context; ++ GLuint available; ++ GLuint samples; ++ BOOL ret; ++ + if (oq->context->tid != GetCurrentThreadId()) + { + FIXME("%p Wrong thread, returning 1.\n", query); +- samples = 1; +- fill_query_data(data, size, &samples, sizeof(samples)); +- return S_OK; ++ oq->samples = 1; ++ return TRUE; + } + + context = context_acquire(query->device, oq->context->current_rt); +@@ -370,68 +391,78 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, + + if (available) + { +- if (size) +- { +- GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &samples)); +- checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT)"); +- TRACE("Returning %d samples.\n", samples); +- fill_query_data(data, size, &samples, sizeof(samples)); +- } +- res = S_OK; ++ GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &samples)); ++ checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT)"); ++ TRACE("Returning %d samples.\n", samples); ++ oq->samples = samples; ++ ret = TRUE; + } + else + { +- res = S_FALSE; ++ ret = FALSE; + } + + context_release(context); + +- return res; ++ return ret; + } + +-static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, +- void *data, DWORD size, DWORD flags) ++static BOOL wined3d_event_query_ops_poll(struct wined3d_query *query) + { + struct wined3d_event_query *event_query = query->extendedData; +- BOOL signaled; + enum wined3d_event_query_result ret; + +- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); +- +- if (!data || !size) return S_OK; +- if (!event_query) +- { +- WARN("Event query not supported by GL, reporting GPU idle.\n"); +- signaled = TRUE; +- fill_query_data(data, size, &signaled, sizeof(signaled)); +- return S_OK; +- } +- + ret = wined3d_event_query_test(event_query, query->device); + switch(ret) + { + case WINED3D_EVENT_QUERY_OK: + case WINED3D_EVENT_QUERY_NOT_STARTED: +- signaled = TRUE; +- fill_query_data(data, size, &signaled, sizeof(signaled)); +- break; ++ return TRUE; + + case WINED3D_EVENT_QUERY_WAITING: +- signaled = FALSE; +- fill_query_data(data, size, &signaled, sizeof(signaled)); +- break; ++ return FALSE; + + case WINED3D_EVENT_QUERY_WRONG_THREAD: + FIXME("(%p) Wrong thread, reporting GPU idle.\n", query); +- signaled = TRUE; +- fill_query_data(data, size, &signaled, sizeof(signaled)); +- break; ++ return TRUE; + + case WINED3D_EVENT_QUERY_ERROR: + ERR("The GL event query failed, returning D3DERR_INVALIDCALL\n"); +- return WINED3DERR_INVALIDCALL; ++ return TRUE; ++ ++ default: ++ ERR("Unexpected wined3d_event_query_test result %u\n", ret); ++ return TRUE; ++ } ++} ++ ++static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, ++ void *pData, DWORD dwSize, DWORD flags) ++{ ++ struct wined3d_event_query *event_query = query->extendedData; ++ BOOL *data = pData; ++ enum wined3d_event_query_result ret; ++ ++ TRACE("query %p, pData %p, dwSize %#x, flags %#x.\n", query, pData, dwSize, flags); ++ ++ if (!pData || !dwSize) return S_OK; ++ if (!event_query) ++ { ++ WARN("Event query not supported by GL, reporting GPU idle.\n"); ++ *data = TRUE; ++ return S_OK; + } + ++ if (!wined3d_settings.cs_multithreaded) ++ ret = query->query_ops->query_poll(query); ++ else if (query->counter_main != query->counter_retrieved) ++ ret = FALSE; ++ else ++ ret = TRUE; ++ ++ if (data) ++ fill_query_data(data, dwSize, &ret, sizeof(ret)); ++ + return S_OK; + } + +@@ -561,33 +592,57 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, + void *data, DWORD size, DWORD flags) + { + struct wined3d_timestamp_query *tq = query->extendedData; ++ ++ TRACE("(%p) : type D3DQUERY_TIMESTAMP, data %p, size %#x, flags %#x.\n", query, data, size, flags); ++ ++ if (query->state == QUERY_CREATED) ++ { ++ UINT64 zero = 0; ++ /* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves */ ++ TRACE("Query wasn't yet started, returning S_OK.\n"); ++ if (data) ++ fill_query_data(data, size, &zero, sizeof(zero)); ++ return S_OK; ++ } ++ ++ if (!wined3d_settings.cs_multithreaded) ++ { ++ if (!query->query_ops->query_poll(query)) ++ return S_FALSE; ++ } ++ else if (query->counter_main != query->counter_retrieved) ++ { ++ return S_FALSE; ++ } ++ ++ if (data) ++ fill_query_data(data, size, &tq->timestamp, sizeof(tq->timestamp)); ++ ++ return S_OK; ++} ++ ++static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) ++{ ++ struct wined3d_timestamp_query *tq = query->extendedData; + struct wined3d_device *device = query->device; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + struct wined3d_context *context; + GLuint available; + GLuint64 timestamp; +- HRESULT res; +- +- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); ++ BOOL ret; + +- if (!tq->context) +- query->state = QUERY_CREATED; +- +- if (query->state == QUERY_CREATED) ++ if (!gl_info->supported[ARB_TIMER_QUERY]) + { +- /* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves. */ +- TRACE("Query wasn't yet started, returning S_OK.\n"); +- timestamp = 0; +- fill_query_data(data, size, ×tamp, sizeof(timestamp)); +- return S_OK; ++ TRACE("Faking timestamp.\n"); ++ QueryPerformanceCounter((LARGE_INTEGER *)&tq->timestamp); ++ return TRUE; + } + + if (tq->context->tid != GetCurrentThreadId()) + { + FIXME("%p Wrong thread, returning 1.\n", query); +- timestamp = 1; +- fill_query_data(data, size, ×tamp, sizeof(timestamp)); +- return S_OK; ++ tq->timestamp = 1; ++ return TRUE; + } + + context = context_acquire(query->device, tq->context->current_rt); +@@ -598,23 +653,20 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, + + if (available) + { +- if (size) +- { +- GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT, ×tamp)); +- checkGLcall("glGetQueryObjectui64v(GL_QUERY_RESULT)"); +- TRACE("Returning timestamp %s.\n", wine_dbgstr_longlong(timestamp)); +- fill_query_data(data, size, ×tamp, sizeof(timestamp)); +- } +- res = S_OK; ++ GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT, ×tamp)); ++ checkGLcall("glGetQueryObjectui64v(GL_QUERY_RESULT)"); ++ TRACE("Returning timestamp %s.\n", wine_dbgstr_longlong(timestamp)); ++ tq->timestamp = timestamp; ++ ret = TRUE; + } + else + { +- res = S_FALSE; ++ ret = FALSE; + } + + context_release(context); + +- return res; ++ return ret; + } + + static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) +@@ -657,7 +709,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer + void *data, DWORD size, DWORD flags) + { + TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); +- + if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) + { + static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE}; +@@ -679,6 +730,11 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer + return S_OK; + } + ++static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *query) ++{ ++ return TRUE; ++} ++ + static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) + { + TRACE("query %p, flags %#x.\n", query, flags); +@@ -692,24 +748,28 @@ static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *que + static const struct wined3d_query_ops event_query_ops = + { + wined3d_event_query_ops_get_data, ++ wined3d_event_query_ops_poll, + wined3d_event_query_ops_issue, + }; + + static const struct wined3d_query_ops occlusion_query_ops = + { + wined3d_occlusion_query_ops_get_data, ++ wined3d_occlusion_query_ops_poll, + wined3d_occlusion_query_ops_issue, + }; + + static const struct wined3d_query_ops timestamp_query_ops = + { + wined3d_timestamp_query_ops_get_data, ++ wined3d_timestamp_query_ops_poll, + wined3d_timestamp_query_ops_issue, + }; + + static const struct wined3d_query_ops timestamp_disjoint_query_ops = + { + wined3d_timestamp_disjoint_query_ops_get_data, ++ wined3d_timestamp_disjoint_query_ops_poll, + wined3d_timestamp_disjoint_query_ops_issue, + }; + +@@ -810,6 +870,7 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de + query->state = QUERY_CREATED; + query->device = device; + query->ref = 1; ++ list_init(&query->poll_list_entry); + + return WINED3D_OK; + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 56d9b0c..4c4ee51 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -1090,6 +1090,7 @@ struct wined3d_occlusion_query + struct list entry; + GLuint id; + struct wined3d_context *context; ++ DWORD samples; + }; + + union wined3d_gl_query_object +@@ -1125,6 +1126,7 @@ struct wined3d_timestamp_query + struct list entry; + GLuint id; + struct wined3d_context *context; ++ UINT64 timestamp; + }; + + void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; +@@ -2610,6 +2612,7 @@ struct wined3d_cs + struct wined3d_cs_queue queue; + + LONG pending_presents; ++ struct list query_poll_list; + }; + + struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; +@@ -2705,6 +2708,7 @@ enum query_state { + struct wined3d_query_ops + { + HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); ++ BOOL (*query_poll)(struct wined3d_query *query); + void (*query_issue)(struct wined3d_query *query, DWORD flags); + }; + +@@ -2720,7 +2724,8 @@ struct wined3d_query + DWORD data_size; + void *extendedData; + +- LONG counter_main, counter_worker; ++ LONG counter_main, counter_retrieved; ++ struct list poll_list_entry; + }; + + /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other +-- +2.3.7 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Introduce-a-separate-queue-for-priority-comm.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Introduce-a-separate-queue-for-priority-comm.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Introduce-a-separate-queue-for-priority-comm.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Introduce-a-separate-queue-for-priority-comm.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,268 @@ +From 0a14b53f4dcb38e852db14d186d14c8526f3549a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 19:18:03 +0200 +Subject: wined3d: Introduce a separate queue for priority commands + +--- + dlls/wined3d/cs.c | 128 ++++++++++++++++++++++++++++++++++------- + dlls/wined3d/wined3d_private.h | 5 +- + 2 files changed, 110 insertions(+), 23 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 68e1ed7..a7f7694 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -372,7 +372,7 @@ struct wined3d_cs_query_issue + DWORD flags; + }; + +-static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) ++static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); + /* There is only one thread writing to queue.head, InterlockedExchange +@@ -380,6 +380,14 @@ static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) + InterlockedExchange(&cs->queue.head, new_val); + } + ++static void wined3d_cs_mt_submit_prio(struct wined3d_cs *cs, size_t size) ++{ ++ LONG new_val = (cs->prio_queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); ++ /* There is only one thread writing to queue.head, InterlockedExchange ++ * is used for the memory barrier. */ ++ InterlockedExchange(&cs->prio_queue.head, new_val); ++} ++ + static UINT wined3d_cs_exec_nop(struct wined3d_cs *cs, const void *data) + { + return sizeof(enum wined3d_cs_op); +@@ -413,15 +421,16 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled) + cs->ops->submit(cs, sizeof(*op)); + } + +-static void wined3d_cs_finish(struct wined3d_cs *cs) ++static void wined3d_cs_emit_fence_prio(struct wined3d_cs *cs, BOOL *signalled) + { +- BOOL fence; ++ struct wined3d_cs_fence *op; + +- wined3d_cs_emit_fence(cs, &fence); ++ *signalled = FALSE; + +- /* A busy wait should be fine, we're not supposed to have to wait very +- * long. */ +- while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); ++ op = cs->ops->require_space_prio(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_FENCE; ++ op->signalled = signalled; ++ cs->ops->submit_prio(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) +@@ -1765,9 +1774,9 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, + }; + +-static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) ++static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) + { +- struct wined3d_cs_queue *queue = &cs->queue; ++ struct wined3d_cs_queue *queue = prio ? &cs->prio_queue : &cs->queue; + size_t queue_size = sizeof(queue->data) / sizeof(*queue->data); + + if (queue_size - size < queue->head) +@@ -1775,7 +1784,7 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) + struct wined3d_cs_skip *skip; + size_t nop_size = queue_size - queue->head; + +- skip = wined3d_cs_mt_require_space(cs, nop_size); ++ skip = _wined3d_cs_mt_require_space(cs, nop_size, prio); + if (nop_size < sizeof(*skip)) + { + skip->opcode = WINED3D_CS_OP_NOP; +@@ -1786,7 +1795,11 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) + skip->size = nop_size; + } + +- cs->ops->submit(cs, nop_size); ++ if (prio) ++ cs->ops->submit_prio(cs, nop_size); ++ else ++ cs->ops->submit(cs, nop_size); ++ + assert(!queue->head); + } + +@@ -1813,12 +1826,15 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) + return &queue->data[queue->head]; + } + +-static const struct wined3d_cs_ops wined3d_cs_mt_ops = ++static inline void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) + { +- wined3d_cs_mt_require_space, +- wined3d_cs_submit, +- wined3d_cs_finish, +-}; ++ return _wined3d_cs_mt_require_space(cs, size, FALSE); ++} ++ ++static inline void *wined3d_cs_mt_require_space_prio(struct wined3d_cs *cs, size_t size) ++{ ++ return _wined3d_cs_mt_require_space(cs, size, TRUE); ++} + + /* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an + * OP itself. */ +@@ -1829,9 +1845,63 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs) + op = wined3d_cs_mt_require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_STOP; + +- wined3d_cs_submit(cs, sizeof(*op)); ++ wined3d_cs_mt_submit(cs, sizeof(*op)); + } + ++static void wined3d_cs_mt_finish(struct wined3d_cs *cs) ++{ ++ BOOL fence; ++ ++ if (cs->thread_id == GetCurrentThreadId()) ++ { ++ static BOOL once; ++ if (!once) ++ { ++ FIXME("flush_and_wait called from cs thread\n"); ++ once = TRUE; ++ } ++ return; ++ } ++ ++ wined3d_cs_emit_fence(cs, &fence); ++ ++ /* A busy wait should be fine, we're not supposed to have to wait very ++ * long. */ ++ while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); ++} ++ ++static void wined3d_cs_mt_finish_prio(struct wined3d_cs *cs) ++{ ++ BOOL fence; ++ ++ if (cs->thread_id == GetCurrentThreadId()) ++ { ++ static BOOL once; ++ if (!once) ++ { ++ FIXME("flush_and_wait called from cs thread\n"); ++ once = TRUE; ++ } ++ return; ++ } ++ ++ wined3d_cs_emit_fence_prio(cs, &fence); ++ ++ /* A busy wait should be fine, we're not supposed to have to wait very ++ * long. */ ++ while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); ++} ++ ++static const struct wined3d_cs_ops wined3d_cs_mt_ops = ++{ ++ wined3d_cs_mt_require_space, ++ wined3d_cs_mt_require_space_prio, ++ wined3d_cs_mt_submit, ++ wined3d_cs_mt_submit_prio, ++ wined3d_cs_mt_finish, ++ wined3d_cs_mt_finish_prio, ++}; ++ + static void wined3d_cs_st_submit(struct wined3d_cs *cs, size_t size) + { + enum wined3d_cs_op opcode = *(const enum wined3d_cs_op *)&cs->queue.data; +@@ -1857,8 +1927,11 @@ static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) + static const struct wined3d_cs_ops wined3d_cs_st_ops = + { + wined3d_cs_st_require_space, ++ wined3d_cs_st_require_space, ++ wined3d_cs_st_submit, + wined3d_cs_st_submit, + wined3d_cs_st_finish, ++ wined3d_cs_st_finish, + }; + + void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, +@@ -1901,6 +1974,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) + enum wined3d_cs_op opcode; + LONG tail; + char poll = 0; ++ struct wined3d_cs_queue *queue; + + TRACE("Started.\n"); + +@@ -1916,13 +1990,23 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) + else + poll++; + +- if (*((volatile LONG *)&cs->queue.head) == cs->queue.tail) ++ if (*((volatile LONG *)&cs->prio_queue.head) != cs->prio_queue.tail) ++ { ++ queue = &cs->prio_queue; ++ } ++ else if (*((volatile LONG *)&cs->queue.head) != cs->queue.tail) ++ { ++ queue = &cs->queue; ++ if (*((volatile LONG *)&cs->prio_queue.head) != cs->prio_queue.tail) ++ queue = &cs->prio_queue; ++ } ++ else + { + continue; + } + +- tail = cs->queue.tail; +- opcode = *(const enum wined3d_cs_op *)&cs->queue.data[tail]; ++ tail = queue->tail; ++ opcode = *(const enum wined3d_cs_op *)&queue->data[tail]; + + if (opcode >= WINED3D_CS_OP_STOP) + { +@@ -1931,9 +2015,9 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) + goto done; + } + +- tail += wined3d_cs_op_handlers[opcode](cs, &cs->queue.data[tail]); ++ tail += wined3d_cs_op_handlers[opcode](cs, &queue->data[tail]); + tail &= (WINED3D_CS_QUEUE_SIZE - 1); +- InterlockedExchange(&cs->queue.tail, tail); ++ InterlockedExchange(&queue->tail, tail); + } + + done: +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 7bda9f0..cf01a6a 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2550,8 +2550,11 @@ struct wined3d_cs_queue + struct wined3d_cs_ops + { + void *(*require_space)(struct wined3d_cs *cs, size_t size); ++ void *(*require_space_prio)(struct wined3d_cs *cs, size_t size); + void (*submit)(struct wined3d_cs *cs, size_t size); ++ void (*submit_prio)(struct wined3d_cs *cs, size_t size); + void (*finish)(struct wined3d_cs *cs); ++ void (*finish_prio)(struct wined3d_cs *cs); + }; + + struct wined3d_cs +@@ -2563,7 +2566,7 @@ struct wined3d_cs + DWORD thread_id; + struct wined3d_surface *onscreen_depth_stencil; + +- struct wined3d_cs_queue queue; ++ struct wined3d_cs_queue queue, prio_queue; + + LONG pending_presents; + struct list query_poll_list; +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Separate-main-and-worker-thread-query-state.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Separate-main-and-worker-thread-query-state.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Separate-main-and-worker-thread-query-state.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0090-wined3d-Separate-main-and-worker-thread-query-state.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -From 1a53e5cd7279145ad9f78f2970a186f488216d6b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 24 Jul 2013 16:34:17 +0200 -Subject: wined3d: Separate main and worker thread query state - ---- - dlls/wined3d/query.c | 34 ++++++++++++---------------------- - dlls/wined3d/wined3d_private.h | 1 + - 2 files changed, 13 insertions(+), 22 deletions(-) - -diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index f377eea..97483a2 100644 ---- a/dlls/wined3d/query.c -+++ b/dlls/wined3d/query.c -@@ -299,6 +299,12 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) - query->counter_main++; - - wined3d_cs_emit_query_issue(query->device->cs, query, flags); -+ -+ if (flags & WINED3DISSUE_BEGIN) -+ query->state = QUERY_BUILDING; -+ else -+ query->state = QUERY_SIGNALLED; -+ - return WINED3D_OK; - } - -@@ -493,11 +499,6 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla - /* Started implicitly at device creation */ - ERR("Event query issued with START flag - what to do?\n"); - } -- -- if (flags & WINED3DISSUE_BEGIN) -- query->state = QUERY_BUILDING; -- else -- query->state = QUERY_SIGNALLED; - } - - static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) -@@ -515,7 +516,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - /* This is allowed according to msdn and our tests. Reset the query and restart */ - if (flags & WINED3DISSUE_BEGIN) - { -- if (query->state == QUERY_BUILDING) -+ if (oq->started) - { - if (oq->context->tid != GetCurrentThreadId()) - { -@@ -544,6 +545,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - checkGLcall("glBeginQuery()"); - - context_release(context); -+ oq->started = TRUE; - } - if (flags & WINED3DISSUE_END) - { -@@ -551,7 +553,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - * our tests show that it returns OK. But OpenGL doesn't like it, so avoid - * generating an error - */ -- if (query->state == QUERY_BUILDING) -+ if (oq->started) - { - if (oq->context->tid != GetCurrentThreadId()) - { -@@ -567,6 +569,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - context_release(context); - } - } -+ oq->started = FALSE; - } - } - else -@@ -574,11 +577,6 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - FIXME("%p Occlusion queries not supported.\n", query); - } - -- if (flags & WINED3DISSUE_BEGIN) -- query->state = QUERY_BUILDING; -- else -- query->state = QUERY_SIGNALLED; -- - return; - } - -@@ -694,9 +692,6 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD - { - ERR("Timestamp queries not supported.\n"); - } -- -- if (flags & WINED3DISSUE_END) -- query->state = QUERY_SIGNALLED; - } - - static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, -@@ -732,11 +727,6 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer - static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); -- -- if (flags & WINED3DISSUE_BEGIN) -- query->state = QUERY_BUILDING; -- if (flags & WINED3DISSUE_END) -- query->state = QUERY_SIGNALLED; - } - - static const struct wined3d_query_ops event_query_ops = -@@ -785,13 +775,13 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de - } - query->query_ops = &occlusion_query_ops; - query->data_size = sizeof(DWORD); -- query->extendedData = HeapAlloc(GetProcessHeap(), 0, sizeof(struct wined3d_occlusion_query)); -+ query->extendedData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, -+ sizeof(struct wined3d_occlusion_query)); - if (!query->extendedData) - { - ERR("Failed to allocate occlusion query extended data.\n"); - return E_OUTOFMEMORY; - } -- ((struct wined3d_occlusion_query *)query->extendedData)->context = NULL; - break; - - case WINED3D_QUERY_TYPE_EVENT: -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 28badf6..ec474dd 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -1052,6 +1052,7 @@ struct wined3d_occlusion_query - GLuint id; - struct wined3d_context *context; - DWORD samples; -+ BOOL started; - }; - - union wined3d_gl_query_object --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Destroy-queries-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Destroy-queries-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Destroy-queries-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Destroy-queries-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,183 @@ +From ef12b024a49a4390df02fad20938e04d5cfae35e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 21:54:45 +0200 +Subject: wined3d: Destroy queries through the CS + +--- + dlls/wined3d/cs.c | 31 ++++++++++++++++++++ + dlls/wined3d/query.c | 66 +++++++++++++++++++----------------------- + dlls/wined3d/wined3d_private.h | 3 ++ + 3 files changed, 64 insertions(+), 36 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index a7f7694..b2af05b 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -68,6 +68,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_RESOURCE_MAP, + WINED3D_CS_OP_RESOURCE_UNMAP, + WINED3D_CS_OP_QUERY_ISSUE, ++ WINED3D_CS_OP_QUERY_DESTROY, + WINED3D_CS_OP_STOP, + }; + +@@ -372,6 +373,12 @@ struct wined3d_cs_query_issue + DWORD flags; + }; + ++struct wined3d_cs_query_destroy ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_query *query; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -1726,6 +1733,29 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_query_destroy(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_query_destroy *op = data; ++ ++ if (!list_empty(&op->query->poll_list_entry)) ++ list_remove(&op->query->poll_list_entry); ++ ++ wined3d_query_destroy(op->query); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *query) ++{ ++ struct wined3d_cs_query_destroy *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_QUERY_DESTROY; ++ op->query = query; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -1772,6 +1802,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, + /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, ++ /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +index 621a9d7..f377eea 100644 +--- a/dlls/wined3d/query.c ++++ b/dlls/wined3d/query.c +@@ -233,50 +233,44 @@ ULONG CDECL wined3d_query_incref(struct wined3d_query *query) + return refcount; + } + +-ULONG CDECL wined3d_query_decref(struct wined3d_query *query) ++void wined3d_query_destroy(struct wined3d_query *query) + { +- ULONG refcount = InterlockedDecrement(&query->ref); +- +- TRACE("%p decreasing refcount to %u.\n", query, refcount); ++ /* Queries are specific to the GL context that created them. Not ++ * deleting the query will obviously leak it, but that's still better ++ * than potentially deleting a different query with the same id in this ++ * context, and (still) leaking the actual query. */ ++ if (query->type == WINED3D_QUERY_TYPE_EVENT) ++ { ++ struct wined3d_event_query *event_query = query->extendedData; ++ if (event_query) wined3d_event_query_destroy(event_query); ++ } ++ else if (query->type == WINED3D_QUERY_TYPE_OCCLUSION) ++ { ++ struct wined3d_occlusion_query *oq = query->extendedData; + +- if (!refcount) ++ if (oq->context) context_free_occlusion_query(oq); ++ HeapFree(GetProcessHeap(), 0, query->extendedData); ++ } ++ else if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP) + { +- if (wined3d_settings.cs_multithreaded) +- { +- struct wined3d_device *device = query->device; ++ struct wined3d_timestamp_query *tq = query->extendedData; + +- FIXME("waiting for cs\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } ++ if (tq->context) ++ context_free_timestamp_query(tq); ++ HeapFree(GetProcessHeap(), 0, query->extendedData); ++ } + +- /* Queries are specific to the GL context that created them. Not +- * deleting the query will obviously leak it, but that's still better +- * than potentially deleting a different query with the same id in this +- * context, and (still) leaking the actual query. */ +- if (query->type == WINED3D_QUERY_TYPE_EVENT) +- { +- struct wined3d_event_query *event_query = query->extendedData; +- if (event_query) wined3d_event_query_destroy(event_query); +- } +- else if (query->type == WINED3D_QUERY_TYPE_OCCLUSION) +- { +- struct wined3d_occlusion_query *oq = query->extendedData; ++ HeapFree(GetProcessHeap(), 0, query); ++} + +- if (oq->context) context_free_occlusion_query(oq); +- HeapFree(GetProcessHeap(), 0, query->extendedData); +- } +- else if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP) +- { +- struct wined3d_timestamp_query *tq = query->extendedData; ++ULONG CDECL wined3d_query_decref(struct wined3d_query *query) ++{ ++ ULONG refcount = InterlockedDecrement(&query->ref); + +- if (tq->context) +- context_free_timestamp_query(tq); +- HeapFree(GetProcessHeap(), 0, query->extendedData); +- } ++ TRACE("%p decreasing refcount to %u.\n", query, refcount); + +- HeapFree(GetProcessHeap(), 0, query); +- } ++ if (!refcount) ++ wined3d_cs_emit_query_destroy(query->device->cs, query); + + return refcount; + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index cf01a6a..28badf6 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2649,6 +2649,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu + DWORD flags) DECLSPEC_HIDDEN; + void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, + UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *query) DECLSPEC_HIDDEN; + + /* 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 +@@ -2683,6 +2684,8 @@ struct wined3d_query + struct list poll_list_entry; + }; + ++void wined3d_query_destroy(struct wined3d_query *query) DECLSPEC_HIDDEN; ++ + /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other + * fixed function semantics as D3DCOLOR or FLOAT16 */ + enum wined3d_buffer_conversion_type +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Don-t-poll-queries-that-failed-to-start.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Don-t-poll-queries-that-failed-to-start.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Don-t-poll-queries-that-failed-to-start.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0091-wined3d-Don-t-poll-queries-that-failed-to-start.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -From 3ee3d46182ba5a4f968d2bed318a80e9380b1246 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 24 Jul 2013 17:27:35 +0200 -Subject: wined3d: Don't poll queries that failed to start - ---- - dlls/wined3d/cs.c | 5 +++-- - dlls/wined3d/query.c | 21 +++++++++++++++------ - dlls/wined3d/wined3d_private.h | 2 +- - 3 files changed, 19 insertions(+), 9 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index b2af05b..4c0695a 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1711,10 +1711,11 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_query_issue *op = data; - struct wined3d_query *query = op->query; -+ BOOL poll; - -- query->query_ops->query_issue(query, op->flags); -+ poll = query->query_ops->query_issue(query, op->flags); - -- if (wined3d_settings.cs_multithreaded && op->flags & WINED3DISSUE_END -+ if (wined3d_settings.cs_multithreaded && poll - && list_empty(&query->poll_list_entry)) - list_add_tail(&cs->query_poll_list, &query->poll_list_entry); - -diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 97483a2..a42a1bd 100644 ---- a/dlls/wined3d/query.c -+++ b/dlls/wined3d/query.c -@@ -480,7 +480,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query - return query->type; - } - --static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags) -+static BOOL wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); - -@@ -490,21 +490,24 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla - struct wined3d_event_query *event_query = query->extendedData; - - /* Faked event query support */ -- if (!event_query) return; -+ if (!event_query) return FALSE; - - wined3d_event_query_issue(event_query, query->device); -+ return TRUE; - } - else if (flags & WINED3DISSUE_BEGIN) - { - /* Started implicitly at device creation */ - ERR("Event query issued with START flag - what to do?\n"); - } -+ return FALSE; - } - --static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) -+static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - struct wined3d_device *device = query->device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -+ BOOL poll = FALSE; - - TRACE("query %p, flags %#x.\n", query, flags); - -@@ -570,6 +573,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - } - } - oq->started = FALSE; -+ poll = TRUE; - } - } - else -@@ -577,7 +581,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - FIXME("%p Occlusion queries not supported.\n", query); - } - -- return; -+ return poll; - } - - static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, -@@ -661,7 +665,7 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) - return ret; - } - --static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) -+static BOOL wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - struct wined3d_device *device = query->device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -692,6 +696,10 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD - { - ERR("Timestamp queries not supported.\n"); - } -+ -+ if (flags & WINED3DISSUE_END) -+ return TRUE; -+ return FALSE; - } - - static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, -@@ -724,9 +732,10 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer - return TRUE; - } - --static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) -+static BOOL wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); -+ return FALSE; - } - - static const struct wined3d_query_ops event_query_ops = -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ec474dd..8dd9786 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2666,7 +2666,7 @@ struct wined3d_query_ops - { - HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); - BOOL (*query_poll)(struct wined3d_query *query); -- void (*query_issue)(struct wined3d_query *query, DWORD flags); -+ BOOL (*query_issue)(struct wined3d_query *query, DWORD flags); - }; - - struct wined3d_query --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Remove-restated-queries-from-the-poll-list.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Remove-restated-queries-from-the-poll-list.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Remove-restated-queries-from-the-poll-list.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Remove-restated-queries-from-the-poll-list.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -From d46500650ef16a6bd292705ce9896bc8b1427d99 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 24 Jul 2013 17:50:16 +0200 -Subject: wined3d: Remove restated queries from the poll list - ---- - dlls/wined3d/cs.c | 17 ++++++++++++++--- - 1 file changed, 14 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 4c0695a..5c19a17 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1715,9 +1715,20 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) - - poll = query->query_ops->query_issue(query, op->flags); - -- if (wined3d_settings.cs_multithreaded && poll -- && list_empty(&query->poll_list_entry)) -- list_add_tail(&cs->query_poll_list, &query->poll_list_entry); -+ if (wined3d_settings.cs_multithreaded) -+ { -+ if (poll && list_empty(&query->poll_list_entry)) -+ { -+ list_add_tail(&cs->query_poll_list, &query->poll_list_entry); -+ } -+ else if (!poll && !list_empty(&query->poll_list_entry)) -+ { -+ /* Can happen if occlusion queries are restarted. This discards the old -+ * result, polling it could result in a GL error */ -+ list_remove(&query->poll_list_entry); -+ list_init(&query->poll_list_entry); -+ } -+ } - - return sizeof(*op); - } --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Separate-main-and-worker-thread-query-state.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Separate-main-and-worker-thread-query-state.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Separate-main-and-worker-thread-query-state.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0092-wined3d-Separate-main-and-worker-thread-query-state.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,138 @@ +From 1a53e5cd7279145ad9f78f2970a186f488216d6b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 24 Jul 2013 16:34:17 +0200 +Subject: wined3d: Separate main and worker thread query state + +--- + dlls/wined3d/query.c | 34 ++++++++++++---------------------- + dlls/wined3d/wined3d_private.h | 1 + + 2 files changed, 13 insertions(+), 22 deletions(-) + +diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +index f377eea..97483a2 100644 +--- a/dlls/wined3d/query.c ++++ b/dlls/wined3d/query.c +@@ -299,6 +299,12 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) + query->counter_main++; + + wined3d_cs_emit_query_issue(query->device->cs, query, flags); ++ ++ if (flags & WINED3DISSUE_BEGIN) ++ query->state = QUERY_BUILDING; ++ else ++ query->state = QUERY_SIGNALLED; ++ + return WINED3D_OK; + } + +@@ -493,11 +499,6 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla + /* Started implicitly at device creation */ + ERR("Event query issued with START flag - what to do?\n"); + } +- +- if (flags & WINED3DISSUE_BEGIN) +- query->state = QUERY_BUILDING; +- else +- query->state = QUERY_SIGNALLED; + } + + static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) +@@ -515,7 +516,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD + /* This is allowed according to msdn and our tests. Reset the query and restart */ + if (flags & WINED3DISSUE_BEGIN) + { +- if (query->state == QUERY_BUILDING) ++ if (oq->started) + { + if (oq->context->tid != GetCurrentThreadId()) + { +@@ -544,6 +545,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD + checkGLcall("glBeginQuery()"); + + context_release(context); ++ oq->started = TRUE; + } + if (flags & WINED3DISSUE_END) + { +@@ -551,7 +553,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD + * our tests show that it returns OK. But OpenGL doesn't like it, so avoid + * generating an error + */ +- if (query->state == QUERY_BUILDING) ++ if (oq->started) + { + if (oq->context->tid != GetCurrentThreadId()) + { +@@ -567,6 +569,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD + context_release(context); + } + } ++ oq->started = FALSE; + } + } + else +@@ -574,11 +577,6 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD + FIXME("%p Occlusion queries not supported.\n", query); + } + +- if (flags & WINED3DISSUE_BEGIN) +- query->state = QUERY_BUILDING; +- else +- query->state = QUERY_SIGNALLED; +- + return; + } + +@@ -694,9 +692,6 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD + { + ERR("Timestamp queries not supported.\n"); + } +- +- if (flags & WINED3DISSUE_END) +- query->state = QUERY_SIGNALLED; + } + + static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, +@@ -732,11 +727,6 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer + static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) + { + TRACE("query %p, flags %#x.\n", query, flags); +- +- if (flags & WINED3DISSUE_BEGIN) +- query->state = QUERY_BUILDING; +- if (flags & WINED3DISSUE_END) +- query->state = QUERY_SIGNALLED; + } + + static const struct wined3d_query_ops event_query_ops = +@@ -785,13 +775,13 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de + } + query->query_ops = &occlusion_query_ops; + query->data_size = sizeof(DWORD); +- query->extendedData = HeapAlloc(GetProcessHeap(), 0, sizeof(struct wined3d_occlusion_query)); ++ query->extendedData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ++ sizeof(struct wined3d_occlusion_query)); + if (!query->extendedData) + { + ERR("Failed to allocate occlusion query extended data.\n"); + return E_OUTOFMEMORY; + } +- ((struct wined3d_occlusion_query *)query->extendedData)->context = NULL; + break; + + case WINED3D_QUERY_TYPE_EVENT: +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 28badf6..ec474dd 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -1052,6 +1052,7 @@ struct wined3d_occlusion_query + GLuint id; + struct wined3d_context *context; + DWORD samples; ++ BOOL started; + }; + + union wined3d_gl_query_object +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Don-t-poll-queries-that-failed-to-start.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Don-t-poll-queries-that-failed-to-start.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Don-t-poll-queries-that-failed-to-start.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Don-t-poll-queries-that-failed-to-start.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,134 @@ +From 3ee3d46182ba5a4f968d2bed318a80e9380b1246 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 24 Jul 2013 17:27:35 +0200 +Subject: wined3d: Don't poll queries that failed to start + +--- + dlls/wined3d/cs.c | 5 +++-- + dlls/wined3d/query.c | 21 +++++++++++++++------ + dlls/wined3d/wined3d_private.h | 2 +- + 3 files changed, 19 insertions(+), 9 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index b2af05b..4c0695a 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1711,10 +1711,11 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_query_issue *op = data; + struct wined3d_query *query = op->query; ++ BOOL poll; + +- query->query_ops->query_issue(query, op->flags); ++ poll = query->query_ops->query_issue(query, op->flags); + +- if (wined3d_settings.cs_multithreaded && op->flags & WINED3DISSUE_END ++ if (wined3d_settings.cs_multithreaded && poll + && list_empty(&query->poll_list_entry)) + list_add_tail(&cs->query_poll_list, &query->poll_list_entry); + +diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +index 97483a2..a42a1bd 100644 +--- a/dlls/wined3d/query.c ++++ b/dlls/wined3d/query.c +@@ -480,7 +480,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query + return query->type; + } + +-static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags) ++static BOOL wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags) + { + TRACE("query %p, flags %#x.\n", query, flags); + +@@ -490,21 +490,24 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla + struct wined3d_event_query *event_query = query->extendedData; + + /* Faked event query support */ +- if (!event_query) return; ++ if (!event_query) return FALSE; + + wined3d_event_query_issue(event_query, query->device); ++ return TRUE; + } + else if (flags & WINED3DISSUE_BEGIN) + { + /* Started implicitly at device creation */ + ERR("Event query issued with START flag - what to do?\n"); + } ++ return FALSE; + } + +-static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) ++static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) + { + struct wined3d_device *device = query->device; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; ++ BOOL poll = FALSE; + + TRACE("query %p, flags %#x.\n", query, flags); + +@@ -570,6 +573,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD + } + } + oq->started = FALSE; ++ poll = TRUE; + } + } + else +@@ -577,7 +581,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD + FIXME("%p Occlusion queries not supported.\n", query); + } + +- return; ++ return poll; + } + + static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, +@@ -661,7 +665,7 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) + return ret; + } + +-static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) ++static BOOL wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) + { + struct wined3d_device *device = query->device; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; +@@ -692,6 +696,10 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD + { + ERR("Timestamp queries not supported.\n"); + } ++ ++ if (flags & WINED3DISSUE_END) ++ return TRUE; ++ return FALSE; + } + + static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, +@@ -724,9 +732,10 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer + return TRUE; + } + +-static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) ++static BOOL wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) + { + TRACE("query %p, flags %#x.\n", query, flags); ++ return FALSE; + } + + static const struct wined3d_query_ops event_query_ops = +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index ec474dd..8dd9786 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2666,7 +2666,7 @@ struct wined3d_query_ops + { + HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); + BOOL (*query_poll)(struct wined3d_query *query); +- void (*query_issue)(struct wined3d_query *query, DWORD flags); ++ BOOL (*query_issue)(struct wined3d_query *query, DWORD flags); + }; + + struct wined3d_query +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0093-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -From 681469685b22ba7fedfbc808498028b518b890a0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 5 Aug 2013 13:07:42 +0200 -Subject: wined3d: Don't reset the query state if it doesn't have a ctx - -The CS recreates occlusion queries and changes the context variable. -This leads to incorrect query results. - -TODO: Before sending, find out why the line was there in the first place -and if it is needed with the multithreaded and/or singlethreaded CS. ---- - dlls/wined3d/query.c | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index a42a1bd..39d663a 100644 ---- a/dlls/wined3d/query.c -+++ b/dlls/wined3d/query.c -@@ -321,9 +321,6 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - struct wined3d_occlusion_query *oq = query->extendedData; - GLuint samples; - -- if (!oq->context) -- query->state = QUERY_CREATED; -- - if (query->state == QUERY_CREATED) - { - /* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves */ --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Put-this-into-the-query-poll-patch.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Put-this-into-the-query-poll-patch.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Put-this-into-the-query-poll-patch.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Put-this-into-the-query-poll-patch.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -From 5797fdf345e0af334745c957771b6a7a770eecbc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 30 Aug 2013 13:53:48 +0200 -Subject: wined3d: Put this into the query poll patch - ---- - dlls/wined3d/cs.c | 12 ++++++++++++ - dlls/wined3d/query.c | 2 +- - 2 files changed, 13 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 5c19a17..3540cb7 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1728,6 +1728,18 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) - list_remove(&query->poll_list_entry); - list_init(&query->poll_list_entry); - } -+ else if (op->flags & WINED3DISSUE_END) -+ { -+ /* Can happen when an occlusion query is ended without being started, -+ * in which case we don't want to poll, but still have to counter-balance -+ * the increment of the main counter (!poll && list_empty). -+ * -+ * This can also happen if an event query is re-issued before the first -+ * fence was reached (poll && !list_empty). In this case the query is -+ * already in the list and the poll function will check the new fence. -+ * We have to counter-balance the discarded increment. */ -+ InterlockedIncrement(&query->counter_retrieved); -+ } - } - - return sizeof(*op); -diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 39d663a..f33b30e 100644 ---- a/dlls/wined3d/query.c -+++ b/dlls/wined3d/query.c -@@ -567,10 +567,10 @@ static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - checkGLcall("glEndQuery()"); - - context_release(context); -+ poll = TRUE; - } - } - oq->started = FALSE; -- poll = TRUE; - } - } - else --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Remove-restated-queries-from-the-poll-list.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Remove-restated-queries-from-the-poll-list.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Remove-restated-queries-from-the-poll-list.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0094-wined3d-Remove-restated-queries-from-the-poll-list.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,40 @@ +From d46500650ef16a6bd292705ce9896bc8b1427d99 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 24 Jul 2013 17:50:16 +0200 +Subject: wined3d: Remove restated queries from the poll list + +--- + dlls/wined3d/cs.c | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 4c0695a..5c19a17 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1715,9 +1715,20 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) + + poll = query->query_ops->query_issue(query, op->flags); + +- if (wined3d_settings.cs_multithreaded && poll +- && list_empty(&query->poll_list_entry)) +- list_add_tail(&cs->query_poll_list, &query->poll_list_entry); ++ if (wined3d_settings.cs_multithreaded) ++ { ++ if (poll && list_empty(&query->poll_list_entry)) ++ { ++ list_add_tail(&cs->query_poll_list, &query->poll_list_entry); ++ } ++ else if (!poll && !list_empty(&query->poll_list_entry)) ++ { ++ /* Can happen if occlusion queries are restarted. This discards the old ++ * result, polling it could result in a GL error */ ++ list_remove(&query->poll_list_entry); ++ list_init(&query->poll_list_entry); ++ } ++ } + + return sizeof(*op); + } +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,31 @@ +From 681469685b22ba7fedfbc808498028b518b890a0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Mon, 5 Aug 2013 13:07:42 +0200 +Subject: wined3d: Don't reset the query state if it doesn't have a ctx + +The CS recreates occlusion queries and changes the context variable. +This leads to incorrect query results. + +TODO: Before sending, find out why the line was there in the first place +and if it is needed with the multithreaded and/or singlethreaded CS. +--- + dlls/wined3d/query.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +index a42a1bd..39d663a 100644 +--- a/dlls/wined3d/query.c ++++ b/dlls/wined3d/query.c +@@ -321,9 +321,6 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, + struct wined3d_occlusion_query *oq = query->extendedData; + GLuint samples; + +- if (!oq->context) +- query->state = QUERY_CREATED; +- + if (query->state == QUERY_CREATED) + { + /* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves */ +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Send-update_surface-commands-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Send-update_surface-commands-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Send-update_surface-commands-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0095-wined3d-Send-update_surface-commands-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ -From 961a8cb3c42a2969dd1500b4fc16adb4d47b514f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 1 Aug 2013 00:00:26 +0200 -Subject: wined3d: Send update_surface commands through the CS - ---- - dlls/wined3d/cs.c | 48 ++++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/device.c | 9 ++------ - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 52 insertions(+), 7 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 3540cb7..3264d17 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -69,6 +69,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_RESOURCE_UNMAP, - WINED3D_CS_OP_QUERY_ISSUE, - WINED3D_CS_OP_QUERY_DESTROY, -+ WINED3D_CS_OP_UPDATE_SURFACE, - WINED3D_CS_OP_STOP, - }; - -@@ -379,6 +380,15 @@ struct wined3d_cs_query_destroy - struct wined3d_query *query; - }; - -+struct wined3d_cs_update_surface -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_surface *src, *dst; -+ RECT src_rect; -+ POINT dst_point; -+ BOOL has_src_rect, has_dst_point; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -1780,6 +1790,43 @@ void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query * - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_update_surface(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_update_surface *op = data; -+ -+ surface_upload_from_surface(op->dst, op->has_dst_point ? &op->dst_point : NULL, -+ op->src, op->has_src_rect ? &op->src_rect : NULL); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surface *src, const RECT *src_rect, -+ struct wined3d_surface *dst, const POINT *dst_point) -+{ -+ struct wined3d_cs_update_surface *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_UPDATE_SURFACE; -+ op->src = src; -+ op->dst = dst; -+ op->has_src_rect = FALSE; -+ op->has_dst_point = FALSE; -+ -+ if (src_rect) -+ { -+ op->has_src_rect = TRUE; -+ op->src_rect = *src_rect; -+ } -+ -+ if (dst_point) -+ { -+ op->has_dst_point = TRUE; -+ op->dst_point = *dst_point; -+ } -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -1827,6 +1874,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, - /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, - /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, -+ /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index cd90c76..ed055f8 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -3796,14 +3796,9 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, - return WINED3DERR_INVALIDCALL; - } - -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -+ wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point); - -- return surface_upload_from_surface(dst_surface, dst_point, src_surface, src_rect); -+ return WINED3D_OK; - } - - void CDECL wined3d_device_copy_resource(struct wined3d_device *device, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 8dd9786..07d1613 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2651,6 +2651,8 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu - void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, - UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN; - void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *query) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surface *src, -+ const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Put-this-into-the-query-poll-patch.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Put-this-into-the-query-poll-patch.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Put-this-into-the-query-poll-patch.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Put-this-into-the-query-poll-patch.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,52 @@ +From 5797fdf345e0af334745c957771b6a7a770eecbc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 30 Aug 2013 13:53:48 +0200 +Subject: wined3d: Put this into the query poll patch + +--- + dlls/wined3d/cs.c | 12 ++++++++++++ + dlls/wined3d/query.c | 2 +- + 2 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 5c19a17..3540cb7 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1728,6 +1728,18 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) + list_remove(&query->poll_list_entry); + list_init(&query->poll_list_entry); + } ++ else if (op->flags & WINED3DISSUE_END) ++ { ++ /* Can happen when an occlusion query is ended without being started, ++ * in which case we don't want to poll, but still have to counter-balance ++ * the increment of the main counter (!poll && list_empty). ++ * ++ * This can also happen if an event query is re-issued before the first ++ * fence was reached (poll && !list_empty). In this case the query is ++ * already in the list and the poll function will check the new fence. ++ * We have to counter-balance the discarded increment. */ ++ InterlockedIncrement(&query->counter_retrieved); ++ } + } + + return sizeof(*op); +diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +index 39d663a..f33b30e 100644 +--- a/dlls/wined3d/query.c ++++ b/dlls/wined3d/query.c +@@ -567,10 +567,10 @@ static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD + checkGLcall("glEndQuery()"); + + context_release(context); ++ poll = TRUE; + } + } + oq->started = FALSE; +- poll = TRUE; + } + } + else +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Send-texture-preloads-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Send-texture-preloads-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Send-texture-preloads-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0096-wined3d-Send-texture-preloads-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ -From dd0852f22f9a3e04e9fefae6c0a3ac4913cc390d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 1 Aug 2013 00:10:40 +0200 -Subject: wined3d: Send texture preloads through the CS - ---- - dlls/wined3d/cs.c | 32 ++++++++++++++++++++++++++++++++ - dlls/wined3d/texture.c | 6 ++---- - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 35 insertions(+), 4 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 3264d17..78e5010 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -70,6 +70,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_QUERY_ISSUE, - WINED3D_CS_OP_QUERY_DESTROY, - WINED3D_CS_OP_UPDATE_SURFACE, -+ WINED3D_CS_OP_TEXTURE_PRELOAD, - WINED3D_CS_OP_STOP, - }; - -@@ -389,6 +390,12 @@ struct wined3d_cs_update_surface - BOOL has_src_rect, has_dst_point; - }; - -+struct wined3d_cs_texture_preload -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_texture *texture; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -1827,6 +1834,30 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_texture_preload(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_texture_preload *op = data; -+ struct wined3d_context *context; -+ struct wined3d_texture *texture = op->texture; -+ -+ context = context_acquire(cs->device, NULL); -+ wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB); -+ context_release(context); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) -+{ -+ struct wined3d_cs_texture_preload *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_TEXTURE_PRELOAD; -+ op->texture = texture; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -1875,6 +1906,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, - /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, - /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, -+ /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index b7891d9..ea8589a 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -569,10 +569,8 @@ void wined3d_texture_load(struct wined3d_texture *texture, - - void CDECL wined3d_texture_preload(struct wined3d_texture *texture) - { -- struct wined3d_context *context; -- context = context_acquire(texture->resource.device, NULL); -- wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB); -- context_release(context); -+ const struct wined3d_device *device = texture->resource.device; -+ wined3d_cs_emit_texture_preload(device->cs, texture); - } - - void * CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 07d1613..de82b46 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2653,6 +2653,7 @@ void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query - void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *query) DECLSPEC_HIDDEN; - void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surface *src, - const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Send-surface-preloads-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Send-surface-preloads-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Send-surface-preloads-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Send-surface-preloads-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -From 2f0bb40d8d1791180b93f3d4eccbf7c3f190d19e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 1 Aug 2013 00:15:58 +0200 -Subject: wined3d: Send surface preloads through the CS - ---- - dlls/wined3d/cs.c | 31 +++++++++++++++++++++++++++++++ - dlls/wined3d/surface.c | 5 +++-- - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 35 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 78e5010..4834dd4 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -71,6 +71,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_QUERY_DESTROY, - WINED3D_CS_OP_UPDATE_SURFACE, - WINED3D_CS_OP_TEXTURE_PRELOAD, -+ WINED3D_CS_OP_SURFACE_PRELOAD, - WINED3D_CS_OP_STOP, - }; - -@@ -396,6 +397,12 @@ struct wined3d_cs_texture_preload - struct wined3d_texture *texture; - }; - -+struct wined3d_cs_surface_preload -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_surface *surface; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -1858,6 +1865,29 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_surface_preload(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_surface_preload *op = data; -+ struct wined3d_context *context; -+ -+ context = context_acquire(cs->device, NULL); -+ wined3d_texture_preload(op->surface->container); -+ context_release(context); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) -+{ -+ struct wined3d_cs_surface_preload *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SURFACE_PRELOAD; -+ op->surface = surface; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -1907,6 +1937,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, - /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, - /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, -+ /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 9dadb6d..b2a5d22 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -1771,15 +1771,16 @@ ULONG CDECL wined3d_surface_decref(struct wined3d_surface *surface) - - void CDECL wined3d_surface_preload(struct wined3d_surface *surface) - { -+ const struct wined3d_device *device = surface->resource.device; - TRACE("surface %p.\n", surface); - -- if (!surface->resource.device->d3d_initialized) -+ if (!device->d3d_initialized) - { - ERR("D3D not initialized.\n"); - return; - } - -- wined3d_texture_preload(surface->container); -+ wined3d_cs_emit_surface_preload(device->cs, surface); - } - - void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index de82b46..409f395 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2654,6 +2654,7 @@ void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query * - void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surface *src, - const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; - void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Send-update_surface-commands-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Send-update_surface-commands-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Send-update_surface-commands-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0097-wined3d-Send-update_surface-commands-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,128 @@ +From 961a8cb3c42a2969dd1500b4fc16adb4d47b514f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 1 Aug 2013 00:00:26 +0200 +Subject: wined3d: Send update_surface commands through the CS + +--- + dlls/wined3d/cs.c | 48 ++++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/device.c | 9 ++------ + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 52 insertions(+), 7 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 3540cb7..3264d17 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -69,6 +69,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_RESOURCE_UNMAP, + WINED3D_CS_OP_QUERY_ISSUE, + WINED3D_CS_OP_QUERY_DESTROY, ++ WINED3D_CS_OP_UPDATE_SURFACE, + WINED3D_CS_OP_STOP, + }; + +@@ -379,6 +380,15 @@ struct wined3d_cs_query_destroy + struct wined3d_query *query; + }; + ++struct wined3d_cs_update_surface ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_surface *src, *dst; ++ RECT src_rect; ++ POINT dst_point; ++ BOOL has_src_rect, has_dst_point; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -1780,6 +1790,43 @@ void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query * + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_update_surface(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_update_surface *op = data; ++ ++ surface_upload_from_surface(op->dst, op->has_dst_point ? &op->dst_point : NULL, ++ op->src, op->has_src_rect ? &op->src_rect : NULL); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surface *src, const RECT *src_rect, ++ struct wined3d_surface *dst, const POINT *dst_point) ++{ ++ struct wined3d_cs_update_surface *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_UPDATE_SURFACE; ++ op->src = src; ++ op->dst = dst; ++ op->has_src_rect = FALSE; ++ op->has_dst_point = FALSE; ++ ++ if (src_rect) ++ { ++ op->has_src_rect = TRUE; ++ op->src_rect = *src_rect; ++ } ++ ++ if (dst_point) ++ { ++ op->has_dst_point = TRUE; ++ op->dst_point = *dst_point; ++ } ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -1827,6 +1874,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, + /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, ++ /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index cd90c76..ed055f8 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -3796,14 +3796,9 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, + return WINED3DERR_INVALIDCALL; + } + +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } ++ wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point); + +- return surface_upload_from_surface(dst_surface, dst_point, src_surface, src_rect); ++ return WINED3D_OK; + } + + void CDECL wined3d_device_copy_resource(struct wined3d_device *device, +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 8dd9786..07d1613 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2651,6 +2651,8 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu + void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, + UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN; + void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *query) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surface *src, ++ const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Send-texture-preloads-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Send-texture-preloads-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Send-texture-preloads-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Send-texture-preloads-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,107 @@ +From dd0852f22f9a3e04e9fefae6c0a3ac4913cc390d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 1 Aug 2013 00:10:40 +0200 +Subject: wined3d: Send texture preloads through the CS + +--- + dlls/wined3d/cs.c | 32 ++++++++++++++++++++++++++++++++ + dlls/wined3d/texture.c | 6 ++---- + dlls/wined3d/wined3d_private.h | 1 + + 3 files changed, 35 insertions(+), 4 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 3264d17..78e5010 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -70,6 +70,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_QUERY_ISSUE, + WINED3D_CS_OP_QUERY_DESTROY, + WINED3D_CS_OP_UPDATE_SURFACE, ++ WINED3D_CS_OP_TEXTURE_PRELOAD, + WINED3D_CS_OP_STOP, + }; + +@@ -389,6 +390,12 @@ struct wined3d_cs_update_surface + BOOL has_src_rect, has_dst_point; + }; + ++struct wined3d_cs_texture_preload ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_texture *texture; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -1827,6 +1834,30 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_texture_preload(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_texture_preload *op = data; ++ struct wined3d_context *context; ++ struct wined3d_texture *texture = op->texture; ++ ++ context = context_acquire(cs->device, NULL); ++ wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB); ++ context_release(context); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) ++{ ++ struct wined3d_cs_texture_preload *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_TEXTURE_PRELOAD; ++ op->texture = texture; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -1875,6 +1906,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, + /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, + /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, ++ /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index b7891d9..ea8589a 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -569,10 +569,8 @@ void wined3d_texture_load(struct wined3d_texture *texture, + + void CDECL wined3d_texture_preload(struct wined3d_texture *texture) + { +- struct wined3d_context *context; +- context = context_acquire(texture->resource.device, NULL); +- wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB); +- context_release(context); ++ const struct wined3d_device *device = texture->resource.device; ++ wined3d_cs_emit_texture_preload(device->cs, texture); + } + + void * CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 07d1613..de82b46 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2653,6 +2653,7 @@ void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query + void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *query) DECLSPEC_HIDDEN; + void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surface *src, + const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,297 +0,0 @@ -From 59bc0b8c16cd0e7c3a1d899c140c88ccba9f99ad Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 1 Aug 2013 00:33:48 +0200 -Subject: wined3d: Send update_texture calls through the CS - ---- - dlls/wined3d/cs.c | 33 ++++++++++++ - dlls/wined3d/device.c | 114 ++++++++++++++++++----------------------- - dlls/wined3d/wined3d_private.h | 4 ++ - 3 files changed, 86 insertions(+), 65 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 4210ddf..93e6e5f 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -73,6 +73,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_UPDATE_SURFACE, - WINED3D_CS_OP_TEXTURE_PRELOAD, - WINED3D_CS_OP_SURFACE_PRELOAD, -+ WINED3D_CS_OP_UPDATE_TEXTURE, - WINED3D_CS_OP_STOP, - }; - -@@ -413,6 +414,12 @@ struct wined3d_cs_surface_preload - struct wined3d_surface *surface; - }; - -+struct wined3d_cs_update_texture -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_texture *src, *dst; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2001,6 +2008,31 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_update_texture *op = data; -+ struct wined3d_context *context; -+ -+ context = context_acquire(cs->device, NULL); -+ device_exec_update_texture(context, op->src, op->dst); -+ context_release(context); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, -+ struct wined3d_texture *dst) -+{ -+ struct wined3d_cs_update_texture *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_UPDATE_TEXTURE; -+ op->src = src; -+ op->dst = dst; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2052,6 +2084,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, - /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, - /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, -+ /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 0e4e2ba..c55505e 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -3430,16 +3430,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device - } - - /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ --static HRESULT device_update_volume(struct wined3d_device *device, -+static HRESULT device_update_volume(struct wined3d_context *context, - struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) - { - struct wined3d_const_bo_address data; - struct wined3d_map_desc src; - HRESULT hr; -- struct wined3d_context *context; - -- TRACE("device %p, src_volume %p, dst_volume %p.\n", -- device, src_volume, dst_volume); -+ TRACE("src_volume %p, dst_volume %p.\n", -+ src_volume, dst_volume); - - if (src_volume->resource.format != dst_volume->resource.format) - { -@@ -3457,8 +3456,6 @@ static HRESULT device_update_volume(struct wined3d_device *device, - if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY))) - return hr; - -- context = context_acquire(device, NULL); -- - /* Only a prepare, since we're uploading the entire volume. */ - wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); - wined3d_texture_bind_and_dirtify(dst_volume->container, context, FALSE); -@@ -3468,48 +3465,17 @@ static HRESULT device_update_volume(struct wined3d_device *device, - wined3d_volume_upload_data(dst_volume, context, &data); - wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); - -- context_release(context); -- - hr = wined3d_volume_unmap(src_volume); - - return hr; - } - --HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, -- struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) -+/* Context activation is done by the caller */ -+void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, -+ struct wined3d_texture *dst_texture) - { -- enum wined3d_resource_type type; -+ enum wined3d_resource_type type = src_texture->resource.type; - unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0; -- HRESULT hr; -- struct wined3d_context *context; -- -- TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); -- -- /* Verify that the source and destination textures are non-NULL. */ -- if (!src_texture || !dst_texture) -- { -- WARN("Source and destination textures must be non-NULL, returning WINED3DERR_INVALIDCALL.\n"); -- return WINED3DERR_INVALIDCALL; -- } -- -- if (src_texture->resource.pool != WINED3D_POOL_SYSTEM_MEM) -- { -- WARN("Source texture not in WINED3D_POOL_SYSTEM_MEM, returning WINED3DERR_INVALIDCALL.\n"); -- return WINED3DERR_INVALIDCALL; -- } -- if (dst_texture->resource.pool != WINED3D_POOL_DEFAULT) -- { -- WARN("Destination texture not in WINED3D_POOL_DEFAULT, returning WINED3DERR_INVALIDCALL.\n"); -- return WINED3DERR_INVALIDCALL; -- } -- -- /* Verify that the source and destination textures are the same type. */ -- type = src_texture->resource.type; -- if (dst_texture->resource.type != type) -- { -- WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n"); -- return WINED3DERR_INVALIDCALL; -- } - - level_count = min(wined3d_texture_get_level_count(src_texture), - wined3d_texture_get_level_count(dst_texture)); -@@ -3527,17 +3493,8 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, - ++src_skip_levels; - } - -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -- - /* Make sure that the destination texture is loaded. */ -- context = context_acquire(device, NULL); - wined3d_texture_load(dst_texture, context, FALSE); -- context_release(context); - - /* Update every surface level of the texture. */ - switch (type) -@@ -3552,12 +3509,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, - src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, - i + src_skip_levels)); - dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); -- hr = wined3d_device_update_surface(device, src_surface, NULL, dst_surface, NULL); -- if (FAILED(hr)) -- { -- WARN("Failed to update surface, hr %#x.\n", hr); -- return hr; -- } -+ surface_upload_from_surface(dst_surface, NULL, src_surface, NULL); - } - break; - } -@@ -3577,12 +3529,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, - i * src_levels + j + src_skip_levels)); - dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, - i * dst_levels + j)); -- hr = wined3d_device_update_surface(device, src_surface, NULL, dst_surface, NULL); -- if (FAILED(hr)) -- { -- WARN("Failed to update surface, hr %#x.\n", hr); -- return hr; -- } -+ surface_upload_from_surface(dst_surface, NULL, src_surface, NULL); - } - } - break; -@@ -3592,14 +3539,15 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, - { - for (i = 0; i < level_count; ++i) - { -- hr = device_update_volume(device, -+ HRESULT hr; -+ hr = device_update_volume(context, - volume_from_resource(wined3d_texture_get_sub_resource(src_texture, - i + src_skip_levels)), - volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i))); - if (FAILED(hr)) - { - WARN("Failed to update volume, hr %#x.\n", hr); -- return hr; -+ return; - } - } - break; -@@ -3607,8 +3555,44 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, - - default: - FIXME("Unsupported texture type %#x.\n", type); -- return WINED3DERR_INVALIDCALL; -+ return; - } -+} -+ -+HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, -+ struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) -+{ -+ enum wined3d_resource_type type; -+ -+ TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); -+ -+ /* Verify that the source and destination textures are non-NULL. */ -+ if (!src_texture || !dst_texture) -+ { -+ WARN("Source and destination textures must be non-NULL, returning WINED3DERR_INVALIDCALL.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ if (src_texture->resource.pool != WINED3D_POOL_SYSTEM_MEM) -+ { -+ WARN("Source texture not in WINED3D_POOL_SYSTEM_MEM, returning WINED3DERR_INVALIDCALL.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ if (dst_texture->resource.pool != WINED3D_POOL_DEFAULT) -+ { -+ WARN("Destination texture not in WINED3D_POOL_DEFAULT, returning WINED3DERR_INVALIDCALL.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ /* Verify that the source and destination textures are the same type. */ -+ type = src_texture->resource.type; -+ if (dst_texture->resource.type != type) -+ { -+ WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n"); -+ return WINED3DERR_INVALIDCALL; -+ } -+ -+ wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); - - return WINED3D_OK; - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index d141e3e..fa9270a 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2114,6 +2114,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource - void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; - void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; -+void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, -+ struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN; - - static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) - { -@@ -2703,6 +2705,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac - const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; - void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; - void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, -+ struct wined3d_texture *dst) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -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 - ---- - dlls/wined3d/surface.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index c503c67..5dda903 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -1403,9 +1403,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w - checkGLcall("glBindBuffer"); - } - -- if (wined3d_settings.cs_multithreaded) -- gl_info->gl_ops.gl.p_glFinish(); -- else if (wined3d_settings.strict_draw_ordering) -+ if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); - - if (gl_info->quirks & WINED3D_QUIRK_FBO_TEX_UPDATE) --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Send-surface-preloads-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Send-surface-preloads-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Send-surface-preloads-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0099-wined3d-Send-surface-preloads-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,112 @@ +From 2f0bb40d8d1791180b93f3d4eccbf7c3f190d19e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 1 Aug 2013 00:15:58 +0200 +Subject: wined3d: Send surface preloads through the CS + +--- + dlls/wined3d/cs.c | 31 +++++++++++++++++++++++++++++++ + dlls/wined3d/surface.c | 5 +++-- + dlls/wined3d/wined3d_private.h | 1 + + 3 files changed, 35 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 78e5010..4834dd4 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -71,6 +71,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_QUERY_DESTROY, + WINED3D_CS_OP_UPDATE_SURFACE, + WINED3D_CS_OP_TEXTURE_PRELOAD, ++ WINED3D_CS_OP_SURFACE_PRELOAD, + WINED3D_CS_OP_STOP, + }; + +@@ -396,6 +397,12 @@ struct wined3d_cs_texture_preload + struct wined3d_texture *texture; + }; + ++struct wined3d_cs_surface_preload ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_surface *surface; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -1858,6 +1865,29 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_surface_preload(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_surface_preload *op = data; ++ struct wined3d_context *context; ++ ++ context = context_acquire(cs->device, NULL); ++ wined3d_texture_preload(op->surface->container); ++ context_release(context); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) ++{ ++ struct wined3d_cs_surface_preload *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_SURFACE_PRELOAD; ++ op->surface = surface; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -1907,6 +1937,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, + /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, + /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, ++ /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 9dadb6d..b2a5d22 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -1771,15 +1771,16 @@ ULONG CDECL wined3d_surface_decref(struct wined3d_surface *surface) + + void CDECL wined3d_surface_preload(struct wined3d_surface *surface) + { ++ const struct wined3d_device *device = surface->resource.device; + TRACE("surface %p.\n", surface); + +- if (!surface->resource.device->d3d_initialized) ++ if (!device->d3d_initialized) + { + ERR("D3D not initialized.\n"); + return; + } + +- wined3d_texture_preload(surface->container); ++ wined3d_cs_emit_surface_preload(device->cs, surface); + } + + void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index de82b46..409f395 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2654,6 +2654,7 @@ void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query * + void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surface *src, + const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; + void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -From ef5650c2467c6902fca699bb05d0302a0f42d900 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 29 Aug 2013 22:25:14 +0200 -Subject: wined3d: Don't lock the src volume in device_update_volume - -This will attempt to wait for the CS, but this code is executed by the CS, so -it will, among other problems, break the single producer, single consumer -assumption of the work queue. - -FIXME: Maybe merge this with the previous patch or change their order. ---- - dlls/wined3d/device.c | 31 +++++++------------------------ - 1 file changed, 7 insertions(+), 24 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index c55505e..1db616d 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -3430,12 +3430,10 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device - } - - /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ --static HRESULT device_update_volume(struct wined3d_context *context, -+static void device_update_volume(struct wined3d_context *context, - struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) - { -- struct wined3d_const_bo_address data; -- struct wined3d_map_desc src; -- HRESULT hr; -+ struct wined3d_bo_address data; - - TRACE("src_volume %p, dst_volume %p.\n", - src_volume, dst_volume); -@@ -3443,31 +3441,22 @@ static HRESULT device_update_volume(struct wined3d_context *context, - if (src_volume->resource.format != dst_volume->resource.format) - { - FIXME("Source and destination formats do not match.\n"); -- return WINED3DERR_INVALIDCALL; -+ return; - } - if (src_volume->resource.width != dst_volume->resource.width - || src_volume->resource.height != dst_volume->resource.height - || src_volume->resource.depth != dst_volume->resource.depth) - { - FIXME("Source and destination sizes do not match.\n"); -- return WINED3DERR_INVALIDCALL; -+ return; - } - -- if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY))) -- return hr; -- - /* Only a prepare, since we're uploading the entire volume. */ - wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); - wined3d_texture_bind_and_dirtify(dst_volume->container, context, FALSE); -- -- data.buffer_object = 0; -- data.addr = src.data; -- wined3d_volume_upload_data(dst_volume, context, &data); -+ wined3d_resource_get_memory(&src_volume->resource, src_volume->resource.map_binding, &data); -+ wined3d_volume_upload_data(dst_volume, context, wined3d_const_bo_address(&data)); - wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); -- -- hr = wined3d_volume_unmap(src_volume); -- -- return hr; - } - - /* Context activation is done by the caller */ -@@ -3539,16 +3528,10 @@ void device_exec_update_texture(struct wined3d_context *context, struct wined3d_ - { - for (i = 0; i < level_count; ++i) - { -- HRESULT hr; -- hr = device_update_volume(context, -+ device_update_volume(context, - volume_from_resource(wined3d_texture_get_sub_resource(src_texture, - i + src_skip_levels)), - volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i))); -- if (FAILED(hr)) -- { -- WARN("Failed to update volume, hr %#x.\n", hr); -- return; -- } - } - break; - } --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Send-update_texture-calls-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Send-update_texture-calls-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Send-update_texture-calls-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0100-wined3d-Send-update_texture-calls-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,297 @@ +From 59bc0b8c16cd0e7c3a1d899c140c88ccba9f99ad Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 1 Aug 2013 00:33:48 +0200 +Subject: wined3d: Send update_texture calls through the CS + +--- + dlls/wined3d/cs.c | 33 ++++++++++++ + dlls/wined3d/device.c | 114 ++++++++++++++++++----------------------- + dlls/wined3d/wined3d_private.h | 4 ++ + 3 files changed, 86 insertions(+), 65 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 4210ddf..93e6e5f 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -73,6 +73,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_UPDATE_SURFACE, + WINED3D_CS_OP_TEXTURE_PRELOAD, + WINED3D_CS_OP_SURFACE_PRELOAD, ++ WINED3D_CS_OP_UPDATE_TEXTURE, + WINED3D_CS_OP_STOP, + }; + +@@ -413,6 +414,12 @@ struct wined3d_cs_surface_preload + struct wined3d_surface *surface; + }; + ++struct wined3d_cs_update_texture ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_texture *src, *dst; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2001,6 +2008,31 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_update_texture *op = data; ++ struct wined3d_context *context; ++ ++ context = context_acquire(cs->device, NULL); ++ device_exec_update_texture(context, op->src, op->dst); ++ context_release(context); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, ++ struct wined3d_texture *dst) ++{ ++ struct wined3d_cs_update_texture *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_UPDATE_TEXTURE; ++ op->src = src; ++ op->dst = dst; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2052,6 +2084,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, + /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, + /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, ++ /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 0e4e2ba..c55505e 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -3430,16 +3430,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device + } + + /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ +-static HRESULT device_update_volume(struct wined3d_device *device, ++static HRESULT device_update_volume(struct wined3d_context *context, + struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) + { + struct wined3d_const_bo_address data; + struct wined3d_map_desc src; + HRESULT hr; +- struct wined3d_context *context; + +- TRACE("device %p, src_volume %p, dst_volume %p.\n", +- device, src_volume, dst_volume); ++ TRACE("src_volume %p, dst_volume %p.\n", ++ src_volume, dst_volume); + + if (src_volume->resource.format != dst_volume->resource.format) + { +@@ -3457,8 +3456,6 @@ static HRESULT device_update_volume(struct wined3d_device *device, + if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY))) + return hr; + +- context = context_acquire(device, NULL); +- + /* Only a prepare, since we're uploading the entire volume. */ + wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); + wined3d_texture_bind_and_dirtify(dst_volume->container, context, FALSE); +@@ -3468,48 +3465,17 @@ static HRESULT device_update_volume(struct wined3d_device *device, + wined3d_volume_upload_data(dst_volume, context, &data); + wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); + +- context_release(context); +- + hr = wined3d_volume_unmap(src_volume); + + return hr; + } + +-HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +- struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) ++/* Context activation is done by the caller */ ++void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, ++ struct wined3d_texture *dst_texture) + { +- enum wined3d_resource_type type; ++ enum wined3d_resource_type type = src_texture->resource.type; + unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0; +- HRESULT hr; +- struct wined3d_context *context; +- +- TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); +- +- /* Verify that the source and destination textures are non-NULL. */ +- if (!src_texture || !dst_texture) +- { +- WARN("Source and destination textures must be non-NULL, returning WINED3DERR_INVALIDCALL.\n"); +- return WINED3DERR_INVALIDCALL; +- } +- +- if (src_texture->resource.pool != WINED3D_POOL_SYSTEM_MEM) +- { +- WARN("Source texture not in WINED3D_POOL_SYSTEM_MEM, returning WINED3DERR_INVALIDCALL.\n"); +- return WINED3DERR_INVALIDCALL; +- } +- if (dst_texture->resource.pool != WINED3D_POOL_DEFAULT) +- { +- WARN("Destination texture not in WINED3D_POOL_DEFAULT, returning WINED3DERR_INVALIDCALL.\n"); +- return WINED3DERR_INVALIDCALL; +- } +- +- /* Verify that the source and destination textures are the same type. */ +- type = src_texture->resource.type; +- if (dst_texture->resource.type != type) +- { +- WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n"); +- return WINED3DERR_INVALIDCALL; +- } + + level_count = min(wined3d_texture_get_level_count(src_texture), + wined3d_texture_get_level_count(dst_texture)); +@@ -3527,17 +3493,8 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, + ++src_skip_levels; + } + +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } +- + /* Make sure that the destination texture is loaded. */ +- context = context_acquire(device, NULL); + wined3d_texture_load(dst_texture, context, FALSE); +- context_release(context); + + /* Update every surface level of the texture. */ + switch (type) +@@ -3552,12 +3509,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, + src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, + i + src_skip_levels)); + dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); +- hr = wined3d_device_update_surface(device, src_surface, NULL, dst_surface, NULL); +- if (FAILED(hr)) +- { +- WARN("Failed to update surface, hr %#x.\n", hr); +- return hr; +- } ++ surface_upload_from_surface(dst_surface, NULL, src_surface, NULL); + } + break; + } +@@ -3577,12 +3529,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, + i * src_levels + j + src_skip_levels)); + dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, + i * dst_levels + j)); +- hr = wined3d_device_update_surface(device, src_surface, NULL, dst_surface, NULL); +- if (FAILED(hr)) +- { +- WARN("Failed to update surface, hr %#x.\n", hr); +- return hr; +- } ++ surface_upload_from_surface(dst_surface, NULL, src_surface, NULL); + } + } + break; +@@ -3592,14 +3539,15 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, + { + for (i = 0; i < level_count; ++i) + { +- hr = device_update_volume(device, ++ HRESULT hr; ++ hr = device_update_volume(context, + volume_from_resource(wined3d_texture_get_sub_resource(src_texture, + i + src_skip_levels)), + volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i))); + if (FAILED(hr)) + { + WARN("Failed to update volume, hr %#x.\n", hr); +- return hr; ++ return; + } + } + break; +@@ -3607,8 +3555,44 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, + + default: + FIXME("Unsupported texture type %#x.\n", type); +- return WINED3DERR_INVALIDCALL; ++ return; + } ++} ++ ++HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, ++ struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) ++{ ++ enum wined3d_resource_type type; ++ ++ TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); ++ ++ /* Verify that the source and destination textures are non-NULL. */ ++ if (!src_texture || !dst_texture) ++ { ++ WARN("Source and destination textures must be non-NULL, returning WINED3DERR_INVALIDCALL.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ if (src_texture->resource.pool != WINED3D_POOL_SYSTEM_MEM) ++ { ++ WARN("Source texture not in WINED3D_POOL_SYSTEM_MEM, returning WINED3DERR_INVALIDCALL.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ if (dst_texture->resource.pool != WINED3D_POOL_DEFAULT) ++ { ++ WARN("Destination texture not in WINED3D_POOL_DEFAULT, returning WINED3DERR_INVALIDCALL.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ /* Verify that the source and destination textures are the same type. */ ++ type = src_texture->resource.type; ++ if (dst_texture->resource.type != type) ++ { ++ WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ ++ wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); + + return WINED3D_OK; + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index d141e3e..fa9270a 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2114,6 +2114,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource + void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; + void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; ++void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, ++ struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN; + + static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) + { +@@ -2703,6 +2705,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac + const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; + void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; + void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, ++ struct wined3d_texture *dst) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,27 @@ +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 + +--- + dlls/wined3d/surface.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index c503c67..5dda903 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -1403,9 +1403,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w + checkGLcall("glBindBuffer"); + } + +- if (wined3d_settings.cs_multithreaded) +- gl_info->gl_ops.gl.p_glFinish(); +- else if (wined3d_settings.strict_draw_ordering) ++ if (wined3d_settings.strict_draw_ordering) + gl_info->gl_ops.gl.p_glFlush(); + + if (gl_info->quirks & WINED3D_QUIRK_FBO_TEX_UPDATE) +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Handle-evit_managed_resources-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Handle-evit_managed_resources-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Handle-evit_managed_resources-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0101-wined3d-Handle-evit_managed_resources-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -From 87f659571c4214fcc73a42a1e112d6bda34950a3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 6 Aug 2013 13:50:31 +0200 -Subject: wined3d: Handle evit_managed_resources through the CS - ---- - dlls/wined3d/cs.c | 37 +++++++++++++++++++++++++++++++++++++ - dlls/wined3d/device.c | 14 +++----------- - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 41 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index aeba50f..11aa133 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -73,6 +73,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_TEXTURE_PRELOAD, - WINED3D_CS_OP_SURFACE_PRELOAD, - WINED3D_CS_OP_UPDATE_TEXTURE, -+ WINED3D_CS_OP_EVICT_RESOURCE, - WINED3D_CS_OP_STOP, - }; - -@@ -410,6 +411,12 @@ struct wined3d_cs_update_texture - struct wined3d_texture *src, *dst; - }; - -+struct wined3d_cs_evict_resource -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_resource *resource; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -1920,6 +1927,35 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_evict_resource(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_evict_resource *op = data; -+ struct wined3d_resource *resource = op->resource; -+ -+ resource->resource_ops->resource_unload(resource); -+ -+ /* FIXME: Is this necessary? Bound buffers are preloaded anyway, and in theory -+ * PreLoad should take care of invalidating the state if the VBO changes */ -+ if (resource->bind_count && resource->type == WINED3D_RTYPE_BUFFER) -+ { -+ device_invalidate_state(cs->device, STATE_STREAMSRC); -+ device_invalidate_state(cs->device, STATE_INDEXBUFFER); -+ } -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) -+{ -+ struct wined3d_cs_evict_resource *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_EVICT_RESOURCE; -+ op->resource = resource; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -1971,6 +2007,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, - /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, - /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, -+ /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index ae7ad31..f062e84 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4207,13 +4207,8 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) - - TRACE("device %p.\n", device); - -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -- -+ /* The resource list is manged by the main thread, iterate here and emit commands for -+ * each resource */ - LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) - { - TRACE("Checking resource %p for eviction.\n", resource); -@@ -4221,12 +4216,9 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) - if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) - { - TRACE("Evicting %p.\n", resource); -- resource->resource_ops->resource_unload(resource); -+ wined3d_cs_emit_evict_resource(device->cs, resource); - } - } -- -- /* Invalidate stream sources, the buffer(s) may have been evicted. */ -- device_invalidate_state(device, STATE_STREAMSRC); - } - - static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 25fce7f..b9eee2c 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2659,6 +2659,7 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu - void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, - struct wined3d_texture *dst) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,90 @@ +From ef5650c2467c6902fca699bb05d0302a0f42d900 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 29 Aug 2013 22:25:14 +0200 +Subject: wined3d: Don't lock the src volume in device_update_volume + +This will attempt to wait for the CS, but this code is executed by the CS, so +it will, among other problems, break the single producer, single consumer +assumption of the work queue. + +FIXME: Maybe merge this with the previous patch or change their order. +--- + dlls/wined3d/device.c | 31 +++++++------------------------ + 1 file changed, 7 insertions(+), 24 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index c55505e..1db616d 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -3430,12 +3430,10 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device + } + + /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ +-static HRESULT device_update_volume(struct wined3d_context *context, ++static void device_update_volume(struct wined3d_context *context, + struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) + { +- struct wined3d_const_bo_address data; +- struct wined3d_map_desc src; +- HRESULT hr; ++ struct wined3d_bo_address data; + + TRACE("src_volume %p, dst_volume %p.\n", + src_volume, dst_volume); +@@ -3443,31 +3441,22 @@ static HRESULT device_update_volume(struct wined3d_context *context, + if (src_volume->resource.format != dst_volume->resource.format) + { + FIXME("Source and destination formats do not match.\n"); +- return WINED3DERR_INVALIDCALL; ++ return; + } + if (src_volume->resource.width != dst_volume->resource.width + || src_volume->resource.height != dst_volume->resource.height + || src_volume->resource.depth != dst_volume->resource.depth) + { + FIXME("Source and destination sizes do not match.\n"); +- return WINED3DERR_INVALIDCALL; ++ return; + } + +- if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY))) +- return hr; +- + /* Only a prepare, since we're uploading the entire volume. */ + wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); + wined3d_texture_bind_and_dirtify(dst_volume->container, context, FALSE); +- +- data.buffer_object = 0; +- data.addr = src.data; +- wined3d_volume_upload_data(dst_volume, context, &data); ++ wined3d_resource_get_memory(&src_volume->resource, src_volume->resource.map_binding, &data); ++ wined3d_volume_upload_data(dst_volume, context, wined3d_const_bo_address(&data)); + wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); +- +- hr = wined3d_volume_unmap(src_volume); +- +- return hr; + } + + /* Context activation is done by the caller */ +@@ -3539,16 +3528,10 @@ void device_exec_update_texture(struct wined3d_context *context, struct wined3d_ + { + for (i = 0; i < level_count; ++i) + { +- HRESULT hr; +- hr = device_update_volume(context, ++ device_update_volume(context, + volume_from_resource(wined3d_texture_get_sub_resource(src_texture, + i + src_skip_levels)), + volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i))); +- if (FAILED(hr)) +- { +- WARN("Failed to update volume, hr %#x.\n", hr); +- return; +- } + } + break; + } +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Send-flips-through-the-command-stream.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Send-flips-through-the-command-stream.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Send-flips-through-the-command-stream.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0102-wined3d-Send-flips-through-the-command-stream.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -From 883b523131797cfb6e3c715ff8018850d48734a6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 6 Aug 2013 17:39:26 +0200 -Subject: wined3d: Send flips through the command stream - -TODO: This remove this patch and flip_surface / surface_flip. ---- - dlls/wined3d/surface.c | 77 ------------------------------------------ - dlls/wined3d/wined3d_private.h | 2 +- - 2 files changed, 1 insertion(+), 78 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index b19355c..0c3313d 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -2758,83 +2758,6 @@ void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl - } - } - --void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) --{ -- if (front->container->level_count != 1 || front->container->layer_count != 1 -- || back->container->level_count != 1 || back->container->layer_count != 1) -- ERR("Flip between surfaces %p and %p not supported.\n", front, back); -- -- /* Flip the surface contents */ -- /* Flip the DC */ -- { -- HDC tmp; -- tmp = front->hDC; -- front->hDC = back->hDC; -- back->hDC = tmp; -- } -- -- /* Flip the DIBsection */ -- { -- HBITMAP tmp = front->dib.DIBsection; -- front->dib.DIBsection = back->dib.DIBsection; -- back->dib.DIBsection = tmp; -- } -- -- /* Flip the surface data */ -- { -- void* tmp; -- -- tmp = front->resource.bitmap_data; -- front->resource.bitmap_data = back->resource.bitmap_data; -- back->resource.bitmap_data = tmp; -- -- tmp = front->resource.heap_memory; -- front->resource.heap_memory = back->resource.heap_memory; -- back->resource.heap_memory = tmp; -- } -- -- /* Flip the PBO */ -- { -- GLuint tmp_pbo = front->resource.buffer_object; -- front->resource.buffer_object = back->resource.buffer_object; -- back->resource.buffer_object = tmp_pbo; -- } -- -- /* Flip the opengl texture */ -- { -- GLuint tmp; -- -- tmp = back->container->texture_rgb.name; -- back->container->texture_rgb.name = front->container->texture_rgb.name; -- front->container->texture_rgb.name = tmp; -- -- tmp = back->container->texture_srgb.name; -- back->container->texture_srgb.name = front->container->texture_srgb.name; -- front->container->texture_srgb.name = tmp; -- -- tmp = back->rb_multisample; -- back->rb_multisample = front->rb_multisample; -- front->rb_multisample = tmp; -- -- tmp = back->rb_resolved; -- back->rb_resolved = front->rb_resolved; -- front->rb_resolved = tmp; -- -- resource_unload(&back->resource); -- resource_unload(&front->resource); -- } -- -- { -- DWORD tmp_flags = back->flags; -- back->flags = front->flags; -- front->flags = tmp_flags; -- -- tmp_flags = back->resource.locations; -- back->resource.locations = front->resource.locations; -- front->resource.locations = tmp_flags; -- } --} -- - /* Does a direct frame buffer -> texture copy. Stretching is done with single - * pixel copy calls. */ - static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index b9eee2c..a2bee4d 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2424,7 +2424,7 @@ BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect - - void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, - const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; --void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN; -+void surface_flip(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN; - - /* Surface flags: */ - #define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */ --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Handle-evit_managed_resources-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Handle-evit_managed_resources-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Handle-evit_managed_resources-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Handle-evit_managed_resources-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,129 @@ +From 87f659571c4214fcc73a42a1e112d6bda34950a3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 6 Aug 2013 13:50:31 +0200 +Subject: wined3d: Handle evit_managed_resources through the CS + +--- + dlls/wined3d/cs.c | 37 +++++++++++++++++++++++++++++++++++++ + dlls/wined3d/device.c | 14 +++----------- + dlls/wined3d/wined3d_private.h | 1 + + 3 files changed, 41 insertions(+), 11 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index aeba50f..11aa133 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -73,6 +73,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_TEXTURE_PRELOAD, + WINED3D_CS_OP_SURFACE_PRELOAD, + WINED3D_CS_OP_UPDATE_TEXTURE, ++ WINED3D_CS_OP_EVICT_RESOURCE, + WINED3D_CS_OP_STOP, + }; + +@@ -410,6 +411,12 @@ struct wined3d_cs_update_texture + struct wined3d_texture *src, *dst; + }; + ++struct wined3d_cs_evict_resource ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_resource *resource; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -1920,6 +1927,35 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_evict_resource(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_evict_resource *op = data; ++ struct wined3d_resource *resource = op->resource; ++ ++ resource->resource_ops->resource_unload(resource); ++ ++ /* FIXME: Is this necessary? Bound buffers are preloaded anyway, and in theory ++ * PreLoad should take care of invalidating the state if the VBO changes */ ++ if (resource->bind_count && resource->type == WINED3D_RTYPE_BUFFER) ++ { ++ device_invalidate_state(cs->device, STATE_STREAMSRC); ++ device_invalidate_state(cs->device, STATE_INDEXBUFFER); ++ } ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) ++{ ++ struct wined3d_cs_evict_resource *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_EVICT_RESOURCE; ++ op->resource = resource; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -1971,6 +2007,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, + /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, + /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, ++ /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index ae7ad31..f062e84 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4207,13 +4207,8 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) + + TRACE("device %p.\n", device); + +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } +- ++ /* The resource list is manged by the main thread, iterate here and emit commands for ++ * each resource */ + LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) + { + TRACE("Checking resource %p for eviction.\n", resource); +@@ -4221,12 +4216,9 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) + if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) + { + TRACE("Evicting %p.\n", resource); +- resource->resource_ops->resource_unload(resource); ++ wined3d_cs_emit_evict_resource(device->cs, resource); + } + } +- +- /* Invalidate stream sources, the buffer(s) may have been evicted. */ +- device_invalidate_state(device, STATE_STREAMSRC); + } + + static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 25fce7f..b9eee2c 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2659,6 +2659,7 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu + void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, + struct wined3d_texture *dst) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Introduce-resource-fencing.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Introduce-resource-fencing.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Introduce-resource-fencing.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0103-wined3d-Introduce-resource-fencing.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ -From cba6a35d48886d00959d29d4fef9115a46143589 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 20 Aug 2014 18:01:36 +0200 -Subject: wined3d: Introduce resource fencing. - -FIXME: The buffer part doesn't really make sense without dynamic buffer maps. ---- - dlls/wined3d/cs.c | 19 +++++++++++++++++++ - dlls/wined3d/wined3d_private.h | 16 ++++++++++++++++ - 2 files changed, 35 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 11aa133..1197eef 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -575,6 +575,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_draw *op = data; - const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; -+ unsigned int i; - - if (op->indexed && !gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]) - { -@@ -593,6 +594,14 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - draw_primitive(cs->device, &cs->state, op->start_idx, op->index_count, - op->start_instance, op->instance_count, op->indexed); - -+ if (op->indexed) -+ wined3d_resource_dec_fence(&cs->state.index_buffer->resource); -+ for (i = 0; i < sizeof(cs->state.streams) / sizeof(*cs->state.streams); i++) -+ { -+ if (cs->state.streams[i].buffer) -+ wined3d_resource_dec_fence(&cs->state.streams[i].buffer->resource); -+ } -+ - return sizeof(*op); - } - -@@ -600,6 +609,8 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun - UINT start_instance, UINT instance_count, BOOL indexed) - { - struct wined3d_cs_draw *op; -+ unsigned int i; -+ const struct wined3d_state *state = &cs->device->state; - - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_DRAW; -@@ -609,6 +620,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun - op->instance_count = instance_count; - op->indexed = indexed; - -+ if (indexed) -+ wined3d_resource_inc_fence(&state->index_buffer->resource); -+ for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++) -+ { -+ if (state->streams[i].buffer) -+ wined3d_resource_inc_fence(&state->streams[i].buffer->resource); -+ } -+ - cs->ops->submit(cs, sizeof(*op)); - } - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 570f5e3..10d0789 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2129,6 +2129,7 @@ struct wined3d_resource - GLuint buffer_object; - struct list resource_list_entry; - DWORD locations; -+ LONG access_fence; - - void *parent; - const struct wined3d_parent_ops *parent_ops; -@@ -2182,6 +2183,21 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) DECLSPEC - void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; - -+static inline void wined3d_resource_inc_fence(struct wined3d_resource *resource) -+{ -+ InterlockedIncrement(&resource->access_fence); -+} -+ -+static inline void wined3d_resource_dec_fence(struct wined3d_resource *resource) -+{ -+ InterlockedDecrement(&resource->access_fence); -+} -+ -+static inline void wined3d_resource_wait_fence(struct wined3d_resource *resource) -+{ -+ while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); -+} -+ - /* Tests show that the start address of resources is 32 byte aligned */ - #define RESOURCE_ALIGNMENT 16 - --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Fence-update_texture-and-update_surface-call.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Fence-update_texture-and-update_surface-call.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Fence-update_texture-and-update_surface-call.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Fence-update_texture-and-update_surface-call.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -From a83b0e8543213b11848897ea954412ac0f06083a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 30 Aug 2013 10:41:42 +0200 -Subject: wined3d: Fence update_texture and update_surface calls - ---- - dlls/wined3d/cs.c | 26 ++++++++++++++++++++++++++ - dlls/wined3d/resource.c | 28 ++++++++++++++++++++++++++++ - 2 files changed, 54 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 1197eef..9a7e6df 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1844,6 +1844,16 @@ static UINT wined3d_cs_exec_update_surface(struct wined3d_cs *cs, const void *da - surface_upload_from_surface(op->dst, op->has_dst_point ? &op->dst_point : NULL, - op->src, op->has_src_rect ? &op->src_rect : NULL); - -+ if (op->src->container) -+ wined3d_resource_dec_fence(&op->src->container->resource); -+ else -+ wined3d_resource_inc_fence(&op->src->resource); -+ -+ if (op->dst->container) -+ wined3d_resource_dec_fence(&op->dst->container->resource); -+ else -+ wined3d_resource_inc_fence(&op->dst->resource); -+ - return sizeof(*op); - } - -@@ -1871,6 +1881,16 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac - op->dst_point = *dst_point; - } - -+ if (src->container) -+ wined3d_resource_inc_fence(&src->container->resource); -+ else -+ wined3d_resource_inc_fence(&src->resource); -+ -+ if (dst->container) -+ wined3d_resource_inc_fence(&dst->container->resource); -+ else -+ wined3d_resource_inc_fence(&dst->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - -@@ -1930,6 +1950,9 @@ static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da - device_exec_update_texture(context, op->src, op->dst); - context_release(context); - -+ wined3d_resource_dec_fence(&op->src->resource); -+ wined3d_resource_dec_fence(&op->dst->resource); -+ - return sizeof(*op); - } - -@@ -1943,6 +1966,9 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur - op->src = src; - op->dst = dst; - -+ wined3d_resource_inc_fence(&op->src->resource); -+ wined3d_resource_inc_fence(&op->dst->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index af60d51..708b080 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -712,6 +712,32 @@ void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD fla - return mem; - } - -+static void wined3d_resource_sync(struct wined3d_resource *resource) -+{ -+ struct wined3d_resource *real_res = resource; -+ struct wined3d_surface *surface; -+ struct wined3d_volume *volume; -+ -+ switch (resource->type) -+ { -+ case WINED3D_RTYPE_SURFACE: -+ surface = surface_from_resource(resource); -+ if (surface->container) -+ real_res = &surface->container->resource; -+ break; -+ -+ case WINED3D_RTYPE_VOLUME: -+ volume = volume_from_resource(resource); -+ real_res = &volume->container->resource; -+ break; -+ -+ default: -+ break; -+ } -+ if (!real_res->access_fence) -+ FIXME("Waiting for CS even though resource %p is idle.\n", resource); -+} -+ - HRESULT wined3d_resource_map(struct wined3d_resource *resource, - struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) - { -@@ -730,6 +756,8 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - - flags = wined3d_resource_sanitize_map_flags(resource, flags); - -+ wined3d_resource_sync(resource); -+ - base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); - if (!base_memory) - { --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Send-flips-through-the-command-stream.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Send-flips-through-the-command-stream.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Send-flips-through-the-command-stream.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0104-wined3d-Send-flips-through-the-command-stream.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,115 @@ +From 883b523131797cfb6e3c715ff8018850d48734a6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 6 Aug 2013 17:39:26 +0200 +Subject: wined3d: Send flips through the command stream + +TODO: This remove this patch and flip_surface / surface_flip. +--- + dlls/wined3d/surface.c | 77 ------------------------------------------ + dlls/wined3d/wined3d_private.h | 2 +- + 2 files changed, 1 insertion(+), 78 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index b19355c..0c3313d 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -2758,83 +2758,6 @@ void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl + } + } + +-void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) +-{ +- if (front->container->level_count != 1 || front->container->layer_count != 1 +- || back->container->level_count != 1 || back->container->layer_count != 1) +- ERR("Flip between surfaces %p and %p not supported.\n", front, back); +- +- /* Flip the surface contents */ +- /* Flip the DC */ +- { +- HDC tmp; +- tmp = front->hDC; +- front->hDC = back->hDC; +- back->hDC = tmp; +- } +- +- /* Flip the DIBsection */ +- { +- HBITMAP tmp = front->dib.DIBsection; +- front->dib.DIBsection = back->dib.DIBsection; +- back->dib.DIBsection = tmp; +- } +- +- /* Flip the surface data */ +- { +- void* tmp; +- +- tmp = front->resource.bitmap_data; +- front->resource.bitmap_data = back->resource.bitmap_data; +- back->resource.bitmap_data = tmp; +- +- tmp = front->resource.heap_memory; +- front->resource.heap_memory = back->resource.heap_memory; +- back->resource.heap_memory = tmp; +- } +- +- /* Flip the PBO */ +- { +- GLuint tmp_pbo = front->resource.buffer_object; +- front->resource.buffer_object = back->resource.buffer_object; +- back->resource.buffer_object = tmp_pbo; +- } +- +- /* Flip the opengl texture */ +- { +- GLuint tmp; +- +- tmp = back->container->texture_rgb.name; +- back->container->texture_rgb.name = front->container->texture_rgb.name; +- front->container->texture_rgb.name = tmp; +- +- tmp = back->container->texture_srgb.name; +- back->container->texture_srgb.name = front->container->texture_srgb.name; +- front->container->texture_srgb.name = tmp; +- +- tmp = back->rb_multisample; +- back->rb_multisample = front->rb_multisample; +- front->rb_multisample = tmp; +- +- tmp = back->rb_resolved; +- back->rb_resolved = front->rb_resolved; +- front->rb_resolved = tmp; +- +- resource_unload(&back->resource); +- resource_unload(&front->resource); +- } +- +- { +- DWORD tmp_flags = back->flags; +- back->flags = front->flags; +- front->flags = tmp_flags; +- +- tmp_flags = back->resource.locations; +- back->resource.locations = front->resource.locations; +- front->resource.locations = tmp_flags; +- } +-} +- + /* Does a direct frame buffer -> texture copy. Stretching is done with single + * pixel copy calls. */ + static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index b9eee2c..a2bee4d 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2424,7 +2424,7 @@ BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect + + void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, + const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +-void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN; ++void surface_flip(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN; + + /* Surface flags: */ + #define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */ +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Dirtify-resources-on-unmap.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Dirtify-resources-on-unmap.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Dirtify-resources-on-unmap.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Dirtify-resources-on-unmap.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -From 440a516b0908c7282e89fe73a788ca461d90d81e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 26 Sep 2013 17:25:01 +0200 -Subject: wined3d: Dirtify resources on unmap - ---- - dlls/wined3d/resource.c | 7 ++++++- - dlls/wined3d/surface.c | 4 ++++ - dlls/wined3d/volume.c | 3 +++ - dlls/wined3d/wined3d_private.h | 1 + - 4 files changed, 14 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 708b080..73011f8 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -806,7 +806,7 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - } - - if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) -- wined3d_resource_invalidate_location(resource, ~resource->map_binding); -+ resource->unmap_dirtify = TRUE; - - resource->map_count++; - -@@ -826,6 +826,11 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) - wined3d_resource_release_map_ptr(resource, context); - if (context) - context_release(context); -+ -+ if (resource->unmap_dirtify) -+ wined3d_resource_invalidate_location(resource, ~resource->map_binding); -+ resource->unmap_dirtify = FALSE; -+ - } - - HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 0c3313d..e661494 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -2405,6 +2405,10 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) - HRESULT hr; - TRACE("surface %p.\n", surface); - -+ if (surface->resource.unmap_dirtify && surface->container) -+ wined3d_texture_set_dirty(surface->container); -+ -+ - hr = wined3d_resource_unmap(&surface->resource); - if (FAILED(hr)) - return hr; -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 7ce5331..faadea1 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -424,6 +424,9 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) - { - HRESULT hr; - -+ if (volume->resource.unmap_dirtify) -+ wined3d_texture_set_dirty(volume->container); -+ - hr = wined3d_resource_unmap(&volume->resource); - if (hr == WINEDDERR_NOTLOCKED) - return WINED3DERR_INVALIDCALL; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index b4e5679..d670fe1 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2119,6 +2119,7 @@ struct wined3d_resource - struct list resource_list_entry; - DWORD locations; - LONG access_fence; -+ BOOL unmap_dirtify; - - void *parent; - const struct wined3d_parent_ops *parent_ops; --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Introduce-resource-fencing.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Introduce-resource-fencing.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Introduce-resource-fencing.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0105-wined3d-Introduce-resource-fencing.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,99 @@ +From cba6a35d48886d00959d29d4fef9115a46143589 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 20 Aug 2014 18:01:36 +0200 +Subject: wined3d: Introduce resource fencing. + +FIXME: The buffer part doesn't really make sense without dynamic buffer maps. +--- + dlls/wined3d/cs.c | 19 +++++++++++++++++++ + dlls/wined3d/wined3d_private.h | 16 ++++++++++++++++ + 2 files changed, 35 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 11aa133..1197eef 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -575,6 +575,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_draw *op = data; + const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; ++ unsigned int i; + + if (op->indexed && !gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]) + { +@@ -593,6 +594,14 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + draw_primitive(cs->device, &cs->state, op->start_idx, op->index_count, + op->start_instance, op->instance_count, op->indexed); + ++ if (op->indexed) ++ wined3d_resource_dec_fence(&cs->state.index_buffer->resource); ++ for (i = 0; i < sizeof(cs->state.streams) / sizeof(*cs->state.streams); i++) ++ { ++ if (cs->state.streams[i].buffer) ++ wined3d_resource_dec_fence(&cs->state.streams[i].buffer->resource); ++ } ++ + return sizeof(*op); + } + +@@ -600,6 +609,8 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun + UINT start_instance, UINT instance_count, BOOL indexed) + { + struct wined3d_cs_draw *op; ++ unsigned int i; ++ const struct wined3d_state *state = &cs->device->state; + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_DRAW; +@@ -609,6 +620,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun + op->instance_count = instance_count; + op->indexed = indexed; + ++ if (indexed) ++ wined3d_resource_inc_fence(&state->index_buffer->resource); ++ for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++) ++ { ++ if (state->streams[i].buffer) ++ wined3d_resource_inc_fence(&state->streams[i].buffer->resource); ++ } ++ + cs->ops->submit(cs, sizeof(*op)); + } + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 570f5e3..10d0789 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2129,6 +2129,7 @@ struct wined3d_resource + GLuint buffer_object; + struct list resource_list_entry; + DWORD locations; ++ LONG access_fence; + + void *parent; + const struct wined3d_parent_ops *parent_ops; +@@ -2182,6 +2183,21 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) DECLSPEC + void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; + ++static inline void wined3d_resource_inc_fence(struct wined3d_resource *resource) ++{ ++ InterlockedIncrement(&resource->access_fence); ++} ++ ++static inline void wined3d_resource_dec_fence(struct wined3d_resource *resource) ++{ ++ InterlockedDecrement(&resource->access_fence); ++} ++ ++static inline void wined3d_resource_wait_fence(struct wined3d_resource *resource) ++{ ++ while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); ++} ++ + /* Tests show that the start address of resources is 32 byte aligned */ + #define RESOURCE_ALIGNMENT 16 + +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Fence-texture-reads-in-draws.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Fence-texture-reads-in-draws.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Fence-texture-reads-in-draws.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Fence-texture-reads-in-draws.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -From 2d87f930869bcd32273e722a50a13a9330ce6a30 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 30 Aug 2013 22:42:33 +0200 -Subject: wined3d: Fence texture reads in draws - -This is probably stricter than necessary. GL BOs and allocated sysmem -are just staging resources. After they have been uploaded into the GL -texture, it's in theory OK to write new data buffer without interfering -with old draws. However, it is impossible to tell when if data has been -transfered into the texture because texture loads are delayed until draw -time. Specifically, it is difficult to separate two consecutive maps -from a map, draw, map sequence, where the draw hasn't been executed by -the time the second map occurs. - -The other problem is that sRGB may cause a texture load from -buffer/sysmem even though the GL texture is thought to be loaded. This -is limited to situations where sRGB textures are supported, but -sRGB_decode isn't. ---- - dlls/wined3d/cs.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 9a7e6df..0277a1e 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -601,6 +601,11 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - if (cs->state.streams[i].buffer) - wined3d_resource_dec_fence(&cs->state.streams[i].buffer->resource); - } -+ for (i = 0; i < sizeof(cs->state.textures) / sizeof(*cs->state.textures); i++) -+ { -+ if (cs->state.textures[i]) -+ wined3d_resource_dec_fence(&cs->state.textures[i]->resource); -+ } - - return sizeof(*op); - } -@@ -627,6 +632,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun - if (state->streams[i].buffer) - wined3d_resource_inc_fence(&state->streams[i].buffer->resource); - } -+ for (i = 0; i < sizeof(state->textures) / sizeof(*state->textures); i++) -+ { -+ if (state->textures[i]) -+ wined3d_resource_inc_fence(&state->textures[i]->resource); -+ } - - cs->ops->submit(cs, sizeof(*op)); - } --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Fence-update_texture-and-update_surface-call.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Fence-update_texture-and-update_surface-call.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Fence-update_texture-and-update_surface-call.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0106-wined3d-Fence-update_texture-and-update_surface-call.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,117 @@ +From a83b0e8543213b11848897ea954412ac0f06083a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 30 Aug 2013 10:41:42 +0200 +Subject: wined3d: Fence update_texture and update_surface calls + +--- + dlls/wined3d/cs.c | 26 ++++++++++++++++++++++++++ + dlls/wined3d/resource.c | 28 ++++++++++++++++++++++++++++ + 2 files changed, 54 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 1197eef..9a7e6df 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1844,6 +1844,16 @@ static UINT wined3d_cs_exec_update_surface(struct wined3d_cs *cs, const void *da + surface_upload_from_surface(op->dst, op->has_dst_point ? &op->dst_point : NULL, + op->src, op->has_src_rect ? &op->src_rect : NULL); + ++ if (op->src->container) ++ wined3d_resource_dec_fence(&op->src->container->resource); ++ else ++ wined3d_resource_inc_fence(&op->src->resource); ++ ++ if (op->dst->container) ++ wined3d_resource_dec_fence(&op->dst->container->resource); ++ else ++ wined3d_resource_inc_fence(&op->dst->resource); ++ + return sizeof(*op); + } + +@@ -1871,6 +1881,16 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac + op->dst_point = *dst_point; + } + ++ if (src->container) ++ wined3d_resource_inc_fence(&src->container->resource); ++ else ++ wined3d_resource_inc_fence(&src->resource); ++ ++ if (dst->container) ++ wined3d_resource_inc_fence(&dst->container->resource); ++ else ++ wined3d_resource_inc_fence(&dst->resource); ++ + cs->ops->submit(cs, sizeof(*op)); + } + +@@ -1930,6 +1950,9 @@ static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da + device_exec_update_texture(context, op->src, op->dst); + context_release(context); + ++ wined3d_resource_dec_fence(&op->src->resource); ++ wined3d_resource_dec_fence(&op->dst->resource); ++ + return sizeof(*op); + } + +@@ -1943,6 +1966,9 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur + op->src = src; + op->dst = dst; + ++ wined3d_resource_inc_fence(&op->src->resource); ++ wined3d_resource_inc_fence(&op->dst->resource); ++ + cs->ops->submit(cs, sizeof(*op)); + } + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index af60d51..708b080 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -712,6 +712,32 @@ void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD fla + return mem; + } + ++static void wined3d_resource_sync(struct wined3d_resource *resource) ++{ ++ struct wined3d_resource *real_res = resource; ++ struct wined3d_surface *surface; ++ struct wined3d_volume *volume; ++ ++ switch (resource->type) ++ { ++ case WINED3D_RTYPE_SURFACE: ++ surface = surface_from_resource(resource); ++ if (surface->container) ++ real_res = &surface->container->resource; ++ break; ++ ++ case WINED3D_RTYPE_VOLUME: ++ volume = volume_from_resource(resource); ++ real_res = &volume->container->resource; ++ break; ++ ++ default: ++ break; ++ } ++ if (!real_res->access_fence) ++ FIXME("Waiting for CS even though resource %p is idle.\n", resource); ++} ++ + HRESULT wined3d_resource_map(struct wined3d_resource *resource, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) + { +@@ -730,6 +756,8 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + + flags = wined3d_resource_sanitize_map_flags(resource, flags); + ++ wined3d_resource_sync(resource); ++ + base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); + if (!base_memory) + { +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Dirtify-resources-on-unmap.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Dirtify-resources-on-unmap.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Dirtify-resources-on-unmap.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Dirtify-resources-on-unmap.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,81 @@ +From 440a516b0908c7282e89fe73a788ca461d90d81e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 26 Sep 2013 17:25:01 +0200 +Subject: wined3d: Dirtify resources on unmap + +--- + dlls/wined3d/resource.c | 7 ++++++- + dlls/wined3d/surface.c | 4 ++++ + dlls/wined3d/volume.c | 3 +++ + dlls/wined3d/wined3d_private.h | 1 + + 4 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 708b080..73011f8 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -806,7 +806,7 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + } + + if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) +- wined3d_resource_invalidate_location(resource, ~resource->map_binding); ++ resource->unmap_dirtify = TRUE; + + resource->map_count++; + +@@ -826,6 +826,11 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) + wined3d_resource_release_map_ptr(resource, context); + if (context) + context_release(context); ++ ++ if (resource->unmap_dirtify) ++ wined3d_resource_invalidate_location(resource, ~resource->map_binding); ++ resource->unmap_dirtify = FALSE; ++ + } + + HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 0c3313d..e661494 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -2405,6 +2405,10 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + HRESULT hr; + TRACE("surface %p.\n", surface); + ++ if (surface->resource.unmap_dirtify && surface->container) ++ wined3d_texture_set_dirty(surface->container); ++ ++ + hr = wined3d_resource_unmap(&surface->resource); + if (FAILED(hr)) + return hr; +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 7ce5331..faadea1 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -424,6 +424,9 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) + { + HRESULT hr; + ++ if (volume->resource.unmap_dirtify) ++ wined3d_texture_set_dirty(volume->container); ++ + hr = wined3d_resource_unmap(&volume->resource); + if (hr == WINEDDERR_NOTLOCKED) + return WINED3DERR_INVALIDCALL; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index b4e5679..d670fe1 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2119,6 +2119,7 @@ struct wined3d_resource + struct list resource_list_entry; + DWORD locations; + LONG access_fence; ++ BOOL unmap_dirtify; + + void *parent; + const struct wined3d_parent_ops *parent_ops; +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Fence-render-targets-and-depth-stencils.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Fence-render-targets-and-depth-stencils.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Fence-render-targets-and-depth-stencils.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0107-wined3d-Fence-render-targets-and-depth-stencils.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -From 093a05f4ff44d45e81e9e0f3dada8fb6551cf382 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 16:55:58 +0200 -Subject: wined3d: Fence render targets and depth stencils - ---- - dlls/wined3d/cs.c | 38 ++++++++++++++++++++++++++++++++++++++ - 1 file changed, 38 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 0277a1e..a4b996e 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -571,6 +571,30 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * - cs->ops->submit(cs, size); - } - -+static inline BOOL wined3d_cs_colorwrite_enabled(const struct wined3d_state *state, unsigned int i) -+{ -+ switch (i) -+ { -+ case 0: -+ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE]; -+ case 1: -+ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE1]; -+ case 2: -+ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE2]; -+ case 3: -+ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE3]; -+ default: -+ ERR("Unexpected color target %u.\n", i); -+ return TRUE; -+ } -+} -+ -+static inline BOOL wined3d_cs_depth_stencil_enabled(const struct wined3d_state *state) -+{ -+ return state->render_states[WINED3D_RS_ZENABLE] -+ || state->render_states[WINED3D_RS_STENCILENABLE]; -+} -+ - static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_draw *op = data; -@@ -606,6 +630,13 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - if (cs->state.textures[i]) - wined3d_resource_dec_fence(&cs->state.textures[i]->resource); - } -+ for (i = 0; i < sizeof(cs->state.fb.render_targets) / sizeof(*cs->state.fb.render_targets); i++) -+ { -+ if (cs->state.fb.render_targets[i] && wined3d_cs_colorwrite_enabled(&cs->state, i)) -+ wined3d_resource_dec_fence(cs->state.fb.render_targets[i]->resource); -+ } -+ if (cs->state.fb.depth_stencil && wined3d_cs_depth_stencil_enabled(&cs->state)) -+ wined3d_resource_dec_fence(cs->state.fb.depth_stencil->resource); - - return sizeof(*op); - } -@@ -637,6 +668,13 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun - if (state->textures[i]) - wined3d_resource_inc_fence(&state->textures[i]->resource); - } -+ for (i = 0; i < sizeof(state->fb.render_targets) / sizeof(*state->fb.render_targets); i++) -+ { -+ if (state->fb.render_targets[i] && wined3d_cs_colorwrite_enabled(state, i)) -+ wined3d_resource_inc_fence(state->fb.render_targets[i]->resource); -+ } -+ if (state->fb.depth_stencil && wined3d_cs_depth_stencil_enabled(state)) -+ wined3d_resource_inc_fence(state->fb.depth_stencil->resource); - - cs->ops->submit(cs, sizeof(*op)); - } --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Fence-blit-operations.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Fence-blit-operations.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Fence-blit-operations.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Fence-blit-operations.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -From 5903d5d7db4ffbfb87d1b9616d13ea05d19dd171 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 16:57:01 +0200 -Subject: wined3d: Fence blit operations. - ---- - dlls/wined3d/cs.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index a4b996e..5603a37 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1709,6 +1709,10 @@ static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) - op->src_surface, &op->src_rect, - op->flags, &op->fx, op->filter); - -+ wined3d_resource_dec_fence(&op->dst_surface->container->resource); -+ if (op->src_surface && op->src_surface != op->dst_surface) -+ wined3d_resource_dec_fence(&op->src_surface->container->resource); -+ - return sizeof(*op); - } - -@@ -1730,6 +1734,10 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf - if (fx) - op->fx = *fx; - -+ wined3d_resource_inc_fence(&dst_surface->container->resource); -+ if (src_surface && src_surface != dst_surface) -+ wined3d_resource_inc_fence(&src_surface->container->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Fence-texture-reads-in-draws.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Fence-texture-reads-in-draws.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Fence-texture-reads-in-draws.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0108-wined3d-Fence-texture-reads-in-draws.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,53 @@ +From 2d87f930869bcd32273e722a50a13a9330ce6a30 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 30 Aug 2013 22:42:33 +0200 +Subject: wined3d: Fence texture reads in draws + +This is probably stricter than necessary. GL BOs and allocated sysmem +are just staging resources. After they have been uploaded into the GL +texture, it's in theory OK to write new data buffer without interfering +with old draws. However, it is impossible to tell when if data has been +transfered into the texture because texture loads are delayed until draw +time. Specifically, it is difficult to separate two consecutive maps +from a map, draw, map sequence, where the draw hasn't been executed by +the time the second map occurs. + +The other problem is that sRGB may cause a texture load from +buffer/sysmem even though the GL texture is thought to be loaded. This +is limited to situations where sRGB textures are supported, but +sRGB_decode isn't. +--- + dlls/wined3d/cs.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 9a7e6df..0277a1e 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -601,6 +601,11 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + if (cs->state.streams[i].buffer) + wined3d_resource_dec_fence(&cs->state.streams[i].buffer->resource); + } ++ for (i = 0; i < sizeof(cs->state.textures) / sizeof(*cs->state.textures); i++) ++ { ++ if (cs->state.textures[i]) ++ wined3d_resource_dec_fence(&cs->state.textures[i]->resource); ++ } + + return sizeof(*op); + } +@@ -627,6 +632,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun + if (state->streams[i].buffer) + wined3d_resource_inc_fence(&state->streams[i].buffer->resource); + } ++ for (i = 0; i < sizeof(state->textures) / sizeof(*state->textures); i++) ++ { ++ if (state->textures[i]) ++ wined3d_resource_inc_fence(&state->textures[i]->resource); ++ } + + cs->ops->submit(cs, sizeof(*op)); + } +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Fence-color_fill-operations.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Fence-color_fill-operations.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Fence-color_fill-operations.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Fence-color_fill-operations.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -From 97f6ef9c0d1d05efc640183d3b045296bca762a0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 16:58:13 +0200 -Subject: wined3d: Fence color_fill operations. - ---- - dlls/wined3d/cs.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 5603a37..fb92286 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1750,6 +1750,8 @@ static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data) - - surface_color_fill(surface_from_resource(resource), &op->rect, &op->color); - -+ wined3d_resource_dec_fence(op->view->resource); -+ - return sizeof(*op); - } - -@@ -1764,6 +1766,8 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge - op->rect = *rect; - op->color = *color; - -+ wined3d_resource_inc_fence(view->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Fence-render-targets-and-depth-stencils.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Fence-render-targets-and-depth-stencils.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Fence-render-targets-and-depth-stencils.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0109-wined3d-Fence-render-targets-and-depth-stencils.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,75 @@ +From 093a05f4ff44d45e81e9e0f3dada8fb6551cf382 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 16:55:58 +0200 +Subject: wined3d: Fence render targets and depth stencils + +--- + dlls/wined3d/cs.c | 38 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 38 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 0277a1e..a4b996e 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -571,6 +571,30 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * + cs->ops->submit(cs, size); + } + ++static inline BOOL wined3d_cs_colorwrite_enabled(const struct wined3d_state *state, unsigned int i) ++{ ++ switch (i) ++ { ++ case 0: ++ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE]; ++ case 1: ++ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE1]; ++ case 2: ++ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE2]; ++ case 3: ++ return !!state->render_states[WINED3D_RS_COLORWRITEENABLE3]; ++ default: ++ ERR("Unexpected color target %u.\n", i); ++ return TRUE; ++ } ++} ++ ++static inline BOOL wined3d_cs_depth_stencil_enabled(const struct wined3d_state *state) ++{ ++ return state->render_states[WINED3D_RS_ZENABLE] ++ || state->render_states[WINED3D_RS_STENCILENABLE]; ++} ++ + static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_draw *op = data; +@@ -606,6 +630,13 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) + if (cs->state.textures[i]) + wined3d_resource_dec_fence(&cs->state.textures[i]->resource); + } ++ for (i = 0; i < sizeof(cs->state.fb.render_targets) / sizeof(*cs->state.fb.render_targets); i++) ++ { ++ if (cs->state.fb.render_targets[i] && wined3d_cs_colorwrite_enabled(&cs->state, i)) ++ wined3d_resource_dec_fence(cs->state.fb.render_targets[i]->resource); ++ } ++ if (cs->state.fb.depth_stencil && wined3d_cs_depth_stencil_enabled(&cs->state)) ++ wined3d_resource_dec_fence(cs->state.fb.depth_stencil->resource); + + return sizeof(*op); + } +@@ -637,6 +668,13 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun + if (state->textures[i]) + wined3d_resource_inc_fence(&state->textures[i]->resource); + } ++ for (i = 0; i < sizeof(state->fb.render_targets) / sizeof(*state->fb.render_targets); i++) ++ { ++ if (state->fb.render_targets[i] && wined3d_cs_colorwrite_enabled(state, i)) ++ wined3d_resource_inc_fence(state->fb.render_targets[i]->resource); ++ } ++ if (state->fb.depth_stencil && wined3d_cs_depth_stencil_enabled(state)) ++ wined3d_resource_inc_fence(state->fb.depth_stencil->resource); + + cs->ops->submit(cs, sizeof(*op)); + } +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Fence-blit-operations.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Fence-blit-operations.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Fence-blit-operations.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Fence-blit-operations.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,38 @@ +From 5903d5d7db4ffbfb87d1b9616d13ea05d19dd171 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 16:57:01 +0200 +Subject: wined3d: Fence blit operations. + +--- + dlls/wined3d/cs.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index a4b996e..5603a37 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1709,6 +1709,10 @@ static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) + op->src_surface, &op->src_rect, + op->flags, &op->fx, op->filter); + ++ wined3d_resource_dec_fence(&op->dst_surface->container->resource); ++ if (op->src_surface && op->src_surface != op->dst_surface) ++ wined3d_resource_dec_fence(&op->src_surface->container->resource); ++ + return sizeof(*op); + } + +@@ -1730,6 +1734,10 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf + if (fx) + op->fx = *fx; + ++ wined3d_resource_inc_fence(&dst_surface->container->resource); ++ if (src_surface && src_surface != dst_surface) ++ wined3d_resource_inc_fence(&src_surface->container->resource); ++ + cs->ops->submit(cs, sizeof(*op)); + } + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Fence-clear-calls.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Fence-clear-calls.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Fence-clear-calls.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0110-wined3d-Fence-clear-calls.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -From d95011df395938acfe6f6c7a33f7c5c094e7df83 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 17:04:47 +0200 -Subject: wined3d: Fence clear calls. - ---- - dlls/wined3d/cs.c | 27 +++++++++++++++++++++++++-- - 1 file changed, 25 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index fb92286..bdb9279 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -540,7 +540,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) - const struct wined3d_cs_clear *op = data; - struct wined3d_device *device; - RECT draw_rect; -- unsigned int extra_rects = op->rect_count ? op->rect_count - 1 : 0; -+ unsigned int extra_rects = op->rect_count ? op->rect_count - 1 : 0, i; - - device = cs->device; - wined3d_get_draw_rect(&cs->state, &draw_rect); -@@ -548,6 +548,17 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) - &cs->state.fb, op->rect_count, op->rect_count ? op->rects : NULL, &draw_rect, op->flags, - &op->color, op->depth, op->stencil); - -+ if (op->flags & WINED3DCLEAR_TARGET) -+ { -+ for (i = 0; i < sizeof(cs->state.fb.render_targets) / sizeof(*cs->state.fb.render_targets); i++) -+ { -+ if (cs->state.fb.render_targets[i]) -+ wined3d_resource_dec_fence(cs->state.fb.render_targets[i]->resource); -+ } -+ } -+ if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) -+ wined3d_resource_dec_fence(cs->state.fb.depth_stencil->resource); -+ - return sizeof(*op) + sizeof(*op->rects) * extra_rects; - } - -@@ -555,8 +566,9 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * - DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) - { - struct wined3d_cs_clear *op; -- unsigned int extra_rects = rect_count ? rect_count - 1 : 0; -+ unsigned int extra_rects = rect_count ? rect_count - 1 : 0, i; - size_t size = sizeof(*op) + sizeof(*op->rects) * extra_rects; -+ const struct wined3d_state *state = &cs->device->state; - - op = cs->ops->require_space(cs, size); - op->opcode = WINED3D_CS_OP_CLEAR; -@@ -568,6 +580,17 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * - op->depth = depth; - op->stencil = stencil; - -+ if (flags & WINED3DCLEAR_TARGET) -+ { -+ for (i = 0; i < sizeof(state->fb.render_targets) / sizeof(*state->fb.render_targets); i++) -+ { -+ if (state->fb.render_targets[i]) -+ wined3d_resource_inc_fence(state->fb.render_targets[i]->resource); -+ } -+ } -+ if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) -+ wined3d_resource_inc_fence(state->fb.depth_stencil->resource); -+ - cs->ops->submit(cs, size); - } - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Fence-color_fill-operations.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Fence-color_fill-operations.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Fence-color_fill-operations.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Fence-color_fill-operations.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,34 @@ +From 97f6ef9c0d1d05efc640183d3b045296bca762a0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 16:58:13 +0200 +Subject: wined3d: Fence color_fill operations. + +--- + dlls/wined3d/cs.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 5603a37..fb92286 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1750,6 +1750,8 @@ static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data) + + surface_color_fill(surface_from_resource(resource), &op->rect, &op->color); + ++ wined3d_resource_dec_fence(op->view->resource); ++ + return sizeof(*op); + } + +@@ -1764,6 +1766,8 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge + op->rect = *rect; + op->color = *color; + ++ wined3d_resource_inc_fence(view->resource); ++ + cs->ops->submit(cs, sizeof(*op)); + } + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Fence-present-calls.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Fence-present-calls.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Fence-present-calls.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0111-wined3d-Fence-present-calls.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -From e485302fbcd610c34cf3e664d3d9a588fb7f3a32 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 17:55:35 +0200 -Subject: wined3d: Fence present calls. - ---- - dlls/wined3d/cs.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index bdb9279..45dc5ce 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -485,6 +485,7 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) - const RECT *src_rect = op->set_data & CS_PRESENT_SRC_RECT ? &op->src_rect : NULL; - const RECT *dst_rect = op->set_data & CS_PRESENT_DST_RECT ? &op->dst_rect : NULL; - const RGNDATA *dirty_region = op->set_data & CS_PRESENT_DIRTY_RGN ? &op->dirty_region : NULL; -+ unsigned int i; - - swapchain = op->swapchain; - wined3d_swapchain_set_window(swapchain, op->dst_window_override); -@@ -495,6 +496,10 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) - - InterlockedDecrement(&cs->pending_presents); - -+ wined3d_resource_dec_fence(&swapchain->front_buffer->resource); -+ for (i = 0; i < swapchain->desc.backbuffer_count; i++) -+ wined3d_resource_dec_fence(&swapchain->back_buffers[i]->resource); -+ - return sizeof(*op); - } - -@@ -504,6 +509,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw - { - struct wined3d_cs_present *op; - LONG pending; -+ unsigned int i; - - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_PRESENT; -@@ -527,6 +533,10 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw - } - op->flags = flags; - -+ wined3d_resource_inc_fence(&swapchain->front_buffer->resource); -+ for (i = 0; i < swapchain->desc.backbuffer_count; i++) -+ wined3d_resource_inc_fence(&swapchain->back_buffers[i]->resource); -+ - pending = InterlockedIncrement(&cs->pending_presents); - - cs->ops->submit(cs, sizeof(*op)); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Fence-clear-calls.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Fence-clear-calls.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Fence-clear-calls.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Fence-clear-calls.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,72 @@ +From d95011df395938acfe6f6c7a33f7c5c094e7df83 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 17:04:47 +0200 +Subject: wined3d: Fence clear calls. + +--- + dlls/wined3d/cs.c | 27 +++++++++++++++++++++++++-- + 1 file changed, 25 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index fb92286..bdb9279 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -540,7 +540,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) + const struct wined3d_cs_clear *op = data; + struct wined3d_device *device; + RECT draw_rect; +- unsigned int extra_rects = op->rect_count ? op->rect_count - 1 : 0; ++ unsigned int extra_rects = op->rect_count ? op->rect_count - 1 : 0, i; + + device = cs->device; + wined3d_get_draw_rect(&cs->state, &draw_rect); +@@ -548,6 +548,17 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) + &cs->state.fb, op->rect_count, op->rect_count ? op->rects : NULL, &draw_rect, op->flags, + &op->color, op->depth, op->stencil); + ++ if (op->flags & WINED3DCLEAR_TARGET) ++ { ++ for (i = 0; i < sizeof(cs->state.fb.render_targets) / sizeof(*cs->state.fb.render_targets); i++) ++ { ++ if (cs->state.fb.render_targets[i]) ++ wined3d_resource_dec_fence(cs->state.fb.render_targets[i]->resource); ++ } ++ } ++ if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) ++ wined3d_resource_dec_fence(cs->state.fb.depth_stencil->resource); ++ + return sizeof(*op) + sizeof(*op->rects) * extra_rects; + } + +@@ -555,8 +566,9 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * + DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) + { + struct wined3d_cs_clear *op; +- unsigned int extra_rects = rect_count ? rect_count - 1 : 0; ++ unsigned int extra_rects = rect_count ? rect_count - 1 : 0, i; + size_t size = sizeof(*op) + sizeof(*op->rects) * extra_rects; ++ const struct wined3d_state *state = &cs->device->state; + + op = cs->ops->require_space(cs, size); + op->opcode = WINED3D_CS_OP_CLEAR; +@@ -568,6 +580,17 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * + op->depth = depth; + op->stencil = stencil; + ++ if (flags & WINED3DCLEAR_TARGET) ++ { ++ for (i = 0; i < sizeof(state->fb.render_targets) / sizeof(*state->fb.render_targets); i++) ++ { ++ if (state->fb.render_targets[i]) ++ wined3d_resource_inc_fence(state->fb.render_targets[i]->resource); ++ } ++ } ++ if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) ++ wined3d_resource_inc_fence(state->fb.depth_stencil->resource); ++ + cs->ops->submit(cs, size); + } + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0112-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -From a14049c3703ec2f275f2ce21b45ba4bc32d6021d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 17:58:25 +0200 -Subject: wined3d: Make resource maps and unmaps a priority command. - ---- - dlls/wined3d/cs.c | 14 +++++--------- - dlls/wined3d/resource.c | 8 ++++++-- - 2 files changed, 11 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 45dc5ce..054c000 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -1819,19 +1819,15 @@ void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resourc - struct wined3d_cs_resource_map *op; - void *ret; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space_prio(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_RESOURCE_MAP; - op->resource = resource; - op->flags = flags; - op->mem = &ret; - -- cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->submit_prio(cs, sizeof(*op)); - -- if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) -- { -- FIXME("Dynamic resource map is inefficient\n"); -- } -- cs->ops->finish(cs); -+ cs->ops->finish_prio(cs); - - return ret; - } -@@ -1850,11 +1846,11 @@ void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resour - { - struct wined3d_cs_resource_unmap *op; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space_prio(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_RESOURCE_UNMAP; - op->resource = resource; - -- cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->submit_prio(cs, sizeof(*op)); - } - - static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 73011f8..d2407a1 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -734,8 +734,7 @@ static void wined3d_resource_sync(struct wined3d_resource *resource) - default: - break; - } -- if (!real_res->access_fence) -- FIXME("Waiting for CS even though resource %p is idle.\n", resource); -+ wined3d_resource_wait_fence(real_res); - } - - HRESULT wined3d_resource_map(struct wined3d_resource *resource, -@@ -756,6 +755,11 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - - flags = wined3d_resource_sanitize_map_flags(resource, flags); - -+ if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) -+ { -+ FIXME("Dynamic resource map is inefficient\n"); -+ } -+ - wined3d_resource_sync(resource); - - base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Dirtify-changed-textures-through-the-command.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Dirtify-changed-textures-through-the-command.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Dirtify-changed-textures-through-the-command.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Dirtify-changed-textures-through-the-command.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,176 +0,0 @@ -From eb59e53d03f032fe4e04a6e7843ac06e9dddbbdd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 27 Sep 2013 18:46:19 +0200 -Subject: wined3d: Dirtify changed textures through the command stream. - -This makes sure unsynchronized maps (NOOVERWRITE /DISCARD) are reflected -in the volume's location flags at the right time. ---- - dlls/wined3d/cs.c | 31 ++++++++++++++++++++++++++++++- - dlls/wined3d/resource.c | 15 ++++++++++----- - dlls/wined3d/surface.c | 9 +++------ - dlls/wined3d/wined3d_private.h | 2 ++ - 4 files changed, 45 insertions(+), 12 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 054c000..f5c10dd 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -65,6 +65,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SET_LIGHT_ENABLE, - WINED3D_CS_OP_BLT, - WINED3D_CS_OP_CLEAR_RTV, -+ WINED3D_CS_OP_RESOURCE_CHANGED, - WINED3D_CS_OP_RESOURCE_MAP, - WINED3D_CS_OP_RESOURCE_UNMAP, - WINED3D_CS_OP_QUERY_ISSUE, -@@ -365,6 +366,12 @@ struct wined3d_cs_resource_unmap - struct wined3d_resource *resource; - }; - -+struct wined3d_cs_resource_changed -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_resource *resource; -+}; -+ - struct wined3d_cs_skip - { - enum wined3d_cs_op opcode; -@@ -1804,6 +1811,27 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_resource_changed(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_resource_changed *op = data; -+ struct wined3d_resource *resource = op->resource; -+ -+ wined3d_resource_changed(resource); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) -+{ -+ struct wined3d_cs_resource_changed *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_RESOURCE_CHANGED; -+ op->resource = resource; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT wined3d_cs_exec_resource_map(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_resource_map *op = data; -@@ -2110,11 +2138,11 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_INDEX_BUFFER */ wined3d_cs_exec_set_index_buffer, - /* WINED3D_CS_OP_SET_CONSTANT_BUFFER */ wined3d_cs_exec_set_constant_buffer, - /* WINED3D_CS_OP_SET_TEXTURE */ wined3d_cs_exec_set_texture, -- /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, - /* WINED3D_CS_OP_SET_SAMPLER */ wined3d_cs_exec_set_sampler, - /* WINED3D_CS_OP_SET_SHADER */ wined3d_cs_exec_set_shader, - /* WINED3D_CS_OP_SET_RENDER_STATE */ wined3d_cs_exec_set_render_state, - /* WINED3D_CS_OP_SET_TEXTURE_STATE */ wined3d_cs_exec_set_texture_state, -+ /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, - /* WINED3D_CS_OP_SET_SAMPLER_STATE */ wined3d_cs_exec_set_sampler_state, - /* WINED3D_CS_OP_SET_TRANSFORM */ wined3d_cs_exec_set_transform, - /* WINED3D_CS_OP_SET_CLIP_PLANE */ wined3d_cs_exec_set_clip_plane, -@@ -2133,6 +2161,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, - /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, - /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, -+ /* WINED3D_CS_OP_RESOURCE_CHANGED */ wined3d_cs_exec_resource_changed, - /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, - /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, - /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index d2407a1..7cafdc6 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -830,11 +830,6 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) - wined3d_resource_release_map_ptr(resource, context); - if (context) - context_release(context); -- -- if (resource->unmap_dirtify) -- wined3d_resource_invalidate_location(resource, ~resource->map_binding); -- resource->unmap_dirtify = FALSE; -- - } - - HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) -@@ -849,7 +844,17 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - } - - wined3d_cs_emit_resource_unmap(device->cs, resource); -+ -+ if (resource->unmap_dirtify) -+ wined3d_cs_emit_resource_changed(device->cs, resource); -+ resource->unmap_dirtify = FALSE; -+ - resource->map_count--; - - return WINED3D_OK; - } -+ -+void wined3d_resource_changed(struct wined3d_resource *resource) -+{ -+ wined3d_resource_invalidate_location(resource, ~resource->map_binding); -+} -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index e661494..535e21a 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -1093,6 +1093,9 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour - - if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - wined3d_texture_set_dirty(surface->container); -+ -+ if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) -+ surface->surface_ops->surface_frontbuffer_updated(surface); - } - - static const struct wined3d_surface_ops surface_ops = -@@ -2405,16 +2408,10 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) - HRESULT hr; - TRACE("surface %p.\n", surface); - -- if (surface->resource.unmap_dirtify && surface->container) -- wined3d_texture_set_dirty(surface->container); -- -- - hr = wined3d_resource_unmap(&surface->resource); - if (FAILED(hr)) - return hr; - -- if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) -- surface->surface_ops->surface_frontbuffer_updated(surface); - memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); - - return hr; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index d670fe1..b9831fd 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2146,6 +2146,7 @@ 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; -+void wined3d_resource_changed(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - 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; -@@ -2662,6 +2663,7 @@ 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; -+void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, - DWORD flags) DECLSPEC_HIDDEN; - void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Fence-present-calls.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Fence-present-calls.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Fence-present-calls.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0113-wined3d-Fence-present-calls.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,54 @@ +From e485302fbcd610c34cf3e664d3d9a588fb7f3a32 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 17:55:35 +0200 +Subject: wined3d: Fence present calls. + +--- + dlls/wined3d/cs.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index bdb9279..45dc5ce 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -485,6 +485,7 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) + const RECT *src_rect = op->set_data & CS_PRESENT_SRC_RECT ? &op->src_rect : NULL; + const RECT *dst_rect = op->set_data & CS_PRESENT_DST_RECT ? &op->dst_rect : NULL; + const RGNDATA *dirty_region = op->set_data & CS_PRESENT_DIRTY_RGN ? &op->dirty_region : NULL; ++ unsigned int i; + + swapchain = op->swapchain; + wined3d_swapchain_set_window(swapchain, op->dst_window_override); +@@ -495,6 +496,10 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) + + InterlockedDecrement(&cs->pending_presents); + ++ wined3d_resource_dec_fence(&swapchain->front_buffer->resource); ++ for (i = 0; i < swapchain->desc.backbuffer_count; i++) ++ wined3d_resource_dec_fence(&swapchain->back_buffers[i]->resource); ++ + return sizeof(*op); + } + +@@ -504,6 +509,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw + { + struct wined3d_cs_present *op; + LONG pending; ++ unsigned int i; + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_PRESENT; +@@ -527,6 +533,10 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw + } + op->flags = flags; + ++ wined3d_resource_inc_fence(&swapchain->front_buffer->resource); ++ for (i = 0; i < swapchain->desc.backbuffer_count; i++) ++ wined3d_resource_inc_fence(&swapchain->back_buffers[i]->resource); ++ + pending = InterlockedIncrement(&cs->pending_presents); + + cs->ops->submit(cs, sizeof(*op)); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,80 @@ +From a14049c3703ec2f275f2ce21b45ba4bc32d6021d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 17:58:25 +0200 +Subject: wined3d: Make resource maps and unmaps a priority command. + +--- + dlls/wined3d/cs.c | 14 +++++--------- + dlls/wined3d/resource.c | 8 ++++++-- + 2 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 45dc5ce..054c000 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -1819,19 +1819,15 @@ void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resourc + struct wined3d_cs_resource_map *op; + void *ret; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space_prio(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_RESOURCE_MAP; + op->resource = resource; + op->flags = flags; + op->mem = &ret; + +- cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->submit_prio(cs, sizeof(*op)); + +- if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) +- { +- FIXME("Dynamic resource map is inefficient\n"); +- } +- cs->ops->finish(cs); ++ cs->ops->finish_prio(cs); + + return ret; + } +@@ -1850,11 +1846,11 @@ void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resour + { + struct wined3d_cs_resource_unmap *op; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space_prio(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_RESOURCE_UNMAP; + op->resource = resource; + +- cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->submit_prio(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 73011f8..d2407a1 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -734,8 +734,7 @@ static void wined3d_resource_sync(struct wined3d_resource *resource) + default: + break; + } +- if (!real_res->access_fence) +- FIXME("Waiting for CS even though resource %p is idle.\n", resource); ++ wined3d_resource_wait_fence(real_res); + } + + HRESULT wined3d_resource_map(struct wined3d_resource *resource, +@@ -756,6 +755,11 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + + flags = wined3d_resource_sanitize_map_flags(resource, flags); + ++ if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) ++ { ++ FIXME("Dynamic resource map is inefficient\n"); ++ } ++ + wined3d_resource_sync(resource); + + base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,269 +0,0 @@ -From e9a13b9c7f3776005db0f8f32a43241c6c66b5be 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 - -The idea is to use those structures for mapping through the command stream and caching -them for DISCARD maps. ---- - dlls/wined3d/device.c | 53 ++++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/resource.c | 34 +++++++++++---------------- - dlls/wined3d/surface.c | 6 ++--- - dlls/wined3d/volume.c | 6 ++--- - dlls/wined3d/wined3d_private.h | 15 +++++++++++- - 5 files changed, 86 insertions(+), 28 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 18b1784..039ca85 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -5052,3 +5052,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL - else - return CallWindowProcA(proc, window, message, wparam, lparam); - } -+ -+/* Context activation is done by the caller */ -+struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, -+ GLenum type_hint, struct wined3d_context *context) -+{ -+ struct wined3d_gl_bo *ret; -+ const struct wined3d_gl_info *gl_info; -+ -+ TRACE("device %p, size %u, gl_usage %u, type_hint %u\n", device, size, gl_usage, -+ type_hint); -+ -+ ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)); -+ if(!ret) -+ return NULL; -+ ret->type_hint = type_hint; -+ ret->size = size; -+ ret->usage = gl_usage; -+ -+ gl_info = context->gl_info; -+ -+ GL_EXTCALL(glGenBuffers(1, &ret->name)); -+ if (type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) -+ context_invalidate_state(context, STATE_INDEXBUFFER); -+ 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); -+ return ret; -+} -+ -+/* Context activation is done by the caller */ -+static void wined3d_device_destroy_bo(struct wined3d_device *device, const struct wined3d_context *context, -+ struct wined3d_gl_bo *bo) -+{ -+ 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(glDeleteBuffers(1, &bo->name)); -+ checkGLcall("glDeleteBuffers"); -+ -+ HeapFree(GetProcessHeap(), 0, bo); -+} -+ -+/* Context activation is done by the caller */ -+void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, -+ const struct wined3d_context *context) -+{ -+ TRACE("device %p, bo %p, GL bo %u\n", device, bo, bo->name); -+ -+ wined3d_device_destroy_bo(device, context, bo); -+} -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 2530ee0..4496c9b 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -154,12 +154,10 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * - void wined3d_resource_free_bo(struct wined3d_resource *resource) - { - struct wined3d_context *context = context_acquire(resource->device, NULL); -- 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(glDeleteBuffers(1, &resource->buffer_object)); -- checkGLcall("glDeleteBuffers"); -- resource->buffer_object = 0; -+ wined3d_device_release_bo(resource->device, resource->buffer, context); -+ resource->buffer = NULL; -+ - context_release(context); - } - -@@ -175,7 +173,7 @@ void resource_cleanup(struct wined3d_resource *resource) - adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); - } - -- if (resource->buffer_object) -+ if (resource->buffer) - wined3d_resource_free_bo(resource); - - wined3d_resource_free_sysmem(resource); -@@ -188,7 +186,7 @@ void resource_unload(struct wined3d_resource *resource) - if (resource->map_count) - ERR("Resource %p is being unloaded while mapped.\n", resource); - -- if (resource->buffer_object) -+ if (resource->buffer) - wined3d_resource_free_bo(resource); - - context_resource_unloaded(resource->device, -@@ -437,7 +435,7 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, - { - if (location & WINED3D_LOCATION_BUFFER) - { -- data->buffer_object = resource->buffer_object; -+ data->buffer_object = resource->buffer->name; - data->addr = NULL; - return; - } -@@ -546,7 +544,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, - { - case WINED3D_LOCATION_BUFFER: - gl_info = context->gl_info; -- 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]) - { -@@ -589,7 +587,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, - { - case WINED3D_LOCATION_BUFFER: - gl_info = context->gl_info; -- 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"); -@@ -607,20 +605,14 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, - } - - /* Context activation is done by the caller. */ --static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, const struct wined3d_context *context) -+static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struct wined3d_context *context) - { -- const struct wined3d_gl_info *gl_info = context->gl_info; -- -- if (resource->buffer_object) -+ if (resource->buffer) - return; - -- 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, 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 fc719e7..d1020df 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -48,7 +48,7 @@ static void surface_cleanup(struct wined3d_surface *surface) - surface->resource.device->cs->ops->finish(surface->resource.device->cs); - } - -- if (surface->resource.buffer_object || surface->rb_multisample -+ if (surface->resource.buffer || surface->rb_multisample - || surface->rb_resolved || !list_empty(&surface->renderbuffers)) - { - struct wined3d_renderbuffer_entry *entry, *entry2; -@@ -2591,7 +2591,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 -- || surface->resource.buffer_object)) -+ || surface->resource.buffer)) - surface->resource.map_binding = WINED3D_LOCATION_DIB; - } - -@@ -3897,7 +3897,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. */ -- if ((format.convert || conversion) && surface->resource.buffer_object) -+ if ((format.convert || conversion) && surface->resource.buffer) - { - TRACE("Removing the pbo attached to surface %p.\n", surface); - -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 6fc23f3..f6d2e8f 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -218,7 +218,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, - } - else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) - { -- struct wined3d_const_bo_address data = {volume->resource.buffer_object, NULL}; -+ struct wined3d_const_bo_address data = {volume->resource.buffer->name, NULL}; - wined3d_texture_bind_and_dirtify(volume->container, context, - location == WINED3D_LOCATION_TEXTURE_SRGB); - wined3d_volume_upload_data(volume, context, &data); -@@ -269,12 +269,12 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, - break; - - case WINED3D_LOCATION_BUFFER: -- if (!volume->resource.buffer_object) -+ if (!volume->resource.buffer) - ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); - - if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - { -- struct wined3d_bo_address data = {volume->resource.buffer_object, NULL}; -+ struct wined3d_bo_address data = {volume->resource.buffer->name, NULL}; - - if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) - wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index b23757b..2f85556 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2007,6 +2007,14 @@ struct wined3d_state - DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; - }; - -+struct wined3d_gl_bo -+{ -+ GLuint name; -+ GLenum usage; -+ GLenum type_hint; -+ UINT size; -+}; -+ - #define WINED3D_UNMAPPED_STAGE ~0U - - /* Multithreaded flag. Removed from the public header to signal that -@@ -2113,6 +2121,11 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) D - void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; - void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, - struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN; -+struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, -+ GLenum type_hint, struct wined3d_context *context) DECLSPEC_HIDDEN; -+void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, -+ const struct wined3d_context *context) DECLSPEC_HIDDEN; -+ - - static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) - { -@@ -2156,7 +2169,7 @@ struct wined3d_resource - DWORD priority; - void *heap_memory, *user_memory, *bitmap_data; - UINT custom_row_pitch, custom_slice_pitch; -- GLuint buffer_object; -+ struct wined3d_gl_bo *buffer; - struct list resource_list_entry; - DWORD locations; - LONG access_fence; --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Dirtify-changed-textures-through-the-command.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Dirtify-changed-textures-through-the-command.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Dirtify-changed-textures-through-the-command.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Dirtify-changed-textures-through-the-command.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,176 @@ +From eb59e53d03f032fe4e04a6e7843ac06e9dddbbdd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 27 Sep 2013 18:46:19 +0200 +Subject: wined3d: Dirtify changed textures through the command stream. + +This makes sure unsynchronized maps (NOOVERWRITE /DISCARD) are reflected +in the volume's location flags at the right time. +--- + dlls/wined3d/cs.c | 31 ++++++++++++++++++++++++++++++- + dlls/wined3d/resource.c | 15 ++++++++++----- + dlls/wined3d/surface.c | 9 +++------ + dlls/wined3d/wined3d_private.h | 2 ++ + 4 files changed, 45 insertions(+), 12 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 054c000..f5c10dd 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -65,6 +65,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_SET_LIGHT_ENABLE, + WINED3D_CS_OP_BLT, + WINED3D_CS_OP_CLEAR_RTV, ++ WINED3D_CS_OP_RESOURCE_CHANGED, + WINED3D_CS_OP_RESOURCE_MAP, + WINED3D_CS_OP_RESOURCE_UNMAP, + WINED3D_CS_OP_QUERY_ISSUE, +@@ -365,6 +366,12 @@ struct wined3d_cs_resource_unmap + struct wined3d_resource *resource; + }; + ++struct wined3d_cs_resource_changed ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_resource *resource; ++}; ++ + struct wined3d_cs_skip + { + enum wined3d_cs_op opcode; +@@ -1804,6 +1811,27 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_resource_changed(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_resource_changed *op = data; ++ struct wined3d_resource *resource = op->resource; ++ ++ wined3d_resource_changed(resource); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) ++{ ++ struct wined3d_cs_resource_changed *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_RESOURCE_CHANGED; ++ op->resource = resource; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT wined3d_cs_exec_resource_map(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_resource_map *op = data; +@@ -2110,11 +2138,11 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_INDEX_BUFFER */ wined3d_cs_exec_set_index_buffer, + /* WINED3D_CS_OP_SET_CONSTANT_BUFFER */ wined3d_cs_exec_set_constant_buffer, + /* WINED3D_CS_OP_SET_TEXTURE */ wined3d_cs_exec_set_texture, +- /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, + /* WINED3D_CS_OP_SET_SAMPLER */ wined3d_cs_exec_set_sampler, + /* WINED3D_CS_OP_SET_SHADER */ wined3d_cs_exec_set_shader, + /* WINED3D_CS_OP_SET_RENDER_STATE */ wined3d_cs_exec_set_render_state, + /* WINED3D_CS_OP_SET_TEXTURE_STATE */ wined3d_cs_exec_set_texture_state, ++ /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, + /* WINED3D_CS_OP_SET_SAMPLER_STATE */ wined3d_cs_exec_set_sampler_state, + /* WINED3D_CS_OP_SET_TRANSFORM */ wined3d_cs_exec_set_transform, + /* WINED3D_CS_OP_SET_CLIP_PLANE */ wined3d_cs_exec_set_clip_plane, +@@ -2133,6 +2161,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, + /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, + /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, ++ /* WINED3D_CS_OP_RESOURCE_CHANGED */ wined3d_cs_exec_resource_changed, + /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, + /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index d2407a1..7cafdc6 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -830,11 +830,6 @@ void wined3d_resource_unmap_internal(struct wined3d_resource *resource) + wined3d_resource_release_map_ptr(resource, context); + if (context) + context_release(context); +- +- if (resource->unmap_dirtify) +- wined3d_resource_invalidate_location(resource, ~resource->map_binding); +- resource->unmap_dirtify = FALSE; +- + } + + HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) +@@ -849,7 +844,17 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + } + + wined3d_cs_emit_resource_unmap(device->cs, resource); ++ ++ if (resource->unmap_dirtify) ++ wined3d_cs_emit_resource_changed(device->cs, resource); ++ resource->unmap_dirtify = FALSE; ++ + resource->map_count--; + + return WINED3D_OK; + } ++ ++void wined3d_resource_changed(struct wined3d_resource *resource) ++{ ++ wined3d_resource_invalidate_location(resource, ~resource->map_binding); ++} +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index e661494..535e21a 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -1093,6 +1093,9 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour + + if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + wined3d_texture_set_dirty(surface->container); ++ ++ if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) ++ surface->surface_ops->surface_frontbuffer_updated(surface); + } + + static const struct wined3d_surface_ops surface_ops = +@@ -2405,16 +2408,10 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + HRESULT hr; + TRACE("surface %p.\n", surface); + +- if (surface->resource.unmap_dirtify && surface->container) +- wined3d_texture_set_dirty(surface->container); +- +- + hr = wined3d_resource_unmap(&surface->resource); + if (FAILED(hr)) + return hr; + +- if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer) +- surface->surface_ops->surface_frontbuffer_updated(surface); + memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); + + return hr; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index d670fe1..b9831fd 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2146,6 +2146,7 @@ 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; ++void wined3d_resource_changed(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + 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; +@@ -2662,6 +2663,7 @@ 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; ++void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, + DWORD flags) DECLSPEC_HIDDEN; + void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -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 - ---- - dlls/wined3d/resource.c | 9 +++++++-- - dlls/wined3d/wined3d_private.h | 2 +- - 2 files changed, 8 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -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) - { - struct wined3d_context *context = context_acquire(resource->device, NULL); - -+ if (resource->buffer != resource->map_buffer) -+ ERR("Releasing resource buffer with buffer != map_buffer.\n"); -+ - wined3d_device_release_bo(resource->device, resource->buffer, context); - resource->buffer = NULL; -+ resource->map_buffer = NULL; - - context_release(context); - } -@@ -535,7 +539,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, - { - case WINED3D_LOCATION_BUFFER: - gl_info = context->gl_info; -- 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]) - { -@@ -578,7 +582,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, - { - case WINED3D_LOCATION_BUFFER: - gl_info = context->gl_info; -- 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, 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/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ff64215..374dbc2 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2139,7 +2139,7 @@ struct wined3d_resource - DWORD priority; - void *heap_memory, *user_memory, *bitmap_data; - UINT custom_row_pitch, custom_slice_pitch; -- struct wined3d_gl_bo *buffer; -+ struct wined3d_gl_bo *buffer, *map_buffer; - struct list resource_list_entry; - DWORD locations; - LONG access_fence; --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,150 +0,0 @@ -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. - ---- - dlls/wined3d/cs.c | 7 +++++-- - dlls/wined3d/resource.c | 41 ++++++++++++++++++++++++++++++++++------- - dlls/wined3d/wined3d_private.h | 6 ++++-- - 3 files changed, 43 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index f5c10dd..d86aa59 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -370,6 +370,7 @@ struct wined3d_cs_resource_changed - { - enum wined3d_cs_op opcode; - struct wined3d_resource *resource; -+ struct wined3d_gl_bo *swap_buffer; - }; - - struct wined3d_cs_skip -@@ -1816,18 +1817,20 @@ static UINT wined3d_cs_exec_resource_changed(struct wined3d_cs *cs, const void * - const struct wined3d_cs_resource_changed *op = data; - struct wined3d_resource *resource = op->resource; - -- wined3d_resource_changed(resource); -+ wined3d_resource_changed(resource, op->swap_buffer); - - return sizeof(*op); - } - --void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) -+void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, -+ struct wined3d_gl_bo *swap_buffer) - { - struct wined3d_cs_resource_changed *op; - - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_RESOURCE_CHANGED; - op->resource = resource; -+ op->swap_buffer = swap_buffer; - - cs->ops->submit(cs, sizeof(*op)); - } -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -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 - } - - if (flags & WINED3D_MAP_DISCARD) -+ { -+ switch (resource->map_binding) -+ { -+ case WINED3D_LOCATION_BUFFER: -+ resource->map_buffer = wined3d_device_get_bo(device, resource->size, -+ GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); -+ break; -+ -+ default: -+ if (resource->access_fence) -+ ERR("Location %s does not support DISCARD maps.\n", -+ wined3d_debug_location(resource->map_binding)); -+ if (resource->pool != WINED3D_POOL_DEFAULT) -+ FIXME("Discard used on %s pool resource.\n", debug_d3dpool(resource->pool)); -+ } - wined3d_resource_validate_location(resource, resource->map_binding); -+ } - else -+ { - wined3d_resource_load_location(resource, context, resource->map_binding); -+ } - - mem = wined3d_resource_get_map_ptr(resource, context, flags); - -@@ -752,12 +770,11 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - - flags = wined3d_resource_sanitize_map_flags(resource, flags); - -- if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) -- { -- FIXME("Dynamic resource map is inefficient\n"); -- } -+ if (flags & WINED3D_MAP_NOOVERWRITE) -+ FIXME("WINED3D_MAP_NOOVERWRITE are not implemented yet.\n"); - -- wined3d_resource_sync(resource); -+ if (!(flags & WINED3D_MAP_DISCARD) || resource->map_binding != WINED3D_LOCATION_BUFFER) -+ wined3d_resource_sync(resource); - - base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); - if (!base_memory) -@@ -843,7 +860,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - wined3d_cs_emit_resource_unmap(device->cs, resource); - - if (resource->unmap_dirtify) -- wined3d_cs_emit_resource_changed(device->cs, resource); -+ wined3d_cs_emit_resource_changed(device->cs, resource, resource->map_buffer); - resource->unmap_dirtify = FALSE; - - resource->map_count--; -@@ -851,7 +868,17 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - return WINED3D_OK; - } - --void wined3d_resource_changed(struct wined3d_resource *resource) -+void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_gl_bo *swap_buffer) - { -+ struct wined3d_device *device = resource->device; -+ -+ if (swap_buffer && swap_buffer != resource->buffer) -+ { -+ struct wined3d_context *context = context_acquire(device, NULL); -+ wined3d_device_release_bo(device, resource->buffer, context); -+ context_release(context); -+ resource->buffer = swap_buffer; -+ } -+ - wined3d_resource_invalidate_location(resource, ~resource->map_binding); - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 374dbc2..abf3ca2 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -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; --void wined3d_resource_changed(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+void wined3d_resource_changed(struct wined3d_resource *resource, -+ struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; - 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; -@@ -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; --void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, -+ struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; - void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, - DWORD flags) DECLSPEC_HIDDEN; - void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Wrap-GL-BOs-in-a-structure.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Wrap-GL-BOs-in-a-structure.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Wrap-GL-BOs-in-a-structure.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0116-wined3d-Wrap-GL-BOs-in-a-structure.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,269 @@ +From e9a13b9c7f3776005db0f8f32a43241c6c66b5be 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 + +The idea is to use those structures for mapping through the command stream and caching +them for DISCARD maps. +--- + dlls/wined3d/device.c | 53 ++++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/resource.c | 34 +++++++++++---------------- + dlls/wined3d/surface.c | 6 ++--- + dlls/wined3d/volume.c | 6 ++--- + dlls/wined3d/wined3d_private.h | 15 +++++++++++- + 5 files changed, 86 insertions(+), 28 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 18b1784..039ca85 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -5052,3 +5052,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL + else + return CallWindowProcA(proc, window, message, wparam, lparam); + } ++ ++/* Context activation is done by the caller */ ++struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, ++ GLenum type_hint, struct wined3d_context *context) ++{ ++ struct wined3d_gl_bo *ret; ++ const struct wined3d_gl_info *gl_info; ++ ++ TRACE("device %p, size %u, gl_usage %u, type_hint %u\n", device, size, gl_usage, ++ type_hint); ++ ++ ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)); ++ if(!ret) ++ return NULL; ++ ret->type_hint = type_hint; ++ ret->size = size; ++ ret->usage = gl_usage; ++ ++ gl_info = context->gl_info; ++ ++ GL_EXTCALL(glGenBuffers(1, &ret->name)); ++ if (type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) ++ context_invalidate_state(context, STATE_INDEXBUFFER); ++ 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); ++ return ret; ++} ++ ++/* Context activation is done by the caller */ ++static void wined3d_device_destroy_bo(struct wined3d_device *device, const struct wined3d_context *context, ++ struct wined3d_gl_bo *bo) ++{ ++ 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(glDeleteBuffers(1, &bo->name)); ++ checkGLcall("glDeleteBuffers"); ++ ++ HeapFree(GetProcessHeap(), 0, bo); ++} ++ ++/* Context activation is done by the caller */ ++void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, ++ const struct wined3d_context *context) ++{ ++ TRACE("device %p, bo %p, GL bo %u\n", device, bo, bo->name); ++ ++ wined3d_device_destroy_bo(device, context, bo); ++} +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 2530ee0..4496c9b 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -154,12 +154,10 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * + void wined3d_resource_free_bo(struct wined3d_resource *resource) + { + struct wined3d_context *context = context_acquire(resource->device, NULL); +- 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(glDeleteBuffers(1, &resource->buffer_object)); +- checkGLcall("glDeleteBuffers"); +- resource->buffer_object = 0; ++ wined3d_device_release_bo(resource->device, resource->buffer, context); ++ resource->buffer = NULL; ++ + context_release(context); + } + +@@ -175,7 +173,7 @@ void resource_cleanup(struct wined3d_resource *resource) + adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); + } + +- if (resource->buffer_object) ++ if (resource->buffer) + wined3d_resource_free_bo(resource); + + wined3d_resource_free_sysmem(resource); +@@ -188,7 +186,7 @@ void resource_unload(struct wined3d_resource *resource) + if (resource->map_count) + ERR("Resource %p is being unloaded while mapped.\n", resource); + +- if (resource->buffer_object) ++ if (resource->buffer) + wined3d_resource_free_bo(resource); + + context_resource_unloaded(resource->device, +@@ -437,7 +435,7 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, + { + if (location & WINED3D_LOCATION_BUFFER) + { +- data->buffer_object = resource->buffer_object; ++ data->buffer_object = resource->buffer->name; + data->addr = NULL; + return; + } +@@ -546,7 +544,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, + { + case WINED3D_LOCATION_BUFFER: + gl_info = context->gl_info; +- 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]) + { +@@ -589,7 +587,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, + { + case WINED3D_LOCATION_BUFFER: + gl_info = context->gl_info; +- 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"); +@@ -607,20 +605,14 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, + } + + /* Context activation is done by the caller. */ +-static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, const struct wined3d_context *context) ++static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struct wined3d_context *context) + { +- const struct wined3d_gl_info *gl_info = context->gl_info; +- +- if (resource->buffer_object) ++ if (resource->buffer) + return; + +- 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, 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 fc719e7..d1020df 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -48,7 +48,7 @@ static void surface_cleanup(struct wined3d_surface *surface) + surface->resource.device->cs->ops->finish(surface->resource.device->cs); + } + +- if (surface->resource.buffer_object || surface->rb_multisample ++ if (surface->resource.buffer || surface->rb_multisample + || surface->rb_resolved || !list_empty(&surface->renderbuffers)) + { + struct wined3d_renderbuffer_entry *entry, *entry2; +@@ -2591,7 +2591,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 +- || surface->resource.buffer_object)) ++ || surface->resource.buffer)) + surface->resource.map_binding = WINED3D_LOCATION_DIB; + } + +@@ -3897,7 +3897,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. */ +- if ((format.convert || conversion) && surface->resource.buffer_object) ++ if ((format.convert || conversion) && surface->resource.buffer) + { + TRACE("Removing the pbo attached to surface %p.\n", surface); + +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 6fc23f3..f6d2e8f 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -218,7 +218,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, + } + else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) + { +- struct wined3d_const_bo_address data = {volume->resource.buffer_object, NULL}; ++ struct wined3d_const_bo_address data = {volume->resource.buffer->name, NULL}; + wined3d_texture_bind_and_dirtify(volume->container, context, + location == WINED3D_LOCATION_TEXTURE_SRGB); + wined3d_volume_upload_data(volume, context, &data); +@@ -269,12 +269,12 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, + break; + + case WINED3D_LOCATION_BUFFER: +- if (!volume->resource.buffer_object) ++ if (!volume->resource.buffer) + ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); + + if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + { +- struct wined3d_bo_address data = {volume->resource.buffer_object, NULL}; ++ struct wined3d_bo_address data = {volume->resource.buffer->name, NULL}; + + if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) + wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index b23757b..2f85556 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2007,6 +2007,14 @@ struct wined3d_state + DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; + }; + ++struct wined3d_gl_bo ++{ ++ GLuint name; ++ GLenum usage; ++ GLenum type_hint; ++ UINT size; ++}; ++ + #define WINED3D_UNMAPPED_STAGE ~0U + + /* Multithreaded flag. Removed from the public header to signal that +@@ -2113,6 +2121,11 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) D + void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; + void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, + struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN; ++struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, ++ GLenum type_hint, struct wined3d_context *context) DECLSPEC_HIDDEN; ++void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, ++ const struct wined3d_context *context) DECLSPEC_HIDDEN; ++ + + static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) + { +@@ -2156,7 +2169,7 @@ struct wined3d_resource + DWORD priority; + void *heap_memory, *user_memory, *bitmap_data; + UINT custom_row_pitch, custom_slice_pitch; +- GLuint buffer_object; ++ struct wined3d_gl_bo *buffer; + struct list resource_list_entry; + DWORD locations; + LONG access_fence; +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,258 +0,0 @@ -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. - ---- - dlls/wined3d/buffer.c | 1 + - dlls/wined3d/cs.c | 6 ++++-- - dlls/wined3d/resource.c | 40 +++++++++++++++++++++++++++++++++++----- - dlls/wined3d/surface.c | 3 +++ - dlls/wined3d/volume.c | 2 ++ - dlls/wined3d/wined3d_private.h | 6 +++--- - 6 files changed, 48 insertions(+), 10 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -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 - - if (!wined3d_resource_allocate_sysmem(&This->resource)) - ERR("Failed to allocate system memory.\n"); -+ This->resource.heap_memory = This->resource.map_heap_memory; - - if (This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) - context_invalidate_state(context, STATE_INDEXBUFFER); -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index d86aa59..9307246 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -371,6 +371,7 @@ struct wined3d_cs_resource_changed - enum wined3d_cs_op opcode; - struct wined3d_resource *resource; - struct wined3d_gl_bo *swap_buffer; -+ void *swap_heap_memory; - }; - - struct wined3d_cs_skip -@@ -1817,13 +1818,13 @@ static UINT wined3d_cs_exec_resource_changed(struct wined3d_cs *cs, const void * - const struct wined3d_cs_resource_changed *op = data; - struct wined3d_resource *resource = op->resource; - -- wined3d_resource_changed(resource, op->swap_buffer); -+ wined3d_resource_changed(resource, op->swap_buffer, op->swap_heap_memory); - - return sizeof(*op); - } - - void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, -- struct wined3d_gl_bo *swap_buffer) -+ struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) - { - struct wined3d_cs_resource_changed *op; - -@@ -1831,6 +1832,7 @@ void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_reso - op->opcode = WINED3D_CS_OP_RESOURCE_CHANGED; - op->resource = resource; - op->swap_buffer = swap_buffer; -+ op->swap_heap_memory = swap_heap_memory; - - cs->ops->submit(cs, sizeof(*op)); - } -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -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 * - ERR("Failed to allocate system memory.\n"); - return E_OUTOFMEMORY; - } -+ resource->heap_memory = resource->map_heap_memory; - } - else - { -@@ -172,6 +173,7 @@ void resource_cleanup(struct wined3d_resource *resource) - wined3d_resource_free_bo(resource); - - wined3d_resource_free_sysmem(resource); -+ resource->map_heap_memory = NULL; - - device_resource_released(resource->device, resource); - } -@@ -246,7 +248,7 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) - p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1; - *p = mem; - -- resource->heap_memory = ++p; -+ resource->map_heap_memory = ++p; - - return TRUE; - } -@@ -559,7 +561,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, - return ptr; - - case WINED3D_LOCATION_SYSMEM: -- return resource->heap_memory; -+ return resource->map_heap_memory; - - case WINED3D_LOCATION_DIB: - return resource->bitmap_data; -@@ -621,6 +623,7 @@ BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) - ERR("Failed to allocate system memory.\n"); - return FALSE; - } -+ resource->heap_memory = resource->map_heap_memory; - return TRUE; - } - -@@ -705,6 +708,10 @@ void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD fla - GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); - break; - -+ case WINED3D_LOCATION_SYSMEM: -+ wined3d_resource_allocate_sysmem(resource); -+ break; -+ - default: - if (resource->access_fence) - ERR("Location %s does not support DISCARD maps.\n", -@@ -773,7 +780,21 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - if (flags & WINED3D_MAP_NOOVERWRITE) - FIXME("WINED3D_MAP_NOOVERWRITE are not implemented yet.\n"); - -- if (!(flags & WINED3D_MAP_DISCARD) || resource->map_binding != WINED3D_LOCATION_BUFFER) -+ if (flags & WINED3D_MAP_DISCARD) -+ { -+ switch (resource->map_binding) -+ { -+ case WINED3D_LOCATION_BUFFER: -+ case WINED3D_LOCATION_SYSMEM: -+ break; -+ -+ default: -+ FIXME("Implement discard maps with %s map binding.\n", -+ wined3d_debug_location(resource->map_binding)); -+ wined3d_resource_sync(resource); -+ } -+ } -+ else - wined3d_resource_sync(resource); - - base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); -@@ -860,7 +881,10 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - wined3d_cs_emit_resource_unmap(device->cs, resource); - - if (resource->unmap_dirtify) -- wined3d_cs_emit_resource_changed(device->cs, resource, resource->map_buffer); -+ { -+ wined3d_cs_emit_resource_changed(device->cs, resource, -+ resource->map_buffer, resource->map_heap_memory); -+ } - resource->unmap_dirtify = FALSE; - - resource->map_count--; -@@ -868,7 +892,8 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - return WINED3D_OK; - } - --void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_gl_bo *swap_buffer) -+void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_gl_bo *swap_buffer, -+ void *swap_heap_memory) - { - struct wined3d_device *device = resource->device; - -@@ -879,6 +904,11 @@ void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_ - context_release(context); - resource->buffer = swap_buffer; - } -+ if (swap_heap_memory && swap_heap_memory != resource->heap_memory) -+ { -+ wined3d_resource_free_sysmem(resource); -+ resource->heap_memory = swap_heap_memory; -+ } - - wined3d_resource_invalidate_location(resource, ~resource->map_binding); - } -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -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) - return; - - wined3d_resource_free_sysmem(&surface->resource); -+ surface->resource.map_heap_memory = NULL; - wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); - } - -@@ -1997,6 +1998,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, - - surface->resource.locations = 0; - wined3d_resource_free_sysmem(&surface->resource); -+ surface->resource.map_heap_memory = NULL; - - width = texture_resource->width; - height = texture_resource->height; -@@ -5489,6 +5491,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text - if (surface->resource.map_binding == WINED3D_LOCATION_DIB) - { - wined3d_resource_free_sysmem(&surface->resource); -+ surface->resource.map_heap_memory = NULL; - wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB); - wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); - } -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -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, - static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) - { - wined3d_resource_free_sysmem(&volume->resource); -+ volume->resource.map_heap_memory = NULL; - wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); - } - -@@ -516,6 +517,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture - { - wined3d_resource_free_sysmem(&volume->resource); - volume->resource.map_binding = WINED3D_LOCATION_BUFFER; -+ volume->resource.map_heap_memory = NULL; - } - - volume->container = container; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index abf3ca2..ac4aeb3 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2137,7 +2137,7 @@ struct wined3d_resource - UINT depth; - UINT size; - DWORD priority; -- void *heap_memory, *user_memory, *bitmap_data; -+ void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; - UINT custom_row_pitch, custom_slice_pitch; - struct wined3d_gl_bo *buffer, *map_buffer; - struct list resource_list_entry; -@@ -2171,7 +2171,7 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; - BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_changed(struct wined3d_resource *resource, -- struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; -+ struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) DECLSPEC_HIDDEN; - 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; -@@ -2695,7 +2695,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf - void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, - const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; - void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, -- struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; -+ struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) DECLSPEC_HIDDEN; - void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, - DWORD flags) DECLSPEC_HIDDEN; - void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Separate-resource-map-and-draw-buffers.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Separate-resource-map-and-draw-buffers.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Separate-resource-map-and-draw-buffers.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0117-wined3d-Separate-resource-map-and-draw-buffers.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,69 @@ +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 + +--- + dlls/wined3d/resource.c | 9 +++++++-- + dlls/wined3d/wined3d_private.h | 2 +- + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +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) + { + struct wined3d_context *context = context_acquire(resource->device, NULL); + ++ if (resource->buffer != resource->map_buffer) ++ ERR("Releasing resource buffer with buffer != map_buffer.\n"); ++ + wined3d_device_release_bo(resource->device, resource->buffer, context); + resource->buffer = NULL; ++ resource->map_buffer = NULL; + + context_release(context); + } +@@ -535,7 +539,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, + { + case WINED3D_LOCATION_BUFFER: + gl_info = context->gl_info; +- 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]) + { +@@ -578,7 +582,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, + { + case WINED3D_LOCATION_BUFFER: + gl_info = context->gl_info; +- 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, 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/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index ff64215..374dbc2 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2139,7 +2139,7 @@ struct wined3d_resource + DWORD priority; + void *heap_memory, *user_memory, *bitmap_data; + UINT custom_row_pitch, custom_slice_pitch; +- struct wined3d_gl_bo *buffer; ++ struct wined3d_gl_bo *buffer, *map_buffer; + struct list resource_list_entry; + DWORD locations; + LONG access_fence; +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,150 @@ +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. + +--- + dlls/wined3d/cs.c | 7 +++++-- + dlls/wined3d/resource.c | 41 ++++++++++++++++++++++++++++++++++------- + dlls/wined3d/wined3d_private.h | 6 ++++-- + 3 files changed, 43 insertions(+), 11 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index f5c10dd..d86aa59 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -370,6 +370,7 @@ struct wined3d_cs_resource_changed + { + enum wined3d_cs_op opcode; + struct wined3d_resource *resource; ++ struct wined3d_gl_bo *swap_buffer; + }; + + struct wined3d_cs_skip +@@ -1816,18 +1817,20 @@ static UINT wined3d_cs_exec_resource_changed(struct wined3d_cs *cs, const void * + const struct wined3d_cs_resource_changed *op = data; + struct wined3d_resource *resource = op->resource; + +- wined3d_resource_changed(resource); ++ wined3d_resource_changed(resource, op->swap_buffer); + + return sizeof(*op); + } + +-void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) ++void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, ++ struct wined3d_gl_bo *swap_buffer) + { + struct wined3d_cs_resource_changed *op; + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_RESOURCE_CHANGED; + op->resource = resource; ++ op->swap_buffer = swap_buffer; + + cs->ops->submit(cs, sizeof(*op)); + } +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +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 + } + + if (flags & WINED3D_MAP_DISCARD) ++ { ++ switch (resource->map_binding) ++ { ++ case WINED3D_LOCATION_BUFFER: ++ resource->map_buffer = wined3d_device_get_bo(device, resource->size, ++ GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); ++ break; ++ ++ default: ++ if (resource->access_fence) ++ ERR("Location %s does not support DISCARD maps.\n", ++ wined3d_debug_location(resource->map_binding)); ++ if (resource->pool != WINED3D_POOL_DEFAULT) ++ FIXME("Discard used on %s pool resource.\n", debug_d3dpool(resource->pool)); ++ } + wined3d_resource_validate_location(resource, resource->map_binding); ++ } + else ++ { + wined3d_resource_load_location(resource, context, resource->map_binding); ++ } + + mem = wined3d_resource_get_map_ptr(resource, context, flags); + +@@ -752,12 +770,11 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + + flags = wined3d_resource_sanitize_map_flags(resource, flags); + +- if (flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD)) +- { +- FIXME("Dynamic resource map is inefficient\n"); +- } ++ if (flags & WINED3D_MAP_NOOVERWRITE) ++ FIXME("WINED3D_MAP_NOOVERWRITE are not implemented yet.\n"); + +- wined3d_resource_sync(resource); ++ if (!(flags & WINED3D_MAP_DISCARD) || resource->map_binding != WINED3D_LOCATION_BUFFER) ++ wined3d_resource_sync(resource); + + base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); + if (!base_memory) +@@ -843,7 +860,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + wined3d_cs_emit_resource_unmap(device->cs, resource); + + if (resource->unmap_dirtify) +- wined3d_cs_emit_resource_changed(device->cs, resource); ++ wined3d_cs_emit_resource_changed(device->cs, resource, resource->map_buffer); + resource->unmap_dirtify = FALSE; + + resource->map_count--; +@@ -851,7 +868,17 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + return WINED3D_OK; + } + +-void wined3d_resource_changed(struct wined3d_resource *resource) ++void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_gl_bo *swap_buffer) + { ++ struct wined3d_device *device = resource->device; ++ ++ if (swap_buffer && swap_buffer != resource->buffer) ++ { ++ struct wined3d_context *context = context_acquire(device, NULL); ++ wined3d_device_release_bo(device, resource->buffer, context); ++ context_release(context); ++ resource->buffer = swap_buffer; ++ } ++ + wined3d_resource_invalidate_location(resource, ~resource->map_binding); + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 374dbc2..abf3ca2 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -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; +-void wined3d_resource_changed(struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_resource_changed(struct wined3d_resource *resource, ++ struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; + 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; +@@ -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; +-void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, ++ struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; + void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, + DWORD flags) DECLSPEC_HIDDEN; + void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Unset-some-objects-in-state_init_default.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Unset-some-objects-in-state_init_default.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Unset-some-objects-in-state_init_default.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0118-wined3d-Unset-some-objects-in-state_init_default.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -From 09ff7fca62f88791ece6e95f287579687418ba24 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 1 Oct 2013 21:30:07 +0200 -Subject: wined3d: Unset some objects in state_init_default. - -FIXME: Many more are needed. -FIXME2: Is this still needed? ---- - dlls/wined3d/stateblock.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c -index 606134c..690bcc7 100644 ---- a/dlls/wined3d/stateblock.c -+++ b/dlls/wined3d/stateblock.c -@@ -1339,7 +1339,15 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d - state->sampler_states[i][WINED3D_SAMP_ELEMENT_INDEX] = 0; - /* TODO: Vertex offset in the presampled displacement map. */ - state->sampler_states[i][WINED3D_SAMP_DMAP_OFFSET] = 0; -+ state->textures[i] = NULL; - } -+ -+ state->index_buffer = NULL; -+ for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++) -+ memset(&state->streams[i], 0, sizeof(state->streams[i])); -+ -+ state->shader[WINED3D_SHADER_TYPE_VERTEX] = NULL; -+ state->shader[WINED3D_SHADER_TYPE_PIXEL] = NULL; - } - - HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From 55240026af497ef2d4e3d8edc456e65b989bf59e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 2 Oct 2013 12:36:02 +0200 -Subject: wined3d: Don't request the frontbuffer to create dummy textures. - ---- - dlls/wined3d/device.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 6f82385..f5cb7bd 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -905,8 +905,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - device->swapchains[0] = swapchain; - device_init_swapchain_state(device, swapchain); - -- context = context_acquire(device, -- surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0))); -+ context = context_acquire(device, NULL); - - create_dummy_textures(device, context); - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0119-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,258 @@ +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. + +--- + dlls/wined3d/buffer.c | 1 + + dlls/wined3d/cs.c | 6 ++++-- + dlls/wined3d/resource.c | 40 +++++++++++++++++++++++++++++++++++----- + dlls/wined3d/surface.c | 3 +++ + dlls/wined3d/volume.c | 2 ++ + dlls/wined3d/wined3d_private.h | 6 +++--- + 6 files changed, 48 insertions(+), 10 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +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 + + if (!wined3d_resource_allocate_sysmem(&This->resource)) + ERR("Failed to allocate system memory.\n"); ++ This->resource.heap_memory = This->resource.map_heap_memory; + + if (This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) + context_invalidate_state(context, STATE_INDEXBUFFER); +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index d86aa59..9307246 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -371,6 +371,7 @@ struct wined3d_cs_resource_changed + enum wined3d_cs_op opcode; + struct wined3d_resource *resource; + struct wined3d_gl_bo *swap_buffer; ++ void *swap_heap_memory; + }; + + struct wined3d_cs_skip +@@ -1817,13 +1818,13 @@ static UINT wined3d_cs_exec_resource_changed(struct wined3d_cs *cs, const void * + const struct wined3d_cs_resource_changed *op = data; + struct wined3d_resource *resource = op->resource; + +- wined3d_resource_changed(resource, op->swap_buffer); ++ wined3d_resource_changed(resource, op->swap_buffer, op->swap_heap_memory); + + return sizeof(*op); + } + + void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, +- struct wined3d_gl_bo *swap_buffer) ++ struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) + { + struct wined3d_cs_resource_changed *op; + +@@ -1831,6 +1832,7 @@ void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_reso + op->opcode = WINED3D_CS_OP_RESOURCE_CHANGED; + op->resource = resource; + op->swap_buffer = swap_buffer; ++ op->swap_heap_memory = swap_heap_memory; + + cs->ops->submit(cs, sizeof(*op)); + } +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +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 * + ERR("Failed to allocate system memory.\n"); + return E_OUTOFMEMORY; + } ++ resource->heap_memory = resource->map_heap_memory; + } + else + { +@@ -172,6 +173,7 @@ void resource_cleanup(struct wined3d_resource *resource) + wined3d_resource_free_bo(resource); + + wined3d_resource_free_sysmem(resource); ++ resource->map_heap_memory = NULL; + + device_resource_released(resource->device, resource); + } +@@ -246,7 +248,7 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) + p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1; + *p = mem; + +- resource->heap_memory = ++p; ++ resource->map_heap_memory = ++p; + + return TRUE; + } +@@ -559,7 +561,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, + return ptr; + + case WINED3D_LOCATION_SYSMEM: +- return resource->heap_memory; ++ return resource->map_heap_memory; + + case WINED3D_LOCATION_DIB: + return resource->bitmap_data; +@@ -621,6 +623,7 @@ BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) + ERR("Failed to allocate system memory.\n"); + return FALSE; + } ++ resource->heap_memory = resource->map_heap_memory; + return TRUE; + } + +@@ -705,6 +708,10 @@ void *wined3d_resource_map_internal(struct wined3d_resource *resource, DWORD fla + GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); + break; + ++ case WINED3D_LOCATION_SYSMEM: ++ wined3d_resource_allocate_sysmem(resource); ++ break; ++ + default: + if (resource->access_fence) + ERR("Location %s does not support DISCARD maps.\n", +@@ -773,7 +780,21 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + if (flags & WINED3D_MAP_NOOVERWRITE) + FIXME("WINED3D_MAP_NOOVERWRITE are not implemented yet.\n"); + +- if (!(flags & WINED3D_MAP_DISCARD) || resource->map_binding != WINED3D_LOCATION_BUFFER) ++ if (flags & WINED3D_MAP_DISCARD) ++ { ++ switch (resource->map_binding) ++ { ++ case WINED3D_LOCATION_BUFFER: ++ case WINED3D_LOCATION_SYSMEM: ++ break; ++ ++ default: ++ FIXME("Implement discard maps with %s map binding.\n", ++ wined3d_debug_location(resource->map_binding)); ++ wined3d_resource_sync(resource); ++ } ++ } ++ else + wined3d_resource_sync(resource); + + base_memory = wined3d_cs_emit_resource_map(device->cs, resource, flags); +@@ -860,7 +881,10 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + wined3d_cs_emit_resource_unmap(device->cs, resource); + + if (resource->unmap_dirtify) +- wined3d_cs_emit_resource_changed(device->cs, resource, resource->map_buffer); ++ { ++ wined3d_cs_emit_resource_changed(device->cs, resource, ++ resource->map_buffer, resource->map_heap_memory); ++ } + resource->unmap_dirtify = FALSE; + + resource->map_count--; +@@ -868,7 +892,8 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + return WINED3D_OK; + } + +-void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_gl_bo *swap_buffer) ++void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_gl_bo *swap_buffer, ++ void *swap_heap_memory) + { + struct wined3d_device *device = resource->device; + +@@ -879,6 +904,11 @@ void wined3d_resource_changed(struct wined3d_resource *resource, struct wined3d_ + context_release(context); + resource->buffer = swap_buffer; + } ++ if (swap_heap_memory && swap_heap_memory != resource->heap_memory) ++ { ++ wined3d_resource_free_sysmem(resource); ++ resource->heap_memory = swap_heap_memory; ++ } + + wined3d_resource_invalidate_location(resource, ~resource->map_binding); + } +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +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) + return; + + wined3d_resource_free_sysmem(&surface->resource); ++ surface->resource.map_heap_memory = NULL; + wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); + } + +@@ -1997,6 +1998,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, + + surface->resource.locations = 0; + wined3d_resource_free_sysmem(&surface->resource); ++ surface->resource.map_heap_memory = NULL; + + width = texture_resource->width; + height = texture_resource->height; +@@ -5489,6 +5491,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text + if (surface->resource.map_binding == WINED3D_LOCATION_DIB) + { + wined3d_resource_free_sysmem(&surface->resource); ++ surface->resource.map_heap_memory = NULL; + wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB); + wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); + } +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +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, + static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) + { + wined3d_resource_free_sysmem(&volume->resource); ++ volume->resource.map_heap_memory = NULL; + wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_SYSMEM); + } + +@@ -516,6 +517,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture + { + wined3d_resource_free_sysmem(&volume->resource); + volume->resource.map_binding = WINED3D_LOCATION_BUFFER; ++ volume->resource.map_heap_memory = NULL; + } + + volume->container = container; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index abf3ca2..ac4aeb3 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2137,7 +2137,7 @@ struct wined3d_resource + UINT depth; + UINT size; + DWORD priority; +- void *heap_memory, *user_memory, *bitmap_data; ++ void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; + UINT custom_row_pitch, custom_slice_pitch; + struct wined3d_gl_bo *buffer, *map_buffer; + struct list resource_list_entry; +@@ -2171,7 +2171,7 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; + BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_changed(struct wined3d_resource *resource, +- struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; ++ struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) DECLSPEC_HIDDEN; + 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; +@@ -2695,7 +2695,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf + void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, + const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; + void wined3d_cs_emit_resource_changed(struct wined3d_cs *cs, struct wined3d_resource *resource, +- struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN; ++ struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) DECLSPEC_HIDDEN; + void *wined3d_cs_emit_resource_map(struct wined3d_cs *cs, struct wined3d_resource *resource, + DWORD flags) DECLSPEC_HIDDEN; + void wined3d_cs_emit_resource_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Unset-some-objects-in-state_init_default.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Unset-some-objects-in-state_init_default.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Unset-some-objects-in-state_init_default.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Unset-some-objects-in-state_init_default.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,34 @@ +From 09ff7fca62f88791ece6e95f287579687418ba24 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 1 Oct 2013 21:30:07 +0200 +Subject: wined3d: Unset some objects in state_init_default. + +FIXME: Many more are needed. +FIXME2: Is this still needed? +--- + dlls/wined3d/stateblock.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c +index 606134c..690bcc7 100644 +--- a/dlls/wined3d/stateblock.c ++++ b/dlls/wined3d/stateblock.c +@@ -1339,7 +1339,15 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d + state->sampler_states[i][WINED3D_SAMP_ELEMENT_INDEX] = 0; + /* TODO: Vertex offset in the presampled displacement map. */ + state->sampler_states[i][WINED3D_SAMP_DMAP_OFFSET] = 0; ++ state->textures[i] = NULL; + } ++ ++ state->index_buffer = NULL; ++ for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++) ++ memset(&state->streams[i], 0, sizeof(state->streams[i])); ++ ++ state->shader[WINED3D_SHADER_TYPE_VERTEX] = NULL; ++ state->shader[WINED3D_SHADER_TYPE_PIXEL] = NULL; + } + + HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Use-double-buffered-buffers-for-multithreade.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Use-double-buffered-buffers-for-multithreade.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Use-double-buffered-buffers-for-multithreade.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0120-wined3d-Use-double-buffered-buffers-for-multithreade.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From e54d3de255928108db07a5f3367213a24d8bf959 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Jul 2013 23:44:11 +0200 -Subject: wined3d: Use double-buffered buffers for multithreaded CS - ---- - dlls/wined3d/buffer.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 3ca1143..de0eaec 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1254,6 +1254,9 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device - } - buffer->maps_size = 1; - -+ if (wined3d_settings.cs_multithreaded) -+ buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER; -+ - return WINED3D_OK; - } - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,26 @@ +From 55240026af497ef2d4e3d8edc456e65b989bf59e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 2 Oct 2013 12:36:02 +0200 +Subject: wined3d: Don't request the frontbuffer to create dummy textures. + +--- + dlls/wined3d/device.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 6f82385..f5cb7bd 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -905,8 +905,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + device->swapchains[0] = swapchain; + device_init_swapchain_state(device, swapchain); + +- context = context_acquire(device, +- surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0))); ++ context = context_acquire(device, NULL); + + create_dummy_textures(device, context); + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0121-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -From 4dab2b426c1d4eb918dda550a547b33858617395 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Jul 2013 23:49:26 +0200 -Subject: wined3d: Don't synchronize NOOVERWRITE buffer maps - -TODO: Put the patch that makes PreLoad ignore the mapped state here. ---- - dlls/wined3d/buffer.c | 20 +++++++++++++------- - 1 file changed, 13 insertions(+), 7 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index de0eaec..fd03fb5 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -958,13 +958,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - - TRACE("buffer %p, offset %u, size %u, data %p, flags %#x\n", buffer, offset, size, data, flags); - -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -- - flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); - /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture - * fill rate test seems to depend on this. When we map a buffer with -@@ -995,6 +988,13 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - struct wined3d_context *context; - const struct wined3d_gl_info *gl_info; - -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("waiting for cs\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - context = context_acquire(device, NULL); - gl_info = context->gl_info; - -@@ -1056,6 +1056,12 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - buffer->flags |= WINED3D_BUFFER_SYNC; - } - -+ if (!(flags & WINED3D_MAP_NOOVERWRITE) && wined3d_settings.cs_multithreaded) -+ { -+ FIXME("waiting for cs.\n"); -+ device->cs->ops->finish(device->cs); -+ } -+ - base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.heap_memory; - *data = base + offset; - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -From eaad769483668455de518d4bea0013ddef6d5f6a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 15:59:11 +0200 -Subject: wined3d: Separate buffer map write and draw read memory pointers - -TODO: Think about making this generic for all resources. -TODO 2: This is rather pointless on its own, merge this with the -patch that introduces this for all resources. ---- - dlls/wined3d/buffer.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index fd03fb5..2a814c6 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -191,7 +191,10 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine - if (This->flags & WINED3D_BUFFER_DOUBLEBUFFER) - buffer_invalidate_bo_range(This, 0, 0); - else -+ { - wined3d_resource_free_sysmem(&This->resource); -+ This->resource.map_heap_memory = NULL; -+ } - - return; - -@@ -1044,7 +1047,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - buffer_get_sysmem(buffer, context); - } - TRACE("New pointer is %p.\n", buffer->resource.heap_memory); -- buffer->map_ptr = NULL; - } - context_release(context); - } -@@ -1062,7 +1064,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - device->cs->ops->finish(device->cs); - } - -- base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.heap_memory; -+ base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.map_heap_memory; - *data = base + offset; - - TRACE("Returning memory at %p (base %p, offset %u).\n", *data, base, offset); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Use-double-buffered-buffers-for-multithreade.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Use-double-buffered-buffers-for-multithreade.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Use-double-buffered-buffers-for-multithreade.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0122-wined3d-Use-double-buffered-buffers-for-multithreade.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,26 @@ +From e54d3de255928108db07a5f3367213a24d8bf959 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Jul 2013 23:44:11 +0200 +Subject: wined3d: Use double-buffered buffers for multithreaded CS + +--- + dlls/wined3d/buffer.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 3ca1143..de0eaec 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1254,6 +1254,9 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + } + buffer->maps_size = 1; + ++ if (wined3d_settings.cs_multithreaded) ++ buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER; ++ + return WINED3D_OK; + } + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Accelerate-DISCARD-buffer-maps.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Accelerate-DISCARD-buffer-maps.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Accelerate-DISCARD-buffer-maps.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Accelerate-DISCARD-buffer-maps.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ -From 46ed74a72057957b7046b45b4cdfb4b34ad4016e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 16:14:16 +0200 -Subject: wined3d: Accelerate DISCARD buffer maps - -TODO: Make this generic for all resources. -TODO2: Merge this with the patch that controlls BUFFER_DISCARD in the CS thread -TODO3: Clean up the map_mem allocation mess. ---- - dlls/wined3d/buffer.c | 15 ++++++++++++--- - dlls/wined3d/cs.c | 39 ++++++++++++++++++++++++++++++++++++++- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 52 insertions(+), 4 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 2a814c6..5c6d36e 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1058,10 +1058,19 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - buffer->flags |= WINED3D_BUFFER_SYNC; - } - -- if (!(flags & WINED3D_MAP_NOOVERWRITE) && wined3d_settings.cs_multithreaded) -+ if (wined3d_settings.cs_multithreaded && count == 1) - { -- FIXME("waiting for cs.\n"); -- device->cs->ops->finish(device->cs); -+ BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING; -+ if (flags & WINED3D_MAP_DISCARD && !swvp) -+ { -+ wined3d_resource_allocate_sysmem(&buffer->resource); -+ wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); -+ } -+ else if(!(flags & WINED3D_MAP_NOOVERWRITE)) -+ { -+ FIXME("waiting for cs.\n"); -+ device->cs->ops->finish(device->cs); -+ } - } - - base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.map_heap_memory; -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 9307246..341b51c 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -68,6 +68,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_RESOURCE_CHANGED, - WINED3D_CS_OP_RESOURCE_MAP, - WINED3D_CS_OP_RESOURCE_UNMAP, -+ WINED3D_CS_OP_BUFFER_SWAP_MEM, - WINED3D_CS_OP_QUERY_ISSUE, - WINED3D_CS_OP_QUERY_DESTROY, - WINED3D_CS_OP_UPDATE_SURFACE, -@@ -374,6 +375,13 @@ struct wined3d_cs_resource_changed - void *swap_heap_memory; - }; - -+struct wined3d_cs_buffer_swap_mem -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_buffer *buffer; -+ BYTE *mem; -+}; -+ - struct wined3d_cs_skip - { - enum wined3d_cs_op opcode; -@@ -2123,6 +2131,34 @@ void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resour - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_buffer_swap_mem *op = data; -+ struct wined3d_buffer *buffer = op->buffer; -+ -+ wined3d_resource_free_sysmem(&buffer->resource); -+ buffer->resource.heap_memory = op->mem; -+ -+ if (!buffer->buffer_object && buffer->resource.bind_count) -+ { -+ device_invalidate_state(cs->device, STATE_STREAMSRC); -+ device_invalidate_state(cs->device, STATE_INDEXBUFFER); -+ } -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, BYTE *mem) -+{ -+ struct wined3d_cs_buffer_swap_mem *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_BUFFER_SWAP_MEM; -+ op->buffer = buffer; -+ op->mem = mem; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2143,11 +2179,11 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_INDEX_BUFFER */ wined3d_cs_exec_set_index_buffer, - /* WINED3D_CS_OP_SET_CONSTANT_BUFFER */ wined3d_cs_exec_set_constant_buffer, - /* WINED3D_CS_OP_SET_TEXTURE */ wined3d_cs_exec_set_texture, -+ /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, - /* WINED3D_CS_OP_SET_SAMPLER */ wined3d_cs_exec_set_sampler, - /* WINED3D_CS_OP_SET_SHADER */ wined3d_cs_exec_set_shader, - /* WINED3D_CS_OP_SET_RENDER_STATE */ wined3d_cs_exec_set_render_state, - /* WINED3D_CS_OP_SET_TEXTURE_STATE */ wined3d_cs_exec_set_texture_state, -- /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, - /* WINED3D_CS_OP_SET_SAMPLER_STATE */ wined3d_cs_exec_set_sampler_state, - /* WINED3D_CS_OP_SET_TRANSFORM */ wined3d_cs_exec_set_transform, - /* WINED3D_CS_OP_SET_CLIP_PLANE */ wined3d_cs_exec_set_clip_plane, -@@ -2169,6 +2205,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_RESOURCE_CHANGED */ wined3d_cs_exec_resource_changed, - /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, - /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, -+ /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, - /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, - /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, - /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 270162f..7d12df9 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2694,6 +2694,8 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa - void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, - struct wined3d_texture *dst) DECLSPEC_HIDDEN; - void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, -+ BYTE *mem) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0123-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,58 @@ +From 4dab2b426c1d4eb918dda550a547b33858617395 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 4 Jul 2013 23:49:26 +0200 +Subject: wined3d: Don't synchronize NOOVERWRITE buffer maps + +TODO: Put the patch that makes PreLoad ignore the mapped state here. +--- + dlls/wined3d/buffer.c | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index de0eaec..fd03fb5 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -958,13 +958,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + + TRACE("buffer %p, offset %u, size %u, data %p, flags %#x\n", buffer, offset, size, data, flags); + +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } +- + flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); + /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture + * fill rate test seems to depend on this. When we map a buffer with +@@ -995,6 +988,13 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + struct wined3d_context *context; + const struct wined3d_gl_info *gl_info; + ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("waiting for cs\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ + context = context_acquire(device, NULL); + gl_info = context->gl_info; + +@@ -1056,6 +1056,12 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + buffer->flags |= WINED3D_BUFFER_SYNC; + } + ++ if (!(flags & WINED3D_MAP_NOOVERWRITE) && wined3d_settings.cs_multithreaded) ++ { ++ FIXME("waiting for cs.\n"); ++ device->cs->ops->finish(device->cs); ++ } ++ + base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.heap_memory; + *data = base + offset; + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Accelerate-READONLY-buffer-maps.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Accelerate-READONLY-buffer-maps.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Accelerate-READONLY-buffer-maps.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Accelerate-READONLY-buffer-maps.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From 14090e86e52e7fcc475ae83c3a25039a313a6d32 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 16:44:35 +0200 -Subject: wined3d: Accelerate READONLY buffer maps - -FIXME: ProcessVertices can write to buffers ---- - dlls/wined3d/buffer.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 5c6d36e..f4c0d07 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1066,9 +1066,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - wined3d_resource_allocate_sysmem(&buffer->resource); - wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); - } -- else if(!(flags & WINED3D_MAP_NOOVERWRITE)) -+ else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) - { -- FIXME("waiting for cs.\n"); -+ FIXME("waiting for cs, flags 0x%04x.\n", flags); - device->cs->ops->finish(device->cs); - } - } --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0124-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,47 @@ +From eaad769483668455de518d4bea0013ddef6d5f6a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 15:59:11 +0200 +Subject: wined3d: Separate buffer map write and draw read memory pointers + +TODO: Think about making this generic for all resources. +TODO 2: This is rather pointless on its own, merge this with the +patch that introduces this for all resources. +--- + dlls/wined3d/buffer.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index fd03fb5..2a814c6 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -191,7 +191,10 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine + if (This->flags & WINED3D_BUFFER_DOUBLEBUFFER) + buffer_invalidate_bo_range(This, 0, 0); + else ++ { + wined3d_resource_free_sysmem(&This->resource); ++ This->resource.map_heap_memory = NULL; ++ } + + return; + +@@ -1044,7 +1047,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + buffer_get_sysmem(buffer, context); + } + TRACE("New pointer is %p.\n", buffer->resource.heap_memory); +- buffer->map_ptr = NULL; + } + context_release(context); + } +@@ -1062,7 +1064,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + device->cs->ops->finish(device->cs); + } + +- base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.heap_memory; ++ base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.map_heap_memory; + *data = base + offset; + + TRACE("Returning memory at %p (base %p, offset %u).\n", *data, base, offset); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Accelerate-DISCARD-buffer-maps.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Accelerate-DISCARD-buffer-maps.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Accelerate-DISCARD-buffer-maps.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Accelerate-DISCARD-buffer-maps.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,139 @@ +From 46ed74a72057957b7046b45b4cdfb4b34ad4016e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 16:14:16 +0200 +Subject: wined3d: Accelerate DISCARD buffer maps + +TODO: Make this generic for all resources. +TODO2: Merge this with the patch that controlls BUFFER_DISCARD in the CS thread +TODO3: Clean up the map_mem allocation mess. +--- + dlls/wined3d/buffer.c | 15 ++++++++++++--- + dlls/wined3d/cs.c | 39 ++++++++++++++++++++++++++++++++++++++- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 52 insertions(+), 4 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 2a814c6..5c6d36e 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1058,10 +1058,19 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + buffer->flags |= WINED3D_BUFFER_SYNC; + } + +- if (!(flags & WINED3D_MAP_NOOVERWRITE) && wined3d_settings.cs_multithreaded) ++ if (wined3d_settings.cs_multithreaded && count == 1) + { +- FIXME("waiting for cs.\n"); +- device->cs->ops->finish(device->cs); ++ BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING; ++ if (flags & WINED3D_MAP_DISCARD && !swvp) ++ { ++ wined3d_resource_allocate_sysmem(&buffer->resource); ++ wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); ++ } ++ else if(!(flags & WINED3D_MAP_NOOVERWRITE)) ++ { ++ FIXME("waiting for cs.\n"); ++ device->cs->ops->finish(device->cs); ++ } + } + + base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.map_heap_memory; +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 9307246..341b51c 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -68,6 +68,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_RESOURCE_CHANGED, + WINED3D_CS_OP_RESOURCE_MAP, + WINED3D_CS_OP_RESOURCE_UNMAP, ++ WINED3D_CS_OP_BUFFER_SWAP_MEM, + WINED3D_CS_OP_QUERY_ISSUE, + WINED3D_CS_OP_QUERY_DESTROY, + WINED3D_CS_OP_UPDATE_SURFACE, +@@ -374,6 +375,13 @@ struct wined3d_cs_resource_changed + void *swap_heap_memory; + }; + ++struct wined3d_cs_buffer_swap_mem ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_buffer *buffer; ++ BYTE *mem; ++}; ++ + struct wined3d_cs_skip + { + enum wined3d_cs_op opcode; +@@ -2123,6 +2131,34 @@ void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resour + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_buffer_swap_mem *op = data; ++ struct wined3d_buffer *buffer = op->buffer; ++ ++ wined3d_resource_free_sysmem(&buffer->resource); ++ buffer->resource.heap_memory = op->mem; ++ ++ if (!buffer->buffer_object && buffer->resource.bind_count) ++ { ++ device_invalidate_state(cs->device, STATE_STREAMSRC); ++ device_invalidate_state(cs->device, STATE_INDEXBUFFER); ++ } ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, BYTE *mem) ++{ ++ struct wined3d_cs_buffer_swap_mem *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_BUFFER_SWAP_MEM; ++ op->buffer = buffer; ++ op->mem = mem; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2143,11 +2179,11 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_INDEX_BUFFER */ wined3d_cs_exec_set_index_buffer, + /* WINED3D_CS_OP_SET_CONSTANT_BUFFER */ wined3d_cs_exec_set_constant_buffer, + /* WINED3D_CS_OP_SET_TEXTURE */ wined3d_cs_exec_set_texture, ++ /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, + /* WINED3D_CS_OP_SET_SAMPLER */ wined3d_cs_exec_set_sampler, + /* WINED3D_CS_OP_SET_SHADER */ wined3d_cs_exec_set_shader, + /* WINED3D_CS_OP_SET_RENDER_STATE */ wined3d_cs_exec_set_render_state, + /* WINED3D_CS_OP_SET_TEXTURE_STATE */ wined3d_cs_exec_set_texture_state, +- /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, + /* WINED3D_CS_OP_SET_SAMPLER_STATE */ wined3d_cs_exec_set_sampler_state, + /* WINED3D_CS_OP_SET_TRANSFORM */ wined3d_cs_exec_set_transform, + /* WINED3D_CS_OP_SET_CLIP_PLANE */ wined3d_cs_exec_set_clip_plane, +@@ -2169,6 +2205,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_RESOURCE_CHANGED */ wined3d_cs_exec_resource_changed, + /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, + /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, ++ /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, + /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, + /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 270162f..7d12df9 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2694,6 +2694,8 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa + void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, + struct wined3d_texture *dst) DECLSPEC_HIDDEN; + void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, ++ BYTE *mem) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0125-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -From 6d53bc01b8d6db32aab6c0d9e7b93c20f2a7af94 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 17:05:12 +0200 -Subject: wined3d: Access the buffer dirty areas through the CS - -This avoids the following issues: - -1) The worker thread uploading a dirtified area before the application -unlocks the buffer and marking it clean - -2) The worker thread uploading data from the old memory and marking the -area clean although the data was written to a new block of memory. - -However, this adds more synchronization than necessary. The first -problem could be solved by moving dirtification to unmap, e.g. via a -flag in each dirty area. The second problem can be fixed by not -dirtifying in map if map_mem != resource.allocatedMemory and dirtifying -the entire buffer in buffer_swap_memory (DISCARD dirtifies the entire -buffer anyway, and this could be the reason why). - -If one of those ideas is used, access to the dirty area array needs to -be protected by locks. ---- - dlls/wined3d/buffer.c | 6 +++--- - dlls/wined3d/cs.c | 31 +++++++++++++++++++++++++++++++ - dlls/wined3d/wined3d_private.h | 3 +++ - 3 files changed, 37 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index c0bbfb7..df44ae0 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); - #define VB_MAXFULLCONVERSIONS 5 /* Number of full conversions before we stop converting */ - #define VB_RESETFULLCONVS 20 /* Reset full conversion counts after that number of draws */ - --static void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, UINT offset, UINT size) -+void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, UINT offset, UINT size) - { - if (!offset && !size) - goto invalidate_all; -@@ -979,9 +979,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - * being uploaded in that case. Two such applications are Port Royale - * and Darkstar One. */ - if (flags & WINED3D_MAP_DISCARD) -- buffer_invalidate_bo_range(buffer, 0, 0); -+ wined3d_cs_emit_buffer_invalidate_bo_range(device->cs, buffer, 0, 0); - else if (!(flags & WINED3D_MAP_READONLY)) -- buffer_invalidate_bo_range(buffer, offset, size); -+ wined3d_cs_emit_buffer_invalidate_bo_range(device->cs, buffer, offset, size); - - if (!(buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER)) - { -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 0a246a9..b871d92 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -70,6 +70,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_RESOURCE_MAP, - WINED3D_CS_OP_RESOURCE_UNMAP, - WINED3D_CS_OP_BUFFER_SWAP_MEM, -+ WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE, - WINED3D_CS_OP_QUERY_ISSUE, - WINED3D_CS_OP_QUERY_DESTROY, - WINED3D_CS_OP_UPDATE_SURFACE, -@@ -392,6 +393,13 @@ struct wined3d_cs_buffer_swap_mem - BYTE *mem; - }; - -+struct wined3d_cs_buffer_invalidate_bo_range -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_buffer *buffer; -+ UINT offset, size; -+}; -+ - struct wined3d_cs_skip - { - enum wined3d_cs_op opcode; -@@ -2272,6 +2280,28 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_buffer_invalidate_bo_range(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_buffer_invalidate_bo_range *op = data; -+ -+ buffer_invalidate_bo_range(op->buffer, op->offset, op->size); -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, -+ struct wined3d_buffer *buffer, UINT offset, UINT size) -+{ -+ struct wined3d_cs_buffer_invalidate_bo_range *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE; -+ op->buffer = buffer; -+ op->offset = offset; -+ op->size = size; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2320,6 +2350,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, - /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, - /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, -+ /* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range, - /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, - /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, - /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index efc5d2d..801c221 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2745,6 +2745,8 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur - void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, - BYTE *mem) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, -+ struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d -@@ -2830,6 +2832,7 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co - BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; - void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, - const struct wined3d_state *state) DECLSPEC_HIDDEN; -+void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; - - struct wined3d_rendertarget_view - { --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Accelerate-READONLY-buffer-maps.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Accelerate-READONLY-buffer-maps.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Accelerate-READONLY-buffer-maps.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Accelerate-READONLY-buffer-maps.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,29 @@ +From 14090e86e52e7fcc475ae83c3a25039a313a6d32 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 16:44:35 +0200 +Subject: wined3d: Accelerate READONLY buffer maps + +FIXME: ProcessVertices can write to buffers +--- + dlls/wined3d/buffer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 5c6d36e..f4c0d07 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1066,9 +1066,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + wined3d_resource_allocate_sysmem(&buffer->resource); + wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); + } +- else if(!(flags & WINED3D_MAP_NOOVERWRITE)) ++ else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) + { +- FIXME("waiting for cs.\n"); ++ FIXME("waiting for cs, flags 0x%04x.\n", flags); + device->cs->ops->finish(device->cs); + } + } +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0126-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -From e7637b3b410855296289ec8ebe199b80b5a7a2b0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 22:52:06 +0200 -Subject: wined3d: Ignore buffer->resource.map_count in the CS - -This fixes sporadic test failures caused by preload refusing to load -data into the GL buffer. - -It's fine to preload or create a VBO if a DISCARD or NOOVERWRITE map is -happening at the same time. A non-dynamic map will finish the CS before -incrementing map_count. ---- - dlls/wined3d/buffer.c | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 551cc7a..3ac45c6 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -457,7 +457,8 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co - data->buffer_object = buffer->buffer_object; - if (!buffer->buffer_object) - { -- if ((buffer->flags & WINED3D_BUFFER_CREATEBO) && !buffer->resource.map_count) -+ if ((!buffer->resource.map_count || buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER) -+ && buffer->flags & WINED3D_BUFFER_CREATEBO) - { - buffer_create_buffer_object(buffer, context); - buffer->flags &= ~WINED3D_BUFFER_CREATEBO; -@@ -737,12 +738,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte - - TRACE("buffer %p.\n", buffer); - -- if (buffer->resource.map_count) -- { -- WARN("Buffer is mapped, skipping preload.\n"); -- return; -- } -- - buffer_mark_used(buffer); - - if (!buffer->buffer_object) -@@ -934,6 +929,12 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) - struct wined3d_context *context; - struct wined3d_device *device = buffer->resource.device; - -+ if (buffer->resource.map_count) -+ { -+ WARN("Buffer is mapped, skipping preload.\n"); -+ return; -+ } -+ - if (wined3d_settings.cs_multithreaded) - { - FIXME("Waiting for cs.\n"); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,140 @@ +From 6d53bc01b8d6db32aab6c0d9e7b93c20f2a7af94 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 17:05:12 +0200 +Subject: wined3d: Access the buffer dirty areas through the CS + +This avoids the following issues: + +1) The worker thread uploading a dirtified area before the application +unlocks the buffer and marking it clean + +2) The worker thread uploading data from the old memory and marking the +area clean although the data was written to a new block of memory. + +However, this adds more synchronization than necessary. The first +problem could be solved by moving dirtification to unmap, e.g. via a +flag in each dirty area. The second problem can be fixed by not +dirtifying in map if map_mem != resource.allocatedMemory and dirtifying +the entire buffer in buffer_swap_memory (DISCARD dirtifies the entire +buffer anyway, and this could be the reason why). + +If one of those ideas is used, access to the dirty area array needs to +be protected by locks. +--- + dlls/wined3d/buffer.c | 6 +++--- + dlls/wined3d/cs.c | 31 +++++++++++++++++++++++++++++++ + dlls/wined3d/wined3d_private.h | 3 +++ + 3 files changed, 37 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index c0bbfb7..df44ae0 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); + #define VB_MAXFULLCONVERSIONS 5 /* Number of full conversions before we stop converting */ + #define VB_RESETFULLCONVS 20 /* Reset full conversion counts after that number of draws */ + +-static void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, UINT offset, UINT size) ++void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, UINT offset, UINT size) + { + if (!offset && !size) + goto invalidate_all; +@@ -979,9 +979,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + * being uploaded in that case. Two such applications are Port Royale + * and Darkstar One. */ + if (flags & WINED3D_MAP_DISCARD) +- buffer_invalidate_bo_range(buffer, 0, 0); ++ wined3d_cs_emit_buffer_invalidate_bo_range(device->cs, buffer, 0, 0); + else if (!(flags & WINED3D_MAP_READONLY)) +- buffer_invalidate_bo_range(buffer, offset, size); ++ wined3d_cs_emit_buffer_invalidate_bo_range(device->cs, buffer, offset, size); + + if (!(buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER)) + { +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 0a246a9..b871d92 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -70,6 +70,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_RESOURCE_MAP, + WINED3D_CS_OP_RESOURCE_UNMAP, + WINED3D_CS_OP_BUFFER_SWAP_MEM, ++ WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE, + WINED3D_CS_OP_QUERY_ISSUE, + WINED3D_CS_OP_QUERY_DESTROY, + WINED3D_CS_OP_UPDATE_SURFACE, +@@ -392,6 +393,13 @@ struct wined3d_cs_buffer_swap_mem + BYTE *mem; + }; + ++struct wined3d_cs_buffer_invalidate_bo_range ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_buffer *buffer; ++ UINT offset, size; ++}; ++ + struct wined3d_cs_skip + { + enum wined3d_cs_op opcode; +@@ -2272,6 +2280,28 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_buffer_invalidate_bo_range(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_buffer_invalidate_bo_range *op = data; ++ ++ buffer_invalidate_bo_range(op->buffer, op->offset, op->size); ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, ++ struct wined3d_buffer *buffer, UINT offset, UINT size) ++{ ++ struct wined3d_cs_buffer_invalidate_bo_range *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE; ++ op->buffer = buffer; ++ op->offset = offset; ++ op->size = size; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2320,6 +2350,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, + /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, + /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, ++ /* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range, + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, + /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, + /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index efc5d2d..801c221 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2745,6 +2745,8 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur + void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, + BYTE *mem) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, ++ struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +@@ -2830,6 +2832,7 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co + BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; + void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, + const struct wined3d_state *state) DECLSPEC_HIDDEN; ++void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; + + struct wined3d_rendertarget_view + { +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Send-buffer-preloads-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Send-buffer-preloads-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Send-buffer-preloads-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0127-wined3d-Send-buffer-preloads-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -From f0608f8a5916eea7e342db36ffe49427e40a4b49 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 7 Jul 2013 12:02:59 +0200 -Subject: wined3d: Send buffer preloads through the CS - -Think about making this a fast command. Might help if the driver -supports async data transfer, but synchronization side effects, esp. wrt -the dirty area list, have to be considered. ---- - dlls/wined3d/buffer.c | 12 +----------- - dlls/wined3d/cs.c | 31 +++++++++++++++++++++++++++++++ - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 33 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 3ac45c6..a09ca90 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -926,7 +926,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte - - void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) - { -- struct wined3d_context *context; - struct wined3d_device *device = buffer->resource.device; - - if (buffer->resource.map_count) -@@ -935,16 +934,7 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) - return; - } - -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -- -- context = context_acquire(buffer->resource.device, NULL); -- buffer_internal_preload(buffer, context, NULL); -- context_release(context); -+ wined3d_cs_emit_buffer_preload(device->cs, buffer); - } - - struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer) -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 179f2e6..6b16d51 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -70,6 +70,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_RESOURCE_UNMAP, - WINED3D_CS_OP_BUFFER_SWAP_MEM, - WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE, -+ WINED3D_CS_OP_BUFFER_PRELOAD, - WINED3D_CS_OP_QUERY_ISSUE, - WINED3D_CS_OP_QUERY_DESTROY, - WINED3D_CS_OP_UPDATE_SURFACE, -@@ -442,6 +443,12 @@ struct wined3d_cs_evict_resource - struct wined3d_resource *resource; - }; - -+struct wined3d_cs_buffer_preload -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_buffer *buffer; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2189,6 +2196,29 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_buffer_preload(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_buffer_preload *op = data; -+ struct wined3d_context *context; -+ -+ context = context_acquire(cs->device, NULL); -+ buffer_internal_preload(op->buffer, context, NULL); -+ context_release(context); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) -+{ -+ struct wined3d_cs_buffer_preload *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_BUFFER_PRELOAD; -+ op->buffer = buffer; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2237,6 +2267,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, - /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, - /* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range, -+ /* WINED3D_CS_OP_BUFFER_PRELOAD */ wined3d_cs_exec_buffer_preload, - /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, - /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, - /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index c683880..4070e1d 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2698,6 +2698,7 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe - BYTE *mem) DECLSPEC_HIDDEN; - void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, - struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,58 @@ +From e7637b3b410855296289ec8ebe199b80b5a7a2b0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 22:52:06 +0200 +Subject: wined3d: Ignore buffer->resource.map_count in the CS + +This fixes sporadic test failures caused by preload refusing to load +data into the GL buffer. + +It's fine to preload or create a VBO if a DISCARD or NOOVERWRITE map is +happening at the same time. A non-dynamic map will finish the CS before +incrementing map_count. +--- + dlls/wined3d/buffer.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 551cc7a..3ac45c6 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -457,7 +457,8 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co + data->buffer_object = buffer->buffer_object; + if (!buffer->buffer_object) + { +- if ((buffer->flags & WINED3D_BUFFER_CREATEBO) && !buffer->resource.map_count) ++ if ((!buffer->resource.map_count || buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER) ++ && buffer->flags & WINED3D_BUFFER_CREATEBO) + { + buffer_create_buffer_object(buffer, context); + buffer->flags &= ~WINED3D_BUFFER_CREATEBO; +@@ -737,12 +738,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte + + TRACE("buffer %p.\n", buffer); + +- if (buffer->resource.map_count) +- { +- WARN("Buffer is mapped, skipping preload.\n"); +- return; +- } +- + buffer_mark_used(buffer); + + if (!buffer->buffer_object) +@@ -934,6 +929,12 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) + struct wined3d_context *context; + struct wined3d_device *device = buffer->resource.device; + ++ if (buffer->resource.map_count) ++ { ++ WARN("Buffer is mapped, skipping preload.\n"); ++ return; ++ } ++ + if (wined3d_settings.cs_multithreaded) + { + FIXME("Waiting for cs.\n"); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0128-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -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 - -This is faster on Nvidia once we're stuck in double-buffer mode for some -reason (e.g. using threaded cs). For other cards, we want to be able to -do mapbuffer through the CS. ---- - dlls/wined3d/buffer.c | 50 ++++++-------------------------------------------- - 1 file changed, 6 insertions(+), 44 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 12ef20f..04e38cb 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -657,43 +657,17 @@ drop_query: - /* The caller provides a GL context */ - static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info, DWORD flags) - { -- BYTE *map; - UINT start = 0, len = 0; - - /* This potentially invalidates the element array buffer binding, but the - * caller always takes care of this. */ - GL_EXTCALL(glBindBuffer(This->buffer_type_hint, This->buffer_object)); - checkGLcall("glBindBuffer"); -- if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) -- { -- GLbitfield mapflags; -- mapflags = GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT; -- if (flags & WINED3D_BUFFER_DISCARD) -- mapflags |= GL_MAP_INVALIDATE_BUFFER_BIT; -- else if (!(flags & WINED3D_BUFFER_SYNC)) -- mapflags |= GL_MAP_UNSYNCHRONIZED_BIT; -- map = GL_EXTCALL(glMapBufferRange(This->buffer_type_hint, 0, -- This->resource.size, mapflags)); -- checkGLcall("glMapBufferRange"); -- } -- else -- { -- if (This->flags & WINED3D_BUFFER_APPLESYNC) -- { -- DWORD syncflags = 0; -- if (flags & WINED3D_BUFFER_DISCARD) -- syncflags |= WINED3D_MAP_DISCARD; -- else if (!(flags & WINED3D_BUFFER_SYNC)) -- syncflags |= WINED3D_MAP_NOOVERWRITE; -- buffer_sync_apple(This, syncflags, gl_info); -- } -- map = GL_EXTCALL(glMapBuffer(This->buffer_type_hint, GL_WRITE_ONLY)); -- checkGLcall("glMapBuffer"); -- } -- if (!map) -+ -+ if (flags & WINED3D_BUFFER_DISCARD) - { -- ERR("Failed to map opengl buffer\n"); -- return; -+ GL_EXTCALL(glBufferData(This->buffer_type_hint, This->resource.size, NULL, GL_STREAM_DRAW)); -+ checkGLcall("glBufferData"); - } - - while (This->modified_areas) -@@ -702,21 +676,9 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined - start = This->maps[This->modified_areas].offset; - len = This->maps[This->modified_areas].size; - -- memcpy(map + start, (BYTE *)This->resource.heap_memory + start, len); -- -- if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) -- { -- GL_EXTCALL(glFlushMappedBufferRange(This->buffer_type_hint, start, len)); -- checkGLcall("glFlushMappedBufferRange"); -- } -- else if (This->flags & WINED3D_BUFFER_APPLESYNC) -- { -- GL_EXTCALL(glFlushMappedBufferRangeAPPLE(This->buffer_type_hint, start, len)); -- checkGLcall("glFlushMappedBufferRangeAPPLE"); -- } -+ GL_EXTCALL(glBufferSubData(This->buffer_type_hint, start, len, (BYTE *)This->resource.heap_memory + start)); -+ checkGLcall("glBufferSubData"); - } -- GL_EXTCALL(glUnmapBuffer(This->buffer_type_hint)); -- checkGLcall("glUnmapBuffer"); - } - - static void buffer_mark_used(struct wined3d_buffer *buffer) --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Send-buffer-preloads-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Send-buffer-preloads-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Send-buffer-preloads-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Send-buffer-preloads-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,122 @@ +From f0608f8a5916eea7e342db36ffe49427e40a4b49 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 7 Jul 2013 12:02:59 +0200 +Subject: wined3d: Send buffer preloads through the CS + +Think about making this a fast command. Might help if the driver +supports async data transfer, but synchronization side effects, esp. wrt +the dirty area list, have to be considered. +--- + dlls/wined3d/buffer.c | 12 +----------- + dlls/wined3d/cs.c | 31 +++++++++++++++++++++++++++++++ + dlls/wined3d/wined3d_private.h | 1 + + 3 files changed, 33 insertions(+), 11 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 3ac45c6..a09ca90 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -926,7 +926,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte + + void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) + { +- struct wined3d_context *context; + struct wined3d_device *device = buffer->resource.device; + + if (buffer->resource.map_count) +@@ -935,16 +934,7 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) + return; + } + +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } +- +- context = context_acquire(buffer->resource.device, NULL); +- buffer_internal_preload(buffer, context, NULL); +- context_release(context); ++ wined3d_cs_emit_buffer_preload(device->cs, buffer); + } + + struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer) +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 179f2e6..6b16d51 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -70,6 +70,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_RESOURCE_UNMAP, + WINED3D_CS_OP_BUFFER_SWAP_MEM, + WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE, ++ WINED3D_CS_OP_BUFFER_PRELOAD, + WINED3D_CS_OP_QUERY_ISSUE, + WINED3D_CS_OP_QUERY_DESTROY, + WINED3D_CS_OP_UPDATE_SURFACE, +@@ -442,6 +443,12 @@ struct wined3d_cs_evict_resource + struct wined3d_resource *resource; + }; + ++struct wined3d_cs_buffer_preload ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_buffer *buffer; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2189,6 +2196,29 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_buffer_preload(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_buffer_preload *op = data; ++ struct wined3d_context *context; ++ ++ context = context_acquire(cs->device, NULL); ++ buffer_internal_preload(op->buffer, context, NULL); ++ context_release(context); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) ++{ ++ struct wined3d_cs_buffer_preload *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_BUFFER_PRELOAD; ++ op->buffer = buffer; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2237,6 +2267,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, + /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, + /* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range, ++ /* WINED3D_CS_OP_BUFFER_PRELOAD */ wined3d_cs_exec_buffer_preload, + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, + /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, + /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index c683880..4070e1d 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2698,6 +2698,7 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe + BYTE *mem) DECLSPEC_HIDDEN; + void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, + struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Separate-GL-buffer-discard-control-from-igno.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Separate-GL-buffer-discard-control-from-igno.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Separate-GL-buffer-discard-control-from-igno.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0129-wined3d-Separate-GL-buffer-discard-control-from-igno.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -From fd33771329457adaba5a2fb8006991e7ad756ec7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 30 Jul 2013 22:17:10 +0200 -Subject: wined3d: Separate GL buffer discard control from ignoring - MAP_DISCARD. - -Ignoring WINED3D_MAP_DISCARD is controlled purely in the main thread, -whereas the other one is controlled in the worker thread. Store them in -separate fields for synchronization purposes. - -There are some problems left: -* buffer->flags is still accessed by both threads without sync. -* CSMT=off has a separate codepath that is untested. ---- - dlls/wined3d/buffer.c | 25 +++++++++++++++++++------ - dlls/wined3d/cs.c | 9 +++++++-- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 28 insertions(+), 8 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 675dbec..8b09aee 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -32,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); - #define WINED3D_BUFFER_HASDESC 0x01 /* A vertex description has been found. */ - #define WINED3D_BUFFER_CREATEBO 0x02 /* Create a buffer object for this buffer. */ - #define WINED3D_BUFFER_DOUBLEBUFFER 0x04 /* Keep both a buffer object and a system memory copy for this buffer. */ --#define WINED3D_BUFFER_DISCARD 0x08 /* A DISCARD lock has occurred since the last preload. */ -+#define WINED3D_BUFFER_DISCARD 0x08 /* The next PreLoad may discard the buffer contents. */ - #define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */ - #define WINED3D_BUFFER_APPLESYNC 0x20 /* Using sync as in GL_APPLE_flush_buffer_range. */ - -@@ -921,7 +921,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - * previous contents of the buffer. The r600g driver only does this when - * the buffer is currently in use, while the proprietary NVIDIA driver - * appears to do this unconditionally. */ -- if (buffer->flags & WINED3D_BUFFER_DISCARD) -+ if (buffer->ignore_discard) - flags &= ~WINED3D_MAP_DISCARD; - count = ++buffer->resource.map_count; - -@@ -1004,10 +1004,15 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - context_release(context); - } - } -- -- if (flags & WINED3D_MAP_DISCARD) -- buffer->flags |= WINED3D_BUFFER_DISCARD; -- else if (!(flags & WINED3D_MAP_NOOVERWRITE)) -+ else if(!wined3d_settings.cs_multithreaded) -+ { -+ if (flags & WINED3D_MAP_DISCARD) -+ { -+ buffer->flags |= WINED3D_BUFFER_DISCARD; -+ buffer->ignore_discard = TRUE; -+ } -+ } -+ if (!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD))) - buffer->flags |= WINED3D_BUFFER_SYNC; - } - -@@ -1016,6 +1021,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING; - if (flags & WINED3D_MAP_DISCARD && !swvp) - { -+ buffer->ignore_discard = TRUE; - wined3d_resource_allocate_sysmem(&buffer->resource); - wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); - } -@@ -1332,3 +1338,10 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, - - return WINED3D_OK; - } -+ -+void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) -+{ -+ wined3d_resource_free_sysmem(&buffer->resource); -+ buffer->resource.heap_memory = mem; -+ buffer->flags |= WINED3D_BUFFER_DISCARD; -+} -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 6b16d51..4b9af57 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -722,11 +722,17 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun - op->indexed = indexed; - - if (indexed) -+ { - wined3d_resource_inc_fence(&state->index_buffer->resource); -+ state->index_buffer->ignore_discard = FALSE; -+ } - for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++) - { - if (state->streams[i].buffer) -+ { - wined3d_resource_inc_fence(&state->streams[i].buffer->resource); -+ state->streams[i].buffer->ignore_discard = FALSE; -+ } - } - for (i = 0; i < sizeof(state->textures) / sizeof(*state->textures); i++) - { -@@ -2151,8 +2157,7 @@ static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *d - const struct wined3d_cs_buffer_swap_mem *op = data; - struct wined3d_buffer *buffer = op->buffer; - -- wined3d_resource_free_sysmem(&buffer->resource); -- buffer->resource.heap_memory = op->mem; -+ buffer_swap_mem(buffer, op->mem); - - if (!buffer->buffer_object && buffer->resource.bind_count) - { -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 4070e1d..0f88961 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2760,6 +2760,7 @@ struct wined3d_buffer - GLenum buffer_object_usage; - GLenum buffer_type_hint; - DWORD flags; -+ BOOL ignore_discard; - void *map_ptr; - - struct wined3d_map_range *maps; -@@ -2785,6 +2786,7 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *con - void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, - const struct wined3d_state *state) DECLSPEC_HIDDEN; - void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; -+void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; - - struct wined3d_rendertarget_view - { --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Create-buffers-before-mapping-them.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Create-buffers-before-mapping-them.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Create-buffers-before-mapping-them.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Create-buffers-before-mapping-them.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -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. - ---- - dlls/wined3d/buffer.c | 26 +++++++++++++++++++++++++- - 1 file changed, 25 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -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("glBufferData failed with error %s (%#x)\n", debug_glerror(error), error); - goto fail; - } -+ if (wined3d_settings.strict_draw_ordering || wined3d_settings.cs_multithreaded) -+ gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - - This->buffer_object_usage = gl_usage; - -@@ -911,9 +913,32 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - LONG count; - BYTE *base; - struct wined3d_device *device = buffer->resource.device; -+ struct wined3d_context *context; - - TRACE("buffer %p, offset %u, size %u, data %p, flags %#x\n", buffer, offset, size, data, flags); - -+ /* FIXME: There is a race condition with the same code in -+ * buffer_internal_preload and buffer_get_memory. -+ * -+ * This deals with a race condition concering buffer creation and buffer maps. -+ * If a VBO is created by the worker thread while the buffer is mapped, outdated -+ * data may be uploaded, and the BO range is not properly invaliated. Keep in -+ * mind that a broken application might draw from a buffer before mapping it. -+ * -+ * 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_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. */ -+ if (buffer->flags & WINED3D_BUFFER_CREATEBO) -+ { -+ context = context_acquire(device, NULL); -+ buffer_create_buffer_object(buffer, context); -+ context_release(context); -+ buffer->flags &= ~WINED3D_BUFFER_CREATEBO; -+ } -+ - flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); - /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture - * fill rate test seems to depend on this. When we map a buffer with -@@ -941,7 +966,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - if (count == 1) - { - struct wined3d_device *device = buffer->resource.device; -- struct wined3d_context *context; - const struct wined3d_gl_info *gl_info; - - if (wined3d_settings.cs_multithreaded) --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0130-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,91 @@ +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 + +This is faster on Nvidia once we're stuck in double-buffer mode for some +reason (e.g. using threaded cs). For other cards, we want to be able to +do mapbuffer through the CS. +--- + dlls/wined3d/buffer.c | 50 ++++++-------------------------------------------- + 1 file changed, 6 insertions(+), 44 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 12ef20f..04e38cb 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -657,43 +657,17 @@ drop_query: + /* The caller provides a GL context */ + static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info, DWORD flags) + { +- BYTE *map; + UINT start = 0, len = 0; + + /* This potentially invalidates the element array buffer binding, but the + * caller always takes care of this. */ + GL_EXTCALL(glBindBuffer(This->buffer_type_hint, This->buffer_object)); + checkGLcall("glBindBuffer"); +- if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) +- { +- GLbitfield mapflags; +- mapflags = GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT; +- if (flags & WINED3D_BUFFER_DISCARD) +- mapflags |= GL_MAP_INVALIDATE_BUFFER_BIT; +- else if (!(flags & WINED3D_BUFFER_SYNC)) +- mapflags |= GL_MAP_UNSYNCHRONIZED_BIT; +- map = GL_EXTCALL(glMapBufferRange(This->buffer_type_hint, 0, +- This->resource.size, mapflags)); +- checkGLcall("glMapBufferRange"); +- } +- else +- { +- if (This->flags & WINED3D_BUFFER_APPLESYNC) +- { +- DWORD syncflags = 0; +- if (flags & WINED3D_BUFFER_DISCARD) +- syncflags |= WINED3D_MAP_DISCARD; +- else if (!(flags & WINED3D_BUFFER_SYNC)) +- syncflags |= WINED3D_MAP_NOOVERWRITE; +- buffer_sync_apple(This, syncflags, gl_info); +- } +- map = GL_EXTCALL(glMapBuffer(This->buffer_type_hint, GL_WRITE_ONLY)); +- checkGLcall("glMapBuffer"); +- } +- if (!map) ++ ++ if (flags & WINED3D_BUFFER_DISCARD) + { +- ERR("Failed to map opengl buffer\n"); +- return; ++ GL_EXTCALL(glBufferData(This->buffer_type_hint, This->resource.size, NULL, GL_STREAM_DRAW)); ++ checkGLcall("glBufferData"); + } + + while (This->modified_areas) +@@ -702,21 +676,9 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined + start = This->maps[This->modified_areas].offset; + len = This->maps[This->modified_areas].size; + +- memcpy(map + start, (BYTE *)This->resource.heap_memory + start, len); +- +- if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) +- { +- GL_EXTCALL(glFlushMappedBufferRange(This->buffer_type_hint, start, len)); +- checkGLcall("glFlushMappedBufferRange"); +- } +- else if (This->flags & WINED3D_BUFFER_APPLESYNC) +- { +- GL_EXTCALL(glFlushMappedBufferRangeAPPLE(This->buffer_type_hint, start, len)); +- checkGLcall("glFlushMappedBufferRangeAPPLE"); +- } ++ GL_EXTCALL(glBufferSubData(This->buffer_type_hint, start, len, (BYTE *)This->resource.heap_memory + start)); ++ checkGLcall("glBufferSubData"); + } +- GL_EXTCALL(glUnmapBuffer(This->buffer_type_hint)); +- checkGLcall("glUnmapBuffer"); + } + + static void buffer_mark_used(struct wined3d_buffer *buffer) +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Destroy-views-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Destroy-views-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Destroy-views-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Destroy-views-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,173 +0,0 @@ -From a31fb6ca1b9379028340024e2bd7e97e894b0532 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 21 Aug 2014 22:47:58 +0200 -Subject: wined3d: Destroy views through the CS. - -Move this ahead. This has caused sporadic test failures ever since blits were moved to the CS. - -Also contains an ugly hack for ffp_blit_depth_fill. ---- - dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/surface.c | 4 ++-- - dlls/wined3d/view.c | 29 ++++++++++++++++++++++++++++- - dlls/wined3d/wined3d_private.h | 4 ++++ - 4 files changed, 62 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 4b9af57..8e48c55 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -78,6 +78,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SURFACE_PRELOAD, - WINED3D_CS_OP_UPDATE_TEXTURE, - WINED3D_CS_OP_EVICT_RESOURCE, -+ WINED3D_CS_OP_VIEW_DESTROY, - WINED3D_CS_OP_STOP, - }; - -@@ -449,6 +450,12 @@ struct wined3d_cs_buffer_preload - struct wined3d_buffer *buffer; - }; - -+struct wined3d_cs_view_destroy -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_rendertarget_view *view; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2224,6 +2231,26 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_view_destroy(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_view_destroy *op = data; -+ -+ wined3d_rendertarget_view_destroy(op->view); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) -+{ -+ struct wined3d_cs_view_destroy *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_VIEW_DESTROY; -+ op->view = view; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2280,6 +2307,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, - /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, - /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, -+ /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 73160ff..43f68c6 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -4140,7 +4140,7 @@ static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d - } - - device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); -- wined3d_rendertarget_view_decref(view); -+ wined3d_rendertarget_view_decref_worker(view); - - return WINED3D_OK; - } -@@ -4160,7 +4160,7 @@ static HRESULT ffp_blit_depth_fill(struct wined3d_device *device, struct wined3d - } - - device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); -- wined3d_rendertarget_view_decref(fb.depth_stencil); -+ wined3d_rendertarget_view_decref_worker(fb.depth_stencil); - - return WINED3D_OK; - } -diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c -index 9cda64d..56eb7b3 100644 ---- a/dlls/wined3d/view.c -+++ b/dlls/wined3d/view.c -@@ -33,6 +33,11 @@ ULONG CDECL wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *v - return refcount; - } - -+void wined3d_rendertarget_view_destroy(struct wined3d_rendertarget_view *view) -+{ -+ HeapFree(GetProcessHeap(), 0, view); -+} -+ - ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view) - { - ULONG refcount = InterlockedDecrement(&view->refcount); -@@ -41,11 +46,33 @@ ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *v - - if (!refcount) - { -+ struct wined3d_device *device = view->resource->device; -+ - /* Call wined3d_object_destroyed() before releasing the resource, - * since releasing the resource may end up destroying the parent. */ - view->parent_ops->wined3d_object_destroyed(view->parent); - wined3d_resource_decref(view->resource); -- HeapFree(GetProcessHeap(), 0, view); -+ wined3d_cs_emit_view_destroy(device->cs, view); -+ } -+ -+ return refcount; -+} -+ -+/* Ugly hack for ffp_blit_depth_fill that allows destroying a view from inside the -+ * worker thread. */ -+ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) -+{ -+ ULONG refcount = InterlockedDecrement(&view->refcount); -+ -+ TRACE("%p decreasing refcount to %u.\n", view, refcount); -+ -+ if (!refcount) -+ { -+ /* Call wined3d_object_destroyed() before releasing the resource, -+ * since releasing the resource may end up destroying the parent. */ -+ view->parent_ops->wined3d_object_destroyed(view->parent); -+ wined3d_resource_decref(view->resource); -+ wined3d_rendertarget_view_destroy(view); - } - - return refcount; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 0f88961..7d68448 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2699,6 +2699,7 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe - void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, - struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; - void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; - - /* 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 -@@ -2824,6 +2825,9 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( - return surface_from_resource(resource); - } - -+ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; -+void wined3d_rendertarget_view_destroy(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; -+ - struct wined3d_shader_resource_view - { - LONG refcount; --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Separate-GL-buffer-discard-control-from-igno.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Separate-GL-buffer-discard-control-from-igno.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Separate-GL-buffer-discard-control-from-igno.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0131-wined3d-Separate-GL-buffer-discard-control-from-igno.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,135 @@ +From fd33771329457adaba5a2fb8006991e7ad756ec7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 30 Jul 2013 22:17:10 +0200 +Subject: wined3d: Separate GL buffer discard control from ignoring + MAP_DISCARD. + +Ignoring WINED3D_MAP_DISCARD is controlled purely in the main thread, +whereas the other one is controlled in the worker thread. Store them in +separate fields for synchronization purposes. + +There are some problems left: +* buffer->flags is still accessed by both threads without sync. +* CSMT=off has a separate codepath that is untested. +--- + dlls/wined3d/buffer.c | 25 +++++++++++++++++++------ + dlls/wined3d/cs.c | 9 +++++++-- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 28 insertions(+), 8 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 675dbec..8b09aee 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -32,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); + #define WINED3D_BUFFER_HASDESC 0x01 /* A vertex description has been found. */ + #define WINED3D_BUFFER_CREATEBO 0x02 /* Create a buffer object for this buffer. */ + #define WINED3D_BUFFER_DOUBLEBUFFER 0x04 /* Keep both a buffer object and a system memory copy for this buffer. */ +-#define WINED3D_BUFFER_DISCARD 0x08 /* A DISCARD lock has occurred since the last preload. */ ++#define WINED3D_BUFFER_DISCARD 0x08 /* The next PreLoad may discard the buffer contents. */ + #define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */ + #define WINED3D_BUFFER_APPLESYNC 0x20 /* Using sync as in GL_APPLE_flush_buffer_range. */ + +@@ -921,7 +921,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + * previous contents of the buffer. The r600g driver only does this when + * the buffer is currently in use, while the proprietary NVIDIA driver + * appears to do this unconditionally. */ +- if (buffer->flags & WINED3D_BUFFER_DISCARD) ++ if (buffer->ignore_discard) + flags &= ~WINED3D_MAP_DISCARD; + count = ++buffer->resource.map_count; + +@@ -1004,10 +1004,15 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + context_release(context); + } + } +- +- if (flags & WINED3D_MAP_DISCARD) +- buffer->flags |= WINED3D_BUFFER_DISCARD; +- else if (!(flags & WINED3D_MAP_NOOVERWRITE)) ++ else if(!wined3d_settings.cs_multithreaded) ++ { ++ if (flags & WINED3D_MAP_DISCARD) ++ { ++ buffer->flags |= WINED3D_BUFFER_DISCARD; ++ buffer->ignore_discard = TRUE; ++ } ++ } ++ if (!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD))) + buffer->flags |= WINED3D_BUFFER_SYNC; + } + +@@ -1016,6 +1021,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING; + if (flags & WINED3D_MAP_DISCARD && !swvp) + { ++ buffer->ignore_discard = TRUE; + wined3d_resource_allocate_sysmem(&buffer->resource); + wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); + } +@@ -1332,3 +1338,10 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, + + return WINED3D_OK; + } ++ ++void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) ++{ ++ wined3d_resource_free_sysmem(&buffer->resource); ++ buffer->resource.heap_memory = mem; ++ buffer->flags |= WINED3D_BUFFER_DISCARD; ++} +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 6b16d51..4b9af57 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -722,11 +722,17 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun + op->indexed = indexed; + + if (indexed) ++ { + wined3d_resource_inc_fence(&state->index_buffer->resource); ++ state->index_buffer->ignore_discard = FALSE; ++ } + for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++) + { + if (state->streams[i].buffer) ++ { + wined3d_resource_inc_fence(&state->streams[i].buffer->resource); ++ state->streams[i].buffer->ignore_discard = FALSE; ++ } + } + for (i = 0; i < sizeof(state->textures) / sizeof(*state->textures); i++) + { +@@ -2151,8 +2157,7 @@ static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *d + const struct wined3d_cs_buffer_swap_mem *op = data; + struct wined3d_buffer *buffer = op->buffer; + +- wined3d_resource_free_sysmem(&buffer->resource); +- buffer->resource.heap_memory = op->mem; ++ buffer_swap_mem(buffer, op->mem); + + if (!buffer->buffer_object && buffer->resource.bind_count) + { +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 4070e1d..0f88961 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2760,6 +2760,7 @@ struct wined3d_buffer + GLenum buffer_object_usage; + GLenum buffer_type_hint; + DWORD flags; ++ BOOL ignore_discard; + void *map_ptr; + + struct wined3d_map_range *maps; +@@ -2785,6 +2786,7 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *con + void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, + const struct wined3d_state *state) DECLSPEC_HIDDEN; + void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; ++void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; + + struct wined3d_rendertarget_view + { +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Create-buffers-before-mapping-them.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Create-buffers-before-mapping-them.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Create-buffers-before-mapping-them.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Create-buffers-before-mapping-them.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,66 @@ +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. + +--- + dlls/wined3d/buffer.c | 26 +++++++++++++++++++++++++- + 1 file changed, 25 insertions(+), 1 deletion(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +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("glBufferData failed with error %s (%#x)\n", debug_glerror(error), error); + goto fail; + } ++ if (wined3d_settings.strict_draw_ordering || wined3d_settings.cs_multithreaded) ++ gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + + This->buffer_object_usage = gl_usage; + +@@ -911,9 +913,32 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + LONG count; + BYTE *base; + struct wined3d_device *device = buffer->resource.device; ++ struct wined3d_context *context; + + TRACE("buffer %p, offset %u, size %u, data %p, flags %#x\n", buffer, offset, size, data, flags); + ++ /* FIXME: There is a race condition with the same code in ++ * buffer_internal_preload and buffer_get_memory. ++ * ++ * This deals with a race condition concering buffer creation and buffer maps. ++ * If a VBO is created by the worker thread while the buffer is mapped, outdated ++ * data may be uploaded, and the BO range is not properly invaliated. Keep in ++ * mind that a broken application might draw from a buffer before mapping it. ++ * ++ * 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_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. */ ++ if (buffer->flags & WINED3D_BUFFER_CREATEBO) ++ { ++ context = context_acquire(device, NULL); ++ buffer_create_buffer_object(buffer, context); ++ context_release(context); ++ buffer->flags &= ~WINED3D_BUFFER_CREATEBO; ++ } ++ + flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); + /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture + * fill rate test seems to depend on this. When we map a buffer with +@@ -941,7 +966,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + if (count == 1) + { + struct wined3d_device *device = buffer->resource.device; +- struct wined3d_context *context; + const struct wined3d_gl_info *gl_info; + + if (wined3d_settings.cs_multithreaded) +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Remove-another-glFinish.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Remove-another-glFinish.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Remove-another-glFinish.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0132-wined3d-Remove-another-glFinish.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -From 8a0e110ba10657b84aa33a1cd51fe46128062d4d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 22:08:39 +0200 -Subject: wined3d: Remove another glFinish - -I don't think this is needed any more. ---- - dlls/wined3d/surface.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 43f68c6..1d777e2 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -825,9 +825,7 @@ static void surface_blt_fbo(const struct wined3d_device *device, - dst_rect.left, dst_rect.top, dst_rect.right, dst_rect.bottom, GL_COLOR_BUFFER_BIT, gl_filter); - checkGLcall("glBlitFramebuffer()"); - -- if (wined3d_settings.cs_multithreaded) -- gl_info->gl_ops.gl.p_glFinish(); -- else if (wined3d_settings.strict_draw_ordering -+ if (wined3d_settings.strict_draw_ordering - || (dst_location == WINED3D_LOCATION_DRAWABLE - && dst_surface->container->swapchain->front_buffer == dst_surface->container)) - gl_info->gl_ops.gl.p_glFlush(); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Destroy-vertex-declarations-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Destroy-vertex-declarations-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Destroy-vertex-declarations-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Destroy-vertex-declarations-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -From a26808a39c226fc0f168336becc97ed512029d52 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 31 Jul 2013 23:06:27 +0200 -Subject: wined3d: Destroy vertex declarations through the CS - ---- - dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ - dlls/wined3d/vertexdeclaration.c | 15 ++++++++------- - dlls/wined3d/wined3d_private.h | 4 ++++ - 3 files changed, 41 insertions(+), 7 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 8e48c55..38063d7 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -79,6 +79,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_UPDATE_TEXTURE, - WINED3D_CS_OP_EVICT_RESOURCE, - WINED3D_CS_OP_VIEW_DESTROY, -+ WINED3D_CS_OP_VDECL_DESTROY, - WINED3D_CS_OP_STOP, - }; - -@@ -456,6 +457,12 @@ struct wined3d_cs_view_destroy - struct wined3d_rendertarget_view *view; - }; - -+struct wined3d_cs_vertex_declaration_destroy -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_vertex_declaration *declaration; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2251,6 +2258,27 @@ void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_renderta - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_vertex_declaration_destroy(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_vertex_declaration_destroy *op = data; -+ -+ wined3d_vertex_declaration_destroy(op->declaration); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, -+ struct wined3d_vertex_declaration *declaration) -+{ -+ struct wined3d_cs_vertex_declaration_destroy *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_VDECL_DESTROY; -+ op->declaration = declaration; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2308,6 +2336,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, - /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, - /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, -+ /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c -index 3f4d5e4..fc7a110 100644 ---- a/dlls/wined3d/vertexdeclaration.c -+++ b/dlls/wined3d/vertexdeclaration.c -@@ -48,6 +48,12 @@ ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration - return refcount; - } - -+void wined3d_vertex_declaration_destroy(struct wined3d_vertex_declaration *declaration) -+{ -+ HeapFree(GetProcessHeap(), 0, declaration->elements); -+ HeapFree(GetProcessHeap(), 0, declaration); -+} -+ - ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration) - { - ULONG refcount = InterlockedDecrement(&declaration->ref); -@@ -56,14 +62,9 @@ ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration - - if (!refcount) - { -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- declaration->device->cs->ops->finish(declaration->device->cs); -- } -- HeapFree(GetProcessHeap(), 0, declaration->elements); -+ const struct wined3d_device *device = declaration->device; - declaration->parent_ops->wined3d_object_destroyed(declaration->parent); -- HeapFree(GetProcessHeap(), 0, declaration); -+ wined3d_cs_emit_vertex_declaration_destroy(device->cs, declaration); - } - - return refcount; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7d68448..5d3393c 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2499,6 +2499,8 @@ struct wined3d_vertex_declaration - BOOL half_float_conv_needed; - }; - -+void wined3d_vertex_declaration_destroy(struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; -+ - struct wined3d_saved_states - { - DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; -@@ -2700,6 +2702,8 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, - struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; - void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, -+ struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Destroy-views-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Destroy-views-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Destroy-views-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0133-wined3d-Destroy-views-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,173 @@ +From a31fb6ca1b9379028340024e2bd7e97e894b0532 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 21 Aug 2014 22:47:58 +0200 +Subject: wined3d: Destroy views through the CS. + +Move this ahead. This has caused sporadic test failures ever since blits were moved to the CS. + +Also contains an ugly hack for ffp_blit_depth_fill. +--- + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/surface.c | 4 ++-- + dlls/wined3d/view.c | 29 ++++++++++++++++++++++++++++- + dlls/wined3d/wined3d_private.h | 4 ++++ + 4 files changed, 62 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 4b9af57..8e48c55 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -78,6 +78,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_SURFACE_PRELOAD, + WINED3D_CS_OP_UPDATE_TEXTURE, + WINED3D_CS_OP_EVICT_RESOURCE, ++ WINED3D_CS_OP_VIEW_DESTROY, + WINED3D_CS_OP_STOP, + }; + +@@ -449,6 +450,12 @@ struct wined3d_cs_buffer_preload + struct wined3d_buffer *buffer; + }; + ++struct wined3d_cs_view_destroy ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_rendertarget_view *view; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2224,6 +2231,26 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_view_destroy(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_view_destroy *op = data; ++ ++ wined3d_rendertarget_view_destroy(op->view); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) ++{ ++ struct wined3d_cs_view_destroy *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_VIEW_DESTROY; ++ op->view = view; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2280,6 +2307,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, + /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, + /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, ++ /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 73160ff..43f68c6 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -4140,7 +4140,7 @@ static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d + } + + device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); +- wined3d_rendertarget_view_decref(view); ++ wined3d_rendertarget_view_decref_worker(view); + + return WINED3D_OK; + } +@@ -4160,7 +4160,7 @@ static HRESULT ffp_blit_depth_fill(struct wined3d_device *device, struct wined3d + } + + device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); +- wined3d_rendertarget_view_decref(fb.depth_stencil); ++ wined3d_rendertarget_view_decref_worker(fb.depth_stencil); + + return WINED3D_OK; + } +diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c +index 9cda64d..56eb7b3 100644 +--- a/dlls/wined3d/view.c ++++ b/dlls/wined3d/view.c +@@ -33,6 +33,11 @@ ULONG CDECL wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *v + return refcount; + } + ++void wined3d_rendertarget_view_destroy(struct wined3d_rendertarget_view *view) ++{ ++ HeapFree(GetProcessHeap(), 0, view); ++} ++ + ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view) + { + ULONG refcount = InterlockedDecrement(&view->refcount); +@@ -41,11 +46,33 @@ ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *v + + if (!refcount) + { ++ struct wined3d_device *device = view->resource->device; ++ + /* Call wined3d_object_destroyed() before releasing the resource, + * since releasing the resource may end up destroying the parent. */ + view->parent_ops->wined3d_object_destroyed(view->parent); + wined3d_resource_decref(view->resource); +- HeapFree(GetProcessHeap(), 0, view); ++ wined3d_cs_emit_view_destroy(device->cs, view); ++ } ++ ++ return refcount; ++} ++ ++/* Ugly hack for ffp_blit_depth_fill that allows destroying a view from inside the ++ * worker thread. */ ++ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) ++{ ++ ULONG refcount = InterlockedDecrement(&view->refcount); ++ ++ TRACE("%p decreasing refcount to %u.\n", view, refcount); ++ ++ if (!refcount) ++ { ++ /* Call wined3d_object_destroyed() before releasing the resource, ++ * since releasing the resource may end up destroying the parent. */ ++ view->parent_ops->wined3d_object_destroyed(view->parent); ++ wined3d_resource_decref(view->resource); ++ wined3d_rendertarget_view_destroy(view); + } + + return refcount; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 0f88961..7d68448 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2699,6 +2699,7 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe + void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, + struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; + void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; + + /* 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 +@@ -2824,6 +2825,9 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( + return surface_from_resource(resource); + } + ++ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; ++void wined3d_rendertarget_view_destroy(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; ++ + struct wined3d_shader_resource_view + { + LONG refcount; +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Destroy-shaders-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Destroy-shaders-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Destroy-shaders-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Destroy-shaders-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -From c75e1fc10eb6a040ef2736cee8262e4200366905 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 31 Jul 2013 23:18:28 +0200 -Subject: wined3d: Destroy shaders through the CS - ---- - dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ - dlls/wined3d/shader.c | 12 ++++-------- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 35 insertions(+), 8 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index f088200..c745460 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -81,6 +81,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_EVICT_RESOURCE, - WINED3D_CS_OP_VIEW_DESTROY, - WINED3D_CS_OP_VDECL_DESTROY, -+ WINED3D_CS_OP_SHADER_CLEANUP, - WINED3D_CS_OP_STOP, - }; - -@@ -473,6 +474,12 @@ struct wined3d_cs_vertex_declaration_destroy - struct wined3d_vertex_declaration *declaration; - }; - -+struct wined3d_cs_shader_cleanup -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_shader *shader; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2392,6 +2399,27 @@ void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_shader_cleanup(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_shader_cleanup *op = data; -+ -+ shader_cleanup(op->shader); -+ HeapFree(GetProcessHeap(), 0, op->shader); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader *shader) -+{ -+ struct wined3d_cs_shader_cleanup *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SHADER_CLEANUP; -+ op->shader = shader; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2451,6 +2479,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, - /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, - /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, -+ /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c -index ec2a269..04e217e 100644 ---- a/dlls/wined3d/shader.c -+++ b/dlls/wined3d/shader.c -@@ -1859,7 +1859,7 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe - } - } - --static void shader_cleanup(struct wined3d_shader *shader) -+void shader_cleanup(struct wined3d_shader *shader) - { - HeapFree(GetProcessHeap(), 0, shader->output_signature.elements); - HeapFree(GetProcessHeap(), 0, shader->input_signature.elements); -@@ -2115,14 +2115,10 @@ ULONG CDECL wined3d_shader_decref(struct wined3d_shader *shader) - - if (!refcount) - { -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- shader->device->cs->ops->finish(shader->device->cs); -- } -- shader_cleanup(shader); -+ const struct wined3d_device *device = shader->device; -+ - shader->parent_ops->wined3d_object_destroyed(shader->parent); -- HeapFree(GetProcessHeap(), 0, shader); -+ wined3d_cs_emit_shader_cleanup(device->cs, shader); - } - - return refcount; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index a2f2044..545c97e 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2751,6 +2751,7 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer - void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; - 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; - - /* 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 -@@ -3153,6 +3154,7 @@ unsigned int shader_find_free_input_register(const struct wined3d_shader_reg_map - void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, - const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN; - BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN; -+void shader_cleanup(struct wined3d_shader *shader) DECLSPEC_HIDDEN; - - static inline BOOL shader_is_scalar(const struct wined3d_shader_register *reg) - { --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Remove-another-glFinish.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Remove-another-glFinish.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Remove-another-glFinish.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0134-wined3d-Remove-another-glFinish.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,28 @@ +From 8a0e110ba10657b84aa33a1cd51fe46128062d4d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sat, 6 Jul 2013 22:08:39 +0200 +Subject: wined3d: Remove another glFinish + +I don't think this is needed any more. +--- + dlls/wined3d/surface.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 43f68c6..1d777e2 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -825,9 +825,7 @@ static void surface_blt_fbo(const struct wined3d_device *device, + dst_rect.left, dst_rect.top, dst_rect.right, dst_rect.bottom, GL_COLOR_BUFFER_BIT, gl_filter); + checkGLcall("glBlitFramebuffer()"); + +- if (wined3d_settings.cs_multithreaded) +- gl_info->gl_ops.gl.p_glFinish(); +- else if (wined3d_settings.strict_draw_ordering ++ if (wined3d_settings.strict_draw_ordering + || (dst_location == WINED3D_LOCATION_DRAWABLE + && dst_surface->container->swapchain->front_buffer == dst_surface->container)) + gl_info->gl_ops.gl.p_glFlush(); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Create-VBOs-through-the-command-stream.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Create-VBOs-through-the-command-stream.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Create-VBOs-through-the-command-stream.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Create-VBOs-through-the-command-stream.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,133 +0,0 @@ -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. - -A stop-gap solution to make fglrx happier until buffers are updated. ---- - dlls/wined3d/buffer.c | 8 ++------ - dlls/wined3d/cs.c | 32 ++++++++++++++++++++++++++++++++ - dlls/wined3d/wined3d_private.h | 3 +++ - 3 files changed, 37 insertions(+), 6 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -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 - } - - /* Context activation is done by the caller. */ --static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wined3d_context *context) -+void buffer_create_buffer_object(struct wined3d_buffer *This, struct wined3d_context *context) - { - 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("glBufferData failed with error %s (%#x)\n", debug_glerror(error), error); - goto fail; - } -- if (wined3d_settings.strict_draw_ordering || wined3d_settings.cs_multithreaded) -- gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - - This->buffer_object_usage = gl_usage; - -@@ -933,9 +931,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - * on buffer creation won't work either. */ - if (buffer->flags & WINED3D_BUFFER_CREATEBO) - { -- context = context_acquire(device, NULL); -- buffer_create_buffer_object(buffer, context); -- context_release(context); -+ wined3d_cs_emit_create_vbo(device->cs, buffer); - buffer->flags &= ~WINED3D_BUFFER_CREATEBO; - } - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 21d5b74..c00d1d3 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -81,6 +81,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_VIEW_DESTROY, - WINED3D_CS_OP_VDECL_DESTROY, - WINED3D_CS_OP_SHADER_CLEANUP, -+ WINED3D_CS_OP_CREATE_VBO, - WINED3D_CS_OP_STOP, - }; - -@@ -470,6 +471,12 @@ struct wined3d_cs_shader_cleanup - struct wined3d_shader *shader; - }; - -+struct wined3d_cs_create_vbo -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_buffer *buffer; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2307,6 +2314,30 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_create_vbo(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_create_vbo *op = data; -+ struct wined3d_context *context = context_acquire(cs->device, NULL); -+ -+ buffer_create_buffer_object(op->buffer, context); -+ -+ context_release(context); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) -+{ -+ struct wined3d_cs_create_vbo *op; -+ -+ op = cs->ops->require_space_prio(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_CREATE_VBO; -+ op->buffer = buffer; -+ -+ cs->ops->submit_prio(cs, sizeof(*op)); -+ cs->ops->finish_prio(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2366,6 +2397,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, - /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, - /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, -+ /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 2cdc6e9..63b8ece 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2722,6 +2722,7 @@ void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_renderta - 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; -+void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d -@@ -2810,6 +2811,8 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte - const struct wined3d_state *state) DECLSPEC_HIDDEN; - void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; - void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; -+void buffer_create_buffer_object(struct wined3d_buffer *This, -+ struct wined3d_context *context) DECLSPEC_HIDDEN; - - struct wined3d_rendertarget_view - { --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Destroy-vertex-declarations-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Destroy-vertex-declarations-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Destroy-vertex-declarations-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0135-wined3d-Destroy-vertex-declarations-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,131 @@ +From a26808a39c226fc0f168336becc97ed512029d52 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 31 Jul 2013 23:06:27 +0200 +Subject: wined3d: Destroy vertex declarations through the CS + +--- + dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ + dlls/wined3d/vertexdeclaration.c | 15 ++++++++------- + dlls/wined3d/wined3d_private.h | 4 ++++ + 3 files changed, 41 insertions(+), 7 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 8e48c55..38063d7 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -79,6 +79,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_UPDATE_TEXTURE, + WINED3D_CS_OP_EVICT_RESOURCE, + WINED3D_CS_OP_VIEW_DESTROY, ++ WINED3D_CS_OP_VDECL_DESTROY, + WINED3D_CS_OP_STOP, + }; + +@@ -456,6 +457,12 @@ struct wined3d_cs_view_destroy + struct wined3d_rendertarget_view *view; + }; + ++struct wined3d_cs_vertex_declaration_destroy ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_vertex_declaration *declaration; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2251,6 +2258,27 @@ void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_renderta + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_vertex_declaration_destroy(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_vertex_declaration_destroy *op = data; ++ ++ wined3d_vertex_declaration_destroy(op->declaration); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, ++ struct wined3d_vertex_declaration *declaration) ++{ ++ struct wined3d_cs_vertex_declaration_destroy *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_VDECL_DESTROY; ++ op->declaration = declaration; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2308,6 +2336,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, + /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, + /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, ++ /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c +index 3f4d5e4..fc7a110 100644 +--- a/dlls/wined3d/vertexdeclaration.c ++++ b/dlls/wined3d/vertexdeclaration.c +@@ -48,6 +48,12 @@ ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration + return refcount; + } + ++void wined3d_vertex_declaration_destroy(struct wined3d_vertex_declaration *declaration) ++{ ++ HeapFree(GetProcessHeap(), 0, declaration->elements); ++ HeapFree(GetProcessHeap(), 0, declaration); ++} ++ + ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration) + { + ULONG refcount = InterlockedDecrement(&declaration->ref); +@@ -56,14 +62,9 @@ ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration + + if (!refcount) + { +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- declaration->device->cs->ops->finish(declaration->device->cs); +- } +- HeapFree(GetProcessHeap(), 0, declaration->elements); ++ const struct wined3d_device *device = declaration->device; + declaration->parent_ops->wined3d_object_destroyed(declaration->parent); +- HeapFree(GetProcessHeap(), 0, declaration); ++ wined3d_cs_emit_vertex_declaration_destroy(device->cs, declaration); + } + + return refcount; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 7d68448..5d3393c 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2499,6 +2499,8 @@ struct wined3d_vertex_declaration + BOOL half_float_conv_needed; + }; + ++void wined3d_vertex_declaration_destroy(struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; ++ + struct wined3d_saved_states + { + DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; +@@ -2700,6 +2702,8 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, + struct wined3d_buffer *buffer, UINT offset, UINT size) DECLSPEC_HIDDEN; + void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, ++ struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Clean-up-resource-data-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Clean-up-resource-data-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Clean-up-resource-data-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Clean-up-resource-data-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,211 +0,0 @@ -From 9109cd39e2867e3e9061d1720bde4598111b3d3b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 2 Oct 2013 22:38:51 +0200 -Subject: wined3d: Clean up resource data through the CS. - ---- - dlls/wined3d/buffer.c | 3 +++ - dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/resource.c | 15 ++++++++++----- - dlls/wined3d/surface.c | 5 +++++ - dlls/wined3d/texture.c | 4 ++++ - dlls/wined3d/volume.c | 3 +++ - dlls/wined3d/wined3d_private.h | 3 +++ - 7 files changed, 56 insertions(+), 5 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index fc65d3a..d968dcb 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -570,6 +570,9 @@ ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer) - } - - resource_cleanup(&buffer->resource); -+ if (wined3d_settings.cs_multithreaded) -+ buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); -+ - buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent); - HeapFree(GetProcessHeap(), 0, buffer->maps); - HeapFree(GetProcessHeap(), 0, buffer); -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index c00d1d3..6edd5e3 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -82,6 +82,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_VDECL_DESTROY, - WINED3D_CS_OP_SHADER_CLEANUP, - WINED3D_CS_OP_CREATE_VBO, -+ WINED3D_CS_OP_RESOURCE_CLEANUP, - WINED3D_CS_OP_STOP, - }; - -@@ -477,6 +478,12 @@ struct wined3d_cs_create_vbo - struct wined3d_buffer *buffer; - }; - -+struct wined3d_cs_resource_cleanup -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_resource *resource; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2338,6 +2345,26 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu - cs->ops->finish_prio(cs); - } - -+static UINT wined3d_cs_exec_resource_cleanup(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_resource_cleanup *op = data; -+ -+ wined3d_resource_cleanup_cs(op->resource); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_resource *resource) -+{ -+ struct wined3d_cs_resource_cleanup *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_RESOURCE_CLEANUP; -+ op->resource = resource; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2398,6 +2425,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, - /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, - /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, -+ /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index ef0b213..dd21986 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -157,6 +157,15 @@ void wined3d_resource_free_bo(struct wined3d_resource *resource) - context_release(context); - } - -+void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) -+{ -+ if (resource->buffer) -+ wined3d_resource_free_bo(resource); -+ -+ wined3d_resource_free_sysmem(resource); -+ resource->map_heap_memory = NULL; -+} -+ - void resource_cleanup(struct wined3d_resource *resource) - { - const struct wined3d *d3d = resource->device->wined3d; -@@ -169,11 +178,7 @@ void resource_cleanup(struct wined3d_resource *resource) - adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); - } - -- if (resource->buffer) -- wined3d_resource_free_bo(resource); -- -- wined3d_resource_free_sysmem(resource); -- resource->map_heap_memory = NULL; -+ wined3d_cs_emit_resource_cleanup(resource->device->cs, resource); - - device_resource_released(resource->device, resource); - } -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 1d777e2..4a1cf30 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -101,9 +101,12 @@ static void surface_cleanup(struct wined3d_surface *surface) - - void wined3d_surface_destroy(struct wined3d_surface *surface) - { -+ struct wined3d_device *device = surface->resource.device; - TRACE("surface %p.\n", surface); - - surface_cleanup(surface); -+ if (wined3d_settings.cs_multithreaded) -+ device->cs->ops->finish(device->cs); - surface->resource.parent_ops->wined3d_object_destroyed(surface->resource.parent); - HeapFree(GetProcessHeap(), 0, surface); - } -@@ -5321,6 +5324,8 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text - { - ERR("Private setup failed, hr %#x.\n", hr); - surface_cleanup(surface); -+ if (wined3d_settings.cs_multithreaded) -+ surface->resource.device->cs->ops->finish(surface->resource.device->cs); - return hr; - } - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index ea8589a..f7988e5 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -74,6 +74,8 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc - { - ERR("Failed to allocate sub-resource array.\n"); - resource_cleanup(&texture->resource); -+ if (wined3d_settings.cs_multithreaded) -+ texture->resource.device->cs->ops->finish(texture->resource.device->cs); - return E_OUTOFMEMORY; - } - -@@ -153,6 +155,8 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) - wined3d_texture_unload_gl_texture(texture); - HeapFree(GetProcessHeap(), 0, texture->sub_resources); - resource_cleanup(&texture->resource); -+ if (wined3d_settings.cs_multithreaded) -+ texture->resource.device->cs->ops->finish(texture->resource.device->cs); - } - - void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain) -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 34b72d1..218118d 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -291,9 +291,12 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * - - void wined3d_volume_destroy(struct wined3d_volume *volume) - { -+ struct wined3d_device *device = volume->resource.device; - TRACE("volume %p.\n", volume); - - resource_cleanup(&volume->resource); -+ if (wined3d_settings.cs_multithreaded) -+ device->cs->ops->finish(device->cs); - volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); - HeapFree(GetProcessHeap(), 0, volume); - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 74e059c..f4c269c 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2163,6 +2163,7 @@ void wined3d_resource_changed(struct wined3d_resource *resource, - struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) DECLSPEC_HIDDEN; - BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, - const struct wined3d_box *box) DECLSPEC_HIDDEN; -+void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; - BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, -@@ -2706,6 +2707,8 @@ 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; - void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, -+ struct wined3d_resource *resource) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Destroy-shaders-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Destroy-shaders-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Destroy-shaders-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0136-wined3d-Destroy-shaders-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,126 @@ +From c75e1fc10eb6a040ef2736cee8262e4200366905 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 31 Jul 2013 23:18:28 +0200 +Subject: wined3d: Destroy shaders through the CS + +--- + dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ + dlls/wined3d/shader.c | 12 ++++-------- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 35 insertions(+), 8 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index f088200..c745460 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -81,6 +81,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_EVICT_RESOURCE, + WINED3D_CS_OP_VIEW_DESTROY, + WINED3D_CS_OP_VDECL_DESTROY, ++ WINED3D_CS_OP_SHADER_CLEANUP, + WINED3D_CS_OP_STOP, + }; + +@@ -473,6 +474,12 @@ struct wined3d_cs_vertex_declaration_destroy + struct wined3d_vertex_declaration *declaration; + }; + ++struct wined3d_cs_shader_cleanup ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_shader *shader; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2392,6 +2399,27 @@ void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs, + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_shader_cleanup(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_shader_cleanup *op = data; ++ ++ shader_cleanup(op->shader); ++ HeapFree(GetProcessHeap(), 0, op->shader); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader *shader) ++{ ++ struct wined3d_cs_shader_cleanup *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_SHADER_CLEANUP; ++ op->shader = shader; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2451,6 +2479,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, + /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, + /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, ++ /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c +index ec2a269..04e217e 100644 +--- a/dlls/wined3d/shader.c ++++ b/dlls/wined3d/shader.c +@@ -1859,7 +1859,7 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe + } + } + +-static void shader_cleanup(struct wined3d_shader *shader) ++void shader_cleanup(struct wined3d_shader *shader) + { + HeapFree(GetProcessHeap(), 0, shader->output_signature.elements); + HeapFree(GetProcessHeap(), 0, shader->input_signature.elements); +@@ -2115,14 +2115,10 @@ ULONG CDECL wined3d_shader_decref(struct wined3d_shader *shader) + + if (!refcount) + { +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- shader->device->cs->ops->finish(shader->device->cs); +- } +- shader_cleanup(shader); ++ const struct wined3d_device *device = shader->device; ++ + shader->parent_ops->wined3d_object_destroyed(shader->parent); +- HeapFree(GetProcessHeap(), 0, shader); ++ wined3d_cs_emit_shader_cleanup(device->cs, shader); + } + + return refcount; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index a2f2044..545c97e 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2751,6 +2751,7 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer + void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; + 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; + + /* 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 +@@ -3153,6 +3154,7 @@ unsigned int shader_find_free_input_register(const struct wined3d_shader_reg_map + void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, + const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN; + BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN; ++void shader_cleanup(struct wined3d_shader *shader) DECLSPEC_HIDDEN; + + static inline BOOL shader_is_scalar(const struct wined3d_shader_register *reg) + { +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ -From 6462e66d6d2229b1755e7689e2b01eee97696676 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 2 Oct 2013 22:50:08 +0200 -Subject: wined3d: Clean up buffer resource data through the CS. - ---- - dlls/wined3d/buffer.c | 39 ++++++++++++++++++++------------------- - dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 50 insertions(+), 19 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index d968dcb..15ed760 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -545,37 +545,38 @@ static void buffer_unload(struct wined3d_resource *resource) - resource_unload(resource); - } - -+void wined3d_buffer_cleanup_cs(struct wined3d_buffer *buffer) -+{ -+ struct wined3d_context *context; -+ struct wined3d_device *device = buffer->resource.device; -+ -+ if (buffer->buffer_object) -+ { -+ context = context_acquire(device, NULL); -+ delete_gl_buffer(buffer, context->gl_info); -+ context_release(context); -+ -+ HeapFree(GetProcessHeap(), 0, buffer->conversion_map); -+ } -+ -+ HeapFree(GetProcessHeap(), 0, buffer->maps); -+ HeapFree(GetProcessHeap(), 0, buffer); -+} -+ - ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer) - { - ULONG refcount = InterlockedDecrement(&buffer->resource.ref); -- struct wined3d_context *context; - - TRACE("%p decreasing refcount to %u.\n", buffer, refcount); - - if (!refcount) - { -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); -- } -- -- if (buffer->buffer_object) -- { -- context = context_acquire(buffer->resource.device, NULL); -- delete_gl_buffer(buffer, context->gl_info); -- context_release(context); -- -- HeapFree(GetProcessHeap(), 0, buffer->conversion_map); -- } -+ struct wined3d_device *device = buffer->resource.device; - - resource_cleanup(&buffer->resource); -- if (wined3d_settings.cs_multithreaded) -- buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); - - buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent); -- HeapFree(GetProcessHeap(), 0, buffer->maps); -- HeapFree(GetProcessHeap(), 0, buffer); -+ wined3d_cs_emit_buffer_cleanup(device->cs, buffer); - } - - return refcount; -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 6edd5e3..40cd85d 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -83,6 +83,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SHADER_CLEANUP, - WINED3D_CS_OP_CREATE_VBO, - WINED3D_CS_OP_RESOURCE_CLEANUP, -+ WINED3D_CS_OP_BUFFER_CLEANUP, - WINED3D_CS_OP_STOP, - }; - -@@ -484,6 +485,12 @@ struct wined3d_cs_resource_cleanup - struct wined3d_resource *resource; - }; - -+struct wined3d_cs_buffer_cleanup -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_buffer *buffer; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2365,6 +2372,26 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_reso - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_buffer_cleanup(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_buffer_cleanup *op = data; -+ -+ wined3d_buffer_cleanup_cs(op->buffer); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) -+{ -+ struct wined3d_cs_buffer_cleanup *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_BUFFER_CLEANUP; -+ op->buffer = buffer; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2426,6 +2453,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, - /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, - /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, -+ /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index f4c269c..76c0708 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2709,6 +2709,7 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader - void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, - struct wined3d_resource *resource) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d -@@ -2799,6 +2800,7 @@ void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT s - void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; - void buffer_create_buffer_object(struct wined3d_buffer *This, - struct wined3d_context *context) DECLSPEC_HIDDEN; -+void wined3d_buffer_cleanup_cs(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - - struct wined3d_rendertarget_view - { --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Create-VBOs-through-the-command-stream.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Create-VBOs-through-the-command-stream.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Create-VBOs-through-the-command-stream.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0137-wined3d-Create-VBOs-through-the-command-stream.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,133 @@ +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. + +A stop-gap solution to make fglrx happier until buffers are updated. +--- + dlls/wined3d/buffer.c | 8 ++------ + dlls/wined3d/cs.c | 32 ++++++++++++++++++++++++++++++++ + dlls/wined3d/wined3d_private.h | 3 +++ + 3 files changed, 37 insertions(+), 6 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +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 + } + + /* Context activation is done by the caller. */ +-static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wined3d_context *context) ++void buffer_create_buffer_object(struct wined3d_buffer *This, struct wined3d_context *context) + { + 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("glBufferData failed with error %s (%#x)\n", debug_glerror(error), error); + goto fail; + } +- if (wined3d_settings.strict_draw_ordering || wined3d_settings.cs_multithreaded) +- gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + + This->buffer_object_usage = gl_usage; + +@@ -933,9 +931,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + * on buffer creation won't work either. */ + if (buffer->flags & WINED3D_BUFFER_CREATEBO) + { +- context = context_acquire(device, NULL); +- buffer_create_buffer_object(buffer, context); +- context_release(context); ++ wined3d_cs_emit_create_vbo(device->cs, buffer); + buffer->flags &= ~WINED3D_BUFFER_CREATEBO; + } + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 21d5b74..c00d1d3 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -81,6 +81,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_VIEW_DESTROY, + WINED3D_CS_OP_VDECL_DESTROY, + WINED3D_CS_OP_SHADER_CLEANUP, ++ WINED3D_CS_OP_CREATE_VBO, + WINED3D_CS_OP_STOP, + }; + +@@ -470,6 +471,12 @@ struct wined3d_cs_shader_cleanup + struct wined3d_shader *shader; + }; + ++struct wined3d_cs_create_vbo ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_buffer *buffer; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2307,6 +2314,30 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_create_vbo(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_create_vbo *op = data; ++ struct wined3d_context *context = context_acquire(cs->device, NULL); ++ ++ buffer_create_buffer_object(op->buffer, context); ++ ++ context_release(context); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) ++{ ++ struct wined3d_cs_create_vbo *op; ++ ++ op = cs->ops->require_space_prio(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_CREATE_VBO; ++ op->buffer = buffer; ++ ++ cs->ops->submit_prio(cs, sizeof(*op)); ++ cs->ops->finish_prio(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2366,6 +2397,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, + /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, + /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, ++ /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 2cdc6e9..63b8ece 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2722,6 +2722,7 @@ void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_renderta + 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; ++void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +@@ -2810,6 +2811,8 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte + const struct wined3d_state *state) DECLSPEC_HIDDEN; + void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT size) DECLSPEC_HIDDEN; + void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; ++void buffer_create_buffer_object(struct wined3d_buffer *This, ++ struct wined3d_context *context) DECLSPEC_HIDDEN; + + struct wined3d_rendertarget_view + { +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-resource-data-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-resource-data-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-resource-data-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-resource-data-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,211 @@ +From 9109cd39e2867e3e9061d1720bde4598111b3d3b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 2 Oct 2013 22:38:51 +0200 +Subject: wined3d: Clean up resource data through the CS. + +--- + dlls/wined3d/buffer.c | 3 +++ + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/resource.c | 15 ++++++++++----- + dlls/wined3d/surface.c | 5 +++++ + dlls/wined3d/texture.c | 4 ++++ + dlls/wined3d/volume.c | 3 +++ + dlls/wined3d/wined3d_private.h | 3 +++ + 7 files changed, 56 insertions(+), 5 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index fc65d3a..d968dcb 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -570,6 +570,9 @@ ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer) + } + + resource_cleanup(&buffer->resource); ++ if (wined3d_settings.cs_multithreaded) ++ buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); ++ + buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent); + HeapFree(GetProcessHeap(), 0, buffer->maps); + HeapFree(GetProcessHeap(), 0, buffer); +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index c00d1d3..6edd5e3 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -82,6 +82,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_VDECL_DESTROY, + WINED3D_CS_OP_SHADER_CLEANUP, + WINED3D_CS_OP_CREATE_VBO, ++ WINED3D_CS_OP_RESOURCE_CLEANUP, + WINED3D_CS_OP_STOP, + }; + +@@ -477,6 +478,12 @@ struct wined3d_cs_create_vbo + struct wined3d_buffer *buffer; + }; + ++struct wined3d_cs_resource_cleanup ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_resource *resource; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2338,6 +2345,26 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu + cs->ops->finish_prio(cs); + } + ++static UINT wined3d_cs_exec_resource_cleanup(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_resource_cleanup *op = data; ++ ++ wined3d_resource_cleanup_cs(op->resource); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_resource *resource) ++{ ++ struct wined3d_cs_resource_cleanup *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_RESOURCE_CLEANUP; ++ op->resource = resource; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2398,6 +2425,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, + /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, + /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, ++ /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index ef0b213..dd21986 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -157,6 +157,15 @@ void wined3d_resource_free_bo(struct wined3d_resource *resource) + context_release(context); + } + ++void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) ++{ ++ if (resource->buffer) ++ wined3d_resource_free_bo(resource); ++ ++ wined3d_resource_free_sysmem(resource); ++ resource->map_heap_memory = NULL; ++} ++ + void resource_cleanup(struct wined3d_resource *resource) + { + const struct wined3d *d3d = resource->device->wined3d; +@@ -169,11 +178,7 @@ void resource_cleanup(struct wined3d_resource *resource) + adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); + } + +- if (resource->buffer) +- wined3d_resource_free_bo(resource); +- +- wined3d_resource_free_sysmem(resource); +- resource->map_heap_memory = NULL; ++ wined3d_cs_emit_resource_cleanup(resource->device->cs, resource); + + device_resource_released(resource->device, resource); + } +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 1d777e2..4a1cf30 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -101,9 +101,12 @@ static void surface_cleanup(struct wined3d_surface *surface) + + void wined3d_surface_destroy(struct wined3d_surface *surface) + { ++ struct wined3d_device *device = surface->resource.device; + TRACE("surface %p.\n", surface); + + surface_cleanup(surface); ++ if (wined3d_settings.cs_multithreaded) ++ device->cs->ops->finish(device->cs); + surface->resource.parent_ops->wined3d_object_destroyed(surface->resource.parent); + HeapFree(GetProcessHeap(), 0, surface); + } +@@ -5321,6 +5324,8 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text + { + ERR("Private setup failed, hr %#x.\n", hr); + surface_cleanup(surface); ++ if (wined3d_settings.cs_multithreaded) ++ surface->resource.device->cs->ops->finish(surface->resource.device->cs); + return hr; + } + +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index ea8589a..f7988e5 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -74,6 +74,8 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc + { + ERR("Failed to allocate sub-resource array.\n"); + resource_cleanup(&texture->resource); ++ if (wined3d_settings.cs_multithreaded) ++ texture->resource.device->cs->ops->finish(texture->resource.device->cs); + return E_OUTOFMEMORY; + } + +@@ -153,6 +155,8 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) + wined3d_texture_unload_gl_texture(texture); + HeapFree(GetProcessHeap(), 0, texture->sub_resources); + resource_cleanup(&texture->resource); ++ if (wined3d_settings.cs_multithreaded) ++ texture->resource.device->cs->ops->finish(texture->resource.device->cs); + } + + void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain) +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index 34b72d1..218118d 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -291,9 +291,12 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * + + void wined3d_volume_destroy(struct wined3d_volume *volume) + { ++ struct wined3d_device *device = volume->resource.device; + TRACE("volume %p.\n", volume); + + resource_cleanup(&volume->resource); ++ if (wined3d_settings.cs_multithreaded) ++ device->cs->ops->finish(device->cs); + volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); + HeapFree(GetProcessHeap(), 0, volume); + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 74e059c..f4c269c 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2163,6 +2163,7 @@ void wined3d_resource_changed(struct wined3d_resource *resource, + struct wined3d_gl_bo *swap_buffer, void *swap_heap_memory) DECLSPEC_HIDDEN; + BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource, + const struct wined3d_box *box) DECLSPEC_HIDDEN; ++void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_free_bo(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; + BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, +@@ -2706,6 +2707,8 @@ 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; + void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, ++ struct wined3d_resource *resource) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-volume-resource-data-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-volume-resource-data-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-volume-resource-data-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-volume-resource-data-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -From baa69b6a987dfdefff4b205f1dabe6e485226256 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 2 Oct 2013 22:54:57 +0200 -Subject: wined3d: Clean up volume resource data through the CS. - ---- - dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/volume.c | 9 ++++++--- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 36 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 40cd85d..9cba57b 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -84,6 +84,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_CREATE_VBO, - WINED3D_CS_OP_RESOURCE_CLEANUP, - WINED3D_CS_OP_BUFFER_CLEANUP, -+ WINED3D_CS_OP_VOLUME_CLEANUP, - WINED3D_CS_OP_STOP, - }; - -@@ -491,6 +492,12 @@ struct wined3d_cs_buffer_cleanup - struct wined3d_buffer *buffer; - }; - -+struct wined3d_cs_volume_cleanup -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_volume *volume; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2392,6 +2399,26 @@ void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_volume_cleanup(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_volume_cleanup *op = data; -+ -+ wined3d_volume_cleanup_cs(op->volume); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) -+{ -+ struct wined3d_cs_volume_cleanup *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_VOLUME_CLEANUP; -+ op->volume = volume; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2454,6 +2481,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, - /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, - /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, -+ /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index a223f43..fb7ec1a 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -296,10 +296,8 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) - TRACE("volume %p.\n", volume); - - resource_cleanup(&volume->resource); -- if (wined3d_settings.cs_multithreaded) -- device->cs->ops->finish(device->cs); - volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); -- HeapFree(GetProcessHeap(), 0, volume); -+ wined3d_cs_emit_volume_cleanup(device->cs, volume); - } - - static void volume_unload(struct wined3d_resource *resource) -@@ -340,6 +338,11 @@ ULONG CDECL wined3d_volume_incref(struct wined3d_volume *volume) - return wined3d_texture_incref(volume->container); - } - -+void wined3d_volume_cleanup_cs(struct wined3d_volume *volume) -+{ -+ HeapFree(GetProcessHeap(), 0, volume); -+} -+ - ULONG CDECL wined3d_volume_decref(struct wined3d_volume *volume) - { - TRACE("Forwarding to container %p.\n", volume->container); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ffcdcb4..8537000 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2358,6 +2358,7 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * - BOOL srgb_mode) DECLSPEC_HIDDEN; - void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, - const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; -+void wined3d_volume_cleanup_cs(struct wined3d_volume *volume) DECLSPEC_HIDDEN; - - struct wined3d_surface_dib - { -@@ -2728,6 +2729,7 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu - void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, - struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -1.9.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,156 @@ +From 6462e66d6d2229b1755e7689e2b01eee97696676 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 2 Oct 2013 22:50:08 +0200 +Subject: wined3d: Clean up buffer resource data through the CS. + +--- + dlls/wined3d/buffer.c | 39 ++++++++++++++++++++------------------- + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 50 insertions(+), 19 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index d968dcb..15ed760 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -545,37 +545,38 @@ static void buffer_unload(struct wined3d_resource *resource) + resource_unload(resource); + } + ++void wined3d_buffer_cleanup_cs(struct wined3d_buffer *buffer) ++{ ++ struct wined3d_context *context; ++ struct wined3d_device *device = buffer->resource.device; ++ ++ if (buffer->buffer_object) ++ { ++ context = context_acquire(device, NULL); ++ delete_gl_buffer(buffer, context->gl_info); ++ context_release(context); ++ ++ HeapFree(GetProcessHeap(), 0, buffer->conversion_map); ++ } ++ ++ HeapFree(GetProcessHeap(), 0, buffer->maps); ++ HeapFree(GetProcessHeap(), 0, buffer); ++} ++ + ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer) + { + ULONG refcount = InterlockedDecrement(&buffer->resource.ref); +- struct wined3d_context *context; + + TRACE("%p decreasing refcount to %u.\n", buffer, refcount); + + if (!refcount) + { +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); +- } +- +- if (buffer->buffer_object) +- { +- context = context_acquire(buffer->resource.device, NULL); +- delete_gl_buffer(buffer, context->gl_info); +- context_release(context); +- +- HeapFree(GetProcessHeap(), 0, buffer->conversion_map); +- } ++ struct wined3d_device *device = buffer->resource.device; + + resource_cleanup(&buffer->resource); +- if (wined3d_settings.cs_multithreaded) +- buffer->resource.device->cs->ops->finish(buffer->resource.device->cs); + + buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent); +- HeapFree(GetProcessHeap(), 0, buffer->maps); +- HeapFree(GetProcessHeap(), 0, buffer); ++ wined3d_cs_emit_buffer_cleanup(device->cs, buffer); + } + + return refcount; +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 6edd5e3..40cd85d 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -83,6 +83,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_SHADER_CLEANUP, + WINED3D_CS_OP_CREATE_VBO, + WINED3D_CS_OP_RESOURCE_CLEANUP, ++ WINED3D_CS_OP_BUFFER_CLEANUP, + WINED3D_CS_OP_STOP, + }; + +@@ -484,6 +485,12 @@ struct wined3d_cs_resource_cleanup + struct wined3d_resource *resource; + }; + ++struct wined3d_cs_buffer_cleanup ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_buffer *buffer; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2365,6 +2372,26 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_reso + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_buffer_cleanup(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_buffer_cleanup *op = data; ++ ++ wined3d_buffer_cleanup_cs(op->buffer); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) ++{ ++ struct wined3d_cs_buffer_cleanup *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_BUFFER_CLEANUP; ++ op->buffer = buffer; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2426,6 +2453,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, + /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, + /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, ++ /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index f4c269c..76c0708 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2709,6 +2709,7 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader + void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, + struct wined3d_resource *resource) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +@@ -2799,6 +2800,7 @@ void buffer_invalidate_bo_range(struct wined3d_buffer *This, UINT offset, UINT s + void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN; + void buffer_create_buffer_object(struct wined3d_buffer *This, + struct wined3d_context *context) DECLSPEC_HIDDEN; ++void wined3d_buffer_cleanup_cs(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + + struct wined3d_rendertarget_view + { +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,178 +0,0 @@ -From 91a76b0dd0c52b3745dd0ecd1dfc79acad7ccba7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 6 Oct 2013 16:12:24 +0200 -Subject: wined3d: Clean up surfaces through the cs. - ---- - dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/surface.c | 37 ++++++++++++++++--------------------- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 46 insertions(+), 21 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 9cba57b..7675214 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -85,6 +85,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_RESOURCE_CLEANUP, - WINED3D_CS_OP_BUFFER_CLEANUP, - WINED3D_CS_OP_VOLUME_CLEANUP, -+ WINED3D_CS_OP_SURFACE_CLEANUP, - WINED3D_CS_OP_STOP, - }; - -@@ -498,6 +499,12 @@ struct wined3d_cs_volume_cleanup - struct wined3d_volume *volume; - }; - -+struct wined3d_cs_surface_cleanup -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_surface *surface; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2419,6 +2426,26 @@ void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_surface_cleanup(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_surface_cleanup *op = data; -+ -+ wined3d_surface_cleanup_cs(op->surface); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) -+{ -+ struct wined3d_cs_surface_cleanup *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SURFACE_CLEANUP; -+ op->surface = surface; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2482,6 +2509,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, - /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, - /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, -+ /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index ac5f6bb..fcd7d63 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -36,20 +36,10 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); - - #define MAXLOCKCOUNT 50 /* After this amount of locks do not free the sysmem copy. */ - --static void surface_cleanup(struct wined3d_surface *surface) --{ -- struct wined3d_surface *overlay, *cur; -- -- TRACE("surface %p.\n", surface); -- -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- surface->resource.device->cs->ops->finish(surface->resource.device->cs); -- } - -- if (surface->resource.buffer || surface->rb_multisample -- || surface->rb_resolved || !list_empty(&surface->renderbuffers)) -+void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) -+{ -+ if (surface->rb_multisample || surface->rb_resolved || !list_empty(&surface->renderbuffers)) - { - struct wined3d_renderbuffer_entry *entry, *entry2; - const struct wined3d_gl_info *gl_info; -@@ -87,6 +77,16 @@ static void surface_cleanup(struct wined3d_surface *surface) - surface->resource.bitmap_data = NULL; - } - -+ TRACE("Destroyed surface %p.\n", surface); -+ HeapFree(GetProcessHeap(), 0, surface); -+} -+ -+static void surface_cleanup(struct wined3d_surface *surface) -+{ -+ struct wined3d_surface *overlay, *cur; -+ -+ TRACE("surface %p.\n", surface); -+ - if (surface->overlay_dest) - list_remove(&surface->overlay_entry); - -@@ -97,18 +97,15 @@ static void surface_cleanup(struct wined3d_surface *surface) - } - - resource_cleanup(&surface->resource); -+ wined3d_cs_emit_surface_cleanup(surface->resource.device->cs, surface); - } - - void wined3d_surface_destroy(struct wined3d_surface *surface) - { -- struct wined3d_device *device = surface->resource.device; - TRACE("surface %p.\n", surface); - -- surface_cleanup(surface); -- if (wined3d_settings.cs_multithreaded) -- device->cs->ops->finish(device->cs); - surface->resource.parent_ops->wined3d_object_destroyed(surface->resource.parent); -- HeapFree(GetProcessHeap(), 0, surface); -+ surface_cleanup(surface); - } - - void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, -@@ -5479,8 +5476,6 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text - { - ERR("Private setup failed, hr %#x.\n", hr); - surface_cleanup(surface); -- if (wined3d_settings.cs_multithreaded) -- surface->resource.device->cs->ops->finish(surface->resource.device->cs); - return hr; - } - -@@ -5523,7 +5518,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w - if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) - { - WARN("Failed to initialize surface, returning %#x.\n", hr); -- HeapFree(GetProcessHeap(), 0, object); -+ /* The command stream takes care of freeing the memory. */ - return hr; - } - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index d201a5c..c28554f 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2472,6 +2472,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ - struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, - const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; - BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; -+void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; - - void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, - const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -@@ -2729,6 +2730,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, - struct wined3d_resource *resource) DECLSPEC_HIDDEN; - void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-texture-resources-through-the-cs.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-texture-resources-through-the-cs.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-texture-resources-through-the-cs.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-texture-resources-through-the-cs.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,284 +0,0 @@ -From 4ce0b7d84cd9b320205d4b1626f3486b73e95c03 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 6 Oct 2013 16:20:32 +0200 -Subject: wined3d: Clean up texture resources through the cs. - ---- - dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ - dlls/wined3d/texture.c | 38 ++++++++++++++++++++++++++++++-------- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 60 insertions(+), 8 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 997c7d8..f7ede92 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -87,6 +87,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_BUFFER_CLEANUP, - WINED3D_CS_OP_VOLUME_CLEANUP, - WINED3D_CS_OP_SURFACE_CLEANUP, -+ WINED3D_CS_OP_TEXTURE_CLEANUP, - WINED3D_CS_OP_STOP, - }; - -@@ -515,6 +516,12 @@ struct wined3d_cs_surface_cleanup - struct wined3d_surface *surface; - }; - -+struct wined3d_cs_texture_cleanup -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_texture *texture; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2559,6 +2566,26 @@ void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surfa - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_texture_cleanup(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_texture_cleanup *op = data; -+ -+ wined3d_texture_cleanup_cs(op->texture); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) -+{ -+ struct wined3d_cs_texture_cleanup *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_TEXTURE_CLEANUP; -+ op->texture = texture; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2624,6 +2651,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, - /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, - /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, -+ /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index c94dc5b..63e0668 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -114,17 +114,26 @@ static void wined3d_texture_unload_gl_texture(struct wined3d_texture *texture) - resource_unload(&texture->resource); - } - -+void wined3d_texture_cleanup_cs(struct wined3d_texture *texture) -+{ -+ wined3d_texture_unload_gl_texture(texture); -+ HeapFree(GetProcessHeap(), 0, texture->sub_resources); -+ HeapFree(GetProcessHeap(), 0, texture); -+} -+ - static void wined3d_texture_cleanup(struct wined3d_texture *texture) - { - UINT sub_count = texture->level_count * texture->layer_count; - UINT i; -+ struct wined3d_device *device = texture->resource.device; - - TRACE("texture %p.\n", texture); - -+ /* Because sub_resource_cleanup interferes with GL resources */ - if (wined3d_settings.cs_multithreaded) - { - FIXME("Waiting for cs.\n"); -- texture->resource.device->cs->ops->finish(texture->resource.device->cs); -+ device->cs->ops->finish(device->cs); - } - - for (i = 0; i < sub_count; ++i) -@@ -135,11 +144,8 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) - texture->texture_ops->texture_sub_resource_cleanup(sub_resource); - } - -- wined3d_texture_unload_gl_texture(texture); -- HeapFree(GetProcessHeap(), 0, texture->sub_resources); - resource_cleanup(&texture->resource); -- if (wined3d_settings.cs_multithreaded) -- texture->resource.device->cs->ops->finish(texture->resource.device->cs); -+ wined3d_cs_emit_texture_cleanup(device->cs, texture); - } - - void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain) -@@ -419,9 +425,10 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture) - - if (!refcount) - { -+ void *parent = texture->resource.parent; -+ const struct wined3d_parent_ops *parent_ops = texture->resource.parent_ops; - wined3d_texture_cleanup(texture); -- texture->resource.parent_ops->wined3d_object_destroyed(texture->resource.parent); -- HeapFree(GetProcessHeap(), 0, texture); -+ parent_ops->wined3d_object_destroyed(parent); - } - - return refcount; -@@ -1003,6 +1010,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi - if (WINED3DFMT_UNKNOWN >= desc->format) - { - WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - -@@ -1012,12 +1020,14 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi - if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) - { - WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - - if (levels != 1) - { - WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - } -@@ -1038,6 +1048,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi - else - { - WARN("Attempted to create a NPOT cube texture (edge length %u) without GL support.\n", desc->width); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - } -@@ -1047,6 +1058,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi - surface_flags, device, parent, parent_ops, &texture_resource_ops))) - { - WARN("Failed to initialize texture, returning %#x\n", hr); -+ HeapFree(GetProcessHeap(), 0, texture); - return hr; - } - -@@ -1109,6 +1121,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 - if (WINED3DFMT_UNKNOWN >= desc->format) - { - WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - -@@ -1139,6 +1152,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 - else - { - WARN("Attempted to create a mipmapped NPOT texture without unconditional NPOT support.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - } -@@ -1151,12 +1165,14 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 - if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) - { - WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - - if (levels != 1) - { - WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - } -@@ -1165,6 +1181,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 - surface_flags, device, parent, parent_ops, &texture_resource_ops))) - { - WARN("Failed to initialize texture, returning %#x.\n", hr); -+ HeapFree(GetProcessHeap(), 0, texture); - return hr; - } - -@@ -1337,12 +1354,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct - if (WINED3DFMT_UNKNOWN >= desc->format) - { - WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - - if (!gl_info->supported[EXT_TEXTURE3D]) - { - WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - -@@ -1352,12 +1371,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct - if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) - { - WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - - if (levels != 1) - { - WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - } -@@ -1385,6 +1406,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct - { - WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n", - desc->width, desc->height, desc->depth); -+ HeapFree(GetProcessHeap(), 0, texture); - return WINED3DERR_INVALIDCALL; - } - } -@@ -1394,6 +1416,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct - 0, device, parent, parent_ops, &texture_resource_ops))) - { - WARN("Failed to initialize texture, returning %#x.\n", hr); -+ HeapFree(GetProcessHeap(), 0, texture); - return hr; - } - -@@ -1470,7 +1493,6 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct - if (FAILED(hr)) - { - WARN("Failed to initialize texture, returning %#x.\n", hr); -- HeapFree(GetProcessHeap(), 0, object); - return hr; - } - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index b40d7d3..a0e9871 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2343,6 +2343,7 @@ static inline struct gl_texture *wined3d_texture_get_gl_texture(struct wined3d_t - - void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture, - const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; -+void wined3d_texture_cleanup_cs(struct wined3d_texture *texture) DECLSPEC_HIDDEN; - void wined3d_texture_bind(struct wined3d_texture *texture, - struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; - void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, -@@ -2772,6 +2773,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, - void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; - void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-volume-resource-data-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-volume-resource-data-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-volume-resource-data-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-volume-resource-data-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,122 @@ +From baa69b6a987dfdefff4b205f1dabe6e485226256 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 2 Oct 2013 22:54:57 +0200 +Subject: wined3d: Clean up volume resource data through the CS. + +--- + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/volume.c | 9 ++++++--- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 36 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 40cd85d..9cba57b 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -84,6 +84,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_CREATE_VBO, + WINED3D_CS_OP_RESOURCE_CLEANUP, + WINED3D_CS_OP_BUFFER_CLEANUP, ++ WINED3D_CS_OP_VOLUME_CLEANUP, + WINED3D_CS_OP_STOP, + }; + +@@ -491,6 +492,12 @@ struct wined3d_cs_buffer_cleanup + struct wined3d_buffer *buffer; + }; + ++struct wined3d_cs_volume_cleanup ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_volume *volume; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2392,6 +2399,26 @@ void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_volume_cleanup(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_volume_cleanup *op = data; ++ ++ wined3d_volume_cleanup_cs(op->volume); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) ++{ ++ struct wined3d_cs_volume_cleanup *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_VOLUME_CLEANUP; ++ op->volume = volume; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2454,6 +2481,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, + /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, + /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, ++ /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +index a223f43..fb7ec1a 100644 +--- a/dlls/wined3d/volume.c ++++ b/dlls/wined3d/volume.c +@@ -296,10 +296,8 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) + TRACE("volume %p.\n", volume); + + resource_cleanup(&volume->resource); +- if (wined3d_settings.cs_multithreaded) +- device->cs->ops->finish(device->cs); + volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); +- HeapFree(GetProcessHeap(), 0, volume); ++ wined3d_cs_emit_volume_cleanup(device->cs, volume); + } + + static void volume_unload(struct wined3d_resource *resource) +@@ -340,6 +338,11 @@ ULONG CDECL wined3d_volume_incref(struct wined3d_volume *volume) + return wined3d_texture_incref(volume->container); + } + ++void wined3d_volume_cleanup_cs(struct wined3d_volume *volume) ++{ ++ HeapFree(GetProcessHeap(), 0, volume); ++} ++ + ULONG CDECL wined3d_volume_decref(struct wined3d_volume *volume) + { + TRACE("Forwarding to container %p.\n", volume->container); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index ffcdcb4..8537000 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2358,6 +2358,7 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * + BOOL srgb_mode) DECLSPEC_HIDDEN; + void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, + const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; ++void wined3d_volume_cleanup_cs(struct wined3d_volume *volume) DECLSPEC_HIDDEN; + + struct wined3d_surface_dib + { +@@ -2728,6 +2729,7 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu + void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, + struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +1.9.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Clean-up-surfaces-through-the-cs.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Clean-up-surfaces-through-the-cs.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Clean-up-surfaces-through-the-cs.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Clean-up-surfaces-through-the-cs.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,178 @@ +From 91a76b0dd0c52b3745dd0ecd1dfc79acad7ccba7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 6 Oct 2013 16:12:24 +0200 +Subject: wined3d: Clean up surfaces through the cs. + +--- + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/surface.c | 37 ++++++++++++++++--------------------- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 46 insertions(+), 21 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 9cba57b..7675214 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -85,6 +85,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_RESOURCE_CLEANUP, + WINED3D_CS_OP_BUFFER_CLEANUP, + WINED3D_CS_OP_VOLUME_CLEANUP, ++ WINED3D_CS_OP_SURFACE_CLEANUP, + WINED3D_CS_OP_STOP, + }; + +@@ -498,6 +499,12 @@ struct wined3d_cs_volume_cleanup + struct wined3d_volume *volume; + }; + ++struct wined3d_cs_surface_cleanup ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_surface *surface; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2419,6 +2426,26 @@ void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_surface_cleanup(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_surface_cleanup *op = data; ++ ++ wined3d_surface_cleanup_cs(op->surface); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) ++{ ++ struct wined3d_cs_surface_cleanup *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_SURFACE_CLEANUP; ++ op->surface = surface; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2482,6 +2509,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, + /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, + /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, ++ /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index ac5f6bb..fcd7d63 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -36,20 +36,10 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); + + #define MAXLOCKCOUNT 50 /* After this amount of locks do not free the sysmem copy. */ + +-static void surface_cleanup(struct wined3d_surface *surface) +-{ +- struct wined3d_surface *overlay, *cur; +- +- TRACE("surface %p.\n", surface); +- +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- surface->resource.device->cs->ops->finish(surface->resource.device->cs); +- } + +- if (surface->resource.buffer || surface->rb_multisample +- || surface->rb_resolved || !list_empty(&surface->renderbuffers)) ++void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) ++{ ++ if (surface->rb_multisample || surface->rb_resolved || !list_empty(&surface->renderbuffers)) + { + struct wined3d_renderbuffer_entry *entry, *entry2; + const struct wined3d_gl_info *gl_info; +@@ -87,6 +77,16 @@ static void surface_cleanup(struct wined3d_surface *surface) + surface->resource.bitmap_data = NULL; + } + ++ TRACE("Destroyed surface %p.\n", surface); ++ HeapFree(GetProcessHeap(), 0, surface); ++} ++ ++static void surface_cleanup(struct wined3d_surface *surface) ++{ ++ struct wined3d_surface *overlay, *cur; ++ ++ TRACE("surface %p.\n", surface); ++ + if (surface->overlay_dest) + list_remove(&surface->overlay_entry); + +@@ -97,18 +97,15 @@ static void surface_cleanup(struct wined3d_surface *surface) + } + + resource_cleanup(&surface->resource); ++ wined3d_cs_emit_surface_cleanup(surface->resource.device->cs, surface); + } + + void wined3d_surface_destroy(struct wined3d_surface *surface) + { +- struct wined3d_device *device = surface->resource.device; + TRACE("surface %p.\n", surface); + +- surface_cleanup(surface); +- if (wined3d_settings.cs_multithreaded) +- device->cs->ops->finish(device->cs); + surface->resource.parent_ops->wined3d_object_destroyed(surface->resource.parent); +- HeapFree(GetProcessHeap(), 0, surface); ++ surface_cleanup(surface); + } + + void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, +@@ -5479,8 +5476,6 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text + { + ERR("Private setup failed, hr %#x.\n", hr); + surface_cleanup(surface); +- if (wined3d_settings.cs_multithreaded) +- surface->resource.device->cs->ops->finish(surface->resource.device->cs); + return hr; + } + +@@ -5523,7 +5518,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w + if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) + { + WARN("Failed to initialize surface, returning %#x.\n", hr); +- HeapFree(GetProcessHeap(), 0, object); ++ /* The command stream takes care of freeing the memory. */ + return hr; + } + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index d201a5c..c28554f 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2472,6 +2472,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ + struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, + const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; + BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; ++void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; + + void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, + const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +@@ -2729,6 +2730,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, + struct wined3d_resource *resource) DECLSPEC_HIDDEN; + void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0141-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From a0e7463e86758e478993d59c339f590283e3532b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 2 Oct 2013 23:28:56 +0200 -Subject: wined3d: Unload resources through the CS in uninit_3d. - ---- - dlls/wined3d/device.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index e0e2c82..1d7d733 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -1066,9 +1066,10 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) - { - TRACE("Unloading resource %p.\n", resource); -- -- resource->resource_ops->resource_unload(resource); -+ wined3d_cs_emit_evict_resource(device->cs, resource); - } -+ if (wined3d_settings.cs_multithreaded) -+ device->cs->ops->finish(device->cs); - - wine_rb_clear(&device->samplers, device_free_sampler, NULL); - --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Clean-up-texture-resources-through-the-cs.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Clean-up-texture-resources-through-the-cs.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Clean-up-texture-resources-through-the-cs.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Clean-up-texture-resources-through-the-cs.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,284 @@ +From 4ce0b7d84cd9b320205d4b1626f3486b73e95c03 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 6 Oct 2013 16:20:32 +0200 +Subject: wined3d: Clean up texture resources through the cs. + +--- + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/texture.c | 38 ++++++++++++++++++++++++++++++-------- + dlls/wined3d/wined3d_private.h | 2 ++ + 3 files changed, 60 insertions(+), 8 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 997c7d8..f7ede92 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -87,6 +87,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_BUFFER_CLEANUP, + WINED3D_CS_OP_VOLUME_CLEANUP, + WINED3D_CS_OP_SURFACE_CLEANUP, ++ WINED3D_CS_OP_TEXTURE_CLEANUP, + WINED3D_CS_OP_STOP, + }; + +@@ -515,6 +516,12 @@ struct wined3d_cs_surface_cleanup + struct wined3d_surface *surface; + }; + ++struct wined3d_cs_texture_cleanup ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_texture *texture; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2559,6 +2566,26 @@ void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surfa + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_texture_cleanup(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_texture_cleanup *op = data; ++ ++ wined3d_texture_cleanup_cs(op->texture); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) ++{ ++ struct wined3d_cs_texture_cleanup *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_TEXTURE_CLEANUP; ++ op->texture = texture; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2624,6 +2651,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, + /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, + /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, ++ /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index c94dc5b..63e0668 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -114,17 +114,26 @@ static void wined3d_texture_unload_gl_texture(struct wined3d_texture *texture) + resource_unload(&texture->resource); + } + ++void wined3d_texture_cleanup_cs(struct wined3d_texture *texture) ++{ ++ wined3d_texture_unload_gl_texture(texture); ++ HeapFree(GetProcessHeap(), 0, texture->sub_resources); ++ HeapFree(GetProcessHeap(), 0, texture); ++} ++ + static void wined3d_texture_cleanup(struct wined3d_texture *texture) + { + UINT sub_count = texture->level_count * texture->layer_count; + UINT i; ++ struct wined3d_device *device = texture->resource.device; + + TRACE("texture %p.\n", texture); + ++ /* Because sub_resource_cleanup interferes with GL resources */ + if (wined3d_settings.cs_multithreaded) + { + FIXME("Waiting for cs.\n"); +- texture->resource.device->cs->ops->finish(texture->resource.device->cs); ++ device->cs->ops->finish(device->cs); + } + + for (i = 0; i < sub_count; ++i) +@@ -135,11 +144,8 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) + texture->texture_ops->texture_sub_resource_cleanup(sub_resource); + } + +- wined3d_texture_unload_gl_texture(texture); +- HeapFree(GetProcessHeap(), 0, texture->sub_resources); + resource_cleanup(&texture->resource); +- if (wined3d_settings.cs_multithreaded) +- texture->resource.device->cs->ops->finish(texture->resource.device->cs); ++ wined3d_cs_emit_texture_cleanup(device->cs, texture); + } + + void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain) +@@ -419,9 +425,10 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture) + + if (!refcount) + { ++ void *parent = texture->resource.parent; ++ const struct wined3d_parent_ops *parent_ops = texture->resource.parent_ops; + wined3d_texture_cleanup(texture); +- texture->resource.parent_ops->wined3d_object_destroyed(texture->resource.parent); +- HeapFree(GetProcessHeap(), 0, texture); ++ parent_ops->wined3d_object_destroyed(parent); + } + + return refcount; +@@ -1003,6 +1010,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi + if (WINED3DFMT_UNKNOWN >= desc->format) + { + WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + +@@ -1012,12 +1020,14 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi + if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) + { + WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + + if (levels != 1) + { + WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + } +@@ -1038,6 +1048,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi + else + { + WARN("Attempted to create a NPOT cube texture (edge length %u) without GL support.\n", desc->width); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + } +@@ -1047,6 +1058,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi + surface_flags, device, parent, parent_ops, &texture_resource_ops))) + { + WARN("Failed to initialize texture, returning %#x\n", hr); ++ HeapFree(GetProcessHeap(), 0, texture); + return hr; + } + +@@ -1109,6 +1121,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 + if (WINED3DFMT_UNKNOWN >= desc->format) + { + WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + +@@ -1139,6 +1152,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 + else + { + WARN("Attempted to create a mipmapped NPOT texture without unconditional NPOT support.\n"); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + } +@@ -1151,12 +1165,14 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 + if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) + { + WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n"); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + + if (levels != 1) + { + WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + } +@@ -1165,6 +1181,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 + surface_flags, device, parent, parent_ops, &texture_resource_ops))) + { + WARN("Failed to initialize texture, returning %#x.\n", hr); ++ HeapFree(GetProcessHeap(), 0, texture); + return hr; + } + +@@ -1337,12 +1354,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct + if (WINED3DFMT_UNKNOWN >= desc->format) + { + WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + + if (!gl_info->supported[EXT_TEXTURE3D]) + { + WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + +@@ -1352,12 +1371,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct + if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) + { + WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + + if (levels != 1) + { + WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + } +@@ -1385,6 +1406,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct + { + WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n", + desc->width, desc->height, desc->depth); ++ HeapFree(GetProcessHeap(), 0, texture); + return WINED3DERR_INVALIDCALL; + } + } +@@ -1394,6 +1416,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct + 0, device, parent, parent_ops, &texture_resource_ops))) + { + WARN("Failed to initialize texture, returning %#x.\n", hr); ++ HeapFree(GetProcessHeap(), 0, texture); + return hr; + } + +@@ -1470,7 +1493,6 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct + if (FAILED(hr)) + { + WARN("Failed to initialize texture, returning %#x.\n", hr); +- HeapFree(GetProcessHeap(), 0, object); + return hr; + } + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index b40d7d3..a0e9871 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2343,6 +2343,7 @@ static inline struct gl_texture *wined3d_texture_get_gl_texture(struct wined3d_t + + void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture, + const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; ++void wined3d_texture_cleanup_cs(struct wined3d_texture *texture) DECLSPEC_HIDDEN; + void wined3d_texture_bind(struct wined3d_texture *texture, + struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; + void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, +@@ -2772,6 +2773,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, + void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; + void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; + void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Unload-resources-through-the-CS-in-device_re.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Unload-resources-through-the-CS-in-device_re.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Unload-resources-through-the-CS-in-device_re.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0142-wined3d-Unload-resources-through-the-CS-in-device_re.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -From d2b010c4c1c08d71ed6e2e4257db236535c20deb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 2 Oct 2013 23:40:20 +0200 -Subject: wined3d: Unload resources through the CS in device_reset. - ---- - dlls/wined3d/device.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 28819af..2410547 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4228,21 +4228,23 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d - struct wined3d_context *context; - struct wined3d_shader *shader; - -- context = context_acquire(device, NULL); -- gl_info = context->gl_info; -- - LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) - { - TRACE("Unloading resource %p.\n", resource); - -- resource->resource_ops->resource_unload(resource); -+ wined3d_cs_emit_evict_resource(device->cs, resource); - } -+ if (wined3d_settings.cs_multithreaded) -+ device->cs->ops->finish(device->cs); - - LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry) - { - device->shader_backend->shader_destroy(shader); - } - -+ context = context_acquire(device, NULL); -+ gl_info = context->gl_info; -+ - if (device->depth_blt_texture) - { - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -From 81f901210e683ac2a2193957849497031f424545 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 3 Oct 2013 17:39:08 +0200 -Subject: wined3d: Don't glFinish after a depth buffer blit. - ---- - dlls/wined3d/surface.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 4d8bd1c..3c5489f 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -694,9 +694,7 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, - dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, gl_mask, GL_NEAREST); - checkGLcall("glBlitFramebuffer()"); - -- if (wined3d_settings.cs_multithreaded) -- gl_info->gl_ops.gl.p_glFinish(); -- else if (wined3d_settings.strict_draw_ordering) -+ if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - - context_release(context); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0143-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,29 @@ +From a0e7463e86758e478993d59c339f590283e3532b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 2 Oct 2013 23:28:56 +0200 +Subject: wined3d: Unload resources through the CS in uninit_3d. + +--- + dlls/wined3d/device.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index e0e2c82..1d7d733 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -1066,9 +1066,10 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) + { + TRACE("Unloading resource %p.\n", resource); +- +- resource->resource_ops->resource_unload(resource); ++ wined3d_cs_emit_evict_resource(device->cs, resource); + } ++ if (wined3d_settings.cs_multithreaded) ++ device->cs->ops->finish(device->cs); + + wine_rb_clear(&device->samplers, device_free_sampler, NULL); + +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-wined3d-Remove-software-cursor-support.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-wined3d-Remove-software-cursor-support.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-wined3d-Remove-software-cursor-support.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-wined3d-Remove-software-cursor-support.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,173 +0,0 @@ -From 79899d02dd509deb98dfeee88f8325422fdd6937 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 3 Oct 2013 19:23:24 +0200 -Subject: wined3d: Remove software cursor support. - -This has been broken since quite some time and only serves to crash fglrx by acquiring a context -in the main thread. - -FIXME: Make sure wined3d_device_show_cursor returns the correct value if a software cursor is set. ---- - dlls/wined3d/device.c | 66 ++---------------------------------------- - dlls/wined3d/swapchain.c | 21 -------------- - dlls/wined3d/wined3d_private.h | 1 - - 3 files changed, 2 insertions(+), 86 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index a112027..746be2b 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -1023,8 +1023,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - - if (device->logo_texture) - wined3d_texture_decref(device->logo_texture); -- if (device->cursor_texture) -- wined3d_texture_decref(device->cursor_texture); - - /* Release the buffers (with sanity checks). - * FIXME: Move this move into a separate patch. I think the idea -@@ -3984,60 +3982,12 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, - wined3d_rendertarget_view_decref(prev); - } - --static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined3d_device *device, -- struct wined3d_surface *cursor_image) --{ -- struct wined3d_sub_resource_data data; -- struct wined3d_resource_desc desc; -- struct wined3d_map_desc map_desc; -- struct wined3d_texture *texture; -- HRESULT hr; -- -- if (FAILED(wined3d_surface_map(cursor_image, &map_desc, NULL, WINED3D_MAP_READONLY))) -- { -- ERR("Failed to map source surface.\n"); -- return NULL; -- } -- -- data.data = map_desc.data; -- data.row_pitch = map_desc.row_pitch; -- data.slice_pitch = map_desc.slice_pitch; -- -- desc.resource_type = WINED3D_RTYPE_TEXTURE; -- desc.format = WINED3DFMT_B8G8R8A8_UNORM; -- desc.multisample_type = WINED3D_MULTISAMPLE_NONE; -- desc.multisample_quality = 0; -- desc.usage = WINED3DUSAGE_DYNAMIC; -- desc.pool = WINED3D_POOL_DEFAULT; -- desc.width = cursor_image->resource.width; -- desc.height = cursor_image->resource.height; -- desc.depth = 1; -- desc.size = 0; -- -- hr = wined3d_texture_create(device, &desc, 1, WINED3D_SURFACE_MAPPABLE, -- &data, NULL, &wined3d_null_parent_ops, &texture); -- wined3d_surface_unmap(cursor_image); -- if (FAILED(hr)) -- { -- ERR("Failed to create cursor texture.\n"); -- return NULL; -- } -- -- return texture; --} -- - HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device, - UINT x_hotspot, UINT y_hotspot, struct wined3d_surface *cursor_image) - { - TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n", - device, x_hotspot, y_hotspot, cursor_image); - -- if (device->cursor_texture) -- { -- wined3d_texture_decref(device->cursor_texture); -- device->cursor_texture = NULL; -- } -- - if (cursor_image) - { - struct wined3d_display_mode mode; -@@ -4072,11 +4022,8 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device - * release it after setting the cursor image. Windows doesn't - * addref the set surface, so we can't do this either without - * creating circular refcount dependencies. */ -- if (!(device->cursor_texture = wined3d_device_create_cursor_texture(device, cursor_image))) -- { -- ERR("Failed to create cursor texture.\n"); -- return WINED3DERR_INVALIDCALL; -- } -+ device->cursorWidth = cursor_image->resource.width; -+ device->cursorHeight = cursor_image->resource.height; - - device->cursorWidth = cursor_image->resource.width; - device->cursorHeight = cursor_image->resource.height; -@@ -4176,10 +4123,6 @@ BOOL CDECL wined3d_device_show_cursor(struct wined3d_device *device, BOOL show) - else - SetCursor(NULL); - } -- else if (device->cursor_texture) -- { -- device->bCursorVisible = show; -- } - - return oldVisible; - } -@@ -4336,11 +4279,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - wined3d_texture_decref(device->logo_texture); - device->logo_texture = NULL; - } -- if (device->cursor_texture) -- { -- wined3d_texture_decref(device->cursor_texture); -- device->cursor_texture = NULL; -- } - } - - if (device->state.fb.render_targets) -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 1ccd18b..dbfc0d6 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -454,27 +454,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT - NULL, WINED3D_TEXF_POINT); - } - -- if (swapchain->device->bCursorVisible && swapchain->device->cursor_texture -- && !swapchain->device->hardwareCursor) -- { -- struct wined3d_surface *cursor = surface_from_resource( -- wined3d_texture_get_sub_resource(swapchain->device->cursor_texture, 0)); -- RECT destRect = -- { -- swapchain->device->xScreenSpace - swapchain->device->xHotSpot, -- swapchain->device->yScreenSpace - swapchain->device->yHotSpot, -- swapchain->device->xScreenSpace + swapchain->device->cursorWidth - swapchain->device->xHotSpot, -- swapchain->device->yScreenSpace + swapchain->device->cursorHeight - swapchain->device->yHotSpot, -- }; -- -- TRACE("Rendering the software cursor.\n"); -- -- if (swapchain->desc.windowed) -- MapWindowPoints(NULL, swapchain->win_handle, (POINT *)&destRect, 2); -- wined3d_surface_blt(back_buffer, &destRect, cursor, NULL, WINEDDBLT_ALPHATEST, -- NULL, WINED3D_TEXF_POINT); -- } -- - TRACE("Presenting HDC %p.\n", context->hdc); - - render_to_fbo = swapchain->render_to_fbo; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 2f5fbf3..84343c6 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2048,7 +2048,6 @@ struct wined3d_device - UINT xScreenSpace; - UINT yScreenSpace; - UINT cursorWidth, cursorHeight; -- struct wined3d_texture *cursor_texture; - HCURSOR hardwareCursor; - - /* The Wine logo texture */ --- -1.9.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-wined3d-Unload-resources-through-the-CS-in-device_re.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-wined3d-Unload-resources-through-the-CS-in-device_re.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-wined3d-Unload-resources-through-the-CS-in-device_re.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0144-wined3d-Unload-resources-through-the-CS-in-device_re.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,44 @@ +From d2b010c4c1c08d71ed6e2e4257db236535c20deb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 2 Oct 2013 23:40:20 +0200 +Subject: wined3d: Unload resources through the CS in device_reset. + +--- + dlls/wined3d/device.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 28819af..2410547 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4228,21 +4228,23 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d + struct wined3d_context *context; + struct wined3d_shader *shader; + +- context = context_acquire(device, NULL); +- gl_info = context->gl_info; +- + LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) + { + TRACE("Unloading resource %p.\n", resource); + +- resource->resource_ops->resource_unload(resource); ++ wined3d_cs_emit_evict_resource(device->cs, resource); + } ++ if (wined3d_settings.cs_multithreaded) ++ device->cs->ops->finish(device->cs); + + LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry) + { + device->shader_backend->shader_destroy(shader); + } + ++ context = context_acquire(device, NULL); ++ gl_info = context->gl_info; ++ + if (device->depth_blt_texture) + { + gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-wined3d-Create-dummy-textures-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-wined3d-Create-dummy-textures-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-wined3d-Create-dummy-textures-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-wined3d-Create-dummy-textures-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,157 +0,0 @@ -From c91b5281332e1879e25088efeee24bc1a337ca30 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 10 Oct 2013 16:29:42 +0200 -Subject: wined3d: Create dummy textures through the CS. - -Hacky version. Just good enough to see if the double context during init is what makes fglrx -crash. ---- - dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ - dlls/wined3d/device.c | 13 ++++--------- - dlls/wined3d/wined3d_private.h | 3 ++- - 3 files changed, 35 insertions(+), 10 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 5e4aa53..fb1d1aa 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -87,6 +87,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_VOLUME_CLEANUP, - WINED3D_CS_OP_SURFACE_CLEANUP, - WINED3D_CS_OP_TEXTURE_CLEANUP, -+ WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, - WINED3D_CS_OP_STOP, - }; - -@@ -512,6 +513,11 @@ struct wined3d_cs_texture_cleanup - struct wined3d_texture *texture; - }; - -+struct wined3d_cs_create_dummy_textures -+{ -+ enum wined3d_cs_op opcode; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2473,6 +2479,28 @@ void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_textu - cs->ops->submit(cs, sizeof(*op)); - } - -+static UINT wined3d_cs_exec_create_dummy_textures(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_create_dummy_textures *op = data; -+ struct wined3d_context *context = context_acquire(cs->device, NULL); -+ -+ device_create_dummy_textures(cs->device, context); -+ -+ context_release(context); -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) -+{ -+ struct wined3d_cs_create_dummy_textures *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_CREATE_DUMMY_TEXTURES; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->finish(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2538,6 +2566,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, - /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, - /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, -+ /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index b3f75ba..28b1c81 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -608,7 +608,7 @@ out: - } - - /* Context activation is done by the caller. */ --static void create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) -+void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) - { - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - unsigned int i, j, count; -@@ -854,7 +854,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - { - static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f}; - struct wined3d_swapchain *swapchain = NULL; -- struct wined3d_context *context; - DWORD clear_flags = 0; - HRESULT hr; - -@@ -905,9 +904,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - device->swapchains[0] = swapchain; - device_init_swapchain_state(device, swapchain); - -- context = context_acquire(device, NULL); -- -- create_dummy_textures(device, context); -+ wined3d_cs_emit_create_dummy_textures(device->cs); - - device->contexts[0]->last_was_rhw = 0; - -@@ -919,7 +916,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - - case ORM_BACKBUFFER: - { -- if (context_get_current()->aux_buffers > 0) -+ if (device->contexts[0]->aux_buffers > 0) - { - TRACE("Using auxiliary buffer for offscreen rendering\n"); - device->offscreenBuffer = GL_AUX0; -@@ -935,8 +932,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, - - TRACE("All defaults now set up, leaving 3D init.\n"); - -- context_release(context); -- - /* Clear the screen */ - if (swapchain->back_buffers && swapchain->back_buffers[0]) - clear_flags |= WINED3DCLEAR_TARGET; -@@ -4236,7 +4231,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru - - swapchain->context[0] = context; - swapchain->num_contexts = 1; -- create_dummy_textures(device, context); -+ device_create_dummy_textures(device, context); - context_release(context); - - return WINED3D_OK; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 2f8cab4..a4e1886 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2076,7 +2076,7 @@ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT - GLenum type_hint, struct wined3d_context *context) DECLSPEC_HIDDEN; - void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, - const struct wined3d_context *context) DECLSPEC_HIDDEN; -- -+void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; - - static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) - { -@@ -2715,6 +2715,7 @@ void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer - void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; - void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0145-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,27 @@ +From 81f901210e683ac2a2193957849497031f424545 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 3 Oct 2013 17:39:08 +0200 +Subject: wined3d: Don't glFinish after a depth buffer blit. + +--- + dlls/wined3d/surface.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 4d8bd1c..3c5489f 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -694,9 +694,7 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, + dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, gl_mask, GL_NEAREST); + checkGLcall("glBlitFramebuffer()"); + +- if (wined3d_settings.cs_multithreaded) +- gl_info->gl_ops.gl.p_glFinish(); +- else if (wined3d_settings.strict_draw_ordering) ++ if (wined3d_settings.strict_draw_ordering) + gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + + context_release(context); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-wined3d-Create-the-initial-context-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-wined3d-Create-the-initial-context-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-wined3d-Create-the-initial-context-through-the-CS.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-wined3d-Create-the-initial-context-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,240 +0,0 @@ -From f53a2f40f946d8e6c9d36de24010dc9d2f324de1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 10 Oct 2013 16:43:19 +0200 -Subject: wined3d: Create the initial context through the CS. - -Very hacky. ---- - dlls/wined3d/cs.c | 34 ++++++++++++ - dlls/wined3d/swapchain.c | 118 +++++++++++++++++++++++------------------ - dlls/wined3d/wined3d_private.h | 4 ++ - 3 files changed, 103 insertions(+), 53 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index fb1d1aa..3662432 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -88,6 +88,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SURFACE_CLEANUP, - WINED3D_CS_OP_TEXTURE_CLEANUP, - WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, -+ WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT, - WINED3D_CS_OP_STOP, - }; - -@@ -518,6 +519,13 @@ struct wined3d_cs_create_dummy_textures - enum wined3d_cs_op opcode; - }; - -+struct wined3d_cs_create_swapchain_context -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_swapchain *swapchain; -+ HRESULT *ret; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2501,6 +2509,31 @@ void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) - cs->ops->finish(cs); - } - -+static UINT wined3d_cs_exec_create_swapchain_context(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_create_swapchain_context *op = data; -+ -+ *op->ret = swapchain_create_context_cs(cs->device, op->swapchain); -+ -+ return sizeof(*op); -+} -+ -+HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) -+{ -+ HRESULT ret; -+ struct wined3d_cs_create_swapchain_context *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT; -+ op->swapchain = swapchain; -+ op->ret = &ret; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->finish(cs); -+ -+ return ret; -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2567,6 +2600,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, - /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, - /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, -+ /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 0a7b68d..8b9b13c 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -723,6 +723,69 @@ void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) - swapchain->render_to_fbo = TRUE; - } - -+HRESULT swapchain_create_context_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) -+{ -+ const struct wined3d_adapter *adapter = device->adapter; -+ unsigned int i; -+ static const enum wined3d_format_id formats[] = -+ { -+ WINED3DFMT_D24_UNORM_S8_UINT, -+ WINED3DFMT_D32_UNORM, -+ WINED3DFMT_R24_UNORM_X8_TYPELESS, -+ WINED3DFMT_D16_UNORM, -+ WINED3DFMT_S1_UINT_D15_UNORM -+ }; -+ struct wined3d_surface *front_buffer; -+ const struct wined3d_gl_info *gl_info = &adapter->gl_info; -+ -+ swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); -+ if (!swapchain->context) -+ { -+ ERR("Failed to create the context array.\n"); -+ return E_OUTOFMEMORY; -+ } -+ swapchain->num_contexts = 1; -+ -+ /* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate. -+ * You are able to add a depth + stencil surface at a later stage when you need it. -+ * In order to support this properly in WineD3D we need the ability to recreate the opengl context and -+ * drawable when this is required. This is very tricky as we need to reapply ALL opengl states for the new -+ * context, need torecreate shaders, textures and other resources. -+ * -+ * The context manager already takes care of the state problem and for the other tasks code from Reset -+ * can be used. These changes are way to risky during the 1.0 code freeze which is taking place right now. -+ * Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the -+ * time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this -+ * issue needs to be fixed. */ -+ front_buffer = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); -+ for (i = 0; i < (sizeof(formats) / sizeof(*formats)); i++) -+ { -+ swapchain->ds_format = wined3d_get_format(gl_info, formats[i]); -+ swapchain->context[0] = context_create(swapchain, front_buffer, swapchain->ds_format); -+ if (swapchain->context[0]) break; -+ TRACE("Depth stencil format %s is not supported, trying next format\n", -+ debug_d3dformat(formats[i])); -+ } -+ -+ if (!swapchain->context[0]) -+ { -+ WARN("Failed to create context.\n"); -+ HeapFree(GetProcessHeap(), 0, swapchain->context); -+ swapchain->context = NULL; -+ return WINED3DERR_NOTAVAILABLE; -+ } -+ -+ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO -+ && (!swapchain->desc.enable_auto_depth_stencil -+ || swapchain->desc.auto_depth_stencil_format != swapchain->ds_format->id)) -+ { -+ FIXME("Add OpenGL context recreation support to context_validate_onscreen_formats\n"); -+ } -+ context_release(swapchain->context[0]); -+ -+ return WINED3D_OK; -+} -+ - static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3d_device *device, - struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) - { -@@ -847,60 +910,9 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 - - if (!(device->wined3d->flags & WINED3D_NO3D)) - { -- static const enum wined3d_format_id formats[] = -- { -- WINED3DFMT_D24_UNORM_S8_UINT, -- WINED3DFMT_D32_UNORM, -- WINED3DFMT_R24_UNORM_X8_TYPELESS, -- WINED3DFMT_D16_UNORM, -- WINED3DFMT_S1_UINT_D15_UNORM -- }; -- -- const struct wined3d_gl_info *gl_info = &adapter->gl_info; -- -- swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); -- if (!swapchain->context) -- { -- ERR("Failed to create the context array.\n"); -- hr = E_OUTOFMEMORY; -- goto err; -- } -- swapchain->num_contexts = 1; -- -- /* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate. -- * You are able to add a depth + stencil surface at a later stage when you need it. -- * In order to support this properly in WineD3D we need the ability to recreate the opengl context and -- * drawable when this is required. This is very tricky as we need to reapply ALL opengl states for the new -- * context, need torecreate shaders, textures and other resources. -- * -- * The context manager already takes care of the state problem and for the other tasks code from Reset -- * can be used. These changes are way to risky during the 1.0 code freeze which is taking place right now. -- * Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the -- * time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this -- * issue needs to be fixed. */ -- for (i = 0; i < (sizeof(formats) / sizeof(*formats)); i++) -- { -- swapchain->ds_format = wined3d_get_format(gl_info, formats[i]); -- swapchain->context[0] = context_create(swapchain, front_buffer, swapchain->ds_format); -- if (swapchain->context[0]) break; -- TRACE("Depth stencil format %s is not supported, trying next format\n", -- debug_d3dformat(formats[i])); -- } -- -- if (!swapchain->context[0]) -- { -- WARN("Failed to create context.\n"); -- hr = WINED3DERR_NOTAVAILABLE; -+ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); -+ if (FAILED(hr)) - goto err; -- } -- -- if (wined3d_settings.offscreen_rendering_mode != ORM_FBO -- && (!desc->enable_auto_depth_stencil -- || swapchain->desc.auto_depth_stencil_format != swapchain->ds_format->id)) -- { -- FIXME("Add OpenGL context recreation support to context_validate_onscreen_formats\n"); -- } -- context_release(swapchain->context[0]); - } - - if (swapchain->desc.backbuffer_count > 0) -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index a4e1886..ab38f0e 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2716,6 +2716,8 @@ void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume - void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; - void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN; -+HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, -+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - - /* 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 -@@ -2900,6 +2902,8 @@ void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HI - HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; -+HRESULT swapchain_create_context_cs(struct wined3d_device *device, -+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - - /***************************************************************************** - * Utility function prototypes --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-wined3d-Remove-software-cursor-support.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-wined3d-Remove-software-cursor-support.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-wined3d-Remove-software-cursor-support.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0146-wined3d-Remove-software-cursor-support.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,173 @@ +From 79899d02dd509deb98dfeee88f8325422fdd6937 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 3 Oct 2013 19:23:24 +0200 +Subject: wined3d: Remove software cursor support. + +This has been broken since quite some time and only serves to crash fglrx by acquiring a context +in the main thread. + +FIXME: Make sure wined3d_device_show_cursor returns the correct value if a software cursor is set. +--- + dlls/wined3d/device.c | 66 ++---------------------------------------- + dlls/wined3d/swapchain.c | 21 -------------- + dlls/wined3d/wined3d_private.h | 1 - + 3 files changed, 2 insertions(+), 86 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index a112027..746be2b 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -1023,8 +1023,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + + if (device->logo_texture) + wined3d_texture_decref(device->logo_texture); +- if (device->cursor_texture) +- wined3d_texture_decref(device->cursor_texture); + + /* Release the buffers (with sanity checks). + * FIXME: Move this move into a separate patch. I think the idea +@@ -3984,60 +3982,12 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, + wined3d_rendertarget_view_decref(prev); + } + +-static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined3d_device *device, +- struct wined3d_surface *cursor_image) +-{ +- struct wined3d_sub_resource_data data; +- struct wined3d_resource_desc desc; +- struct wined3d_map_desc map_desc; +- struct wined3d_texture *texture; +- HRESULT hr; +- +- if (FAILED(wined3d_surface_map(cursor_image, &map_desc, NULL, WINED3D_MAP_READONLY))) +- { +- ERR("Failed to map source surface.\n"); +- return NULL; +- } +- +- data.data = map_desc.data; +- data.row_pitch = map_desc.row_pitch; +- data.slice_pitch = map_desc.slice_pitch; +- +- desc.resource_type = WINED3D_RTYPE_TEXTURE; +- desc.format = WINED3DFMT_B8G8R8A8_UNORM; +- desc.multisample_type = WINED3D_MULTISAMPLE_NONE; +- desc.multisample_quality = 0; +- desc.usage = WINED3DUSAGE_DYNAMIC; +- desc.pool = WINED3D_POOL_DEFAULT; +- desc.width = cursor_image->resource.width; +- desc.height = cursor_image->resource.height; +- desc.depth = 1; +- desc.size = 0; +- +- hr = wined3d_texture_create(device, &desc, 1, WINED3D_SURFACE_MAPPABLE, +- &data, NULL, &wined3d_null_parent_ops, &texture); +- wined3d_surface_unmap(cursor_image); +- if (FAILED(hr)) +- { +- ERR("Failed to create cursor texture.\n"); +- return NULL; +- } +- +- return texture; +-} +- + HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device, + UINT x_hotspot, UINT y_hotspot, struct wined3d_surface *cursor_image) + { + TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n", + device, x_hotspot, y_hotspot, cursor_image); + +- if (device->cursor_texture) +- { +- wined3d_texture_decref(device->cursor_texture); +- device->cursor_texture = NULL; +- } +- + if (cursor_image) + { + struct wined3d_display_mode mode; +@@ -4072,11 +4022,8 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device + * release it after setting the cursor image. Windows doesn't + * addref the set surface, so we can't do this either without + * creating circular refcount dependencies. */ +- if (!(device->cursor_texture = wined3d_device_create_cursor_texture(device, cursor_image))) +- { +- ERR("Failed to create cursor texture.\n"); +- return WINED3DERR_INVALIDCALL; +- } ++ device->cursorWidth = cursor_image->resource.width; ++ device->cursorHeight = cursor_image->resource.height; + + device->cursorWidth = cursor_image->resource.width; + device->cursorHeight = cursor_image->resource.height; +@@ -4176,10 +4123,6 @@ BOOL CDECL wined3d_device_show_cursor(struct wined3d_device *device, BOOL show) + else + SetCursor(NULL); + } +- else if (device->cursor_texture) +- { +- device->bCursorVisible = show; +- } + + return oldVisible; + } +@@ -4336,11 +4279,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + wined3d_texture_decref(device->logo_texture); + device->logo_texture = NULL; + } +- if (device->cursor_texture) +- { +- wined3d_texture_decref(device->cursor_texture); +- device->cursor_texture = NULL; +- } + } + + if (device->state.fb.render_targets) +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index 1ccd18b..dbfc0d6 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -454,27 +454,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT + NULL, WINED3D_TEXF_POINT); + } + +- if (swapchain->device->bCursorVisible && swapchain->device->cursor_texture +- && !swapchain->device->hardwareCursor) +- { +- struct wined3d_surface *cursor = surface_from_resource( +- wined3d_texture_get_sub_resource(swapchain->device->cursor_texture, 0)); +- RECT destRect = +- { +- swapchain->device->xScreenSpace - swapchain->device->xHotSpot, +- swapchain->device->yScreenSpace - swapchain->device->yHotSpot, +- swapchain->device->xScreenSpace + swapchain->device->cursorWidth - swapchain->device->xHotSpot, +- swapchain->device->yScreenSpace + swapchain->device->cursorHeight - swapchain->device->yHotSpot, +- }; +- +- TRACE("Rendering the software cursor.\n"); +- +- if (swapchain->desc.windowed) +- MapWindowPoints(NULL, swapchain->win_handle, (POINT *)&destRect, 2); +- wined3d_surface_blt(back_buffer, &destRect, cursor, NULL, WINEDDBLT_ALPHATEST, +- NULL, WINED3D_TEXF_POINT); +- } +- + TRACE("Presenting HDC %p.\n", context->hdc); + + render_to_fbo = swapchain->render_to_fbo; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 2f5fbf3..84343c6 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2048,7 +2048,6 @@ struct wined3d_device + UINT xScreenSpace; + UINT yScreenSpace; + UINT cursorWidth, cursorHeight; +- struct wined3d_texture *cursor_texture; + HCURSOR hardwareCursor; + + /* The Wine logo texture */ +-- +1.9.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Create-dummy-textures-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Create-dummy-textures-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Create-dummy-textures-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Create-dummy-textures-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,157 @@ +From c91b5281332e1879e25088efeee24bc1a337ca30 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 10 Oct 2013 16:29:42 +0200 +Subject: wined3d: Create dummy textures through the CS. + +Hacky version. Just good enough to see if the double context during init is what makes fglrx +crash. +--- + dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ + dlls/wined3d/device.c | 13 ++++--------- + dlls/wined3d/wined3d_private.h | 3 ++- + 3 files changed, 35 insertions(+), 10 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 5e4aa53..fb1d1aa 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -87,6 +87,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_VOLUME_CLEANUP, + WINED3D_CS_OP_SURFACE_CLEANUP, + WINED3D_CS_OP_TEXTURE_CLEANUP, ++ WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, + WINED3D_CS_OP_STOP, + }; + +@@ -512,6 +513,11 @@ struct wined3d_cs_texture_cleanup + struct wined3d_texture *texture; + }; + ++struct wined3d_cs_create_dummy_textures ++{ ++ enum wined3d_cs_op opcode; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2473,6 +2479,28 @@ void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_textu + cs->ops->submit(cs, sizeof(*op)); + } + ++static UINT wined3d_cs_exec_create_dummy_textures(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_create_dummy_textures *op = data; ++ struct wined3d_context *context = context_acquire(cs->device, NULL); ++ ++ device_create_dummy_textures(cs->device, context); ++ ++ context_release(context); ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) ++{ ++ struct wined3d_cs_create_dummy_textures *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_CREATE_DUMMY_TEXTURES; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->finish(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2538,6 +2566,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, + /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, + /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, ++ /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index b3f75ba..28b1c81 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -608,7 +608,7 @@ out: + } + + /* Context activation is done by the caller. */ +-static void create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) ++void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) + { + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + unsigned int i, j, count; +@@ -854,7 +854,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + { + static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f}; + struct wined3d_swapchain *swapchain = NULL; +- struct wined3d_context *context; + DWORD clear_flags = 0; + HRESULT hr; + +@@ -905,9 +904,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + device->swapchains[0] = swapchain; + device_init_swapchain_state(device, swapchain); + +- context = context_acquire(device, NULL); +- +- create_dummy_textures(device, context); ++ wined3d_cs_emit_create_dummy_textures(device->cs); + + device->contexts[0]->last_was_rhw = 0; + +@@ -919,7 +916,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + + case ORM_BACKBUFFER: + { +- if (context_get_current()->aux_buffers > 0) ++ if (device->contexts[0]->aux_buffers > 0) + { + TRACE("Using auxiliary buffer for offscreen rendering\n"); + device->offscreenBuffer = GL_AUX0; +@@ -935,8 +932,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, + + TRACE("All defaults now set up, leaving 3D init.\n"); + +- context_release(context); +- + /* Clear the screen */ + if (swapchain->back_buffers && swapchain->back_buffers[0]) + clear_flags |= WINED3DCLEAR_TARGET; +@@ -4236,7 +4231,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru + + swapchain->context[0] = context; + swapchain->num_contexts = 1; +- create_dummy_textures(device, context); ++ device_create_dummy_textures(device, context); + context_release(context); + + return WINED3D_OK; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 2f8cab4..a4e1886 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2076,7 +2076,7 @@ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT + GLenum type_hint, struct wined3d_context *context) DECLSPEC_HIDDEN; + void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, + const struct wined3d_context *context) DECLSPEC_HIDDEN; +- ++void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; + + static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) + { +@@ -2715,6 +2715,7 @@ void wined3d_cs_emit_buffer_cleanup(struct wined3d_cs *cs, struct wined3d_buffer + void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume *volume) DECLSPEC_HIDDEN; + void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0147-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -From bc64eef6fb48de707d8d19cb604e748e207742e4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 10 Oct 2013 18:40:04 +0200 -Subject: wined3d: Recreate ctx and dummy textures through the CS after resets. - ---- - dlls/wined3d/device.c | 26 ++++---------------------- - 1 file changed, 4 insertions(+), 22 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 28b1c81..a113e21 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4189,8 +4189,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d - - static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) - { -- struct wined3d_context *context; -- struct wined3d_surface *target; - HRESULT hr; - - if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4207,32 +4205,16 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru - return hr; - } - -- /* Recreate the primary swapchain's context */ -- swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); -- if (!swapchain->context) -- { -- ERR("Failed to allocate memory for swapchain context array.\n"); -- device->blitter->free_private(device); -- device->shader_backend->shader_free_private(device); -- return E_OUTOFMEMORY; -- } -- -- target = swapchain->back_buffers -- ? surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)) -- : surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); -- if (!(context = context_create(swapchain, target, swapchain->ds_format))) -+ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); -+ if (FAILED(hr)) - { - WARN("Failed to create context.\n"); - device->blitter->free_private(device); - device->shader_backend->shader_free_private(device); -- HeapFree(GetProcessHeap(), 0, swapchain->context); -- return E_FAIL; -+ return hr; - } - -- swapchain->context[0] = context; -- swapchain->num_contexts = 1; -- device_create_dummy_textures(device, context); -- context_release(context); -+ wined3d_cs_emit_create_dummy_textures(device->cs); - - return WINED3D_OK; - } --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Create-the-initial-context-through-the-CS.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Create-the-initial-context-through-the-CS.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Create-the-initial-context-through-the-CS.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Create-the-initial-context-through-the-CS.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,240 @@ +From f53a2f40f946d8e6c9d36de24010dc9d2f324de1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 10 Oct 2013 16:43:19 +0200 +Subject: wined3d: Create the initial context through the CS. + +Very hacky. +--- + dlls/wined3d/cs.c | 34 ++++++++++++ + dlls/wined3d/swapchain.c | 118 +++++++++++++++++++++++------------------ + dlls/wined3d/wined3d_private.h | 4 ++ + 3 files changed, 103 insertions(+), 53 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index fb1d1aa..3662432 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -88,6 +88,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_SURFACE_CLEANUP, + WINED3D_CS_OP_TEXTURE_CLEANUP, + WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, ++ WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT, + WINED3D_CS_OP_STOP, + }; + +@@ -518,6 +519,13 @@ struct wined3d_cs_create_dummy_textures + enum wined3d_cs_op opcode; + }; + ++struct wined3d_cs_create_swapchain_context ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_swapchain *swapchain; ++ HRESULT *ret; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2501,6 +2509,31 @@ void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) + cs->ops->finish(cs); + } + ++static UINT wined3d_cs_exec_create_swapchain_context(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_create_swapchain_context *op = data; ++ ++ *op->ret = swapchain_create_context_cs(cs->device, op->swapchain); ++ ++ return sizeof(*op); ++} ++ ++HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) ++{ ++ HRESULT ret; ++ struct wined3d_cs_create_swapchain_context *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT; ++ op->swapchain = swapchain; ++ op->ret = &ret; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->finish(cs); ++ ++ return ret; ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2567,6 +2600,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, + /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, + /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, ++ /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index 0a7b68d..8b9b13c 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -723,6 +723,69 @@ void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) + swapchain->render_to_fbo = TRUE; + } + ++HRESULT swapchain_create_context_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) ++{ ++ const struct wined3d_adapter *adapter = device->adapter; ++ unsigned int i; ++ static const enum wined3d_format_id formats[] = ++ { ++ WINED3DFMT_D24_UNORM_S8_UINT, ++ WINED3DFMT_D32_UNORM, ++ WINED3DFMT_R24_UNORM_X8_TYPELESS, ++ WINED3DFMT_D16_UNORM, ++ WINED3DFMT_S1_UINT_D15_UNORM ++ }; ++ struct wined3d_surface *front_buffer; ++ const struct wined3d_gl_info *gl_info = &adapter->gl_info; ++ ++ swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); ++ if (!swapchain->context) ++ { ++ ERR("Failed to create the context array.\n"); ++ return E_OUTOFMEMORY; ++ } ++ swapchain->num_contexts = 1; ++ ++ /* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate. ++ * You are able to add a depth + stencil surface at a later stage when you need it. ++ * In order to support this properly in WineD3D we need the ability to recreate the opengl context and ++ * drawable when this is required. This is very tricky as we need to reapply ALL opengl states for the new ++ * context, need torecreate shaders, textures and other resources. ++ * ++ * The context manager already takes care of the state problem and for the other tasks code from Reset ++ * can be used. These changes are way to risky during the 1.0 code freeze which is taking place right now. ++ * Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the ++ * time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this ++ * issue needs to be fixed. */ ++ front_buffer = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); ++ for (i = 0; i < (sizeof(formats) / sizeof(*formats)); i++) ++ { ++ swapchain->ds_format = wined3d_get_format(gl_info, formats[i]); ++ swapchain->context[0] = context_create(swapchain, front_buffer, swapchain->ds_format); ++ if (swapchain->context[0]) break; ++ TRACE("Depth stencil format %s is not supported, trying next format\n", ++ debug_d3dformat(formats[i])); ++ } ++ ++ if (!swapchain->context[0]) ++ { ++ WARN("Failed to create context.\n"); ++ HeapFree(GetProcessHeap(), 0, swapchain->context); ++ swapchain->context = NULL; ++ return WINED3DERR_NOTAVAILABLE; ++ } ++ ++ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO ++ && (!swapchain->desc.enable_auto_depth_stencil ++ || swapchain->desc.auto_depth_stencil_format != swapchain->ds_format->id)) ++ { ++ FIXME("Add OpenGL context recreation support to context_validate_onscreen_formats\n"); ++ } ++ context_release(swapchain->context[0]); ++ ++ return WINED3D_OK; ++} ++ + static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3d_device *device, + struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) + { +@@ -847,60 +910,9 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 + + if (!(device->wined3d->flags & WINED3D_NO3D)) + { +- static const enum wined3d_format_id formats[] = +- { +- WINED3DFMT_D24_UNORM_S8_UINT, +- WINED3DFMT_D32_UNORM, +- WINED3DFMT_R24_UNORM_X8_TYPELESS, +- WINED3DFMT_D16_UNORM, +- WINED3DFMT_S1_UINT_D15_UNORM +- }; +- +- const struct wined3d_gl_info *gl_info = &adapter->gl_info; +- +- swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); +- if (!swapchain->context) +- { +- ERR("Failed to create the context array.\n"); +- hr = E_OUTOFMEMORY; +- goto err; +- } +- swapchain->num_contexts = 1; +- +- /* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate. +- * You are able to add a depth + stencil surface at a later stage when you need it. +- * In order to support this properly in WineD3D we need the ability to recreate the opengl context and +- * drawable when this is required. This is very tricky as we need to reapply ALL opengl states for the new +- * context, need torecreate shaders, textures and other resources. +- * +- * The context manager already takes care of the state problem and for the other tasks code from Reset +- * can be used. These changes are way to risky during the 1.0 code freeze which is taking place right now. +- * Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the +- * time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this +- * issue needs to be fixed. */ +- for (i = 0; i < (sizeof(formats) / sizeof(*formats)); i++) +- { +- swapchain->ds_format = wined3d_get_format(gl_info, formats[i]); +- swapchain->context[0] = context_create(swapchain, front_buffer, swapchain->ds_format); +- if (swapchain->context[0]) break; +- TRACE("Depth stencil format %s is not supported, trying next format\n", +- debug_d3dformat(formats[i])); +- } +- +- if (!swapchain->context[0]) +- { +- WARN("Failed to create context.\n"); +- hr = WINED3DERR_NOTAVAILABLE; ++ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); ++ if (FAILED(hr)) + goto err; +- } +- +- if (wined3d_settings.offscreen_rendering_mode != ORM_FBO +- && (!desc->enable_auto_depth_stencil +- || swapchain->desc.auto_depth_stencil_format != swapchain->ds_format->id)) +- { +- FIXME("Add OpenGL context recreation support to context_validate_onscreen_formats\n"); +- } +- context_release(swapchain->context[0]); + } + + if (swapchain->desc.backbuffer_count > 0) +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index a4e1886..ab38f0e 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2716,6 +2716,8 @@ void wined3d_cs_emit_volume_cleanup(struct wined3d_cs *cs, struct wined3d_volume + void wined3d_cs_emit_surface_cleanup(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; + void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN; ++HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, ++ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + + /* 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 +@@ -2900,6 +2902,8 @@ void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HI + HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; ++HRESULT swapchain_create_context_cs(struct wined3d_device *device, ++ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + + /***************************************************************************** + * Utility function prototypes +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0148-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -From 00632c0c269b313ecf484bf7aff6d61666d27ff9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 10 Oct 2013 19:18:06 +0200 -Subject: wined3d: Ignore WINED3D_MAP_NO_DIRTY_UPDATE in resource_map. - -TODO: This flag and add_dirty_rect need tests. - -The primary purpose of this patch is to fix a memory leak in World of -Warcraft. WoW uses WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_DISCARD on -sysmem surfaces. A new block of memory is allocated, but never assigned -to heap_mem because wined3d_cs_emit_resource_changed is not called. - -The bigger picture is that we don't know how this flag and AddDirtyRect -/ AddDirtyBox are supposed to work. Msdn mentions some interaction with -update_surface and update_texture, but personally I think it is more -likely that this functionality is used to update separate rectangles in -a texture, similar to what can be achieved by mapping a buffer twice. ---- - dlls/wined3d/resource.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index dd21986..805c6da 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -849,7 +849,7 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - } - } - -- if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) -+ if (!(flags & WINED3D_MAP_READONLY)) - resource->unmap_dirtify = TRUE; - - resource->map_count++; --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,147 +0,0 @@ -From 2fa4aafc16726b74a32cfcfae23d68749545114f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 11 Oct 2013 10:11:13 +0200 -Subject: wined3d: Delete GL contexts through the CS in reset. - -Let's see if this fixes the remaining fglrx crashes... ---- - dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ - dlls/wined3d/device.c | 26 +++++++++++++++----------- - dlls/wined3d/wined3d_private.h | 4 ++++ - 3 files changed, 48 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 3662432..489fad0 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -89,6 +89,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_TEXTURE_CLEANUP, - WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, - WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT, -+ WINED3D_CS_OP_DELETE_GL_CONTEXTS, - WINED3D_CS_OP_STOP, - }; - -@@ -526,6 +527,12 @@ struct wined3d_cs_create_swapchain_context - HRESULT *ret; - }; - -+struct wined3d_cs_delete_gl_contexts -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_swapchain *swapchain; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2534,6 +2541,27 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w - return ret; - } - -+static UINT wined3d_cs_exec_delete_gl_contexts(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_delete_gl_contexts *op = data; -+ -+ device_delete_opengl_contexts_cs(cs->device, op->swapchain); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) -+{ -+ struct wined3d_cs_delete_gl_contexts *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_DELETE_GL_CONTEXTS; -+ op->swapchain = swapchain; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->finish(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2601,6 +2629,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, - /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, - /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, -+ /* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index a113e21..b96f20f 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4142,22 +4142,12 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) - } - } - --static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) -+void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) - { -- struct wined3d_resource *resource, *cursor; - const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; - struct wined3d_shader *shader; - -- LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) -- { -- TRACE("Unloading resource %p.\n", resource); -- -- wined3d_cs_emit_evict_resource(device->cs, resource); -- } -- if (wined3d_settings.cs_multithreaded) -- device->cs->ops->finish(device->cs); -- - LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry) - { - device->shader_backend->shader_destroy(shader); -@@ -4187,6 +4177,20 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d - swapchain->context = NULL; - } - -+static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) -+{ -+ struct wined3d_resource *resource, *cursor; -+ -+ LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) -+ { -+ TRACE("Unloading resource %p.\n", resource); -+ -+ wined3d_cs_emit_evict_resource(device->cs, resource); -+ } -+ -+ wined3d_cs_emit_delete_opengl_contexts(device->cs, swapchain); -+} -+ - static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) - { - HRESULT hr; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ab38f0e..2f7dd75 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2077,6 +2077,8 @@ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT - void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, - const struct wined3d_context *context) DECLSPEC_HIDDEN; - void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; -+void device_delete_opengl_contexts_cs(struct wined3d_device *device, -+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - - static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) - { -@@ -2718,6 +2720,8 @@ void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_textu - void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN; - HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, - struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, -+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0149-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,62 @@ +From bc64eef6fb48de707d8d19cb604e748e207742e4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 10 Oct 2013 18:40:04 +0200 +Subject: wined3d: Recreate ctx and dummy textures through the CS after resets. + +--- + dlls/wined3d/device.c | 26 ++++---------------------- + 1 file changed, 4 insertions(+), 22 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 28b1c81..a113e21 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4189,8 +4189,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d + + static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) + { +- struct wined3d_context *context; +- struct wined3d_surface *target; + HRESULT hr; + + if (FAILED(hr = device->shader_backend->shader_alloc_private(device, +@@ -4207,32 +4205,16 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru + return hr; + } + +- /* Recreate the primary swapchain's context */ +- swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); +- if (!swapchain->context) +- { +- ERR("Failed to allocate memory for swapchain context array.\n"); +- device->blitter->free_private(device); +- device->shader_backend->shader_free_private(device); +- return E_OUTOFMEMORY; +- } +- +- target = swapchain->back_buffers +- ? surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)) +- : surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); +- if (!(context = context_create(swapchain, target, swapchain->ds_format))) ++ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); ++ if (FAILED(hr)) + { + WARN("Failed to create context.\n"); + device->blitter->free_private(device); + device->shader_backend->shader_free_private(device); +- HeapFree(GetProcessHeap(), 0, swapchain->context); +- return E_FAIL; ++ return hr; + } + +- swapchain->context[0] = context; +- swapchain->num_contexts = 1; +- device_create_dummy_textures(device, context); +- context_release(context); ++ wined3d_cs_emit_create_dummy_textures(device->cs); + + return WINED3D_OK; + } +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -From 4dd8d4df940d07ac83180fd8efa576d5f9cbfdae Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 11 Oct 2013 10:17:42 +0200 -Subject: wined3d: Delete GL contexts through the CS in uninit_3d. - ---- - dlls/wined3d/device.c | 35 ++++------------------------------- - 1 file changed, 4 insertions(+), 31 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index ee5139b..72e472e 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -1013,8 +1013,6 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context) - HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - { - struct wined3d_resource *resource, *cursor; -- const struct wined3d_gl_info *gl_info; -- struct wined3d_context *context; - struct wined3d_surface *surface; - UINT i; - -@@ -1026,12 +1024,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - if (wined3d_settings.cs_multithreaded) - device->cs->ops->finish(device->cs); - -- /* I don't think that the interface guarantees that the device is destroyed from the same thread -- * it was created. Thus make sure a context is active for the glDelete* calls -- */ -- context = context_acquire(device, NULL); -- gl_info = context->gl_info; -- - if (device->logo_texture) - wined3d_texture_decref(device->logo_texture); - -@@ -1061,30 +1053,8 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) - TRACE("Unloading resource %p.\n", resource); - wined3d_cs_emit_evict_resource(device->cs, resource); - } -- if (wined3d_settings.cs_multithreaded) -- device->cs->ops->finish(device->cs); -- -- wine_rb_clear(&device->samplers, device_free_sampler, NULL); -- -- /* Destroy the depth blt resources, they will be invalid after the reset. Also free shader -- * private data, it might contain opengl pointers -- */ -- if (device->depth_blt_texture) -- { -- gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture); -- device->depth_blt_texture = 0; -- } -- -- /* Destroy the shader backend. Note that this has to happen after all shaders are destroyed. */ -- device->blitter->free_private(device); -- device->shader_backend->shader_free_private(device); -- destroy_dummy_textures(device, gl_info); - -- /* Release the context again as soon as possible. In particular, -- * releasing the render target views below may release the last reference -- * to the swapchain associated with this context, which in turn will -- * destroy the context. */ -- context_release(context); -+ wined3d_cs_emit_delete_opengl_contexts(device->cs, device->swapchains[0]); - - if (device->back_buffer_view) - { -@@ -4180,6 +4150,8 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine - context = context_acquire(device, NULL); - gl_info = context->gl_info; - -+ wine_rb_clear(&device->samplers, device_free_sampler, NULL); -+ - if (device->depth_blt_texture) - { - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture); -@@ -4199,6 +4171,7 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine - - HeapFree(GetProcessHeap(), 0, swapchain->context); - swapchain->context = NULL; -+ swapchain->num_contexts = 0; - } - - static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) --- -2.3.5 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0150-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,37 @@ +From 00632c0c269b313ecf484bf7aff6d61666d27ff9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 10 Oct 2013 19:18:06 +0200 +Subject: wined3d: Ignore WINED3D_MAP_NO_DIRTY_UPDATE in resource_map. + +TODO: This flag and add_dirty_rect need tests. + +The primary purpose of this patch is to fix a memory leak in World of +Warcraft. WoW uses WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_DISCARD on +sysmem surfaces. A new block of memory is allocated, but never assigned +to heap_mem because wined3d_cs_emit_resource_changed is not called. + +The bigger picture is that we don't know how this flag and AddDirtyRect +/ AddDirtyBox are supposed to work. Msdn mentions some interaction with +update_surface and update_texture, but personally I think it is more +likely that this functionality is used to update separate rectangles in +a texture, similar to what can be achieved by mapping a buffer twice. +--- + dlls/wined3d/resource.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index dd21986..805c6da 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -849,7 +849,7 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + } + } + +- if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) ++ if (!(flags & WINED3D_MAP_READONLY)) + resource->unmap_dirtify = TRUE; + + resource->map_count++; +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,147 @@ +From 2fa4aafc16726b74a32cfcfae23d68749545114f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 11 Oct 2013 10:11:13 +0200 +Subject: wined3d: Delete GL contexts through the CS in reset. + +Let's see if this fixes the remaining fglrx crashes... +--- + dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ + dlls/wined3d/device.c | 26 +++++++++++++++----------- + dlls/wined3d/wined3d_private.h | 4 ++++ + 3 files changed, 48 insertions(+), 11 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 3662432..489fad0 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -89,6 +89,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_TEXTURE_CLEANUP, + WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, + WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT, ++ WINED3D_CS_OP_DELETE_GL_CONTEXTS, + WINED3D_CS_OP_STOP, + }; + +@@ -526,6 +527,12 @@ struct wined3d_cs_create_swapchain_context + HRESULT *ret; + }; + ++struct wined3d_cs_delete_gl_contexts ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_swapchain *swapchain; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2534,6 +2541,27 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w + return ret; + } + ++static UINT wined3d_cs_exec_delete_gl_contexts(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_delete_gl_contexts *op = data; ++ ++ device_delete_opengl_contexts_cs(cs->device, op->swapchain); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) ++{ ++ struct wined3d_cs_delete_gl_contexts *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_DELETE_GL_CONTEXTS; ++ op->swapchain = swapchain; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->finish(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2601,6 +2629,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, + /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, + /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, ++ /* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index a113e21..b96f20f 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4142,22 +4142,12 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) + } + } + +-static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) ++void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) + { +- struct wined3d_resource *resource, *cursor; + const struct wined3d_gl_info *gl_info; + struct wined3d_context *context; + struct wined3d_shader *shader; + +- LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) +- { +- TRACE("Unloading resource %p.\n", resource); +- +- wined3d_cs_emit_evict_resource(device->cs, resource); +- } +- if (wined3d_settings.cs_multithreaded) +- device->cs->ops->finish(device->cs); +- + LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry) + { + device->shader_backend->shader_destroy(shader); +@@ -4187,6 +4177,20 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d + swapchain->context = NULL; + } + ++static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) ++{ ++ struct wined3d_resource *resource, *cursor; ++ ++ LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) ++ { ++ TRACE("Unloading resource %p.\n", resource); ++ ++ wined3d_cs_emit_evict_resource(device->cs, resource); ++ } ++ ++ wined3d_cs_emit_delete_opengl_contexts(device->cs, swapchain); ++} ++ + static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) + { + HRESULT hr; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index ab38f0e..2f7dd75 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2077,6 +2077,8 @@ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT + void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo, + const struct wined3d_context *context) DECLSPEC_HIDDEN; + void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; ++void device_delete_opengl_contexts_cs(struct wined3d_device *device, ++ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + + static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) + { +@@ -2718,6 +2720,8 @@ void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_textu + void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN; + HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, + struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, ++ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0151-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -From 210ed15c0132830fe2a6b4bf422fdc794982cf9c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 11 Oct 2013 12:09:37 +0200 -Subject: wined3d: Invoke surface_unload through the CS in - wined3d_surface_update_desc. - -This fixes another case where we use a GL context in the main thread and -crash fglrx in doing so. ---- - dlls/wined3d/texture.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index f055d5e..09ac38f 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -769,7 +769,10 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT - } - - if (device->d3d_initialized) -- texture->resource.resource_ops->resource_unload(&texture->resource); -+ { -+ wined3d_cs_emit_evict_resource(device->cs, &surface->resource); -+ device->cs->ops->finish(device->cs); -+ } - - texture->resource.format = format; - texture->resource.multisample_type = multisample_type; --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,87 @@ +From 4dd8d4df940d07ac83180fd8efa576d5f9cbfdae Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 11 Oct 2013 10:17:42 +0200 +Subject: wined3d: Delete GL contexts through the CS in uninit_3d. + +--- + dlls/wined3d/device.c | 35 ++++------------------------------- + 1 file changed, 4 insertions(+), 31 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index ee5139b..72e472e 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -1013,8 +1013,6 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context) + HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + { + struct wined3d_resource *resource, *cursor; +- const struct wined3d_gl_info *gl_info; +- struct wined3d_context *context; + struct wined3d_surface *surface; + UINT i; + +@@ -1026,12 +1024,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + if (wined3d_settings.cs_multithreaded) + device->cs->ops->finish(device->cs); + +- /* I don't think that the interface guarantees that the device is destroyed from the same thread +- * it was created. Thus make sure a context is active for the glDelete* calls +- */ +- context = context_acquire(device, NULL); +- gl_info = context->gl_info; +- + if (device->logo_texture) + wined3d_texture_decref(device->logo_texture); + +@@ -1061,30 +1053,8 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) + TRACE("Unloading resource %p.\n", resource); + wined3d_cs_emit_evict_resource(device->cs, resource); + } +- if (wined3d_settings.cs_multithreaded) +- device->cs->ops->finish(device->cs); +- +- wine_rb_clear(&device->samplers, device_free_sampler, NULL); +- +- /* Destroy the depth blt resources, they will be invalid after the reset. Also free shader +- * private data, it might contain opengl pointers +- */ +- if (device->depth_blt_texture) +- { +- gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture); +- device->depth_blt_texture = 0; +- } +- +- /* Destroy the shader backend. Note that this has to happen after all shaders are destroyed. */ +- device->blitter->free_private(device); +- device->shader_backend->shader_free_private(device); +- destroy_dummy_textures(device, gl_info); + +- /* Release the context again as soon as possible. In particular, +- * releasing the render target views below may release the last reference +- * to the swapchain associated with this context, which in turn will +- * destroy the context. */ +- context_release(context); ++ wined3d_cs_emit_delete_opengl_contexts(device->cs, device->swapchains[0]); + + if (device->back_buffer_view) + { +@@ -4180,6 +4150,8 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine + context = context_acquire(device, NULL); + gl_info = context->gl_info; + ++ wine_rb_clear(&device->samplers, device_free_sampler, NULL); ++ + if (device->depth_blt_texture) + { + gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture); +@@ -4199,6 +4171,7 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine + + HeapFree(GetProcessHeap(), 0, swapchain->context); + swapchain->context = NULL; ++ swapchain->num_contexts = 0; + } + + static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) +-- +2.3.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Use-an-event-to-block-the-worker-thread-when.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Use-an-event-to-block-the-worker-thread-when.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Use-an-event-to-block-the-worker-thread-when.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0152-wined3d-Use-an-event-to-block-the-worker-thread-when.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,177 +0,0 @@ -From e18809d8ea1a9d47a592c91d3bfb703a5df08ac2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 24 Oct 2013 18:56:13 +0200 -Subject: wined3d: Use an event to block the worker thread when it is idle. - -I could not find a canonical implementation for this. Suggestions are -welcome. - -The main goal was to avoid SetEvent / WaitForSingleObject / ResetEvent -calls at all costs. They go straight to wineserver, bringing it to 25% -CPU time and cutting framerates in half. Hence the extra BOOL to tell -cs_submit when to set the event. - -Finding the correct spin count is tricky. The value I set is high enough -to prevent 3DMark2001 car chase high detail from waiting. This benchmark -maps a lot of in-use managed buffers and thus waits for the CS. But what -the ideal number is depends a lot on the game and CPU. - -A better heuristic is needed. E.g. we could tell the worker thread when -the main thread is waiting for a resource to become idle and avoid -waiting for the event in that case. We may have to use POSIX -synchronization primitives for efficiency. On the other hand, the -current implementation probably still spins way too much for an -application that throttles the framerate to 30 fps by waiting in its own -code. So it is probably only good enough for Microsoft Powerpoint. - -We should also think about blocking the main thread with events if it is -waiting for the worker thread when waiting for resources, the swap -counter or space in the command Stream. This should preserve power when -vsync is turned on. ---- - dlls/wined3d/cs.c | 51 +++++++++++++++++++++++++++++++++++++++--- - dlls/wined3d/wined3d_private.h | 5 +++++ - 2 files changed, 53 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 489fad0..8cbca6c 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -539,6 +539,9 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - /* There is only one thread writing to queue.head, InterlockedExchange - * is used for the memory barrier. */ - InterlockedExchange(&cs->queue.head, new_val); -+ -+ if (InterlockedCompareExchange(&cs->waiting_for_event, FALSE, TRUE)) -+ SetEvent(cs->event); - } - - static void wined3d_cs_mt_submit_prio(struct wined3d_cs *cs, size_t size) -@@ -547,6 +550,9 @@ static void wined3d_cs_mt_submit_prio(struct wined3d_cs *cs, size_t size) - /* There is only one thread writing to queue.head, InterlockedExchange - * is used for the memory barrier. */ - InterlockedExchange(&cs->prio_queue.head, new_val); -+ -+ if (InterlockedCompareExchange(&cs->waiting_for_event, FALSE, TRUE)) -+ SetEvent(cs->event); - } - - static UINT wined3d_cs_exec_nop(struct wined3d_cs *cs, const void *data) -@@ -2826,6 +2832,34 @@ static inline void poll_queries(struct wined3d_cs *cs) - } - } - -+static inline BOOL queue_is_empty(const struct wined3d_cs_queue *queue) -+{ -+ return *((volatile LONG *)&queue->head) == queue->tail; -+} -+ -+static void wined3d_cs_wait_event(struct wined3d_cs *cs) -+{ -+ InterlockedExchange(&cs->waiting_for_event, TRUE); -+ -+ /* The main thread might enqueue a finish command and block on it -+ * after the worker thread decided to enter wined3d_cs_wait_event -+ * and before waiting_for_event was set to TRUE. Check again if -+ * the queues are empty */ -+ if (!queue_is_empty(&cs->prio_queue) || !queue_is_empty(&cs->queue)) -+ { -+ /* The main thread might have signalled the event, or be in the process -+ * of doing so. Wait for the event to reset it. ResetEvent is not good -+ * because the main thread might be beween the waiting_for_event reset -+ * and SignalEvent call. */ -+ if (!InterlockedCompareExchange(&cs->waiting_for_event, FALSE, FALSE)) -+ WaitForSingleObject(cs->event, INFINITE); -+ } -+ else -+ { -+ WaitForSingleObject(cs->event, INFINITE); -+ } -+} -+ - static DWORD WINAPI wined3d_cs_run(void *thread_param) - { - struct wined3d_cs *cs = thread_param; -@@ -2833,6 +2867,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) - LONG tail; - char poll = 0; - struct wined3d_cs_queue *queue; -+ unsigned int spin_count = 0; - - TRACE("Started.\n"); - -@@ -2848,21 +2883,27 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) - else - poll++; - -- if (*((volatile LONG *)&cs->prio_queue.head) != cs->prio_queue.tail) -+ if (!queue_is_empty(&cs->prio_queue)) - { - queue = &cs->prio_queue; - } -- else if (*((volatile LONG *)&cs->queue.head) != cs->queue.tail) -+ else if (!queue_is_empty(&cs->queue)) - { - queue = &cs->queue; -- if (*((volatile LONG *)&cs->prio_queue.head) != cs->prio_queue.tail) -+ if (!queue_is_empty(&cs->prio_queue)) - queue = &cs->prio_queue; - } - else - { -+ spin_count++; -+ if (spin_count >= WINED3D_CS_SPIN_COUNT && list_empty(&cs->query_poll_list)) -+ wined3d_cs_wait_event(cs); -+ - continue; - } - -+ spin_count = 0; -+ - tail = queue->tail; - opcode = *(const enum wined3d_cs_op *)&queue->data[tail]; - -@@ -2904,6 +2945,8 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) - { - cs->ops = &wined3d_cs_mt_ops; - -+ cs->event = CreateEventW(NULL, FALSE, FALSE, NULL); -+ - if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL))) - { - ERR("Failed to create wined3d command stream thread.\n"); -@@ -2934,6 +2977,8 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) - CloseHandle(cs->thread); - if (ret != WAIT_OBJECT_0) - ERR("Wait failed (%#x).\n", ret); -+ if (!CloseHandle(cs->event)) -+ ERR("Closing event failed.\n"); - } - - HeapFree(GetProcessHeap(), 0, cs); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 2f7dd75..63b67da 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2583,6 +2583,8 @@ struct wined3d_cs_list - }; - - #define WINED3D_CS_QUEUE_SIZE 0x100000 -+#define WINED3D_CS_SPIN_COUNT 10000000 -+ - struct wined3d_cs_queue - { - LONG head, tail; -@@ -2612,6 +2614,9 @@ struct wined3d_cs - - LONG pending_presents; - struct list query_poll_list; -+ -+ HANDLE event; -+ BOOL waiting_for_event; - }; - - struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Fence-preload-operations.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Fence-preload-operations.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Fence-preload-operations.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Fence-preload-operations.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -From 4a770e26268a89e0f211b42dfdd857f3180bb73e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 24 Oct 2013 22:38:26 +0200 -Subject: wined3d: Fence preload operations. - -Otherwise texture data might get lost, thanks to surface/volume_evict_sysmem: - -1) preload(texture) -2) map(texture) - -> Loads sysmem / sets it with discard map. -3) unmap(texture) - -> enqueues a resource_changed operation -4) preload is executed. - -> Uploads data written in 3. Discards sysmem. Questionable if - DISCARD was passed, but without it, no harm done. - -> texture is only up to date location. -5) resource_changed executed. - -> Discards texture. - -And data is lost. This patch prevents that by stalling the map until the -PreLoad is done. - -What's left open is finding out why anyone (I'm looking at you EVE -online) preloads a texture right before mapping it... ---- - dlls/wined3d/cs.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 8cbca6c..b152a0d 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -2145,6 +2145,8 @@ static UINT wined3d_cs_exec_texture_preload(struct wined3d_cs *cs, const void *d - wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB); - context_release(context); - -+ wined3d_resource_dec_fence(&texture->resource); -+ - return sizeof(*op); - } - -@@ -2156,6 +2158,8 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu - op->opcode = WINED3D_CS_OP_TEXTURE_PRELOAD; - op->texture = texture; - -+ wined3d_resource_inc_fence(&texture->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - -@@ -2168,6 +2172,8 @@ static UINT wined3d_cs_exec_surface_preload(struct wined3d_cs *cs, const void *d - wined3d_texture_preload(op->surface->container); - context_release(context); - -+ wined3d_resource_dec_fence(&op->surface->container->resource); -+ - return sizeof(*op); - } - -@@ -2179,6 +2185,8 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa - op->opcode = WINED3D_CS_OP_SURFACE_PRELOAD; - op->surface = surface; - -+ wined3d_resource_inc_fence(&op->surface->container->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - -@@ -2300,6 +2308,8 @@ static UINT wined3d_cs_exec_buffer_preload(struct wined3d_cs *cs, const void *da - buffer_internal_preload(op->buffer, context, NULL); - context_release(context); - -+ wined3d_resource_dec_fence(&op->buffer->resource); -+ - return sizeof(*op); - } - -@@ -2311,6 +2321,8 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer - op->opcode = WINED3D_CS_OP_BUFFER_PRELOAD; - op->buffer = buffer; - -+ wined3d_resource_inc_fence(&buffer->resource); -+ - cs->ops->submit(cs, sizeof(*op)); - } - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0153-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,31 @@ +From 210ed15c0132830fe2a6b4bf422fdc794982cf9c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 11 Oct 2013 12:09:37 +0200 +Subject: wined3d: Invoke surface_unload through the CS in + wined3d_surface_update_desc. + +This fixes another case where we use a GL context in the main thread and +crash fglrx in doing so. +--- + dlls/wined3d/texture.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index f055d5e..09ac38f 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -769,7 +769,10 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT + } + + if (device->d3d_initialized) +- texture->resource.resource_ops->resource_unload(&texture->resource); ++ { ++ wined3d_cs_emit_evict_resource(device->cs, &surface->resource); ++ device->cs->ops->finish(device->cs); ++ } + + texture->resource.format = format; + texture->resource.multisample_type = multisample_type; +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From c8083ad9f76ddba995df169c8b2f3486e81bbe02 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 20 Nov 2013 18:04:50 +0100 -Subject: d3d8/tests: D3DLOCK_NO_DIRTY_UPDATE on managed textures is - temporarily broken. - ---- - dlls/d3d8/tests/visual.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c -index a8a771e..9535b69 100644 ---- a/dlls/d3d8/tests/visual.c -+++ b/dlls/d3d8/tests/visual.c -@@ -4998,7 +4998,7 @@ static void add_dirty_rect_test(void) - fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); - add_dirty_rect_test_draw(device); - color = getPixelColor(device, 320, 240); -- ok(color_match(color, 0x00ff0000, 1), -+ todo_wine ok(color_match(color, 0x00ff0000, 1), - "Expected color 0x00ff0000, got 0x%08x.\n", color); - hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); - ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-wined3d-Use-an-event-to-block-the-worker-thread-when.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-wined3d-Use-an-event-to-block-the-worker-thread-when.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-wined3d-Use-an-event-to-block-the-worker-thread-when.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0154-wined3d-Use-an-event-to-block-the-worker-thread-when.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,177 @@ +From e18809d8ea1a9d47a592c91d3bfb703a5df08ac2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 24 Oct 2013 18:56:13 +0200 +Subject: wined3d: Use an event to block the worker thread when it is idle. + +I could not find a canonical implementation for this. Suggestions are +welcome. + +The main goal was to avoid SetEvent / WaitForSingleObject / ResetEvent +calls at all costs. They go straight to wineserver, bringing it to 25% +CPU time and cutting framerates in half. Hence the extra BOOL to tell +cs_submit when to set the event. + +Finding the correct spin count is tricky. The value I set is high enough +to prevent 3DMark2001 car chase high detail from waiting. This benchmark +maps a lot of in-use managed buffers and thus waits for the CS. But what +the ideal number is depends a lot on the game and CPU. + +A better heuristic is needed. E.g. we could tell the worker thread when +the main thread is waiting for a resource to become idle and avoid +waiting for the event in that case. We may have to use POSIX +synchronization primitives for efficiency. On the other hand, the +current implementation probably still spins way too much for an +application that throttles the framerate to 30 fps by waiting in its own +code. So it is probably only good enough for Microsoft Powerpoint. + +We should also think about blocking the main thread with events if it is +waiting for the worker thread when waiting for resources, the swap +counter or space in the command Stream. This should preserve power when +vsync is turned on. +--- + dlls/wined3d/cs.c | 51 +++++++++++++++++++++++++++++++++++++++--- + dlls/wined3d/wined3d_private.h | 5 +++++ + 2 files changed, 53 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 489fad0..8cbca6c 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -539,6 +539,9 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + /* There is only one thread writing to queue.head, InterlockedExchange + * is used for the memory barrier. */ + InterlockedExchange(&cs->queue.head, new_val); ++ ++ if (InterlockedCompareExchange(&cs->waiting_for_event, FALSE, TRUE)) ++ SetEvent(cs->event); + } + + static void wined3d_cs_mt_submit_prio(struct wined3d_cs *cs, size_t size) +@@ -547,6 +550,9 @@ static void wined3d_cs_mt_submit_prio(struct wined3d_cs *cs, size_t size) + /* There is only one thread writing to queue.head, InterlockedExchange + * is used for the memory barrier. */ + InterlockedExchange(&cs->prio_queue.head, new_val); ++ ++ if (InterlockedCompareExchange(&cs->waiting_for_event, FALSE, TRUE)) ++ SetEvent(cs->event); + } + + static UINT wined3d_cs_exec_nop(struct wined3d_cs *cs, const void *data) +@@ -2826,6 +2832,34 @@ static inline void poll_queries(struct wined3d_cs *cs) + } + } + ++static inline BOOL queue_is_empty(const struct wined3d_cs_queue *queue) ++{ ++ return *((volatile LONG *)&queue->head) == queue->tail; ++} ++ ++static void wined3d_cs_wait_event(struct wined3d_cs *cs) ++{ ++ InterlockedExchange(&cs->waiting_for_event, TRUE); ++ ++ /* The main thread might enqueue a finish command and block on it ++ * after the worker thread decided to enter wined3d_cs_wait_event ++ * and before waiting_for_event was set to TRUE. Check again if ++ * the queues are empty */ ++ if (!queue_is_empty(&cs->prio_queue) || !queue_is_empty(&cs->queue)) ++ { ++ /* The main thread might have signalled the event, or be in the process ++ * of doing so. Wait for the event to reset it. ResetEvent is not good ++ * because the main thread might be beween the waiting_for_event reset ++ * and SignalEvent call. */ ++ if (!InterlockedCompareExchange(&cs->waiting_for_event, FALSE, FALSE)) ++ WaitForSingleObject(cs->event, INFINITE); ++ } ++ else ++ { ++ WaitForSingleObject(cs->event, INFINITE); ++ } ++} ++ + static DWORD WINAPI wined3d_cs_run(void *thread_param) + { + struct wined3d_cs *cs = thread_param; +@@ -2833,6 +2867,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) + LONG tail; + char poll = 0; + struct wined3d_cs_queue *queue; ++ unsigned int spin_count = 0; + + TRACE("Started.\n"); + +@@ -2848,21 +2883,27 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) + else + poll++; + +- if (*((volatile LONG *)&cs->prio_queue.head) != cs->prio_queue.tail) ++ if (!queue_is_empty(&cs->prio_queue)) + { + queue = &cs->prio_queue; + } +- else if (*((volatile LONG *)&cs->queue.head) != cs->queue.tail) ++ else if (!queue_is_empty(&cs->queue)) + { + queue = &cs->queue; +- if (*((volatile LONG *)&cs->prio_queue.head) != cs->prio_queue.tail) ++ if (!queue_is_empty(&cs->prio_queue)) + queue = &cs->prio_queue; + } + else + { ++ spin_count++; ++ if (spin_count >= WINED3D_CS_SPIN_COUNT && list_empty(&cs->query_poll_list)) ++ wined3d_cs_wait_event(cs); ++ + continue; + } + ++ spin_count = 0; ++ + tail = queue->tail; + opcode = *(const enum wined3d_cs_op *)&queue->data[tail]; + +@@ -2904,6 +2945,8 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) + { + cs->ops = &wined3d_cs_mt_ops; + ++ cs->event = CreateEventW(NULL, FALSE, FALSE, NULL); ++ + if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL))) + { + ERR("Failed to create wined3d command stream thread.\n"); +@@ -2934,6 +2977,8 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) + CloseHandle(cs->thread); + if (ret != WAIT_OBJECT_0) + ERR("Wait failed (%#x).\n", ret); ++ if (!CloseHandle(cs->event)) ++ ERR("Closing event failed.\n"); + } + + HeapFree(GetProcessHeap(), 0, cs); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 2f7dd75..63b67da 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2583,6 +2583,8 @@ struct wined3d_cs_list + }; + + #define WINED3D_CS_QUEUE_SIZE 0x100000 ++#define WINED3D_CS_SPIN_COUNT 10000000 ++ + struct wined3d_cs_queue + { + LONG head, tail; +@@ -2612,6 +2614,9 @@ struct wined3d_cs + + LONG pending_presents; + struct list query_poll_list; ++ ++ HANDLE event; ++ BOOL waiting_for_event; + }; + + struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From 1bdcaa3e831f627806a00a07fb92ef28502c4f7a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 20 Nov 2013 18:06:02 +0100 -Subject: d3d9/tests: D3DLOCK_NO_DIRTY_UPDATE on managed textures is - temporarily broken. - ---- - dlls/d3d9/tests/visual.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c -index d1aa3d4..6b28d14 100644 ---- a/dlls/d3d9/tests/visual.c -+++ b/dlls/d3d9/tests/visual.c -@@ -16457,7 +16457,7 @@ static void add_dirty_rect_test(void) - fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); - add_dirty_rect_test_draw(device); - color = getPixelColor(device, 320, 240); -- ok(color_match(color, 0x00ff0000, 1), -+ todo_wine ok(color_match(color, 0x00ff0000, 1), - "Expected color 0x00ff0000, got 0x%08x.\n", color); - hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-wined3d-Fence-preload-operations.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-wined3d-Fence-preload-operations.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-wined3d-Fence-preload-operations.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0155-wined3d-Fence-preload-operations.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,89 @@ +From 4a770e26268a89e0f211b42dfdd857f3180bb73e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 24 Oct 2013 22:38:26 +0200 +Subject: wined3d: Fence preload operations. + +Otherwise texture data might get lost, thanks to surface/volume_evict_sysmem: + +1) preload(texture) +2) map(texture) + -> Loads sysmem / sets it with discard map. +3) unmap(texture) + -> enqueues a resource_changed operation +4) preload is executed. + -> Uploads data written in 3. Discards sysmem. Questionable if + DISCARD was passed, but without it, no harm done. + -> texture is only up to date location. +5) resource_changed executed. + -> Discards texture. + +And data is lost. This patch prevents that by stalling the map until the +PreLoad is done. + +What's left open is finding out why anyone (I'm looking at you EVE +online) preloads a texture right before mapping it... +--- + dlls/wined3d/cs.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 8cbca6c..b152a0d 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -2145,6 +2145,8 @@ static UINT wined3d_cs_exec_texture_preload(struct wined3d_cs *cs, const void *d + wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB); + context_release(context); + ++ wined3d_resource_dec_fence(&texture->resource); ++ + return sizeof(*op); + } + +@@ -2156,6 +2158,8 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu + op->opcode = WINED3D_CS_OP_TEXTURE_PRELOAD; + op->texture = texture; + ++ wined3d_resource_inc_fence(&texture->resource); ++ + cs->ops->submit(cs, sizeof(*op)); + } + +@@ -2168,6 +2172,8 @@ static UINT wined3d_cs_exec_surface_preload(struct wined3d_cs *cs, const void *d + wined3d_texture_preload(op->surface->container); + context_release(context); + ++ wined3d_resource_dec_fence(&op->surface->container->resource); ++ + return sizeof(*op); + } + +@@ -2179,6 +2185,8 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa + op->opcode = WINED3D_CS_OP_SURFACE_PRELOAD; + op->surface = surface; + ++ wined3d_resource_inc_fence(&op->surface->container->resource); ++ + cs->ops->submit(cs, sizeof(*op)); + } + +@@ -2300,6 +2308,8 @@ static UINT wined3d_cs_exec_buffer_preload(struct wined3d_cs *cs, const void *da + buffer_internal_preload(op->buffer, context, NULL); + context_release(context); + ++ wined3d_resource_dec_fence(&op->buffer->resource); ++ + return sizeof(*op); + } + +@@ -2311,6 +2321,8 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer + op->opcode = WINED3D_CS_OP_BUFFER_PRELOAD; + op->buffer = buffer; + ++ wined3d_resource_inc_fence(&buffer->resource); ++ + cs->ops->submit(cs, sizeof(*op)); + } + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,26 @@ +From c8083ad9f76ddba995df169c8b2f3486e81bbe02 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 20 Nov 2013 18:04:50 +0100 +Subject: d3d8/tests: D3DLOCK_NO_DIRTY_UPDATE on managed textures is + temporarily broken. + +--- + dlls/d3d8/tests/visual.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c +index a8a771e..9535b69 100644 +--- a/dlls/d3d8/tests/visual.c ++++ b/dlls/d3d8/tests/visual.c +@@ -4998,7 +4998,7 @@ static void add_dirty_rect_test(void) + fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); +- ok(color_match(color, 0x00ff0000, 1), ++ todo_wine ok(color_match(color, 0x00ff0000, 1), + "Expected color 0x00ff0000, got 0x%08x.\n", color); + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-wined3d-Completely-reset-the-state-on-reset.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-wined3d-Completely-reset-the-state-on-reset.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-wined3d-Completely-reset-the-state-on-reset.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0156-wined3d-Completely-reset-the-state-on-reset.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -From eb14a8f5c8dc07cda57b588e11f4b3381a340dcb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 10 Jan 2014 17:57:03 +0100 -Subject: wined3d: Completely reset the state on reset. - ---- - dlls/wined3d/device.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 278bbdc..62b0625 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4531,6 +4531,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - } - wined3d_cs_emit_reset_state(device->cs); - state_cleanup(&device->state); -+ memset(&device->state, 0, sizeof(device->state)); - - if (device->d3d_initialized) - delete_opengl_contexts(device, swapchain); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,26 @@ +From 1bdcaa3e831f627806a00a07fb92ef28502c4f7a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 20 Nov 2013 18:06:02 +0100 +Subject: d3d9/tests: D3DLOCK_NO_DIRTY_UPDATE on managed textures is + temporarily broken. + +--- + dlls/d3d9/tests/visual.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c +index d1aa3d4..6b28d14 100644 +--- a/dlls/d3d9/tests/visual.c ++++ b/dlls/d3d9/tests/visual.c +@@ -16457,7 +16457,7 @@ static void add_dirty_rect_test(void) + fill_surface(surface_managed, 0x0000ff00, D3DLOCK_NO_DIRTY_UPDATE); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); +- ok(color_match(color, 0x00ff0000, 1), ++ todo_wine ok(color_match(color, 0x00ff0000, 1), + "Expected color 0x00ff0000, got 0x%08x.\n", color); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,274 +0,0 @@ -From a46bfa2015c98651461fb18e2e37d21046d89e2b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 16 Mar 2014 14:13:42 +0100 -Subject: wined3d: Send getdc and releasedc through the command stream. - -As with the palette patch just a cheap workaround for a context -activation bug I just regret that I didn't describe more verbously -earlier. I forgot what it was about exactly and can't be bothered to -investigate atm. ---- - dlls/wined3d/cs.c | 58 +++++++++++++++++++++++++ - dlls/wined3d/surface.c | 96 +++++++++++++++++++++--------------------- - dlls/wined3d/wined3d_private.h | 4 ++ - 3 files changed, 110 insertions(+), 48 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 90a8efb..8bd3cd9 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -91,6 +91,8 @@ enum wined3d_cs_op - WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, - WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT, - WINED3D_CS_OP_DELETE_GL_CONTEXTS, -+ WINED3D_CS_OP_GETDC, -+ WINED3D_CS_OP_RELEASEDC, - WINED3D_CS_OP_STOP, - }; - -@@ -543,6 +545,18 @@ struct wined3d_cs_delete_gl_contexts - struct wined3d_swapchain *swapchain; - }; - -+struct wined3d_cs_getdc -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_surface *surface; -+}; -+ -+struct wined3d_cs_releasedc -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_surface *surface; -+}; -+ - static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) - { - LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2693,6 +2707,48 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3 - cs->ops->finish(cs); - } - -+static UINT wined3d_cs_exec_getdc(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_getdc *op = data; -+ -+ wined3d_surface_getdc_cs(op->surface); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) -+{ -+ struct wined3d_cs_getdc *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_GETDC; -+ op->surface = surface; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->finish(cs); -+} -+ -+static UINT wined3d_cs_exec_releasedc(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_releasedc *op = data; -+ -+ wined3d_surface_releasedc_cs(op->surface); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) -+{ -+ struct wined3d_cs_releasedc *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_RELEASEDC; -+ op->surface = surface; -+ -+ cs->ops->submit(cs, sizeof(*op)); -+ cs->ops->finish(cs); -+} -+ - static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2762,6 +2818,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, - /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, - /* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts, -+ /* WINED3D_CS_OP_GETDC */ wined3d_cs_exec_getdc, -+ /* WINED3D_CS_OP_RELEASEDC */ wined3d_cs_exec_releasedc, - }; - - static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 9a4edd5..e1ceeb3 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -2551,48 +2551,23 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - return wined3d_resource_map(&surface->resource, map_desc, rect ? &box : NULL, flags); - } - --HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) -+void wined3d_surface_getdc_cs(struct wined3d_surface *surface) - { -- HRESULT hr; - struct wined3d_device *device = surface->resource.device; - struct wined3d_context *context = NULL; - -- TRACE("surface %p, dc %p.\n", surface, dc); -- -- if (!(surface->container->resource.format_flags & WINED3DFMT_FLAG_GETDC)) -- { -- WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->container->resource.format->id)); -- return WINED3DERR_INVALIDCALL; -- } -- -- if (wined3d_settings.cs_multithreaded) -- { -- struct wined3d_device *device = surface->resource.device; -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -- -- /* Give more detailed info for ddraw. */ -- if (surface->flags & SFLAG_DCINUSE) -- return WINEDDERR_DCALREADYCREATED; -- -- /* Can't GetDC if the surface is locked. */ -- if (surface->resource.map_count) -- return WINED3DERR_INVALIDCALL; -- - if (device->d3d_initialized) - context = context_acquire(surface->resource.device, NULL); - - /* Create a DIB section if there isn't a dc yet. */ - if (!surface->hDC) - { -- hr = surface_create_dib_section(surface); -+ HRESULT hr = surface_create_dib_section(surface); - if (FAILED(hr)) - { - if (context) - context_release(context); -- return WINED3DERR_INVALIDCALL; -+ return; - } - if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY - || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM -@@ -2605,35 +2580,40 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - - if (context) - context_release(context); -- -- surface->flags |= SFLAG_DCINUSE; -- surface->resource.map_count++; -- -- *dc = surface->hDC; -- TRACE("Returning dc %p.\n", *dc); -- -- return WINED3D_OK; - } - --HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -+HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) - { -- TRACE("surface %p, dc %p.\n", surface, dc); -+ struct wined3d_device *device = surface->resource.device; - -- if (!(surface->flags & SFLAG_DCINUSE)) -- return WINEDDERR_NODC; -+ TRACE("surface %p, dc %p.\n", surface, dc); - -- if (surface->hDC != dc) -+ if (!(surface->container->resource.format_flags & WINED3DFMT_FLAG_GETDC)) - { -- WARN("Application tries to release invalid DC %p, surface DC is %p.\n", -- dc, surface->hDC); -- return WINEDDERR_NODC; -+ WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->container->resource.format->id)); -+ return WINED3DERR_INVALIDCALL; - } - -- surface->resource.map_count--; -- surface->flags &= ~SFLAG_DCINUSE; -+ /* Give more detailed info for ddraw. */ -+ if (surface->flags & SFLAG_DCINUSE) -+ return WINEDDERR_DCALREADYCREATED; -+ -+ /* Can't GetDC if the surface is locked. */ -+ if (surface->resource.map_count) -+ return WINED3DERR_INVALIDCALL; -+ -+ surface->flags |= SFLAG_DCINUSE; -+ surface->resource.map_count++; -+ wined3d_cs_emit_getdc(device->cs, surface); -+ *dc = surface->hDC; -+ TRACE("Returning dc %p.\n", *dc); -+ -+ return *dc ? WINED3D_OK : WINED3DERR_INVALIDCALL; -+} - -- if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY -- || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM -+void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) -+{ -+ if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM - && surface->resource.map_binding != WINED3D_LOCATION_DIB)) - { - /* The game Salammbo modifies the surface contents without mapping the surface between -@@ -2654,6 +2634,26 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) - if (context) - context_release(context); - } -+} -+ -+HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -+{ -+ TRACE("surface %p, dc %p.\n", surface, dc); -+ -+ if (!(surface->flags & SFLAG_DCINUSE)) -+ return WINEDDERR_NODC; -+ -+ if (surface->hDC != dc) -+ { -+ WARN("Application tries to release invalid DC %p, surface DC is %p.\n", -+ dc, surface->hDC); -+ return WINEDDERR_NODC; -+ } -+ -+ surface->resource.map_count--; -+ surface->flags &= ~SFLAG_DCINUSE; -+ -+ wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); - - return WINED3D_OK; - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 5865cad..b5a3611 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2512,6 +2512,8 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ - const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; - BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; - void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; -+void wined3d_surface_getdc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; -+void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; - - void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, - const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -@@ -2788,6 +2790,8 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, - struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, - struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; - - /* Direct3D terminology with little modifications. We do not have an issued state - * because only the driver knows about it, but we have a created state because d3d --- -2.4.2 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Completely-reset-the-state-on-reset.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Completely-reset-the-state-on-reset.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Completely-reset-the-state-on-reset.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Completely-reset-the-state-on-reset.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,24 @@ +From eb14a8f5c8dc07cda57b588e11f4b3381a340dcb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 10 Jan 2014 17:57:03 +0100 +Subject: wined3d: Completely reset the state on reset. + +--- + dlls/wined3d/device.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 278bbdc..62b0625 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4531,6 +4531,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + } + wined3d_cs_emit_reset_state(device->cs); + state_cleanup(&device->state); ++ memset(&device->state, 0, sizeof(device->state)); + + if (device->d3d_initialized) + delete_opengl_contexts(device, swapchain); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0158-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -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. - -Otherwise the next unmap will re-assign it with the resource_changed -message. Freeing the actual memory and setting the read pointer to 0 is -the task of the worker thread. - -Wined3d_resource_prepare_bo is only called if the map binding is -LOCATION_BUFFER, and map_heap_memory is only used if the map binding is -LOCATION_SYSMEM. ---- - dlls/wined3d/resource.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 671ab50..1dff0ed 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -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; - } - - BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Send-getdc-and-releasedc-through-the-command.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Send-getdc-and-releasedc-through-the-command.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Send-getdc-and-releasedc-through-the-command.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Send-getdc-and-releasedc-through-the-command.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,274 @@ +From a46bfa2015c98651461fb18e2e37d21046d89e2b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Sun, 16 Mar 2014 14:13:42 +0100 +Subject: wined3d: Send getdc and releasedc through the command stream. + +As with the palette patch just a cheap workaround for a context +activation bug I just regret that I didn't describe more verbously +earlier. I forgot what it was about exactly and can't be bothered to +investigate atm. +--- + dlls/wined3d/cs.c | 58 +++++++++++++++++++++++++ + dlls/wined3d/surface.c | 96 +++++++++++++++++++++--------------------- + dlls/wined3d/wined3d_private.h | 4 ++ + 3 files changed, 110 insertions(+), 48 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 90a8efb..8bd3cd9 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -91,6 +91,8 @@ enum wined3d_cs_op + WINED3D_CS_OP_CREATE_DUMMY_TEXTURES, + WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT, + WINED3D_CS_OP_DELETE_GL_CONTEXTS, ++ WINED3D_CS_OP_GETDC, ++ WINED3D_CS_OP_RELEASEDC, + WINED3D_CS_OP_STOP, + }; + +@@ -543,6 +545,18 @@ struct wined3d_cs_delete_gl_contexts + struct wined3d_swapchain *swapchain; + }; + ++struct wined3d_cs_getdc ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_surface *surface; ++}; ++ ++struct wined3d_cs_releasedc ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_surface *surface; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2693,6 +2707,48 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3 + cs->ops->finish(cs); + } + ++static UINT wined3d_cs_exec_getdc(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_getdc *op = data; ++ ++ wined3d_surface_getdc_cs(op->surface); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) ++{ ++ struct wined3d_cs_getdc *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_GETDC; ++ op->surface = surface; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->finish(cs); ++} ++ ++static UINT wined3d_cs_exec_releasedc(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_releasedc *op = data; ++ ++ wined3d_surface_releasedc_cs(op->surface); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) ++{ ++ struct wined3d_cs_releasedc *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_RELEASEDC; ++ op->surface = surface; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++ cs->ops->finish(cs); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2762,6 +2818,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, + /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, + /* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts, ++ /* WINED3D_CS_OP_GETDC */ wined3d_cs_exec_getdc, ++ /* WINED3D_CS_OP_RELEASEDC */ wined3d_cs_exec_releasedc, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 9a4edd5..e1ceeb3 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -2551,48 +2551,23 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, + return wined3d_resource_map(&surface->resource, map_desc, rect ? &box : NULL, flags); + } + +-HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) ++void wined3d_surface_getdc_cs(struct wined3d_surface *surface) + { +- HRESULT hr; + struct wined3d_device *device = surface->resource.device; + struct wined3d_context *context = NULL; + +- TRACE("surface %p, dc %p.\n", surface, dc); +- +- if (!(surface->container->resource.format_flags & WINED3DFMT_FLAG_GETDC)) +- { +- WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->container->resource.format->id)); +- return WINED3DERR_INVALIDCALL; +- } +- +- if (wined3d_settings.cs_multithreaded) +- { +- struct wined3d_device *device = surface->resource.device; +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } +- +- /* Give more detailed info for ddraw. */ +- if (surface->flags & SFLAG_DCINUSE) +- return WINEDDERR_DCALREADYCREATED; +- +- /* Can't GetDC if the surface is locked. */ +- if (surface->resource.map_count) +- return WINED3DERR_INVALIDCALL; +- + if (device->d3d_initialized) + context = context_acquire(surface->resource.device, NULL); + + /* Create a DIB section if there isn't a dc yet. */ + if (!surface->hDC) + { +- hr = surface_create_dib_section(surface); ++ HRESULT hr = surface_create_dib_section(surface); + if (FAILED(hr)) + { + if (context) + context_release(context); +- return WINED3DERR_INVALIDCALL; ++ return; + } + if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY + || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM +@@ -2605,35 +2580,40 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) + + if (context) + context_release(context); +- +- surface->flags |= SFLAG_DCINUSE; +- surface->resource.map_count++; +- +- *dc = surface->hDC; +- TRACE("Returning dc %p.\n", *dc); +- +- return WINED3D_OK; + } + +-HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) ++HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) + { +- TRACE("surface %p, dc %p.\n", surface, dc); ++ struct wined3d_device *device = surface->resource.device; + +- if (!(surface->flags & SFLAG_DCINUSE)) +- return WINEDDERR_NODC; ++ TRACE("surface %p, dc %p.\n", surface, dc); + +- if (surface->hDC != dc) ++ if (!(surface->container->resource.format_flags & WINED3DFMT_FLAG_GETDC)) + { +- WARN("Application tries to release invalid DC %p, surface DC is %p.\n", +- dc, surface->hDC); +- return WINEDDERR_NODC; ++ WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->container->resource.format->id)); ++ return WINED3DERR_INVALIDCALL; + } + +- surface->resource.map_count--; +- surface->flags &= ~SFLAG_DCINUSE; ++ /* Give more detailed info for ddraw. */ ++ if (surface->flags & SFLAG_DCINUSE) ++ return WINEDDERR_DCALREADYCREATED; ++ ++ /* Can't GetDC if the surface is locked. */ ++ if (surface->resource.map_count) ++ return WINED3DERR_INVALIDCALL; ++ ++ surface->flags |= SFLAG_DCINUSE; ++ surface->resource.map_count++; ++ wined3d_cs_emit_getdc(device->cs, surface); ++ *dc = surface->hDC; ++ TRACE("Returning dc %p.\n", *dc); ++ ++ return *dc ? WINED3D_OK : WINED3DERR_INVALIDCALL; ++} + +- if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY +- || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM ++void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) ++{ ++ if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM + && surface->resource.map_binding != WINED3D_LOCATION_DIB)) + { + /* The game Salammbo modifies the surface contents without mapping the surface between +@@ -2654,6 +2634,26 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) + if (context) + context_release(context); + } ++} ++ ++HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) ++{ ++ TRACE("surface %p, dc %p.\n", surface, dc); ++ ++ if (!(surface->flags & SFLAG_DCINUSE)) ++ return WINEDDERR_NODC; ++ ++ if (surface->hDC != dc) ++ { ++ WARN("Application tries to release invalid DC %p, surface DC is %p.\n", ++ dc, surface->hDC); ++ return WINEDDERR_NODC; ++ } ++ ++ surface->resource.map_count--; ++ surface->flags &= ~SFLAG_DCINUSE; ++ ++ wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); + + return WINED3D_OK; + } +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 5865cad..b5a3611 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2512,6 +2512,8 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ + const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; + BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) DECLSPEC_HIDDEN; + void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; ++void wined3d_surface_getdc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; ++void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; + + void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, + const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +@@ -2788,6 +2790,8 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, + struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, + struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.4.2 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Wait-only-for-the-buffer-to-be-idle.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Wait-only-for-the-buffer-to-be-idle.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Wait-only-for-the-buffer-to-be-idle.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0159-wined3d-Wait-only-for-the-buffer-to-be-idle.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -From 82ec316a058cc2e1894fb64eee1249ff663f112e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 22 Aug 2014 15:52:50 +0200 -Subject: wined3d: Wait only for the buffer to be idle. - -This got lost somewhere during the patch reordering. ---- - dlls/wined3d/buffer.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 15ed760..c0f96e3 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1051,8 +1051,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - } - else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) - { -- FIXME("waiting for cs, flags 0x%04x.\n", flags); -- device->cs->ops->finish(device->cs); -+ wined3d_resource_wait_fence(&buffer->resource); - } - } - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Add-a-comment-about-worker-thread-lag.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Add-a-comment-about-worker-thread-lag.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Add-a-comment-about-worker-thread-lag.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Add-a-comment-about-worker-thread-lag.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -From 7cfd19b8d052ed99f3060d5cab1349ec33e162ad Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 25 Aug 2014 19:57:42 +0200 -Subject: wined3d: Add a comment about worker thread lag. - ---- - dlls/wined3d/cs.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 44930c1..9b890ae 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -677,6 +677,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw - - cs->ops->submit(cs, sizeof(*op)); - -+ /* D3D10 documentation suggests that Windows allows the game to run -+ * 3 frames ahead of the GPU. Increasing this above 1 causes uneven -+ * animation in some games, most notably StarCraft II. The framerates -+ * don't show this problem. The issue is more noticable with vsync -+ * on, but also happens with vsync off. -+ * -+ * In Counter-Strike: Source a frame difference of 3 causes noticable -+ * input delay that makes the game unplayable. */ - while (pending > 1) - pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0); - } --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0160-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,31 @@ +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. + +Otherwise the next unmap will re-assign it with the resource_changed +message. Freeing the actual memory and setting the read pointer to 0 is +the task of the worker thread. + +Wined3d_resource_prepare_bo is only called if the map binding is +LOCATION_BUFFER, and map_heap_memory is only used if the map binding is +LOCATION_SYSMEM. +--- + dlls/wined3d/resource.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 671ab50..1dff0ed 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -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; + } + + BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Remove-the-texture-destroy-glFinish.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Remove-the-texture-destroy-glFinish.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Remove-the-texture-destroy-glFinish.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Remove-the-texture-destroy-glFinish.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -From c064211d94884f2c131c5496e60f591511c5462d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 28 Aug 2014 15:02:12 +0200 -Subject: wined3d: Remove the texture destroy glFinish. - -This should work now that surface_decref is essentially gone and the -container is never unset. ---- - dlls/wined3d/texture.c | 7 ------- - 1 file changed, 7 deletions(-) - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 09ac38f..6f78292 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -146,13 +146,6 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) - - TRACE("texture %p.\n", texture); - -- /* Because sub_resource_cleanup interferes with GL resources */ -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- device->cs->ops->finish(device->cs); -- } -- - for (i = 0; i < sub_count; ++i) - { - struct wined3d_resource *sub_resource = texture->sub_resources[i]; --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Wait-only-for-the-buffer-to-be-idle.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Wait-only-for-the-buffer-to-be-idle.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Wait-only-for-the-buffer-to-be-idle.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0161-wined3d-Wait-only-for-the-buffer-to-be-idle.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,27 @@ +From 82ec316a058cc2e1894fb64eee1249ff663f112e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 22 Aug 2014 15:52:50 +0200 +Subject: wined3d: Wait only for the buffer to be idle. + +This got lost somewhere during the patch reordering. +--- + dlls/wined3d/buffer.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 15ed760..c0f96e3 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1051,8 +1051,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + } + else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) + { +- FIXME("waiting for cs, flags 0x%04x.\n", flags); +- device->cs->ops->finish(device->cs); ++ wined3d_resource_wait_fence(&buffer->resource); + } + } + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Add-a-comment-about-worker-thread-lag.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Add-a-comment-about-worker-thread-lag.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Add-a-comment-about-worker-thread-lag.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Add-a-comment-about-worker-thread-lag.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,31 @@ +From 7cfd19b8d052ed99f3060d5cab1349ec33e162ad Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Mon, 25 Aug 2014 19:57:42 +0200 +Subject: wined3d: Add a comment about worker thread lag. + +--- + dlls/wined3d/cs.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index 44930c1..9b890ae 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -677,6 +677,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw + + cs->ops->submit(cs, sizeof(*op)); + ++ /* D3D10 documentation suggests that Windows allows the game to run ++ * 3 frames ahead of the GPU. Increasing this above 1 causes uneven ++ * animation in some games, most notably StarCraft II. The framerates ++ * don't show this problem. The issue is more noticable with vsync ++ * on, but also happens with vsync off. ++ * ++ * In Counter-Strike: Source a frame difference of 3 causes noticable ++ * input delay that makes the game unplayable. */ + while (pending > 1) + pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0); + } +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Move-FBO-destruction-into-the-worker-thread.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Move-FBO-destruction-into-the-worker-thread.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Move-FBO-destruction-into-the-worker-thread.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0162-wined3d-Move-FBO-destruction-into-the-worker-thread.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -From 05b16589d0f658e929eaafb416d4b19bd88bb47d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 28 Aug 2014 16:09:45 +0200 -Subject: wined3d: Move FBO destruction into the worker thread. - -This protects the context array against races. ---- - dlls/wined3d/device.c | 2 -- - dlls/wined3d/resource.c | 2 ++ - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 62b0625..b5ce2c3 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4638,8 +4638,6 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso - - TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); - -- context_resource_released(device, resource, type); -- - switch (type) - { - case WINED3D_RTYPE_SURFACE: -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 8069160..cd60356 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -159,6 +159,8 @@ void wined3d_resource_free_bo(struct wined3d_resource *resource) - - void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) - { -+ context_resource_released(resource->device, resource, resource->type); -+ - if (resource->buffer) - wined3d_resource_free_bo(resource); - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -From 54eb3e212afc243fef25a46017ae3d822014f336 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 28 Aug 2014 16:10:09 +0200 -Subject: wined3d: Don't incref / decref textures in color / depth fill blits. - -See comment in the code. The solution is not particularly nice. A better -approach may be to handle them in ddraw, where we have a permanent view -for the surface. ---- - dlls/wined3d/surface.c | 52 +++++++++++++++++++++++++----------------- - dlls/wined3d/view.c | 20 ---------------- - dlls/wined3d/wined3d_private.h | 1 - - 3 files changed, 31 insertions(+), 42 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 1ccbe35..82485f3 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -4124,19 +4124,26 @@ static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d - const RECT *dst_rect, const struct wined3d_color *color) - { - const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; -- struct wined3d_rendertarget_view *view; -- struct wined3d_fb_state fb = {&view, NULL}; -- HRESULT hr; -- -- if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(dst_surface, -- NULL, &wined3d_null_parent_ops, &view))) -- { -- ERR("Failed to create rendertarget view, hr %#x.\n", hr); -- return hr; -- } -+ struct wined3d_rendertarget_view view, *view_ptr = &view; -+ struct wined3d_fb_state fb = {&view_ptr, NULL, 1}; -+ struct wined3d_texture *texture = dst_surface->container; -+ -+ /* Can't incref / decref the resource here. This is executed inside the worker -+ * thread. Playing with the refcount here makes the worker thread visible to -+ * the client lib. Problems occur when the worker thread happens to hold the -+ * last reference and the resource destruction callbacks are called from the -+ * wrong thread. */ -+ view.resource = &texture->resource; -+ view.parent = NULL; -+ view.parent_ops = &wined3d_null_parent_ops; -+ view.format = dst_surface->resource.format; -+ view.buffer_offset = 0; -+ view.width = dst_surface->resource.width; -+ view.height = dst_surface->resource.height; -+ view.depth = 1; -+ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; - - device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); -- wined3d_rendertarget_view_decref_worker(view); - - return WINED3D_OK; - } -@@ -4145,18 +4152,21 @@ static HRESULT ffp_blit_depth_fill(struct wined3d_device *device, struct wined3d - const RECT *dst_rect, float depth) - { - const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; -- struct wined3d_fb_state fb = {NULL, NULL}; -- HRESULT hr; -- -- if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(dst_surface, -- NULL, &wined3d_null_parent_ops, &fb.depth_stencil))) -- { -- ERR("Failed to create rendertarget view, hr %#x.\n", hr); -- return hr; -- } -+ struct wined3d_rendertarget_view view; -+ struct wined3d_fb_state fb = {NULL, &view}; -+ struct wined3d_texture *texture = dst_surface->container; -+ -+ view.resource = &dst_surface->container->resource; -+ view.parent = NULL; -+ view.parent_ops = &wined3d_null_parent_ops; -+ view.format = dst_surface->resource.format; -+ view.buffer_offset = 0; -+ view.width = dst_surface->resource.width; -+ view.height = dst_surface->resource.height; -+ view.depth = 1; -+ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; - - device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); -- wined3d_rendertarget_view_decref_worker(fb.depth_stencil); - - return WINED3D_OK; - } -diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c -index 56eb7b3..870f1df 100644 ---- a/dlls/wined3d/view.c -+++ b/dlls/wined3d/view.c -@@ -58,26 +58,6 @@ ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *v - return refcount; - } - --/* Ugly hack for ffp_blit_depth_fill that allows destroying a view from inside the -- * worker thread. */ --ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) --{ -- ULONG refcount = InterlockedDecrement(&view->refcount); -- -- TRACE("%p decreasing refcount to %u.\n", view, refcount); -- -- if (!refcount) -- { -- /* Call wined3d_object_destroyed() before releasing the resource, -- * since releasing the resource may end up destroying the parent. */ -- view->parent_ops->wined3d_object_destroyed(view->parent); -- wined3d_resource_decref(view->resource); -- wined3d_rendertarget_view_destroy(view); -- } -- -- return refcount; --} -- - void * CDECL wined3d_rendertarget_view_get_parent(const struct wined3d_rendertarget_view *view) - { - TRACE("view %p.\n", view); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 3abd0a8..88329e5 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -2859,7 +2859,6 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( - return surface_from_resource(resource); - } - --ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; - void wined3d_rendertarget_view_destroy(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; - - struct wined3d_shader_resource_view --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Remove-the-texture-destroy-glFinish.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Remove-the-texture-destroy-glFinish.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Remove-the-texture-destroy-glFinish.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0163-wined3d-Remove-the-texture-destroy-glFinish.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,32 @@ +From c064211d94884f2c131c5496e60f591511c5462d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 28 Aug 2014 15:02:12 +0200 +Subject: wined3d: Remove the texture destroy glFinish. + +This should work now that surface_decref is essentially gone and the +container is never unset. +--- + dlls/wined3d/texture.c | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 09ac38f..6f78292 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -146,13 +146,6 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) + + TRACE("texture %p.\n", texture); + +- /* Because sub_resource_cleanup interferes with GL resources */ +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- device->cs->ops->finish(device->cs); +- } +- + for (i = 0; i < sub_count; ++i) + { + struct wined3d_resource *sub_resource = texture->sub_resources[i]; +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-wined3d-Move-FBO-destruction-into-the-worker-thread.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-wined3d-Move-FBO-destruction-into-the-worker-thread.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-wined3d-Move-FBO-destruction-into-the-worker-thread.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-wined3d-Move-FBO-destruction-into-the-worker-thread.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,40 @@ +From 05b16589d0f658e929eaafb416d4b19bd88bb47d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 28 Aug 2014 16:09:45 +0200 +Subject: wined3d: Move FBO destruction into the worker thread. + +This protects the context array against races. +--- + dlls/wined3d/device.c | 2 -- + dlls/wined3d/resource.c | 2 ++ + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 62b0625..b5ce2c3 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4638,8 +4638,6 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso + + TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); + +- context_resource_released(device, resource, type); +- + switch (type) + { + case WINED3D_RTYPE_SURFACE: +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 8069160..cd60356 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -159,6 +159,8 @@ void wined3d_resource_free_bo(struct wined3d_resource *resource) + + void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) + { ++ context_resource_released(resource->device, resource, resource->type); ++ + if (resource->buffer) + wined3d_resource_free_bo(resource); + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-Winex11-complain-about-glfinish.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-Winex11-complain-about-glfinish.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-Winex11-complain-about-glfinish.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0164-Winex11-complain-about-glfinish.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -From 422cdfa68ac69e3bbbc08a70b13fdc2afc8fd505 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 29 Aug 2014 12:12:11 +0200 -Subject: Winex11: complain about glfinish - ---- - dlls/winex11.drv/opengl.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c -index 7b8ba82..42a7498 100644 ---- a/dlls/winex11.drv/opengl.c -+++ b/dlls/winex11.drv/opengl.c -@@ -1983,6 +1983,7 @@ static void wglFinish(void) - escape.code = X11DRV_FLUSH_GL_DRAWABLE; - escape.gl_drawable = 0; - -+ ERR("glFinish\n"); - if ((gl = get_gl_drawable( WindowFromDC( ctx->hdc ), 0 ))) - { - switch (gl->type) -@@ -2008,6 +2009,7 @@ static void wglFlush(void) - escape.code = X11DRV_FLUSH_GL_DRAWABLE; - escape.gl_drawable = 0; - -+ ERR("glFlush\n"); - if ((gl = get_gl_drawable( WindowFromDC( ctx->hdc ), 0 ))) - { - switch (gl->type) --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,134 @@ +From 54eb3e212afc243fef25a46017ae3d822014f336 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 28 Aug 2014 16:10:09 +0200 +Subject: wined3d: Don't incref / decref textures in color / depth fill blits. + +See comment in the code. The solution is not particularly nice. A better +approach may be to handle them in ddraw, where we have a permanent view +for the surface. +--- + dlls/wined3d/surface.c | 52 +++++++++++++++++++++++++----------------- + dlls/wined3d/view.c | 20 ---------------- + dlls/wined3d/wined3d_private.h | 1 - + 3 files changed, 31 insertions(+), 42 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 1ccbe35..82485f3 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -4124,19 +4124,26 @@ static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d + const RECT *dst_rect, const struct wined3d_color *color) + { + const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; +- struct wined3d_rendertarget_view *view; +- struct wined3d_fb_state fb = {&view, NULL}; +- HRESULT hr; +- +- if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(dst_surface, +- NULL, &wined3d_null_parent_ops, &view))) +- { +- ERR("Failed to create rendertarget view, hr %#x.\n", hr); +- return hr; +- } ++ struct wined3d_rendertarget_view view, *view_ptr = &view; ++ struct wined3d_fb_state fb = {&view_ptr, NULL, 1}; ++ struct wined3d_texture *texture = dst_surface->container; ++ ++ /* Can't incref / decref the resource here. This is executed inside the worker ++ * thread. Playing with the refcount here makes the worker thread visible to ++ * the client lib. Problems occur when the worker thread happens to hold the ++ * last reference and the resource destruction callbacks are called from the ++ * wrong thread. */ ++ view.resource = &texture->resource; ++ view.parent = NULL; ++ view.parent_ops = &wined3d_null_parent_ops; ++ view.format = dst_surface->resource.format; ++ view.buffer_offset = 0; ++ view.width = dst_surface->resource.width; ++ view.height = dst_surface->resource.height; ++ view.depth = 1; ++ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; + + device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); +- wined3d_rendertarget_view_decref_worker(view); + + return WINED3D_OK; + } +@@ -4145,18 +4152,21 @@ static HRESULT ffp_blit_depth_fill(struct wined3d_device *device, struct wined3d + const RECT *dst_rect, float depth) + { + const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; +- struct wined3d_fb_state fb = {NULL, NULL}; +- HRESULT hr; +- +- if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(dst_surface, +- NULL, &wined3d_null_parent_ops, &fb.depth_stencil))) +- { +- ERR("Failed to create rendertarget view, hr %#x.\n", hr); +- return hr; +- } ++ struct wined3d_rendertarget_view view; ++ struct wined3d_fb_state fb = {NULL, &view}; ++ struct wined3d_texture *texture = dst_surface->container; ++ ++ view.resource = &dst_surface->container->resource; ++ view.parent = NULL; ++ view.parent_ops = &wined3d_null_parent_ops; ++ view.format = dst_surface->resource.format; ++ view.buffer_offset = 0; ++ view.width = dst_surface->resource.width; ++ view.height = dst_surface->resource.height; ++ view.depth = 1; ++ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; + + device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); +- wined3d_rendertarget_view_decref_worker(fb.depth_stencil); + + return WINED3D_OK; + } +diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c +index 56eb7b3..870f1df 100644 +--- a/dlls/wined3d/view.c ++++ b/dlls/wined3d/view.c +@@ -58,26 +58,6 @@ ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *v + return refcount; + } + +-/* Ugly hack for ffp_blit_depth_fill that allows destroying a view from inside the +- * worker thread. */ +-ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) +-{ +- ULONG refcount = InterlockedDecrement(&view->refcount); +- +- TRACE("%p decreasing refcount to %u.\n", view, refcount); +- +- if (!refcount) +- { +- /* Call wined3d_object_destroyed() before releasing the resource, +- * since releasing the resource may end up destroying the parent. */ +- view->parent_ops->wined3d_object_destroyed(view->parent); +- wined3d_resource_decref(view->resource); +- wined3d_rendertarget_view_destroy(view); +- } +- +- return refcount; +-} +- + void * CDECL wined3d_rendertarget_view_get_parent(const struct wined3d_rendertarget_view *view) + { + TRACE("view %p.\n", view); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 3abd0a8..88329e5 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2859,7 +2859,6 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( + return surface_from_resource(resource); + } + +-ULONG wined3d_rendertarget_view_decref_worker(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; + void wined3d_rendertarget_view_destroy(struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; + + struct wined3d_shader_resource_view +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0165-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -From 08dd8c4b88837bd88c112f831b589d81339cd286 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 29 Aug 2014 14:46:19 +0200 -Subject: wined3d: Make sure the new window is set up before setting up a - context. - ---- - dlls/wined3d/device.c | 31 +++++++++++++++++++++---------- - 1 file changed, 21 insertions(+), 10 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index b5ce2c3..63eb87e 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4269,6 +4269,27 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - } - } - -+ /* Free implicit resources and wait for the command stream before modifying -+ * swapchain parameters. After modifying the swapchain parameters a new GL -+ * context may be acquired by the worker thread. This causes problems in the -+ * d3d8/9 test that passes a hidden window as the new device window. -+ * SetPixelFormat will call SetWindowPos inside the X11 driver, which sends -+ * a message to the window to query the icon. Since the worker thread is -+ * not the thread that created the window and the d3d8 test does not run -+ * an event loop this deadlocks. Set up the window first from the main thread -+ * before calling SetPixelFormat from the worker thread to avoid this. */ -+ if (device->auto_depth_stencil_view) -+ { -+ wined3d_rendertarget_view_decref(device->auto_depth_stencil_view); -+ device->auto_depth_stencil_view = NULL; -+ } -+ if (device->back_buffer_view) -+ { -+ wined3d_rendertarget_view_decref(device->back_buffer_view); -+ device->back_buffer_view = NULL; -+ } -+ device->cs->ops->finish(device->cs); -+ - /* Is it necessary to recreate the gl context? Actually every setting can be changed - * on an existing gl context, so there's no real need for recreation. - * -@@ -4404,11 +4425,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - } - } - -- if (device->auto_depth_stencil_view) -- { -- wined3d_rendertarget_view_decref(device->auto_depth_stencil_view); -- device->auto_depth_stencil_view = NULL; -- } - if (swapchain->desc.enable_auto_depth_stencil) - { - struct wined3d_resource_desc surface_desc; -@@ -4446,11 +4462,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); - } - -- if (device->back_buffer_view) -- { -- wined3d_rendertarget_view_decref(device->back_buffer_view); -- device->back_buffer_view = NULL; -- } - if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface( - surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)), - NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-wined3d-Remove-the-device_reset-CS-sync-fixme.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-wined3d-Remove-the-device_reset-CS-sync-fixme.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-wined3d-Remove-the-device_reset-CS-sync-fixme.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-wined3d-Remove-the-device_reset-CS-sync-fixme.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -From 0dafdc38e8dd712f59666224ed22ffe91cc72a76 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Fri, 29 Aug 2014 14:46:55 +0200 -Subject: wined3d: Remove the device_reset CS sync fixme. - ---- - dlls/wined3d/device.c | 9 ++------- - 1 file changed, 2 insertions(+), 7 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 63eb87e..7bc6aeb 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4215,13 +4215,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - unsigned int i; - - TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback); -- -- if (wined3d_settings.cs_multithreaded) -- { -- FIXME("Waiting for cs.\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); - - if (!(swapchain = wined3d_device_get_swapchain(device, 0))) - { --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-Winex11-complain-about-glfinish.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-Winex11-complain-about-glfinish.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-Winex11-complain-about-glfinish.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0166-Winex11-complain-about-glfinish.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,32 @@ +From 422cdfa68ac69e3bbbc08a70b13fdc2afc8fd505 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 29 Aug 2014 12:12:11 +0200 +Subject: Winex11: complain about glfinish + +--- + dlls/winex11.drv/opengl.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c +index 7b8ba82..42a7498 100644 +--- a/dlls/winex11.drv/opengl.c ++++ b/dlls/winex11.drv/opengl.c +@@ -1983,6 +1983,7 @@ static void wglFinish(void) + escape.code = X11DRV_FLUSH_GL_DRAWABLE; + escape.gl_drawable = 0; + ++ ERR("glFinish\n"); + if ((gl = get_gl_drawable( WindowFromDC( ctx->hdc ), 0 ))) + { + switch (gl->type) +@@ -2008,6 +2009,7 @@ static void wglFlush(void) + escape.code = X11DRV_FLUSH_GL_DRAWABLE; + escape.gl_drawable = 0; + ++ ERR("glFlush\n"); + if ((gl = get_gl_drawable( WindowFromDC( ctx->hdc ), 0 ))) + { + switch (gl->type) +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,69 @@ +From 08dd8c4b88837bd88c112f831b589d81339cd286 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 29 Aug 2014 14:46:19 +0200 +Subject: wined3d: Make sure the new window is set up before setting up a + context. + +--- + dlls/wined3d/device.c | 31 +++++++++++++++++++++---------- + 1 file changed, 21 insertions(+), 10 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index b5ce2c3..63eb87e 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4269,6 +4269,27 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + } + } + ++ /* Free implicit resources and wait for the command stream before modifying ++ * swapchain parameters. After modifying the swapchain parameters a new GL ++ * context may be acquired by the worker thread. This causes problems in the ++ * d3d8/9 test that passes a hidden window as the new device window. ++ * SetPixelFormat will call SetWindowPos inside the X11 driver, which sends ++ * a message to the window to query the icon. Since the worker thread is ++ * not the thread that created the window and the d3d8 test does not run ++ * an event loop this deadlocks. Set up the window first from the main thread ++ * before calling SetPixelFormat from the worker thread to avoid this. */ ++ if (device->auto_depth_stencil_view) ++ { ++ wined3d_rendertarget_view_decref(device->auto_depth_stencil_view); ++ device->auto_depth_stencil_view = NULL; ++ } ++ if (device->back_buffer_view) ++ { ++ wined3d_rendertarget_view_decref(device->back_buffer_view); ++ device->back_buffer_view = NULL; ++ } ++ device->cs->ops->finish(device->cs); ++ + /* Is it necessary to recreate the gl context? Actually every setting can be changed + * on an existing gl context, so there's no real need for recreation. + * +@@ -4404,11 +4425,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + } + } + +- if (device->auto_depth_stencil_view) +- { +- wined3d_rendertarget_view_decref(device->auto_depth_stencil_view); +- device->auto_depth_stencil_view = NULL; +- } + if (swapchain->desc.enable_auto_depth_stencil) + { + struct wined3d_resource_desc surface_desc; +@@ -4446,11 +4462,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); + } + +- if (device->back_buffer_view) +- { +- wined3d_rendertarget_view_decref(device->back_buffer_view); +- device->back_buffer_view = NULL; +- } + if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface( + surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)), + NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0167-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -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. - ---- - dlls/wined3d/buffer.c | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -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(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) -+ { -+ /* OSX doesn't do non-blocking asynchonous glBufferSubData like Linux drivers do, so we want to set -+ * GL_BUFFER_FLUSHING_UNMAP_APPLE to GL_FALSE. This means we have to do synchonization ourselves. */ -+ buffer_sync_apple(This, 0, gl_info); -+ } - - while (This->modified_areas) - { -@@ -1035,9 +1041,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - buffer->flags |= WINED3D_BUFFER_DISCARD; - buffer->ignore_discard = TRUE; - } -+ else if (!(flags & WINED3D_MAP_NOOVERWRITE)) -+ buffer->flags |= WINED3D_BUFFER_SYNC; - } -- if (!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD))) -- buffer->flags |= WINED3D_BUFFER_SYNC; - } - - if (wined3d_settings.cs_multithreaded && count == 1) -@@ -1052,6 +1058,10 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) - { - wined3d_resource_wait_fence(&buffer->resource); -+ /* Writing to the (otherwise worker thread controlled) -+ * flags field is OK here since the wait_fence call made -+ * sure the buffer is idle. */ -+ buffer->flags |= WINED3D_BUFFER_SYNC; - } - } - --- -2.2.1 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Remove-the-device_reset-CS-sync-fixme.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Remove-the-device_reset-CS-sync-fixme.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Remove-the-device_reset-CS-sync-fixme.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Remove-the-device_reset-CS-sync-fixme.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,32 @@ +From 0dafdc38e8dd712f59666224ed22ffe91cc72a76 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 29 Aug 2014 14:46:55 +0200 +Subject: wined3d: Remove the device_reset CS sync fixme. + +--- + dlls/wined3d/device.c | 9 ++------- + 1 file changed, 2 insertions(+), 7 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index 63eb87e..7bc6aeb 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -4215,13 +4215,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, + unsigned int i; + + TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback); +- +- if (wined3d_settings.cs_multithreaded) +- { +- FIXME("Waiting for cs.\n"); +- wined3d_cs_emit_glfinish(device->cs); +- device->cs->ops->finish(device->cs); +- } ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); + + if (!(swapchain = wined3d_device_get_swapchain(device, 0))) + { +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0168-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -From ba0d7248f185c8d6024f0d92b8c87b2d7153317c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 3 Sep 2014 20:20:39 +0200 -Subject: wined3d: Wait for the resource to be idle when destroying user memory - surfaces. - ---- - dlls/wined3d/surface.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 82485f3..3557c00 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -84,6 +84,8 @@ void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) - static void surface_cleanup(struct wined3d_surface *surface) - { - struct wined3d_surface *overlay, *cur; -+ struct wined3d_cs *cs = surface->resource.device->cs; -+ BOOL user_mem = surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY; - - TRACE("surface %p.\n", surface); - -@@ -97,7 +99,13 @@ static void surface_cleanup(struct wined3d_surface *surface) - } - - resource_cleanup(&surface->resource); -- wined3d_cs_emit_surface_cleanup(surface->resource.device->cs, surface); -+ wined3d_cs_emit_surface_cleanup(cs, surface); -+ -+ /* Wait for the CS to finish operations on this surface when user memory was in use. -+ * The application is allowed to free the memory after texture / surface destruction -+ * returns. */ -+ if (user_mem) -+ wined3d_resource_wait_fence(&surface->container->resource); - } - - void wined3d_surface_destroy(struct wined3d_surface *surface) --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0169-wined3d-Don-t-sync-on-redundant-discard-calls.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0169-wined3d-Don-t-sync-on-redundant-discard-calls.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0169-wined3d-Don-t-sync-on-redundant-discard-calls.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0169-wined3d-Don-t-sync-on-redundant-discard-calls.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From 4e89934c223fd43aab2679042c7c808c8200aa68 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 8 Sep 2014 14:53:57 +0200 -Subject: wined3d: Don't sync on redundant discard calls. - ---- - dlls/wined3d/buffer.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index d743f0a..1081247 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1055,7 +1055,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN - wined3d_resource_allocate_sysmem(&buffer->resource); - wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); - } -- else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) -+ else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY)) && !buffer->ignore_discard) - { - wined3d_resource_wait_fence(&buffer->resource); - /* Writing to the (otherwise worker thread controlled) --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0169-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0169-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0169-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0169-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,52 @@ +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. + +--- + dlls/wined3d/buffer.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +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(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) ++ { ++ /* OSX doesn't do non-blocking asynchonous glBufferSubData like Linux drivers do, so we want to set ++ * GL_BUFFER_FLUSHING_UNMAP_APPLE to GL_FALSE. This means we have to do synchonization ourselves. */ ++ buffer_sync_apple(This, 0, gl_info); ++ } + + while (This->modified_areas) + { +@@ -1035,9 +1041,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + buffer->flags |= WINED3D_BUFFER_DISCARD; + buffer->ignore_discard = TRUE; + } ++ else if (!(flags & WINED3D_MAP_NOOVERWRITE)) ++ buffer->flags |= WINED3D_BUFFER_SYNC; + } +- if (!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD))) +- buffer->flags |= WINED3D_BUFFER_SYNC; + } + + if (wined3d_settings.cs_multithreaded && count == 1) +@@ -1052,6 +1058,10 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) + { + wined3d_resource_wait_fence(&buffer->resource); ++ /* Writing to the (otherwise worker thread controlled) ++ * flags field is OK here since the wait_fence call made ++ * sure the buffer is idle. */ ++ buffer->flags |= WINED3D_BUFFER_SYNC; + } + } + +-- +2.2.1 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0170-wined3d-Don-t-discard-new-buffers.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0170-wined3d-Don-t-discard-new-buffers.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0170-wined3d-Don-t-discard-new-buffers.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0170-wined3d-Don-t-discard-new-buffers.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -From 6f08171470d477868721be4e6a1f1178856340d4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 8 Sep 2014 14:57:37 +0200 -Subject: wined3d: Don't discard new buffers. - ---- - dlls/wined3d/buffer.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 1081247..e6e56bb 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1196,6 +1196,7 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device - return hr; - } - buffer->buffer_type_hint = bind_hint; -+ buffer->ignore_discard = TRUE; - - TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage, - debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory, buffer); --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0170-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0170-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0170-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0170-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,41 @@ +From ba0d7248f185c8d6024f0d92b8c87b2d7153317c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Wed, 3 Sep 2014 20:20:39 +0200 +Subject: wined3d: Wait for the resource to be idle when destroying user memory + surfaces. + +--- + dlls/wined3d/surface.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 82485f3..3557c00 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -84,6 +84,8 @@ void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) + static void surface_cleanup(struct wined3d_surface *surface) + { + struct wined3d_surface *overlay, *cur; ++ struct wined3d_cs *cs = surface->resource.device->cs; ++ BOOL user_mem = surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY; + + TRACE("surface %p.\n", surface); + +@@ -97,7 +99,13 @@ static void surface_cleanup(struct wined3d_surface *surface) + } + + resource_cleanup(&surface->resource); +- wined3d_cs_emit_surface_cleanup(surface->resource.device->cs, surface); ++ wined3d_cs_emit_surface_cleanup(cs, surface); ++ ++ /* Wait for the CS to finish operations on this surface when user memory was in use. ++ * The application is allowed to free the memory after texture / surface destruction ++ * returns. */ ++ if (user_mem) ++ wined3d_resource_wait_fence(&surface->container->resource); + } + + void wined3d_surface_destroy(struct wined3d_surface *surface) +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0171-wined3d-Don-t-sync-on-redundant-discard-calls.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0171-wined3d-Don-t-sync-on-redundant-discard-calls.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0171-wined3d-Don-t-sync-on-redundant-discard-calls.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0171-wined3d-Don-t-sync-on-redundant-discard-calls.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,25 @@ +From 4e89934c223fd43aab2679042c7c808c8200aa68 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Mon, 8 Sep 2014 14:53:57 +0200 +Subject: wined3d: Don't sync on redundant discard calls. + +--- + dlls/wined3d/buffer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index d743f0a..1081247 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1055,7 +1055,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + wined3d_resource_allocate_sysmem(&buffer->resource); + wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); + } +- else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY))) ++ else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY)) && !buffer->ignore_discard) + { + wined3d_resource_wait_fence(&buffer->resource); + /* Writing to the (otherwise worker thread controlled) +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0171-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0171-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0171-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0171-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -From 180d8cf49a4f4481b08e373e8c8a75c116094e63 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 8 Sep 2014 15:09:44 +0200 -Subject: wined3d: Don't try to sync VBOs manually on OSX with CSMT. - -This fixes a performance regression in some games caused by -aaf4849718c3c3a763c460a24a51dd6c6b55524a. - -GL_ARB_sync and GL_APPLE_fence seem to be fairly slow on OSX. Putting the -buffer back into synchonized mode and synchronizing all future uploads -is about twice as fast. This was benchmarked with 3DMark2001. Gunpoint, -another game that depends on synchronized dynamic buffer maps, feels -smoother, although the lack of a benchmark mode makes testing this difficult. - -This assumes that if a game maps a dynamic buffer without NOOVERWRITE or -DISCARD once it will always do so. I have not seen a game yet that mixes -async and sync maps. If the game mixes them, the wined3d-side CS will still -update the buffer asynchronously. Only the worker thread -> GL copy is -synchronized, as it used to be for all buffers in cx13. - -This patch only changes the double-buffered (used for CSMT) codepath. Making -the same change to the glMapBuffer codepath improves 3DMark2001 performance -as well, but the difference is much smaller. I will leave the manual sync -code in place until we have a game that clearly profits from this change. ---- - dlls/wined3d/buffer.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index e6e56bb..b33dd5a 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -676,8 +676,14 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined - else if (flags & WINED3D_BUFFER_SYNC && This->flags & WINED3D_BUFFER_APPLESYNC) - { - /* OSX doesn't do non-blocking asynchonous glBufferSubData like Linux drivers do, so we want to set -- * GL_BUFFER_FLUSHING_UNMAP_APPLE to GL_FALSE. This means we have to do synchonization ourselves. */ -- buffer_sync_apple(This, 0, gl_info); -+ * GL_BUFFER_SERIALIZED_MODIFY_APPLE to GL_FALSE. Unfortunately ARB_sync and APPLE_fence are pretty -+ * slow on OSX. Putting the buffer back into synchronized mode for future maps is a lot faster. -+ * (GeForce 650M, Mavericks). The difference between ARB_sync and normal buffer operation is small -+ * in the glMapBuffer codepath without CSMT. */ -+ glFinish(); -+ GL_EXTCALL(glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)); -+ checkGLcall("glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)"); -+ This->flags &= ~WINED3D_BUFFER_APPLESYNC; - } - - while (This->modified_areas) --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0172-wined3d-Don-t-discard-new-buffers.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0172-wined3d-Don-t-discard-new-buffers.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0172-wined3d-Don-t-discard-new-buffers.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0172-wined3d-Don-t-discard-new-buffers.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,24 @@ +From 6f08171470d477868721be4e6a1f1178856340d4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Mon, 8 Sep 2014 14:57:37 +0200 +Subject: wined3d: Don't discard new buffers. + +--- + dlls/wined3d/buffer.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 1081247..e6e56bb 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1196,6 +1196,7 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + return hr; + } + buffer->buffer_type_hint = bind_hint; ++ buffer->ignore_discard = TRUE; + + TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage, + debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory, buffer); +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0172-wined3d-Render-target-lock-hack.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0172-wined3d-Render-target-lock-hack.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0172-wined3d-Render-target-lock-hack.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0172-wined3d-Render-target-lock-hack.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ -From f23d42ca6a96a3d257fc57dbae8d5ebd3620e4b7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Tue, 23 Sep 2014 22:18:56 +0200 -Subject: wined3d: Render target lock hack - ---- - dlls/wined3d/resource.c | 17 +++++++++++++++++ - dlls/wined3d/wined3d_main.c | 7 +++++++ - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 25 insertions(+) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index cd60356..dc36dd5 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -777,6 +777,17 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, - TRACE("resource %p, map_desc %p, box %p, flags %#x.\n", - resource, map_desc, box, flags); - -+ if (resource->usage & WINED3DUSAGE_RENDERTARGET && wined3d_settings.ignore_rt_map) -+ { -+ WARN("Ignoring render target map, only finishing CS.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ map_desc->row_pitch = 0; -+ map_desc->slice_pitch = 0; -+ map_desc->data = NULL; -+ device->cs->ops->finish(device->cs); -+ return WINED3D_OK; -+ } -+ - if (resource->map_count) - { - WARN("Volume is already mapped.\n"); -@@ -880,6 +891,12 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) - struct wined3d_device *device = resource->device; - TRACE("resource %p.\n", resource); - -+ if (resource->usage & WINED3DUSAGE_RENDERTARGET && wined3d_settings.ignore_rt_map) -+ { -+ WARN("Ignoring render target unmap.\n"); -+ return WINED3D_OK; -+ } -+ - if (!resource->map_count) - { - WARN("Trying to unlock an unlocked resource %p.\n", resource); -diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c -index e6dc444..a1e4e6c 100644 ---- a/dlls/wined3d/wined3d_main.c -+++ b/dlls/wined3d/wined3d_main.c -@@ -86,6 +86,7 @@ struct wined3d_settings wined3d_settings = - ~0U, /* No PS shader model limit by default. */ - FALSE, /* 3D support enabled by default. */ - FALSE, /* No multithreaded CS by default. */ -+ FALSE, /* Do not ignore render target maps. */ - }; - - struct wined3d * CDECL wined3d_create(DWORD flags) -@@ -311,6 +312,12 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) - TRACE("Enabling multithreaded command stream.\n"); - wined3d_settings.cs_multithreaded = TRUE; - } -+ if (!get_config_key(hkey, appkey, "ignore_rt_map", buffer, size) -+ && !strcmp(buffer,"enabled")) -+ { -+ TRACE("Ignoring render target maps.\n"); -+ wined3d_settings.ignore_rt_map = TRUE; -+ } - } - - if (appkey) RegCloseKey( appkey ); -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 88329e5..dd06525 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -281,6 +281,7 @@ struct wined3d_settings - unsigned int max_sm_ps; - BOOL no_3d; - BOOL cs_multithreaded; -+ BOOL ignore_rt_map; - }; - - extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0173-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0173-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0173-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0173-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -From a2aa05486b1b77425b94657483334a1dd5763048 Mon Sep 17 00:00:00 2001 -From: Matteo Bruni -Date: Fri, 12 Sep 2014 19:03:05 +0200 -Subject: wined3d: Avoid calling wined3d_surface_blt() from - surface_upload_from_surface(). - ---- - dlls/wined3d/surface.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 3557c00..9ab0738 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -37,6 +37,10 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); - #define MAXLOCKCOUNT 50 /* After this amount of locks do not free the sysmem copy. */ - - -+static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect, -+ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, -+ const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter); -+ - void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) - { - if (surface->rb_multisample || surface->rb_resolved || !list_empty(&surface->renderbuffers)) -@@ -1522,9 +1526,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P - return WINED3DERR_INVALIDCALL; - } - -- /* Use wined3d_surface_blt() instead of uploading directly if we need conversion. */ -+ /* Use surface_cpu_blt() instead of uploading directly if we need -+ * conversion. Avoid calling wined3d_surface_blt() since that goes -+ * through the CS. */ - if (dst_format->convert || wined3d_format_get_color_key_conversion(dst_surface->container, FALSE)) -- return wined3d_surface_blt(dst_surface, &dst_rect, src_surface, src_rect, 0, NULL, WINED3D_TEXF_POINT); -+ return surface_cpu_blt(dst_surface, &dst_rect, src_surface, src_rect, 0, NULL, WINED3D_TEXF_POINT); - - context = context_acquire(dst_surface->resource.device, NULL); - gl_info = context->gl_info; --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0173-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0173-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0173-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0173-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,52 @@ +From 180d8cf49a4f4481b08e373e8c8a75c116094e63 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Mon, 8 Sep 2014 15:09:44 +0200 +Subject: wined3d: Don't try to sync VBOs manually on OSX with CSMT. + +This fixes a performance regression in some games caused by +aaf4849718c3c3a763c460a24a51dd6c6b55524a. + +GL_ARB_sync and GL_APPLE_fence seem to be fairly slow on OSX. Putting the +buffer back into synchonized mode and synchronizing all future uploads +is about twice as fast. This was benchmarked with 3DMark2001. Gunpoint, +another game that depends on synchronized dynamic buffer maps, feels +smoother, although the lack of a benchmark mode makes testing this difficult. + +This assumes that if a game maps a dynamic buffer without NOOVERWRITE or +DISCARD once it will always do so. I have not seen a game yet that mixes +async and sync maps. If the game mixes them, the wined3d-side CS will still +update the buffer asynchronously. Only the worker thread -> GL copy is +synchronized, as it used to be for all buffers in cx13. + +This patch only changes the double-buffered (used for CSMT) codepath. Making +the same change to the glMapBuffer codepath improves 3DMark2001 performance +as well, but the difference is much smaller. I will leave the manual sync +code in place until we have a game that clearly profits from this change. +--- + dlls/wined3d/buffer.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index e6e56bb..b33dd5a 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -676,8 +676,14 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined + else if (flags & WINED3D_BUFFER_SYNC && This->flags & WINED3D_BUFFER_APPLESYNC) + { + /* OSX doesn't do non-blocking asynchonous glBufferSubData like Linux drivers do, so we want to set +- * GL_BUFFER_FLUSHING_UNMAP_APPLE to GL_FALSE. This means we have to do synchonization ourselves. */ +- buffer_sync_apple(This, 0, gl_info); ++ * GL_BUFFER_SERIALIZED_MODIFY_APPLE to GL_FALSE. Unfortunately ARB_sync and APPLE_fence are pretty ++ * slow on OSX. Putting the buffer back into synchronized mode for future maps is a lot faster. ++ * (GeForce 650M, Mavericks). The difference between ARB_sync and normal buffer operation is small ++ * in the glMapBuffer codepath without CSMT. */ ++ glFinish(); ++ GL_EXTCALL(glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)); ++ checkGLcall("glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)"); ++ This->flags &= ~WINED3D_BUFFER_APPLESYNC; + } + + while (This->modified_areas) +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0174-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0174-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0174-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0174-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -From f5af340900500fbff08b1fb4f3dca8f0c5171d0d Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 14 Dec 2014 20:15:44 +0100 -Subject: wined3d: Enable CSMT by default, print a winediag message informing - about this patchset. - ---- - dlls/wined3d/wined3d_main.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - -diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c -index a1e4e6c..30b1ff5 100644 ---- a/dlls/wined3d/wined3d_main.c -+++ b/dlls/wined3d/wined3d_main.c -@@ -85,7 +85,7 @@ struct wined3d_settings wined3d_settings = - ~0U, /* No GS shader model limit by default. */ - ~0U, /* No PS shader model limit by default. */ - FALSE, /* 3D support enabled by default. */ -- FALSE, /* No multithreaded CS by default. */ -+ TRUE, /* Multithreaded CS by default. */ - FALSE, /* Do not ignore render target maps. */ - }; - -@@ -307,10 +307,10 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) - wined3d_settings.no_3d = TRUE; - } - if (!get_config_key(hkey, appkey, "CSMT", buffer, size) -- && !strcmp(buffer,"enabled")) -+ && !strcmp(buffer,"disabled")) - { -- TRACE("Enabling multithreaded command stream.\n"); -- wined3d_settings.cs_multithreaded = TRUE; -+ TRACE("Disabling multithreaded command stream.\n"); -+ wined3d_settings.cs_multithreaded = FALSE; - } - if (!get_config_key(hkey, appkey, "ignore_rt_map", buffer, size) - && !strcmp(buffer,"enabled")) -@@ -320,6 +320,9 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) - } - } - -+ FIXME_(winediag)("Experimental wined3d CSMT feature is currently %s.\n", -+ wined3d_settings.cs_multithreaded ? "enabled" : "disabled"); -+ - if (appkey) RegCloseKey( appkey ); - if (hkey) RegCloseKey( hkey ); - --- -2.1.3 - diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0174-wined3d-Render-target-lock-hack.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0174-wined3d-Render-target-lock-hack.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0174-wined3d-Render-target-lock-hack.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0174-wined3d-Render-target-lock-hack.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,86 @@ +From f23d42ca6a96a3d257fc57dbae8d5ebd3620e4b7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Tue, 23 Sep 2014 22:18:56 +0200 +Subject: wined3d: Render target lock hack + +--- + dlls/wined3d/resource.c | 17 +++++++++++++++++ + dlls/wined3d/wined3d_main.c | 7 +++++++ + dlls/wined3d/wined3d_private.h | 1 + + 3 files changed, 25 insertions(+) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index cd60356..dc36dd5 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -777,6 +777,17 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource, + TRACE("resource %p, map_desc %p, box %p, flags %#x.\n", + resource, map_desc, box, flags); + ++ if (resource->usage & WINED3DUSAGE_RENDERTARGET && wined3d_settings.ignore_rt_map) ++ { ++ WARN("Ignoring render target map, only finishing CS.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ map_desc->row_pitch = 0; ++ map_desc->slice_pitch = 0; ++ map_desc->data = NULL; ++ device->cs->ops->finish(device->cs); ++ return WINED3D_OK; ++ } ++ + if (resource->map_count) + { + WARN("Volume is already mapped.\n"); +@@ -880,6 +891,12 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) + struct wined3d_device *device = resource->device; + TRACE("resource %p.\n", resource); + ++ if (resource->usage & WINED3DUSAGE_RENDERTARGET && wined3d_settings.ignore_rt_map) ++ { ++ WARN("Ignoring render target unmap.\n"); ++ return WINED3D_OK; ++ } ++ + if (!resource->map_count) + { + WARN("Trying to unlock an unlocked resource %p.\n", resource); +diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c +index e6dc444..a1e4e6c 100644 +--- a/dlls/wined3d/wined3d_main.c ++++ b/dlls/wined3d/wined3d_main.c +@@ -86,6 +86,7 @@ struct wined3d_settings wined3d_settings = + ~0U, /* No PS shader model limit by default. */ + FALSE, /* 3D support enabled by default. */ + FALSE, /* No multithreaded CS by default. */ ++ FALSE, /* Do not ignore render target maps. */ + }; + + struct wined3d * CDECL wined3d_create(DWORD flags) +@@ -311,6 +312,12 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) + TRACE("Enabling multithreaded command stream.\n"); + wined3d_settings.cs_multithreaded = TRUE; + } ++ if (!get_config_key(hkey, appkey, "ignore_rt_map", buffer, size) ++ && !strcmp(buffer,"enabled")) ++ { ++ TRACE("Ignoring render target maps.\n"); ++ wined3d_settings.ignore_rt_map = TRUE; ++ } + } + + if (appkey) RegCloseKey( appkey ); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 88329e5..dd06525 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -281,6 +281,7 @@ struct wined3d_settings + unsigned int max_sm_ps; + BOOL no_3d; + BOOL cs_multithreaded; ++ BOOL ignore_rt_map; + }; + + extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0175-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0175-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0175-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0175-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,42 @@ +From a2aa05486b1b77425b94657483334a1dd5763048 Mon Sep 17 00:00:00 2001 +From: Matteo Bruni +Date: Fri, 12 Sep 2014 19:03:05 +0200 +Subject: wined3d: Avoid calling wined3d_surface_blt() from + surface_upload_from_surface(). + +--- + dlls/wined3d/surface.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 3557c00..9ab0738 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -37,6 +37,10 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); + #define MAXLOCKCOUNT 50 /* After this amount of locks do not free the sysmem copy. */ + + ++static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect, ++ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, ++ const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter); ++ + void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) + { + if (surface->rb_multisample || surface->rb_resolved || !list_empty(&surface->renderbuffers)) +@@ -1522,9 +1526,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P + return WINED3DERR_INVALIDCALL; + } + +- /* Use wined3d_surface_blt() instead of uploading directly if we need conversion. */ ++ /* Use surface_cpu_blt() instead of uploading directly if we need ++ * conversion. Avoid calling wined3d_surface_blt() since that goes ++ * through the CS. */ + if (dst_format->convert || wined3d_format_get_color_key_conversion(dst_surface->container, FALSE)) +- return wined3d_surface_blt(dst_surface, &dst_rect, src_surface, src_rect, 0, NULL, WINED3D_TEXF_POINT); ++ return surface_cpu_blt(dst_surface, &dst_rect, src_surface, src_rect, 0, NULL, WINED3D_TEXF_POINT); + + context = context_acquire(dst_surface->resource.device, NULL); + gl_info = context->gl_info; +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0176-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0176-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/0176-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/0176-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,50 @@ +From f5af340900500fbff08b1fb4f3dca8f0c5171d0d Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 14 Dec 2014 20:15:44 +0100 +Subject: wined3d: Enable CSMT by default, print a winediag message informing + about this patchset. + +--- + dlls/wined3d/wined3d_main.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c +index a1e4e6c..30b1ff5 100644 +--- a/dlls/wined3d/wined3d_main.c ++++ b/dlls/wined3d/wined3d_main.c +@@ -85,7 +85,7 @@ struct wined3d_settings wined3d_settings = + ~0U, /* No GS shader model limit by default. */ + ~0U, /* No PS shader model limit by default. */ + FALSE, /* 3D support enabled by default. */ +- FALSE, /* No multithreaded CS by default. */ ++ TRUE, /* Multithreaded CS by default. */ + FALSE, /* Do not ignore render target maps. */ + }; + +@@ -307,10 +307,10 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) + wined3d_settings.no_3d = TRUE; + } + if (!get_config_key(hkey, appkey, "CSMT", buffer, size) +- && !strcmp(buffer,"enabled")) ++ && !strcmp(buffer,"disabled")) + { +- TRACE("Enabling multithreaded command stream.\n"); +- wined3d_settings.cs_multithreaded = TRUE; ++ TRACE("Disabling multithreaded command stream.\n"); ++ wined3d_settings.cs_multithreaded = FALSE; + } + if (!get_config_key(hkey, appkey, "ignore_rt_map", buffer, size) + && !strcmp(buffer,"enabled")) +@@ -320,6 +320,9 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) + } + } + ++ FIXME_(winediag)("Experimental wined3d CSMT feature is currently %s.\n", ++ wined3d_settings.cs_multithreaded ? "enabled" : "disabled"); ++ + if (appkey) RegCloseKey( appkey ); + if (hkey) RegCloseKey( hkey ); + +-- +2.1.3 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/9999-IfDefined.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/9999-IfDefined.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-CSMT_Main/9999-IfDefined.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-CSMT_Main/9999-IfDefined.patch 2015-07-29 19:51:42.000000000 +0000 @@ -478,7 +478,52 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -99,6 +99,22 @@ +@@ -40,6 +40,32 @@ + return TRUE; + } + ++#if !defined(STAGING_CSMT) ++void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch) ++{ ++ const struct wined3d_format *format = volume->resource.format; ++ ++ if (volume->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) ++ { ++ /* Since compressed formats are block based, pitch means the amount of ++ * bytes to the next row of block rather than the next row of pixels. */ ++ UINT row_block_count = (volume->resource.width + format->block_width - 1) / format->block_width; ++ UINT slice_block_count = (volume->resource.height + format->block_height - 1) / format->block_height; ++ *row_pitch = row_block_count * format->block_byte_count; ++ *slice_pitch = *row_pitch * slice_block_count; ++ } ++ else ++ { ++ unsigned char alignment = volume->resource.device->surface_alignment; ++ *row_pitch = format->byte_count * volume->resource.width; /* Bytes / row */ ++ *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1); ++ *slice_pitch = *row_pitch * volume->resource.height; ++ } ++ ++ TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); ++} ++ ++#endif /* STAGING_CSMT */ + /* This call just uploads data, the caller is responsible for binding the + * correct texture. */ + /* Context activation is done by the caller. */ +@@ -71,7 +97,11 @@ + dst_row_pitch = width * format->conv_byte_count; + dst_slice_pitch = dst_row_pitch * height; + ++#if defined(STAGING_CSMT) + wined3d_resource_get_pitch(&volume->resource, &src_row_pitch, &src_slice_pitch); ++#else /* STAGING_CSMT */ ++ wined3d_volume_get_pitch(volume, &src_row_pitch, &src_slice_pitch); ++#endif /* STAGING_CSMT */ + + converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth); + format->convert(data->addr, converted_mem, src_row_pitch, src_slice_pitch, +@@ -99,6 +129,22 @@ HeapFree(GetProcessHeap(), 0, converted_mem); } @@ -501,7 +546,7 @@ /* Context activation is done by the caller. */ static void wined3d_volume_download_data(struct wined3d_volume *volume, const struct wined3d_context *context, const struct wined3d_bo_address *data) -@@ -134,8 +150,33 @@ +@@ -134,8 +180,33 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) { wined3d_resource_free_sysmem(&volume->resource); @@ -535,7 +580,7 @@ } /* Context activation is done by the caller. */ -@@ -177,6 +218,7 @@ +@@ -177,6 +248,7 @@ return TRUE; } @@ -543,7 +588,7 @@ /* Context activation is done by the caller. */ static void wined3d_volume_load_location(struct wined3d_resource *resource, -@@ -187,6 +229,22 @@ +@@ -187,6 +259,22 @@ TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location), wined3d_debug_location(volume->resource.locations)); @@ -566,7 +611,7 @@ if ((volume->resource.access_flags & required_access) != required_access) { -@@ -205,6 +263,7 @@ +@@ -205,6 +293,7 @@ && !(volume->container->flags & WINED3D_TEXTURE_SRGB_ALLOCATED))) ERR("Trying to load (s)RGB texture without prior allocation.\n"); @@ -574,7 +619,7 @@ if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) { TRACE("Volume previously discarded, nothing to do.\n"); -@@ -238,6 +297,41 @@ +@@ -238,6 +327,41 @@ return; } wined3d_resource_validate_location(&volume->resource, location); @@ -616,7 +661,7 @@ if (wined3d_volume_can_evict(volume)) wined3d_volume_evict_sysmem(volume); -@@ -248,11 +342,24 @@ +@@ -248,11 +372,24 @@ if (!volume->resource.heap_memory) ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n"); @@ -641,7 +686,7 @@ wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -263,6 +370,7 @@ +@@ -263,6 +400,7 @@ else { FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n", @@ -649,7 +694,7 @@ wined3d_debug_location(volume->resource.locations)); return; } -@@ -278,6 +386,28 @@ +@@ -278,6 +416,28 @@ struct wined3d_bo_address data = {volume->resource.buffer->name, NULL}; if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) @@ -678,7 +723,7 @@ wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -287,6 +417,7 @@ +@@ -287,6 +447,7 @@ else { FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n", @@ -686,7 +731,7 @@ wined3d_debug_location(volume->resource.locations)); return; } -@@ -296,6 +427,17 @@ +@@ -296,6 +457,17 @@ default: FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location), wined3d_debug_location(volume->resource.locations)); @@ -704,7 +749,7 @@ } } -@@ -303,6 +445,7 @@ +@@ -303,6 +475,7 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode) { wined3d_texture_prepare_texture(volume->container, context, srgb_mode); @@ -712,7 +757,7 @@ wined3d_resource_load_location(&volume->resource, context, srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); } -@@ -315,6 +458,51 @@ +@@ -315,6 +488,51 @@ resource_cleanup(&volume->resource); volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); wined3d_cs_emit_volume_cleanup(device->cs, volume); @@ -764,7 +809,7 @@ } static void volume_unload(struct wined3d_resource *resource) -@@ -328,6 +516,7 @@ +@@ -328,6 +546,7 @@ TRACE("texture %p.\n", resource); @@ -772,7 +817,7 @@ if (wined3d_resource_prepare_system_memory(&volume->resource)) { context = context_acquire(device, NULL); -@@ -340,6 +529,29 @@ +@@ -340,6 +559,29 @@ ERR("Out of memory when unloading volume %p.\n", volume); wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_DISCARDED); wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); @@ -802,7 +847,7 @@ } /* The texture name is managed by the container. */ -@@ -355,11 +567,13 @@ +@@ -355,11 +597,13 @@ return wined3d_texture_incref(volume->container); } @@ -816,7 +861,7 @@ ULONG CDECL wined3d_volume_decref(struct wined3d_volume *volume) { TRACE("Forwarding to container %p.\n", volume->container); -@@ -386,6 +600,36 @@ +@@ -386,6 +630,36 @@ return &volume->resource; } @@ -853,7 +898,7 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume, const struct wined3d_box *box) { -@@ -411,6 +655,7 @@ +@@ -411,6 +685,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { @@ -861,7 +906,7 @@ HRESULT hr; const struct wined3d_format *format = volume->resource.format; const unsigned int fmt_flags = volume->container->resource.format_flags; -@@ -439,6 +684,148 @@ +@@ -439,6 +714,148 @@ return hr; return hr; @@ -963,7 +1008,7 @@ + } + else + { -+ wined3d_resource_get_pitch(&volume->resource, &map_desc->row_pitch, &map_desc->slice_pitch); ++ wined3d_volume_get_pitch(volume, &map_desc->row_pitch, &map_desc->slice_pitch); + } + + if (!box) @@ -1010,7 +1055,7 @@ } struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resource *resource) -@@ -448,6 +835,7 @@ +@@ -448,6 +865,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) { @@ -1018,7 +1063,7 @@ HRESULT hr; if (volume->resource.unmap_dirtify) -@@ -457,6 +845,33 @@ +@@ -457,6 +875,33 @@ if (hr == WINEDDERR_NOTLOCKED) return WINED3DERR_INVALIDCALL; return hr; @@ -1052,7 +1097,7 @@ } static ULONG volume_resource_incref(struct wined3d_resource *resource) -@@ -469,6 +884,7 @@ +@@ -469,6 +914,7 @@ return wined3d_volume_decref(volume_from_resource(resource)); } @@ -1060,7 +1105,7 @@ static void wined3d_volume_location_invalidated(struct wined3d_resource *resource, DWORD location) { struct wined3d_volume *volume = volume_from_resource(resource); -@@ -484,6 +900,13 @@ +@@ -484,6 +930,13 @@ volume_unload, wined3d_volume_location_invalidated, wined3d_volume_load_location, @@ -1074,7 +1119,7 @@ }; static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, -@@ -515,7 +938,11 @@ +@@ -515,7 +968,11 @@ } volume->texture_level = level; @@ -1086,20 +1131,28 @@ if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC && gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] -@@ -523,7 +950,9 @@ +@@ -523,11 +980,17 @@ { wined3d_resource_free_sysmem(&volume->resource); volume->resource.map_binding = WINED3D_LOCATION_BUFFER; +#if defined(STAGING_CSMT) volume->resource.map_heap_memory = NULL; -+#endif /* STAGING_CSMT */ } volume->container = container; + volume->resource.format_flags = container->resource.format_flags; ++#else /* STAGING_CSMT */ ++ } ++ ++ volume->container = container; ++#endif /* STAGING_CSMT */ + + return WINED3D_OK; + } diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -3523,7 +3523,11 @@ +@@ -3626,7 +3626,11 @@ float y_offset = context->render_offscreen ? (center_offset - (2.0f * y) - h) / h : (center_offset - (2.0f * y) - h) / -h; @@ -1111,7 +1164,7 @@ state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE; float z_scale = zenable ? 2.0f : 0.0f; float z_offset = zenable ? -1.0f : 0.0f; -@@ -3646,6 +3650,7 @@ +@@ -3749,6 +3753,7 @@ /* case WINED3D_TTFF_COUNT1: Won't ever get here. */ case WINED3D_TTFF_COUNT2: mat._13 = mat._23 = mat._33 = mat._43 = 0.0f; @@ -1119,7 +1172,7 @@ /* OpenGL divides the first 3 vertex coord by the 4th by default, * which is essentially the same as D3DTTFF_PROJECTED. Make sure that * the 4th coord evaluates to 1.0 to eliminate that. -@@ -3658,6 +3663,20 @@ +@@ -3761,6 +3766,20 @@ * A more serious problem occurs if the app passes 4 coordinates in, and the * 4th is != 1.0(opengl default). This would have to be fixed in draw_strided_slow * or a replacement shader. */ @@ -1140,7 +1193,7 @@ default: mat._14 = mat._24 = mat._34 = 0.0f; mat._44 = 1.0f; } -@@ -4113,7 +4132,11 @@ +@@ -4216,7 +4235,11 @@ unsigned int i; DWORD ttff; DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2; @@ -1211,7 +1264,7 @@ shader_arb_ps_local_constants(compiled, context, state, rt_height); } -@@ -7821,7 +7829,11 @@ +@@ -7827,7 +7835,11 @@ /* Now load the surface */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO @@ -1223,7 +1276,7 @@ == WINED3D_LOCATION_DRAWABLE && !wined3d_resource_is_offscreen(&src_surface->container->resource)) { -@@ -7851,6 +7863,7 @@ +@@ -7857,6 +7869,7 @@ /* Leave the opengl state valid for blitting */ arbfp_blit_unset(context->gl_info); @@ -1231,7 +1284,7 @@ if (wined3d_settings.cs_multithreaded) context->gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering -@@ -7862,6 +7875,17 @@ +@@ -7868,6 +7881,17 @@ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); @@ -1307,7 +1360,7 @@ /* Initialize the texture unit mapping to a 1:1 mapping */ for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s) { -@@ -1821,7 +1823,9 @@ +@@ -1830,7 +1832,9 @@ out: device->shader_backend->shader_free_context_data(ret); device->adapter->fragment_pipe->free_context_data(ret); @@ -1317,7 +1370,7 @@ HeapFree(GetProcessHeap(), 0, ret->free_event_queries); HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries); HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries); -@@ -1856,7 +1860,9 @@ +@@ -1865,7 +1869,9 @@ device->shader_backend->shader_free_context_data(context); device->adapter->fragment_pipe->free_context_data(context); @@ -1327,7 +1380,7 @@ HeapFree(GetProcessHeap(), 0, context->draw_buffers); HeapFree(GetProcessHeap(), 0, context->blit_targets); device_context_remove(device, context); -@@ -2264,7 +2270,11 @@ +@@ -2273,7 +2279,11 @@ return TRUE; } @@ -1339,7 +1392,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context, const struct wined3d_rendertarget_view *depth_stencil) { -@@ -2280,6 +2290,7 @@ +@@ -2289,6 +2299,7 @@ WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ @@ -1347,7 +1400,7 @@ wined3d_resource_load_location(&context->current_rt->resource, context, WINED3D_LOCATION_TEXTURE_RGB); swapchain->render_to_fbo = TRUE; swapchain_update_draw_bindings(swapchain); -@@ -2294,6 +2305,22 @@ +@@ -2303,6 +2314,22 @@ return context_generate_rt_mask_from_surface(rt); else return context_generate_rt_mask(context->offscreenBuffer); @@ -1370,7 +1423,7 @@ } /* Context activation is done by the caller. */ -@@ -2325,7 +2352,11 @@ +@@ -2334,7 +2361,11 @@ } else { @@ -1382,7 +1435,7 @@ } cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask; -@@ -2372,7 +2403,11 @@ +@@ -2381,7 +2412,11 @@ DWORD rt_mask = 0, *cur_mask; UINT i; @@ -1394,7 +1447,7 @@ || rt_count != context->gl_info->limits.buffers) { if (!context_validate_rt_config(rt_count, rts, dsv)) -@@ -2414,11 +2449,17 @@ +@@ -2423,11 +2458,17 @@ } else { @@ -1412,7 +1465,7 @@ } else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource))) -@@ -2431,7 +2472,11 @@ +@@ -2440,7 +2481,11 @@ } else { @@ -1424,7 +1477,7 @@ rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); } -@@ -2466,6 +2511,7 @@ +@@ -2475,6 +2520,7 @@ return TRUE; } @@ -1432,7 +1485,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_state *state) { struct wined3d_rendertarget_view **rts = state->fb.render_targets; -@@ -2475,6 +2521,18 @@ +@@ -2484,6 +2530,18 @@ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return context_generate_rt_mask_no_fbo(context, wined3d_rendertarget_view_get_surface(rts[0])); @@ -1451,7 +1504,7 @@ else if (!context->render_offscreen) return context_generate_rt_mask_from_surface(wined3d_rendertarget_view_get_surface(rts[0])); -@@ -2497,8 +2555,14 @@ +@@ -2506,8 +2564,14 @@ /* Context activation is done by the caller. */ void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -1466,7 +1519,7 @@ DWORD *cur_mask; if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) -@@ -2529,8 +2593,10 @@ +@@ -2538,8 +2602,10 @@ context_apply_draw_buffers(context, rt_mask); *cur_mask = rt_mask; } @@ -1477,7 +1530,7 @@ } static void context_map_stage(struct wined3d_context *context, DWORD stage, DWORD unit) -@@ -2768,12 +2834,22 @@ +@@ -2777,12 +2843,22 @@ /* Context activation is done by the caller. */ void context_state_drawbuf(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -1500,7 +1553,7 @@ if (rt_mask != *cur_mask) { context_apply_draw_buffers(context, rt_mask); -@@ -2975,7 +3051,11 @@ +@@ -2984,7 +3060,11 @@ { if (state->vertex_declaration->half_float_conv_needed && !stream_info->all_vbo) { @@ -1512,7 +1565,7 @@ context->use_immediate_mode_draw = TRUE; } else -@@ -3115,11 +3195,19 @@ +@@ -3124,11 +3204,19 @@ } /* Context activation is done by the caller. */ @@ -1532,7 +1585,7 @@ unsigned int i, j; WORD map; -@@ -3151,12 +3239,17 @@ +@@ -3160,12 +3248,17 @@ for (i = 0, map = context->stream_info.use_map; map; map >>= 1, ++i) { if (map & 1) @@ -1550,7 +1603,7 @@ } if (state->index_buffer) { -@@ -3260,7 +3353,11 @@ +@@ -3269,7 +3362,11 @@ if (texture->texture_srgb.name) wined3d_texture_load(texture, context, TRUE); wined3d_texture_load(texture, context, FALSE); @@ -1833,7 +1886,7 @@ }; typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); -@@ -1425,8 +1480,12 @@ +@@ -1430,8 +1485,12 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN; BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN; @@ -1846,7 +1899,7 @@ void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN; void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info, -@@ -1983,7 +2042,11 @@ +@@ -2002,7 +2061,11 @@ struct wined3d_state { DWORD flags; @@ -1858,7 +1911,7 @@ struct wined3d_vertex_declaration *vertex_declaration; struct wined3d_stream_output stream_output[MAX_STREAM_OUT]; -@@ -2028,6 +2091,7 @@ +@@ -2047,6 +2110,7 @@ DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; }; @@ -1866,7 +1919,7 @@ struct wined3d_gl_bo { GLuint name; -@@ -2036,6 +2100,7 @@ +@@ -2055,6 +2119,7 @@ UINT size; }; @@ -1874,7 +1927,7 @@ #define WINED3D_UNMAPPED_STAGE ~0U /* Multithreaded flag. Removed from the public header to signal that -@@ -2091,11 +2156,23 @@ +@@ -2110,11 +2175,23 @@ struct wined3d_rendertarget_view *back_buffer_view; struct wined3d_swapchain **swapchains; UINT swapchain_count; @@ -1898,7 +1951,7 @@ /* For rendering to a texture using glCopyTexImage */ GLuint depth_blt_texture; -@@ -2106,6 +2183,9 @@ +@@ -2125,6 +2202,9 @@ UINT xScreenSpace; UINT yScreenSpace; UINT cursorWidth, cursorHeight; @@ -1908,7 +1961,7 @@ HCURSOR hardwareCursor; /* The Wine logo texture */ -@@ -2137,6 +2217,7 @@ +@@ -2156,6 +2236,7 @@ UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN; void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -1916,7 +1969,7 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, -@@ -2148,6 +2229,11 @@ +@@ -2167,6 +2248,11 @@ void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -1928,7 +1981,7 @@ static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2164,9 +2250,11 @@ +@@ -2183,9 +2269,11 @@ ULONG (*resource_incref)(struct wined3d_resource *resource); ULONG (*resource_decref)(struct wined3d_resource *resource); void (*resource_unload)(struct wined3d_resource *resource); @@ -1940,7 +1993,7 @@ }; struct wined3d_resource -@@ -2191,6 +2279,7 @@ +@@ -2210,6 +2298,7 @@ UINT depth; UINT size; DWORD priority; @@ -1948,19 +2001,18 @@ void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; UINT custom_row_pitch, custom_slice_pitch; struct wined3d_gl_bo *buffer, *map_buffer; -@@ -2198,6 +2287,11 @@ +@@ -2217,6 +2306,10 @@ DWORD locations; LONG access_fence; BOOL unmap_dirtify; +#else /* STAGING_CSMT */ + void *heap_memory; -+ UINT custom_row_pitch, custom_slice_pitch; + struct list resource_list_entry; +#endif /* STAGING_CSMT */ void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2222,6 +2316,7 @@ +@@ -2241,6 +2334,7 @@ void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN; void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -1968,7 +2020,7 @@ DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_changed(struct wined3d_resource *resource, -@@ -2268,6 +2363,15 @@ +@@ -2289,6 +2383,15 @@ { while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); } @@ -1984,7 +2036,7 @@ /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -@@ -2352,7 +2456,9 @@ +@@ -2373,7 +2476,9 @@ void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture, const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; @@ -1994,7 +2046,7 @@ void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, -@@ -2386,9 +2492,16 @@ +@@ -2407,9 +2512,16 @@ struct wined3d_resource resource; struct wined3d_texture *container; @@ -2011,7 +2063,7 @@ }; static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) -@@ -2396,6 +2509,7 @@ +@@ -2417,6 +2529,7 @@ return CONTAINING_RECORD(resource, struct wined3d_volume, resource); } @@ -2019,7 +2071,7 @@ HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; -@@ -2408,6 +2522,23 @@ +@@ -2429,6 +2542,24 @@ struct wined3d_surface_dib { HBITMAP DIBsection; @@ -2028,6 +2080,7 @@ +HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, + unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; +void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; ++void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch) DECLSPEC_HIDDEN; +void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, + BOOL srgb_mode) DECLSPEC_HIDDEN; +void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; @@ -2043,7 +2096,7 @@ UINT bitmap_size; }; -@@ -2433,7 +2564,11 @@ +@@ -2454,7 +2585,11 @@ struct wined3d_surface_ops { HRESULT (*surface_private_setup)(struct wined3d_surface *surface); @@ -2055,7 +2108,7 @@ }; struct wined3d_surface -@@ -2441,12 +2576,25 @@ +@@ -2462,12 +2597,26 @@ struct wined3d_resource resource; const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; @@ -2072,6 +2125,7 @@ DWORD flags; ++ UINT pitch; UINT pow2Width; UINT pow2Height; @@ -2081,7 +2135,7 @@ GLuint rb_multisample; GLuint rb_resolved; GLenum texture_target; -@@ -2490,10 +2638,19 @@ +@@ -2511,10 +2660,19 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN; void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; @@ -2101,7 +2155,7 @@ void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; -@@ -2505,6 +2662,7 @@ +@@ -2526,6 +2684,7 @@ const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN; HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN; @@ -2109,7 +2163,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; -@@ -2523,6 +2681,21 @@ +@@ -2544,6 +2703,21 @@ void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; void surface_flip(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN; @@ -2131,7 +2185,7 @@ /* Surface flags: */ #define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */ -@@ -2570,8 +2743,10 @@ +@@ -2591,8 +2765,10 @@ BOOL half_float_conv_needed; }; @@ -2142,7 +2196,7 @@ struct wined3d_saved_states { DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; -@@ -2639,6 +2814,7 @@ +@@ -2660,6 +2836,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2150,7 +2204,7 @@ HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -2689,6 +2865,32 @@ +@@ -2710,6 +2887,32 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; @@ -2183,7 +2237,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; -@@ -2738,6 +2940,7 @@ +@@ -2759,6 +2962,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; @@ -2191,7 +2245,7 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, -@@ -2797,6 +3000,7 @@ +@@ -2818,6 +3022,7 @@ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -2199,7 +2253,7 @@ /* 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 -@@ -2811,8 +3015,12 @@ +@@ -2832,8 +3037,12 @@ struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -2212,7 +2266,7 @@ }; struct wined3d_query -@@ -2826,12 +3034,16 @@ +@@ -2847,12 +3056,16 @@ enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -2229,7 +2283,7 @@ /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other * fixed function semantics as D3DCOLOR or FLOAT16 */ -@@ -2858,7 +3070,9 @@ +@@ -2879,7 +3092,9 @@ GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -2239,7 +2293,7 @@ void *map_ptr; struct wined3d_map_range *maps; -@@ -2883,11 +3097,15 @@ +@@ -2904,11 +3119,15 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2255,7 +2309,7 @@ struct wined3d_rendertarget_view { -@@ -2926,8 +3144,10 @@ +@@ -2947,8 +3166,10 @@ return surface_from_resource(resource); } @@ -2266,7 +2320,7 @@ struct wined3d_shader_resource_view { LONG refcount; -@@ -2940,8 +3160,12 @@ +@@ -2961,8 +3182,12 @@ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, @@ -2279,7 +2333,7 @@ }; struct wined3d_swapchain -@@ -2981,8 +3205,10 @@ +@@ -3002,8 +3227,10 @@ HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -2290,7 +2344,7 @@ /***************************************************************************** * Utility function prototypes -@@ -3186,7 +3412,9 @@ +@@ -3207,7 +3434,9 @@ void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN; BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN; @@ -3418,7 +3472,7 @@ device->d3d_initialized = FALSE; return WINED3D_OK; -@@ -1436,6 +1615,16 @@ +@@ -1435,6 +1614,16 @@ TRACE("... Range(%f), Falloff(%f), Theta(%f), Phi(%f)\n", light->range, light->falloff, light->theta, light->phi); @@ -3435,7 +3489,7 @@ /* Save away the information. */ object->OriginalParms = *light; -@@ -1515,9 +1704,11 @@ +@@ -1514,9 +1703,11 @@ FIXME("Unrecognized light type %#x.\n", light->type); } @@ -3447,7 +3501,7 @@ return WINED3D_OK; } -@@ -1590,6 +1781,14 @@ +@@ -1589,6 +1780,14 @@ { if (light_info->glIndex != -1) { @@ -3462,7 +3516,7 @@ device->update_state->lights[light_info->glIndex] = NULL; light_info->glIndex = -1; } -@@ -1631,11 +1830,23 @@ +@@ -1630,11 +1829,23 @@ WARN("Too many concurrently active lights\n"); return WINED3D_OK; } @@ -3486,7 +3540,7 @@ return WINED3D_OK; } -@@ -1810,9 +2021,11 @@ +@@ -1809,9 +2020,11 @@ TRACE("device %p, base_index %d.\n", device, base_index); device->update_state->base_vertex_index = base_index; @@ -3498,7 +3552,7 @@ } INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device) -@@ -1857,7 +2070,11 @@ +@@ -1856,7 +2069,11 @@ || !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; surface = surface_from_resource(texture->sub_resources[0]); @@ -3510,7 +3564,7 @@ return; wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT); -@@ -2177,7 +2394,11 @@ +@@ -2176,7 +2393,11 @@ return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx]; } @@ -3522,7 +3576,7 @@ { UINT i; -@@ -2210,8 +2431,12 @@ +@@ -2209,8 +2430,12 @@ } else { @@ -3535,7 +3589,7 @@ } return WINED3D_OK; -@@ -2258,8 +2483,12 @@ +@@ -2257,8 +2482,12 @@ } else { @@ -3548,7 +3602,7 @@ } return WINED3D_OK; -@@ -2310,8 +2539,13 @@ +@@ -2309,8 +2538,13 @@ memset(device->recording->changed.vertexShaderConstantsF + start_register, 1, sizeof(*device->recording->changed.vertexShaderConstantsF) * vector4f_count); else @@ -3562,7 +3616,7 @@ return WINED3D_OK; } -@@ -2446,8 +2680,12 @@ +@@ -2445,8 +2679,12 @@ } else { @@ -3575,7 +3629,7 @@ } return WINED3D_OK; -@@ -2494,8 +2732,12 @@ +@@ -2493,8 +2731,12 @@ } else { @@ -3588,7 +3642,7 @@ } return WINED3D_OK; -@@ -2547,8 +2789,12 @@ +@@ -2546,8 +2788,12 @@ memset(device->recording->changed.pixelShaderConstantsF + start_register, 1, sizeof(*device->recording->changed.pixelShaderConstantsF) * vector4f_count); else @@ -3601,7 +3655,7 @@ return WINED3D_OK; } -@@ -2708,6 +2954,7 @@ +@@ -2707,6 +2953,7 @@ return hr; } @@ -3609,7 +3663,7 @@ if (wined3d_settings.cs_multithreaded) { FIXME("Waiting for cs.\n"); -@@ -2715,6 +2962,7 @@ +@@ -2714,6 +2961,7 @@ device->cs->ops->finish(device->cs); } @@ -3617,7 +3671,7 @@ wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat); wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat); wined3d_device_get_transform(device, WINED3D_TS_WORLD_MATRIX(0), &world_mat); -@@ -3216,6 +3464,10 @@ +@@ -3215,6 +3463,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) { @@ -3628,7 +3682,7 @@ TRACE("device %p.\n", device); if (!device->inScene) -@@ -3224,6 +3476,15 @@ +@@ -3223,6 +3475,15 @@ return WINED3DERR_INVALIDCALL; } @@ -3644,7 +3698,7 @@ device->inScene = FALSE; return WINED3D_OK; } -@@ -3249,8 +3510,10 @@ +@@ -3248,8 +3509,10 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) { @@ -3655,7 +3709,7 @@ TRACE("device %p, rect_count %u, rects %p, flags %#x, color {%.8e, %.8e, %.8e, %.8e}, depth %.8e, stencil %u.\n", device, rect_count, rects, flags, color->r, color->g, color->b, color->a, depth, stencil); -@@ -3259,12 +3522,19 @@ +@@ -3258,12 +3521,19 @@ WARN("Rects is %p, but rect_count is 0, ignoring clear\n", rects); return WINED3D_OK; } @@ -3675,7 +3729,7 @@ if (!ds) { WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n"); -@@ -3273,8 +3543,13 @@ +@@ -3272,8 +3542,13 @@ } else if (flags & WINED3DCLEAR_TARGET) { @@ -3689,7 +3743,7 @@ { WARN("Silently ignoring depth and target clear with mismatching sizes\n"); return WINED3D_OK; -@@ -3320,6 +3595,9 @@ +@@ -3319,6 +3594,9 @@ enum wined3d_primitive_type primitive_type) { GLenum gl_primitive_type, prev; @@ -3699,7 +3753,7 @@ TRACE("device %p, primitive_type %s\n", device, debug_d3dprimitivetype(primitive_type)); gl_primitive_type = gl_primitive_type_from_d3d(primitive_type); -@@ -3327,8 +3605,13 @@ +@@ -3326,8 +3604,13 @@ device->update_state->gl_primitive_type = gl_primitive_type; if (device->recording) device->recording->changed.primitive_type = TRUE; @@ -3713,7 +3767,7 @@ } void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device, -@@ -3351,6 +3634,14 @@ +@@ -3350,6 +3633,14 @@ return WINED3DERR_INVALIDCALL; } @@ -3728,7 +3782,7 @@ wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE); return WINED3D_OK; -@@ -3367,6 +3658,10 @@ +@@ -3366,6 +3657,10 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) { @@ -3739,7 +3793,7 @@ TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count); if (!device->state.index_buffer) -@@ -3385,6 +3680,15 @@ +@@ -3384,6 +3679,15 @@ return WINED3DERR_INVALIDCALL; } @@ -3755,7 +3809,7 @@ wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE); return WINED3D_OK; -@@ -3400,6 +3704,7 @@ +@@ -3399,6 +3703,7 @@ } /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ @@ -3763,7 +3817,7 @@ static void device_update_volume(struct wined3d_context *context, struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) { -@@ -3435,6 +3740,88 @@ +@@ -3434,6 +3739,88 @@ { enum wined3d_resource_type type = src_texture->resource.type; unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0; @@ -3852,7 +3906,7 @@ level_count = min(wined3d_texture_get_level_count(src_texture), wined3d_texture_get_level_count(dst_texture)); -@@ -3453,7 +3840,13 @@ +@@ -3452,7 +3839,13 @@ } /* Make sure that the destination texture is loaded. */ @@ -3866,7 +3920,7 @@ /* Update every surface level of the texture. */ switch (type) -@@ -3468,7 +3861,16 @@ +@@ -3467,7 +3860,16 @@ src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i + src_skip_levels)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); @@ -3883,7 +3937,7 @@ } break; } -@@ -3488,7 +3890,16 @@ +@@ -3487,7 +3889,16 @@ i * src_levels + j + src_skip_levels)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i * dst_levels + j)); @@ -3900,7 +3954,7 @@ } } break; -@@ -3498,6 +3909,7 @@ +@@ -3497,6 +3908,7 @@ { for (i = 0; i < level_count; ++i) { @@ -3908,7 +3962,7 @@ device_update_volume(context, volume_from_resource(wined3d_texture_get_sub_resource(src_texture, i + src_skip_levels)), -@@ -3546,6 +3958,25 @@ +@@ -3545,6 +3957,25 @@ } wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); @@ -3934,7 +3988,7 @@ return WINED3D_OK; } -@@ -3608,8 +4039,13 @@ +@@ -3607,8 +4038,13 @@ if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -3948,7 +4002,7 @@ if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -3706,6 +4142,7 @@ +@@ -3705,6 +4141,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, struct wined3d_surface *dst_surface, const POINT *dst_point) { @@ -3956,7 +4010,7 @@ const struct wined3d_format *src_format = src_surface->resource.format; const struct wined3d_format *dst_format = dst_surface->resource.format; UINT update_w, update_h; -@@ -3713,6 +4150,7 @@ +@@ -3712,6 +4149,7 @@ RECT r, dst_rect; POINT p; @@ -3964,7 +4018,7 @@ TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n", device, src_surface, wine_dbgstr_rect(src_rect), dst_surface, wine_dbgstr_point(dst_point)); -@@ -3724,6 +4162,7 @@ +@@ -3723,6 +4161,7 @@ return WINED3DERR_INVALIDCALL; } @@ -3972,7 +4026,7 @@ if (src_format->id != dst_format->id) { WARN("Source and destination surfaces should have the same format.\n"); -@@ -3786,6 +4225,9 @@ +@@ -3785,6 +4224,9 @@ wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point); return WINED3D_OK; @@ -3982,7 +4036,7 @@ } void CDECL wined3d_device_copy_resource(struct wined3d_device *device, -@@ -3887,8 +4329,14 @@ +@@ -3960,8 +4402,14 @@ rect = &r; } @@ -3997,7 +4051,7 @@ } struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, -@@ -3902,6 +4350,7 @@ +@@ -3975,6 +4423,7 @@ return NULL; } @@ -4005,7 +4059,7 @@ return device->state.fb.render_targets[view_idx]; } -@@ -3917,6 +4366,22 @@ +@@ -3990,6 +4439,22 @@ { struct wined3d_rendertarget_view *prev; struct wined3d_fb_state *fb = &device->state.fb; @@ -4028,7 +4082,7 @@ TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n", device, view_idx, view, set_viewport); -@@ -3956,6 +4421,7 @@ +@@ -4029,6 +4494,7 @@ } @@ -4036,7 +4090,7 @@ prev = fb->render_targets[view_idx]; if (view == prev) return WINED3D_OK; -@@ -3963,6 +4429,15 @@ +@@ -4036,6 +4502,15 @@ if (view) wined3d_rendertarget_view_incref(view); fb->render_targets[view_idx] = view; @@ -4052,7 +4106,7 @@ wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view); /* Release after the assignment, to prevent device_resource_released() * from seeing the surface as still in use. */ -@@ -3974,6 +4449,7 @@ +@@ -4047,6 +4522,7 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -4060,7 +4114,7 @@ struct wined3d_fb_state *fb = &device->state.fb; struct wined3d_rendertarget_view *prev; -@@ -3998,6 +4474,79 @@ +@@ -4071,6 +4547,79 @@ { TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n", device, x_hotspot, y_hotspot, cursor_image); @@ -4140,7 +4194,7 @@ if (cursor_image) { -@@ -4033,8 +4582,16 @@ +@@ -4106,8 +4655,16 @@ * release it after setting the cursor image. Windows doesn't * addref the set surface, so we can't do this either without * creating circular refcount dependencies. */ @@ -4157,7 +4211,7 @@ device->cursorWidth = cursor_image->resource.width; device->cursorHeight = cursor_image->resource.height; -@@ -4134,6 +4691,12 @@ +@@ -4207,6 +4764,12 @@ else SetCursor(NULL); } @@ -4170,7 +4224,7 @@ return oldVisible; } -@@ -4144,8 +4707,10 @@ +@@ -4217,8 +4780,10 @@ TRACE("device %p.\n", device); @@ -4181,7 +4235,7 @@ LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) { TRACE("Checking resource %p for eviction.\n", resource); -@@ -4153,6 +4718,7 @@ +@@ -4226,6 +4791,7 @@ if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) { TRACE("Evicting %p.\n", resource); @@ -4189,7 +4243,7 @@ wined3d_cs_emit_evict_resource(device->cs, resource); } } -@@ -4173,6 +4739,37 @@ +@@ -4246,6 +4812,37 @@ gl_info = context->gl_info; wine_rb_clear(&device->samplers, device_free_sampler, NULL); @@ -4227,7 +4281,7 @@ if (device->depth_blt_texture) { -@@ -4193,6 +4790,7 @@ +@@ -4266,6 +4863,7 @@ HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -4235,7 +4289,7 @@ swapchain->num_contexts = 0; } -@@ -4212,6 +4810,14 @@ +@@ -4285,6 +4883,14 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { @@ -4250,7 +4304,7 @@ HRESULT hr; if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4228,6 +4834,7 @@ +@@ -4301,6 +4907,7 @@ return hr; } @@ -4258,7 +4312,7 @@ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); if (FAILED(hr)) { -@@ -4238,6 +4845,34 @@ +@@ -4311,6 +4918,34 @@ } wined3d_cs_emit_create_dummy_textures(device->cs); @@ -4293,7 +4347,7 @@ return WINED3D_OK; } -@@ -4258,8 +4893,10 @@ +@@ -4331,8 +4966,10 @@ unsigned int i; TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback); @@ -4304,7 +4358,7 @@ if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { -@@ -4275,9 +4912,21 @@ +@@ -4348,9 +4985,21 @@ wined3d_texture_decref(device->logo_texture); device->logo_texture = NULL; } @@ -4326,7 +4380,7 @@ { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4286,6 +4935,7 @@ +@@ -4359,6 +5008,7 @@ } wined3d_device_set_depth_stencil_view(device, NULL); @@ -4334,7 +4388,7 @@ if (reset_state) { state_unbind_resources(&device->state); -@@ -4295,6 +4945,12 @@ +@@ -4368,6 +5018,12 @@ { wined3d_surface_decref(device->cs->onscreen_depth_stencil); device->cs->onscreen_depth_stencil = NULL; @@ -4347,7 +4401,7 @@ } if (reset_state) -@@ -4307,6 +4963,7 @@ +@@ -4380,6 +5036,7 @@ } } @@ -4355,7 +4409,7 @@ /* Free implicit resources and wait for the command stream before modifying * swapchain parameters. After modifying the swapchain parameters a new GL * context may be acquired by the worker thread. This causes problems in the -@@ -4328,6 +4985,7 @@ +@@ -4401,6 +5058,7 @@ } device->cs->ops->finish(device->cs); @@ -4363,7 +4417,7 @@ /* Is it necessary to recreate the gl context? Actually every setting can be changed * on an existing gl context, so there's no real need for recreation. * -@@ -4469,6 +5127,13 @@ +@@ -4542,6 +5200,13 @@ } } @@ -4377,7 +4431,7 @@ if (swapchain->desc.enable_auto_depth_stencil) { struct wined3d_resource_desc surface_desc; -@@ -4506,6 +5171,13 @@ +@@ -4579,6 +5244,13 @@ wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); } @@ -4391,7 +4445,7 @@ if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface( surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)), NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) -@@ -4588,12 +5260,20 @@ +@@ -4661,12 +5333,20 @@ } wined3d_cs_emit_reset_state(device->cs); state_cleanup(&device->state); @@ -4412,7 +4466,7 @@ &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize device state, hr %#x.\n", hr); device->update_state = &device->state; -@@ -4602,6 +5282,7 @@ +@@ -4675,6 +5355,7 @@ } else if (device->back_buffer_view) { @@ -4420,7 +4474,7 @@ struct wined3d_state *state = &device->state; wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE); -@@ -4617,6 +5298,24 @@ +@@ -4690,6 +5371,24 @@ state->scissor_rect.left = 0; state->scissor_rect.right = swapchain->desc.backbuffer_width; state->scissor_rect.bottom = swapchain->desc.backbuffer_height; @@ -4445,7 +4499,7 @@ wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4695,6 +5394,10 @@ +@@ -4768,6 +5467,10 @@ TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); @@ -4456,7 +4510,7 @@ switch (type) { case WINED3D_RTYPE_SURFACE: -@@ -4705,6 +5408,7 @@ +@@ -4778,6 +5481,7 @@ for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -4464,7 +4518,7 @@ if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface) { ERR("Surface %p is still in use as render target %u.\n", surface, i); -@@ -4716,6 +5420,19 @@ +@@ -4789,6 +5493,19 @@ { ERR("Surface %p is still in use as depth/stencil buffer.\n", surface); device->state.fb.depth_stencil = NULL; @@ -4484,7 +4538,7 @@ } } break; -@@ -4878,7 +5595,11 @@ +@@ -4951,7 +5668,11 @@ device->blitter = adapter->blitter; @@ -4496,7 +4550,7 @@ &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) { ERR("Failed to initialize device state, hr %#x.\n", hr); -@@ -4977,6 +5698,7 @@ +@@ -5050,6 +5771,7 @@ else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -4504,7 +4558,7 @@ /* Context activation is done by the caller */ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, -@@ -5030,3 +5752,4 @@ +@@ -5103,3 +5825,4 @@ wined3d_device_destroy_bo(device, context, bo); } @@ -6269,7 +6323,19 @@ } static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_resource, -@@ -1303,7 +1432,11 @@ +@@ -1278,7 +1407,11 @@ + struct wined3d_const_bo_address addr; + unsigned int row_pitch, slice_pitch; + ++#if defined(STAGING_CSMT) + wined3d_resource_get_pitch(sub_resource, &row_pitch, &slice_pitch); ++#else /* STAGING_CSMT */ ++ wined3d_volume_get_pitch(volume, &row_pitch, &slice_pitch); ++#endif /* STAGING_CSMT */ + if (row_pitch != data->row_pitch || slice_pitch != data->slice_pitch) + FIXME("Ignoring row/slice pitch (%u/%u).\n", data->row_pitch, data->slice_pitch); + +@@ -1303,7 +1436,11 @@ void *mem = NULL; if (gl_info->supported[APPLE_CLIENT_STORAGE] && !format->convert @@ -6281,7 +6347,7 @@ { 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); -@@ -1350,6 +1483,7 @@ +@@ -1350,6 +1487,7 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6289,7 +6355,7 @@ HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1358,6 +1492,14 @@ +@@ -1358,6 +1496,14 @@ { WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture); HeapFree(GetProcessHeap(), 0, texture); @@ -6304,7 +6370,7 @@ return WINED3DERR_INVALIDCALL; } -@@ -1367,6 +1509,7 @@ +@@ -1367,6 +1513,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); @@ -6312,7 +6378,7 @@ HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1375,6 +1518,14 @@ +@@ -1375,6 +1522,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6327,7 +6393,7 @@ return WINED3DERR_INVALIDCALL; } } -@@ -1402,7 +1553,9 @@ +@@ -1402,7 +1557,9 @@ { WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n", desc->width, desc->height, desc->depth); @@ -6337,7 +6403,7 @@ return WINED3DERR_INVALIDCALL; } } -@@ -1412,7 +1565,9 @@ +@@ -1412,7 +1569,9 @@ 0, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6347,7 +6413,7 @@ return hr; } -@@ -1489,6 +1644,9 @@ +@@ -1489,6 +1648,9 @@ if (FAILED(hr)) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6449,7 +6515,36 @@ } void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, -@@ -464,7 +504,11 @@ +@@ -372,7 +412,9 @@ + BITMAPINFO *b_info; + int extraline = 0; + DWORD *masks; ++#if defined(STAGING_CSMT) + UINT row_pitch, slice_pitch; ++#endif /* STAGING_CSMT */ + + TRACE("surface %p.\n", surface); + +@@ -418,11 +460,18 @@ + + b_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + /* TODO: Is there a nicer way to force a specific alignment? (8 byte for ddraw) */ ++#if defined(STAGING_CSMT) + wined3d_resource_get_pitch(&surface->resource, &row_pitch, &slice_pitch); + b_info->bmiHeader.biWidth = row_pitch / format->byte_count; + b_info->bmiHeader.biHeight = 0 - surface->resource.height - extraline; + b_info->bmiHeader.biSizeImage = (surface->resource.height + extraline) + * row_pitch; ++#else /* STAGING_CSMT */ ++ b_info->bmiHeader.biWidth = wined3d_surface_get_pitch(surface) / format->byte_count; ++ b_info->bmiHeader.biHeight = 0 - surface->resource.height - extraline; ++ b_info->bmiHeader.biSizeImage = (surface->resource.height + extraline) ++ * wined3d_surface_get_pitch(surface); ++#endif /* STAGING_CSMT */ + b_info->bmiHeader.biPlanes = 1; + b_info->bmiHeader.biBitCount = format->byte_count * 8; + +@@ -464,7 +513,11 @@ TRACE("Creating a DIB section with size %dx%dx%d, size=%d.\n", b_info->bmiHeader.biWidth, b_info->bmiHeader.biHeight, b_info->bmiHeader.biBitCount, b_info->bmiHeader.biSizeImage); @@ -6461,7 +6556,7 @@ if (!surface->dib.DIBsection) { -@@ -473,7 +517,11 @@ +@@ -473,7 +526,11 @@ return HRESULT_FROM_WIN32(GetLastError()); } @@ -6473,7 +6568,7 @@ surface->dib.bitmap_size = b_info->bmiHeader.biSizeImage; HeapFree(GetProcessHeap(), 0, b_info); -@@ -487,6 +535,116 @@ +@@ -487,6 +544,116 @@ return WINED3D_OK; } @@ -6590,7 +6685,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) { /* In some conditions the surface memory must not be freed: -@@ -499,8 +657,34 @@ +@@ -499,8 +666,34 @@ return; wined3d_resource_free_sysmem(&surface->resource); @@ -6625,7 +6720,7 @@ } static BOOL surface_use_pbo(const struct wined3d_surface *surface) -@@ -585,7 +769,11 @@ +@@ -585,7 +778,11 @@ } if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) @@ -6637,7 +6732,7 @@ if (surface_use_pbo(surface)) surface->resource.map_binding = WINED3D_LOCATION_BUFFER; -@@ -593,6 +781,7 @@ +@@ -593,6 +790,7 @@ return WINED3D_OK; } @@ -6645,7 +6740,7 @@ static void surface_frontbuffer_updated(struct wined3d_surface *surface) { struct wined3d_context *context = NULL; -@@ -609,6 +798,50 @@ +@@ -609,6 +807,50 @@ wined3d_resource_load_location(&surface->resource, context, surface->container->resource.draw_binding); if (context) context_release(context); @@ -6696,7 +6791,7 @@ } static BOOL surface_is_full_rect(const struct wined3d_surface *surface, const RECT *r) -@@ -659,6 +892,14 @@ +@@ -659,6 +901,14 @@ if (src_mask & WINED3DFMT_FLAG_STENCIL) gl_mask |= GL_STENCIL_BUFFER_BIT; @@ -6711,7 +6806,7 @@ context = context_acquire(device, NULL); if (!context->valid) { -@@ -667,12 +908,14 @@ +@@ -667,12 +917,14 @@ return; } @@ -6726,7 +6821,7 @@ gl_info = context->gl_info; context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, NULL, src_surface, src_location); -@@ -712,6 +955,7 @@ +@@ -712,6 +964,7 @@ context_release(context); } @@ -6734,7 +6829,7 @@ /* Blit between surface locations. Onscreen on different swapchains is not supported. * Depth / stencil is not supported. Context activation is done by the caller. */ static void surface_blt_fbo(const struct wined3d_device *device, -@@ -722,6 +966,16 @@ +@@ -722,6 +975,16 @@ const struct wined3d_gl_info *gl_info; struct wined3d_context *context; struct wined3d_surface *required_rt, *restore_rt; @@ -6751,7 +6846,7 @@ RECT src_rect, dst_rect; GLenum gl_filter; GLenum buffer; -@@ -760,6 +1014,7 @@ +@@ -760,6 +1023,7 @@ * surface isn't required if the entire surface is overwritten. (And is * in fact harmful if we're being called by surface_load_location() with * the purpose of loading the destination surface.) */ @@ -6759,7 +6854,7 @@ wined3d_resource_load_location(&src_surface->resource, old_ctx, src_location); if (!surface_is_full_rect(dst_surface, &dst_rect)) wined3d_resource_load_location(&dst_surface->resource, old_ctx, dst_location); -@@ -778,6 +1033,15 @@ +@@ -778,6 +1042,15 @@ restore_rt = NULL; context = old_ctx; } @@ -6775,7 +6870,7 @@ if (!context->valid) { -@@ -840,12 +1104,16 @@ +@@ -840,12 +1113,16 @@ && dst_surface->container->swapchain->front_buffer == dst_surface->container)) gl_info->gl_ops.gl.p_glFlush(); @@ -6792,7 +6887,7 @@ } static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined3d_blit_op blit_op, -@@ -968,6 +1236,18 @@ +@@ -968,6 +1245,18 @@ return wined3d_surface_blt(surface, NULL, render_target, NULL, 0, NULL, WINED3D_TEXF_POINT); } @@ -6811,7 +6906,7 @@ static ULONG surface_resource_incref(struct wined3d_resource *resource) { return wined3d_surface_incref(surface_from_resource(resource)); -@@ -988,6 +1268,7 @@ +@@ -988,6 +1277,7 @@ TRACE("surface %p.\n", surface); @@ -6819,7 +6914,7 @@ context = context_acquire(device, NULL); gl_info = context->gl_info; -@@ -999,6 +1280,23 @@ +@@ -999,6 +1289,23 @@ * opengl resources, so we cannot leave early. */ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DISCARDED); wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DISCARDED); @@ -6843,7 +6938,7 @@ /* We also get here when the ddraw swapchain is destroyed, for example * for a mode switch. In this case this surface won't necessarily be -@@ -1008,10 +1306,24 @@ +@@ -1008,10 +1315,24 @@ } else { @@ -6868,7 +6963,7 @@ /* Destroy fbo render buffers. This is needed for implicit render targets, for * all application-created targets the application has to release the surface -@@ -1042,6 +1354,7 @@ +@@ -1042,6 +1363,7 @@ resource_unload(resource); } @@ -6876,7 +6971,7 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); -@@ -1057,6 +1370,19 @@ +@@ -1057,6 +1379,19 @@ { surface_private_setup, surface_frontbuffer_updated, @@ -6896,7 +6991,7 @@ }; /***************************************************************************** -@@ -1100,6 +1426,7 @@ +@@ -1100,6 +1435,7 @@ return WINED3D_OK; } @@ -6904,7 +6999,7 @@ static void gdi_surface_frontbuffer_updated(struct wined3d_surface *surface) { x11_copy_to_screen(surface->container->swapchain, &surface->lockedRect); -@@ -1109,6 +1436,23 @@ +@@ -1109,6 +1445,23 @@ { gdi_surface_private_setup, gdi_surface_frontbuffer_updated, @@ -6928,7 +7023,7 @@ }; /* This call just downloads data, the caller is responsible for binding the -@@ -1127,7 +1471,11 @@ +@@ -1127,7 +1480,11 @@ return; } @@ -6940,7 +7035,54 @@ if (surface->container->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) { -@@ -1376,6 +1724,7 @@ +@@ -1155,6 +1512,7 @@ + void *mem; + GLenum gl_format = format->glFormat; + GLenum gl_type = format->glType; ++#if defined(STAGING_CSMT) + UINT src_pitch = 0; + UINT dst_row_pitch, dst_slice_pitch; + +@@ -1163,6 +1521,16 @@ + unsigned char alignment = surface->resource.device->surface_alignment; + src_pitch = format->byte_count * surface->pow2Width; + wined3d_resource_get_pitch(&surface->resource, &dst_row_pitch, &dst_slice_pitch); ++#else /* STAGING_CSMT */ ++ int src_pitch = 0; ++ int dst_pitch = 0; ++ ++ if (surface->flags & SFLAG_NONPOW2) ++ { ++ unsigned char alignment = surface->resource.device->surface_alignment; ++ src_pitch = format->byte_count * surface->pow2Width; ++ dst_pitch = wined3d_surface_get_pitch(surface); ++#endif /* STAGING_CSMT */ + src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1); + mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * surface->pow2Height); + } +@@ -1249,12 +1617,21 @@ + * won't be released, and doesn't have to be re-read. */ + src_data = mem; + dst_data = data.addr; ++#if defined(STAGING_CSMT) + TRACE("(%p) : Repacking the surface data from pitch %d to pitch %d\n", surface, src_pitch, dst_row_pitch); + for (y = 0; y < surface->resource.height; ++y) + { + memcpy(dst_data, src_data, dst_row_pitch); + src_data += src_pitch; + dst_data += dst_row_pitch; ++#else /* STAGING_CSMT */ ++ TRACE("(%p) : Repacking the surface data from pitch %d to pitch %d\n", surface, src_pitch, dst_pitch); ++ for (y = 0; y < surface->resource.height; ++y) ++ { ++ memcpy(dst_data, src_data, dst_pitch); ++ src_data += src_pitch; ++ dst_data += dst_pitch; ++#endif /* STAGING_CSMT */ + } + + HeapFree(GetProcessHeap(), 0, mem); +@@ -1376,6 +1753,7 @@ } } @@ -6948,7 +7090,7 @@ BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) { struct wined3d_box box; -@@ -1390,6 +1739,27 @@ +@@ -1390,6 +1768,27 @@ box.bottom = rect->bottom; box.back = 1; return wined3d_resource_check_block_align(&surface->resource, &box); @@ -6976,7 +7118,19 @@ } HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, -@@ -1475,11 +1845,17 @@ +@@ -1404,7 +1803,11 @@ + UINT update_w, update_h; + UINT dst_w, dst_h; + RECT r, dst_rect; ++#if defined(STAGING_CSMT) + UINT src_row_pitch, src_slice_pitch; ++#else /* STAGING_CSMT */ ++ UINT src_pitch; ++#endif /* STAGING_CSMT */ + POINT p; + + TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n", +@@ -1475,11 +1878,17 @@ return WINED3DERR_INVALIDCALL; } @@ -6994,7 +7148,7 @@ context = context_acquire(dst_surface->resource.device, NULL); gl_info = context->gl_info; -@@ -1490,10 +1866,17 @@ +@@ -1490,6 +1899,7 @@ if (update_w == dst_w && update_h == dst_h) wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); else @@ -7002,31 +7156,29 @@ wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); - wined3d_resource_get_memory(&src_surface->resource, src_surface->resource.locations, &data); +@@ -1503,6 +1913,21 @@ + + wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); +#else /* STAGING_CSMT */ + surface_load_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); + + surface_get_memory(src_surface, &data, src_surface->locations); -+#endif /* STAGING_CSMT */ - wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); - - wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -@@ -1501,8 +1884,13 @@ - - context_release(context); - -+#if defined(STAGING_CSMT) - wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); - wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); -+#else /* STAGING_CSMT */ ++ src_pitch = wined3d_surface_get_pitch(src_surface); ++ ++ wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, ++ src_pitch, dst_point, FALSE, wined3d_const_bo_address(&data)); ++ ++ context_release(context); ++ + surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); + surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); +#endif /* STAGING_CSMT */ return WINED3D_OK; } -@@ -1606,8 +1994,12 @@ +@@ -1606,8 +2031,12 @@ return GL_BACK; } @@ -7039,7 +7191,7 @@ { DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; -@@ -1616,6 +2008,7 @@ +@@ -1616,6 +2045,7 @@ if (surface->resource.pool == WINED3D_POOL_SCRATCH) ERR("Not supported on scratch surfaces.\n"); @@ -7047,7 +7199,7 @@ if (surface->resource.locations & location) { TRACE("surface is already in texture\n"); -@@ -1624,6 +2017,16 @@ +@@ -1624,6 +2054,16 @@ TRACE("Reloading because surface is dirty.\n"); wined3d_resource_load_location(&surface->resource, context, location); @@ -7064,7 +7216,7 @@ surface_evict_sysmem(surface); } -@@ -1706,6 +2109,7 @@ +@@ -1706,6 +2146,7 @@ void CDECL wined3d_surface_preload(struct wined3d_surface *surface) { @@ -7072,7 +7224,7 @@ const struct wined3d_device *device = surface->resource.device; TRACE("surface %p.\n", surface); -@@ -1716,6 +2120,17 @@ +@@ -1716,6 +2157,17 @@ } wined3d_cs_emit_surface_preload(device->cs, surface); @@ -7090,7 +7242,36 @@ } void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) -@@ -1902,6 +2317,7 @@ +@@ -1782,10 +2234,28 @@ + + DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface) + { ++#if defined(STAGING_CSMT) + UINT row_pitch, slice_pitch; + const struct wined3d_resource *resource = &surface->resource; + wined3d_resource_get_pitch(resource, &row_pitch, &slice_pitch); + return row_pitch; ++#else /* STAGING_CSMT */ ++ unsigned int alignment; ++ DWORD pitch; ++ ++ TRACE("surface %p.\n", surface); ++ ++ if (surface->pitch) ++ return surface->pitch; ++ ++ alignment = surface->resource.device->surface_alignment; ++ pitch = wined3d_format_calculate_pitch(surface->resource.format, surface->resource.width); ++ pitch = (pitch + alignment - 1) & ~(alignment - 1); ++ ++ TRACE("Returning %u.\n", pitch); ++ ++ return pitch; ++#endif /* STAGING_CSMT */ + } + + HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y) +@@ -1910,6 +2380,7 @@ { DeleteDC(surface->hDC); DeleteObject(surface->dib.DIBsection); @@ -7098,7 +7279,7 @@ surface->resource.bitmap_data = NULL; surface->flags &= ~SFLAG_DIBSECTION; create_dib = TRUE; -@@ -1910,6 +2326,15 @@ +@@ -1918,6 +2389,15 @@ surface->resource.locations = 0; wined3d_resource_free_sysmem(&surface->resource); surface->resource.map_heap_memory = NULL; @@ -7114,19 +7295,43 @@ width = texture_resource->width; height = texture_resource->height; -@@ -1935,7 +2360,11 @@ +@@ -1943,6 +2423,7 @@ else surface->flags &= ~SFLAG_NONPOW2; +#if defined(STAGING_CSMT) if ((surface->resource.user_memory = mem)) + { + surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; +@@ -1963,6 +2444,27 @@ + surface->resource.size = wined3d_format_calculate_size(texture_resource->format, 1, width, height, 1); + surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width); + surface->resource.custom_slice_pitch = surface->resource.custom_row_pitch * surface->resource.height; /* FIXME */ +#else /* STAGING_CSMT */ + if ((surface->user_memory = mem)) ++ { ++ surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; ++ valid_location = WINED3D_LOCATION_USER_MEMORY; ++ } ++ surface->pitch = pitch; ++ surface->resource.format = texture_resource->format; ++ surface->resource.multisample_type = texture_resource->multisample_type; ++ surface->resource.multisample_quality = texture_resource->multisample_quality; ++ if (surface->pitch) ++ { ++ surface->resource.size = height * surface->pitch; ++ } ++ else ++ { ++ /* User memory surfaces don't have the regular surface alignment. */ ++ surface->resource.size = wined3d_format_calculate_size(texture_resource->format, ++ 1, width, height, 1); ++ surface->pitch = wined3d_format_calculate_pitch(texture_resource->format, width); +#endif /* STAGING_CSMT */ - { - surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; - valid_location = WINED3D_LOCATION_USER_MEMORY; -@@ -1977,11 +2406,19 @@ + } + + /* The format might be changed to a format that needs conversion. +@@ -1985,11 +2487,19 @@ if (!valid_location) { @@ -7146,7 +7351,7 @@ return WINED3D_OK; } -@@ -2340,6 +2777,7 @@ +@@ -2348,6 +2858,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) { @@ -7154,7 +7359,7 @@ void *dst_data = NULL, *src_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const struct d3dfmt_converter_desc *conv; -@@ -2348,6 +2786,13 @@ +@@ -2356,6 +2867,13 @@ struct wined3d_surface *dst; struct wined3d_context *context = NULL; struct wined3d_device *device = source->resource.device; @@ -7168,7 +7373,7 @@ conv = find_converter(source->resource.format->id, to_fmt); if (!conv) -@@ -2371,6 +2816,7 @@ +@@ -2379,6 +2897,7 @@ } dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); @@ -7176,7 +7381,7 @@ wined3d_resource_get_pitch(&source->resource, &src_row_pitch, &src_slice_pitch); wined3d_resource_get_pitch(&ret->resource, &dst_row_pitch, &dst_slice_pitch); -@@ -2411,6 +2857,32 @@ +@@ -2419,6 +2938,32 @@ if (context) context_release(context); return NULL; @@ -7209,7 +7414,7 @@ } static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height, -@@ -2478,6 +2950,7 @@ +@@ -2486,6 +3031,7 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -7217,20 +7422,28 @@ HRESULT hr; TRACE("surface %p.\n", surface); -@@ -2496,6 +2969,40 @@ +@@ -2504,18 +3050,59 @@ struct wined3d_box box; const struct wined3d_format *format = surface->resource.format; unsigned int fmt_flags = surface->container->resource.format_flags; +#else /* STAGING_CSMT */ + TRACE("surface %p.\n", surface); -+ + +- if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && rect +- && !surface_check_block_align(surface, rect)) + if (!surface->resource.map_count) -+ { + { +- WARN("Map rect %s is misaligned for %ux%u blocks.\n", +- wine_dbgstr_rect(rect), format->block_width, format->block_height); +- +- if (surface->resource.pool == WINED3D_POOL_DEFAULT) +- return WINED3DERR_INVALIDCALL; + WARN("Trying to unmap unmapped surface.\n"); + return WINEDDERR_NOTLOCKED; -+ } + } + --surface->resource.map_count; -+ + +- /* Performance optimization: Count how often a surface is mapped, if it is + surface->surface_ops->surface_unmap(surface); + + return WINED3D_OK; @@ -7255,13 +7468,17 @@ + return WINED3DERR_INVALIDCALL; + } +#endif /* STAGING_CSMT */ - - if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && rect - && !surface_check_block_align(surface, rect)) -@@ -2507,6 +3014,13 @@ - return WINED3DERR_INVALIDCALL; - } - ++ ++ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && rect ++ && !surface_check_block_align(surface, rect)) ++ { ++ WARN("Map rect %s is misaligned for %ux%u blocks.\n", ++ wine_dbgstr_rect(rect), format->block_width, format->block_height); ++ ++ if (surface->resource.pool == WINED3D_POOL_DEFAULT) ++ return WINED3DERR_INVALIDCALL; ++ } ++ +#if !defined(STAGING_CSMT) + ++surface->resource.map_count; + @@ -7269,10 +7486,11 @@ + WARN("Trying to lock unlockable surface.\n"); + +#endif /* STAGING_CSMT */ - /* Performance optimization: Count how often a surface is mapped, if it is ++ /* Performance optimization: Count how often a surface is mapped, if it is * mapped regularly do not throw away the system memory copy. This avoids * the need to download the surface from OpenGL all the time. The surface -@@ -2522,6 +3036,7 @@ + * is still downloaded if the OpenGL texture is changed. Note that this +@@ -2530,6 +3117,7 @@ } } @@ -7280,9 +7498,9 @@ if (rect) { surface->lockedRect = *rect; -@@ -2586,22 +3101,121 @@ - WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->container->resource.format->id)); - return WINED3DERR_INVALIDCALL; +@@ -2635,6 +3223,140 @@ + if (context) + context_release(context); } +#else /* STAGING_CSMT */ + surface_prepare_map_memory(surface); @@ -7296,26 +7514,13 @@ + { + if (surface->resource.usage & WINED3DUSAGE_DYNAMIC) + WARN_(d3d_perf)("Mapping a dynamic surface without WINED3D_MAP_DISCARD.\n"); - -- /* Give more detailed info for ddraw. */ -- if (surface->flags & SFLAG_DCINUSE) -- return WINEDDERR_DCALREADYCREATED; -- -- /* Can't GetDC if the surface is locked. */ -- if (surface->resource.map_count) -- return WINED3DERR_INVALIDCALL; ++ + surface_load_location(surface, surface->resource.map_binding); + } - -- surface->flags |= SFLAG_DCINUSE; -- surface->resource.map_count++; -- wined3d_cs_emit_getdc(device->cs, surface); -- *dc = surface->hDC; -- TRACE("Returning dc %p.\n", *dc); ++ + if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) + surface_invalidate_location(surface, ~surface->resource.map_binding); - -- return *dc ? WINED3D_OK : WINED3DERR_INVALIDCALL; ++ + switch (surface->resource.map_binding) + { + case WINED3D_LOCATION_SYSMEM: @@ -7350,7 +7555,7 @@ + if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + map_desc->row_pitch = surface->resource.width * format->byte_count; + else -+ wined3d_resource_get_pitch(&surface->resource, &map_desc->row_pitch, &map_desc->slice_pitch); ++ map_desc->row_pitch = wined3d_surface_get_pitch(surface); + map_desc->slice_pitch = 0; + + if (!rect) @@ -7394,7 +7599,6 @@ + HRESULT hr; + + TRACE("surface %p, dc %p.\n", surface, dc); -+#endif /* STAGING_CSMT */ + + /* Give more detailed info for ddraw. */ + if (surface->flags & SFLAG_DCINUSE) @@ -7404,22 +7608,6 @@ + if (surface->resource.map_count) + return WINED3DERR_INVALIDCALL; + -+#if defined(STAGING_CSMT) -+ surface->flags |= SFLAG_DCINUSE; -+ surface->resource.map_count++; -+ wined3d_cs_emit_getdc(device->cs, surface); -+ *dc = surface->hDC; -+ TRACE("Returning dc %p.\n", *dc); -+ -+ return *dc ? WINED3D_OK : WINED3DERR_INVALIDCALL; - } - - void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) -@@ -2627,6 +3241,35 @@ - if (context) - context_release(context); - } -+#else /* STAGING_CSMT */ + /* Create a DIB section if there isn't a dc yet. */ + if (!surface->hDC) + { @@ -7451,7 +7639,7 @@ } HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -@@ -2646,6 +3289,7 @@ +@@ -2654,6 +3376,7 @@ surface->resource.map_count--; surface->flags &= ~SFLAG_DCINUSE; @@ -7459,10 +7647,10 @@ wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); return WINED3D_OK; -@@ -2658,6 +3302,31 @@ - const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; - struct wined3d_surface *restore_rt; +@@ -2690,6 +3413,40 @@ + context = context_acquire(device, surface); + } + +#else /* STAGING_CSMT */ + if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY + || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM @@ -7487,31 +7675,48 @@ + struct wined3d_device *device = surface->resource.device; + const struct wined3d_gl_info *gl_info; + struct wined3d_context *context; ++ BYTE *mem; ++ BYTE *row, *top, *bottom; ++ int i; ++ BOOL srcIsUpsideDown; ++ struct wined3d_bo_address data; ++ ++ surface_get_memory(surface, &data, dst_location); ++ ++ context = context_acquire(device, surface); +#endif /* STAGING_CSMT */ - BYTE *mem; - BYTE *row, *top, *bottom; - int i; -@@ -2665,6 +3334,7 @@ - struct wined3d_bo_address data; - UINT row_pitch, slice_pitch; + context_apply_blit_state(context, device); + gl_info = context->gl_info; +@@ -2722,8 +3479,13 @@ + } + + /* Setup pixel store pack state -- to glReadPixels into the correct place */ +#if defined(STAGING_CSMT) - wined3d_resource_get_memory(&surface->resource, dst_location, &data); + wined3d_resource_get_pitch(&surface->resource, &row_pitch, &slice_pitch); + gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, row_pitch / surface->resource.format->byte_count); ++#else /* STAGING_CSMT */ ++ gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, ++ wined3d_surface_get_pitch(surface) / surface->resource.format->byte_count); ++#endif /* STAGING_CSMT */ + checkGLcall("glPixelStorei"); - /* Context_release does not restore the original context in case of -@@ -2682,6 +3352,11 @@ - context = context_acquire(device, surface); - } + gl_info->gl_ops.gl.p_glReadPixels(0, 0, +@@ -2740,9 +3502,13 @@ + { + /* glReadPixels returns the image upside down, and there is no way to prevent this. + * Flip the lines in software. */ ++#if defined(STAGING_CSMT) + UINT pitch, slice_pitch; + wined3d_resource_get_pitch(&surface->resource, &pitch, &slice_pitch); +#else /* STAGING_CSMT */ -+ surface_get_memory(surface, &data, dst_location); -+ -+ context = context_acquire(device, surface); ++ UINT pitch = wined3d_surface_get_pitch(surface); +#endif /* STAGING_CSMT */ - context_apply_blit_state(context, device); - gl_info = context->gl_info; -@@ -2770,12 +3445,16 @@ + if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) + goto error; +@@ -2778,12 +3544,16 @@ checkGLcall("glBindBuffer"); } @@ -7528,7 +7733,7 @@ } /* Read the framebuffer contents into a texture. Note that this function -@@ -2837,6 +3516,85 @@ +@@ -2845,6 +3615,85 @@ } } @@ -7614,7 +7819,7 @@ /* Does a direct frame buffer -> texture copy. Stretching is done with single * pixel copy calls. */ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, -@@ -2943,8 +3701,13 @@ +@@ -2951,8 +3800,13 @@ /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ @@ -7628,7 +7833,7 @@ } /* Uses the hardware to stretch and flip the image */ -@@ -3012,7 +3775,11 @@ +@@ -3020,7 +3874,11 @@ checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -7640,7 +7845,7 @@ } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3209,6 +3976,7 @@ +@@ -3217,6 +4075,7 @@ checkGLcall("glDeleteTextures(1, &backup)"); } @@ -7648,7 +7853,7 @@ if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering) -@@ -3220,6 +3988,17 @@ +@@ -3228,6 +4087,17 @@ * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -7666,7 +7871,7 @@ } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3250,6 +4029,7 @@ +@@ -3258,6 +4128,7 @@ rect->bottom = drawable_height - rect->bottom; } @@ -7674,7 +7879,7 @@ /* Context activation is done by the caller. */ static void surface_blt_to_drawable(const struct wined3d_device *device, struct wined3d_context *old_ctx, -@@ -3284,6 +4064,26 @@ +@@ -3292,6 +4163,26 @@ /* Make sure the surface is up-to-date. This should probably use * wined3d_resource_load_location() and worry about the destination * surface too, unless we're overwriting it completely. */ @@ -7701,7 +7906,7 @@ wined3d_texture_load(src_surface->container, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -3326,6 +4126,7 @@ +@@ -3334,6 +4225,7 @@ /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -7709,7 +7914,7 @@ if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering -@@ -3339,6 +4140,14 @@ +@@ -3347,6 +4239,14 @@ context = context_acquire(device, restore_rt); context_release(context); } @@ -7724,7 +7929,7 @@ } HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) -@@ -3362,8 +4171,13 @@ +@@ -3370,8 +4270,13 @@ enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -7738,7 +7943,7 @@ TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, blt_fx %p, filter %s.\n", dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), -@@ -3554,6 +4368,7 @@ +@@ -3562,6 +4467,7 @@ { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -7746,7 +7951,7 @@ if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) || (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB))) -@@ -3562,6 +4377,15 @@ +@@ -3570,6 +4476,15 @@ surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; surface->resource.locations = location; @@ -7762,7 +7967,7 @@ } /* Context activation is done by the caller. */ -@@ -3576,7 +4400,11 @@ +@@ -3584,7 +4499,11 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -7774,7 +7979,7 @@ { w = surface->ds_current_size.cx; h = surface->ds_current_size.cy; -@@ -3602,7 +4430,11 @@ +@@ -3610,7 +4529,11 @@ return; } @@ -7786,7 +7991,7 @@ { TRACE("Surface was discarded, no need copy data.\n"); switch (location) -@@ -3622,6 +4454,7 @@ +@@ -3630,6 +4553,7 @@ default: FIXME("Unhandled location %#x\n", location); } @@ -7794,7 +7999,7 @@ surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED; surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; -@@ -3633,6 +4466,19 @@ +@@ -3641,6 +4565,19 @@ { FIXME("No up to date depth stencil location.\n"); surface->resource.locations |= location; @@ -7814,7 +8019,7 @@ surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; return; -@@ -3697,9 +4543,13 @@ +@@ -3705,9 +4642,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7828,7 +8033,7 @@ gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else if (location == WINED3D_LOCATION_DRAWABLE) -@@ -3715,9 +4565,13 @@ +@@ -3723,9 +4664,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7842,7 +8047,7 @@ gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else -@@ -3725,6 +4579,7 @@ +@@ -3733,6 +4678,7 @@ ERR("Invalid location (%#x) specified.\n", location); } @@ -7850,7 +8055,7 @@ surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; -@@ -3770,6 +4625,135 @@ +@@ -3778,6 +4724,135 @@ TRACE("Surface was discarded, nothing to do.\n"); return WINED3D_OK; } @@ -7986,7 +8191,7 @@ if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && wined3d_resource_is_offscreen(&surface->container->resource)) -@@ -3779,6 +4763,7 @@ +@@ -3787,6 +4862,7 @@ } surface_get_rect(surface, NULL, &r); @@ -7994,7 +8199,7 @@ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -3847,6 +4832,66 @@ +@@ -3855,6 +4931,66 @@ RECT rect = {0, 0, surface->resource.width, surface->resource.height}; surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, @@ -8014,7 +8219,7 @@ + const struct wined3d_color_key_conversion *conversion; + struct wined3d_texture *texture = surface->container; + struct wined3d_context *context; -+ UINT width, src_row_pitch, src_slice_pitch, dst_pitch; ++ UINT width, src_pitch, dst_pitch; + struct wined3d_bo_address data; + struct wined3d_format format; + POINT dst_point = {0, 0}; @@ -8061,7 +8266,7 @@ &rect, surface, dst_location, &rect); return WINED3D_OK; -@@ -3856,6 +4901,7 @@ +@@ -3864,6 +5000,7 @@ if (srgb) { @@ -8069,10 +8274,10 @@ if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) == WINED3D_LOCATION_TEXTURE_RGB) { -@@ -3884,6 +4930,39 @@ - wined3d_resource_prepare_system_memory(&surface->resource); - wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); - } +@@ -3898,6 +5035,45 @@ + + width = surface->resource.width; + wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch); +#else /* STAGING_CSMT */ + if ((surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) + == WINED3D_LOCATION_TEXTURE_RGB) @@ -8105,11 +8310,17 @@ + + /* TODO: Use already acquired context when possible. */ + context = context_acquire(device, NULL); ++ ++ wined3d_texture_prepare_texture(texture, context, srgb); ++ wined3d_texture_bind_and_dirtify(texture, context, srgb); ++ ++ width = surface->resource.width; ++ src_pitch = wined3d_surface_get_pitch(surface); +#endif /* STAGING_CSMT */ - wined3d_texture_prepare_texture(texture, context, srgb); - wined3d_texture_bind_and_dirtify(texture, context, srgb); -@@ -3898,7 +4977,11 @@ + format = *texture->resource.format; + if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) +@@ -3906,7 +5082,11 @@ /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ @@ -8121,7 +8332,7 @@ { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3907,6 +4990,7 @@ +@@ -3915,6 +5095,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -8129,7 +8340,7 @@ wined3d_resource_prepare_map_memory(&surface->resource, context); wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_free_bo(&surface->resource); -@@ -3914,6 +4998,14 @@ +@@ -3922,6 +5103,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -8144,19 +8355,44 @@ if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -3959,6 +5051,7 @@ - wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, - src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); - +@@ -3936,9 +5125,15 @@ + context_release(context); + return E_OUTOFMEMORY; + } +#if defined(STAGING_CSMT) - HeapFree(GetProcessHeap(), 0, mem); - - return WINED3D_OK; -@@ -3982,6 +5075,31 @@ + format.convert(data.addr, mem, src_row_pitch, src_row_pitch * height, + dst_pitch, dst_pitch * height, width, height, 1); + src_row_pitch = dst_pitch; ++#else /* STAGING_CSMT */ ++ format.convert(data.addr, mem, src_pitch, src_pitch * height, ++ dst_pitch, dst_pitch * height, width, height, 1); ++ src_pitch = dst_pitch; ++#endif /* STAGING_CSMT */ + data.addr = mem; + } + else if (conversion) +@@ -3958,6 +5153,7 @@ + } + if (texture->swapchain && texture->swapchain->palette) + palette = texture->swapchain->palette; ++#if defined(STAGING_CSMT) + conversion->convert(data.addr, src_row_pitch, mem, dst_pitch, + width, height, palette, &texture->async.gl_color_key); + src_row_pitch = dst_pitch; +@@ -3990,6 +5186,40 @@ struct wined3d_context *context, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); +#else /* STAGING_CSMT */ ++ conversion->convert(data.addr, src_pitch, mem, dst_pitch, ++ width, height, palette, &texture->async.gl_color_key); ++ src_pitch = dst_pitch; ++ data.addr = mem; ++ } ++ ++ wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, ++ src_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); ++ + context_release(context); + + HeapFree(GetProcessHeap(), 0, mem); @@ -8184,7 +8420,7 @@ HRESULT hr; TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -3989,6 +5107,7 @@ +@@ -3997,6 +5227,7 @@ if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -8192,7 +8428,7 @@ && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) { surface_load_ds_location(surface, context, location); -@@ -3998,21 +5117,63 @@ +@@ -4006,21 +5237,63 @@ && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) { /* Already up to date, nothing to do. */ @@ -8261,7 +8497,7 @@ } switch (location) -@@ -4021,6 +5182,7 @@ +@@ -4029,6 +5302,7 @@ case WINED3D_LOCATION_USER_MEMORY: case WINED3D_LOCATION_SYSMEM: case WINED3D_LOCATION_BUFFER: @@ -8269,7 +8505,7 @@ surface_load_sysmem(surface, context, location); break; -@@ -4038,6 +5200,24 @@ +@@ -4046,6 +5320,24 @@ if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) return; @@ -8294,7 +8530,7 @@ break; default: -@@ -4045,12 +5225,21 @@ +@@ -4053,12 +5345,21 @@ break; } @@ -8316,7 +8552,7 @@ } static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; } -@@ -4158,6 +5347,7 @@ +@@ -4166,6 +5467,7 @@ const RECT *dst_rect, const struct wined3d_color *color) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8324,7 +8560,7 @@ struct wined3d_rendertarget_view view, *view_ptr = &view; struct wined3d_fb_state fb = {&view_ptr, NULL, 1}; struct wined3d_texture *texture = dst_surface->container; -@@ -4178,6 +5368,21 @@ +@@ -4186,6 +5488,21 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); @@ -8346,7 +8582,7 @@ return WINED3D_OK; } -@@ -4186,6 +5391,7 @@ +@@ -4194,6 +5511,7 @@ const RECT *dst_rect, float depth) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8354,7 +8590,7 @@ struct wined3d_rendertarget_view view; struct wined3d_fb_state fb = {NULL, &view}; struct wined3d_texture *texture = dst_surface->container; -@@ -4201,6 +5407,20 @@ +@@ -4209,6 +5527,20 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); @@ -8375,7 +8611,7 @@ return WINED3D_OK; } -@@ -4213,6 +5433,7 @@ +@@ -4221,6 +5553,7 @@ /* Blit from offscreen surface to render target */ struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key; DWORD old_color_key_flags = src_surface->container->async.color_key_flags; @@ -8383,7 +8619,7 @@ struct wined3d_context *context; TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); -@@ -4230,6 +5451,22 @@ +@@ -4238,6 +5571,22 @@ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); @@ -8406,7 +8642,7 @@ } const struct blit_shader ffp_blit = { -@@ -4389,6 +5626,7 @@ +@@ -4397,6 +5746,7 @@ const struct wined3d_format *src_format, *dst_format; unsigned int src_fmt_flags, dst_fmt_flags; struct wined3d_texture *src_texture = NULL; @@ -8414,7 +8650,7 @@ void *src_data = NULL, *dst_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const BYTE *sbase = NULL; -@@ -4419,6 +5657,23 @@ +@@ -4427,6 +5777,23 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -8438,7 +8674,7 @@ src_format = dst_surface->resource.format; dst_format = src_format; dst_fmt_flags = dst_surface->container->resource.format_flags; -@@ -4430,12 +5685,14 @@ +@@ -4438,12 +5805,14 @@ dst_fmt_flags = dst_surface->container->resource.format_flags; if (src_surface) { @@ -8453,7 +8689,7 @@ if (dst_surface->resource.format->id != src_surface->resource.format->id) { if (!(src_texture = surface_convert_format(src_surface, dst_format->id))) -@@ -4446,9 +5703,13 @@ +@@ -4454,9 +5823,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -8467,7 +8703,7 @@ src_format = src_surface->resource.format; src_fmt_flags = src_surface->container->resource.format_flags; } -@@ -4458,8 +5719,12 @@ +@@ -4466,8 +5839,12 @@ src_fmt_flags = dst_fmt_flags; } @@ -8480,7 +8716,7 @@ } bpp = dst_surface->resource.format->byte_count; -@@ -4470,12 +5735,24 @@ +@@ -4478,12 +5855,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -8505,7 +8741,7 @@ if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4510,7 +5787,11 @@ +@@ -4518,7 +5907,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -8517,7 +8753,7 @@ src_format, flags, fx); goto release; } -@@ -4518,7 +5799,11 @@ +@@ -4526,7 +5919,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -8529,7 +8765,7 @@ flags &= ~WINEDDBLT_COLORFILL; } -@@ -4567,6 +5852,7 @@ +@@ -4575,6 +5972,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -8537,7 +8773,7 @@ sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4580,6 +5866,21 @@ +@@ -4588,6 +5986,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -8559,7 +8795,7 @@ memcpy(dbuf, sbuf, width); } } -@@ -4589,8 +5890,13 @@ +@@ -4597,8 +6010,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -8573,7 +8809,7 @@ } } } -@@ -4599,9 +5905,15 @@ +@@ -4607,9 +6025,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8589,7 +8825,7 @@ } } } -@@ -4611,6 +5923,7 @@ +@@ -4619,6 +6043,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8597,7 +8833,7 @@ sbuf = sbase + (sy >> 16) * src_row_pitch; if ((sy >> 16) == (last_sy >> 16)) -@@ -4618,6 +5931,15 @@ +@@ -4626,6 +6051,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -8613,7 +8849,7 @@ } else { -@@ -4664,6 +5986,7 @@ +@@ -4672,6 +6106,7 @@ } #undef STRETCH_ROW } @@ -8621,7 +8857,7 @@ dbuf += dst_row_pitch; last_sy = sy; } -@@ -4672,6 +5995,16 @@ +@@ -4680,6 +6115,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -8638,7 +8874,7 @@ DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff; DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff; if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE)) -@@ -4721,7 +6054,11 @@ +@@ -4729,7 +6174,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -8650,7 +8886,7 @@ dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4798,6 +6135,7 @@ +@@ -4806,6 +6255,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -8658,7 +8894,7 @@ #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4819,6 +6157,29 @@ +@@ -4827,6 +6277,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -8688,7 +8924,7 @@ switch (bpp) { -@@ -4837,7 +6198,11 @@ +@@ -4845,7 +6318,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8700,7 +8936,7 @@ dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4868,10 +6233,12 @@ +@@ -4876,10 +6353,12 @@ } } @@ -8713,7 +8949,7 @@ error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4879,6 +6246,7 @@ +@@ -4887,6 +6366,7 @@ } release: @@ -8721,7 +8957,7 @@ if (dst_data) { wined3d_resource_release_map_ptr(&dst_surface->resource, context); -@@ -4897,6 +6265,14 @@ +@@ -4905,6 +6385,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -8736,7 +8972,7 @@ return hr; } -@@ -4941,6 +6317,7 @@ +@@ -4949,6 +6437,7 @@ cpu_blit_blit_surface, }; @@ -8744,7 +8980,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) -@@ -4948,6 +6325,16 @@ +@@ -4956,6 +6445,16 @@ struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_device *device = dst_surface->resource.device; DWORD src_ds_flags, dst_ds_flags; @@ -8761,7 +8997,7 @@ BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -4958,6 +6345,106 @@ +@@ -4966,6 +6465,106 @@ | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -8868,7 +9104,7 @@ if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5000,8 +6487,13 @@ +@@ -5008,8 +6607,13 @@ } scale = src_surface @@ -8882,7 +9118,7 @@ convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; dst_ds_flags = dst_surface->container->resource.format_flags -@@ -5021,6 +6513,7 @@ +@@ -5029,6 +6633,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -8890,7 +9126,7 @@ return; if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) -@@ -5031,6 +6524,24 @@ +@@ -5039,6 +6644,24 @@ if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding, src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect))) return; @@ -8915,7 +9151,7 @@ } } else -@@ -5039,8 +6550,13 @@ +@@ -5047,8 +6670,13 @@ /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ @@ -8929,7 +9165,7 @@ { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5061,8 +6577,13 @@ +@@ -5069,8 +6697,13 @@ palette, fx->u5.dwFillColor, &color)) goto fallback; @@ -8943,7 +9179,7 @@ } else { -@@ -5080,8 +6601,13 @@ +@@ -5088,8 +6721,13 @@ color_key = &src_surface->container->async.src_blt_color_key; blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY; } @@ -8957,7 +9193,7 @@ { /* Upload */ if (scale) -@@ -5090,6 +6616,7 @@ +@@ -5098,6 +6736,7 @@ TRACE("Not doing upload because of format conversion.\n"); else { @@ -8965,7 +9201,7 @@ POINT dst_point = {dst_rect->left, dst_rect->top}; if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect))) -@@ -5102,6 +6629,15 @@ +@@ -5110,6 +6749,15 @@ context_release(context); } return; @@ -8981,7 +9217,7 @@ } } } -@@ -5125,6 +6661,7 @@ +@@ -5133,6 +6781,7 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -8989,7 +9225,7 @@ return; } -@@ -5320,6 +6857,49 @@ +@@ -5328,6 +6977,49 @@ wined3d_surface_location_invalidated, wined3d_surface_load_location, }; @@ -9039,11 +9275,13 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) -@@ -5387,7 +6967,11 @@ +@@ -5395,9 +7087,13 @@ } surface->container = container; +#if defined(STAGING_CSMT) + surface->resource.format_flags = container->resource.format_flags; + wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM); +#else /* STAGING_CSMT */ + surface_validate_location(surface, WINED3D_LOCATION_SYSMEM); @@ -9051,7 +9289,7 @@ list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5419,9 +7003,14 @@ +@@ -5429,9 +7125,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -9066,7 +9304,7 @@ } return hr; -@@ -5448,7 +7037,11 @@ +@@ -5458,7 +7159,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr); @@ -9614,7 +9852,7 @@ diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c -@@ -5395,9 +5395,15 @@ +@@ -5486,9 +5486,15 @@ DebugBreak(); } @@ -9707,14 +9945,14 @@ { if (d3d_flags & WINED3D_MAP_READONLY) return GL_READ_ONLY_ARB; -@@ -474,6 +492,7 @@ - - TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); +@@ -443,6 +461,7 @@ + else + resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB; } +#if defined(STAGING_CSMT) - void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) - { + void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, + UINT *slice_pitch) @@ -1021,3 +1040,4 @@ wined3d_resource_invalidate_location(resource, ~resource->map_binding); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-Geforce_425M/0001-wined3d-Add-detection-for-NVIDIA-GeForce-425M.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-Geforce_425M/0001-wined3d-Add-detection-for-NVIDIA-GeForce-425M.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-Geforce_425M/0001-wined3d-Add-detection-for-NVIDIA-GeForce-425M.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-Geforce_425M/0001-wined3d-Add-detection-for-NVIDIA-GeForce-425M.patch 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1,45 @@ +From 3e9c58f0bd7ae338375adc8b4a94c0d7cb0d8f8f Mon Sep 17 00:00:00 2001 +From: Jarkko Korpi +Date: Sun, 12 Jul 2015 17:41:59 +0300 +Subject: wined3d: Add detection for NVIDIA GeForce 425M. + +--- + dlls/wined3d/directx.c | 2 ++ + dlls/wined3d/wined3d_private.h | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c +index ce23c47..daefa0f 100644 +--- a/dlls/wined3d/directx.c ++++ b/dlls/wined3d/directx.c +@@ -1237,6 +1237,7 @@ static const struct gpu_description gpu_description_table[] = + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTS350M, "NVIDIA GeForce GTS 350M", DRIVER_NVIDIA_GEFORCE8, 1024}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_410M, "NVIDIA GeForce 410M", DRIVER_NVIDIA_GEFORCE8, 512}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT420, "NVIDIA GeForce GT 420", DRIVER_NVIDIA_GEFORCE8, 2048}, ++ {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT425M, "NVIDIA GeForce GT 425M", DRIVER_NVIDIA_GEFORCE8, 1024}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT430, "NVIDIA GeForce GT 430", DRIVER_NVIDIA_GEFORCE8, 1024}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT440, "NVIDIA GeForce GT 440", DRIVER_NVIDIA_GEFORCE8, 1024}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTS450, "NVIDIA GeForce GTS 450", DRIVER_NVIDIA_GEFORCE8, 1024}, +@@ -1745,6 +1746,7 @@ cards_nvidia_binary[] = + {"GTS 450", CARD_NVIDIA_GEFORCE_GTS450}, /* Geforce 400 - midend low */ + {"GT 440", CARD_NVIDIA_GEFORCE_GT440}, /* Geforce 400 - lowend */ + {"GT 430", CARD_NVIDIA_GEFORCE_GT430}, /* Geforce 400 - lowend */ ++ {"GT 425M", CARD_NVIDIA_GEFORCE_GT425M}, /* Geforce 400 - lowend mobile */ + {"GT 420", CARD_NVIDIA_GEFORCE_GT420}, /* Geforce 400 - lowend */ + {"410M", CARD_NVIDIA_GEFORCE_410M}, /* Geforce 400 - lowend mobile */ + {"GT 330", CARD_NVIDIA_GEFORCE_GT330}, /* Geforce 300 - highend */ +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index a1331d3..b1e6124 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -1564,6 +1564,7 @@ enum wined3d_pci_device + CARD_NVIDIA_GEFORCE_GTS350M = 0x0cb0, + CARD_NVIDIA_GEFORCE_410M = 0x1055, + CARD_NVIDIA_GEFORCE_GT420 = 0x0de2, ++ CARD_NVIDIA_GEFORCE_GT425M = 0x0df0, + CARD_NVIDIA_GEFORCE_GT430 = 0x0de1, + CARD_NVIDIA_GEFORCE_GT440 = 0x0de0, + CARD_NVIDIA_GEFORCE_GTS450 = 0x0dc4, +-- +2.4.5 + diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-Geforce_425M/definition wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-Geforce_425M/definition --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-Geforce_425M/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-Geforce_425M/definition 2015-07-29 19:51:42.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [35054] Add wined3d detection for GeForce GT 425M diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-MESA_GPU_Info/0001-wined3d-Use-pci-and-memory-information-from-MESA-if-.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-MESA_GPU_Info/0001-wined3d-Use-pci-and-memory-information-from-MESA-if-.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wined3d-MESA_GPU_Info/0001-wined3d-Use-pci-and-memory-information-from-MESA-if-.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wined3d-MESA_GPU_Info/0001-wined3d-Use-pci-and-memory-information-from-MESA-if-.patch 2015-07-29 19:51:42.000000000 +0000 @@ -1,17 +1,17 @@ -From 32306d330e7da6eb0bf3d20d5f755bfffa8d4109 Mon Sep 17 00:00:00 2001 +From 8ab65c299cd2bed6e81c6fafaf90c10f5c091643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 11 Jul 2015 04:06:27 +0200 -Subject: wined3d: Use pci and memory information from MESA if possible. +Subject: wined3d: Use pci and memory information from MESA if possible. (v2) --- - dlls/wined3d/directx.c | 25 +++++++++++++++++++++ + dlls/wined3d/directx.c | 25 ++++++++++++++++++ dlls/wined3d/wined3d_gl.h | 1 + - dlls/winex11.drv/opengl.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++ + dlls/winex11.drv/opengl.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++ include/wine/wgl_driver.h | 2 ++ - 4 files changed, 85 insertions(+) + 4 files changed, 93 insertions(+) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c -index 9ee4a0e..48cc92b 100644 +index 97c7f36..33ad78e 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -231,6 +231,7 @@ static const struct wined3d_extension_map wgl_extension_map[] = @@ -76,7 +76,7 @@ WINED3D_GL_BLEND_EQUATION, WINED3D_GL_NORMALIZED_TEXRECT, diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c -index 7b8ba82..42816a2 100644 +index 7b8ba82..e9009d4 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -175,6 +175,18 @@ typedef XID GLXPbuffer; @@ -114,7 +114,7 @@ #undef LOAD_FUNCPTR if(!X11DRV_WineGL_InitOpenglInfo()) goto failed; -@@ -3061,6 +3075,42 @@ static BOOL X11DRV_wglSwapIntervalEXT(int interval) +@@ -3061,6 +3075,50 @@ static BOOL X11DRV_wglSwapIntervalEXT(int interval) } /** @@ -150,14 +150,22 @@ + if (!pglXQueryCurrentRendererIntegerMESA || !memory) + return FALSE; + -+ return pglXQueryCurrentRendererIntegerMESA(GLX_RENDERER_VIDEO_MEMORY_MESA, memory); ++ if (!pglXQueryCurrentRendererIntegerMESA(GLX_RENDERER_VIDEO_MEMORY_MESA, memory)) ++ return FALSE; ++ ++ /* Some MESA drivers return a video memory of 0 MB. This doesn't make any sense, ++ * so fall back to other methods. */ ++ if (!*memory) ++ return FALSE; ++ ++ return TRUE; +} + +/** * X11DRV_wglSetPixelFormatWINE * * WGL_WINE_pixel_format_passthrough: wglSetPixelFormatWINE -@@ -3211,6 +3261,13 @@ static void X11DRV_WineGL_LoadExtensions(void) +@@ -3211,6 +3269,13 @@ static void X11DRV_WineGL_LoadExtensions(void) /* WINE-specific WGL Extensions */ diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/wine.inf-Performance/0001-wine.inf-Add-registry-keys-for-Windows-Performance-L.patch wine-staging-1.7.48~ubuntu12.04.1/patches/wine.inf-Performance/0001-wine.inf-Add-registry-keys-for-Windows-Performance-L.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/wine.inf-Performance/0001-wine.inf-Add-registry-keys-for-Windows-Performance-L.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/wine.inf-Performance/0001-wine.inf-Add-registry-keys-for-Windows-Performance-L.patch 2015-07-29 19:51:42.000000000 +0000 @@ -1,4 +1,4 @@ -From 94f11de5d7ea9594acdfb3d778d7abca7d2c3017 Mon Sep 17 00:00:00 2001 +From cb92c3e3611dd8d8d97992b79e1c9fc449ff2569 Mon Sep 17 00:00:00 2001 From: Daniel Jelinski Date: Sun, 8 Feb 2015 06:32:34 +0100 Subject: wine.inf: Add registry keys for Windows Performance Library. @@ -8,12 +8,12 @@ 1 file changed, 4 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in -index a4548f2..d0548cb 100644 +index 315ef29..2de7e61 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in -@@ -484,6 +484,10 @@ HKLM,%CurrentVersionNT%\Image File Execution Options,,16 - HKLM,%CurrentVersionNT%\Language Pack,,16 +@@ -492,6 +492,10 @@ HKLM,%CurrentVersionNT%\Language Pack,,16 HKLM,%CurrentVersionNT%\NetworkCards,,16 + HKLM,%CurrentVersionNT%\OpenGLDrivers,,16 HKLM,%CurrentVersionNT%\Perflib,,16 +HKLM,%CurrentVersionNT%\Perflib,Last Counter,0x10003,1846 +HKLM,%CurrentVersionNT%\Perflib,Last Help,0x10003,1847 @@ -23,5 +23,5 @@ HKLM,%CurrentVersionNT%\Print,,16 HKLM,%CurrentVersionNT%\ProfileList,,16 -- -2.2.2 +2.4.5 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/patches/winsta-WinStationEnumerateW/0001-winsta-Add-stub-for-WinStationEnumerateW.patch wine-staging-1.7.48~ubuntu12.04.1/patches/winsta-WinStationEnumerateW/0001-winsta-Add-stub-for-WinStationEnumerateW.patch --- wine-staging-1.7.47~ubuntu12.04.1/patches/winsta-WinStationEnumerateW/0001-winsta-Add-stub-for-WinStationEnumerateW.patch 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/patches/winsta-WinStationEnumerateW/0001-winsta-Add-stub-for-WinStationEnumerateW.patch 2015-07-29 19:51:42.000000000 +0000 @@ -1,7 +1,7 @@ -From 2efe4f101c0dc1b87b176d6652576f8e1880a72a Mon Sep 17 00:00:00 2001 +From 7b26357b2125f80df05269f2bb38592dd2e8be6f Mon Sep 17 00:00:00 2001 From: Austin English Date: Thu, 7 May 2015 06:15:58 +0200 -Subject: winsta: Add stub for WinStationEnumerateW. +Subject: winsta: Add stub for WinStationEnumerateW. (v2) --- dlls/winsta/main.c | 7 +++++++ @@ -9,22 +9,22 @@ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/winsta/main.c b/dlls/winsta/main.c -index 46a4ce7..82e5d36 100644 +index a95782f..59efef2 100644 --- a/dlls/winsta/main.c +++ b/dlls/winsta/main.c -@@ -90,3 +90,10 @@ BOOL WINAPI WinStationVirtualOpen( PVOID a, PVOID b, PVOID c ) +@@ -91,3 +91,10 @@ BOOL WINAPI WinStationVirtualOpen( PVOID a, PVOID b, PVOID c ) SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); return FALSE; } + -+BOOLEAN WINAPI WinStationEnumerateW( HANDLE server, void *sessionids, PULONG count ) ++BOOLEAN WINAPI WinStationEnumerateW( HANDLE server, PSESSIONIDW *sessionids, ULONG *count ) +{ + FIXME( "%p %p %p\n", server, sessionids, count ); + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} diff --git a/dlls/winsta/winsta.spec b/dlls/winsta/winsta.spec -index 5854d83..6c4affc 100644 +index 30aa6b5..a9def1a 100644 --- a/dlls/winsta/winsta.spec +++ b/dlls/winsta/winsta.spec @@ -29,7 +29,7 @@ @@ -37,5 +37,5 @@ @ stub WinStationEnumerate_IndexedW @ stub WinStationFreeGAPMemory -- -2.3.7 +2.4.5 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/ar.po wine-staging-1.7.48~ubuntu12.04.1/po/ar.po --- wine-staging-1.7.47~ubuntu12.04.1/po/ar.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/ar.po 2015-07-29 19:28:54.000000000 +0000 @@ -65,7 +65,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -146,7 +146,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -522,7 +522,7 @@ msgid "&Source" msgstr "الم&صدر" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "الخط" @@ -8541,7 +8541,7 @@ msgid "&Move" msgstr "ت&حريك" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "تح&جيم" @@ -13695,98 +13695,108 @@ msgstr "&كبير" #: wineconsole.rc:68 -msgid "Control" -msgstr "تحكم" +msgid "Command history" +msgstr "تأريخ الأوامر" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "ركن التدفق" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "حذف التك&رار" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "القائمة المنبثقة" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "ت&حكم" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "&عالي" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "التحرير السّريع" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "م&فعل" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "تأريخ الأوامر" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "عد&د الاوامر المعاد طلبها:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "أغلق الطرف&ية" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "حذف التك&رار" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "التحرير السّريع" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "وضع الخبراء" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "ال&خط" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "ال&لون" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "الت&هيئة" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "ركن التدفق" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "العر&ض:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "ال&طول:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "حجم النافذة" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "ال&عرض:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "الط&ول:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "نهائة البرنامج" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "أغلق الطرف&ية" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "الإصدارة" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "معاملات الطرفية" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "الاحتفاظ بهذه الإعدادات للجلسات اللاحقة" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "التعديل فقط لهذه الجلسة" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/bg.po wine-staging-1.7.48~ubuntu12.04.1/po/bg.po --- wine-staging-1.7.47~ubuntu12.04.1/po/bg.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/bg.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -154,7 +154,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -534,7 +534,7 @@ msgid "&Source" msgstr "&Източник" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Шрифт" @@ -8662,7 +8662,7 @@ msgid "&Move" msgstr "&Премести" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Размер" @@ -13355,108 +13355,108 @@ msgstr "" #: wineconsole.rc:68 -msgid "Control" +msgid "Command history" msgstr "" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "" + +#: wineconsole.rc:72 +#, fuzzy +msgid "&Remove duplicates" +msgstr "&Анотирай..." + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "" - -#: wineconsole.rc:73 +#: wineconsole.rc:78 #, fuzzy -msgid "&enable" -msgstr "&Таблица" +msgid "Console" +msgstr "Отвори в &нов прозорец" -#: wineconsole.rc:75 -msgid "Command history" +#: wineconsole.rc:79 +msgid "&Quick Edit mode" msgstr "" -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" +#: wineconsole.rc:80 +msgid "&Insert mode" msgstr "" -#: wineconsole.rc:79 -#, fuzzy -msgid "&Remove doubles" -msgstr "&Анотирай..." - -#: wineconsole.rc:87 +#: wineconsole.rc:88 #, fuzzy msgid "&Font" msgstr "Шрифтове" -#: wineconsole.rc:89 +#: wineconsole.rc:90 #, fuzzy msgid "&Color" msgstr "&Колона" -#: wineconsole.rc:100 +#: wineconsole.rc:101 #, fuzzy msgid "Configuration" msgstr "Информация" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 #, fuzzy msgid "&Height:" msgstr "Дя&сна:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 #, fuzzy msgid "H&eight:" msgstr "Дя&сна:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 #, fuzzy msgid "&Close console" msgstr "Отвори в &нов прозорец" -#: wineconsole.rc:122 +#: wineconsole.rc:123 #, fuzzy msgid "Edition" msgstr "&Редактиране" -#: wineconsole.rc:128 +#: wineconsole.rc:129 #, fuzzy msgid "Console parameters" msgstr "Невалидни знаци в пътя" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/ca.po wine-staging-1.7.48~ubuntu12.04.1/po/ca.po --- wine-staging-1.7.47~ubuntu12.04.1/po/ca.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/ca.po 2015-07-29 19:28:54.000000000 +0000 @@ -69,7 +69,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -153,7 +153,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -532,7 +532,7 @@ msgid "&Source" msgstr "&Font" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Tipus de lletra" @@ -8545,7 +8545,7 @@ msgid "&Move" msgstr "&Desplaça" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Dimensiona" @@ -13624,98 +13624,108 @@ msgstr "&Gran" #: wineconsole.rc:68 -msgid "Control" -msgstr "Control" +msgid "Command history" +msgstr "Historial d'ordres" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Zona de memòria intermèdia" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "&Elimina dobles" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Menú emergent" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Control" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "&Maj" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Edició ràpida" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&habilita" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Historial d'ordres" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Nombre d'ordres cancel·lats:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Tanca la consola" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Elimina dobles" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Edició ràpida" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "Mode &expert" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&Tipus de lletra" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Color" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Configuració" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Zona de memòria intermèdia" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "A&mplada:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "A&lçada:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Mida de finestra" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "Am&plada:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "Al&çada:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Fi de programa" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Tanca la consola" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "&Edició" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Paràmetres de consola" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Conserva aquesta configuració per a sessions futures" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Modifica només la sessió actual" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/cs.po wine-staging-1.7.48~ubuntu12.04.1/po/cs.po --- wine-staging-1.7.47~ubuntu12.04.1/po/cs.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/cs.po 2015-07-29 19:28:54.000000000 +0000 @@ -68,7 +68,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -151,7 +151,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -529,7 +529,7 @@ msgid "&Source" msgstr "&Zdroj" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Písmo" @@ -8480,7 +8480,7 @@ msgid "&Move" msgstr "Pře&sunout" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Velikost" @@ -13393,98 +13393,108 @@ msgstr "Ve&lký" #: wineconsole.rc:68 -msgid "Control" -msgstr "Řízení" +msgid "Command history" +msgstr "Historie příkazů" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Oblast zásobníku" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "Odst&ranit duplicity" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Vyskakovací nabídka" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Ctrl" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Quick edit mód" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "P&ovolit" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Historie příkazů" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Počet znovu vyvolaných příkazů:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "Uzavřít &konzoli" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "Odst&ranit duplicity" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Quick edit mód" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "Pokročilý režim" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&Písmo" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Barva" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Nastavení" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Oblast zásobníku" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "Šířka :" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Výška:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Velikost okna" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "Šíř&ka:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "Výšk&a:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Konec programu" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "Uzavřít &konzoli" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Edice" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Parametry konzole" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Zachovat tyto změny pro další sezení" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Upravit pouze současné sezení" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/da.po wine-staging-1.7.48~ubuntu12.04.1/po/da.po --- wine-staging-1.7.47~ubuntu12.04.1/po/da.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/da.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -149,7 +149,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -537,7 +537,7 @@ msgid "&Source" msgstr "&Kilde" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Skrifttyper" @@ -8637,7 +8637,7 @@ msgid "&Move" msgstr "&Flyt" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Størrelse" @@ -13662,98 +13662,108 @@ msgstr "S&tore" #: wineconsole.rc:68 -msgid "Control" -msgstr "Kontrol" +msgid "Command history" +msgstr "Kommando historik" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Buffer zone" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "&Fjern dubletter" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Popup menu" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "Kontrol" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&kift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Hurtig rediger" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&Aktiver" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Kommando historik" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "A&ntal af genkaldte kommandoer:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Luk konsol" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Fjern dubletter" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Hurtig rediger" -#: wineconsole.rc:87 +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "&Ekspert mode" + +#: wineconsole.rc:88 msgid "&Font" msgstr "&Skrifttype" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Farve" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Konfiguration" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Buffer zone" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Bredde:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Højde:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Vindue størrelse" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "B&redde:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "H&øjde:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Afslutning af program" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Luk konsol" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Version" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Konsol parametre" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Bevar disse indstillinger til senere sessioner" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Rediger kun nuværende session" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/de.po wine-staging-1.7.48~ubuntu12.04.1/po/de.po --- wine-staging-1.7.47~ubuntu12.04.1/po/de.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/de.po 2015-07-29 19:28:54.000000000 +0000 @@ -5,7 +5,7 @@ "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To: http://bugs.winehq.org\n" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2015-05-24 19:47+0200\n" +"PO-Revision-Date: 2015-07-19 02:02+0200\n" "Last-Translator: Julian Rüger\n" "Language-Team: German\n" "Language: de\n" @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -152,7 +152,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -529,7 +529,7 @@ msgid "&Source" msgstr "P&apierquelle" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Schriftart" @@ -8524,7 +8524,7 @@ msgid "&Move" msgstr "&Verschieben" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Größe" @@ -9618,7 +9618,7 @@ msgstr "" "CALL wird in einer Batchdatei genutzt, um Befehle aus\n" "einer anderen Batchdatei auszuführen. Wenn die Batchdatei endet, kehrt die\n" -"Kontrolle zu der Datei zurück, die sie aufgerufen hat. Der CALL Befehl kann\n" +"Kontrolle zu der Datei zurück, die sie aufgerufen hat. Der CALL-Befehl kann\n" "Parameter an die aufgerufene Prozedur übergeben.\n" "\n" "Änderungen am aktuellen Verzeichnis, Umgebungsvariablen usw. innerhalb\n" @@ -9678,8 +9678,8 @@ "auf dem Terminalgerät angezeigt und danach ausgeführt werden.\n" "\n" "ECHO OFF kehrt den Effekt des vorherigen ECHO ON (ECHO ist standardmäßig\n" -"auf OFF) um. Um den ECHO OFF Befehl nicht anzeigen zu lassen, kann vor\n" -"diesen ein @ Zeichen gesetzt werden.\n" +"auf OFF) um. Um 'ECHO OFF' selbst nicht anzeigen zu lassen, kann dem Befehl\n" +"ein @-Zeichen vorangestellt werden.\n" #: cmd.rc:78 msgid "ERASE deletes a file or set of files.\n" @@ -9714,7 +9714,7 @@ "\n" "GOTO has no effect when used interactively.\n" msgstr "" -"Der GOTO Befehl transferiert die Ausführung zu einer anderen Stelle in\n" +"Der GOTO-Befehl transferiert die Ausführung zu einer anderen Stelle in\n" "einer Batchdatei.\n" "\n" "Das Label, das Ziel eines GOTOs ist, kann bis zu 255 Zeichen lang sein,\n" @@ -9768,7 +9768,7 @@ "Syntax: LABEL [Laufwerk:]\n" "Der Befehl wartet auf die Eingabe einer neuen Bezeichnung für das\n" "angegebene Laufwerk. Sie können sich auch die Laufwerksbezeichnung mit dem\n" -"VOL Befehl anzeigen lassen.\n" +"VOL-Befehl anzeigen lassen.\n" #: cmd.rc:121 msgid "MD is the short version of MKDIR. It creates a subdirectory.\n" @@ -9790,11 +9790,11 @@ "MOVE verschiebt eine Datei oder ein Verzeichnis zu einem neuen Punkt im\n" "Dateisystem.\n" "\n" -"Ist das zu verschiebende Objekt ein Verzeichnis, dann werden alle Dateien\n" -"und Unterverzeichnisse unterhalb des Objektes genauso verschoben.\n" +"Ist das zu verschiebende Objekt ein Verzeichnis, werden alle Dateien und\n" +"Unterverzeichnisse unterhalb des Objektes ebenfalls verschoben.\n" "\n" -"MOVE schlägt fehl, wenn die alte und die neue Position auf verschiedenen\n" -"DOS Laufwerken sind.\n" +"MOVE schlägt fehl, wenn sich alte und neue Position auf verschiedenen\n" +"DOS-Laufwerken befinden.\n" #: cmd.rc:142 msgid "" @@ -9808,13 +9808,13 @@ "variable, for example:\n" "PATH %PATH%;c:\\temp\n" msgstr "" -"PATH ändert oder zeigt den CMD Suchpfad an.\n" +"PATH ändert oder zeigt den CMD-Suchpfad an.\n" "\n" -"Nach der Eingabe von PATH wird die aktuelle PATH-Einstellung angezeigt\n" -"(ursprünglich aus der Registry). Um die Einstellung zu ändern, muss nach\n" -"dem PATH Befehl der neue Wert angegeben werden.\n" +"Durch Eingabe von PATH wird die aktuelle PATH-Einstellung angezeigt (der\n" +"Initialwert wird aus der Registrierung ausgelesen). Um diese Einstellung zu\n" +"ändern, kann dem PATH-Befehl der neue Wert als Argument übergegeben werden.\n" "\n" -"Es ist auch möglich, den PATH mit Hilfe der PATH Umgebungsvariable zu\n" +"Es ist möglich, den Suchpfad mit Hilfe der PATH-Umgebungsvariable zu\n" "modifizieren. Zum Beispiel:\n" "PATH %PATH%;c:\\temp\n" @@ -9856,42 +9856,42 @@ msgstr "" "PROMPT setzt den Befehlszeilenprompt.\n" "\n" -"Die Zeichenkette, die dem PROMPT Befehl folgt (und dem Leerzeichen\n" +"Die Zeichenkette, die dem PROMPT-Befehl folgt (und dem Leerzeichen\n" "unmittelbar danach), erscheint am Zeilenanfang, wenn cmd auf Eingabe\n" "wartet.\n" "\n" "Die folgenden Zeichen haben eine besondere Bedeutung:\n" "\n" -"$$ Dollarzeichen $_ Zeilenvorschub $b Pipe Zeichen (|)\n" +"$$ Dollarzeichen $_ Zeilenvorschub $b Pipe-Zeichen (|)\n" "$d aktuelles Datum $e Escape $g > Zeichen\n" "$l < Zeichen $n aktuelles Laufwerk $p aktueller Pfad\n" -"$q Gleichheitszeichen $t aktuelle Zeit $v cmd Version\n" +"$q Gleichheitszeichen $t aktuelle Zeit $v cmd-Version\n" "\n" -"Hinweis: Die Eingabe des PROMPT Befehls ohne eine Prompt-Zeichenkette,\n" -"setzt den Prompt auf den Standardwert zurück, dieser entspricht dem\n" -"aktuellen Verzeichnis (inklusive dem aktuellen Laufwerksbuchstaben),\n" -"gefolgt von einem Größerzeichen (>) (genau wie der PROMPT $p$g Befehl).\n" -"\n" -"Der Prompt kann auch durch Änderung der PROMPT Umgebungsvariable angepasst\n" -"werden, folglich hat der Befehl 'SET PROMPT=Text' die gleiche Auswirkung\n" -"wie 'PROMPT Text'.\n" +"Hinweis: Eingabe des PROMPT-Befehls ohne Argumente setzt den Prompt auf\n" +"seinen Standardwert zurück, dieser entspricht dem aktuellen Verzeichnis\n" +"(einschließlich des Laufwerksbuchstabens), gefolgt von einem Größerzeichen\n" +"(>) (äquivalent zum Befehl 'PROMPT $p$g').\n" +"\n" +"Der Prompt kann auch durch Änderung der PROMPT-Umgebungsvariable angepasst\n" +"werden, folglich hat der Befehl 'SET PROMPT=Text' die selbe Auswirkung wie\n" +"'PROMPT Text'.\n" #: cmd.rc:173 msgid "" "A command line beginning with REM (followed by a space) performs no action,\n" "and can therefore be used as a comment in a batch file.\n" msgstr "" -"Beginnt eine Befehlszeile mit REM (gefolgt von einem Leerzeichen) wird\n" +"Beginnt eine Befehlszeile mit REM (gefolgt von einem Leerzeichen), wird\n" "keine Aktion ausgeführt, sie kann daher auch als Kommentar in einer\n" "Batchdatei genutzt werden.\n" #: cmd.rc:176 msgid "REN is the short version of RENAME. It renames a file.\n" -msgstr "REN ist die Kurzform von RENAME.\n" +msgstr "REN ist die Kurzform von RENAME. Benennt eine Datei um.\n" #: cmd.rc:178 msgid "RENAME renames a file.\n" -msgstr "RENAME benennt die angegebenen Dateien um.\n" +msgstr "RENAME benennt die angegebene Datei um.\n" #: cmd.rc:181 msgid "RD is the short version of RMDIR. It deletes a directory.\n" @@ -9919,22 +9919,22 @@ "values than in a native Win32 implementation. Note that it is not possible\n" "to affect the operating system environment from within cmd.\n" msgstr "" -"SET ändert oder zeigt die CMD Umgebungsvariablen an.\n" +"SET ändert oder zeigt die CMD-Umgebungsvariablen an.\n" "\n" "SET ohne Parameter zeigt alle aktuellen Umgebungsvariablen an.\n" "\n" -"Um eine Umgebungsvariable zu erstellen oder zu ändern, ist die Syntax:\n" +"Die Syntax, um eine Umgebungsvariable anzulegen oder zu ändern, lautet:\n" "\n" "SET =\n" "\n" "Wobei und Zeichenketten sind. Es dürfen weder Leerzeichen\n" -"vor dem Gleichheitszeichen sein, noch darf der Variablenname Leerzeichen\n" +"vor dem Gleichheitszeichen stehen, noch darf der Variablenname Leerzeichen\n" "enthalten.\n" "\n" "In Wine werden die Umgebungsvariablen des darunterliegenden Betriebssystems\n" -"mit in die Win32 Umgebung eingebunden, deshalb gibt es gewöhnlich mehr\n" -"Werte als es sie in einer ursprünglichen Win32 Realisierung gäbe.\n" -"Anmerkung: Es ist nicht möglich die Umgebungsvariablen des Betriebssystems\n" +"in die Win32-Umgebung eingebunden, daher gibt es für gewöhnlich deutlich\n" +"mehr Werte als in einer nativen Win32-Implementierung.\n" +"Anmerkung: Es ist nicht möglich, die Umgebungsvariablen des Betriebssystems\n" "vom CMD aus zu beeinflussen.\n" #: cmd.rc:234 @@ -9944,9 +9944,9 @@ "called from the command line.\n" msgstr "" "SHIFT wird in einer Batchdatei genutzt, um einen Parameter vom Anfang der\n" -"Liste zu entfernen, so das der Parameter 2 zu Parameter 1 wird und so\n" -"weiter. Es hat keine Auswirkungen, wenn es von der Befehlszeile aus\n" -"aufgerufen wird.\n" +"Liste zu entfernen, so dass Parameter 2 zu Parameter 1 wird und so weiter.\n" +"SHIFT hat keine Auswirkungen, wenn es von der Befehlszeile aus aufgerufen\n" +"wird.\n" #: cmd.rc:212 start.rc:56 msgid "" @@ -13586,98 +13586,98 @@ msgstr "&Groß" #: wineconsole.rc:68 -msgid "Control" -msgstr "Steuerung" +msgid "Command history" +msgstr "Befehlsverlauf" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "&Puffergröße:" + +#: wineconsole.rc:72 +msgid "&Remove duplicates" +msgstr "&Duplikate entfernen" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Popup-Menü" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Strg" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "&Umschalt" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "QuickEdit" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&aktiv" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Befehlsverlauf" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "Anzahl der gespeicherten &Befehle:" +#: wineconsole.rc:78 +msgid "Console" +msgstr "Konsole" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Duplikate entfernen" +msgid "&Quick Edit mode" +msgstr "&QuickEdit-Modus" -#: wineconsole.rc:87 +#: wineconsole.rc:80 +msgid "&Insert mode" +msgstr "&Einfügen-Modus" + +#: wineconsole.rc:88 msgid "&Font" msgstr "&Schriftart" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Farbe" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Konfiguration" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Zeichenpuffer" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Breite:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Höhe:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Fenstergröße" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "B&reite:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "Höh&e:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Programmende" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "Konsole &schließen" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Edition" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Konsolenparameter" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Einstellungen für spätere Sitzungen übernehmen" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Nur für aktuelle Sitzung ändern" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/el.po wine-staging-1.7.48~ubuntu12.04.1/po/el.po --- wine-staging-1.7.47~ubuntu12.04.1/po/el.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/el.po 2015-07-29 19:28:54.000000000 +0000 @@ -63,7 +63,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -143,7 +143,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -513,7 +513,7 @@ msgid "&Source" msgstr "&Πηγή" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Γραμματοσειρά" @@ -8499,7 +8499,7 @@ msgid "&Move" msgstr "" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "" @@ -13102,106 +13102,106 @@ msgstr "" #: wineconsole.rc:68 -#, fuzzy -msgid "Control" -msgstr "&Περιεχόμενα" +msgid "Command history" +msgstr "" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "" + +#: wineconsole.rc:72 +#, fuzzy +msgid "&Remove duplicates" +msgstr "Επιλογές" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "" -#: wineconsole.rc:70 +#: wineconsole.rc:75 #, fuzzy msgid "&Control" msgstr "&Περιεχόμενα" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "" - -#: wineconsole.rc:73 -msgid "&enable" +#: wineconsole.rc:78 +msgid "Console" msgstr "" -#: wineconsole.rc:75 -msgid "Command history" -msgstr "" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" +#: wineconsole.rc:79 +msgid "&Quick Edit mode" msgstr "" -#: wineconsole.rc:79 -msgid "&Remove doubles" +#: wineconsole.rc:80 +msgid "&Insert mode" msgstr "" -#: wineconsole.rc:87 +#: wineconsole.rc:88 #, fuzzy msgid "&Font" msgstr "Γραμματοσειρές" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "" -#: wineconsole.rc:100 +#: wineconsole.rc:101 #, fuzzy msgid "Configuration" msgstr "Επιλογές" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 #, fuzzy msgid "&Height:" msgstr "&Δεξιά:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 #, fuzzy msgid "H&eight:" msgstr "&Δεξιά:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "" -#: wineconsole.rc:122 +#: wineconsole.rc:123 #, fuzzy msgid "Edition" msgstr "Επιλογές" -#: wineconsole.rc:128 +#: wineconsole.rc:129 #, fuzzy msgid "Console parameters" msgstr "Μη έγγυρος(οι) χαρακτήρας(ες) στο μονοπάτι" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/en.po wine-staging-1.7.48~ubuntu12.04.1/po/en.po --- wine-staging-1.7.47~ubuntu12.04.1/po/en.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/en.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -150,7 +150,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -528,7 +528,7 @@ msgid "&Source" msgstr "&Source" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Font" @@ -8505,7 +8505,7 @@ msgid "&Move" msgstr "&Move" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Size" @@ -13492,98 +13492,98 @@ msgstr "&Large" #: wineconsole.rc:68 -msgid "Control" -msgstr "Control" +msgid "Command history" +msgstr "Command history" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "&Buffer size:" + +#: wineconsole.rc:72 +msgid "&Remove duplicates" +msgstr "&Remove duplicates" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Popup menu" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Control" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Quick edit" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&enable" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Command history" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Number of recalled commands:" +#: wineconsole.rc:78 +msgid "Console" +msgstr "Console" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Remove doubles" +msgid "&Quick Edit mode" +msgstr "&Quick Edit mode" -#: wineconsole.rc:87 +#: wineconsole.rc:80 +msgid "&Insert mode" +msgstr "&Insert mode" + +#: wineconsole.rc:88 msgid "&Font" msgstr "&Font" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Colour" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Configuration" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Buffer zone" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Width:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Height:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Window size" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "W&idth:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "H&eight:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "End of program" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Close console" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Edition" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Console parameters" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Retain these settings for later sessions" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Modify only current session" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/en_US.po wine-staging-1.7.48~ubuntu12.04.1/po/en_US.po --- wine-staging-1.7.47~ubuntu12.04.1/po/en_US.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/en_US.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -150,7 +150,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -528,7 +528,7 @@ msgid "&Source" msgstr "&Source" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Font" @@ -8505,7 +8505,7 @@ msgid "&Move" msgstr "&Move" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Size" @@ -13492,98 +13492,98 @@ msgstr "&Large" #: wineconsole.rc:68 -msgid "Control" -msgstr "Control" +msgid "Command history" +msgstr "Command history" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "&Buffer size:" + +#: wineconsole.rc:72 +msgid "&Remove duplicates" +msgstr "&Remove duplicates" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Popup menu" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Control" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Quick edit" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&enable" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Command history" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Number of recalled commands:" +#: wineconsole.rc:78 +msgid "Console" +msgstr "Console" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Remove doubles" +msgid "&Quick Edit mode" +msgstr "&Quick Edit mode" -#: wineconsole.rc:87 +#: wineconsole.rc:80 +msgid "&Insert mode" +msgstr "&Insert mode" + +#: wineconsole.rc:88 msgid "&Font" msgstr "&Font" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Color" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Configuration" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Buffer zone" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Width:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Height:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Window size" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "W&idth:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "H&eight:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "End of program" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Close console" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Edition" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Console parameters" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Retain these settings for later sessions" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Modify only current session" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/eo.po wine-staging-1.7.48~ubuntu12.04.1/po/eo.po --- wine-staging-1.7.47~ubuntu12.04.1/po/eo.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/eo.po 2015-07-29 19:28:54.000000000 +0000 @@ -72,7 +72,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -148,7 +148,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -519,7 +519,7 @@ msgid "&Source" msgstr "&Fonto" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Tiparo" @@ -8401,7 +8401,7 @@ msgid "&Move" msgstr "&Movi" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Grando" @@ -12984,98 +12984,108 @@ msgstr "&Larĝa" #: wineconsole.rc:68 -msgid "Control" -msgstr "Regado" +msgid "Command history" +msgstr "Kronologio" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Bufro" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "&Forigi duoblaĵojn" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Ŝprucmenuo" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Stirklavo" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "&Registrumo" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Rapida Redaktado" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&aktivigi" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Kronologio" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Nombro da revokitaj komandoj:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Fermi terminalon" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Forigi duoblaĵojn" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Rapida Redaktado" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Insert" +msgid "&Insert mode" +msgstr "&Enmeti" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&Tiparo" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Koloro" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Agordo" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Bufro" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Larĝo:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Alto:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Fenestro" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "La&rĝo:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "Al&to:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Programfino" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Fermi terminalon" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Redaktado" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Terminala parametoj" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Konserrvi ĉi tiujn agordadojn" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Modifi nur nunan sesion" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/es.po wine-staging-1.7.48~ubuntu12.04.1/po/es.po --- wine-staging-1.7.47~ubuntu12.04.1/po/es.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/es.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -151,7 +151,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -540,7 +540,7 @@ msgid "&Source" msgstr "O&rigen" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Fuente" @@ -8651,7 +8651,7 @@ msgid "&Move" msgstr "&Mover" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Tamaño" @@ -13753,98 +13753,108 @@ msgstr "&Grande" #: wineconsole.rc:68 -msgid "Control" -msgstr "Control" +msgid "Command history" +msgstr "Historial de comandos" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Zona de búfer" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "&Eliminar duplicados" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Menú emergente" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Control" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Edición rápida" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&habilitar" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Historial de comandos" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Número de comandos recordados:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Cerrar consola" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Eliminar duplicados" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Edición rápida" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "Modo &Experto" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&Fuente" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Color" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Configuración" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Zona de búfer" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Anchura:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Altura:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Tamaño de ventana" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "A&nchura:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "A<ura:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Fin del programa" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Cerrar consola" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Edición" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Parámetros de consola" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Guardar esta configuración para sesiones posteriores" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Modificar sólo la sesión actual" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/fa.po wine-staging-1.7.48~ubuntu12.04.1/po/fa.po --- wine-staging-1.7.47~ubuntu12.04.1/po/fa.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/fa.po 2015-07-29 19:28:54.000000000 +0000 @@ -64,7 +64,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -143,7 +143,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -527,7 +527,7 @@ msgid "&Source" msgstr "" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 #, fuzzy msgid "Font" msgstr "&قلم‌ها..." @@ -8493,7 +8493,7 @@ msgid "&Move" msgstr "" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "" @@ -13113,105 +13113,104 @@ msgstr "" #: wineconsole.rc:68 -#, fuzzy -msgid "Control" -msgstr "&محتویات" +msgid "Command history" +msgstr "" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "" + +#: wineconsole.rc:72 +msgid "&Remove duplicates" +msgstr "" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "" -#: wineconsole.rc:70 +#: wineconsole.rc:75 #, fuzzy msgid "&Control" msgstr "&محتویات" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "" -#: wineconsole.rc:72 -msgid "Quick edit" +#: wineconsole.rc:78 +msgid "Console" msgstr "" -#: wineconsole.rc:73 -msgid "&enable" -msgstr "" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" +#: wineconsole.rc:79 +msgid "&Quick Edit mode" msgstr "" -#: wineconsole.rc:79 -msgid "&Remove doubles" +#: wineconsole.rc:80 +msgid "&Insert mode" msgstr "" -#: wineconsole.rc:87 +#: wineconsole.rc:88 #, fuzzy msgid "&Font" msgstr "&قلم‌ها..." -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "" -#: wineconsole.rc:100 +#: wineconsole.rc:101 #, fuzzy msgid "Configuration" msgstr "اطلاعات" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 #, fuzzy msgid "&Height:" msgstr "&راست:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 #, fuzzy msgid "H&eight:" msgstr "&راست:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "" -#: wineconsole.rc:122 +#: wineconsole.rc:123 #, fuzzy msgid "Edition" msgstr "&ویرایش" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/fi.po wine-staging-1.7.48~ubuntu12.04.1/po/fi.po --- wine-staging-1.7.47~ubuntu12.04.1/po/fi.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/fi.po 2015-07-29 19:28:54.000000000 +0000 @@ -66,7 +66,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -148,7 +148,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -524,7 +524,7 @@ msgid "&Source" msgstr "Lä&hde" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Fontit" @@ -8498,7 +8498,7 @@ msgid "&Move" msgstr "Sii&rrä" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Muuta kokoa" @@ -13470,98 +13470,98 @@ msgstr "&Suuri" #: wineconsole.rc:68 -msgid "Control" -msgstr "Hallinta" +msgid "Command history" +msgstr "Komentohistoria" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "P&uskurin koko:" + +#: wineconsole.rc:72 +msgid "&Remove duplicates" +msgstr "P&oista toistuvat" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Ponnahdusvalikko" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Control" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" -msgstr "&Shift" - -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Pikamuokkaus" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&käytä" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Komentohistoria" +msgstr "S&hift" -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Muistettujen komentojen määrä:" +#: wineconsole.rc:78 +msgid "Console" +msgstr "Konsoli" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Poista toistuvat" +msgid "&Quick Edit mode" +msgstr "Pika&muokkaustila" -#: wineconsole.rc:87 +#: wineconsole.rc:80 +msgid "&Insert mode" +msgstr "&Lisäystila" + +#: wineconsole.rc:88 msgid "&Font" msgstr "&Fontit" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Väri" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Valinnat" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Puskurivyöhyke" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Leveys:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Korkeus:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Ikkunan koko" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "L&eveys:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "K&orkeus:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Ohjelman loppu" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Sulje konsoli" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Versio" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Konsolin parametrit" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Muista nämä asetukset myöhempää varten" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Muokkaa vain nykyistä istuntoa" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/fr.po wine-staging-1.7.48~ubuntu12.04.1/po/fr.po --- wine-staging-1.7.47~ubuntu12.04.1/po/fr.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/fr.po 2015-07-29 19:28:54.000000000 +0000 @@ -5,7 +5,7 @@ "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To: http://bugs.winehq.org\n" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2015-02-12 14:55+0100\n" +"PO-Revision-Date: 2015-07-18 09:12+0100\n" "Last-Translator: Frédéric Delanoy \n" "Language-Team: French\n" "Language: fr\n" @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -152,7 +152,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -532,7 +532,7 @@ msgid "&Source" msgstr "&Source" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Police" @@ -7493,10 +7493,8 @@ msgstr "Ajouter un contrôle" #: oledlg.rc:34 -#, fuzzy -#| msgid "&Font..." msgid "&Convert..." -msgstr "&Police..." +msgstr "&Convertir..." #: oledlg.rc:33 oleview.rc:40 msgid "&Object" @@ -8562,7 +8560,7 @@ msgid "&Move" msgstr "&Déplacer" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "Di&mension" @@ -8960,10 +8958,6 @@ "assez d'espace disque ou que vous êtes toujours connecté au réseau." #: winmm.rc:86 -#, fuzzy -#| msgid "" -#| "Cannot find the specified device. Make sure it is installed or that the " -#| "device name is spelled correctly." msgid "" "Cannot find the specified device. Make sure it is installed and that the " "device name is spelled correctly." @@ -9300,10 +9294,8 @@ msgstr "Programme d'installation de Mono pour Wine" #: winmm.rc:137 -#, fuzzy -#| msgid "column" msgid "Volume" -msgstr "colonne" +msgstr "Volume" #: winmm.rc:138 msgid "Master Volume" @@ -13658,98 +13650,98 @@ msgstr "&Grand" #: wineconsole.rc:68 -msgid "Control" -msgstr "Contrôle" +msgid "Command history" +msgstr "Historique des commandes" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "&Taille mém. tampon :" + +#: wineconsole.rc:72 +msgid "&Remove duplicates" +msgstr "&Supprimer les doublons" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Menu contextuel" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Contrôle" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" -msgstr "Ma&j" - -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Édition rapide" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&activer" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Historique des commandes" +msgstr "M&aj" -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Nombre de commandes mémorisées :" +#: wineconsole.rc:78 +msgid "Console" +msgstr "Console" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Supprimer les doublons" +msgid "&Quick Edit mode" +msgstr "Mode é&dition rapide" + +#: wineconsole.rc:80 +msgid "&Insert mode" +msgstr "Mode &insertion" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&Police" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Couleur" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Configuration" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Taille mémoire tampon écran" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Largeur :" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "Ha&uteur :" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Taille de la fenêtre" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "La&rgeur :" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "Hau&teur :" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Fin du programme" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Fermer la console" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Édition" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Paramètres de la console" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Sauver les paramètres pour les prochaines sessions" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Appliquer uniquement à la session courante" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/he.po wine-staging-1.7.48~ubuntu12.04.1/po/he.po --- wine-staging-1.7.47~ubuntu12.04.1/po/he.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/he.po 2015-07-29 19:28:54.000000000 +0000 @@ -74,7 +74,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -156,7 +156,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -533,7 +533,7 @@ msgid "&Source" msgstr "מ&קור" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "גופן" @@ -8807,7 +8807,7 @@ msgid "&Move" msgstr "ה&זזה" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "ג&ודל" @@ -13568,104 +13568,113 @@ msgstr "&גדול" #: wineconsole.rc:68 -msgid "Control" -msgstr "שליטה" +msgid "Command history" +msgstr "היסטוריית הפקודות" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "אזור האגירה" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "ה&סרת כפולים" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "התפריט הקובץ" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Control" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "עריכה מהירה" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "ה&פעלה" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "היסטוריית הפקודות" - -#: wineconsole.rc:76 +#: wineconsole.rc:78 #, fuzzy -msgid "&Number of recalled commands:" -msgstr "&מספר הפקודות שנשמרות :" +#| msgid "&Close console" +msgid "Console" +msgstr "סגירת ה&מסוף" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "ה&סרת כפולים" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "עריכה מהירה" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "מצב &מומחה" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&גופן" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&צבע" -#: wineconsole.rc:100 +#: wineconsole.rc:101 #, fuzzy msgid "Configuration" msgstr " תצוגה " -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "אזור האגירה" -#: wineconsole.rc:104 +#: wineconsole.rc:105 #, fuzzy msgid "&Width:" msgstr "&רוחב :" -#: wineconsole.rc:107 +#: wineconsole.rc:108 #, fuzzy msgid "&Height:" msgstr "&גובה :" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "גודל החלון" -#: wineconsole.rc:112 +#: wineconsole.rc:113 #, fuzzy msgid "W&idth:" msgstr "&גובה :" -#: wineconsole.rc:115 +#: wineconsole.rc:116 #, fuzzy msgid "H&eight:" msgstr "&רוחב :" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "סיום התכנית" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "סגירת ה&מסוף" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "מצב עריכה" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "הפרמטרים של המסוף" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "שמירת הגדרות אלו להפעלות הבאות" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "שינוי בהפעלה הנוכחית בלבד" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/hi.po wine-staging-1.7.48~ubuntu12.04.1/po/hi.po --- wine-staging-1.7.47~ubuntu12.04.1/po/hi.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/hi.po 2015-07-29 19:28:54.000000000 +0000 @@ -63,7 +63,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -140,7 +140,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -511,7 +511,7 @@ msgid "&Source" msgstr "" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 #, fuzzy msgid "Font" msgstr "फ़ॉन्ट (&F)..." @@ -8345,7 +8345,7 @@ msgid "&Move" msgstr "" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "" @@ -12887,99 +12887,99 @@ msgstr "" #: wineconsole.rc:68 -msgid "Control" +msgid "Command history" msgstr "" #: wineconsole.rc:69 -msgid "Popup menu" -msgstr "" - -#: wineconsole.rc:70 -msgid "&Control" -msgstr "" - -#: wineconsole.rc:71 -msgid "S&hift" +msgid "&Buffer size:" msgstr "" #: wineconsole.rc:72 -msgid "Quick edit" +msgid "&Remove duplicates" msgstr "" -#: wineconsole.rc:73 -msgid "&enable" +#: wineconsole.rc:74 +msgid "Popup menu" msgstr "" #: wineconsole.rc:75 -msgid "Command history" +msgid "&Control" msgstr "" #: wineconsole.rc:76 -msgid "&Number of recalled commands:" +msgid "S&hift" +msgstr "" + +#: wineconsole.rc:78 +msgid "Console" msgstr "" #: wineconsole.rc:79 -msgid "&Remove doubles" +msgid "&Quick Edit mode" +msgstr "" + +#: wineconsole.rc:80 +msgid "&Insert mode" msgstr "" -#: wineconsole.rc:87 +#: wineconsole.rc:88 #, fuzzy msgid "&Font" msgstr "फ़ॉन्ट (&F)..." -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/hr.po wine-staging-1.7.48~ubuntu12.04.1/po/hr.po --- wine-staging-1.7.47~ubuntu12.04.1/po/hr.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/hr.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -150,7 +150,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -527,7 +527,7 @@ msgid "&Source" msgstr "&Izvor" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Font" @@ -8556,7 +8556,7 @@ msgid "&Move" msgstr "Pr&emjesti" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Veličina" @@ -13203,98 +13203,108 @@ msgstr "&Veliki" #: wineconsole.rc:68 -msgid "Control" -msgstr "Kontrola" +msgid "Command history" +msgstr "Povijest naredbi" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Tampon zona" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "&Ukloni duplikate" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Iskočni izbornik" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "Kont&rola" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "Po&mak" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Brzo editiranje" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "uklju&či" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Povijest naredbi" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "Broj povučen&ih naredbi:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Zatvori konzolu" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Ukloni duplikate" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Brzo editiranje" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Insert" +msgid "&Insert mode" +msgstr "&Unesi" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "Fon&t" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "Bo&ja" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Konfiguracija" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Tampon zona" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Širina:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Visina:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Veličina rozora" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "Š&irina:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "Vi&sina:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Kraj programa" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Zatvori konzolu" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Edicija" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Paremetri konzole" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Sačuvaj ove postake za kasnije sjednice" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Modificiraj samo trenutnu sjednicu" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/hu.po wine-staging-1.7.48~ubuntu12.04.1/po/hu.po --- wine-staging-1.7.47~ubuntu12.04.1/po/hu.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/hu.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -152,7 +152,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -541,7 +541,7 @@ msgid "&Source" msgstr "Fo&rrás" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Betûtípus" @@ -8596,7 +8596,7 @@ msgid "&Move" msgstr "Át&helyzés" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Méret" @@ -13662,98 +13662,108 @@ msgstr "&Nagy" #: wineconsole.rc:68 -msgid "Control" -msgstr "Irányítás" +msgid "Command history" +msgstr "Parancs előzmény" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Puffer zóna" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "Kettőzések &eltávolítása" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Előbukkanó menü" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Vezérlés" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Gyors szerkesztés" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&engedélyez" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Parancs előzmény" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Visszahívható parancsok száma:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Konsol bezárása" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "Kettőzések &eltávolítása" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Gyors szerkesztés" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "&Bővített mód" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&Betűtípus" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Szín" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Beállítás" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Puffer zóna" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Szélesség:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Magasság:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Ablak méret" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "S&zélesség:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "M&agasság:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Program vége" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Konsol bezárása" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Verzió kiadás" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Konsol paraméterek" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Beállítások mentése" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Csak az aktuális munkafolyamat módosítása" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/it.po wine-staging-1.7.48~ubuntu12.04.1/po/it.po --- wine-staging-1.7.47~ubuntu12.04.1/po/it.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/it.po 2015-07-29 19:28:54.000000000 +0000 @@ -72,7 +72,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -157,7 +157,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -547,7 +547,7 @@ msgid "&Source" msgstr "&Origine" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Carattere" @@ -8666,7 +8666,7 @@ msgid "&Move" msgstr "&Muovi" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Dimensione" @@ -13757,98 +13757,108 @@ msgstr "&Grande" #: wineconsole.rc:68 -msgid "Control" -msgstr "Controlli" +msgid "Command history" +msgstr "Cronologia" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Zona del buffer" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "&Rimuovi doppioni" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Menù a comparsa" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Controlla" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "Sco&rri" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Modifica rapida" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&abilita" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Cronologia" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Numero di comandi richiamati:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Chiudi console" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Rimuovi doppioni" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Modifica rapida" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "Modalità &esperto" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&Carattere" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "C&olore" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Configurazione" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Zona del buffer" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Larghezza:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Altezza:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Dimensione della finestra" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "&Larghezza:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "&Altezza:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Fine del programma" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Chiudi console" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Edizione" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Parametri della console" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Salva queste impostazioni" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Modifica solo la sessione corrente" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/ja.po wine-staging-1.7.48~ubuntu12.04.1/po/ja.po --- wine-staging-1.7.47~ubuntu12.04.1/po/ja.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/ja.po 2015-07-29 19:28:54.000000000 +0000 @@ -5,7 +5,7 @@ "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To: http://bugs.winehq.org\n" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2015-03-05 23:24+0900\n" +"PO-Revision-Date: 2015-07-22 00:22+0900\n" "Last-Translator: Akihiro Sagawa \n" "Language-Team: Japanese\n" "Language: ja\n" @@ -68,7 +68,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -151,7 +151,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -530,7 +530,7 @@ msgid "&Source" msgstr "給紙方法(&S)" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "フォントの指定" @@ -7442,10 +7442,8 @@ msgstr "コントロールを追加" #: oledlg.rc:34 -#, fuzzy -#| msgid "&Font..." msgid "&Convert..." -msgstr "フォント(&F)..." +msgstr "変換(&C)..." #: oledlg.rc:33 oleview.rc:40 msgid "&Object" @@ -8336,7 +8334,7 @@ #: shell32.rc:195 msgid "Unable to display Run File dialog box (internal error)" -msgstr "[ファイルを指定して実行]ダイアログを表示できません。(内部エラー)" +msgstr "[ファイルを指定して実行]ダイアログを表示できません (内部エラー)" #: shell32.rc:196 msgid "Unable to display Browse dialog box (internal error)" @@ -8497,7 +8495,7 @@ msgid "&Move" msgstr "移動(&M)" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "サイズ変更(&S)" @@ -8562,10 +8560,8 @@ msgstr "両面印刷:" #: wineps.rc:50 -#, fuzzy -#| msgid "&Setup" msgid "Setup" -msgstr "プリンタの設定(&S)" +msgstr "プリンタの設定" #: wininet.rc:42 wininet.rc:62 msgid "Realm" @@ -8879,10 +8875,6 @@ "あるいはネットワークに接続されているか確認して下さい。" #: winmm.rc:86 -#, fuzzy -#| msgid "" -#| "Cannot find the specified device. Make sure it is installed or that the " -#| "device name is spelled correctly." msgid "" "Cannot find the specified device. Make sure it is installed and that the " "device name is spelled correctly." @@ -9195,24 +9187,20 @@ "はネットワークに接続されているか確認して下さい。" #: winmm.rc:136 -#, fuzzy -#| msgid "Wine Mono Installer" msgid "Wine Sound Mapper" -msgstr "Wine Mono インストーラ" +msgstr "Wine サウンド マッパー" #: winmm.rc:137 -#, fuzzy -#| msgid "column" msgid "Volume" -msgstr "列" +msgstr "音量" #: winmm.rc:138 msgid "Master Volume" -msgstr "" +msgstr "マスタ音量" #: winmm.rc:139 msgid "Mute" -msgstr "" +msgstr "ミュート" #: winspool.rc:37 msgid "Print to File" @@ -9503,8 +9491,7 @@ "ATTRIB - ファイル属性を表示または変更します。\n" "\n" "構文:\n" -"ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [ドライブ:][パス][ファイル" -"名]\n" +"ATTRIB [+R|-R] [+A|-A] [+S|-S] [+H|-H] [ドライブ:][パス][ファイル名]\n" " [/S [/D]]\n" "\n" "オプション:\n" @@ -9517,8 +9504,7 @@ " H 隠しファイル属性。\n" " [ドライブ:][パス][ファイル名]\n" " attribが処理するファイルやファイル群を指定します。\n" -" /S カレント フォルダとすべてのサブフォルダでマッチするファイルを処理しま" -"す。\n" +" /S カレント フォルダと全サブフォルダでマッチするファイルを処理します。\n" " /D フォルダも同様に処理します。\n" #: clock.rc:32 @@ -9558,15 +9544,6 @@ msgstr "時計" #: cmd.rc:40 -#, fuzzy -#| msgid "" -#| "CALL is used within a batch file to execute commands\n" -#| "from another batch file. When the batch file exits, control returns to\n" -#| "the file which called it. The CALL command may supply parameters to the\n" -#| "called procedure.\n" -#| "\n" -#| "Changes to default directory, environment variables etc made within a\n" -#| "called procedure are inherited by the caller.\n" msgid "" "CALL is used within a batch file to execute commands from\n" "another batch file. When the batch file exits, control returns to the file\n" @@ -9576,13 +9553,13 @@ "Changes to default directory, environment variables etc made within a\n" "called procedure are inherited by the caller.\n" msgstr "" -"CALL <バッチファイル名> は他のバッチファイルからコマンドを実行する場合\n" -"にバッチファイル中で使用します。バッチファイル終了時にコントロールは呼\n" -"び出したファイルに戻ります。 CALL コマンドは呼び出される手続きにパラメ\n" -"ータを渡すことが可能です。\n" +"CALL <バッチファイル名> は他のバッチ ファイルからコマンドを実行する場合に\n" +"バッチ ファイル中で使用します。バッチ ファイル終了時にコントロールは呼び出\n" +"したファイルに戻ります。 CALL コマンドは呼び出される手続きにパラメータを渡\n" +"すことが可能です。\n" "\n" -"呼び出された手続きが行ったカレントディレクトリや環境変数の変更は呼び出\n" -"し元に引き継がれます。\n" +"呼び出された手続きが行ったカレント ディレクトリや環境変数の変更は呼び出し元\n" +"に引き継がれます。\n" #: cmd.rc:44 msgid "" @@ -9621,16 +9598,6 @@ msgstr "DIR はディレクトリの内容を一覧表示します。\n" #: cmd.rc:75 -#, fuzzy -#| msgid "" -#| "ECHO displays on the current terminal device.\n" -#| "\n" -#| "ECHO ON causes all subsequent commands in a batch file to be displayed\n" -#| "on the terminal device before they are executed.\n" -#| "\n" -#| "ECHO OFF reverses the effect of a previous ECHO ON (ECHO is OFF by\n" -#| "default). The ECHO OFF command can be prevented from displaying by\n" -#| "preceding it with an @ sign.\n" msgid "" "ECHO displays on the current terminal device.\n" "\n" @@ -9641,14 +9608,13 @@ "default). The ECHO OFF command can be prevented from displaying by\n" "preceding it with an @ sign.\n" msgstr "" -"ECHO <文字列> は<文字列>を現在のターミナルに表示します。\n" +"ECHO <文字列> は<文字列>を現在の端末デバイスに表示します。\n" "\n" -"ECHO ON は以降にバッチファイルで実行するコマンドを実行前に\n" -"ターミナルに表示するようにします。\n" +"ECHO ON は以降にバッチ ファイルで実行するコマンドを実行前に端末に表示するよ\n" +"うにします。\n" "\n" -"ECHO OFF はECHO ONの逆の効果を持ちます。 (ECHOはデフォルト\n" -"ではOFFです)。ECHO OFF コマンドは@マークに続けて実行すれば\n" -"表示されません。\n" +"ECHO OFF は ECHO ON の逆の効果を持ちます(ECHO はデフォルトでは OFF です)。\n" +"ECHO OFF コマンドは @ マークに続けて実行すれば表示されません。\n" #: cmd.rc:78 msgid "ERASE deletes a file or set of files.\n" @@ -9670,18 +9636,6 @@ "バッチ ファイルで FOR を利用するとき、% 記号は二重にする必要があります。\n" #: cmd.rc:97 -#, fuzzy -#| msgid "" -#| "The GOTO command transfers execution to another statement within a\n" -#| "batch file.\n" -#| "\n" -#| "The label which is the target of a GOTO may be up to 255 characters\n" -#| "long but may not include spaces (this is different from other operating\n" -#| "systems). If two or more identical labels exist in a batch file the\n" -#| "first one will always be executed. Attempting to GOTO a nonexistent\n" -#| "label terminates the batch file execution.\n" -#| "\n" -#| "GOTO has no effect when used interactively.\n" msgid "" "The GOTO command transfers execution to another statement within a batch\n" "file.\n" @@ -9694,14 +9648,12 @@ "\n" "GOTO has no effect when used interactively.\n" msgstr "" -"GOTO コマンドはバッチファイル中で実行行を他のステートメントに\n" -"移します。\n" +"GOTO コマンドはバッチ ファイル中で実行行を他のステートメントに移します。\n" "\n" -"GOTO 文のターゲットとなるラベルは半角255文字以内ですが、空白\n" -"を含んではいけません。(これは他のオペレーティングシステムでは\n" -"異なります)。2つ以上同一のラベルが存在する場合は常に最初の物\n" -"が実行されます。GOTO文に存在しないラベルを指定した場合はバッ\n" -"チファイルの実行を中断します。\n" +"GOTO 文のターゲットとなるラベルは半角 255 文字以内ですが、空白を含んではい\n" +"けません(これは他のオペレーティング システムでは異なります)。2 つ以上同一の\n" +"ラベルが存在する場合は常に最初の物が実行されます。GOTO 文に存在しないラベル\n" +"を指定した場合はバッチ ファイルの実行を中断します。\n" "\n" "GOTO は対話モードで使用された場合は意味を持ちません。\n" @@ -9756,17 +9708,6 @@ msgstr "MKDIR <名前> はサブディレクトリを作成します。\n" #: cmd.rc:131 -#, fuzzy -#| msgid "" -#| "MOVE relocates a file or directory to a new point within the file " -#| "system.\n" -#| "\n" -#| "If the item being moved is a directory then all the files and " -#| "subdirectories\n" -#| "below the item are moved as well.\n" -#| "\n" -#| "MOVE fails if the old and new locations are on different DOS drive " -#| "letters.\n" msgid "" "MOVE relocates a file or directory to a new point within the file system.\n" "\n" @@ -9775,8 +9716,8 @@ "\n" "MOVE fails if the old and new locations are on different DOS drive letters.\n" msgstr "" -"MOVE はファイルかディレクトリをファイル システムでの新しい場所に移動しま" -"す。\n" +"MOVE はファイルまたはディレクトリをファイル システムでの新しい場所に移動し\n" +"ます。\n" "\n" "移動する対象がディレクトリの場合は、ディレクトリ内の全てのファイルとサブ\n" "ディレクトリも移動します。\n" @@ -9784,17 +9725,6 @@ "MOVE では移動元と移動先のドライブ レターが異なる場合、移動は失敗します。\n" #: cmd.rc:142 -#, fuzzy -#| msgid "" -#| "PATH displays or changes the cmd search path.\n" -#| "\n" -#| "Entering PATH will display the current PATH setting (initially taken\n" -#| "from the registry). To change the setting follow the\n" -#| "PATH command with the new value.\n" -#| "\n" -#| "It is also possible to modify the PATH by using the PATH environment\n" -#| "variable, for example:\n" -#| "PATH %PATH%;c:\\temp\n" msgid "" "PATH displays or changes the cmd search path.\n" "\n" @@ -9808,21 +9738,14 @@ msgstr "" "PATH は cmd の検索パスを表示または変更します。\n" "\n" -"PATH と入力すると現在のパス設定を表示します(初期状態ではレジストリから\n" -"取得されます)。設定を変更するには、PATH コマンドに続けて新しい設定値を\n" -"入力して下さい。\n" +"PATH と入力すると現在のパス設定を表示します(初期状態ではレジストリから取得\n" +"されます)。設定を変更するには、PATH コマンドに続けて新しい設定値を入力して\n" +"下さい。\n" "\n" -"パスを変更するときに PATH 環境変数を使用することも可能です。\n" -"例えば:\n" +"PATH を変更するときに PATH 環境変数を使用することも可能です、例えば:\n" "PATH %PATH%;c:\\temp\n" #: cmd.rc:148 -#, fuzzy -#| msgid "" -#| "PAUSE displays a message on the screen asking the user to press a key.\n" -#| "\n" -#| "It is mainly useful in batch files to allow the user to read the output\n" -#| "of a previous command before it scrolls off the screen.\n" msgid "" "PAUSE displays a message on the screen asking the user to press a key.\n" "\n" @@ -9831,34 +9754,10 @@ msgstr "" "PAUSE は画面にキーを押してくださいとメッセージを表示します。\n" "\n" -"これは主にバッチ ファイル中で実行されたコマンドの結果がスクロールする前\n" -"にユーザが読めるようにしたい場合に有用です。\n" +"これは主にバッチ ファイル中で実行されたコマンドの結果がスクロールする前に\n" +"ユーザが読めるようにしたい場合に有用です。\n" #: cmd.rc:169 -#, fuzzy -#| msgid "" -#| "PROMPT sets the command-line prompt.\n" -#| "\n" -#| "The string following the PROMPT command (and the space immediately " -#| "after)\n" -#| "appears at the beginning of the line when cmd is waiting for input.\n" -#| "\n" -#| "The following character strings have the special meaning shown:\n" -#| "\n" -#| "$$ Dollar sign $_ Linefeed $b Pipe sign (|)\n" -#| "$d Current date $e Escape $g > sign\n" -#| "$l < sign $n Current drive $p Current path\n" -#| "$q Equal sign $t Current time $v cmd version\n" -#| "\n" -#| "Note that entering the PROMPT command without a prompt-string resets the\n" -#| "prompt to the default, which is the current directory (which includes " -#| "the\n" -#| "current drive letter) followed by a greater-than (>) sign.\n" -#| "(like a command PROMPT $p$g).\n" -#| "\n" -#| "The prompt can also be changed by altering the PROMPT environment " -#| "variable,\n" -#| "so the command 'SET PROMPT=text' has the same effect as 'PROMPT text'.\n" msgid "" "PROMPT sets the command-line prompt.\n" "\n" @@ -9880,10 +9779,10 @@ "The prompt can also be changed by altering the PROMPT environment variable,\n" "so the command 'SET PROMPT=text' has the same effect as 'PROMPT text'.\n" msgstr "" -"PROMPT はコマンドプロンプトを設定します。\n" +"PROMPT はコマンド行のプロンプトを設定します。\n" "\n" -"PROMPT コマンド(と直後のスペース)に続く文字列はcmdが入力待ちの時、\n" -"行の先頭に表示されます。\n" +"PROMPT コマンド(と直後のスペース)に続く文字列はcmdが入力待ちの時、行の先頭\n" +"に表示されます。\n" "\n" "以下のキャラクタ文字列は特別な意味を持ちます:\n" "\n" @@ -9893,24 +9792,20 @@ "$q 等号 $t 現在の時刻 $v cmdのバージョン\n" "\n" "注意:PROMPTコマンドをプロンプト文字列なしで実行すると、デフォルト値にリ\n" -"セットされます。 デフォルト値はカレントディレクトリ(ドライブ名を含みます)\n" +"セットされます。 デフォルト値はカレント ディレクトリ(ドライブ名を含みます)\n" "に続いて大なり(>)記号です。\n" "(PROMPT $p$g を実行した時と同様です)\n" "\n" -"プロンプトはPROMPT環境変数を編集することでも変更できます。\n" -"したがって、'SET PROMPT=文字列'と'PROMPT 文字列'の効果は同じです。\n" +"プロンプトはPROMPT環境変数を編集することでも変更できます。したがって、\n" +"'SET PROMPT=文字列'と'PROMPT 文字列'の効果は同じです。\n" #: cmd.rc:173 -#, fuzzy -#| msgid "" -#| "A command line beginning with REM (followed by a space) performs no\n" -#| "action, and can therefore be used as a comment in a batch file.\n" msgid "" "A command line beginning with REM (followed by a space) performs no action,\n" "and can therefore be used as a comment in a batch file.\n" msgstr "" -"REM(と直後のスペース)で始まるコマンドは実行されません。\n" -"したがって、バッチファイル中のコメントとして使用できます。\n" +"REM(と直後のスペース)で始まるコマンドは実行されません。したがって、バッチ\n" +"ファイル中のコメントとして使用できます。\n" #: cmd.rc:176 msgid "REN is the short version of RENAME. It renames a file.\n" @@ -9929,24 +9824,6 @@ msgstr "RMDIR <ディレクトリ> はディレクトリを削除します。\n" #: cmd.rc:229 -#, fuzzy -#| msgid "" -#| "SET displays or changes the cmd environment variables.\n" -#| "\n" -#| "SET without parameters shows all of the current environment.\n" -#| "\n" -#| "To create or modify an environment variable the syntax is:\n" -#| "\n" -#| "SET =\n" -#| "\n" -#| "where and are character strings. There must be no\n" -#| "space before the equals sign, nor can the variable name\n" -#| "have embedded spaces.\n" -#| "\n" -#| "Under Wine, the environment of the underlying operating system is\n" -#| "included into the Win32 environment, there will generally therefore be\n" -#| "many more values than in a native Win32 implementation. Note that it is\n" -#| "not possible to affect the operating system environment from within cmd.\n" msgid "" "SET displays or changes the cmd environment variables.\n" "\n" @@ -9972,60 +9849,25 @@ "\n" "SET <環境変数名>=<値>\n" "\n" -"<環境変数名> と <値> は文字列です。等号の手前にスペースを\n" -"入れないで下さい。手前にスペースを入れると環境変数名に余分\n" -"なスペースが含まれてしまう場合があります。\n" -"\n" -"Wine環境では、Wineが動作しているOSの環境変数がWin32環境変数に含\n" -"まれます。したがって、ネイティブWin32環境より多くの値がセットさ\n" -"れています。cmd内からOSの環境変数を変更することができないこと\n" -"に注意して下さい。\n" +"<環境変数名> と <値> は文字列です。等号の手前にスペースを入れないで下さい。\n" +"手前にスペースを入れると環境変数名に余分なスペースが含まれてしまう場合があ\n" +"ります。\n" +"\n" +"Wine環境では、Wineが動作しているOSの環境変数がWin32環境変数に含まれます。し\n" +"たがって、ネイティブWin32環境より多くの値がセットされています。cmd内からOS\n" +"の環境変数を変更することができないことに注意して下さい。\n" #: cmd.rc:234 -#, fuzzy -#| msgid "" -#| "SHIFT is used in a batch file to remove one parameter from the head of\n" -#| "the list, so parameter 2 becomes parameter 1 and so on. It has no effect\n" -#| "if called from the command line.\n" msgid "" "SHIFT is used in a batch file to remove one parameter from the head of the\n" "list, so parameter 2 becomes parameter 1 and so on. It has no effect if\n" "called from the command line.\n" msgstr "" -"SHIFT はバッチファイル中でリストの先頭から一つのパラメータを取り除く時\n" -"に使用します。つまり、パラメータ2がパラメータ1になります。コマンドライン\n" -"から呼ばれたときには何も起こりません。\n" +"SHIFT はバッチ ファイル中でリストの先頭から一つのパラメータを取り除く時に使\n" +"用します。つまり、パラメータ2がパラメータ1になります。コマンドラインから呼\n" +"ばれたときには何も起こりません。\n" #: cmd.rc:212 start.rc:56 -#, fuzzy -#| msgid "" -#| "Start a program, or open a document in the program normally used for " -#| "files with that suffix.\n" -#| "Usage:\n" -#| "start [options] program_filename [...]\n" -#| "start [options] document_filename\n" -#| "\n" -#| "Options:\n" -#| "\"title\" Specifies the title of the child windows.\n" -#| "/d directory Start the program in the specified directory.\n" -#| "/b Don't create a new console for the program.\n" -#| "/i Start the program with fresh environment variables.\n" -#| "/min Start the program minimized.\n" -#| "/max Start the program maximized.\n" -#| "/low Start the program in the idle priority class.\n" -#| "/normal Start the program in the normal priority class.\n" -#| "/high Start the program in the high priority class.\n" -#| "/realtime Start the program in the realtime priority class.\n" -#| "/abovenormal Start the program in the abovenormal priority class.\n" -#| "/belownormal Start the program in the belownormal priority class.\n" -#| "/node n Start the program on the specified NUMA node.\n" -#| "/affinity mask Start the program with the specified affinity mask.\n" -#| "/wait Wait for the started program to finish, then exit with its " -#| "exit code.\n" -#| "/unix Use a Unix filename and start the file like windows " -#| "explorer.\n" -#| "/ProgIDOpen Open a document using the specified progID.\n" -#| "/? Display this help and exit.\n" msgid "" "Start a program, or open a document in the program normally used for files\n" "with that suffix.\n" @@ -10055,8 +9897,8 @@ "/ProgIDOpen Open a document using the specified progID.\n" "/? Display this help and exit.\n" msgstr "" -"プログラムを開始したり、拡張子に基づき通常使われるプログラムで文書を開きま" -"す。\n" +"プログラムを開始したり、その拡張子のファイルに通常使われるプログラムで文書\n" +"を開きます。\n" "使い方:\n" "start [オプション] プログラムファイル名 [...]\n" "start [オプション] 文書ファイル名\n" @@ -10076,10 +9918,10 @@ "/belownormal 優先度クラス'通常以下'でプログラムを開始します。\n" "/node n 指定した NUMA ノードでプログラムを開始します。\n" "/affinity mask 指定した関連マスクでプログラムを開始します。\n" -"/wait 開始プログラムの完了を待ち、そのプログラムの終了コードで終了しま" -"す。\n" -"/unix Unix ファイル名を使い、windows エクスプローラのようにファイルを" -"開始します。\n" +"/wait 開始プログラムの完了を待ち、そのプログラムの終了コードで終了し\n" +"ます。\n" +"/unix Unix ファイル名を使い、windows エクスプローラのようにファイル\n" +"を開始します。\n" "/ProgIDOpen 文書を指定した progID を用いて開きます。\n" "/? このヘルプを表示し、終了します。\n" @@ -10092,10 +9934,6 @@ msgstr "TITLE <文字列> は cmd ウィンドウのウィンドウ タイトルを設定します。\n" #: cmd.rc:244 -#, fuzzy -#| msgid "" -#| "TYPE copies to the console device (or elsewhere\n" -#| "if redirected). No check is made that the file is readable text.\n" msgid "" "TYPE copies to the console device (or elsewhere if\n" "redirected). No check is made that the file is readable text.\n" @@ -10114,11 +9952,10 @@ "\n" "The verify flag has no function in Wine.\n" msgstr "" -"VERIFY は照合フラグをセット、クリア、確認するときに使用します。有効な形式" -"は:\n" +"VERIFY は照合フラグを設定、消去、確認するときに使用します。有効な形式は:\n" "\n" -"VERIFY ON\tフラグをセットします。\n" -"VERIFY OFF\tフラグをクリアします。\n" +"VERIFY ON\tフラグを設定します。\n" +"VERIFY OFF\tフラグを消去します。\n" "VERIFY\t\t状況に応じONかOFFかを表示します。\n" "\n" "Wine環境では照合フラグは意味を持ちません。\n" @@ -10132,16 +9969,12 @@ msgstr "VOL はディスク デバイスのボリューム ラベルを表示します。\n" #: cmd.rc:263 -#, fuzzy -#| msgid "" -#| "ENDLOCAL ends localization of environment changes in a batch file\n" -#| "which were introduced by a preceding SETLOCAL.\n" msgid "" "ENDLOCAL ends localization of environment changes in a batch file which\n" "were introduced by a preceding SETLOCAL.\n" msgstr "" -"ENDLOCAL は先行する SETLOCAL によって開始されたバッチ ファイルでの環境\n" -"変更の局所化を終了します。\n" +"ENDLOCAL は先行する SETLOCAL によって開始されたバッチ ファイルでの環境変更\n" +"の局所化を終了します。\n" #: cmd.rc:271 msgid "" @@ -10159,34 +9992,20 @@ "まで保持されます。終了時点で以前の環境設定が復元されます。\n" #: cmd.rc:275 -#, fuzzy -#| msgid "" -#| "PUSHD saves the current directory onto a\n" -#| "stack, and then changes the current directory to the supplied one.\n" msgid "" "PUSHD saves the current directory onto a stack, and then\n" "changes the current directory to the supplied one.\n" msgstr "" -"PUSHD <ディレクトリ> はカレント ディレクトリをスタック上に保存し、\n" -"カレント ディレクトリを指定されたディレクトリに変更します。\n" +"PUSHD <ディレクトリ> はカレント ディレクトリをスタック上に保存し、カレント\n" +"ディレクトリを指定されたディレクトリに変更します。\n" #: cmd.rc:278 msgid "POPD changes current directory to the last one saved with PUSHD.\n" msgstr "" -"POPD は PUSHD で最後に保存されたディレクトリにカレント ディレクトリを変更しま" -"す。\n" +"POPD は PUSHD で最後に保存されたディレクトリにカレント ディレクトリを変更し\n" +"ます。\n" #: cmd.rc:288 -#, fuzzy -#| msgid "" -#| "ASSOC shows or modifies file extension associations.\n" -#| "\n" -#| "Syntax: ASSOC [.ext[=[fileType]]]\n" -#| "\n" -#| "ASSOC without parameters displays current file associations.\n" -#| "If used with only a file extension, displays the current association.\n" -#| "Specifying no file type after the equal sign removes the current " -#| "association, if any.\n" msgid "" "ASSOC shows or modifies file extension associations.\n" "\n" @@ -10199,26 +10018,14 @@ msgstr "" "ASSOC はファイル拡張子の関連付けを表示または変更します。\n" "\n" -"構文: ASSOC [.拡張子[=[ファイル タイプ]]\n" +"構文: ASSOC [.拡張子[=[ファイルタイプ]]\n" "\n" "ASSOC をパラメータなしで使うとファイルの関連付けを表示します。\n" "拡張子だけを指定すると拡張子に対する現在の関連付けを表示します。\n" -"ファイル タイプを等号のあとに指定しない場合は現在の関連付けがあれば削除しま" +"ファイル タイプを等号のあとに指定しない場合は現在の関連付けがあれば削除しま\n" "す。\n" #: cmd.rc:300 -#, fuzzy -#| msgid "" -#| "FTYPE shows or modifies open commands associated with file types.\n" -#| "\n" -#| "Syntax: FTYPE [fileType[=[openCommand]]]\n" -#| "\n" -#| "Without parameters, shows the file types for which open command strings " -#| "are currently defined.\n" -#| "If used with only a file type, displays the associated open command " -#| "string, if any.\n" -#| "Specifying no open command after the equal sign removes the command " -#| "string associated to the specified file type.\n" msgid "" "FTYPE shows or modifies open commands associated with file types.\n" "\n" @@ -10231,48 +10038,39 @@ "Specifying no open command after the equal sign removes the command string\n" "associated to the specified file type.\n" msgstr "" -"FTYPE はファイル タイプに関連付けられたオープン コマンドを表示または変更しま" -"す。\n" +"FTYPE はファイル タイプに関連付けられたオープン コマンドを表示または変更し\n" +"ます。\n" "\n" -"構文: FTYPE [ファイル タイプ[=[オープン コマンド]]\n" +"構文: FTYPE [ファイルタイプ[=[オープンコマンド]]\n" "\n" -"パラメータを指定しない場合、オープン コマンド文字列が定義されているファイル " +"パラメータを指定しない場合、オープン コマンド文字列が定義されているファイル\n" "タイプを表示します。\n" -"ファイル タイプだけを指定した場合は、関連付けられたオープン コマンド文字列が" -"あれば表示します。\n" -"等号のあとに何もオープン コマンドを指定しない場合は、指定したファイル タイプ" -"に対するコマンド文字列を削除します。\n" +"ファイル タイプだけを指定した場合は、関連付けられたオープン コマンド文字列\n" +"があれば表示します。\n" +"等号のあとに何もオープン コマンドを指定しない場合は、指定したファイル タイ\n" +"プに対するコマンド文字列を削除します。\n" #: cmd.rc:303 msgid "MORE displays output of files or piped input in pages.\n" msgstr "MORE はファイルの出力やパイプ化された入力を表示します。\n" #: cmd.rc:308 -#, fuzzy -#| msgid "" -#| "CHOICE displays a text and waits, until the User\n" -#| "presses an allowed Key from a selectable list.\n" -#| "CHOICE is mainly used to build a menu selection in a batch file.\n" msgid "" "CHOICE displays a text and waits, until the User presses an allowed Key\n" "from a selectable list.\n" "CHOICE is mainly used to build a menu selection in a batch file.\n" msgstr "" -"CHOICE はテキストを表示し、選択可能なりストで許可されたキーをユーザが押\n" -"すまで待機します。\n" +"CHOICE はテキストを表示し、選択可能なりストで許可されたキーをユーザが押すま\n" +"で待機します。\n" "CHOICE は主にバッチ ファイルでメニュー選択を構築するために使われます。\n" #: cmd.rc:312 -#, fuzzy -#| msgid "" -#| "EXIT terminates the current command session and returns\n" -#| "to the operating system or shell from which you invoked cmd.\n" msgid "" "EXIT terminates the current command session and returns to the operating\n" "system or shell from which you invoked cmd.\n" msgstr "" -"EXIT は現在のコマンドセッションを終了してcmdを呼び出したOSまたはシェルに戻し" -"ます。\n" +"EXIT は現在のコマンド セッションを終了してcmdを呼び出したOSまたはシェルに戻\n" +"ります。\n" #: cmd.rc:351 msgid "" @@ -10352,8 +10150,8 @@ "XCOPY\t\t送り元のファイルやディレクトリ ツリーをあて先にコピー\n" "EXIT\t\tCMD を終了\n" "\n" -"上記のコマンドに関する詳細を表示するには HELP <コマンド名> と入力して下さ" -"い。\n" +"上記のコマンドに関する詳細情報を表示するには HELP <コマンド名> と入力して下\n" +"さい。\n" #: cmd.rc:353 msgid "Are you sure?" @@ -12099,8 +11897,8 @@ " [/u] サーバの登録を消去します。\n" " [/s] サイレント モード (一切のメッセージが表示されません)。\n" " [/i] DllInstallを呼び出し、 追加の[cmdline]を渡します。\n" -"\t[/u]を付けて使った場合、DllInstallはアンインストール モードで呼び出されま" -"す。 \n" +"\t[/u]と同時に使った場合、DllInstallはアンインストール モードで呼び出\n" +"\tされます。 \n" " [/n] DllRegisterServerを呼び出しません。[/i]と一緒に使用してください。\n" "\n" @@ -13682,98 +13480,98 @@ msgstr "大(&L)" #: wineconsole.rc:68 -msgid "Control" -msgstr "コントロール" +msgid "Command history" +msgstr "コマンド履歴" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "バッファ サイズ(&B)" + +#: wineconsole.rc:72 +msgid "&Remove duplicates" +msgstr "重複を削除(&R)" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "ポップアップ メニュー" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "コントロール(&C)" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "シフト(&H)" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "簡易編集" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "有効(&E)" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "コマンド履歴" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "記憶するコマンド数(&N):" +#: wineconsole.rc:78 +msgid "Console" +msgstr "コンソール" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "重複を削除(&R)" +msgid "&Quick Edit mode" +msgstr "簡易編集モード(&Q)" + +#: wineconsole.rc:80 +msgid "&Insert mode" +msgstr "挿入モード(&I)" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "フォント(&F)" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "色(&C)" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "設定" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" -msgstr "バッファ サイズ" +msgstr "バッファ域" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "幅(&W):" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "高さ(&H):" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "ウィンドウ サイズ" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "幅(&I):" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "高さ(&E):" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "プログラムの終了時" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "コンソールを閉じる(&C)" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "編集方式" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "コンソール パラメータ" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "この設定を以後のセッションでも利用する" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "現在のセッションのみ変更する" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/ko.po wine-staging-1.7.48~ubuntu12.04.1/po/ko.po --- wine-staging-1.7.47~ubuntu12.04.1/po/ko.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/ko.po 2015-07-29 19:28:54.000000000 +0000 @@ -66,7 +66,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -149,7 +149,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -528,7 +528,7 @@ msgid "&Source" msgstr "원본(&S)" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "글꼴" @@ -8553,7 +8553,7 @@ msgid "&Move" msgstr "이동(&M)" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "크기(&S)" @@ -13723,98 +13723,108 @@ msgstr "크게(&L)" #: wineconsole.rc:68 -msgid "Control" -msgstr "컨트롤" +msgid "Command history" +msgstr "명령 히스토리" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "버퍼 존" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "두번 제거(&R)" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "팝업 메뉴" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "컨트롤(&C)" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "쉬프트(&H)" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "빠른 편집" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "가능(&E)" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "명령 히스토리" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "다시 부르는 명령의 갯수(&N):" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "콘솔 닫기(&C)" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "두번 제거(&R)" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "빠른 편집" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "전문가 모드(&E)" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "글꼴(&F)" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "색상(&C)" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "설정" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "버퍼 존" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "너비(&W):" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "높이(&H):" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "창 크기" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "너비(&I) :" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "높이(&E) :" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "풀그림의 끝" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "콘솔 닫기(&C)" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "에디션" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "콘솔 매개변수" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "나중의 세션을 위해 설정 보존" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "오직 현재의 세션만 변경" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/lt.po wine-staging-1.7.48~ubuntu12.04.1/po/lt.po --- wine-staging-1.7.47~ubuntu12.04.1/po/lt.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/lt.po 2015-07-29 19:28:54.000000000 +0000 @@ -5,7 +5,7 @@ "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To: http://bugs.winehq.org\n" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2015-05-21 20:22+0300\n" +"PO-Revision-Date: 2015-07-14 16:31+0300\n" "Last-Translator: Aurimas Fišeras \n" "Language-Team: Lithuanian \n" "Language: lt\n" @@ -69,7 +69,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -152,7 +152,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -529,7 +529,7 @@ msgid "&Source" msgstr "&Šaltinis" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Šriftas" @@ -8509,7 +8509,7 @@ msgid "&Move" msgstr "Pe&rkelti" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "D&ydis" @@ -13508,98 +13508,98 @@ msgstr "&Didelis" #: wineconsole.rc:68 -msgid "Control" -msgstr "Valdymas" +msgid "Command history" +msgstr "Komandų istorija" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "&Buferio dydis:" + +#: wineconsole.rc:72 +msgid "&Remove duplicates" +msgstr "&Šalinti dublikatus" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Iškylantis meniu" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Control" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Greitas redagavimas" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "įjun>i" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Komandų istorija" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "Prisimintų &komandų skaičius:" +#: wineconsole.rc:78 +msgid "Console" +msgstr "Pultas" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Šalinti vienodas" +msgid "&Quick Edit mode" +msgstr "&Greitas redagavimas" -#: wineconsole.rc:87 +#: wineconsole.rc:80 +msgid "&Insert mode" +msgstr "Į&terpimo režimas" + +#: wineconsole.rc:88 msgid "&Font" msgstr "&Šriftas" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Spalva" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Konfigūracija" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Buferio dydis" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Plotis:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Aukštis:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Lango dydis" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "P&lotis:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "A&ukštis:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Programos pabaiga" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "Už&daryti pultą" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Laida" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Pulto parametrai" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Išsaugoti vėlesniems seansams" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Keisti tik dabartinį seansą" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/ml.po wine-staging-1.7.48~ubuntu12.04.1/po/ml.po --- wine-staging-1.7.47~ubuntu12.04.1/po/ml.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/ml.po 2015-07-29 19:28:54.000000000 +0000 @@ -63,7 +63,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -140,7 +140,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -511,7 +511,7 @@ msgid "&Source" msgstr "" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 #, fuzzy msgid "Font" msgstr "_അക്ഷരസഞ്ചയം..." @@ -8345,7 +8345,7 @@ msgid "&Move" msgstr "" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "" @@ -12887,99 +12887,99 @@ msgstr "" #: wineconsole.rc:68 -msgid "Control" +msgid "Command history" msgstr "" #: wineconsole.rc:69 -msgid "Popup menu" -msgstr "" - -#: wineconsole.rc:70 -msgid "&Control" -msgstr "" - -#: wineconsole.rc:71 -msgid "S&hift" +msgid "&Buffer size:" msgstr "" #: wineconsole.rc:72 -msgid "Quick edit" +msgid "&Remove duplicates" msgstr "" -#: wineconsole.rc:73 -msgid "&enable" +#: wineconsole.rc:74 +msgid "Popup menu" msgstr "" #: wineconsole.rc:75 -msgid "Command history" +msgid "&Control" msgstr "" #: wineconsole.rc:76 -msgid "&Number of recalled commands:" +msgid "S&hift" +msgstr "" + +#: wineconsole.rc:78 +msgid "Console" msgstr "" #: wineconsole.rc:79 -msgid "&Remove doubles" +msgid "&Quick Edit mode" +msgstr "" + +#: wineconsole.rc:80 +msgid "&Insert mode" msgstr "" -#: wineconsole.rc:87 +#: wineconsole.rc:88 #, fuzzy msgid "&Font" msgstr "_അക്ഷരസഞ്ചയം..." -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/nb_NO.po wine-staging-1.7.48~ubuntu12.04.1/po/nb_NO.po --- wine-staging-1.7.47~ubuntu12.04.1/po/nb_NO.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/nb_NO.po 2015-07-29 19:28:54.000000000 +0000 @@ -68,7 +68,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -151,7 +151,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -528,7 +528,7 @@ msgid "&Source" msgstr "&Kilde" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Skrift" @@ -8575,7 +8575,7 @@ msgid "&Move" msgstr "&Flytt" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Størrelse" @@ -13564,98 +13564,108 @@ msgstr "&Stor" #: wineconsole.rc:68 -msgid "Control" -msgstr "Kontroll" +msgid "Command history" +msgstr "Kommandohistorikk" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Hurtigminnesone" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "Fje&rn doble" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Hurtigmeny" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Kontroll" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&kift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Rask redigering" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "aktiv&er" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Kommandohistorikk" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "A&ntall huskede kommandoer:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Lukk konsoll" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "Fje&rn doble" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Rask redigering" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "&Ekspertmodus" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "Skri&ft" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "Farg&e" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Oppsett" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Hurtigminnesone" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Bredde:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Høyde:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Vindustørrelse" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "&Bredde:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "Høyd&e:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Ved programslutt" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Lukk konsoll" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Utgave" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Konsoll-parametere" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Behold disse innstillingene for kommende økter" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Endre kun for gjeldende økt" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/nl.po wine-staging-1.7.48~ubuntu12.04.1/po/nl.po --- wine-staging-1.7.47~ubuntu12.04.1/po/nl.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/nl.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -152,7 +152,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -530,7 +530,7 @@ msgid "&Source" msgstr "&Bron" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Lettertype" @@ -8629,7 +8629,7 @@ msgid "&Move" msgstr "Ve&rplaatsen" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Grootte" @@ -13723,98 +13723,108 @@ msgstr "&Groot" #: wineconsole.rc:68 -msgid "Control" -msgstr "Controle" +msgid "Command history" +msgstr "Geschiedenis" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Bufferzone" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "&Verwijder dubbelen" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Popup menu" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Control" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Snel bewerken" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&aan" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Geschiedenis" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Aantal te bewaren opdrachten:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Console afsluiten" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Verwijder dubbelen" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Snel bewerken" -#: wineconsole.rc:87 +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "&Expertmodus" + +#: wineconsole.rc:88 msgid "&Font" msgstr "&Lettertype" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Kleur" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Configuratie" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Bufferzone" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Breedte :" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Hoogte :" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Venstergrootte" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "B&reedte :" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "H&oogte :" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Programma is beëindigd" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Console afsluiten" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Versie" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Console parameters" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Bewaar deze instellingen voor latere sessies" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Wijzig alleen de huidige sessie" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/or.po wine-staging-1.7.48~ubuntu12.04.1/po/or.po --- wine-staging-1.7.47~ubuntu12.04.1/po/or.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/or.po 2015-07-29 19:28:54.000000000 +0000 @@ -63,7 +63,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -140,7 +140,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -511,7 +511,7 @@ msgid "&Source" msgstr "" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 #, fuzzy msgid "Font" msgstr "ଅକ୍ଷରରୂପ (&F)..." @@ -8345,7 +8345,7 @@ msgid "&Move" msgstr "" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "" @@ -12887,99 +12887,99 @@ msgstr "" #: wineconsole.rc:68 -msgid "Control" +msgid "Command history" msgstr "" #: wineconsole.rc:69 -msgid "Popup menu" -msgstr "" - -#: wineconsole.rc:70 -msgid "&Control" -msgstr "" - -#: wineconsole.rc:71 -msgid "S&hift" +msgid "&Buffer size:" msgstr "" #: wineconsole.rc:72 -msgid "Quick edit" +msgid "&Remove duplicates" msgstr "" -#: wineconsole.rc:73 -msgid "&enable" +#: wineconsole.rc:74 +msgid "Popup menu" msgstr "" #: wineconsole.rc:75 -msgid "Command history" +msgid "&Control" msgstr "" #: wineconsole.rc:76 -msgid "&Number of recalled commands:" +msgid "S&hift" +msgstr "" + +#: wineconsole.rc:78 +msgid "Console" msgstr "" #: wineconsole.rc:79 -msgid "&Remove doubles" +msgid "&Quick Edit mode" +msgstr "" + +#: wineconsole.rc:80 +msgid "&Insert mode" msgstr "" -#: wineconsole.rc:87 +#: wineconsole.rc:88 #, fuzzy msgid "&Font" msgstr "ଅକ୍ଷରରୂପ (&F)..." -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/pa.po wine-staging-1.7.48~ubuntu12.04.1/po/pa.po --- wine-staging-1.7.47~ubuntu12.04.1/po/pa.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/pa.po 2015-07-29 19:28:54.000000000 +0000 @@ -63,7 +63,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -140,7 +140,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -511,7 +511,7 @@ msgid "&Source" msgstr "" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 #, fuzzy msgid "Font" msgstr "ਫੌਂਟ(&F)..." @@ -8345,7 +8345,7 @@ msgid "&Move" msgstr "" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "" @@ -12887,99 +12887,99 @@ msgstr "" #: wineconsole.rc:68 -msgid "Control" +msgid "Command history" msgstr "" #: wineconsole.rc:69 -msgid "Popup menu" -msgstr "" - -#: wineconsole.rc:70 -msgid "&Control" -msgstr "" - -#: wineconsole.rc:71 -msgid "S&hift" +msgid "&Buffer size:" msgstr "" #: wineconsole.rc:72 -msgid "Quick edit" +msgid "&Remove duplicates" msgstr "" -#: wineconsole.rc:73 -msgid "&enable" +#: wineconsole.rc:74 +msgid "Popup menu" msgstr "" #: wineconsole.rc:75 -msgid "Command history" +msgid "&Control" msgstr "" #: wineconsole.rc:76 -msgid "&Number of recalled commands:" +msgid "S&hift" +msgstr "" + +#: wineconsole.rc:78 +msgid "Console" msgstr "" #: wineconsole.rc:79 -msgid "&Remove doubles" +msgid "&Quick Edit mode" +msgstr "" + +#: wineconsole.rc:80 +msgid "&Insert mode" msgstr "" -#: wineconsole.rc:87 +#: wineconsole.rc:88 #, fuzzy msgid "&Font" msgstr "ਫੌਂਟ(&F)..." -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/pl.po wine-staging-1.7.48~ubuntu12.04.1/po/pl.po --- wine-staging-1.7.47~ubuntu12.04.1/po/pl.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/pl.po 2015-07-29 19:28:54.000000000 +0000 @@ -71,7 +71,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -155,7 +155,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -533,7 +533,7 @@ msgid "&Source" msgstr "&Źródło" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Czcionka" @@ -8537,7 +8537,7 @@ msgid "&Move" msgstr "Prz&enieś" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Rozmiar" @@ -13569,98 +13569,108 @@ msgstr "&Duża" #: wineconsole.rc:68 -msgid "Control" -msgstr "Kontrola" +msgid "Command history" +msgstr "Historia poleceń" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Strefa bufora" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "&Usuń powtórzenia" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Menu kontekstowe" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Control" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Szybka edycja" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&Udostępnij" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Historia poleceń" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Ilość poleceń, które można przywołać:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Zamknij konsolę" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Usuń powtórzenia" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Szybka edycja" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "Tryb &eksperta" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&Czcionka" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Kolor" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Ustawienia" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Strefa bufora" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Szerokość:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Wysokość:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Rozmiar okna" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "S&zerokość:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "W&ysokość:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Na zakończenie pracy" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Zamknij konsolę" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Edycja" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Parametry konsoli" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Zachowaj ustawienia" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Użyj tylko w bieżącej sesji" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/pt_BR.po wine-staging-1.7.48~ubuntu12.04.1/po/pt_BR.po --- wine-staging-1.7.47~ubuntu12.04.1/po/pt_BR.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/pt_BR.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -151,7 +151,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -530,7 +530,7 @@ msgid "&Source" msgstr "&Fonte" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Fonte" @@ -8526,7 +8526,7 @@ msgid "&Move" msgstr "&Mover" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Tamanho" @@ -13588,98 +13588,108 @@ msgstr "&Grande" #: wineconsole.rc:68 -msgid "Control" -msgstr "Controle" +msgid "Command history" +msgstr "Histórico de comandos" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Zona do buffer" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "&Remover duplicados" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Menu de contexto" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Controle" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "&Rotação" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Edição rápida" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&habilitar" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Histórico de comandos" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Número de comandos memorizados:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Fechar o console" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Remover duplicados" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Edição rápida" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "&Modo Experiente" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&Fonte" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Cor" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Configuração" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Zona do buffer" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Largura:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Altura:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Tamanho da janela" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "L&argura:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "A<ura:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Finalizar programa" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Fechar o console" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Edição" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Parâmetros do console" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Manter configurações nas sessões seguintes" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Modificar somente sessão atual" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/pt_PT.po wine-staging-1.7.48~ubuntu12.04.1/po/pt_PT.po --- wine-staging-1.7.47~ubuntu12.04.1/po/pt_PT.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/pt_PT.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -151,7 +151,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -530,7 +530,7 @@ msgid "&Source" msgstr "&Fonte de Alimentação" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Tipo de Letra" @@ -8498,7 +8498,7 @@ msgid "&Move" msgstr "&Mover" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Tamanho" @@ -13546,98 +13546,108 @@ msgstr "&Grande" #: wineconsole.rc:68 -msgid "Control" -msgstr "Controlo" +msgid "Command history" +msgstr "Histórico de comandos" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Zona do 'buffer'" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "&Remover duplicados" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Popup Menu" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Controlo" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "&Deslocação" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Edição rápida" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&activar" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Histórico de comandos" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Número de comandos rechamados:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Fechar consola" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Remover duplicados" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Edição rápida" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "&Modo Experiente" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&Tipo de Letra" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Cores" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Configuração" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Zona do 'buffer'" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Largura:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Altura:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Tamanho da janela" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "L&argura:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "A<ura:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Finalizar programa" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Fechar consola" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Edição" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Parâmetros da consola" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Manter configurações nas sessões seguintes" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Modificar apenas a sessão actual" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/rm.po wine-staging-1.7.48~ubuntu12.04.1/po/rm.po --- wine-staging-1.7.47~ubuntu12.04.1/po/rm.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/rm.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -145,7 +145,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -526,7 +526,7 @@ msgid "&Source" msgstr "" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "" @@ -8407,7 +8407,7 @@ msgid "&Move" msgstr "" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "" @@ -12984,101 +12984,101 @@ msgstr "" #: wineconsole.rc:68 -msgid "Control" +msgid "Command history" msgstr "" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "" + +#: wineconsole.rc:72 +#, fuzzy +msgid "&Remove duplicates" +msgstr "&Annotaziun..." + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "" -#: wineconsole.rc:72 -msgid "Quick edit" +#: wineconsole.rc:78 +msgid "Console" msgstr "" -#: wineconsole.rc:73 -msgid "&enable" -msgstr "" - -#: wineconsole.rc:75 -msgid "Command history" +#: wineconsole.rc:79 +msgid "&Quick Edit mode" msgstr "" -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" +#: wineconsole.rc:80 +msgid "&Insert mode" msgstr "" -#: wineconsole.rc:79 -#, fuzzy -msgid "&Remove doubles" -msgstr "&Annotaziun..." - -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "" -#: wineconsole.rc:100 +#: wineconsole.rc:101 #, fuzzy msgid "Configuration" msgstr "INFUORMAZIUN" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "" -#: wineconsole.rc:122 +#: wineconsole.rc:123 #, fuzzy msgid "Edition" msgstr "&Lavurar" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/ro.po wine-staging-1.7.48~ubuntu12.04.1/po/ro.po --- wine-staging-1.7.47~ubuntu12.04.1/po/ro.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/ro.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -145,7 +145,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -514,7 +514,7 @@ msgid "&Source" msgstr "&Sursă" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Font" @@ -8769,7 +8769,7 @@ msgid "&Move" msgstr "&Mută" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "M&ărime" @@ -13759,98 +13759,108 @@ msgstr "M&are" #: wineconsole.rc:68 -msgid "Control" -msgstr "Control" +msgid "Command history" +msgstr "Istoric comenzi" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Zonă tampon" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "Elimină dublu&rile" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Meniu popup" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Control" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Editare rapidă" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "activ&ează" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Istoric comenzi" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Număr de comenzi reapelate:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "În&chide consola" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "Elimină dublu&rile" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Editare rapidă" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "Mod &expert" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&Font" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Culoare" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Configurație" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Zonă tampon" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "Lăți&me:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "Î&nălțime:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Dimensiune fereastră" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "Lăț&ime:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "Înălțim&e:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Sfârșitul programului" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "În&chide consola" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Ediție" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Parametrii consolei" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Păstrează această configurație pentru sesiunile ulterioare" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Modifică numai sesiunea curentă" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/ru.po wine-staging-1.7.48~ubuntu12.04.1/po/ru.po --- wine-staging-1.7.47~ubuntu12.04.1/po/ru.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/ru.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -152,7 +152,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -529,7 +529,7 @@ msgid "&Source" msgstr "&Источник" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Шрифт" @@ -2186,8 +2186,8 @@ "сертификатов.\n" "\n" "Сертификаты позволяют идентифицировать вас или компьютер, с которым " -"устанавливается связь.Также они используются для подтверждения подлинности и " -"подписывания сообщений. Хранилище сертификатов представляет собой набор " +"устанавливается связь. Также они используются для подтверждения подлинности " +"и подписывания сообщений. Хранилище сертификатов представляет собой набор " "сертификатов, списков отзыва сертификатов и списков доверенных " "сертификатов.\n" "\n" @@ -2324,8 +2324,8 @@ "файл.\n" "\n" "Сертификаты позволяют идентифицировать вас или компьютер, с которым " -"устанавливается связь.Также они используются для подтверждения подлинности и " -"подписывания сообщений. Хранилище сертификатов представляет собой набор " +"устанавливается связь. Также они используются для подтверждения подлинности " +"и подписывания сообщений. Хранилище сертификатов представляет собой набор " "сертификатов, списков отзыва сертификатов и списков доверенных " "сертификатов.\n" "\n" @@ -8508,7 +8508,7 @@ msgid "&Move" msgstr "&Переместить" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "Раз&мер" @@ -9072,7 +9072,7 @@ "Cannot set the current wave device for play back because it is in use. Wait " "until the device is free, and then try again." msgstr "" -"Невозможно использовать текущее устройство для воспроизведения, т.к. оно " +"Невозможно использовать текущее устройство для воспроизведения, так как оно " "занято. Подождите, пока устройство освободится, и попробуйте заново." #: winmm.rc:114 @@ -9080,7 +9080,7 @@ "All wave devices that can record files in the current format are in use. " "Wait until a wave device is free, and then try again." msgstr "" -"Невозможно использовать текущее устройство для записи, т.к. оно занято. " +"Невозможно использовать текущее устройство для записи, так как оно занято. " "Подождите, пока устройство освободится, и попробуйте заново." #: winmm.rc:115 @@ -9088,7 +9088,7 @@ "Cannot set the current wave device for recording because it is in use. Wait " "until the device is free, and then try again." msgstr "" -"Невозможно использовать текущее устройство для воспроизведения, т.к. оно " +"Невозможно использовать текущее устройство для воспроизведения, так как оно " "занято. Подождите, пока устройство освободится, и попробуйте заново." #: winmm.rc:116 @@ -9741,7 +9741,6 @@ "другой.\n" #: cmd.rc:142 -#, fuzzy msgid "" "PATH displays or changes the cmd search path.\n" "\n" @@ -9755,12 +9754,12 @@ msgstr "" "PATH отображает или изменяет маршрут поиска в cmd.\n" "\n" -"Команда PATH отображает текущую установку пути поиска исполняемых файлов\n" -"(первоначально это значение задаётся в вашем файле wine.conf). Для\n" -"изменения значения вызовите PATH с новым значением.\n" +"Команда PATH отображает текущее значение PATH (начальное значение\n" +"задаётся в реестре). Для изменения значения вызовите PATH с новым\n" +"значением.\n" "\n" -"Так же возможно изменять значение PATH, используя значение переменной\n" -"окружения PATH, например:\n" +"Также возможно изменить значение PATH, используя переменную окружения\n" +"PATH, например:\n" "PATH %PATH%;c:\\temp\n" #: cmd.rc:148 @@ -13497,98 +13496,98 @@ msgstr "&Большой" #: wineconsole.rc:68 -msgid "Control" -msgstr "Управление" +msgid "Command history" +msgstr "История команд" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "Р&азмер буфера:" + +#: wineconsole.rc:72 +msgid "&Remove duplicates" +msgstr "&Удалять повторы" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Всплывающее меню" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Сtrl" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Быстрое редактирование" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&включить" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "История команд" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&История команд:" +#: wineconsole.rc:78 +msgid "Console" +msgstr "Консоль" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Удалять повторяющиеся" +msgid "&Quick Edit mode" +msgstr "&Быстрое редактирование" -#: wineconsole.rc:87 +#: wineconsole.rc:80 +msgid "&Insert mode" +msgstr "&Режим вставки" + +#: wineconsole.rc:88 msgid "&Font" msgstr "&Шрифт" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Цвет" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Конфигурация" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Зона буфера" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Ширина:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Высота:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Размер окна" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "Ш&ирина:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "В&ысота:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Завершение программы" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Закрывать консоль" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Редактирование" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Параметры консоли" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Сохранить эти настройки для будущих сессий" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Изменить только текущую сессию" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/sk.po wine-staging-1.7.48~ubuntu12.04.1/po/sk.po --- wine-staging-1.7.47~ubuntu12.04.1/po/sk.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/sk.po 2015-07-29 19:28:54.000000000 +0000 @@ -72,7 +72,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -157,7 +157,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -547,7 +547,7 @@ msgid "&Source" msgstr "&Odkiaľ" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Písmo" @@ -8523,7 +8523,7 @@ msgid "&Move" msgstr "Pre&sunúť" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Zmeniť veľkosť" @@ -13150,104 +13150,106 @@ msgstr "" #: wineconsole.rc:68 -msgid "Control" +msgid "Command history" msgstr "" #: wineconsole.rc:69 -msgid "Popup menu" -msgstr "" - -#: wineconsole.rc:70 -msgid "&Control" -msgstr "" - -#: wineconsole.rc:71 -msgid "S&hift" +msgid "&Buffer size:" msgstr "" #: wineconsole.rc:72 -msgid "Quick edit" -msgstr "" +#, fuzzy +msgid "&Remove duplicates" +msgstr "&Skomentovať..." -#: wineconsole.rc:73 -msgid "&enable" +#: wineconsole.rc:74 +msgid "Popup menu" msgstr "" #: wineconsole.rc:75 -msgid "Command history" +msgid "&Control" msgstr "" #: wineconsole.rc:76 -msgid "&Number of recalled commands:" +msgid "S&hift" +msgstr "" + +#: wineconsole.rc:78 +msgid "Console" msgstr "" #: wineconsole.rc:79 +msgid "&Quick Edit mode" +msgstr "" + +#: wineconsole.rc:80 #, fuzzy -msgid "&Remove doubles" -msgstr "&Skomentovať..." +#| msgid "&Insert" +msgid "&Insert mode" +msgstr "&Vložiť" -#: wineconsole.rc:87 +#: wineconsole.rc:88 #, fuzzy msgid "&Font" msgstr "Písma" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "" -#: wineconsole.rc:100 +#: wineconsole.rc:101 #, fuzzy msgid "Configuration" msgstr "Informácie" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 #, fuzzy msgid "&Height:" msgstr "&Right:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 #, fuzzy msgid "H&eight:" msgstr "&Right:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "" -#: wineconsole.rc:122 +#: wineconsole.rc:123 #, fuzzy msgid "Edition" msgstr "&Upraviť" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/sl.po wine-staging-1.7.48~ubuntu12.04.1/po/sl.po --- wine-staging-1.7.47~ubuntu12.04.1/po/sl.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/sl.po 2015-07-29 19:28:54.000000000 +0000 @@ -72,7 +72,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -156,7 +156,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -546,7 +546,7 @@ msgid "&Source" msgstr "&Vir" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Pisava" @@ -8651,7 +8651,7 @@ msgid "&Move" msgstr "&Premakni" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "Sp&remeni velikost" @@ -13690,98 +13690,108 @@ msgstr "&Velika" #: wineconsole.rc:68 -msgid "Control" -msgstr "Nadzor" +msgid "Command history" +msgstr "Zgodovina ukazov" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Velikost medpomnilnika" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "&Odstrani dvojnike" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Pojavni meni" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Control" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Hitro urejanje" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&omogoči" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Zgodovina ukazov" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Število priklicanih ukazov:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Zapri konzolo" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Odstrani dvojnike" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Hitro urejanje" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "&Izvedenski način" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&Pisava" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Barva" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Nastavitve" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Velikost medpomnilnika" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Širina:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Višina:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Velikost okna" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "Ši&rina:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "V&išina:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Konec programa" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Zapri konzolo" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Izdaja" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Parametri konzole" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Obdrži te nastavitve za prihodnje seje" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Spremeni samo trenutno sejo" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/sr_RS@cyrillic.po wine-staging-1.7.48~ubuntu12.04.1/po/sr_RS@cyrillic.po --- wine-staging-1.7.47~ubuntu12.04.1/po/sr_RS@cyrillic.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/sr_RS@cyrillic.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -150,7 +150,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -534,7 +534,7 @@ msgid "&Source" msgstr "&Извор" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Фонт" @@ -8868,7 +8868,7 @@ msgid "&Move" msgstr "Пр&емести" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Величина" @@ -13654,114 +13654,115 @@ msgstr "" #: wineconsole.rc:68 -#, fuzzy -msgid "Control" -msgstr "Додај контролу" +msgid "Command history" +msgstr "" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "" + +#: wineconsole.rc:72 +#, fuzzy +msgid "&Remove duplicates" +msgstr "&Уклони..." + +#: wineconsole.rc:74 #, fuzzy msgid "Popup menu" msgstr "искачући мени" -#: wineconsole.rc:70 +#: wineconsole.rc:75 #, fuzzy msgid "&Control" msgstr "Додај контролу" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "" - -#: wineconsole.rc:73 +#: wineconsole.rc:78 #, fuzzy -msgid "&enable" -msgstr "&Табела" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "" +msgid "Console" +msgstr "прозор" -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" +#: wineconsole.rc:79 +msgid "&Quick Edit mode" msgstr "" -#: wineconsole.rc:79 +#: wineconsole.rc:80 #, fuzzy -msgid "&Remove doubles" -msgstr "&Уклони..." +#| msgid "Insert Object" +msgid "&Insert mode" +msgstr "Унос објекта" -#: wineconsole.rc:87 +#: wineconsole.rc:88 #, fuzzy msgid "&Font" msgstr "Фонтови" -#: wineconsole.rc:89 +#: wineconsole.rc:90 #, fuzzy msgid "&Color" msgstr "&Колона" -#: wineconsole.rc:100 +#: wineconsole.rc:101 #, fuzzy msgid "Configuration" msgstr "Грешка у радњама" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 #, fuzzy msgid "&Height:" msgstr "&Десно:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 #, fuzzy msgid "Window size" msgstr "&Прозор" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 #, fuzzy msgid "H&eight:" msgstr "&Десно:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 #, fuzzy msgid "End of program" msgstr "Чекање програма" -#: wineconsole.rc:120 +#: wineconsole.rc:121 #, fuzzy msgid "&Close console" msgstr "прозор" -#: wineconsole.rc:122 +#: wineconsole.rc:123 #, fuzzy msgid "Edition" msgstr "&Уређивање" -#: wineconsole.rc:128 +#: wineconsole.rc:129 #, fuzzy msgid "Console parameters" msgstr "" "Грешка: унесени су непознати или неисправни параметри наредбене линије\n" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/sr_RS@latin.po wine-staging-1.7.48~ubuntu12.04.1/po/sr_RS@latin.po --- wine-staging-1.7.47~ubuntu12.04.1/po/sr_RS@latin.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/sr_RS@latin.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -150,7 +150,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -575,7 +575,7 @@ msgid "&Source" msgstr "Izvor:" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 #, fuzzy msgid "Font" msgstr "Fontovi" @@ -8970,7 +8970,7 @@ msgid "&Move" msgstr "Pr&emesti" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Veličina" @@ -13790,99 +13790,100 @@ msgstr "Veliki" #: wineconsole.rc:68 -#, fuzzy -msgid "Control" -msgstr "Dodaj kontrolu" +msgid "Command history" +msgstr "" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "" + +#: wineconsole.rc:72 +#, fuzzy +msgid "&Remove duplicates" +msgstr "&Ukloni..." + +#: wineconsole.rc:74 #, fuzzy msgid "Popup menu" msgstr "iskačući meni" -#: wineconsole.rc:70 +#: wineconsole.rc:75 #, fuzzy msgid "&Control" msgstr "Dodaj kontrolu" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "" - -#: wineconsole.rc:73 +#: wineconsole.rc:78 #, fuzzy -msgid "&enable" -msgstr "&Tabela" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "" +msgid "Console" +msgstr "prozor" -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" +#: wineconsole.rc:79 +msgid "&Quick Edit mode" msgstr "" -#: wineconsole.rc:79 +#: wineconsole.rc:80 #, fuzzy -msgid "&Remove doubles" -msgstr "&Ukloni..." +#| msgid "Insert Object" +msgid "&Insert mode" +msgstr "Unos objekta" -#: wineconsole.rc:87 +#: wineconsole.rc:88 #, fuzzy msgid "&Font" msgstr "Fontovi" -#: wineconsole.rc:89 +#: wineconsole.rc:90 #, fuzzy msgid "&Color" msgstr "&Kolona" -#: wineconsole.rc:100 +#: wineconsole.rc:101 #, fuzzy msgid "Configuration" msgstr "Greška u radnjama" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 #, fuzzy msgid "&Height:" msgstr "&Desno:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 #, fuzzy msgid "Window size" msgstr "Text Prozora" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 #, fuzzy msgid "H&eight:" msgstr "&Desno:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 #, fuzzy msgid "End of program" msgstr "Čekanje programa" -#: wineconsole.rc:120 +#: wineconsole.rc:121 #, fuzzy msgid "&Close console" msgstr "prozor" -#: wineconsole.rc:122 +#: wineconsole.rc:123 #, fuzzy msgid "Edition" msgstr "" @@ -13891,17 +13892,17 @@ "#-#-#-#-# sr_RS@latin.po (Wine) #-#-#-#-#\n" "&Izmeni" -#: wineconsole.rc:128 +#: wineconsole.rc:129 #, fuzzy msgid "Console parameters" msgstr "" "Greška: uneseni su nepoznati ili neispravni parametri naredbene linije\n" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/sv.po wine-staging-1.7.48~ubuntu12.04.1/po/sv.po --- wine-staging-1.7.47~ubuntu12.04.1/po/sv.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/sv.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -150,7 +150,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -527,7 +527,7 @@ msgid "&Source" msgstr "&Källa" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Typsnitt" @@ -8537,7 +8537,7 @@ msgid "&Move" msgstr "&Flytta" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Storlek" @@ -13451,98 +13451,104 @@ msgstr "&Stor" #: wineconsole.rc:68 -msgid "Control" -msgstr "Control" +msgid "Command history" +msgstr "Kommandohistorik" #: wineconsole.rc:69 -msgid "Popup menu" +msgid "&Buffer size:" msgstr "" -#: wineconsole.rc:70 -msgid "&Control" -msgstr "" - -#: wineconsole.rc:71 -msgid "S&hift" -msgstr "S&hift" - #: wineconsole.rc:72 -msgid "Quick edit" -msgstr "" +#, fuzzy +#| msgid "&Remove application" +msgid "&Remove duplicates" +msgstr "&Ta bort program" -#: wineconsole.rc:73 -msgid "&enable" +#: wineconsole.rc:74 +msgid "Popup menu" msgstr "" #: wineconsole.rc:75 -msgid "Command history" -msgstr "Kommandohistorik" +msgid "&Control" +msgstr "" #: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "" +msgid "S&hift" +msgstr "S&hift" + +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Stäng konsoll" #: wineconsole.rc:79 -msgid "&Remove doubles" +msgid "&Quick Edit mode" msgstr "" -#: wineconsole.rc:87 +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "&Expertläge" + +#: wineconsole.rc:88 msgid "&Font" msgstr "&Typsnitt" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Färg" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Konfiguration" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Bredd:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Höjd:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Fönsterstorlek" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "B&redd:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "H&öjd:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Stäng konsoll" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Edition" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Konsollparametrar" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Spara dessa inställningar för följande sessioner" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Ändra enbart den aktuella sessionen" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/te.po wine-staging-1.7.48~ubuntu12.04.1/po/te.po --- wine-staging-1.7.47~ubuntu12.04.1/po/te.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/te.po 2015-07-29 19:28:54.000000000 +0000 @@ -63,7 +63,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -140,7 +140,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -511,7 +511,7 @@ msgid "&Source" msgstr "" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 #, fuzzy msgid "Font" msgstr "ఫాంట్... (&F)" @@ -8345,7 +8345,7 @@ msgid "&Move" msgstr "" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "" @@ -12887,99 +12887,99 @@ msgstr "" #: wineconsole.rc:68 -msgid "Control" +msgid "Command history" msgstr "" #: wineconsole.rc:69 -msgid "Popup menu" -msgstr "" - -#: wineconsole.rc:70 -msgid "&Control" -msgstr "" - -#: wineconsole.rc:71 -msgid "S&hift" +msgid "&Buffer size:" msgstr "" #: wineconsole.rc:72 -msgid "Quick edit" +msgid "&Remove duplicates" msgstr "" -#: wineconsole.rc:73 -msgid "&enable" +#: wineconsole.rc:74 +msgid "Popup menu" msgstr "" #: wineconsole.rc:75 -msgid "Command history" +msgid "&Control" msgstr "" #: wineconsole.rc:76 -msgid "&Number of recalled commands:" +msgid "S&hift" +msgstr "" + +#: wineconsole.rc:78 +msgid "Console" msgstr "" #: wineconsole.rc:79 -msgid "&Remove doubles" +msgid "&Quick Edit mode" +msgstr "" + +#: wineconsole.rc:80 +msgid "&Insert mode" msgstr "" -#: wineconsole.rc:87 +#: wineconsole.rc:88 #, fuzzy msgid "&Font" msgstr "ఫాంట్... (&F)" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/th.po wine-staging-1.7.48~ubuntu12.04.1/po/th.po --- wine-staging-1.7.47~ubuntu12.04.1/po/th.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/th.po 2015-07-29 19:28:54.000000000 +0000 @@ -64,7 +64,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -144,7 +144,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -512,7 +512,7 @@ msgid "&Source" msgstr "จาก" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "ต้วอักษร" @@ -8524,7 +8524,7 @@ msgid "&Move" msgstr "" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "" @@ -13149,105 +13149,105 @@ msgstr "" #: wineconsole.rc:68 -#, fuzzy -msgid "Control" -msgstr "เนื้อหา" +msgid "Command history" +msgstr "" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "" + +#: wineconsole.rc:72 +#, fuzzy +msgid "&Remove duplicates" +msgstr "ที่คั่นหนังสือ" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "" -#: wineconsole.rc:70 +#: wineconsole.rc:75 #, fuzzy msgid "&Control" msgstr "เนื้อหา" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "" - -#: wineconsole.rc:73 -msgid "&enable" +#: wineconsole.rc:78 +msgid "Console" msgstr "" -#: wineconsole.rc:75 -msgid "Command history" -msgstr "" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" +#: wineconsole.rc:79 +msgid "&Quick Edit mode" msgstr "" -#: wineconsole.rc:79 -msgid "&Remove doubles" +#: wineconsole.rc:80 +msgid "&Insert mode" msgstr "" -#: wineconsole.rc:87 +#: wineconsole.rc:88 #, fuzzy msgid "&Font" msgstr "ดัวอักษร" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "" -#: wineconsole.rc:100 +#: wineconsole.rc:101 #, fuzzy msgid "Configuration" msgstr "รายละเอียด" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 #, fuzzy msgid "&Height:" msgstr "ขวา:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 #, fuzzy msgid "H&eight:" msgstr "ขวา:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "" -#: wineconsole.rc:122 +#: wineconsole.rc:123 #, fuzzy msgid "Edition" msgstr "แก้ไข" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/tr.po wine-staging-1.7.48~ubuntu12.04.1/po/tr.po --- wine-staging-1.7.47~ubuntu12.04.1/po/tr.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/tr.po 2015-07-29 19:28:54.000000000 +0000 @@ -69,7 +69,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -152,7 +152,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -530,7 +530,7 @@ msgid "&Source" msgstr "&Kaynak" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Yazı Tipi" @@ -8568,7 +8568,7 @@ msgid "&Move" msgstr "&Taşı" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Boyutlandır" @@ -13514,98 +13514,108 @@ msgstr "&Büyük" #: wineconsole.rc:68 -msgid "Control" -msgstr "Denetim" +msgid "Command history" +msgstr "Komut geçmişi" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Tampon bölge" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "&Çiftleri sil" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Açılır menü" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Kontrol" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "&Kaydır" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Hızlı düzenle" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "&etkinleştir" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Komut geçmişi" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Konsolu kapat" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "&Çiftleri sil" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Hızlı düzenle" -#: wineconsole.rc:87 +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "&Uzman modu" + +#: wineconsole.rc:88 msgid "&Font" msgstr "&Yazı Tipi" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Renk" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Yapılandırma" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Tampon bölge" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Genişlik :" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Yükseklik :" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Pencere boyutu" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "&Genişlik :" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "&Yükseklik :" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Program sonu" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Konsolu kapat" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Yayın" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Konsol Ayarları" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Sonraki oturumlar için sakla" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Sadece geçerli oturuma uygula" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/uk.po wine-staging-1.7.48~ubuntu12.04.1/po/uk.po --- wine-staging-1.7.47~ubuntu12.04.1/po/uk.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/uk.po 2015-07-29 19:28:54.000000000 +0000 @@ -66,7 +66,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -149,7 +149,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -525,7 +525,7 @@ msgid "&Source" msgstr "&Джерело" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Шрифт" @@ -8587,7 +8587,7 @@ msgid "&Move" msgstr "&Пересунути" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "Роз&мір" @@ -13590,98 +13590,108 @@ msgstr "&Великий" #: wineconsole.rc:68 -msgid "Control" -msgstr "Керування" +msgid "Command history" +msgstr "Історія команд" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "Зона буфера" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "Видаляти &повтори" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "Спливаюче меню" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "Швидке редагування" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "вв&імкнути" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "Історія команд" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "&Кількість нагаданих команд:" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "&Закрити консоль" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "Видаляти &повтори" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "Швидке редагування" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "&Режим експерта" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "&Шрифт" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "&Колір" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "Конфігурація" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "Зона буфера" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "&Ширина:" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "&Висота:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "Розмір вікна" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "Ш&ирина:" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "Висо&та:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "Завершення програми" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "&Закрити консоль" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Випуск" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "Параметри консолі" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "Зберегти ці налаштування для наступних сесій" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "Змінювати лише поточну сесію" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/wa.po wine-staging-1.7.48~ubuntu12.04.1/po/wa.po --- wine-staging-1.7.47~ubuntu12.04.1/po/wa.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/wa.po 2015-07-29 19:28:54.000000000 +0000 @@ -67,7 +67,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -147,7 +147,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -520,7 +520,7 @@ msgid "&Source" msgstr "Ali&mentåcion" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "Fontes" @@ -8456,7 +8456,7 @@ msgid "&Move" msgstr "&Bodjî" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "&Grandeu" @@ -13050,43 +13050,43 @@ msgstr "" #: wineconsole.rc:68 -msgid "Control" +msgid "Command history" msgstr "" #: wineconsole.rc:69 +msgid "&Buffer size:" +msgstr "" + +#: wineconsole.rc:72 +#, fuzzy +msgid "&Remove duplicates" +msgstr "&Sicrîre..." + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "" -#: wineconsole.rc:72 -msgid "Quick edit" +#: wineconsole.rc:78 +msgid "Console" msgstr "" -#: wineconsole.rc:73 -msgid "&enable" -msgstr "" - -#: wineconsole.rc:75 -msgid "Command history" +#: wineconsole.rc:79 +msgid "&Quick Edit mode" msgstr "" -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" +#: wineconsole.rc:80 +msgid "&Insert mode" msgstr "" -#: wineconsole.rc:79 -#, fuzzy -msgid "&Remove doubles" -msgstr "&Sicrîre..." - -#: wineconsole.rc:87 +#: wineconsole.rc:88 #, fuzzy msgid "&Font" msgstr "" @@ -13095,62 +13095,62 @@ "#-#-#-#-# wa.po (Wine) #-#-#-#-#\n" "&Font..." -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 #, fuzzy msgid "&Height:" msgstr "&Droete:" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 #, fuzzy msgid "H&eight:" msgstr "&Droete:" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "" -#: wineconsole.rc:122 +#: wineconsole.rc:123 #, fuzzy msgid "Edition" msgstr "&Candjî" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/wine.pot wine-staging-1.7.48~ubuntu12.04.1/po/wine.pot --- wine-staging-1.7.47~ubuntu12.04.1/po/wine.pot 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/wine.pot 2015-07-29 19:28:54.000000000 +0000 @@ -59,7 +59,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -135,7 +135,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -501,7 +501,7 @@ msgid "&Source" msgstr "" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "" @@ -8290,7 +8290,7 @@ msgid "&Move" msgstr "" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "" @@ -12819,98 +12819,98 @@ msgstr "" #: wineconsole.rc:68 -msgid "Control" +msgid "Command history" msgstr "" #: wineconsole.rc:69 -msgid "Popup menu" -msgstr "" - -#: wineconsole.rc:70 -msgid "&Control" -msgstr "" - -#: wineconsole.rc:71 -msgid "S&hift" +msgid "&Buffer size:" msgstr "" #: wineconsole.rc:72 -msgid "Quick edit" +msgid "&Remove duplicates" msgstr "" -#: wineconsole.rc:73 -msgid "&enable" +#: wineconsole.rc:74 +msgid "Popup menu" msgstr "" #: wineconsole.rc:75 -msgid "Command history" +msgid "&Control" msgstr "" #: wineconsole.rc:76 -msgid "&Number of recalled commands:" +msgid "S&hift" +msgstr "" + +#: wineconsole.rc:78 +msgid "Console" msgstr "" #: wineconsole.rc:79 -msgid "&Remove doubles" +msgid "&Quick Edit mode" +msgstr "" + +#: wineconsole.rc:80 +msgid "&Insert mode" msgstr "" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/zh_CN.po wine-staging-1.7.48~ubuntu12.04.1/po/zh_CN.po --- wine-staging-1.7.47~ubuntu12.04.1/po/zh_CN.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/zh_CN.po 2015-07-29 19:28:54.000000000 +0000 @@ -62,7 +62,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -142,7 +142,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -512,7 +512,7 @@ msgid "&Source" msgstr "纸张来源(&S)" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "字体" @@ -8405,7 +8405,7 @@ msgid "&Move" msgstr "移动(&M)" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "大小(&S)" @@ -13025,98 +13025,108 @@ msgstr "大(&L)" #: wineconsole.rc:68 -msgid "Control" -msgstr "控制" +msgid "Command history" +msgstr "命令历史" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "缓冲区" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "删除连续相同的命令(&R)" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "弹出菜单" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Control" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "快速编辑" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "启用(&E)" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "命令历史" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "最大记录命令数(&N):" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "关闭控制台(&C)" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "删除连续相同的命令(&R)" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "快速编辑" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "专家模式(&E)" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "字体(&F)" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "颜色(&C)" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "配置" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "缓冲区" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "宽度(&W):" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "高度(&H):" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "窗口大小" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "宽度(&I):" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "高度(&E):" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "当程序退出后" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "关闭控制台(&C)" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "控制台参数" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "保留当前配置以便以后使用" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "仅修改当前会话" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/po/zh_TW.po wine-staging-1.7.48~ubuntu12.04.1/po/zh_TW.po --- wine-staging-1.7.47~ubuntu12.04.1/po/zh_TW.po 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/po/zh_TW.po 2015-07-29 19:28:54.000000000 +0000 @@ -65,7 +65,7 @@ #: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 #: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 #: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:134 +#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 #: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 #: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 #: wordpad.rc:249 @@ -146,7 +146,7 @@ #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 -#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:135 winefile.rc:132 +#: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 #: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 #: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 msgid "Cancel" @@ -517,7 +517,7 @@ msgid "&Source" msgstr "來源(&S)" -#: comdlg32.rc:249 wineconsole.rc:84 +#: comdlg32.rc:249 wineconsole.rc:85 msgid "Font" msgstr "字型" @@ -8505,7 +8505,7 @@ msgid "&Move" msgstr "移動(&M)" -#: user32.rc:32 user32.rc:45 wineconsole.rc:92 +#: user32.rc:32 user32.rc:45 wineconsole.rc:93 msgid "&Size" msgstr "大小(&S)" @@ -13599,98 +13599,108 @@ msgstr "大(&L)" #: wineconsole.rc:68 -msgid "Control" -msgstr "控制" +msgid "Command history" +msgstr "指令歷程" #: wineconsole.rc:69 +#, fuzzy +#| msgid "Buffer zone" +msgid "&Buffer size:" +msgstr "緩衝區域" + +#: wineconsole.rc:72 +#, fuzzy +#| msgid "&Remove doubles" +msgid "&Remove duplicates" +msgstr "刪除連續相同的指令(&R)" + +#: wineconsole.rc:74 msgid "Popup menu" msgstr "彈出功能表" -#: wineconsole.rc:70 +#: wineconsole.rc:75 msgid "&Control" msgstr "&Control" -#: wineconsole.rc:71 +#: wineconsole.rc:76 msgid "S&hift" msgstr "S&hift" -#: wineconsole.rc:72 -msgid "Quick edit" -msgstr "快速編輯" - -#: wineconsole.rc:73 -msgid "&enable" -msgstr "啟用(&E)" - -#: wineconsole.rc:75 -msgid "Command history" -msgstr "指令歷程" - -#: wineconsole.rc:76 -msgid "&Number of recalled commands:" -msgstr "最大記錄指令數(&N):" +#: wineconsole.rc:78 +#, fuzzy +#| msgid "&Close console" +msgid "Console" +msgstr "關閉虛擬終端(&C)" #: wineconsole.rc:79 -msgid "&Remove doubles" -msgstr "刪除連續相同的指令(&R)" +#, fuzzy +#| msgid "Quick edit" +msgid "&Quick Edit mode" +msgstr "快速編輯" + +#: wineconsole.rc:80 +#, fuzzy +#| msgid "&Expert mode" +msgid "&Insert mode" +msgstr "專家模式(&E)" -#: wineconsole.rc:87 +#: wineconsole.rc:88 msgid "&Font" msgstr "字型(&F)" -#: wineconsole.rc:89 +#: wineconsole.rc:90 msgid "&Color" msgstr "顏色(&C)" -#: wineconsole.rc:100 +#: wineconsole.rc:101 msgid "Configuration" msgstr "組態" -#: wineconsole.rc:103 +#: wineconsole.rc:104 msgid "Buffer zone" msgstr "緩衝區域" -#: wineconsole.rc:104 +#: wineconsole.rc:105 msgid "&Width:" msgstr "寬度(&W):" -#: wineconsole.rc:107 +#: wineconsole.rc:108 msgid "&Height:" msgstr "高度(&H):" -#: wineconsole.rc:111 +#: wineconsole.rc:112 msgid "Window size" msgstr "視窗大小" -#: wineconsole.rc:112 +#: wineconsole.rc:113 msgid "W&idth:" msgstr "寬度(&I):" -#: wineconsole.rc:115 +#: wineconsole.rc:116 msgid "H&eight:" msgstr "高度(&E):" -#: wineconsole.rc:119 +#: wineconsole.rc:120 msgid "End of program" msgstr "當程式結束後" -#: wineconsole.rc:120 +#: wineconsole.rc:121 msgid "&Close console" msgstr "關閉虛擬終端(&C)" -#: wineconsole.rc:122 +#: wineconsole.rc:123 msgid "Edition" msgstr "Edition" -#: wineconsole.rc:128 +#: wineconsole.rc:129 msgid "Console parameters" msgstr "虛擬終端執行參數" -#: wineconsole.rc:131 +#: wineconsole.rc:132 msgid "Retain these settings for later sessions" msgstr "保留當前配置以便下次使用" -#: wineconsole.rc:132 +#: wineconsole.rc:133 msgid "Modify only current session" msgstr "僅修改目前的工作階段" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/programs/net/net.c wine-staging-1.7.48~ubuntu12.04.1/programs/net/net.c --- wine-staging-1.7.47~ubuntu12.04.1/programs/net/net.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/programs/net/net.c 2015-07-29 19:28:54.000000000 +0000 @@ -220,8 +220,11 @@ { output_string(STRING_STOP_DEP, dependencies[counter].lpDisplayName); dependent_serviceHandle = OpenServiceW(SCManager, dependencies[counter].lpServiceName, SC_MANAGER_ALL_ACCESS); - if(dependent_serviceHandle) result = StopService(SCManager, dependent_serviceHandle); - CloseServiceHandle(dependent_serviceHandle); + if(dependent_serviceHandle) + { + result = StopService(SCManager, dependent_serviceHandle); + CloseServiceHandle(dependent_serviceHandle); + } if(!result) output_string(STRING_CANT_STOP, dependencies[counter].lpDisplayName); } } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/programs/notepad/main.c wine-staging-1.7.48~ubuntu12.04.1/programs/notepad/main.c --- wine-staging-1.7.47~ubuntu12.04.1/programs/notepad/main.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/programs/notepad/main.c 2015-07-29 19:28:54.000000000 +0000 @@ -76,7 +76,7 @@ { lstrcpyW(Globals.szFileName, szFileName); Globals.szFileTitle[0] = 0; - GetFileTitleW(szFileName, Globals.szFileTitle, sizeof(Globals.szFileTitle)); + GetFileTitleW(szFileName, Globals.szFileTitle, sizeof(Globals.szFileTitle) / sizeof(WCHAR)); Globals.encFile = enc; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/programs/wineconsole/dialog.c wine-staging-1.7.48~ubuntu12.04.1/programs/wineconsole/dialog.c --- wine-staging-1.7.47~ubuntu12.04.1/programs/wineconsole/dialog.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/programs/wineconsole/dialog.c 2015-07-29 19:28:54.000000000 +0000 @@ -76,6 +76,8 @@ SetDlgItemInt(hDlg, IDC_OPT_HIST_SIZE, di->config.history_size, FALSE); SendDlgItemMessageW(hDlg, IDC_OPT_HIST_NODOUBLE, BM_SETCHECK, (di->config.history_nodup) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessageW(hDlg, IDC_OPT_INSERT_MODE, BM_SETCHECK, + (di->config.insert_mode) ? BST_CHECKED : BST_UNCHECKED, 0); SendDlgItemMessageW(hDlg, IDC_OPT_CONF_CTRL, BM_SETCHECK, (di->config.menu_mask & MK_CONTROL) ? BST_CHECKED : BST_UNCHECKED, 0); SendDlgItemMessageW(hDlg, IDC_OPT_CONF_SHIFT, BM_SETCHECK, @@ -121,6 +123,9 @@ val = (IsDlgButtonChecked(hDlg, IDC_OPT_HIST_NODOUBLE) & BST_CHECKED) != 0; di->config.history_nodup = val; + val = (IsDlgButtonChecked(hDlg, IDC_OPT_INSERT_MODE) & BST_CHECKED) != 0; + di->config.insert_mode = val; + val = 0; if (IsDlgButtonChecked(hDlg, IDC_OPT_CONF_CTRL) & BST_CHECKED) val |= MK_CONTROL; if (IsDlgButtonChecked(hDlg, IDC_OPT_CONF_SHIFT) & BST_CHECKED) val |= MK_SHIFT; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/programs/wineconsole/wineconsole.c wine-staging-1.7.48~ubuntu12.04.1/programs/wineconsole/wineconsole.c --- wine-staging-1.7.47~ubuntu12.04.1/programs/wineconsole/wineconsole.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/programs/wineconsole/wineconsole.c 2015-07-29 19:28:54.000000000 +0000 @@ -150,6 +150,23 @@ } /****************************************************************** + * WINECON_SetInsertMode + * + * + */ +static void WINECON_SetInsertMode(HANDLE hConIn, unsigned int enable) +{ + DWORD mode; + + GetConsoleMode(hConIn, &mode); + if (enable) + mode |= ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS; + else + mode &= ~ENABLE_INSERT_MODE; + SetConsoleMode(hConIn, mode); +} + +/****************************************************************** * WINECON_GetConsoleTitle * * @@ -397,6 +414,11 @@ data->curcfg.history_nodup = cfg->history_nodup; WINECON_SetHistoryMode(data->hConIn, cfg->history_nodup); } + if (data->curcfg.insert_mode != cfg->insert_mode) + { + data->curcfg.insert_mode = cfg->insert_mode; + WINECON_SetInsertMode(data->hConIn, cfg->insert_mode); + } data->curcfg.menu_mask = cfg->menu_mask; data->curcfg.quick_edit = cfg->quick_edit; if (1 /* FIXME: font info has changed */) @@ -533,7 +555,8 @@ */ static BOOL WINECON_GetServerConfig(struct inner_data* data) { - BOOL ret; + BOOL ret; + DWORD mode; SERVER_START_REQ(get_console_input_info) { @@ -545,6 +568,11 @@ } SERVER_END_REQ; if (!ret) return FALSE; + + GetConsoleMode(data->hConIn, &mode); + data->curcfg.insert_mode = (mode & (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS)) == + (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS); + SERVER_START_REQ(get_console_output_info) { req->handle = wine_server_obj_handle( data->hConOut ); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/programs/wineconsole/wineconsole.rc wine-staging-1.7.48~ubuntu12.04.1/programs/wineconsole/wineconsole.rc --- wine-staging-1.7.47~ubuntu12.04.1/programs/wineconsole/wineconsole.rc 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/programs/wineconsole/wineconsole.rc 2015-07-29 19:28:54.000000000 +0000 @@ -54,31 +54,32 @@ END -IDD_OPTION DIALOG 36, 24, 140, 105 +IDD_OPTION DIALOG 36, 24, 140, 109 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Options" FONT 8, "MS Shell Dlg" { - GROUPBOX "Cursor size", -1, 5, 5, 65, 56, BS_GROUPBOX + GROUPBOX "Cursor size", -1, 5, 5, 70, 54, BS_GROUPBOX AUTORADIOBUTTON "&Small", IDC_OPT_CURSOR_SMALL, 9, 18, 50, 10, WS_TABSTOP AUTORADIOBUTTON "&Medium", IDC_OPT_CURSOR_MEDIUM, 9, 30, 50, 10, WS_TABSTOP AUTORADIOBUTTON "&Large", IDC_OPT_CURSOR_LARGE, 9, 42, 50, 10, WS_TABSTOP - GROUPBOX "Control", -1, 75, 5, 125, 56, BS_GROUPBOX - LTEXT "Popup menu", -1, 79, 18, 50, 18 - AUTOCHECKBOX "&Control", IDC_OPT_CONF_CTRL, 138, 18, 60, 10, WS_TABSTOP - AUTOCHECKBOX "S&hift", IDC_OPT_CONF_SHIFT, 138, 30, 60, 10, WS_TABSTOP - LTEXT "Quick edit", -1, 79, 42, 50, 18 - AUTOCHECKBOX "&enable", IDC_OPT_QUICK_EDIT, 138, 42, 60, 10, WS_TABSTOP - - GROUPBOX "Command history", -1, 5, 63, 195, 40, BS_GROUPBOX - LTEXT "&Number of recalled commands:", -1, 9, 75, 78, 18 - EDITTEXT IDC_OPT_HIST_SIZE, 87, 77, 31, 12, WS_TABSTOP|WS_BORDER|ES_NUMBER - CONTROL "", IDC_OPT_HIST_SIZE_UD, "msctls_updown32", UDS_SETBUDDYINT|UDS_ALIGNRIGHT|UDS_AUTOBUDDY|UDS_ARROWKEYS|UDS_NOTHOUSANDS, 0, 0, 0, 0 - AUTOCHECKBOX "&Remove doubles", IDC_OPT_HIST_NODOUBLE, 125, 75, 60, 18, WS_TABSTOP|BS_MULTILINE + GROUPBOX "Command history", -1, 80, 5, 120, 54, BS_GROUPBOX + LTEXT "&Buffer size:", -1, 84, 20, 70, 10 + EDITTEXT IDC_OPT_HIST_SIZE, 154, 18, 40, 12, WS_TABSTOP|WS_BORDER|ES_NUMBER + CONTROL "", IDC_OPT_HIST_SIZE_UD, "msctls_updown32", UDS_SETBUDDYINT|UDS_ALIGNRIGHT|UDS_AUTOBUDDY|UDS_ARROWKEYS|UDS_NOTHOUSANDS, 0, 0, 0, 0 + AUTOCHECKBOX "&Remove duplicates", IDC_OPT_HIST_NODOUBLE, 84, 36, 100, 10, WS_TABSTOP|BS_MULTILINE + + GROUPBOX "Popup menu", -1, 5, 61, 70, 42, BS_GROUPBOX + AUTOCHECKBOX "&Control", IDC_OPT_CONF_CTRL, 9, 74, 60, 10, WS_TABSTOP + AUTOCHECKBOX "S&hift", IDC_OPT_CONF_SHIFT, 9, 86, 60, 10, WS_TABSTOP + + GROUPBOX "Console", -1, 80, 61, 120, 42, BS_GROUPBOX + AUTOCHECKBOX "&Quick Edit mode", IDC_OPT_QUICK_EDIT, 84, 74, 100, 10, WS_TABSTOP + AUTOCHECKBOX "&Insert mode", IDC_OPT_INSERT_MODE, 84, 86, 100, 10, WS_TABSTOP } -IDD_FONT DIALOG 36, 24, 140, 105 +IDD_FONT DIALOG 36, 24, 140, 109 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Font" FONT 8, "MS Shell Dlg" @@ -94,7 +95,7 @@ LTEXT "", IDC_FNT_FONT_INFO, 128, 73, 80, 27 } -IDD_CONFIG DIALOG 36, 24, 140, 105 +IDD_CONFIG DIALOG 36, 24, 140, 109 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Configuration" FONT 8, "MS Shell Dlg" diff -Nru wine-staging-1.7.47~ubuntu12.04.1/programs/wineconsole/wineconsole_res.h wine-staging-1.7.48~ubuntu12.04.1/programs/wineconsole/wineconsole_res.h --- wine-staging-1.7.47~ubuntu12.04.1/programs/wineconsole/wineconsole_res.h 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/programs/wineconsole/wineconsole_res.h 2015-07-29 19:28:54.000000000 +0000 @@ -70,6 +70,7 @@ #define IDC_OPT_CONF_CTRL 0x0107 #define IDC_OPT_CONF_SHIFT 0x0108 #define IDC_OPT_QUICK_EDIT 0x0109 +#define IDC_OPT_INSERT_MODE 0x0110 #define IDC_FNT_LIST_FONT 0x0201 #define IDC_FNT_LIST_SIZE 0x0202 diff -Nru wine-staging-1.7.47~ubuntu12.04.1/programs/winedbg/gdbproxy.c wine-staging-1.7.48~ubuntu12.04.1/programs/winedbg/gdbproxy.c --- wine-staging-1.7.47~ubuntu12.04.1/programs/winedbg/gdbproxy.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/programs/winedbg/gdbproxy.c 2015-07-29 19:28:54.000000000 +0000 @@ -1400,13 +1400,12 @@ { int i; CONTEXT ctx; - CONTEXT* pctx = &gdbctx->context; assert(gdbctx->in_trap); if (dbg_curr_thread != gdbctx->other_thread && gdbctx->other_thread) { - if (!fetch_context(gdbctx, gdbctx->other_thread->handle, pctx = &ctx)) + if (!fetch_context(gdbctx, gdbctx->other_thread->handle, &ctx)) return packet_error; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/programs/wordpad/wordpad.c wine-staging-1.7.48~ubuntu12.04.1/programs/wordpad/wordpad.c --- wine-staging-1.7.47~ubuntu12.04.1/programs/wordpad/wordpad.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/programs/wordpad/wordpad.c 2015-07-29 19:28:54.000000000 +0000 @@ -1232,7 +1232,7 @@ if (pFr->lpstrFindWhat != custom_data->findBuffer) { lstrcpynW(custom_data->findBuffer, pFr->lpstrFindWhat, - sizeof(custom_data->findBuffer)); + sizeof(custom_data->findBuffer) / sizeof(WCHAR)); pFr->lpstrFindWhat = custom_data->findBuffer; } diff -Nru wine-staging-1.7.47~ubuntu12.04.1/README.md wine-staging-1.7.48~ubuntu12.04.1/README.md --- wine-staging-1.7.47~ubuntu12.04.1/README.md 2015-07-15 04:42:57.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/README.md 2015-07-29 19:51:42.000000000 +0000 @@ -39,7 +39,7 @@ Included bug fixes and improvements ----------------------------------- -**Bug fixes and features in Wine Staging 1.7.47 [230]:** +**Bug fixes and features in Wine Staging 1.7.48 [238]:** *Note: The following list only contains features and bug fixes which are not yet available in vanilla Wine. They are removed from the list as soon as they @@ -58,9 +58,8 @@ * Add shell32 placeholder icons to match offsets with Windows ([Wine Bug #30185](https://bugs.winehq.org/show_bug.cgi?id=30185)) * Add stub fltmgr.sys (filter manager driver) ([Wine Bug #23583](https://bugs.winehq.org/show_bug.cgi?id=23583)) * Add stub for D3DXComputeNormalMap -* Add stub for D3DXComputeTangentFrameEx ([Wine Bug #31984](https://bugs.winehq.org/show_bug.cgi?id=31984)) * Add stub for D3DXFrameFind ([Wine Bug #38334](https://bugs.winehq.org/show_bug.cgi?id=38334)) -* Add stub for D3DXIntersect +* Add stub for D3DXTessellateNPatches * Add stub for NtSetLdtEntries/ZwSetLdtEntries ([Wine Bug #26268](https://bugs.winehq.org/show_bug.cgi?id=26268)) * Add stub for gdiplus.GdipCreateEffect ([Wine Bug #32163](https://bugs.winehq.org/show_bug.cgi?id=32163)) * Add stub for ntoskrnl.ExAcquireResourceExclusiveLite @@ -74,17 +73,20 @@ * Add stub for winscard.SCardListReadersA/W ([Wine Bug #26978](https://bugs.winehq.org/show_bug.cgi?id=26978)) * Add stub for winsta.WinStationEnumerateW ([Wine Bug #38102](https://bugs.winehq.org/show_bug.cgi?id=38102)) * Add stubbed ISWbemSecurity interfaces in wbemdisp +* Add stubs for D3DCompile2 and D3DCompileFromFile * Add stubs for D3DXCreateAnimationController interface +* Add stubs for d3dx10_43.D3DX10CreateEffectFromFileA/W ([Wine Bug #27739](https://bugs.winehq.org/show_bug.cgi?id=27739)) * Add support for CopyFileEx progress callback ([Wine Bug #22692](https://bugs.winehq.org/show_bug.cgi?id=22692)) * Add support for GetPropValue to PulseAudio backend +* Add support for ThreadQuerySetWin32StartAddress info class ([Wine Bug #8277](https://bugs.winehq.org/show_bug.cgi?id=8277)) * Add support for hiding wine version information from applications ([Wine Bug #38656](https://bugs.winehq.org/show_bug.cgi?id=38656)) * Add support for process specific debug channels +* Add wined3d detection for GeForce GT 425M ([Wine Bug #35054](https://bugs.winehq.org/show_bug.cgi?id=35054)) * Adobe Reader needs ITextSelection_fnGetDuplicate implementation * Allow selection of audio device for PulseAudio backend * Allow special characters in pipe names ([Wine Bug #28995](https://bugs.winehq.org/show_bug.cgi?id=28995)) * Allow to cancel a file operation via progress callback ([Wine Bug #22690](https://bugs.winehq.org/show_bug.cgi?id=22690)) * Allow to edit winecfg library override by double clicking -* Allow to enable/disable InsertMode in wineconsole settings ([Wine Bug #38697](https://bugs.winehq.org/show_bug.cgi?id=38697)) * Allow to open files/directories without any access rights in order to query attributes * Allow to override number of quality levels for D3DMULTISAMPLE_NONMASKABLE. ([Wine Bug #12652](https://bugs.winehq.org/show_bug.cgi?id=12652)) * Allow to set pixel format for desktop window @@ -94,6 +96,7 @@ * Avoid crashing when broken app tries to release surface although refcount is zero ([Wine Bug #18477](https://bugs.winehq.org/show_bug.cgi?id=18477)) * Avoid race-conditions in NtReadFile() operations with write watches. * Avoid race-conditions of async WSARecv() operations with write watches. +* Avoid race-conditions with long running threadpool tasks * Avoid race-conditions with write watches in WS2_async_accept. * Avseq crashes when multisampling is enabled ([Wine Bug #31998](https://bugs.winehq.org/show_bug.cgi?id=31998)) * Basic handling of write watches triggered while we're on the signal stack. @@ -101,6 +104,7 @@ * Black & White needs DXTn software decoding support ([Wine Bug #14939](https://bugs.winehq.org/show_bug.cgi?id=14939)) * CPU-Z fails to start because GetLogicalProcessorInformationEx returns FALSE * Calculate msvcrt exponential math operations with higher precision ([Wine Bug #37149](https://bugs.winehq.org/show_bug.cgi?id=37149)) +* Check architecture before trying to load libraries ([Wine Bug #38021](https://bugs.winehq.org/show_bug.cgi?id=38021)) * Create HKLM\Software\Microsoft\Cryptography\MachineGuid registry key ([Wine Bug #38508](https://bugs.winehq.org/show_bug.cgi?id=38508)) * Create stub files for system32/drivers/etc/{services,hosts,networks,protocol} ([Wine Bug #12076](https://bugs.winehq.org/show_bug.cgi?id=12076)) * CreateProcess does not prioritize the working directory over the system search path ([Wine Bug #23934](https://bugs.winehq.org/show_bug.cgi?id=23934)) @@ -110,10 +114,11 @@ * Enforce that surfaces are flushed after ReleaseDC * Ensure NtProtectVirtualMemory and NtCreateSection are on separate pages ([Wine Bug #33162](https://bugs.winehq.org/show_bug.cgi?id=33162)) * Ensure X11 input events are handled even without explicit message loop ([Wine Bug #8854](https://bugs.winehq.org/show_bug.cgi?id=8854)) -* Ensure console InsertMode changes take effect immediately * Exception during start of fr-043 caused by missing DXTn support ([Wine Bug #37391](https://bugs.winehq.org/show_bug.cgi?id=37391)) +* Export additional OpenAL32 functions ([Wine Bug #38972](https://bugs.winehq.org/show_bug.cgi?id=38972)) * Expose PKEY_AudioEndpoint_PhysicalSpeakers device property in PulseAudio driver * FEAR 1 installer expects basic_string_wchar_dtor to return NULL ([Wine Bug #37358](https://bugs.winehq.org/show_bug.cgi?id=37358)) +* Fake success in kernel32.SetFileCompletionNotificationModes ([Wine Bug #38960](https://bugs.winehq.org/show_bug.cgi?id=38960)) * Fallback to system ping command when CAP_NET_RAW is not available ([Wine Bug #8332](https://bugs.winehq.org/show_bug.cgi?id=8332)) * Fix NULL dereference in ICSeqCompressFrameStart ([Wine Bug #27595](https://bugs.winehq.org/show_bug.cgi?id=27595)) * Fix caps lock state issues with multiple processes ([Wine Bug #35907](https://bugs.winehq.org/show_bug.cgi?id=35907)) @@ -137,6 +142,7 @@ * Fix handling of opening read-only files for FILE_DELETE_ON_CLOSE ([Wine Bug #38417](https://bugs.winehq.org/show_bug.cgi?id=38417)) * Fix handling of window attributes for WS_EX_LAYERED | WS_EX_COMPOSITED ([Wine Bug #37876](https://bugs.winehq.org/show_bug.cgi?id=37876)) * Fix issues with dragging layers between images in Adobe Photoshop 7.0 ([Wine Bug #12007](https://bugs.winehq.org/show_bug.cgi?id=12007)) +* Fix loading of libraries with incomplete IMAGE_LOAD_CONFIG_DIRECTORY struct * Fix missing video introduced by pixelformat changes. ([Wine Bug #36900](https://bugs.winehq.org/show_bug.cgi?id=36900)) * Fix multithreading issues with fullscreen clipping ([Wine Bug #38087](https://bugs.winehq.org/show_bug.cgi?id=38087)) * Fix possible segfault in pulse_rd_loop of PulseAudio backend @@ -144,6 +150,7 @@ * Fix regression caused by blacklisting supported OpenGL extensions ([Wine Bug #38480](https://bugs.winehq.org/show_bug.cgi?id=38480)) * Fix return value of ScrollWindowEx for invisible windows ([Wine Bug #37706](https://bugs.winehq.org/show_bug.cgi?id=37706)) * Fix scaling behaviour of images and mipmap levels in IDirect3DTexture2_Load (needed for example by Prezzie Hunt) +* Fix security cookie handling for UPX compressed executables ([Wine Bug #38949](https://bugs.winehq.org/show_bug.cgi?id=38949)) * Fix texture corruption in CSI: Fatal Conspiracy ([Wine Bug #33768](https://bugs.winehq.org/show_bug.cgi?id=33768)) * Fix unintentional leaks with ntdll internals * Fix wined3d performance drop introduced by pixelformat changes. ([Wine Bug #35655](https://bugs.winehq.org/show_bug.cgi?id=35655)) @@ -151,15 +158,15 @@ * Fix wrong defition of ntoskrnl.IoReleaseCancelSpinLock function. * Fix wrong version of ID3DXEffect interface for d3dx9_24 * Fix wrong version of ID3DXEffect interface for d3dx9_25 ([Wine Bug #25138](https://bugs.winehq.org/show_bug.cgi?id=25138)) -* Forward GIF encoder requests to windowscodecs ([Wine Bug #34356](https://bugs.winehq.org/show_bug.cgi?id=34356)) +* Forward exitcode from child process when in wineconsole * Free RPC parameters allocated by application before anything else ([Wine Bug #36743](https://bugs.winehq.org/show_bug.cgi?id=36743)) * GetMessage should remove already seen messages with higher priority ([Wine Bug #28884](https://bugs.winehq.org/show_bug.cgi?id=28884)) * GetMonitorInfo returns the same name for all monitors ([Wine Bug #37709](https://bugs.winehq.org/show_bug.cgi?id=37709)) * GetSecurityInfo returns NULL DACL for process object ([Wine Bug #15980](https://bugs.winehq.org/show_bug.cgi?id=15980)) * Globally invalidate key state on changes in other threads ([Wine Bug #29871](https://bugs.winehq.org/show_bug.cgi?id=29871)) * Graphical issues in Inquisitor ([Wine Bug #32490](https://bugs.winehq.org/show_bug.cgi?id=32490)) -* Ignore garbage after decoding gif lines ([Wine Bug #32227](https://bugs.winehq.org/show_bug.cgi?id=32227)) * Ignore unsupported flags for CoInternetSetFeatureEnabled ([Wine Bug #35197](https://bugs.winehq.org/show_bug.cgi?id=35197)) +* Implement AMStream GetMultiMediaStream functions ([Wine Bug #37090](https://bugs.winehq.org/show_bug.cgi?id=37090)) * Implement D3DXGetShaderOutputSemantics * Implement DDENUMSURFACES_CANBECREATED in IDirectDraw7::EnumSurfaces ([Wine Bug #17233](https://bugs.winehq.org/show_bug.cgi?id=17233)) * Implement ID3DXEffect::FindNextValidTechnique ([Wine Bug #34101](https://bugs.winehq.org/show_bug.cgi?id=34101)) @@ -167,6 +174,7 @@ * Implement a Microsoft Yahei replacement font ([Wine Bug #13829](https://bugs.winehq.org/show_bug.cgi?id=13829)) * Implement an Arial replacement font ([Wine Bug #32323](https://bugs.winehq.org/show_bug.cgi?id=32323)) * Implement combase.WindowsSubstring function +* Implement dbghelp.UnDecorateSymbolNameW ([Wine Bug #38828](https://bugs.winehq.org/show_bug.cgi?id=38828)) * Implement default homepage button in inetcpl.cpl * Implement empty enumerator for IWiaDevMgr::EnumDeviceInfo ([Wine Bug #27775](https://bugs.winehq.org/show_bug.cgi?id=27775)) * Implement exclusive mode in PulseAudio backend ([Wine Bug #37042](https://bugs.winehq.org/show_bug.cgi?id=37042)) @@ -188,7 +196,6 @@ * Improve stubs for AEV_{Get,Set}MasterVolumeLevel * Improve stubs for AEV_{Get,Set}Mute * Improvement for heap allocation performance -* Increase buffer size in widl/typegen.c to avoid buffer overflow ([Wine Bug #37129](https://bugs.winehq.org/show_bug.cgi?id=37129)) * Initialize *lpcDevices in RasEnumDevicesA ([Wine Bug #30378](https://bugs.winehq.org/show_bug.cgi?id=30378)) * Initialize System\CurrentControlSet\Control\TimeZoneInformation registry keys * Jedi Knight: Dark Forces II crashes with winmm set to native ([Wine Bug #37983](https://bugs.winehq.org/show_bug.cgi?id=37983)) @@ -198,7 +205,6 @@ * MediaCoder needs CUDA for video encoding ([Wine Bug #37664](https://bugs.winehq.org/show_bug.cgi?id=37664)) * Multiple applications need EnumDisplayDevicesW implementation ([Wine Bug #34978](https://bugs.winehq.org/show_bug.cgi?id=34978)) * Multiple applications needs better NtQueryInformationJobObject stub -* Multiple applications start wrong executable if whitespace present in name ([Wine Bug #19666](https://bugs.winehq.org/show_bug.cgi?id=19666)) * Need for Speed 3 installer requires devices in HKEY_DYN_DATA ([Wine Bug #7115](https://bugs.winehq.org/show_bug.cgi?id=7115)) * Only send WM_DROPFILES when OLE dnd fails ([Wine Bug #29081](https://bugs.winehq.org/show_bug.cgi?id=29081)) * Other Pipelight-specific enhancements @@ -210,21 +216,22 @@ * Return an error when trying to open a terminated process ([Wine Bug #37087](https://bugs.winehq.org/show_bug.cgi?id=37087)) * Return correct IMediaSeeking stream positions in quartz * Return correct values for GetThreadTimes function ([Wine Bug #20230](https://bugs.winehq.org/show_bug.cgi?id=20230)) -* Return default palette entries from GetSystemPaletteEntries for non-palette-based devices +* Return default palette entries from GetSystemPaletteEntries for non-palette-based devices ([Wine Bug #36895](https://bugs.winehq.org/show_bug.cgi?id=36895)) +* Return dummy ID3DXSkinInfo interface when skinning info not present ([Wine Bug #33904](https://bugs.winehq.org/show_bug.cgi?id=33904)) * Return fake device type when systemroot is located on virtual disk ([Wine Bug #36546](https://bugs.winehq.org/show_bug.cgi?id=36546)) * Return proper status codes when NtReadFile/NtWriteFile is called on closed (but not disconnected) pipe -* Revert patch causing crash in IrfanView when using the WebP plugin ([Wine Bug #38895](https://bugs.winehq.org/show_bug.cgi?id=38895)) * SO_CONNECT_TIME returns the appropriate time * Scrolling causes mouse and screen to lock in Call to Power II ([Wine Bug #34559](https://bugs.winehq.org/show_bug.cgi?id=34559)) -* SecuROM 5.x media validation fails ([Wine Bug #21448](https://bugs.winehq.org/show_bug.cgi?id=21448)) * Send WM_PAINT event during dialog creation ([Wine Bug #35652](https://bugs.winehq.org/show_bug.cgi?id=35652)) * Set NamedPipeState to FILE_PIPE_CLOSING_STATE on broken pipe in NtQueryInformationFile +* Share source of d3dx9_36 with d3dx9_33 to avoid Wine DLL forwards ([Wine Bug #21817](https://bugs.winehq.org/show_bug.cgi?id=21817)) * Show unmounted devices in winecfg and allow changing the unix path +* Silence repeated LocaleNameToLCID/LCIDToLocaleName unsupported flags FIXMEs ([Wine Bug #30076](https://bugs.winehq.org/show_bug.cgi?id=30076)) * Silence repeated wbemprox "timeout not supported" fixme ([Wine Bug #37618](https://bugs.winehq.org/show_bug.cgi?id=37618)) * Skip unknown item when decoding a CMS certificate ([Wine Bug #34388](https://bugs.winehq.org/show_bug.cgi?id=34388)) * Software support for Environmental Audio Extensions (EAX) +* Store registry timestamps with nanoseconds precision ([Wine Bug #38927](https://bugs.winehq.org/show_bug.cgi?id=38927)) * Super Mario 3: Mario Forever fails to load keyboard mapping from profile files. ([Wine Bug #18099](https://bugs.winehq.org/show_bug.cgi?id=18099)) -* Support for 8bpp grayscale TIFF images with 8bpp alpha channel ([Wine Bug #38027](https://bugs.winehq.org/show_bug.cgi?id=38027)) * Support for AllocateAndGetTcpExTableFromStack ([Wine Bug #34372](https://bugs.winehq.org/show_bug.cgi?id=34372)) * Support for BindImageEx ([Wine Bug #3591](https://bugs.winehq.org/show_bug.cgi?id=3591)) * Support for CSMT (command stream) to increase graphic performance ([Wine Bug #11674](https://bugs.winehq.org/show_bug.cgi?id=11674)) @@ -271,6 +278,7 @@ * Use POSIX implementation to enumerate directory content on FreeBSD ([Wine Bug #35397](https://bugs.winehq.org/show_bug.cgi?id=35397)) * Use actual program name if available to describe PulseAudio streams * Use manual relay for RunDLL_CallEntry16 in shell32 ([Wine Bug #23033](https://bugs.winehq.org/show_bug.cgi?id=23033)) +* Use video memory for rendering targets if possible ([Wine Bug #34906](https://bugs.winehq.org/show_bug.cgi?id=34906)) * Voobly expects correct handling of WRITECOPY memory protection ([Wine Bug #29384](https://bugs.winehq.org/show_bug.cgi?id=29384)) * Wine ignores IDF_CHECKFIRST flag in SetupPromptForDisk ([Wine Bug #20465](https://bugs.winehq.org/show_bug.cgi?id=20465)) * Workaround for shlwapi URLs with relative paths diff -Nru wine-staging-1.7.47~ubuntu12.04.1/server/device.c wine-staging-1.7.48~ubuntu12.04.1/server/device.c --- wine-staging-1.7.47~ubuntu12.04.1/server/device.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/server/device.c 2015-07-29 19:28:54.000000000 +0000 @@ -242,7 +242,7 @@ release_object( irp->async ); } if (irp->file) release_object( irp->file ); - release_object( irp->thread ); + if (irp->thread) release_object( irp->thread ); } static struct irp_call *create_irp( struct device_file *file, const irp_params_t *params, @@ -337,14 +337,14 @@ if (device->manager) list_remove( &device->entry ); } -static void add_irp_to_queue( struct device_file *file, struct irp_call *irp ) +static void add_irp_to_queue( struct device_file *file, struct irp_call *irp, struct thread *thread ) { struct device_manager *manager = file->device->manager; assert( manager ); grab_object( irp ); /* grab reference for queued irp */ - irp->thread = (struct thread *)grab_object( current ); + irp->thread = thread ? (struct thread *)grab_object( thread ) : NULL; list_add_tail( &file->requests, &irp->dev_entry ); list_add_tail( &manager->requests, &irp->mgr_entry ); if (list_head( &manager->requests ) == &irp->mgr_entry) wake_up( &manager->obj, 0 ); /* first one */ @@ -391,7 +391,7 @@ if ((irp = create_irp( file, ¶ms, NULL, 0, 0 ))) { - add_irp_to_queue( file, irp ); + add_irp_to_queue( file, irp, NULL ); release_object( irp ); } } @@ -426,7 +426,7 @@ if ((irp = create_irp( file, ¶ms, NULL, 0, 0 ))) { - add_irp_to_queue( file, irp ); + add_irp_to_queue( file, irp, NULL ); release_object( irp ); } } @@ -497,7 +497,7 @@ return 0; } irp->user_arg = async_data->arg; - add_irp_to_queue( file, irp ); + add_irp_to_queue( file, irp, current ); set_error( STATUS_PENDING ); return handle; } @@ -772,9 +772,12 @@ if ((ptr = list_head( &manager->requests ))) { irp = LIST_ENTRY( ptr, struct irp_call, mgr_entry ); + if (irp->thread) + { + reply->client_pid = get_process_id( irp->thread->process ); + reply->client_tid = get_thread_id( irp->thread ); + } reply->params = irp->params; - reply->client_pid = get_process_id( irp->thread->process ); - reply->client_tid = get_thread_id( irp->thread ); reply->in_size = irp->in_size; reply->out_size = irp->out_size; if (irp->in_size > get_reply_max_size()) set_error( STATUS_BUFFER_OVERFLOW ); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/server/process.c wine-staging-1.7.48~ubuntu12.04.1/server/process.c --- wine-staging-1.7.47~ubuntu12.04.1/server/process.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/server/process.c 2015-07-29 19:28:54.000000000 +0000 @@ -140,6 +140,7 @@ static struct object_type *job_get_type( struct object *obj ); static int job_signaled( struct object *obj, struct wait_queue_entry *entry ); static unsigned int job_map_access( struct object *obj, unsigned int access ); +static int job_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); static void job_destroy( struct object *obj ); struct job @@ -170,7 +171,7 @@ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ no_open_file, /* open_file */ - no_close_handle, /* close_handle */ + job_close_handle, /* close_handle */ job_destroy /* destroy */ }; @@ -287,6 +288,19 @@ wake_up( &job->obj, 0 ); } +static int job_close_handle( struct object *obj, struct process *process, obj_handle_t handle ) +{ + struct job *job = (struct job *)obj; + assert( obj->ops == &job_ops ); + + if (obj->handle_count == 1) /* last handle */ + { + if (job->limit_flags & JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE) + terminate_job( job, 0 ); + } + return 1; +} + static void job_destroy( struct object *obj ) { struct job *job = (struct job *)obj; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/server/thread.c wine-staging-1.7.48~ubuntu12.04.1/server/thread.c --- wine-staging-1.7.47~ubuntu12.04.1/server/thread.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/server/thread.c 2015-07-29 19:28:54.000000000 +0000 @@ -601,6 +601,7 @@ wait->count = count; wait->flags = flags; wait->select = select_op->op; + wait->cookie = 0; wait->user = NULL; wait->timeout = timeout; wait->abandoned = 0; @@ -719,7 +720,7 @@ cookie = thread->wait->cookie; if (debug_level) fprintf( stderr, "%04x: *wakeup* signaled=%d\n", thread->id, signaled ); end_wait( thread ); - if (send_thread_wakeup( thread, cookie, signaled ) == -1) /* error */ + if (cookie && send_thread_wakeup( thread, cookie, signaled ) == -1) /* error */ { if (!count) count = -1; break; @@ -749,7 +750,7 @@ if (debug_level) fprintf( stderr, "%04x: *wakeup* signaled=%d\n", thread->id, signaled ); end_wait( thread ); - if (send_thread_wakeup( thread, cookie, signaled ) != -1) + if (!cookie || send_thread_wakeup( thread, cookie, signaled ) != -1) wake_thread( thread ); /* check other waits too */ return 1; @@ -768,6 +769,8 @@ if (debug_level) fprintf( stderr, "%04x: *wakeup* signaled=TIMEOUT\n", thread->id ); end_wait( thread ); + + assert( cookie ); if (send_thread_wakeup( thread, cookie, STATUS_TIMEOUT ) == -1) return; /* check if other objects have become signaled in the meantime */ wake_thread( thread ); @@ -1429,6 +1432,12 @@ set_error( STATUS_INVALID_PARAMETER ); return; } + if (!req->cookie) + { + set_error( STATUS_INVALID_PARAMETER ); + return; + } + op_size = min( get_req_data_size() - sizeof(*result), sizeof(select_op) ); memset( &select_op, 0, sizeof(select_op) ); memcpy( &select_op, result + 1, op_size ); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/server/token.c wine-staging-1.7.48~ubuntu12.04.1/server/token.c --- wine-staging-1.7.47~ubuntu12.04.1/server/token.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/server/token.c 2015-07-29 19:28:54.000000000 +0000 @@ -848,7 +848,7 @@ /* fail if desired_access contains generic rights */ if (desired_access & (GENERIC_READ|GENERIC_WRITE|GENERIC_EXECUTE|GENERIC_ALL)) { - *priv_count = 0; + if (priv_count) *priv_count = 0; return STATUS_GENERIC_NOT_MAPPED; } @@ -856,14 +856,14 @@ owner = sd_get_owner( sd ); if (!owner || !sd_get_group( sd )) { - *priv_count = 0; + if (priv_count) *priv_count = 0; return STATUS_INVALID_SECURITY_DESCR; } /* 1: Grant desired access if the object is unprotected */ if (!dacl_present || !dacl) { - *priv_count = 0; + if (priv_count) *priv_count = 0; *granted_access = desired_access; return *status = STATUS_SUCCESS; } @@ -899,7 +899,7 @@ } else { - *priv_count = 0; + if (priv_count) *priv_count = 0; *status = STATUS_PRIVILEGE_NOT_HELD; return STATUS_SUCCESS; } @@ -1002,8 +1002,7 @@ { GENERIC_MAPPING mapping; struct token *token = current->token ? current->token : current->process->token; - LUID_AND_ATTRIBUTES priv; - unsigned int status, priv_count = 1; + unsigned int status; int res; mapping.GenericAll = obj->ops->map_access( obj, GENERIC_ALL ); @@ -1019,7 +1018,7 @@ mapping.GenericWrite = obj->ops->map_access( obj, GENERIC_WRITE ); mapping.GenericExecute = obj->ops->map_access( obj, GENERIC_EXECUTE ); - res = token_access_check( token, obj->sd, *access, &priv, &priv_count, + res = token_access_check( token, obj->sd, *access, NULL, NULL, &mapping, access, &status ) == STATUS_SUCCESS && status == STATUS_SUCCESS; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/tools/widl/header.c wine-staging-1.7.48~ubuntu12.04.1/tools/widl/header.c --- wine-staging-1.7.47~ubuntu12.04.1/tools/widl/header.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/tools/widl/header.c 2015-07-29 19:28:54.000000000 +0000 @@ -937,8 +937,18 @@ if (method == 2) { const expr_t *expr = get_attrp(arg->attrs, ATTR_DEFAULTVALUE); if (expr) { - fprintf(h, " = "); - write_expr( h, expr, 0, 1, NULL, NULL, "" ); + const var_t *tail_arg; + + /* Output default value only if all following arguments also have default value. */ + LIST_FOR_EACH_ENTRY_REV( tail_arg, args, const var_t, entry ) { + if(tail_arg == arg) { + fprintf(h, " = "); + write_expr( h, expr, 0, 1, NULL, NULL, "" ); + break; + } + if(!get_attrp(tail_arg->attrs, ATTR_DEFAULTVALUE)) + break; + } } } count++; diff -Nru wine-staging-1.7.47~ubuntu12.04.1/tools/widl/typegen.c wine-staging-1.7.48~ubuntu12.04.1/tools/widl/typegen.c --- wine-staging-1.7.47~ubuntu12.04.1/tools/widl/typegen.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/tools/widl/typegen.c 2015-07-29 19:28:54.000000000 +0000 @@ -1142,7 +1142,7 @@ static unsigned int write_new_procformatstring_type(FILE *file, int indent, const var_t *var, int is_return, unsigned int *stack_offset) { - char buffer[64]; + char buffer[128]; unsigned int stack_size, typestring_offset; unsigned short flags; unsigned char fc = get_parameter_fc( var, is_return, &flags, &stack_size, &typestring_offset ); diff -Nru wine-staging-1.7.47~ubuntu12.04.1/tools/widl/write_msft.c wine-staging-1.7.48~ubuntu12.04.1/tools/widl/write_msft.c --- wine-staging-1.7.47~ubuntu12.04.1/tools/widl/write_msft.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/tools/widl/write_msft.c 2015-07-29 19:28:54.000000000 +0000 @@ -1267,7 +1267,7 @@ any default value. */ static int get_defaultvalue_vt(type_t *type) { - int vt = get_type_vt(type); + int vt; if (type_get_type(type) == TYPE_ENUM) vt = VT_I4; else diff -Nru wine-staging-1.7.47~ubuntu12.04.1/tools/winebuild/parser.c wine-staging-1.7.48~ubuntu12.04.1/tools/winebuild/parser.c --- wine-staging-1.7.47~ubuntu12.04.1/tools/winebuild/parser.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/tools/winebuild/parser.c 2015-07-29 19:28:54.000000000 +0000 @@ -603,6 +603,7 @@ { if (!strcmp( odp->name, "DllRegisterServer" ) || !strcmp( odp->name, "DllUnregisterServer" ) || + !strcmp( odp->name, "DllMain" ) || !strcmp( odp->name, "DllGetClassObject" ) || !strcmp( odp->name, "DllGetVersion" ) || !strcmp( odp->name, "DllInstall" ) || diff -Nru wine-staging-1.7.47~ubuntu12.04.1/tools/winedump/main.c wine-staging-1.7.48~ubuntu12.04.1/tools/winedump/main.c --- wine-staging-1.7.47~ubuntu12.04.1/tools/winedump/main.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/tools/winedump/main.c 2015-07-29 19:28:54.000000000 +0000 @@ -228,7 +228,7 @@ {"-C", DUMP, 0, do_symdmngl, "-C Turn on symbol demangling"}, {"-f", DUMP, 0, do_dumphead, "-f Dump file header information"}, {"-G", DUMP, 0, do_rawdebug, "-G Dump raw debug information"}, - {"-j", DUMP, 1, do_dumpsect, "-j Dump only the content of section 'sect_name' (import, export, debug, resource, tls, clr, reloc, except)"}, + {"-j", DUMP, 1, do_dumpsect, "-j Dump only the content of section 'sect_name' (import, export, debug, resource, tls, loadcfg, clr, reloc, except)"}, {"-t", DUMP, 0, do_symtable, "-t Dump symbol table"}, {"-x", DUMP, 0, do_dumpall, "-x Dump everything"}, {NULL, NONE, 0, NULL, NULL} diff -Nru wine-staging-1.7.47~ubuntu12.04.1/tools/winedump/pe.c wine-staging-1.7.48~ubuntu12.04.1/tools/winedump/pe.c --- wine-staging-1.7.47~ubuntu12.04.1/tools/winedump/pe.c 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/tools/winedump/pe.c 2015-07-29 19:28:54.000000000 +0000 @@ -1266,6 +1266,52 @@ printf("\n"); } +static void dump_dir_loadconfig(void) +{ + const IMAGE_LOAD_CONFIG_DIRECTORY32 *loadcfg32 = get_dir(IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG); + const IMAGE_LOAD_CONFIG_DIRECTORY64 *loadcfg64 = (void*)loadcfg32; + + if (!loadcfg32) return; + + printf( "Loadconfig\n" ); + print_dword( "Size", loadcfg32->Size ); + print_dword( "TimeDateStamp", loadcfg32->TimeDateStamp ); + print_word( "MajorVersion", loadcfg32->MajorVersion ); + print_word( "MinorVersion", loadcfg32->MinorVersion ); + print_dword( "GlobalFlagsClear", loadcfg32->GlobalFlagsClear ); + print_dword( "GlobalFlagsSet", loadcfg32->GlobalFlagsSet ); + print_dword( "CriticalSectionDefaultTimeout", loadcfg32->CriticalSectionDefaultTimeout ); + + if(PE_nt_headers->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) + { + print_longlong( "DeCommitFreeBlockThreshold", loadcfg64->DeCommitFreeBlockThreshold ); + print_longlong( "DeCommitTotalFreeThreshold", loadcfg64->DeCommitTotalFreeThreshold ); + print_longlong( "MaximumAllocationSize", loadcfg64->MaximumAllocationSize ); + print_longlong( "VirtualMemoryThreshold", loadcfg64->VirtualMemoryThreshold ); + print_dword( "ProcessHeapFlags", loadcfg64->ProcessHeapFlags ); + print_longlong( "ProcessAffinityMask", loadcfg64->ProcessAffinityMask ); + print_word( "CSDVersion", loadcfg64->CSDVersion ); + print_word( "Reserved", loadcfg64->Reserved1 ); + print_longlong( "SecurityCookie", loadcfg64->SecurityCookie ); + print_longlong( "SEHandlerTable", loadcfg64->SEHandlerTable ); + print_longlong( "SEHandlerCount", loadcfg64->SEHandlerCount ); + } + else + { + print_dword( "DeCommitFreeBlockThreshold", loadcfg32->DeCommitFreeBlockThreshold ); + print_dword( "DeCommitTotalFreeThreshold", loadcfg32->DeCommitTotalFreeThreshold ); + print_dword( "MaximumAllocationSize", loadcfg32->MaximumAllocationSize ); + print_dword( "VirtualMemoryThreshold", loadcfg32->VirtualMemoryThreshold ); + print_dword( "ProcessHeapFlags", loadcfg32->ProcessHeapFlags ); + print_dword( "ProcessAffinityMask", loadcfg32->ProcessAffinityMask ); + print_word( "CSDVersion", loadcfg32->CSDVersion ); + print_word( "Reserved", loadcfg32->Reserved1 ); + print_dword( "SecurityCookie", loadcfg32->SecurityCookie ); + print_dword( "SEHandlerTable", loadcfg32->SEHandlerTable ); + print_dword( "SEHandlerCount", loadcfg32->SEHandlerCount ); + } +} + static void dump_dir_delay_imported_functions(void) { unsigned directorySize; @@ -1930,6 +1976,8 @@ dump_dir_resource(); if (all || !strcmp(globals.dumpsect, "tls")) dump_dir_tls(); + if (all || !strcmp(globals.dumpsect, "loadcfg")) + dump_dir_loadconfig(); if (all || !strcmp(globals.dumpsect, "clr")) dump_dir_clr_header(); if (all || !strcmp(globals.dumpsect, "reloc")) diff -Nru wine-staging-1.7.47~ubuntu12.04.1/VERSION wine-staging-1.7.48~ubuntu12.04.1/VERSION --- wine-staging-1.7.47~ubuntu12.04.1/VERSION 2015-07-15 04:26:20.000000000 +0000 +++ wine-staging-1.7.48~ubuntu12.04.1/VERSION 2015-07-29 19:28:54.000000000 +0000 @@ -1 +1 @@ -Wine version 1.7.47 +Wine version 1.7.48