diff --git a/README.md b/README.md index 4919f54c..4a933004 100644 --- a/README.md +++ b/README.md @@ -83,11 +83,11 @@ Included bug fixes and improvements * Do not fail when a used context is passed to wglShareLists ([Wine Bug #11436](https://bugs.winehq.org/show_bug.cgi?id=11436)) * Don't fill KdHelp structure for usermode applications ([Wine Bug #37272](https://bugs.winehq.org/show_bug.cgi?id=37272)) * Emulate access to KI_USER_SHARED_DATA kernel page on x86_64 ([Wine Bug #33849](https://bugs.winehq.org/show_bug.cgi?id=33849)) -* Emulate write to CR4 register ([Wine Bug #30220](https://bugs.winehq.org/show_bug.cgi?id=30220)) +* ~~Emulate write to CR4 register~~ ([Wine Bug #30220](https://bugs.winehq.org/show_bug.cgi?id=30220)) * Ensure NtProtectVirtualMemory and NtCreateSection are on separate pages ([Wine Bug #33162](https://bugs.winehq.org/show_bug.cgi?id=33162)) * Exception during start of fr-043 caused by missing DXTn support ([Wine Bug #37391](https://bugs.winehq.org/show_bug.cgi?id=37391)) * FEAR 1 installer expects basic_string_wchar_dtor to return NULL ([Wine Bug #37358](https://bugs.winehq.org/show_bug.cgi?id=37358)) -* FairplayKD.sys needs KeSetSystemAffinityThread ([Wine Bug #36822](https://bugs.winehq.org/show_bug.cgi?id=36822)) +* ~~FairplayKD.sys needs KeSetSystemAffinityThread~~ ([Wine Bug #36822](https://bugs.winehq.org/show_bug.cgi?id=36822)) * Fix black screen on startup introduced by pixelformat changes. ([Wine Bug #35950](https://bugs.winehq.org/show_bug.cgi?id=35950)) * Fix comparison of punctuation characters in lstrcmp ([Wine Bug #10767](https://bugs.winehq.org/show_bug.cgi?id=10767)) * Fix condition mask handling in RtlVerifyVersionInfo ([Wine Bug #36143](https://bugs.winehq.org/show_bug.cgi?id=36143)) diff --git a/debian/changelog b/debian/changelog index 3ff64032..18101fc8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,8 @@ wine-staging (1.7.34) UNRELEASED; urgency=low * Added patch to fix parameters for ConvertToIndexedBlendedMesh stub. * Added patch for basic CUDA support. * Added patches for D3DXComputeNormals and D3DXComputeNormalMap. + * Removed patch to emulate write to CR4 register (accepted upstream). + * Removed patch with stub for KeSetSystemAffinityThread (accepted upstream). * Removed patch to implement combase HSTRING objects (accepted upstream). * Removed patch to add fake ProductId to registry (accepted upstream). * Removed patch to implement stubs for MFStartup and MFShutdown (accepted upstream). diff --git a/patches/Makefile b/patches/Makefile index 1d932921..a290fb00 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -88,9 +88,7 @@ PATCHLIST := \ ntdll-WinSqm.ok \ ntoskrnl-Emulator.ok \ ntoskrnl-Irp_Status.ok \ - ntoskrnl-KeSetSystemAffinityThread.ok \ ntoskrnl-Stub_FileObject.ok \ - ntoskrnl-Write_CR4.ok \ nvcuda-CUDA_Support.ok \ ole32-CoWaitForMultipleHandles.ok \ quartz-MediaSeeking_Positions.ok \ @@ -1385,21 +1383,6 @@ ntoskrnl-Irp_Status.ok: echo '+ { "Sebastian Lackner", "ntoskrnl: Handle issues when driver returns two different status codes from dispatcher.", 1 },'; \ ) > ntoskrnl-Irp_Status.ok -# Patchset ntoskrnl-KeSetSystemAffinityThread -# | -# | This patchset fixes the following Wine bugs: -# | * [#36822] FairplayKD.sys needs KeSetSystemAffinityThread -# | -# | Modified files: -# | * dlls/ntoskrnl.exe/ntoskrnl.c, dlls/ntoskrnl.exe/ntoskrnl.exe.spec -# | -.INTERMEDIATE: ntoskrnl-KeSetSystemAffinityThread.ok -ntoskrnl-KeSetSystemAffinityThread.ok: - $(call APPLY_FILE,ntoskrnl-KeSetSystemAffinityThread/0001-ntoskrnl-Add-stub-for-KeSetSystemAffinityThread.patch) - @( \ - echo '+ { "Michael Müller", "ntoskrnl: Add stub for KeSetSystemAffinityThread.", 1 },'; \ - ) > ntoskrnl-KeSetSystemAffinityThread.ok - # Patchset ntoskrnl-Stub_FileObject # | # | This patchset fixes the following Wine bugs: @@ -1415,21 +1398,6 @@ ntoskrnl-Stub_FileObject.ok: echo '+ { "Sebastian Lackner", "ntoskrnl: Initialize irp.Tail.Overlay.OriginalFileObject with stub file object.", 1 },'; \ ) > ntoskrnl-Stub_FileObject.ok -# Patchset ntoskrnl-Write_CR4 -# | -# | This patchset fixes the following Wine bugs: -# | * [#30220] Emulate write to CR4 register -# | -# | Modified files: -# | * dlls/ntoskrnl.exe/instr.c -# | -.INTERMEDIATE: ntoskrnl-Write_CR4.ok -ntoskrnl-Write_CR4.ok: - $(call APPLY_FILE,ntoskrnl-Write_CR4/0001-ntoskrnl.exe-Emulate-write-to-CR4-register.patch) - @( \ - echo '+ { "Stefan Leichter", "ntoskrnl.exe: Emulate write to CR4 register.", 1 },'; \ - ) > ntoskrnl-Write_CR4.ok - # Patchset nvcuda-CUDA_Support # | # | Modified files: @@ -2028,8 +1996,8 @@ winecfg-Staging.ok: ntdll-DllRedirects.ok wined3d-CSMT_Main.ok # | # | 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/volume.c, dlls/wined3d/wined3d.spec, -# | dlls/wined3d/wined3d_private.h, include/wine/wined3d.h +# | 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 # | .INTERMEDIATE: wined3d-CSMT_Helper.ok wined3d-CSMT_Helper.ok: makedep-PARENTSPEC.ok wined3d-DXTn.ok diff --git a/patches/ntoskrnl-KeSetSystemAffinityThread/0001-ntoskrnl-Add-stub-for-KeSetSystemAffinityThread.patch b/patches/ntoskrnl-KeSetSystemAffinityThread/0001-ntoskrnl-Add-stub-for-KeSetSystemAffinityThread.patch deleted file mode 100644 index a1fb52b3..00000000 --- a/patches/ntoskrnl-KeSetSystemAffinityThread/0001-ntoskrnl-Add-stub-for-KeSetSystemAffinityThread.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 85771b3079ab71a2e4e4a81e7ed3e1f6f63e93ef Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Wed, 5 Nov 2014 05:06:06 +0100 -Subject: ntoskrnl: Add stub for KeSetSystemAffinityThread. - ---- - dlls/ntoskrnl.exe/ntoskrnl.c | 9 +++++++++ - dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- - 2 files changed, 10 insertions(+), 1 deletion(-) - -diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c -index a31b186..8d3e3c6 100644 ---- a/dlls/ntoskrnl.exe/ntoskrnl.c -+++ b/dlls/ntoskrnl.exe/ntoskrnl.c -@@ -1404,6 +1404,15 @@ KPRIORITY WINAPI KeSetPriorityThread( PKTHREAD Thread, KPRIORITY Priority ) - - - /*********************************************************************** -+ * KeSetSystemAffinityThread (NTOSKRNL.EXE.@) -+ */ -+VOID WINAPI KeSetSystemAffinityThread( KAFFINITY affinity ) -+{ -+ FIXME("(%lx)\n", affinity); -+} -+ -+ -+/*********************************************************************** - * KeWaitForSingleObject (NTOSKRNL.EXE.@) - */ - NTSTATUS WINAPI KeWaitForSingleObject(PVOID Object, -diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec -index 4ead907..356c3a3 100644 ---- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec -+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec -@@ -614,7 +614,7 @@ - @ stub KeSetKernelStackSwapEnable - @ stdcall KeSetPriorityThread(ptr long) - @ stub KeSetProfileIrql --@ stub KeSetSystemAffinityThread -+@ stdcall KeSetSystemAffinityThread(long) - @ stub KeSetTargetProcessorDpc - @ stub KeSetTimeIncrement - @ stub KeSetTimer --- -1.9.1 - diff --git a/patches/ntoskrnl-KeSetSystemAffinityThread/definition b/patches/ntoskrnl-KeSetSystemAffinityThread/definition deleted file mode 100644 index 0f4925d1..00000000 --- a/patches/ntoskrnl-KeSetSystemAffinityThread/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [36822] FairplayKD.sys needs KeSetSystemAffinityThread diff --git a/patches/ntoskrnl-Write_CR4/0001-ntoskrnl.exe-Emulate-write-to-CR4-register.patch b/patches/ntoskrnl-Write_CR4/0001-ntoskrnl.exe-Emulate-write-to-CR4-register.patch deleted file mode 100644 index feadb2c5..00000000 --- a/patches/ntoskrnl-Write_CR4/0001-ntoskrnl.exe-Emulate-write-to-CR4-register.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0f039e31e5e405a94ddc907bffc796886a53c9b1 Mon Sep 17 00:00:00 2001 -From: Stefan Leichter -Date: Fri, 31 Oct 2014 07:30:03 +0100 -Subject: ntoskrnl.exe: Emulate write to CR4 register. - ---- - dlls/ntoskrnl.exe/instr.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/dlls/ntoskrnl.exe/instr.c b/dlls/ntoskrnl.exe/instr.c -index 85ab9eb..e545269 100644 ---- a/dlls/ntoskrnl.exe/instr.c -+++ b/dlls/ntoskrnl.exe/instr.c -@@ -319,9 +319,14 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) - TRACE("mov eax,cr0 at 0x%08x, EAX=0x%08x\n", context->Eip,context->Eax ); - context->Eip += prefixlen+3; - return ExceptionContinueExecution; -+ case 0xe0: -+ TRACE("mov eax,cr4 at 0x%08x, EAX=0x%08x\n", context->Eip,context->Eax ); -+ context->Eip += prefixlen+3; -+ return ExceptionContinueExecution; - default: - break; /*fallthrough to bad instruction handling */ - } -+ ERR("Unsupported CR register, eip+2 is %02x\n", instr[2]); - break; /*fallthrough to bad instruction handling */ - case 0x20: /* mov crX, eax */ - switch (instr[2]) --- -2.1.2 - diff --git a/patches/ntoskrnl-Write_CR4/definition b/patches/ntoskrnl-Write_CR4/definition deleted file mode 100644 index 71ac9727..00000000 --- a/patches/ntoskrnl-Write_CR4/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [30220] Emulate write to CR4 register diff --git a/patches/riched20-IText_Interface/0002-riched20-Stub-for-ITextFont-interface-and-implement-.patch b/patches/riched20-IText_Interface/0002-riched20-Stub-for-ITextFont-interface-and-implement-.patch index d79b3a46..9a3c8838 100644 --- a/patches/riched20-IText_Interface/0002-riched20-Stub-for-ITextFont-interface-and-implement-.patch +++ b/patches/riched20-IText_Interface/0002-riched20-Stub-for-ITextFont-interface-and-implement-.patch @@ -1,4 +1,4 @@ -From ef430ec89085a9d089de21871329c7cac5a5eea2 Mon Sep 17 00:00:00 2001 +From 8f95372e011674226be25a4456db6dd2952da804 Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Mon, 11 Aug 2014 13:51:55 +0800 Subject: riched20: Stub for ITextFont interface and implement @@ -10,7 +10,7 @@ Subject: riched20: Stub for ITextFont interface and implement 2 files changed, 893 insertions(+), 4 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c -index 8b5f2ba..6cc4b09 100644 +index 276c795..df43621 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -46,10 +46,12 @@ DEFINE_GUID(IID_ITextHost2, 0x13e670f5,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0x @@ -46,7 +46,24 @@ index 8b5f2ba..6cc4b09 100644 struct ITextRangeImpl { ITextRange ITextRange_iface; LONG ref; -@@ -481,6 +494,744 @@ static const IRichEditOleVtbl revt = { +@@ -145,6 +158,7 @@ static ULONG WINAPI IRichEditOleImpl_inner_fnRelease(IUnknown *iface) + if (!ref) + { + ITextRangeImpl *txtRge; ++ ITextFontImpl *txtFont; + + TRACE("Destroying %p\n", This); + This->txtSel->reOle = NULL; +@@ -153,6 +167,8 @@ static ULONG WINAPI IRichEditOleImpl_inner_fnRelease(IUnknown *iface) + IOleClientSite_Release(&This->clientSite->IOleClientSite_iface); + LIST_FOR_EACH_ENTRY(txtRge, &This->rangelist, ITextRangeImpl, entry) + txtRge->reOle = NULL; ++ LIST_FOR_EACH_ENTRY(txtFont, &This->fontlist, ITextFontImpl, entry) ++ txtFont->reOle = NULL; + heap_free(This); + } + return ref; +@@ -492,6 +508,744 @@ static const IRichEditOleVtbl revt = { IRichEditOle_fnImportDataObject }; @@ -791,7 +808,7 @@ index 8b5f2ba..6cc4b09 100644 /* ITextRange interface */ static inline ITextRangeImpl *impl_from_ITextRange(ITextRange *iface) { -@@ -733,14 +1484,42 @@ static HRESULT WINAPI ITextRange_fnSetEnd(ITextRange *me, LONG cpLim) +@@ -744,14 +1498,42 @@ static HRESULT WINAPI ITextRange_fnSetEnd(ITextRange *me, LONG cpLim) return range_SetEnd(This->reOle->editor, cpLim, &This->start, &This->end); } @@ -836,7 +853,7 @@ index 8b5f2ba..6cc4b09 100644 } static HRESULT WINAPI ITextRange_fnSetFont(ITextRange *me, ITextFont *pFont) -@@ -1754,11 +2533,24 @@ static HRESULT WINAPI ITextSelection_fnSetEnd(ITextSelection *me, LONG cpLim) +@@ -1765,11 +2547,24 @@ static HRESULT WINAPI ITextSelection_fnSetEnd(ITextSelection *me, LONG cpLim) static HRESULT WINAPI ITextSelection_fnGetFont(ITextSelection *me, ITextFont **pFont) { ITextSelectionImpl *This = impl_from_ITextSelection(me); @@ -863,7 +880,7 @@ index 8b5f2ba..6cc4b09 100644 } static HRESULT WINAPI ITextSelection_fnSetFont(ITextSelection *me, ITextFont *pFont) -@@ -2392,6 +3184,7 @@ LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *p +@@ -2403,6 +3198,7 @@ LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *p } TRACE("Created %p\n",reo); list_init(&reo->rangelist); @@ -871,23 +888,6 @@ index 8b5f2ba..6cc4b09 100644 if (outer_unk) reo->outer_unk = outer_unk; else -@@ -2405,6 +3198,7 @@ void DestroyIRichEditOle(IRichEditOle *iface) - { - IRichEditOleImpl *This = impl_from_IRichEditOle(iface); - ITextRangeImpl *txtRge; -+ ITextFontImpl *txtFont; - - TRACE("Destroying %p\n", This); - This->txtSel->reOle = NULL; -@@ -2413,6 +3207,8 @@ void DestroyIRichEditOle(IRichEditOle *iface) - IOleClientSite_Release(&This->clientSite->IOleClientSite_iface); - LIST_FOR_EACH_ENTRY(txtRge, &This->rangelist, ITextRangeImpl, entry) - txtRge->reOle = NULL; -+ LIST_FOR_EACH_ENTRY(txtFont, &This->fontlist, ITextFontImpl, entry) -+ txtFont->reOle = NULL; - heap_free(This); - } - diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index 2268211..e9618d8 100644 --- a/dlls/riched20/tests/richole.c @@ -1005,5 +1005,5 @@ index 2268211..e9618d8 100644 + test_ITextRange_GetFont(); } -- -2.1.2 +1.9.1 diff --git a/patches/riched20-IText_Interface/0003-riched20-Stub-for-ITextPara-interface-and-implement-.patch b/patches/riched20-IText_Interface/0003-riched20-Stub-for-ITextPara-interface-and-implement-.patch index 68a56c73..fd9e19dc 100644 --- a/patches/riched20-IText_Interface/0003-riched20-Stub-for-ITextPara-interface-and-implement-.patch +++ b/patches/riched20-IText_Interface/0003-riched20-Stub-for-ITextPara-interface-and-implement-.patch @@ -1,4 +1,4 @@ -From ad5c4b52d44704ff75e0706ce0e2aaa3859f6f29 Mon Sep 17 00:00:00 2001 +From 19911f4b2960e524c1701273c9460d281643d03c Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Sun, 10 Aug 2014 22:17:57 +0800 Subject: riched20: Stub for ITextPara interface and implement @@ -10,7 +10,7 @@ Subject: riched20: Stub for ITextPara interface and implement 2 files changed, 729 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c -index 6cc4b09..76fc51d 100644 +index df43621..f98f147 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -47,11 +47,13 @@ DEFINE_GUID(IID_ITextDocument, 0x8cc497c0, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xa @@ -47,7 +47,24 @@ index 6cc4b09..76fc51d 100644 struct ITextFontImpl { ITextFont ITextFont_iface; LONG ref; -@@ -494,6 +507,641 @@ static const IRichEditOleVtbl revt = { +@@ -159,6 +172,7 @@ static ULONG WINAPI IRichEditOleImpl_inner_fnRelease(IUnknown *iface) + { + ITextRangeImpl *txtRge; + ITextFontImpl *txtFont; ++ ITextParaImpl *txtPara; + + TRACE("Destroying %p\n", This); + This->txtSel->reOle = NULL; +@@ -169,6 +183,8 @@ static ULONG WINAPI IRichEditOleImpl_inner_fnRelease(IUnknown *iface) + txtRge->reOle = NULL; + LIST_FOR_EACH_ENTRY(txtFont, &This->fontlist, ITextFontImpl, entry) + txtFont->reOle = NULL; ++ LIST_FOR_EACH_ENTRY(txtPara, &This->paralist, ITextParaImpl, entry) ++ txtPara->reOle = NULL; + heap_free(This); + } + return ref; +@@ -508,6 +524,641 @@ static const IRichEditOleVtbl revt = { IRichEditOle_fnImportDataObject }; @@ -689,7 +706,7 @@ index 6cc4b09..76fc51d 100644 /* ITextFont interface */ static inline ITextFontImpl *impl_from_ITextFont(ITextFont *iface) { -@@ -1532,14 +2180,42 @@ static HRESULT WINAPI ITextRange_fnSetFont(ITextRange *me, ITextFont *pFont) +@@ -1546,14 +2197,42 @@ static HRESULT WINAPI ITextRange_fnSetFont(ITextRange *me, ITextFont *pFont) return E_NOTIMPL; } @@ -734,7 +751,7 @@ index 6cc4b09..76fc51d 100644 } static HRESULT WINAPI ITextRange_fnSetPara(ITextRange *me, ITextPara *pPara) -@@ -3185,6 +3861,7 @@ LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *p +@@ -3199,6 +3878,7 @@ LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *p TRACE("Created %p\n",reo); list_init(&reo->rangelist); list_init(&reo->fontlist); @@ -742,23 +759,6 @@ index 6cc4b09..76fc51d 100644 if (outer_unk) reo->outer_unk = outer_unk; else -@@ -3199,6 +3876,7 @@ void DestroyIRichEditOle(IRichEditOle *iface) - IRichEditOleImpl *This = impl_from_IRichEditOle(iface); - ITextRangeImpl *txtRge; - ITextFontImpl *txtFont; -+ ITextParaImpl *txtPara; - - TRACE("Destroying %p\n", This); - This->txtSel->reOle = NULL; -@@ -3209,6 +3887,8 @@ void DestroyIRichEditOle(IRichEditOle *iface) - txtRge->reOle = NULL; - LIST_FOR_EACH_ENTRY(txtFont, &This->fontlist, ITextFontImpl, entry) - txtFont->reOle = NULL; -+ LIST_FOR_EACH_ENTRY(txtPara, &This->paralist, ITextParaImpl, entry) -+ txtPara->reOle = NULL; - heap_free(This); - } - diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index e9618d8..909d27e 100644 --- a/dlls/riched20/tests/richole.c @@ -823,5 +823,5 @@ index e9618d8..909d27e 100644 + test_ITextRange_GetPara(); } -- -2.1.2 +1.9.1 diff --git a/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch b/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch index 50045184..6903dd3c 100644 --- a/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch +++ b/patches/wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch @@ -1,4 +1,4 @@ -From e40fbe3feb09e745a7cb95413b23f3087a2859af Mon Sep 17 00:00:00 2001 +From 366b6fe7fb45ebe1010417aedfa3dfab9cd6360b 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. @@ -7,14 +7,15 @@ Subject: wined3d: Merge get_pitch functions. dlls/ddraw/surface.c | 12 ++++++-- dlls/wined3d/resource.c | 31 +++++++++++++++++++ dlls/wined3d/surface.c | 70 +++++++++++++++++------------------------- - dlls/wined3d/volume.c | 29 ++--------------- + dlls/wined3d/texture.c | 2 +- + dlls/wined3d/volume.c | 28 ++--------------- dlls/wined3d/wined3d.spec | 2 +- dlls/wined3d/wined3d_private.h | 2 +- include/wine/wined3d.h | 3 +- - 7 files changed, 74 insertions(+), 75 deletions(-) + 8 files changed, 75 insertions(+), 75 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c -index a4184b8..a0d7f2d 100644 +index a387d12..9a8d94f 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -6158,6 +6158,10 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, stru @@ -96,7 +97,7 @@ index 0ab55dc..8032a4c 100644 + TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); +} diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 092cbe6..d9b1846 100644 +index fb27c8a..3ffec05 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) @@ -164,19 +165,20 @@ index 092cbe6..d9b1846 100644 POINT p; TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n", -@@ -1698,9 +1700,9 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1698,10 +1700,10 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P wined3d_texture_bind(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); -- surface_upload_data(dst_surface, gl_info, src_format, src_rect, src_pitch, dst_point, FALSE, &data); -+ surface_upload_data(dst_surface, gl_info, src_format, src_rect, src_row_pitch, dst_point, FALSE, &data); + 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_invalidate_active_texture(context); -@@ -2008,25 +2010,6 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface) +@@ -2009,25 +2011,6 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface) return WINED3D_OK; } @@ -202,7 +204,7 @@ index 092cbe6..d9b1846 100644 HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y) { LONG w, h; -@@ -2207,12 +2190,13 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -2208,12 +2191,13 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; valid_location = WINED3D_LOCATION_USER_MEMORY; } @@ -219,7 +221,7 @@ index 092cbe6..d9b1846 100644 else surface->resource.size = wined3d_format_calculate_size(texture_resource->format, texture_resource->device->surface_alignment, width, height, 1); -@@ -2680,7 +2664,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2681,7 +2665,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) map_desc->row_pitch = surface->resource.width * format->byte_count; else @@ -228,7 +230,7 @@ index 092cbe6..d9b1846 100644 map_desc->slice_pitch = 0; if (!rect) -@@ -2860,7 +2844,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2861,7 +2845,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. */ @@ -239,7 +241,7 @@ index 092cbe6..d9b1846 100644 if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) goto error; -@@ -4092,7 +4078,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4093,7 +4079,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; @@ -248,7 +250,7 @@ index 092cbe6..d9b1846 100644 struct wined3d_bo_address data; struct wined3d_format format; POINT dst_point = {0, 0}; -@@ -4187,7 +4173,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4188,7 +4174,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, else surface->flags &= ~SFLAG_GLCKEY; width = surface->resource.width; @@ -257,7 +259,7 @@ index 092cbe6..d9b1846 100644 format = *texture->resource.format; if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) -@@ -4226,9 +4212,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4227,9 +4213,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, context_release(context); return E_OUTOFMEMORY; } @@ -269,7 +271,7 @@ index 092cbe6..d9b1846 100644 data.addr = mem; } else if (conversion) -@@ -4248,13 +4234,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4249,14 +4235,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } if (texture->swapchain && texture->swapchain->palette) palette = texture->swapchain->palette; @@ -281,21 +283,34 @@ index 092cbe6..d9b1846 100644 data.addr = mem; } -- surface_upload_data(surface, gl_info, &format, &src_rect, src_pitch, &dst_point, srgb, &data); -+ surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, &data); + 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 d33bad1..0a8a550 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -1340,7 +1340,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(&volume->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 58d7321..af99825 100644 +index b5ab862..87b6ab6 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -40,31 +40,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) +@@ -40,30 +40,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) return TRUE; } --static void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, -- UINT *slice_pitch) +-void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch) -{ - const struct wined3d_format *format = volume->resource.format; - @@ -321,17 +336,17 @@ index 58d7321..af99825 100644 - /* Context activation is done by the caller. */ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, - const struct wined3d_bo_address *data) -@@ -95,7 +70,7 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine + const struct wined3d_const_bo_address *data) +@@ -95,7 +71,7 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine dst_row_pitch = (dst_row_pitch + alignment - 1) & ~(alignment - 1); 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); - mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth); - format->convert(data->addr, mem, src_row_pitch, src_slice_pitch, -@@ -638,7 +613,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, + converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth); + format->convert(data->addr, converted_mem, src_row_pitch, src_slice_pitch, +@@ -638,7 +614,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, } else { @@ -361,10 +376,10 @@ index 7a77003..95885c7 100644 @ cdecl wined3d_surface_get_resource(ptr) @ cdecl wined3d_surface_getdc(ptr ptr) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7935a5d..abd8d2b 100644 +index 047946b..d3af1c0 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2080,6 +2080,7 @@ struct wined3d_resource +@@ -2091,6 +2091,7 @@ struct wined3d_resource UINT size; DWORD priority; void *heap_memory; @@ -372,7 +387,7 @@ index 7935a5d..abd8d2b 100644 struct list resource_list_entry; void *parent; -@@ -2298,7 +2299,6 @@ struct wined3d_surface +@@ -2314,7 +2315,6 @@ struct wined3d_surface DWORD flags; @@ -381,10 +396,10 @@ index 7935a5d..abd8d2b 100644 UINT pow2Height; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h -index 0cf26e1..3d24b98 100644 +index 6e06388..cd8fd28 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h -@@ -2411,6 +2411,8 @@ static inline HRESULT wined3d_private_store_set_private_data(struct wined3d_priv +@@ -2418,6 +2418,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); @@ -393,7 +408,7 @@ index 0cf26e1..3d24b98 100644 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); -@@ -2468,7 +2470,6 @@ HRESULT __cdecl wined3d_surface_get_blt_status(const struct wined3d_surface *sur +@@ -2475,7 +2477,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); @@ -402,5 +417,5 @@ index 0cf26e1..3d24b98 100644 struct wined3d_surface *render_target); struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface); -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_load_texture.patch b/patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_load_texture.patch index 8d565d48..597b33ec 100644 --- a/patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_load_texture.patch +++ b/patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_load_texture.patch @@ -1,4 +1,4 @@ -From c47fbee59422dcccdf545d9ca1a37eba75e7ef92 Mon Sep 17 00:00:00 2001 +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. @@ -8,10 +8,10 @@ Subject: wined3d: Pass a context to surface_load_texture. 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index ee6cfdd..b37dca9 100644 +index 92fe15c..6c291ad 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -4130,13 +4130,13 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, +@@ -4275,13 +4275,13 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, } static HRESULT surface_load_texture(struct wined3d_surface *surface, @@ -27,7 +27,7 @@ index ee6cfdd..b37dca9 100644 UINT width, src_row_pitch, src_slice_pitch, dst_pitch; struct wined3d_bo_address data; struct wined3d_format format; -@@ -4158,8 +4158,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -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)) { @@ -36,7 +36,7 @@ index ee6cfdd..b37dca9 100644 if (srgb) surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect); -@@ -4167,8 +4165,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -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); @@ -45,7 +45,7 @@ index ee6cfdd..b37dca9 100644 return WINED3D_OK; } -@@ -4183,10 +4179,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -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}; @@ -56,7 +56,7 @@ index ee6cfdd..b37dca9 100644 return WINED3D_OK; } -@@ -4224,9 +4218,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4369,9 +4363,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, surface_load_location(surface, WINED3D_LOCATION_SYSMEM); } @@ -66,16 +66,16 @@ index ee6cfdd..b37dca9 100644 wined3d_texture_prepare_texture(texture, context, srgb); wined3d_texture_bind_and_dirtify(texture, context, srgb); -@@ -4307,8 +4298,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - - surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, &data); +@@ -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; -@@ -4330,7 +4319,6 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct +@@ -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; @@ -83,7 +83,7 @@ index ee6cfdd..b37dca9 100644 HRESULT hr; struct wined3d_context *context = NULL; -@@ -4410,7 +4398,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) +@@ -4556,7 +4544,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) case WINED3D_LOCATION_TEXTURE_RGB: case WINED3D_LOCATION_TEXTURE_SRGB: @@ -96,5 +96,5 @@ index ee6cfdd..b37dca9 100644 break; -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch b/patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch index 8d7eefc0..90339fef 100644 --- a/patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch +++ b/patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch @@ -1,4 +1,4 @@ -From 98ce21ea2f7c29d885b7dcf5b36819f8d977c5a5 Mon Sep 17 00:00:00 2001 +From b947c724e3227d812a7e60f1a845b2e5c2d7ec09 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. @@ -9,11 +9,11 @@ Subject: wined3d: Store volume locations in the resource. 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index af99825..ea56b38 100644 +index 87b6ab6..62eb5ed 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -101,15 +101,15 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine - static void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) +@@ -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; @@ -32,7 +32,7 @@ index af99825..ea56b38 100644 } /* Context activation is done by the caller. */ -@@ -217,9 +217,9 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -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), @@ -44,7 +44,7 @@ index af99825..ea56b38 100644 { TRACE("Location(s) already up to date.\n"); return; -@@ -242,32 +242,32 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -243,32 +243,32 @@ 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"); @@ -57,13 +57,13 @@ index af99825..ea56b38 100644 - else if (volume->locations & WINED3D_LOCATION_SYSMEM) + else if (volume->resource.locations & WINED3D_LOCATION_SYSMEM) { - struct wined3d_bo_address data = {0, volume->resource.heap_memory}; + struct wined3d_const_bo_address data = {0, volume->resource.heap_memory}; wined3d_volume_upload_data(volume, context, &data); } - else if (volume->locations & WINED3D_LOCATION_BUFFER) + else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) { - struct wined3d_bo_address data = {volume->pbo, NULL}; + struct wined3d_const_bo_address data = {volume->pbo, NULL}; wined3d_volume_upload_data(volume, context, &data); } - else if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB) @@ -83,7 +83,7 @@ index af99825..ea56b38 100644 return; } wined3d_volume_validate_location(volume, location); -@@ -281,16 +281,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -282,16 +282,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"); @@ -103,7 +103,7 @@ index af99825..ea56b38 100644 wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -301,7 +301,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -302,7 +302,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, else { FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n", @@ -112,7 +112,7 @@ index af99825..ea56b38 100644 return; } wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); -@@ -311,16 +311,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -312,16 +312,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"); @@ -132,7 +132,7 @@ index af99825..ea56b38 100644 wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -330,7 +330,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -331,7 +331,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, else { FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n", @@ -141,7 +141,7 @@ index af99825..ea56b38 100644 return; } wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER); -@@ -338,7 +338,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -339,7 +339,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, default: FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location), @@ -150,7 +150,7 @@ index af99825..ea56b38 100644 } } -@@ -595,7 +595,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -596,7 +596,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, { wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM); } @@ -159,7 +159,7 @@ index af99825..ea56b38 100644 { context = context_acquire(device, NULL); wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM); -@@ -743,7 +743,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture +@@ -744,7 +744,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture } volume->texture_level = level; @@ -169,7 +169,7 @@ index af99825..ea56b38 100644 if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC && gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index f24808b..57a048f 100644 +index 78406a4..004969d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -5,7 +5,7 @@ @@ -181,7 +181,7 @@ index f24808b..57a048f 100644 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public -@@ -2082,6 +2082,7 @@ struct wined3d_resource +@@ -2093,6 +2093,7 @@ struct wined3d_resource void *heap_memory; UINT custom_row_pitch, custom_slice_pitch; struct list resource_list_entry; @@ -189,7 +189,7 @@ index f24808b..57a048f 100644 void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2236,7 +2237,7 @@ struct wined3d_volume +@@ -2250,7 +2251,7 @@ struct wined3d_volume struct wined3d_resource resource; struct wined3d_texture *container; @@ -199,5 +199,5 @@ index f24808b..57a048f 100644 DWORD download_count; GLuint pbo; -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch b/patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch index 33f09bf1..2b51b38b 100644 --- a/patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch +++ b/patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch @@ -1,19 +1,20 @@ -From 8b7f33e2323fa2acac3722c3a8a753b7a8f11db2 Mon Sep 17 00:00:00 2001 +From 8f5ecefe9fba62e68e71b8931b94a658e4b32602 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 | 2 +- dlls/wined3d/volume.c | 19 ++++++------------- - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 14 insertions(+), 13 deletions(-) + dlls/wined3d/wined3d_private.h | 2 +- + 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 8032a4c..bac15c0 100644 +index 7594a0d..dd80490 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -332,6 +332,13 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) +@@ -335,6 +335,13 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB; } @@ -27,15 +28,28 @@ index 8032a4c..bac15c0 100644 void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, UINT *slice_pitch) { -diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index ea56b38..6bc2724 100644 ---- a/dlls/wined3d/volume.c -+++ b/dlls/wined3d/volume.c -@@ -98,13 +98,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine - HeapFree(GetProcessHeap(), 0, mem); +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 1ff27bc..315a8d0 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -1333,7 +1333,7 @@ static void texture3d_sub_resource_validate_location(struct wined3d_resource *su + { + struct wined3d_volume *volume = volume_from_resource(sub_resource); + +- wined3d_volume_validate_location(volume, location); ++ wined3d_resource_validate_location(&volume->resource, location); } --static void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD 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; @@ -45,7 +59,7 @@ index ea56b38..6bc2724 100644 void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) { TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location)); -@@ -270,7 +263,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -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; } @@ -54,7 +68,7 @@ index ea56b38..6bc2724 100644 if (wined3d_volume_can_evict(volume)) wined3d_volume_evict_sysmem(volume); -@@ -304,7 +297,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -305,7 +298,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, wined3d_debug_location(volume->resource.locations)); return; } @@ -63,7 +77,7 @@ index ea56b38..6bc2724 100644 break; case WINED3D_LOCATION_BUFFER: -@@ -333,7 +326,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -334,7 +327,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, wined3d_debug_location(volume->resource.locations)); return; } @@ -72,7 +86,7 @@ index ea56b38..6bc2724 100644 break; default: -@@ -412,7 +405,7 @@ static void volume_unload(struct wined3d_resource *resource) +@@ -413,7 +406,7 @@ static void volume_unload(struct wined3d_resource *resource) else { ERR("Out of memory when unloading volume %p.\n", volume); @@ -81,7 +95,7 @@ index ea56b38..6bc2724 100644 wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_DISCARDED); } -@@ -558,7 +551,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -559,7 +552,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, wined3d_volume_prepare_pbo(volume, context); if (flags & WINED3D_MAP_DISCARD) @@ -90,7 +104,7 @@ index ea56b38..6bc2724 100644 else wined3d_volume_load_location(volume, context, WINED3D_LOCATION_BUFFER); -@@ -593,7 +586,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -594,7 +587,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, if (flags & WINED3D_MAP_DISCARD) { @@ -100,10 +114,10 @@ index ea56b38..6bc2724 100644 else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM)) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 57a048f..0c698b6 100644 +index 004969d..edbc066 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2114,6 +2114,7 @@ GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; +@@ -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; @@ -111,6 +125,14 @@ index 57a048f..0c698b6 100644 /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 +@@ -2270,7 +2271,6 @@ void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pit + 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.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch b/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch index 691eac11..f05db4c4 100644 --- a/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch +++ b/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch @@ -1,4 +1,4 @@ -From 298ba6d476f8f76000f879b2ca61ff1fd0e810ff Mon Sep 17 00:00:00 2001 +From ea0e273a5c7c53945e0de57fc877511555ed0627 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. @@ -26,7 +26,7 @@ index bc66c4a..c1b3b6d 100644 && !wined3d_resource_is_offscreen(&src_surface->container->resource)) { diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 0b4c6f9..01ccd9d 100644 +index df8789a..4ac9c3e 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -236,7 +236,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context @@ -61,7 +61,7 @@ index 2d39a83..7034b25 100644 else SetRectEmpty(¤t_rect); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 8a14169..c44179f 100644 +index 6927ea3..1ed3e46 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) @@ -99,8 +99,8 @@ index 8a14169..c44179f 100644 + surface_get_memory(src_surface, &data, src_surface->resource.locations); wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); - surface_upload_data(dst_surface, gl_info, src_format, src_rect, src_row_pitch, dst_point, FALSE, &data); -@@ -1872,7 +1872,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte + wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, +@@ -1873,7 +1873,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte if (ck_changed) wined3d_texture_force_reload(surface->container); } @@ -109,7 +109,7 @@ index 8a14169..c44179f 100644 { TRACE("Reloading because surface is dirty.\n"); } -@@ -2186,7 +2186,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -2187,7 +2187,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, create_dib = TRUE; } @@ -118,7 +118,7 @@ index 8a14169..c44179f 100644 wined3d_resource_free_sysmem(&surface->resource); width = texture_resource->width; -@@ -3088,9 +3088,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) +@@ -3233,9 +3233,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) back->flags = front->flags; front->flags = tmp_flags; @@ -131,7 +131,7 @@ index 8a14169..c44179f 100644 } } -@@ -3269,7 +3269,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3414,7 +3414,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -140,7 +140,7 @@ index 8a14169..c44179f 100644 } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3863,13 +3863,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface, +@@ -4008,13 +4008,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface, { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -158,7 +158,7 @@ index 8a14169..c44179f 100644 } /* Context activation is done by the caller. */ -@@ -3884,7 +3885,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4029,7 +4030,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -167,7 +167,7 @@ index 8a14169..c44179f 100644 { w = surface->ds_current_size.cx; h = surface->ds_current_size.cy; -@@ -3910,7 +3911,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4055,7 +4056,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co return; } @@ -176,7 +176,7 @@ index 8a14169..c44179f 100644 { TRACE("Surface was discarded, no need copy data.\n"); switch (location) -@@ -3927,17 +3928,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4072,17 +4073,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co default: FIXME("Unhandled location %#x\n", location); } @@ -198,7 +198,7 @@ index 8a14169..c44179f 100644 surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; return; -@@ -4026,7 +4027,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4171,7 +4172,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co ERR("Invalid location (%#x) specified.\n", location); } @@ -207,7 +207,7 @@ index 8a14169..c44179f 100644 surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; } -@@ -4035,7 +4036,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location) +@@ -4180,7 +4181,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location) { TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); @@ -216,7 +216,7 @@ index 8a14169..c44179f 100644 } void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) -@@ -4044,9 +4045,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location +@@ -4189,9 +4190,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) wined3d_texture_set_dirty(surface->container); @@ -228,7 +228,7 @@ index 8a14169..c44179f 100644 ERR("Surface %p does not have any up to date location.\n", surface); } -@@ -4082,7 +4083,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD +@@ -4227,7 +4228,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD UINT size = surface->resource.size; surface_get_memory(surface, &dst, location); @@ -237,7 +237,7 @@ index 8a14169..c44179f 100644 if (dst.buffer_object) { -@@ -4115,33 +4116,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface, +@@ -4260,33 +4261,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface, { const struct wined3d_gl_info *gl_info = context->gl_info; @@ -277,7 +277,7 @@ index 8a14169..c44179f 100644 } /* Context activation is done by the caller. */ -@@ -4181,14 +4182,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4326,14 +4327,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, if (wined3d_settings.offscreen_rendering_mode != ORM_FBO && wined3d_resource_is_offscreen(&texture->resource) @@ -294,7 +294,7 @@ index 8a14169..c44179f 100644 && (surface->resource.format->flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB) && fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT, NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, -@@ -4204,13 +4205,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4349,13 +4350,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, return WINED3D_OK; } @@ -310,7 +310,7 @@ index 8a14169..c44179f 100644 WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE; DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; RECT rect = {0, 0, surface->resource.width, surface->resource.height}; -@@ -4225,7 +4226,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4370,7 +4371,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, if (srgb) { @@ -319,7 +319,7 @@ index 8a14169..c44179f 100644 == WINED3D_LOCATION_TEXTURE_RGB) { /* Performance warning... */ -@@ -4236,7 +4237,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4381,7 +4382,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } else { @@ -328,7 +328,7 @@ index 8a14169..c44179f 100644 == WINED3D_LOCATION_TEXTURE_SRGB) { /* Performance warning... */ -@@ -4246,7 +4247,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4391,7 +4392,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } } @@ -337,7 +337,7 @@ index 8a14169..c44179f 100644 { WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); /* Lets hope we get it from somewhere... */ -@@ -4288,7 +4289,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4433,7 +4434,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, surface_remove_pbo(surface, gl_info); } @@ -346,7 +346,7 @@ index 8a14169..c44179f 100644 if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -4344,7 +4345,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct +@@ -4490,7 +4491,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct { RECT rect = {0, 0, surface->resource.width, surface->resource.height}; @@ -355,7 +355,7 @@ index 8a14169..c44179f 100644 ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n", surface); -@@ -4362,12 +4363,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4508,12 +4509,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -370,7 +370,7 @@ index 8a14169..c44179f 100644 && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) { /* Already up to date, nothing to do. */ -@@ -4376,12 +4377,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4522,12 +4523,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte else { FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n", @@ -385,7 +385,7 @@ index 8a14169..c44179f 100644 { TRACE("Location already up to date.\n"); return; -@@ -4395,7 +4396,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4541,7 +4542,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte required_access, surface->resource.access_flags); } @@ -394,7 +394,7 @@ index 8a14169..c44179f 100644 { ERR("Surface %p does not have any up to date location.\n", surface); surface->flags |= SFLAG_LOST; -@@ -4434,7 +4435,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4580,7 +4581,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte surface_validate_location(surface, location); @@ -403,7 +403,7 @@ index 8a14169..c44179f 100644 surface_evict_sysmem(surface); return; -@@ -5439,8 +5440,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5585,8 +5586,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC { /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ @@ -414,7 +414,7 @@ index 8a14169..c44179f 100644 { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5467,8 +5468,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5613,8 +5614,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC TRACE("Color blit.\n"); /* Upload */ @@ -426,10 +426,10 @@ index 8a14169..c44179f 100644 if (scale) TRACE("Not doing upload because of scaling.\n"); diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index d742b11..601d3ad 100644 +index f984235..4d7eb32 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 +@@ -560,8 +560,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)); @@ -441,10 +441,10 @@ index d742b11..601d3ad 100644 /* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying * Doesn't work with render_to_fbo because we're not flipping diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 0c698b6..4011833 100644 +index edbc066..8203200 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2297,7 +2297,6 @@ struct wined3d_surface +@@ -2312,7 +2312,6 @@ struct wined3d_surface const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; void *user_memory; @@ -453,5 +453,5 @@ index 0c698b6..4011833 100644 DWORD flags; -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch b/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch index 4692d564..441b40d5 100644 --- a/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch +++ b/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch @@ -1,4 +1,4 @@ -From a15ccac8ee6ece2955548900f4e7b4a993a498b2 Mon Sep 17 00:00:00 2001 +From c24cea315381bd5666541f3717079e3d09c02ff4 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. @@ -8,8 +8,9 @@ Subject: wined3d: Remove surface_validate_location. dlls/wined3d/device.c | 2 +- dlls/wined3d/surface.c | 29 +++++++++++------------------ dlls/wined3d/swapchain.c | 12 ++++++------ + dlls/wined3d/texture.c | 2 +- dlls/wined3d/wined3d_private.h | 1 - - 5 files changed, 19 insertions(+), 27 deletions(-) + 6 files changed, 20 insertions(+), 28 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index c1b3b6d..08f92cb 100644 @@ -25,7 +26,7 @@ index c1b3b6d..08f92cb 100644 return WINED3D_OK; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 01ccd9d..e10ea1c 100644 +index 4ac9c3e..99f4e96 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 @@ -38,7 +39,7 @@ index 01ccd9d..e10ea1c 100644 } } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index c44179f..b56796e 100644 +index 1ed3e46..f756621 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1224,7 +1224,7 @@ static void surface_unload(struct wined3d_resource *resource) @@ -50,7 +51,7 @@ index c44179f..b56796e 100644 surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM); /* We also get here when the ddraw swapchain is destroyed, for example -@@ -1735,7 +1735,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1736,7 +1736,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P context_release(context); @@ -59,7 +60,7 @@ index c44179f..b56796e 100644 surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); return WINED3D_OK; -@@ -2253,7 +2253,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -2254,7 +2254,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, valid_location = WINED3D_LOCATION_SYSMEM; } @@ -68,7 +69,7 @@ index c44179f..b56796e 100644 return WINED3D_OK; } -@@ -2645,7 +2645,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2790,7 +2790,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)); @@ -77,7 +78,7 @@ index c44179f..b56796e 100644 } else { -@@ -3200,7 +3200,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc +@@ -3345,7 +3345,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. */ @@ -86,7 +87,7 @@ index c44179f..b56796e 100644 surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); } -@@ -3474,7 +3474,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3619,7 +3619,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. */ @@ -95,7 +96,7 @@ index c44179f..b56796e 100644 surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); } -@@ -3787,7 +3787,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE +@@ -3932,7 +3932,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT, (old_color_key_flags & WINEDDSD_CKSRCBLT) ? &old_blt_key : NULL); @@ -104,7 +105,7 @@ index c44179f..b56796e 100644 surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); return WINED3D_OK; -@@ -4032,13 +4032,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4177,13 +4177,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } @@ -118,7 +119,7 @@ index c44179f..b56796e 100644 void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) { TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4433,7 +4426,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -4579,7 +4572,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte break; } @@ -127,7 +128,7 @@ index c44179f..b56796e 100644 if (location != WINED3D_LOCATION_SYSMEM && (surface->resource.locations & WINED3D_LOCATION_SYSMEM)) surface_evict_sysmem(surface); -@@ -5528,7 +5521,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5674,7 +5667,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); @@ -136,7 +137,7 @@ index c44179f..b56796e 100644 surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); return WINED3D_OK; -@@ -5625,7 +5618,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text +@@ -5771,7 +5764,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text } surface->container = container; @@ -145,7 +146,7 @@ index c44179f..b56796e 100644 list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5657,7 +5650,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text +@@ -5803,7 +5796,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); @@ -155,10 +156,10 @@ index c44179f..b56796e 100644 } diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 601d3ad..bdb4b67 100644 +index 4d7eb32..3b0c6b3 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 +@@ -574,19 +574,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. */ @@ -182,7 +183,7 @@ index 601d3ad..bdb4b67 100644 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 +@@ -595,7 +595,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT */ if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) { @@ -191,7 +192,7 @@ index 601d3ad..bdb4b67 100644 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 +@@ -870,7 +870,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)) { @@ -200,11 +201,24 @@ index 601d3ad..bdb4b67 100644 surface_invalidate_location(front_buffer, ~WINED3D_LOCATION_DRAWABLE); } +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index 315a8d0..5bcbd12 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -876,7 +876,7 @@ static void texture2d_sub_resource_validate_location(struct wined3d_resource *su + { + struct wined3d_surface *surface = surface_from_resource(sub_resource); + +- surface_validate_location(surface, location); ++ wined3d_resource_validate_location(&surface->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 4011833..5ca3ab8 100644 +index 8203200..1a5cc7b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2368,7 +2368,6 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -2383,7 +2383,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; @@ -213,5 +227,5 @@ index 4011833..5ca3ab8 100644 GLenum target, unsigned int level, unsigned int layer, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch b/patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch index 1088f96c..9a9373cb 100644 --- a/patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch +++ b/patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch @@ -1,4 +1,4 @@ -From c7669f4cc8e98c81027cd1c2392d3435ec534206 Mon Sep 17 00:00:00 2001 +From e91b559bcccc65140b04128ad41db21413065cf9 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. @@ -12,7 +12,7 @@ Subject: wined3d: Move invalidate_location to resource.c. 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index e10ea1c..600afed 100644 +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, @@ -25,10 +25,10 @@ index e10ea1c..600afed 100644 context_release(context); diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index bac15c0..1ec27d3 100644 +index dd80490..534cf80 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -339,6 +339,13 @@ void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD +@@ -342,6 +342,13 @@ void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations)); } @@ -43,10 +43,10 @@ index bac15c0..1ec27d3 100644 UINT *slice_pitch) { diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index c173518..f003fa2 100644 +index 5bcbd12..0113efc 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -1286,9 +1286,7 @@ static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource +@@ -1324,9 +1324,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) { @@ -56,13 +56,13 @@ index c173518..f003fa2 100644 + wined3d_resource_invalidate_location(sub_resource, location); } - static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) + 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 6bc2724..3b742d2 100644 +index e1fa454..722f92e 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -98,13 +98,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine - HeapFree(GetProcessHeap(), 0, mem); +@@ -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) @@ -75,7 +75,7 @@ index 6bc2724..3b742d2 100644 /* 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) -@@ -140,7 +133,7 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume, +@@ -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); @@ -84,7 +84,7 @@ index 6bc2724..3b742d2 100644 } static DWORD volume_access_from_location(DWORD location) -@@ -238,7 +231,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -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"); @@ -93,7 +93,7 @@ index 6bc2724..3b742d2 100644 } else if (volume->resource.locations & WINED3D_LOCATION_SYSMEM) { -@@ -277,7 +270,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -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"); @@ -102,7 +102,7 @@ index 6bc2724..3b742d2 100644 } else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { -@@ -307,7 +300,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume, +@@ -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"); @@ -111,7 +111,7 @@ index 6bc2724..3b742d2 100644 } else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { -@@ -400,13 +393,13 @@ static void volume_unload(struct wined3d_resource *resource) +@@ -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); @@ -127,7 +127,7 @@ index 6bc2724..3b742d2 100644 } if (volume->pbo) -@@ -640,7 +633,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -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); @@ -137,10 +137,10 @@ index 6bc2724..3b742d2 100644 volume->resource.map_count++; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 5ca3ab8..fd28fa5 100644 +index 1a5cc7b..232e956 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2115,6 +2115,7 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_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; @@ -148,14 +148,14 @@ index 5ca3ab8..fd28fa5 100644 /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -@@ -2255,7 +2256,6 @@ HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wi - void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; +@@ -2270,7 +2271,6 @@ 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; void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, - const struct wined3d_bo_address *data) DECLSPEC_HIDDEN; + const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch b/patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch index cbef2d37..7d608666 100644 --- a/patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch +++ b/patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch @@ -1,4 +1,4 @@ -From 421ef7716a0748076fd14bb607849f81ab149679 Mon Sep 17 00:00:00 2001 +From 7b874f424fc87ef49a94bc78d7080616ac9681a4 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. @@ -41,7 +41,7 @@ index 1f34992..61c074f 100644 } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 600afed..70a30f0 100644 +index bde37b1..a6620f5 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -393,7 +393,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c @@ -67,7 +67,7 @@ index 7034b25..eef7e2c 100644 } } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 6c2698a..ef52ed0 100644 +index 6f48834..8789d44 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -599,7 +599,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) @@ -118,7 +118,7 @@ index 6c2698a..ef52ed0 100644 } static const struct wined3d_resource_ops surface_resource_ops = -@@ -1742,7 +1745,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1743,7 +1746,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); @@ -127,7 +127,7 @@ index 6c2698a..ef52ed0 100644 return WINED3D_OK; } -@@ -1873,7 +1876,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte +@@ -1874,7 +1877,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte surface_prepare_map_memory(surface); surface_load_location(surface, context, surface->resource.map_binding); @@ -136,7 +136,7 @@ index 6c2698a..ef52ed0 100644 /* Switching color keying on / off may change the internal format. */ if (ck_changed) wined3d_texture_force_reload(surface->container); -@@ -2668,7 +2671,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2813,7 +2816,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, } if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) @@ -145,7 +145,7 @@ index 6c2698a..ef52ed0 100644 switch (surface->resource.map_binding) { -@@ -2784,7 +2787,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2929,7 +2932,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) } surface_load_location(surface, context, WINED3D_LOCATION_DIB); @@ -154,7 +154,7 @@ index 6c2698a..ef52ed0 100644 if (context) context_release(context); -@@ -2833,7 +2836,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) +@@ -2978,7 +2981,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) context = context_acquire(device, NULL); surface_load_location(surface, context, surface->resource.map_binding); @@ -163,7 +163,7 @@ index 6c2698a..ef52ed0 100644 if (context) context_release(context); } -@@ -3207,7 +3210,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc +@@ -3352,7 +3355,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); @@ -172,7 +172,7 @@ index 6c2698a..ef52ed0 100644 } /* Uses the hardware to stretch and flip the image */ -@@ -3275,7 +3278,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3420,7 +3423,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -181,7 +181,7 @@ index 6c2698a..ef52ed0 100644 } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3481,7 +3484,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -3626,7 +3629,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); @@ -190,7 +190,7 @@ index 6c2698a..ef52ed0 100644 } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3794,7 +3797,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE +@@ -3939,7 +3942,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE (old_color_key_flags & WINEDDSD_CKSRCBLT) ? &old_blt_key : NULL); wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); @@ -199,7 +199,7 @@ index 6c2698a..ef52ed0 100644 return WINED3D_OK; } -@@ -4038,18 +4041,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co +@@ -4183,18 +4186,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co surface->ds_current_size.cy = surface->resource.height; } @@ -218,7 +218,7 @@ index 6c2698a..ef52ed0 100644 static DWORD resource_access_from_location(DWORD location) { switch (location) -@@ -5528,7 +5519,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5674,7 +5665,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC context_release(context); wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); @@ -227,7 +227,7 @@ index 6c2698a..ef52ed0 100644 return WINED3D_OK; } -@@ -5657,7 +5648,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text +@@ -5803,7 +5794,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text { wined3d_resource_free_sysmem(&surface->resource); wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB); @@ -237,10 +237,10 @@ index 6c2698a..ef52ed0 100644 return hr; diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index bdb4b67..e64715e 100644 +index 3b0c6b3..290a6cd 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 +@@ -517,7 +517,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO) { surface_load_location(back_buffer, context, WINED3D_LOCATION_TEXTURE_RGB); @@ -249,7 +249,7 @@ index bdb4b67..e64715e 100644 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 +@@ -579,15 +579,15 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT else { wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); @@ -268,7 +268,7 @@ index bdb4b67..e64715e 100644 /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM * and INTEXTURE copies can keep their old content if they have any defined content. * If the swapeffect is COPY, the content remains the same. If it is FLIP however, -@@ -591,7 +591,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT +@@ -596,7 +596,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) { wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding); @@ -277,7 +277,7 @@ index bdb4b67..e64715e 100644 } } -@@ -866,7 +866,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 +@@ -871,7 +871,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 if (!(device->wined3d->flags & WINED3D_NO3D)) { wined3d_resource_validate_location(&front_buffer->resource, WINED3D_LOCATION_DRAWABLE); @@ -287,10 +287,10 @@ index bdb4b67..e64715e 100644 /* MSDN says we're only allowed a single fullscreen swapchain per device, diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index c42e475..941d935 100644 +index 9d89774..24c6cb9 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -832,7 +832,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub +@@ -855,7 +855,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); @@ -299,7 +299,7 @@ index c42e475..941d935 100644 } static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource) -@@ -844,9 +844,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource +@@ -867,9 +867,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) { @@ -309,12 +309,12 @@ index c42e475..941d935 100644 + wined3d_resource_invalidate_location(sub_resource, location); } - /* Context activation is done by the caller. */ + 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 60d1b56..640aa95 100644 +index 2790115..002afea 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2351,7 +2351,6 @@ HRESULT surface_color_fill(struct wined3d_surface *s, +@@ -2366,7 +2366,6 @@ HRESULT surface_color_fill(struct wined3d_surface *s, GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN; void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; @@ -323,5 +323,5 @@ index 60d1b56..640aa95 100644 void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch b/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch index 791ce439..d87c9b0a 100644 --- a/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch +++ b/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch @@ -1,4 +1,4 @@ -From b416ab9ae21fee5c8253969318c55156c1d5fc0a Mon Sep 17 00:00:00 2001 +From 437cae1236351d1ce2d0a6e5a2179de17932390b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 16 Jan 2014 22:07:17 +0100 Subject: wined3d: Move volume PBO infrastructure into the resource. @@ -10,10 +10,10 @@ Subject: wined3d: Move volume PBO infrastructure into the resource. 3 files changed, 82 insertions(+), 79 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 63f8584..d904c36 100644 +index 6cbf120..ef7a52a 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -292,7 +292,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) +@@ -295,7 +295,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) return ret; } @@ -22,7 +22,7 @@ index 63f8584..d904c36 100644 { if (d3d_flags & WINED3D_MAP_READONLY) return GL_READ_ONLY_ARB; -@@ -398,6 +398,68 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, +@@ -401,6 +401,68 @@ void wined3d_resource_load_location(struct wined3d_resource *resource, resource->resource_ops->resource_load_location(resource, context, location); } @@ -92,19 +92,19 @@ index 63f8584..d904c36 100644 UINT *slice_pitch) { diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index ee64070..1e03097 100644 +index 2e92dd7..c538e08 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -215,7 +215,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -216,7 +216,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, } else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) { -- struct wined3d_bo_address data = {volume->pbo, NULL}; -+ struct wined3d_bo_address data = {volume->resource.buffer_object, NULL}; +- struct wined3d_const_bo_address data = {volume->pbo, NULL}; ++ struct wined3d_const_bo_address data = {volume->resource.buffer_object, NULL}; wined3d_volume_upload_data(volume, context, &data); } else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) -@@ -269,7 +269,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -270,7 +270,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, break; case WINED3D_LOCATION_BUFFER: @@ -113,7 +113,7 @@ index ee64070..1e03097 100644 ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n"); if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) -@@ -279,7 +279,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -280,7 +280,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, } else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { @@ -122,7 +122,7 @@ index ee64070..1e03097 100644 if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); -@@ -316,16 +316,16 @@ static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct win +@@ -317,16 +317,16 @@ static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct win { const struct wined3d_gl_info *gl_info = context->gl_info; @@ -143,7 +143,7 @@ index ee64070..1e03097 100644 } static void wined3d_volume_free_pbo(struct wined3d_volume *volume) -@@ -333,10 +333,10 @@ static void wined3d_volume_free_pbo(struct wined3d_volume *volume) +@@ -334,10 +334,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; @@ -157,7 +157,7 @@ index ee64070..1e03097 100644 context_release(context); } -@@ -344,7 +344,7 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) +@@ -345,7 +345,7 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) { TRACE("volume %p.\n", volume); @@ -166,7 +166,7 @@ index ee64070..1e03097 100644 wined3d_volume_free_pbo(volume); resource_cleanup(&volume->resource); -@@ -377,7 +377,7 @@ static void volume_unload(struct wined3d_resource *resource) +@@ -378,7 +378,7 @@ static void volume_unload(struct wined3d_resource *resource) wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); } @@ -175,7 +175,7 @@ index ee64070..1e03097 100644 { /* Should not happen because only dynamic default pool volumes * have a buffer, and those are not evicted by device_evit_managed_resources -@@ -493,44 +493,6 @@ static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, str +@@ -494,44 +494,6 @@ static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, str } } @@ -220,7 +220,7 @@ index ee64070..1e03097 100644 HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { -@@ -581,7 +543,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -582,7 +544,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, else wined3d_resource_load_location(&volume->resource, context, volume->resource.map_binding); @@ -229,7 +229,7 @@ index ee64070..1e03097 100644 context_release(context); TRACE("Base memory pointer %p.\n", base_memory); -@@ -640,30 +602,6 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour +@@ -641,30 +603,6 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour return volume_from_resource(resource); } @@ -260,7 +260,7 @@ index ee64070..1e03097 100644 HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) { struct wined3d_device *device = volume->resource.device; -@@ -677,7 +615,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) +@@ -678,7 +616,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) } context = context_acquire(device, NULL); @@ -270,10 +270,10 @@ index ee64070..1e03097 100644 volume->resource.map_count--; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 059310b..9285ab8 100644 +index 342b900..ff2f205 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2083,6 +2083,7 @@ struct wined3d_resource +@@ -2094,6 +2094,7 @@ struct wined3d_resource UINT size; DWORD priority; void *heap_memory, *user_memory, *bitmap_data; @@ -281,7 +281,7 @@ index 059310b..9285ab8 100644 UINT custom_row_pitch, custom_slice_pitch; struct list resource_list_entry; DWORD locations; -@@ -2113,12 +2114,15 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; +@@ -2124,12 +2125,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; @@ -298,7 +298,7 @@ index 059310b..9285ab8 100644 DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN; -@@ -2248,7 +2252,6 @@ struct wined3d_volume +@@ -2262,7 +2266,6 @@ struct wined3d_volume DWORD flags; GLint texture_level; DWORD download_count; @@ -307,5 +307,5 @@ index 059310b..9285ab8 100644 static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch b/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch index bdbb0e72..3dbde2bf 100644 --- a/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch +++ b/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch @@ -1,4 +1,4 @@ -From df1b8896b325fb67b08f7cc8b6656d7166b451c2 Mon Sep 17 00:00:00 2001 +From a95bca19bbfd77bc151a29981e4cdd5c759f8821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 18 Sep 2013 22:49:34 +0200 Subject: wined3d: Move buffer creation into the resource. @@ -15,10 +15,10 @@ surface_load_location will write a lot of ERRs. 4 files changed, 72 insertions(+), 76 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index c0e4d70..d5ec71f 100644 +index b3c87ba..369ea52 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 * +@@ -145,6 +145,18 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * return WINED3D_OK; } @@ -37,7 +37,7 @@ index c0e4d70..d5ec71f 100644 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) +@@ -157,6 +169,9 @@ void resource_cleanup(struct wined3d_resource *resource) adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); } @@ -47,7 +47,7 @@ index c0e4d70..d5ec71f 100644 wined3d_resource_free_sysmem(resource); device_resource_released(resource->device, resource); -@@ -164,6 +179,9 @@ void resource_unload(struct wined3d_resource *resource) +@@ -167,6 +182,9 @@ void resource_unload(struct wined3d_resource *resource) if (resource->map_count) ERR("Resource %p is being unloaded while mapped.\n", resource); @@ -57,7 +57,7 @@ index c0e4d70..d5ec71f 100644 context_resource_unloaded(resource->device, resource, resource->type); } -@@ -468,6 +486,54 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -471,6 +489,54 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, } } @@ -113,10 +113,10 @@ index c0e4d70..d5ec71f 100644 UINT *slice_pitch) { diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 48717d7..41cf61d 100644 +index 35010b0..91e8b72 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -1316,7 +1316,7 @@ static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wi +@@ -1378,7 +1378,7 @@ static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wi void *mem = NULL; if (gl_info->supported[APPLE_CLIENT_STORAGE] && !format->convert @@ -126,7 +126,7 @@ index 48717d7..41cf61d 100644 TRACE("Enabling GL_UNPACK_CLIENT_STORAGE_APPLE for volume %p\n", volume); gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 1e03097..a40d9f0 100644 +index c538e08..4842170 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -27,19 +27,6 @@ @@ -148,8 +148,8 @@ index 1e03097..a40d9f0 100644 - /* Context activation is done by the caller. */ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, - const struct wined3d_bo_address *data) -@@ -311,42 +298,10 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * + const struct wined3d_const_bo_address *data) +@@ -312,42 +299,10 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); } @@ -192,7 +192,7 @@ index 1e03097..a40d9f0 100644 resource_cleanup(&volume->resource); volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); HeapFree(GetProcessHeap(), 0, volume); -@@ -363,7 +318,7 @@ static void volume_unload(struct wined3d_resource *resource) +@@ -364,7 +319,7 @@ static void volume_unload(struct wined3d_resource *resource) TRACE("texture %p.\n", resource); @@ -201,7 +201,7 @@ index 1e03097..a40d9f0 100644 { context = context_acquire(device, NULL); wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM); -@@ -377,15 +332,6 @@ static void volume_unload(struct wined3d_resource *resource) +@@ -378,15 +333,6 @@ static void volume_unload(struct wined3d_resource *resource) wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED); } @@ -217,7 +217,7 @@ index 1e03097..a40d9f0 100644 /* The texture name is managed by the container. */ volume->flags &= ~WINED3D_VFLAG_CLIENT_STORAGE; -@@ -475,24 +421,6 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol +@@ -476,24 +422,6 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol return TRUE; } @@ -242,7 +242,7 @@ index 1e03097..a40d9f0 100644 HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { -@@ -530,7 +458,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -531,7 +459,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags); context = context_acquire(device, NULL); @@ -252,10 +252,10 @@ index 1e03097..a40d9f0 100644 WARN("Out of memory.\n"); map_desc->data = NULL; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 8dbee1a..9353e57 100644 +index a924009..26d2d5d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2121,6 +2121,9 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO +@@ -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; @@ -265,7 +265,7 @@ index 8dbee1a..9353e57 100644 void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, const struct wined3d_context *context) DECLSPEC_HIDDEN; DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; -@@ -2259,7 +2262,6 @@ static inline struct wined3d_volume *volume_from_resource(struct wined3d_resourc +@@ -2273,7 +2276,6 @@ static inline struct wined3d_volume *volume_from_resource(struct wined3d_resourc return CONTAINING_RECORD(resource, struct wined3d_volume, resource); } @@ -274,5 +274,5 @@ index 8dbee1a..9353e57 100644 unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch b/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch index aae4bbfd..34f4297b 100644 --- a/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch +++ b/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch @@ -1,4 +1,4 @@ -From 564052d9ce2b7450a97ca3310d54d1b416976978 Mon Sep 17 00:00:00 2001 +From 97352f9938385bbf7c81995c1384633b7075076d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 16 Sep 2013 22:44:33 +0200 Subject: wined3d: Introduce a function to retrieve resource memory. @@ -10,10 +10,10 @@ Subject: wined3d: Introduce a function to retrieve resource memory. 3 files changed, 38 insertions(+), 39 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 051297c..94c06ac 100644 +index a7a0d44..05c5018 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -392,6 +392,36 @@ DWORD wined3d_resource_access_from_location(DWORD location) +@@ -395,6 +395,36 @@ DWORD wined3d_resource_access_from_location(DWORD location) } } @@ -51,7 +51,7 @@ index 051297c..94c06ac 100644 void wined3d_resource_load_location(struct wined3d_resource *resource, struct wined3d_context *context, DWORD location) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 29f4563..4815965 100644 +index e06a2d7..75e5acd 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) @@ -111,8 +111,8 @@ index 29f4563..4815965 100644 + 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); - surface_upload_data(dst_surface, gl_info, src_format, src_rect, src_row_pitch, dst_point, FALSE, &data); -@@ -2794,7 +2761,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, + wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, +@@ -2939,7 +2906,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, BOOL srcIsUpsideDown; struct wined3d_bo_address data; @@ -121,7 +121,7 @@ index 29f4563..4815965 100644 /* Context_release does not restore the original context in case of * nested context_acquire calls. Only read_from_framebuffer and -@@ -3986,8 +3953,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD +@@ -4131,8 +4098,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD struct wined3d_bo_address dst, src; UINT size = surface->resource.size; @@ -132,7 +132,7 @@ index 29f4563..4815965 100644 if (dst.buffer_object) { -@@ -4206,7 +4173,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4351,7 +4318,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, surface_remove_pbo(surface, gl_info); } @@ -142,10 +142,10 @@ index 29f4563..4815965 100644 { /* This code is entered for texture formats which need a fixup. */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 9353e57..df2031a 100644 +index 26d2d5d..d56a63b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2116,6 +2116,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE +@@ -2127,6 +2127,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; @@ -155,5 +155,5 @@ index 9353e57..df2031a 100644 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.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch b/patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch index 339b76bd..d19268ba 100644 --- a/patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch +++ b/patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch @@ -1,4 +1,4 @@ -From 86e9642f816e8f9bfa7b71f3157fd42071aaf7d6 Mon Sep 17 00:00:00 2001 +From 94dbd1a23471584d1f837ebc10f071d0ea09f9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 16:40:56 +0100 Subject: wined3d: Replace surface alloc functions with resource ones. @@ -11,10 +11,10 @@ Subject: wined3d: Replace surface alloc functions with resource ones. 4 files changed, 20 insertions(+), 87 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 947fe8d..aa81c00 100644 +index 0093c6a..59626f7 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -570,6 +570,16 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru +@@ -573,6 +573,16 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru case WINED3D_LOCATION_SYSMEM: return wined3d_resource_prepare_system_memory(resource); @@ -32,7 +32,7 @@ index 947fe8d..aa81c00 100644 ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); return FALSE; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 6fa2576..4c2a759 100644 +index b0f6ec9..85b1fd6 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -479,81 +479,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) @@ -126,7 +126,7 @@ index 6fa2576..4c2a759 100644 wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); } -@@ -1780,7 +1705,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte +@@ -1781,7 +1706,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte /* To perform the color key conversion we need a sysmem copy of * the surface. Make sure we have it. */ @@ -135,7 +135,7 @@ index 6fa2576..4c2a759 100644 wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); /* Switching color keying on / off may change the internal format. */ -@@ -2164,7 +2089,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -2165,7 +2090,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, if (!valid_location) { @@ -144,7 +144,7 @@ index 6fa2576..4c2a759 100644 valid_location = WINED3D_LOCATION_SYSMEM; } -@@ -2567,7 +2492,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2712,7 +2637,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, if (device->d3d_initialized) context = context_acquire(device, NULL); @@ -153,7 +153,7 @@ index 6fa2576..4c2a759 100644 if (flags & WINED3D_MAP_DISCARD) { TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n", -@@ -4097,7 +4022,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4242,7 +4167,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, { /* Performance warning... */ FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); @@ -162,7 +162,7 @@ index 6fa2576..4c2a759 100644 wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); } } -@@ -4108,7 +4033,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4253,7 +4178,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, { /* Performance warning... */ FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); @@ -171,7 +171,7 @@ index 6fa2576..4c2a759 100644 wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); } } -@@ -4117,7 +4042,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4262,7 +4187,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, { WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); /* Lets hope we get it from somewhere... */ @@ -180,7 +180,7 @@ index 6fa2576..4c2a759 100644 wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); } -@@ -4150,7 +4075,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4295,7 +4220,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -190,10 +190,10 @@ index 6fa2576..4c2a759 100644 surface_remove_pbo(surface, gl_info); } diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 8298e53..429eb89 100644 +index 0c3fe95..06a041c 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -828,8 +828,8 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub +@@ -851,8 +851,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; @@ -203,7 +203,7 @@ index 8298e53..429eb89 100644 wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); context_release(context); wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); -@@ -916,8 +916,7 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi +@@ -966,8 +966,7 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi } else { @@ -214,17 +214,17 @@ index 8298e53..429eb89 100644 surface->flags |= SFLAG_CLIENT; mem = surface->resource.heap_memory; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 35f2445..51c957b 100644 +index 7ea1374..b9d77f3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2380,7 +2380,6 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w +@@ -2395,7 +2395,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 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 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.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch index 21331928..42ee165d 100644 --- a/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch +++ b/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch @@ -1,4 +1,4 @@ -From f2f3b1c84b57d393a2eb2986704537d37d81f04b Mon Sep 17 00:00:00 2001 +From d8d04cd60fafff413cb9f04efe1e5807eebf95b5 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. @@ -108,10 +108,10 @@ index 949bd6b..dcaedfd 100644 { struct wined3d_cs_block *block; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 97450ef..2620570 100644 +index e2cc4c2..8536927 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -4937,14 +4937,13 @@ const struct blit_shader cpu_blit = { +@@ -5083,14 +5083,13 @@ const struct blit_shader cpu_blit = { cpu_blit_depth_fill, }; @@ -128,7 +128,7 @@ index 97450ef..2620570 100644 BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -4953,111 +4952,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5099,111 +5098,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -240,7 +240,7 @@ index 97450ef..2620570 100644 if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5100,8 +4994,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5246,8 +5140,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC } scale = src_surface @@ -251,7 +251,7 @@ index 97450ef..2620570 100644 convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; dst_ds_flags = dst_surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); -@@ -5119,22 +5013,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5265,22 +5159,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -279,7 +279,7 @@ index 97450ef..2620570 100644 } } else -@@ -5161,8 +5049,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5307,8 +5195,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC if (!surface_convert_color_to_float(dst_surface, fx->u5.dwFillColor, &color)) goto fallback; @@ -290,7 +290,7 @@ index 97450ef..2620570 100644 } else { -@@ -5178,9 +5066,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5324,9 +5212,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC TRACE("Not doing upload because of format conversion.\n"); else { @@ -302,7 +302,7 @@ index 97450ef..2620570 100644 { if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) { -@@ -5189,7 +5077,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5335,7 +5223,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC dst_surface->container->resource.draw_binding); context_release(context); } @@ -311,7 +311,7 @@ index 97450ef..2620570 100644 } } } -@@ -5214,51 +5102,192 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5360,51 +5248,192 @@ 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; @@ -518,20 +518,20 @@ index 97450ef..2620570 100644 static const struct wined3d_resource_ops surface_resource_ops = diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ab3d07f..a311a35 100644 +index 3c04b1b..6889bd8 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2409,6 +2409,9 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w +@@ -2424,6 +2424,9 @@ 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_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; -@@ -2553,6 +2556,7 @@ struct wined3d_cs + 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; +@@ -2571,6 +2574,7 @@ struct wined3d_cs struct wined3d_device *device; struct wined3d_state state; HANDLE thread; @@ -539,7 +539,7 @@ index ab3d07f..a311a35 100644 DWORD tls_idx; struct wined3d_surface *onscreen_depth_stencil; -@@ -2629,6 +2633,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, +@@ -2647,6 +2651,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; @@ -551,5 +551,5 @@ index ab3d07f..a311a35 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch b/patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch index 74e5b788..b2f2086d 100644 --- a/patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch +++ b/patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch @@ -1,4 +1,4 @@ -From f563282c26b069e5e053bd2bc441fe079854f998 Mon Sep 17 00:00:00 2001 +From 69549fe872a05e2bfb752d583f7342cf52dd6228 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 @@ -12,7 +12,7 @@ yet because blits depend on them. 3 files changed, 68 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 9ef99b2..599a25d 100644 +index 5242028..a4d1c53 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3731,6 +3731,13 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, @@ -96,10 +96,10 @@ index 9ef99b2..599a25d 100644 { FIXME("Waiting for cs.\n"); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 2620570..c47f78c 100644 +index 8536927..01bee3e 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -1420,7 +1420,7 @@ static void surface_upload_data(struct wined3d_surface *surface, const struct wi +@@ -1420,7 +1420,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w } } @@ -109,17 +109,17 @@ index 2620570..c47f78c 100644 struct wined3d_box box; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index a311a35..0d76377 100644 +index 6889bd8..c3b1c28 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2412,6 +2412,7 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; +@@ -2427,6 +2427,7 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) 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; +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; + 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.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch b/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch index cf9ba576..7fd06525 100644 --- a/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch @@ -1,4 +1,4 @@ -From ece46da9666f1f33930351ffe5ba81d346db164a Mon Sep 17 00:00:00 2001 +From 1cc8df787d882d4c0a32c7c2f423c9935db5cf64 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 @@ -75,7 +75,7 @@ index 4834dd4..aeba50f 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index ed055f8..f1c284a 100644 +index cbb1466..5333f23 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3398,16 +3398,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device @@ -86,9 +86,9 @@ index ed055f8..f1c284a 100644 +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_bo_address data; - struct wined3d_context *context; - TRACE("device %p, src_volume %p, dst_volume %p.\n", @@ -284,10 +284,10 @@ index ed055f8..f1c284a 100644 } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 409f395..25fce7f 100644 +index a1518dd..656469a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2063,6 +2063,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource +@@ -2074,6 +2074,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; @@ -296,7 +296,7 @@ index 409f395..25fce7f 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2655,6 +2657,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac +@@ -2673,6 +2675,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -306,5 +306,5 @@ index 409f395..25fce7f 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch b/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch index 260601c8..6d3a84fa 100644 --- a/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch +++ b/patches/wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch @@ -1,4 +1,4 @@ -From b78bd76d80ff1d2edf5a9789e117ae003ec2c842 Mon Sep 17 00:00:00 2001 +From 72175d9c8fd436a69642594990d9b671ac497f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 29 Aug 2013 22:25:14 +0200 Subject: wined3d: Don't lock the src volume in device_update_volume @@ -13,17 +13,17 @@ FIXME: Maybe merge this with the previous patch or change their order. 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index f1c284a..ae7ad31 100644 +index 5333f23..8d6272d 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3401,7 +3401,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device - static HRESULT device_update_volume(struct wined3d_context *context, +@@ -3402,7 +3402,6 @@ 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_bo_address data; + TRACE("src_volume %p, dst_volume %p.\n", @@ -3421,19 +3420,12 @@ static HRESULT device_update_volume(struct wined3d_context *context, return WINED3DERR_INVALIDCALL; } @@ -46,5 +46,5 @@ index f1c284a..ae7ad31 100644 } -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch b/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch index 68d16aad..447b6dda 100644 --- a/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch +++ b/patches/wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch @@ -1,4 +1,4 @@ -From 496e24cd5a0649042e456adc2b4e512e15463974 Mon Sep 17 00:00:00 2001 +From a9c5139b4af3710105931fb127431ac153b48062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 30 Aug 2013 17:00:35 +0200 Subject: wined3d: Wrap GL BOs in a structure @@ -14,10 +14,10 @@ them for DISCARD maps. 5 files changed, 86 insertions(+), 28 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index f062e84..6f82385 100644 +index c9723ea..c57bd77 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -5007,3 +5007,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -4990,3 +4990,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -75,10 +75,10 @@ index f062e84..6f82385 100644 + wined3d_device_destroy_bo(device, context, bo); +} diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 7cafdc6..4fc4ce9 100644 +index f84b3ee..885075e 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -145,12 +145,10 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -148,12 +148,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); @@ -94,7 +94,7 @@ index 7cafdc6..4fc4ce9 100644 context_release(context); } -@@ -166,7 +164,7 @@ void resource_cleanup(struct wined3d_resource *resource) +@@ -169,7 +167,7 @@ void resource_cleanup(struct wined3d_resource *resource) adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); } @@ -103,7 +103,7 @@ index 7cafdc6..4fc4ce9 100644 wined3d_resource_free_bo(resource); wined3d_resource_free_sysmem(resource); -@@ -179,7 +177,7 @@ void resource_unload(struct wined3d_resource *resource) +@@ -182,7 +180,7 @@ void resource_unload(struct wined3d_resource *resource) if (resource->map_count) ERR("Resource %p is being unloaded while mapped.\n", resource); @@ -112,7 +112,7 @@ index 7cafdc6..4fc4ce9 100644 wined3d_resource_free_bo(resource); context_resource_unloaded(resource->device, -@@ -397,7 +395,7 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, +@@ -400,7 +398,7 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, { if (location & WINED3D_LOCATION_BUFFER) { @@ -121,7 +121,7 @@ index 7cafdc6..4fc4ce9 100644 data->addr = NULL; return; } -@@ -506,7 +504,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, +@@ -509,7 +507,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; @@ -130,7 +130,7 @@ index 7cafdc6..4fc4ce9 100644 if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) { -@@ -549,7 +547,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -552,7 +550,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; @@ -139,7 +139,7 @@ index 7cafdc6..4fc4ce9 100644 GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)); GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); checkGLcall("Unmap GL buffer"); -@@ -567,20 +565,14 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -570,20 +568,14 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, } /* Context activation is done by the caller. */ @@ -166,7 +166,7 @@ index 7cafdc6..4fc4ce9 100644 BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 535e21a..7c532f0 100644 +index 7a65abc..8881490 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -48,7 +48,7 @@ static void surface_cleanup(struct wined3d_surface *surface) @@ -178,7 +178,7 @@ index 535e21a..7c532f0 100644 || surface->rb_resolved || !list_empty(&surface->renderbuffers)) { struct wined3d_renderbuffer_entry *entry, *entry2; -@@ -2515,7 +2515,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2660,7 +2660,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 @@ -187,7 +187,7 @@ index 535e21a..7c532f0 100644 surface->resource.map_binding = WINED3D_LOCATION_DIB; } -@@ -3880,7 +3880,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4025,7 +4025,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. */ @@ -197,19 +197,19 @@ index 535e21a..7c532f0 100644 TRACE("Removing the pbo attached to surface %p.\n", surface); diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index faadea1..467169f 100644 +index 6532ab5..9d6583d 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -202,7 +202,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -203,7 +203,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, } else if (volume->resource.locations & WINED3D_LOCATION_BUFFER) { -- struct wined3d_bo_address data = {volume->resource.buffer_object, NULL}; -+ struct wined3d_bo_address data = {volume->resource.buffer->name, NULL}; +- struct wined3d_const_bo_address data = {volume->resource.buffer_object, NULL}; ++ struct wined3d_const_bo_address data = {volume->resource.buffer->name, NULL}; wined3d_volume_upload_data(volume, context, &data); } else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) -@@ -251,12 +251,12 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, +@@ -252,12 +252,12 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, break; case WINED3D_LOCATION_BUFFER: @@ -225,10 +225,10 @@ index faadea1..467169f 100644 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 b9831fd..8477d0c 100644 +index e2e5423..b1ec269 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1960,6 +1960,14 @@ struct wined3d_state +@@ -1971,6 +1971,14 @@ struct wined3d_state DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; }; @@ -243,7 +243,7 @@ index b9831fd..8477d0c 100644 #define WINED3D_UNMAPPED_STAGE ~0U /* Multithreaded flag. Removed from the public header to signal that -@@ -2065,6 +2073,11 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) D +@@ -2076,6 +2084,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; @@ -255,7 +255,7 @@ index b9831fd..8477d0c 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2114,7 +2127,7 @@ struct wined3d_resource +@@ -2125,7 +2138,7 @@ struct wined3d_resource UINT size; DWORD priority; void *heap_memory, *user_memory, *bitmap_data; @@ -265,5 +265,5 @@ index b9831fd..8477d0c 100644 struct list resource_list_entry; DWORD locations; -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-volume-resource-data-through-the-CS.patch b/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-volume-resource-data-through-the-CS.patch index aaa4e6a4..28e53d31 100644 --- a/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-volume-resource-data-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-volume-resource-data-through-the-CS.patch @@ -1,4 +1,4 @@ -From 6237370d85227ef7db8888705128156918fcafc3 Mon Sep 17 00:00:00 2001 +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. @@ -70,10 +70,10 @@ index 40cd85d..9cba57b 100644 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 218118d..a30acab 100644 +index a223f43..fb7ec1a 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c -@@ -295,10 +295,8 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) +@@ -296,10 +296,8 @@ void wined3d_volume_destroy(struct wined3d_volume *volume) TRACE("volume %p.\n", volume); resource_cleanup(&volume->resource); @@ -85,7 +85,7 @@ index 218118d..a30acab 100644 } static void volume_unload(struct wined3d_resource *resource) -@@ -339,6 +337,11 @@ ULONG CDECL wined3d_volume_incref(struct wined3d_volume *volume) +@@ -340,6 +338,11 @@ ULONG CDECL wined3d_volume_incref(struct wined3d_volume *volume) return wined3d_texture_incref(volume->container); } @@ -98,18 +98,18 @@ index 218118d..a30acab 100644 { TRACE("Forwarding to container %p.\n", volume->container); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 76c0708..2b808dd 100644 +index ffcdcb4..8537000 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2343,6 +2343,7 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context * +@@ -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_bo_address *data) DECLSPEC_HIDDEN; + const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; +void wined3d_volume_cleanup_cs(struct wined3d_volume *volume) DECLSPEC_HIDDEN; struct wined3d_surface_dib { -@@ -2710,6 +2711,7 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu +@@ -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; @@ -118,5 +118,5 @@ index 76c0708..2b808dd 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch b/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch index 085b18f2..ad31b0b8 100644 --- a/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch +++ b/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch @@ -1,4 +1,4 @@ -From ffa89bb6de1ecc4769b6aae7f0c66b1c18296c21 Mon Sep 17 00:00:00 2001 +From 4cd3608532db258e1b970b68b696437e273cddde 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. @@ -70,7 +70,7 @@ index 9cba57b..7675214 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 4a1cf30..4d8bd1c 100644 +index 89c4c59..65bffab 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -36,20 +36,10 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); @@ -135,7 +135,7 @@ index 4a1cf30..4d8bd1c 100644 } void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, -@@ -5324,8 +5321,6 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text +@@ -5470,8 +5467,6 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text { ERR("Private setup failed, hr %#x.\n", hr); surface_cleanup(surface); @@ -144,7 +144,7 @@ index 4a1cf30..4d8bd1c 100644 return hr; } -@@ -5368,7 +5363,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w +@@ -5514,7 +5509,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); @@ -154,18 +154,18 @@ index 4a1cf30..4d8bd1c 100644 } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 2b808dd..afb31c2 100644 +index 8537000..5b1a286 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2455,6 +2455,7 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ +@@ -2470,6 +2470,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; -@@ -2712,6 +2713,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, + 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; +@@ -2730,6 +2731,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; @@ -174,5 +174,5 @@ index 2b808dd..afb31c2 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-texture-resources-through-the-cs.patch b/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-texture-resources-through-the-cs.patch index 4be13f5d..a2c3009b 100644 --- a/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-texture-resources-through-the-cs.patch +++ b/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-texture-resources-through-the-cs.patch @@ -1,4 +1,4 @@ -From 92b80eca71961fa3669d9da8cb64a62e6f556184 Mon Sep 17 00:00:00 2001 +From 76c15351903191f31484a66c498dbfc39e763a5a 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. @@ -70,7 +70,7 @@ index 7675214..5e4aa53 100644 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 f7988e5..f055d5e 100644 +index 3fc020e..49bd366 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -131,17 +131,26 @@ static void wined3d_texture_unload_gl_texture(struct wined3d_texture *texture) @@ -127,7 +127,7 @@ index f7988e5..f055d5e 100644 } return refcount; -@@ -1040,12 +1047,14 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi +@@ -1092,12 +1099,14 @@ 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); @@ -142,7 +142,7 @@ index f7988e5..f055d5e 100644 return WINED3DERR_INVALIDCALL; } -@@ -1055,12 +1064,14 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi +@@ -1107,12 +1116,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"); @@ -150,14 +150,14 @@ index f7988e5..f055d5e 100644 return WINED3DERR_INVALIDCALL; } - if (levels > 1) + if (levels != 1) { - WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n"); + WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); + HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } - -@@ -1088,6 +1099,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi + } +@@ -1133,6 +1144,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); @@ -165,7 +165,7 @@ index f7988e5..f055d5e 100644 return WINED3DERR_INVALIDCALL; } } -@@ -1097,6 +1109,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi +@@ -1142,6 +1154,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); @@ -173,7 +173,7 @@ index f7988e5..f055d5e 100644 return hr; } -@@ -1159,6 +1172,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 +@@ -1204,6 +1217,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); @@ -181,7 +181,7 @@ index f7988e5..f055d5e 100644 return WINED3DERR_INVALIDCALL; } -@@ -1189,6 +1203,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 +@@ -1234,6 +1248,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"); @@ -189,7 +189,7 @@ index f7988e5..f055d5e 100644 return WINED3DERR_INVALIDCALL; } } -@@ -1201,12 +1216,14 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 +@@ -1246,12 +1261,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"); @@ -197,14 +197,14 @@ index f7988e5..f055d5e 100644 return WINED3DERR_INVALIDCALL; } - if (levels > 1) + if (levels != 1) { - WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning WINED3DERR_INVALIDCALL.\n"); + WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); + HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } - -@@ -1222,6 +1239,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 + } +@@ -1260,6 +1277,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); @@ -212,7 +212,7 @@ index f7988e5..f055d5e 100644 return hr; } -@@ -1382,12 +1400,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct +@@ -1446,12 +1464,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); @@ -227,7 +227,7 @@ index f7988e5..f055d5e 100644 return WINED3DERR_INVALIDCALL; } -@@ -1397,12 +1417,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct +@@ -1461,12 +1481,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"); @@ -235,14 +235,14 @@ index f7988e5..f055d5e 100644 return WINED3DERR_INVALIDCALL; } - if (levels > 1) + if (levels != 1) { - WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n"); + WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); + HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } - -@@ -1437,6 +1459,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct + } +@@ -1494,6 +1516,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); @@ -250,7 +250,7 @@ index f7988e5..f055d5e 100644 return WINED3DERR_INVALIDCALL; } } -@@ -1446,6 +1469,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct +@@ -1503,6 +1526,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); @@ -258,7 +258,7 @@ index f7988e5..f055d5e 100644 return hr; } -@@ -1516,7 +1540,6 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct +@@ -1579,7 +1603,6 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct if (FAILED(hr)) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -267,10 +267,10 @@ index f7988e5..f055d5e 100644 } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index afb31c2..6382375 100644 +index 5b1a286..2f5fbf3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2293,6 +2293,7 @@ static inline struct gl_texture *wined3d_texture_get_gl_texture(struct wined3d_t +@@ -2307,6 +2307,7 @@ static inline struct gl_texture *wined3d_texture_get_gl_texture(struct wined3d_t void wined3d_texture_apply_state_changes(struct wined3d_texture *texture, const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1], const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; @@ -278,7 +278,7 @@ index afb31c2..6382375 100644 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, -@@ -2714,6 +2715,7 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, +@@ -2732,6 +2733,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; @@ -287,5 +287,5 @@ index afb31c2..6382375 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0144-wined3d-Remove-software-cursor-support.patch b/patches/wined3d-CSMT_Main/0144-wined3d-Remove-software-cursor-support.patch index 7427de69..05653611 100644 --- a/patches/wined3d-CSMT_Main/0144-wined3d-Remove-software-cursor-support.patch +++ b/patches/wined3d-CSMT_Main/0144-wined3d-Remove-software-cursor-support.patch @@ -1,4 +1,4 @@ -From 3eb3def034aaacfd9f65b3f6f5f750cccbbf6c42 Mon Sep 17 00:00:00 2001 +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. @@ -8,13 +8,13 @@ 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 | 83 +----------------------------------------- - dlls/wined3d/swapchain.c | 21 ----------- + dlls/wined3d/device.c | 66 ++---------------------------------------- + dlls/wined3d/swapchain.c | 21 -------------- dlls/wined3d/wined3d_private.h | 1 - - 3 files changed, 2 insertions(+), 103 deletions(-) + 3 files changed, 2 insertions(+), 86 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 2410547..b3f75ba 100644 +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) @@ -26,20 +26,18 @@ index 2410547..b3f75ba 100644 /* Release the buffers (with sanity checks). * FIXME: Move this move into a separate patch. I think the idea -@@ -3984,77 +3982,12 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, +@@ -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; -- struct wined3d_surface *surface; -- BYTE *src_data, *dst_data; -- unsigned int src_pitch; -- unsigned int i; +- HRESULT hr; - - if (FAILED(wined3d_surface_map(cursor_image, &map_desc, NULL, WINED3D_MAP_READONLY))) - { @@ -47,8 +45,9 @@ index 2410547..b3f75ba 100644 - return NULL; - } - -- src_pitch = map_desc.row_pitch; -- src_data = map_desc.data; +- 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; @@ -61,31 +60,15 @@ index 2410547..b3f75ba 100644 - desc.depth = 1; - desc.size = 0; - -- if (FAILED(wined3d_texture_create(device, &desc, 1, WINED3D_SURFACE_MAPPABLE, -- NULL, &wined3d_null_parent_ops, &texture))) +- 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"); -- wined3d_surface_unmap(cursor_image); - return NULL; - } - -- surface = surface_from_resource(wined3d_texture_get_sub_resource(texture, 0)); -- if (FAILED(wined3d_surface_map(surface, &map_desc, NULL, WINED3D_MAP_DISCARD))) -- { -- ERR("Failed to map destination surface.\n"); -- wined3d_texture_decref(texture); -- wined3d_surface_unmap(cursor_image); -- return NULL; -- } -- -- dst_data = map_desc.data; -- -- for (i = 0; i < desc.height; ++i) -- memcpy(&dst_data[map_desc.row_pitch * i], &src_data[src_pitch * i], desc.width * 4); -- -- wined3d_surface_unmap(surface); -- wined3d_surface_unmap(cursor_image); -- - return texture; -} - @@ -104,7 +87,7 @@ index 2410547..b3f75ba 100644 if (cursor_image) { struct wined3d_display_mode mode; -@@ -4089,11 +4022,8 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device +@@ -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. */ @@ -118,7 +101,7 @@ index 2410547..b3f75ba 100644 device->cursorWidth = cursor_image->resource.width; device->cursorHeight = cursor_image->resource.height; -@@ -4193,10 +4123,6 @@ BOOL CDECL wined3d_device_show_cursor(struct wined3d_device *device, BOOL show) +@@ -4176,10 +4123,6 @@ BOOL CDECL wined3d_device_show_cursor(struct wined3d_device *device, BOOL show) else SetCursor(NULL); } @@ -129,7 +112,7 @@ index 2410547..b3f75ba 100644 return oldVisible; } -@@ -4353,11 +4279,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4336,11 +4279,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, wined3d_texture_decref(device->logo_texture); device->logo_texture = NULL; } @@ -142,10 +125,10 @@ index 2410547..b3f75ba 100644 if (device->state.fb.render_targets) diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 7ebdd1b..0a7b68d 100644 +index 1ccd18b..dbfc0d6 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c -@@ -449,27 +449,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT +@@ -454,27 +454,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT NULL, WINED3D_TEXF_POINT); } @@ -174,10 +157,10 @@ index 7ebdd1b..0a7b68d 100644 render_to_fbo = swapchain->render_to_fbo; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 6382375..2f8cab4 100644 +index 2f5fbf3..84343c6 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2037,7 +2037,6 @@ struct wined3d_device +@@ -2048,7 +2048,6 @@ struct wined3d_device UINT xScreenSpace; UINT yScreenSpace; UINT cursorWidth, cursorHeight; @@ -186,5 +169,5 @@ index 6382375..2f8cab4 100644 /* The Wine logo texture */ -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch b/patches/wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch index 904846af..85d939a4 100644 --- a/patches/wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch +++ b/patches/wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch @@ -1,4 +1,4 @@ -From 09b215acf85da6b34638c3454ff3d8e00d29ab07 Mon Sep 17 00:00:00 2001 +From a08ec4508ae2f63e2545b51a6b177e672c7dbdaf 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. @@ -104,10 +104,10 @@ index b152a0d..44930c1 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 3c5489f..1ccbe35 100644 +index 0221ebd..b6bb67e 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -2468,48 +2468,23 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2613,48 +2613,23 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, return wined3d_resource_map(&surface->resource, map_desc, rect ? &box : NULL, flags); } @@ -159,7 +159,7 @@ index 3c5489f..1ccbe35 100644 } if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM -@@ -2522,35 +2497,40 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2667,35 +2642,40 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) if (context) context_release(context); @@ -220,7 +220,7 @@ index 3c5489f..1ccbe35 100644 && surface->resource.map_binding != WINED3D_LOCATION_DIB)) { /* The game Salammbo modifies the surface contents without mapping the surface between -@@ -2571,6 +2551,26 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) +@@ -2716,6 +2696,26 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) if (context) context_release(context); } @@ -248,19 +248,19 @@ index 3c5489f..1ccbe35 100644 return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 63b67da..3abd0a8 100644 +index 3f491e0..19596f3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2458,6 +2458,8 @@ void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_ +@@ -2474,6 +2474,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; -@@ -2727,6 +2729,8 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, + 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; +@@ -2746,6 +2748,8 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -270,5 +270,5 @@ index 63b67da..3abd0a8 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/0174-wined3d-Fix-some-uninitialized-memory-accesses.patch b/patches/wined3d-CSMT_Main/0174-wined3d-Fix-some-uninitialized-memory-accesses.patch index 7e64953f..420cc1b1 100644 --- a/patches/wined3d-CSMT_Main/0174-wined3d-Fix-some-uninitialized-memory-accesses.patch +++ b/patches/wined3d-CSMT_Main/0174-wined3d-Fix-some-uninitialized-memory-accesses.patch @@ -1,4 +1,4 @@ -From a8a191d592e1c7202929d272b37afe5a2a347f40 Mon Sep 17 00:00:00 2001 +From ae26ae32cd73d0ca290196ac9dc02a641c77ed54 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 14 Dec 2014 15:24:44 +0100 Subject: wined3d: Fix some uninitialized memory accesses. @@ -9,18 +9,18 @@ Subject: wined3d: Fix some uninitialized memory accesses. 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 7bc6aeb..50376f7 100644 +index be1ecd6..93331b4 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3370,7 +3370,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device - static HRESULT device_update_volume(struct wined3d_context *context, +@@ -3373,7 +3373,6 @@ 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; - HRESULT hr; - struct wined3d_bo_address data; TRACE("src_volume %p, dst_volume %p.\n", -@@ -3395,7 +3394,7 @@ static HRESULT device_update_volume(struct wined3d_context *context, + src_volume, dst_volume); +@@ -3397,7 +3396,7 @@ static HRESULT device_update_volume(struct wined3d_context *context, wined3d_volume_upload_data(dst_volume, context, &data); wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -30,7 +30,7 @@ index 7bc6aeb..50376f7 100644 /* Context activation is done by the caller */ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 9ab0738..9a2bcf7 100644 +index bf37b7d..9c3f7ce 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -770,7 +770,7 @@ static void surface_blt_fbo(const struct wined3d_device *device, @@ -43,5 +43,5 @@ index 9ab0738..9a2bcf7 100644 } else -- -2.1.3 +1.9.1 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index c72c6a41..8674f1b2 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -497,13 +497,13 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c +#endif /* STAGING_CSMT */ /* Context activation is done by the caller. */ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, - const struct wined3d_bo_address *data) -@@ -85,6 +100,22 @@ - HeapFree(GetProcessHeap(), 0, mem); + const struct wined3d_const_bo_address *data) +@@ -86,6 +101,22 @@ + HeapFree(GetProcessHeap(), 0, converted_mem); } +#if !defined(STAGING_CSMT) -+static void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) ++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; @@ -521,7 +521,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c /* 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) -@@ -120,8 +151,33 @@ +@@ -121,8 +152,33 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) { wined3d_resource_free_sysmem(&volume->resource); @@ -555,7 +555,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } /* Context activation is done by the caller. */ -@@ -163,6 +219,7 @@ +@@ -164,6 +220,7 @@ return TRUE; } @@ -563,7 +563,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c /* Context activation is done by the caller. */ static void wined3d_volume_load_location(struct wined3d_resource *resource, -@@ -173,6 +230,22 @@ +@@ -174,6 +231,22 @@ TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location), wined3d_debug_location(volume->resource.locations)); @@ -586,7 +586,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if ((volume->resource.access_flags & required_access) != required_access) { -@@ -191,6 +264,7 @@ +@@ -192,6 +265,7 @@ && !(volume->container->flags & WINED3D_TEXTURE_SRGB_ALLOCATED))) ERR("Trying to load (s)RGB texture without prior allocation.\n"); @@ -594,7 +594,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (volume->resource.locations & WINED3D_LOCATION_DISCARDED) { TRACE("Volume previously discarded, nothing to do.\n"); -@@ -220,6 +294,37 @@ +@@ -221,6 +295,37 @@ return; } wined3d_resource_validate_location(&volume->resource, location); @@ -606,12 +606,12 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c + } + else if (volume->locations & WINED3D_LOCATION_SYSMEM) + { -+ struct wined3d_bo_address data = {0, volume->resource.heap_memory}; ++ struct wined3d_const_bo_address data = {0, volume->resource.heap_memory}; + wined3d_volume_upload_data(volume, context, &data); + } + else if (volume->locations & WINED3D_LOCATION_BUFFER) + { -+ struct wined3d_bo_address data = {volume->pbo, NULL}; ++ struct wined3d_const_bo_address data = {volume->pbo, NULL}; + wined3d_volume_upload_data(volume, context, &data); + } + else if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB) @@ -632,7 +632,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (wined3d_volume_can_evict(volume)) wined3d_volume_evict_sysmem(volume); -@@ -230,11 +335,24 @@ +@@ -231,11 +336,24 @@ if (!volume->resource.heap_memory) ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n"); @@ -657,7 +657,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -245,6 +363,7 @@ +@@ -246,6 +364,7 @@ else { FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n", @@ -665,7 +665,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_debug_location(volume->resource.locations)); return; } -@@ -260,6 +379,28 @@ +@@ -261,6 +380,28 @@ struct wined3d_bo_address data = {volume->resource.buffer->name, NULL}; if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) @@ -694,7 +694,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); else wined3d_texture_bind_and_dirtify(volume->container, context, TRUE); -@@ -269,6 +410,7 @@ +@@ -270,6 +411,7 @@ else { FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n", @@ -702,7 +702,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_debug_location(volume->resource.locations)); return; } -@@ -278,6 +420,17 @@ +@@ -279,6 +421,17 @@ default: FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location), wined3d_debug_location(volume->resource.locations)); @@ -720,7 +720,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } } -@@ -285,6 +438,7 @@ +@@ -286,6 +439,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); @@ -728,7 +728,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c wined3d_resource_load_location(&volume->resource, context, srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB); } -@@ -297,6 +451,51 @@ +@@ -298,6 +452,51 @@ resource_cleanup(&volume->resource); volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent); wined3d_cs_emit_volume_cleanup(device->cs, volume); @@ -780,7 +780,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } static void volume_unload(struct wined3d_resource *resource) -@@ -310,6 +509,7 @@ +@@ -311,6 +510,7 @@ TRACE("texture %p.\n", resource); @@ -788,7 +788,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (wined3d_resource_prepare_system_memory(&volume->resource)) { context = context_acquire(device, NULL); -@@ -322,6 +522,29 @@ +@@ -323,6 +523,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); @@ -818,7 +818,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } /* The texture name is managed by the container. */ -@@ -337,11 +560,13 @@ +@@ -338,11 +561,13 @@ return wined3d_texture_incref(volume->container); } @@ -832,7 +832,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c ULONG CDECL wined3d_volume_decref(struct wined3d_volume *volume) { TRACE("Forwarding to container %p.\n", volume->container); -@@ -368,6 +593,36 @@ +@@ -369,6 +594,36 @@ return &volume->resource; } @@ -869,7 +869,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume, const struct wined3d_box *box) { -@@ -393,6 +648,7 @@ +@@ -394,6 +649,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { @@ -877,7 +877,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c HRESULT hr; const struct wined3d_format *format = volume->resource.format; -@@ -420,6 +676,147 @@ +@@ -421,6 +677,147 @@ return hr; return hr; @@ -1025,7 +1025,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resource *resource) -@@ -429,6 +826,7 @@ +@@ -430,6 +827,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) { @@ -1033,7 +1033,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c HRESULT hr; if (volume->resource.unmap_dirtify) -@@ -438,6 +836,33 @@ +@@ -439,6 +837,33 @@ if (hr == WINEDDERR_NOTLOCKED) return WINED3DERR_INVALIDCALL; return hr; @@ -1067,7 +1067,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } static ULONG volume_resource_incref(struct wined3d_resource *resource) -@@ -450,6 +875,7 @@ +@@ -451,6 +876,7 @@ return wined3d_volume_decref(volume_from_resource(resource)); } @@ -1075,7 +1075,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c static void wined3d_volume_location_invalidated(struct wined3d_resource *resource, DWORD location) { struct wined3d_volume *volume = volume_from_resource(resource); -@@ -465,6 +891,13 @@ +@@ -466,6 +892,13 @@ volume_unload, wined3d_volume_location_invalidated, wined3d_volume_load_location, @@ -1089,7 +1089,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c }; static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, -@@ -501,7 +934,11 @@ +@@ -502,7 +935,11 @@ } volume->texture_level = level; @@ -1101,7 +1101,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC && gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] -@@ -509,7 +946,9 @@ +@@ -510,7 +947,9 @@ { wined3d_resource_free_sysmem(&volume->resource); volume->resource.map_binding = WINED3D_LOCATION_BUFFER; @@ -1761,7 +1761,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; -@@ -968,9 +998,14 @@ +@@ -979,9 +1009,14 @@ WORD use_map; /* MAX_ATTRIBS, 16 */ }; @@ -1776,7 +1776,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN; #define eps 1e-8f -@@ -1052,8 +1087,10 @@ +@@ -1063,8 +1098,10 @@ struct list entry; GLuint id; struct wined3d_context *context; @@ -1787,7 +1787,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; union wined3d_gl_query_object -@@ -1089,6 +1126,7 @@ +@@ -1100,6 +1137,7 @@ struct list entry; GLuint id; struct wined3d_context *context; @@ -1795,7 +1795,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT64 timestamp; }; -@@ -1124,6 +1162,12 @@ +@@ -1135,6 +1173,12 @@ for (i = 0; i < min(dst->rt_size, src->rt_size); i++) dst->render_targets[i] = src->render_targets[i]; } @@ -1808,7 +1808,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_context { -@@ -1139,7 +1183,9 @@ +@@ -1150,7 +1194,9 @@ 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 */ @@ -1818,7 +1818,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_swapchain *swapchain; struct wined3d_surface *current_rt; -@@ -1237,8 +1283,17 @@ +@@ -1248,8 +1294,17 @@ GLfloat fog_coord_value; GLfloat color[4], fogstart, fogend, fogcolor[4]; GLuint dummy_arbfp_prog; @@ -1836,7 +1836,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); -@@ -1366,8 +1421,12 @@ +@@ -1377,8 +1432,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; @@ -1849,7 +1849,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h 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, -@@ -1916,7 +1975,11 @@ +@@ -1927,7 +1986,11 @@ struct wined3d_state { DWORD flags; @@ -1861,7 +1861,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_vertex_declaration *vertex_declaration; struct wined3d_stream_output stream_output[MAX_STREAM_OUT]; -@@ -1961,6 +2024,7 @@ +@@ -1972,6 +2035,7 @@ DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; }; @@ -1869,7 +1869,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_gl_bo { GLuint name; -@@ -1969,6 +2033,7 @@ +@@ -1980,6 +2044,7 @@ UINT size; }; @@ -1877,7 +1877,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h #define WINED3D_UNMAPPED_STAGE ~0U /* Multithreaded flag. Removed from the public header to signal that -@@ -2024,10 +2089,21 @@ +@@ -2035,10 +2100,21 @@ struct wined3d_rendertarget_view *back_buffer_view; struct wined3d_swapchain **swapchains; UINT swapchain_count; @@ -1899,7 +1899,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* For rendering to a texture using glCopyTexImage */ GLuint depth_blt_texture; -@@ -2038,6 +2114,9 @@ +@@ -2049,6 +2125,9 @@ UINT xScreenSpace; UINT yScreenSpace; UINT cursorWidth, cursorHeight; @@ -1909,7 +1909,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HCURSOR hardwareCursor; /* The Wine logo texture */ -@@ -2069,6 +2148,7 @@ +@@ -2080,6 +2159,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; @@ -1917,7 +1917,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h 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, -@@ -2080,6 +2160,11 @@ +@@ -2091,6 +2171,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; @@ -1929,7 +1929,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2103,9 +2188,11 @@ +@@ -2114,9 +2199,11 @@ ULONG (*resource_incref)(struct wined3d_resource *resource); ULONG (*resource_decref)(struct wined3d_resource *resource); void (*resource_unload)(struct wined3d_resource *resource); @@ -1941,7 +1941,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_resource -@@ -2128,6 +2215,7 @@ +@@ -2139,6 +2226,7 @@ UINT depth; UINT size; DWORD priority; @@ -1949,7 +1949,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; struct wined3d_gl_bo *buffer, *map_buffer; UINT custom_row_pitch, custom_slice_pitch; -@@ -2135,6 +2223,11 @@ +@@ -2146,6 +2234,11 @@ DWORD locations; LONG access_fence; BOOL unmap_dirtify; @@ -1961,7 +1961,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2159,6 +2252,7 @@ +@@ -2170,6 +2263,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; @@ -1969,7 +1969,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_changed(struct wined3d_resource *resource, -@@ -2205,6 +2299,15 @@ +@@ -2216,6 +2310,15 @@ { while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); } @@ -1985,7 +1985,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -@@ -2295,7 +2398,9 @@ +@@ -2309,7 +2412,9 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture, const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1], const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; @@ -1995,7 +1995,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, -@@ -2329,9 +2434,16 @@ +@@ -2343,9 +2448,16 @@ struct wined3d_resource resource; struct wined3d_texture *container; @@ -2012,7 +2012,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) -@@ -2339,6 +2451,7 @@ +@@ -2353,6 +2465,7 @@ return CONTAINING_RECORD(resource, struct wined3d_volume, resource); } @@ -2020,7 +2020,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; -@@ -2351,6 +2464,22 @@ +@@ -2366,6 +2479,24 @@ struct wined3d_surface_dib { HBITMAP DIBsection; @@ -2029,11 +2029,13 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, + unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; +void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; ++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; ++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_bo_address *data) DECLSPEC_HIDDEN; ++ const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; + +struct wined3d_surface_dib +{ @@ -2043,7 +2045,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT bitmap_size; }; -@@ -2376,7 +2505,11 @@ +@@ -2391,7 +2522,11 @@ struct wined3d_surface_ops { HRESULT (*surface_private_setup)(struct wined3d_surface *surface); @@ -2055,33 +2057,33 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_surface -@@ -2384,12 +2517,25 @@ +@@ -2399,12 +2534,25 @@ struct wined3d_resource resource; const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; +#if defined(STAGING_CSMT) - - DWORD flags; - - UINT pow2Width; - UINT pow2Height; - -+#else /* STAGING_CSMT */ -+ void *user_memory; -+ DWORD locations; + + DWORD flags; + + UINT pow2Width; + UINT pow2Height; + ++#else /* STAGING_CSMT */ ++ void *user_memory; ++ DWORD locations; + + DWORD flags; + + UINT pow2Width; + UINT pow2Height; + + /* PBO */ + GLuint pbo; +#endif /* STAGING_CSMT */ GLuint rb_multisample; GLuint rb_resolved; GLenum texture_target; -@@ -2435,10 +2581,19 @@ +@@ -2450,10 +2598,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 +2103,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; -@@ -2450,6 +2605,7 @@ +@@ -2465,6 +2622,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 +2111,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; -@@ -2465,6 +2621,18 @@ +@@ -2483,6 +2641,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; @@ -2120,6 +2122,9 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h + 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; + +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; @@ -2128,7 +2133,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Surface flags: */ #define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */ -@@ -2507,8 +2675,10 @@ +@@ -2525,8 +2698,10 @@ BOOL half_float_conv_needed; }; @@ -2139,7 +2144,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_saved_states { DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; -@@ -2576,6 +2746,7 @@ +@@ -2594,6 +2769,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2147,7 +2152,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -2626,6 +2797,32 @@ +@@ -2644,6 +2820,32 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; @@ -2180,7 +2185,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; -@@ -2673,6 +2870,7 @@ +@@ -2691,6 +2893,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; @@ -2188,7 +2193,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, -@@ -2732,6 +2930,7 @@ +@@ -2750,6 +2953,7 @@ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -2196,7 +2201,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -@@ -2746,8 +2945,12 @@ +@@ -2764,8 +2968,12 @@ struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -2209,7 +2214,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_query -@@ -2761,12 +2964,16 @@ +@@ -2779,12 +2987,16 @@ enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -2226,7 +2231,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other * fixed function semantics as D3DCOLOR or FLOAT16 */ -@@ -2793,7 +3000,9 @@ +@@ -2811,7 +3023,9 @@ GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -2236,7 +2241,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -2818,11 +3027,15 @@ +@@ -2836,11 +3050,15 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2252,7 +2257,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -2860,8 +3073,10 @@ +@@ -2878,8 +3096,10 @@ return surface_from_resource(resource); } @@ -2263,7 +2268,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_shader_resource_view { LONG refcount; -@@ -2874,8 +3089,12 @@ +@@ -2892,8 +3112,12 @@ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, @@ -2276,7 +2281,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_swapchain -@@ -2915,8 +3134,10 @@ +@@ -2933,8 +3157,10 @@ HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -2287,7 +2292,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /***************************************************************************** * Utility function prototypes -@@ -3135,7 +3356,9 @@ +@@ -3153,7 +3379,9 @@ void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_shader_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN; BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN; @@ -3771,9 +3776,9 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +static HRESULT device_update_volume(struct wined3d_device *device, + 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; + struct wined3d_context *context; + + TRACE("device %p, src_volume %p, dst_volume %p.\n", @@ -4070,7 +4075,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_fb_state *fb = &device->state.fb; struct wined3d_rendertarget_view *prev; -@@ -3957,6 +4422,96 @@ +@@ -3957,6 +4422,79 @@ { TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n", device, x_hotspot, y_hotspot, cursor_image); @@ -4096,13 +4101,11 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +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; -+ struct wined3d_surface *surface; -+ BYTE *src_data, *dst_data; -+ unsigned int src_pitch; -+ unsigned int i; ++ HRESULT hr; + + if (FAILED(wined3d_surface_map(cursor_image, &map_desc, NULL, WINED3D_MAP_READONLY))) + { @@ -4110,8 +4113,9 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c + return NULL; + } + -+ src_pitch = map_desc.row_pitch; -+ src_data = map_desc.data; ++ 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; @@ -4124,31 +4128,15 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c + desc.depth = 1; + desc.size = 0; + -+ if (FAILED(wined3d_texture_create(device, &desc, 1, WINED3D_SURFACE_MAPPABLE, -+ NULL, &wined3d_null_parent_ops, &texture))) ++ 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"); -+ wined3d_surface_unmap(cursor_image); + return NULL; + } + -+ surface = surface_from_resource(wined3d_texture_get_sub_resource(texture, 0)); -+ if (FAILED(wined3d_surface_map(surface, &map_desc, NULL, WINED3D_MAP_DISCARD))) -+ { -+ ERR("Failed to map destination surface.\n"); -+ wined3d_texture_decref(texture); -+ wined3d_surface_unmap(cursor_image); -+ return NULL; -+ } -+ -+ dst_data = map_desc.data; -+ -+ for (i = 0; i < desc.height; ++i) -+ memcpy(&dst_data[map_desc.row_pitch * i], &src_data[src_pitch * i], desc.width * 4); -+ -+ wined3d_surface_unmap(surface); -+ wined3d_surface_unmap(cursor_image); -+ + return texture; +} + @@ -4167,7 +4155,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (cursor_image) { -@@ -3992,8 +4547,16 @@ +@@ -3992,8 +4530,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. */ @@ -4184,7 +4172,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->cursorWidth = cursor_image->resource.width; device->cursorHeight = cursor_image->resource.height; -@@ -4093,6 +4656,12 @@ +@@ -4093,6 +4639,12 @@ else SetCursor(NULL); } @@ -4197,7 +4185,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return oldVisible; } -@@ -4103,8 +4672,10 @@ +@@ -4103,8 +4655,10 @@ TRACE("device %p.\n", device); @@ -4208,7 +4196,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) { TRACE("Checking resource %p for eviction.\n", resource); -@@ -4112,6 +4683,7 @@ +@@ -4112,6 +4666,7 @@ if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) { TRACE("Evicting %p.\n", resource); @@ -4216,7 +4204,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_evict_resource(device->cs, resource); } } -@@ -4130,6 +4702,37 @@ +@@ -4130,6 +4685,37 @@ context = context_acquire(device, NULL); gl_info = context->gl_info; @@ -4254,7 +4242,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->depth_blt_texture) { -@@ -4150,6 +4753,7 @@ +@@ -4150,6 +4736,7 @@ HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -4262,7 +4250,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c swapchain->num_contexts = 0; } -@@ -4169,6 +4773,14 @@ +@@ -4169,6 +4756,14 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { @@ -4277,7 +4265,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HRESULT hr; if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4185,6 +4797,7 @@ +@@ -4185,6 +4780,7 @@ return hr; } @@ -4285,7 +4273,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); if (FAILED(hr)) { -@@ -4195,6 +4808,34 @@ +@@ -4195,6 +4791,34 @@ } wined3d_cs_emit_create_dummy_textures(device->cs); @@ -4320,7 +4308,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4214,8 +4855,10 @@ +@@ -4214,8 +4838,10 @@ unsigned int i; TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback); @@ -4331,7 +4319,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { -@@ -4231,9 +4874,21 @@ +@@ -4231,9 +4857,21 @@ wined3d_texture_decref(device->logo_texture); device->logo_texture = NULL; } @@ -4353,7 +4341,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4242,6 +4897,7 @@ +@@ -4242,6 +4880,7 @@ } wined3d_device_set_depth_stencil_view(device, NULL); @@ -4361,7 +4349,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (reset_state) { state_unbind_resources(&device->state); -@@ -4251,6 +4907,12 @@ +@@ -4251,6 +4890,12 @@ { wined3d_surface_decref(device->cs->onscreen_depth_stencil); device->cs->onscreen_depth_stencil = NULL; @@ -4374,7 +4362,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4263,6 +4925,7 @@ +@@ -4263,6 +4908,7 @@ } } @@ -4382,7 +4370,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Free implicit resources and wait for the command stream before modifying * swapchain parameters. After modifying the swapchain parameters a new GL * context may be acquired by the worker thread. This causes problems in the -@@ -4284,6 +4947,7 @@ +@@ -4284,6 +4930,7 @@ } device->cs->ops->finish(device->cs); @@ -4390,7 +4378,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Is it necessary to recreate the gl context? Actually every setting can be changed * on an existing gl context, so there's no real need for recreation. * -@@ -4419,6 +5083,13 @@ +@@ -4419,6 +5066,13 @@ } } @@ -4404,7 +4392,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (swapchain->desc.enable_auto_depth_stencil) { struct wined3d_resource_desc surface_desc; -@@ -4456,6 +5127,13 @@ +@@ -4456,6 +5110,13 @@ wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); } @@ -4418,7 +4406,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface( surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)), NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) -@@ -4536,12 +5214,20 @@ +@@ -4536,12 +5197,20 @@ } wined3d_cs_emit_reset_state(device->cs); state_cleanup(&device->state); @@ -4439,7 +4427,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize device state, hr %#x.\n", hr); device->update_state = &device->state; -@@ -4550,6 +5236,7 @@ +@@ -4550,6 +5219,7 @@ } else if (device->back_buffer_view) { @@ -4447,7 +4435,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_state *state = &device->state; wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE); -@@ -4565,6 +5252,24 @@ +@@ -4565,6 +5235,24 @@ state->scissor_rect.left = 0; state->scissor_rect.right = swapchain->desc.backbuffer_width; state->scissor_rect.bottom = swapchain->desc.backbuffer_height; @@ -4472,7 +4460,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4643,6 +5348,10 @@ +@@ -4643,6 +5331,10 @@ TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); @@ -4483,7 +4471,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c switch (type) { case WINED3D_RTYPE_SURFACE: -@@ -4653,6 +5362,7 @@ +@@ -4653,6 +5345,7 @@ for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -4491,7 +4479,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface) { ERR("Surface %p is still in use as render target %u.\n", surface, i); -@@ -4664,6 +5374,19 @@ +@@ -4664,6 +5357,19 @@ { ERR("Surface %p is still in use as depth/stencil buffer.\n", surface); device->state.fb.depth_stencil = NULL; @@ -4511,7 +4499,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } } break; -@@ -4804,7 +5527,11 @@ +@@ -4804,7 +5510,11 @@ device->blitter = adapter->blitter; @@ -4523,7 +4511,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) { ERR("Failed to initialize device state, hr %#x.\n", hr); -@@ -4892,6 +5619,7 @@ +@@ -4892,6 +5602,7 @@ else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -4531,7 +4519,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Context activation is done by the caller */ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, -@@ -4945,3 +5673,4 @@ +@@ -4945,3 +5656,4 @@ wined3d_device_destroy_bo(device, context, bo); } @@ -5951,7 +5939,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c texture->resource.format = format; texture->resource.multisample_type = multisample_type; -@@ -843,6 +879,7 @@ +@@ -866,6 +902,7 @@ static void texture2d_sub_resource_load(struct wined3d_resource *sub_resource, struct wined3d_context *context, BOOL srgb) { @@ -5959,7 +5947,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c surface_load(surface_from_resource(sub_resource), context, srgb); } -@@ -857,6 +894,19 @@ +@@ -880,6 +917,19 @@ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); context_release(context); wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); @@ -5979,21 +5967,34 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource) -@@ -868,7 +918,13 @@ +@@ -891,6 +941,7 @@ static void texture2d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) { +#if defined(STAGING_CSMT) wined3d_resource_invalidate_location(sub_resource, location); + } + +@@ -899,6 +950,18 @@ + struct wined3d_surface *surface = surface_from_resource(sub_resource); + + wined3d_resource_validate_location(&surface->resource, location); +#else /* STAGING_CSMT */ + struct wined3d_surface *surface = surface_from_resource(sub_resource); + + surface_invalidate_location(surface, location); ++} ++ ++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); +#endif /* STAGING_CSMT */ } - /* Context activation is done by the caller. */ -@@ -927,6 +983,7 @@ + static void texture2d_sub_resource_upload_data(struct wined3d_resource *sub_resource, +@@ -977,6 +1040,7 @@ if (gl_info->supported[APPLE_CLIENT_STORAGE]) { @@ -6001,7 +6002,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (surface->flags & (SFLAG_NONPOW2) || texture->flags & WINED3D_TEXTURE_CONVERTED) { -@@ -935,12 +992,26 @@ +@@ -985,12 +1049,26 @@ * WINED3D_TEXTURE_CONVERTED: The conversion destination memory is freed after loading the surface * heap_memory == NULL: Not defined in the extension. Seems to disable client storage effectively */ @@ -6028,7 +6029,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c surface->flags |= SFLAG_CLIENT; mem = surface->resource.heap_memory; -@@ -1008,6 +1079,7 @@ +@@ -1060,6 +1138,7 @@ wined3d_texture_unload_gl_texture(texture); } @@ -6036,7 +6037,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c static void wined3d_texture_load_location_invalidated(struct wined3d_resource *resource, DWORD location) { ERR("Should not be called on textures.\n"); -@@ -1027,6 +1099,13 @@ +@@ -1079,6 +1158,13 @@ wined3d_texture_unload, wined3d_texture_load_location_invalidated, wined3d_texture_load_location, @@ -6050,7 +6051,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c }; static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, -@@ -1043,6 +1122,7 @@ +@@ -1095,6 +1181,7 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6058,7 +6059,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1051,6 +1131,14 @@ +@@ -1103,6 +1190,14 @@ { WARN("(%p) : Tried to create not supported cube texture.\n", texture); HeapFree(GetProcessHeap(), 0, texture); @@ -6073,7 +6074,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1060,6 +1148,7 @@ +@@ -1112,6 +1207,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); @@ -6081,22 +6082,22 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1068,6 +1157,14 @@ +@@ -1120,6 +1216,14 @@ { - WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n"); + WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); +#else /* STAGING_CSMT */ + return WINED3DERR_INVALIDCALL; + } + -+ if (levels > 1) ++ if (levels != 1) + { -+ WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n"); ++ WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); +#endif /* STAGING_CSMT */ return WINED3DERR_INVALIDCALL; } - -@@ -1095,7 +1192,9 @@ + } +@@ -1140,7 +1244,9 @@ else { WARN("Attempted to create a NPOT cube texture (edge length %u) without GL support.\n", desc->width); @@ -6106,7 +6107,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1105,7 +1204,9 @@ +@@ -1150,7 +1256,9 @@ surface_flags, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x\n", hr); @@ -6116,7 +6117,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1168,7 +1269,9 @@ +@@ -1213,7 +1321,9 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6126,7 +6127,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1199,7 +1302,9 @@ +@@ -1244,7 +1354,9 @@ else { WARN("Attempted to create a mipmapped NPOT texture without unconditional NPOT support.\n"); @@ -6136,7 +6137,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1212,6 +1317,7 @@ +@@ -1257,6 +1369,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n"); @@ -6144,22 +6145,22 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1220,6 +1326,14 @@ +@@ -1265,6 +1378,14 @@ { - WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning WINED3DERR_INVALIDCALL.\n"); + WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); +#else /* STAGING_CSMT */ + return WINED3DERR_INVALIDCALL; + } + -+ if (levels > 1) ++ if (levels != 1) + { -+ WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning WINED3DERR_INVALIDCALL.\n"); ++ WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); +#endif /* STAGING_CSMT */ return WINED3DERR_INVALIDCALL; } - -@@ -1235,7 +1349,9 @@ + } +@@ -1273,7 +1394,9 @@ surface_flags, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6169,21 +6170,34 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1333,7 +1449,13 @@ +@@ -1371,6 +1494,7 @@ static void texture3d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) { +#if defined(STAGING_CSMT) wined3d_resource_invalidate_location(sub_resource, location); + } + +@@ -1379,6 +1503,18 @@ + struct wined3d_volume *volume = volume_from_resource(sub_resource); + + wined3d_resource_validate_location(&volume->resource, location); +#else /* STAGING_CSMT */ + struct wined3d_volume *volume = volume_from_resource(sub_resource); + + wined3d_volume_invalidate_location(volume, location); ++} ++ ++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); +#endif /* STAGING_CSMT */ } - static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) -@@ -1351,7 +1473,11 @@ + static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_resource, +@@ -1413,7 +1549,11 @@ void *mem = NULL; if (gl_info->supported[APPLE_CLIENT_STORAGE] && !format->convert @@ -6195,7 +6209,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c { TRACE("Enabling GL_UNPACK_CLIENT_STORAGE_APPLE for volume %p\n", volume); gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); -@@ -1396,6 +1522,7 @@ +@@ -1460,6 +1600,7 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6203,7 +6217,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1404,6 +1531,14 @@ +@@ -1468,6 +1609,14 @@ { WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture); HeapFree(GetProcessHeap(), 0, texture); @@ -6218,7 +6232,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1413,6 +1548,7 @@ +@@ -1477,6 +1626,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); @@ -6226,22 +6240,22 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1421,6 +1557,14 @@ +@@ -1485,6 +1635,14 @@ { - WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n"); + WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); +#else /* STAGING_CSMT */ + return WINED3DERR_INVALIDCALL; + } + -+ if (levels > 1) ++ if (levels != 1) + { -+ WARN("D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL.\n"); ++ WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); +#endif /* STAGING_CSMT */ return WINED3DERR_INVALIDCALL; } - -@@ -1455,7 +1599,9 @@ + } +@@ -1512,7 +1670,9 @@ { WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n", desc->width, desc->height, desc->depth); @@ -6251,7 +6265,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1465,7 +1611,9 @@ +@@ -1522,7 +1682,9 @@ 0, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6261,7 +6275,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1536,6 +1684,9 @@ +@@ -1599,6 +1761,9 @@ if (FAILED(hr)) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6925,8 +6939,8 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +#endif /* STAGING_CSMT */ wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); - surface_upload_data(dst_surface, gl_info, src_format, src_rect, src_row_pitch, dst_point, FALSE, &data); -@@ -1553,8 +1936,13 @@ + wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, +@@ -1554,8 +1937,13 @@ context_release(context); @@ -6940,7 +6954,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -1658,8 +2046,12 @@ +@@ -1659,8 +2047,12 @@ return GL_BACK; } @@ -6953,7 +6967,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; BOOL ck_changed; -@@ -1683,6 +2075,7 @@ +@@ -1684,6 +2076,7 @@ /* To perform the color key conversion we need a sysmem copy of * the surface. Make sure we have it. */ @@ -6961,7 +6975,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_prepare_map_memory(&surface->resource, context); wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); -@@ -1691,6 +2084,16 @@ +@@ -1692,6 +2085,16 @@ wined3d_texture_force_reload(surface->container); } else if (!(surface->resource.locations & location)) @@ -6978,7 +6992,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Reloading because surface is dirty.\n"); } -@@ -1700,7 +2103,11 @@ +@@ -1701,7 +2104,11 @@ return; } @@ -6990,7 +7004,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_evict_sysmem(surface); } -@@ -1783,6 +2190,7 @@ +@@ -1784,6 +2191,7 @@ void CDECL wined3d_surface_preload(struct wined3d_surface *surface) { @@ -6998,7 +7012,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c const struct wined3d_device *device = surface->resource.device; TRACE("surface %p.\n", surface); -@@ -1793,6 +2201,17 @@ +@@ -1794,6 +2202,17 @@ } wined3d_cs_emit_surface_preload(device->cs, surface); @@ -7016,7 +7030,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) -@@ -2000,6 +2419,7 @@ +@@ -2001,6 +2420,7 @@ { DeleteDC(surface->hDC); DeleteObject(surface->dib.DIBsection); @@ -7024,7 +7038,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.bitmap_data = NULL; surface->flags &= ~SFLAG_DIBSECTION; create_dib = TRUE; -@@ -2008,6 +2428,15 @@ +@@ -2009,6 +2429,15 @@ surface->resource.locations = 0; wined3d_resource_free_sysmem(&surface->resource); surface->resource.map_heap_memory = NULL; @@ -7040,7 +7054,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c width = texture_resource->width; height = texture_resource->height; -@@ -2033,7 +2462,11 @@ +@@ -2034,7 +2463,11 @@ else surface->flags &= ~SFLAG_NONPOW2; @@ -7052,7 +7066,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; valid_location = WINED3D_LOCATION_USER_MEMORY; -@@ -2069,11 +2502,19 @@ +@@ -2070,11 +2503,19 @@ if (!valid_location) { @@ -7072,7 +7086,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -2423,6 +2864,7 @@ +@@ -2424,6 +2865,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) { @@ -7080,7 +7094,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void *dst_data = NULL, *src_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const struct d3dfmt_converter_desc *conv; -@@ -2431,6 +2873,13 @@ +@@ -2432,6 +2874,13 @@ struct wined3d_surface *dst; struct wined3d_context *context = NULL; struct wined3d_device *device = source->resource.device; @@ -7094,7 +7108,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conv = find_converter(source->resource.format->id, to_fmt); if (!conv) -@@ -2454,6 +2903,7 @@ +@@ -2455,6 +2904,7 @@ } dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); @@ -7102,7 +7116,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_get_pitch(&source->resource, &src_row_pitch, &src_slice_pitch); wined3d_resource_get_pitch(&ret->resource, &dst_row_pitch, &dst_slice_pitch); -@@ -2494,6 +2944,32 @@ +@@ -2495,6 +2945,32 @@ if (context) context_release(context); return NULL; @@ -7135,7 +7149,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height, -@@ -2561,6 +3037,7 @@ +@@ -2562,6 +3038,7 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -7143,7 +7157,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p.\n", surface); -@@ -2578,6 +3055,39 @@ +@@ -2579,6 +3056,39 @@ { struct wined3d_box box; const struct wined3d_format *format = surface->resource.format; @@ -7183,7 +7197,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((format->flags & WINED3DFMT_FLAG_BLOCKS) && rect && !surface_check_block_align(surface, rect)) -@@ -2589,6 +3099,13 @@ +@@ -2590,6 +3100,13 @@ return WINED3DERR_INVALIDCALL; } @@ -7197,7 +7211,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Performance optimization: Count how often a surface is mapped, if it is * mapped regularly do not throw away the system memory copy. This avoids * the need to download the surface from OpenGL all the time. The surface -@@ -2604,6 +3121,7 @@ +@@ -2605,6 +3122,7 @@ } } @@ -7205,7 +7219,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (rect) { surface->lockedRect = *rect; -@@ -2668,22 +3186,121 @@ +@@ -2669,22 +3187,121 @@ WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->resource.format->id)); return WINED3DERR_INVALIDCALL; } @@ -7339,7 +7353,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) -@@ -2709,6 +3326,35 @@ +@@ -2710,6 +3327,35 @@ if (context) context_release(context); } @@ -7375,7 +7389,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -@@ -2728,6 +3374,7 @@ +@@ -2729,6 +3375,7 @@ surface->resource.map_count--; surface->flags &= ~SFLAG_DCINUSE; @@ -7383,7 +7397,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); return WINED3D_OK; -@@ -2763,6 +3410,40 @@ +@@ -2764,6 +3411,40 @@ context = context_acquire(device, surface); } @@ -7424,7 +7438,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context_apply_blit_state(context, device); gl_info = context->gl_info; -@@ -2850,12 +3531,16 @@ +@@ -2851,12 +3532,16 @@ checkGLcall("glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0)"); } @@ -7441,7 +7455,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Read the framebuffer contents into a texture. Note that this function -@@ -2915,6 +3600,85 @@ +@@ -2916,6 +3601,85 @@ } } @@ -7527,7 +7541,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Does a direct frame buffer -> texture copy. Stretching is done with single * pixel copy calls. */ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, -@@ -3021,8 +3785,13 @@ +@@ -3022,8 +3786,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. */ @@ -7541,7 +7555,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Uses the hardware to stretch and flip the image */ -@@ -3090,7 +3859,11 @@ +@@ -3091,7 +3860,11 @@ checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -7553,7 +7567,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3288,6 +4061,7 @@ +@@ -3289,6 +4062,7 @@ checkGLcall("glDeleteTextures(1, &backup)"); } @@ -7561,7 +7575,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering) -@@ -3299,6 +4073,17 @@ +@@ -3300,6 +4074,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); @@ -7579,7 +7593,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3329,6 +4114,7 @@ +@@ -3330,6 +4115,7 @@ rect->bottom = drawable_height - rect->bottom; } @@ -7587,7 +7601,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Context activation is done by the caller. */ static void surface_blt_to_drawable(const struct wined3d_device *device, struct wined3d_context *old_ctx, -@@ -3363,6 +4149,26 @@ +@@ -3364,6 +4150,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. */ @@ -7614,7 +7628,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_load(src_surface->container, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -3405,6 +4211,7 @@ +@@ -3406,6 +4212,7 @@ /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -7622,7 +7636,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering -@@ -3418,6 +4225,14 @@ +@@ -3419,6 +4226,14 @@ context = context_acquire(device, restore_rt); context_release(context); } @@ -7637,7 +7651,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) -@@ -3441,9 +4256,15 @@ +@@ -3442,9 +4257,15 @@ enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -7653,7 +7667,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, blt_fx %p, filter %s.\n", dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), -@@ -3568,7 +4389,9 @@ +@@ -3569,7 +4390,9 @@ /* Blit from offscreen surface to render target */ struct wined3d_color_key old_blt_key = src_surface->container->src_blt_color_key; DWORD old_color_key_flags = src_surface->container->color_key_flags; @@ -7663,7 +7677,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); -@@ -3602,6 +4425,7 @@ +@@ -3603,6 +4426,7 @@ wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT, NULL); } @@ -7671,7 +7685,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(device, dst_surface); surface_blt_to_drawable(device, context, filter, flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_ALPHATEST), -@@ -3614,6 +4438,18 @@ +@@ -3615,6 +4439,18 @@ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); @@ -7690,7 +7704,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -3688,6 +4524,7 @@ +@@ -3689,6 +4525,7 @@ { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -7698,7 +7712,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) || (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB))) -@@ -3696,6 +4533,15 @@ +@@ -3697,6 +4534,15 @@ surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; surface->resource.locations = location; @@ -7714,7 +7728,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Context activation is done by the caller. */ -@@ -3710,7 +4556,11 @@ +@@ -3711,7 +4557,11 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -7726,7 +7740,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { w = surface->ds_current_size.cx; h = surface->ds_current_size.cy; -@@ -3736,7 +4586,11 @@ +@@ -3737,7 +4587,11 @@ return; } @@ -7738,7 +7752,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Surface was discarded, no need copy data.\n"); switch (location) -@@ -3753,6 +4607,7 @@ +@@ -3754,6 +4608,7 @@ default: FIXME("Unhandled location %#x\n", location); } @@ -7746,7 +7760,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED; surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; -@@ -3764,6 +4619,19 @@ +@@ -3765,6 +4620,19 @@ { FIXME("No up to date depth stencil location.\n"); surface->resource.locations |= location; @@ -7766,7 +7780,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; return; -@@ -3828,9 +4696,13 @@ +@@ -3829,9 +4697,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7780,7 +7794,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else if (location == WINED3D_LOCATION_DRAWABLE) -@@ -3846,9 +4718,13 @@ +@@ -3847,9 +4719,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -7794,7 +7808,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else -@@ -3856,6 +4732,7 @@ +@@ -3857,6 +4733,7 @@ ERR("Invalid location (%#x) specified.\n", location); } @@ -7802,7 +7816,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; -@@ -3901,6 +4778,135 @@ +@@ -3902,6 +4779,135 @@ TRACE("Surface was discarded, nothing to do.\n"); return WINED3D_OK; } @@ -7938,7 +7952,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && wined3d_resource_is_offscreen(&surface->container->resource)) -@@ -3910,6 +4916,7 @@ +@@ -3911,6 +4917,7 @@ } surface_get_rect(surface, NULL, &r); @@ -7946,7 +7960,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -3978,6 +4985,66 @@ +@@ -3979,6 +4986,66 @@ RECT rect = {0, 0, surface->resource.width, surface->resource.height}; surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, @@ -8013,7 +8027,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c &rect, surface, dst_location, &rect); return WINED3D_OK; -@@ -3987,6 +5054,7 @@ +@@ -3988,6 +5055,7 @@ if (srgb) { @@ -8021,7 +8035,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) == WINED3D_LOCATION_TEXTURE_RGB) { -@@ -4015,6 +5083,39 @@ +@@ -4016,6 +5084,39 @@ wined3d_resource_prepare_system_memory(&surface->resource); wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM); } @@ -8061,7 +8075,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_prepare_texture(texture, context, srgb); wined3d_texture_bind_and_dirtify(texture, context, srgb); -@@ -4036,7 +5137,11 @@ +@@ -4037,7 +5138,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. */ @@ -8073,7 +8087,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -4045,6 +5150,7 @@ +@@ -4046,6 +5151,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -8081,7 +8095,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_prepare_map_memory(&surface->resource, context); wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_free_bo(&surface->resource); -@@ -4052,6 +5158,14 @@ +@@ -4053,6 +5159,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -8096,15 +8110,15 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -4097,6 +5211,7 @@ - - surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, &data); +@@ -4099,6 +5213,7 @@ + wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, + src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); +#if defined(STAGING_CSMT) HeapFree(GetProcessHeap(), 0, mem); return WINED3D_OK; -@@ -4120,6 +5235,31 @@ +@@ -4122,6 +5237,31 @@ struct wined3d_context *context, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); @@ -8136,7 +8150,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4127,6 +5267,7 @@ +@@ -4129,6 +5269,7 @@ if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -8144,7 +8158,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) { surface_load_ds_location(surface, context, location); -@@ -4146,11 +5287,53 @@ +@@ -4148,11 +5289,53 @@ } } @@ -8200,7 +8214,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -4159,6 +5342,7 @@ +@@ -4161,6 +5344,7 @@ case WINED3D_LOCATION_USER_MEMORY: case WINED3D_LOCATION_SYSMEM: case WINED3D_LOCATION_BUFFER: @@ -8208,7 +8222,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_load_sysmem(surface, context, location); break; -@@ -4176,6 +5360,24 @@ +@@ -4178,6 +5362,24 @@ if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) return; @@ -8233,7 +8247,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -4183,12 +5385,21 @@ +@@ -4185,12 +5387,21 @@ break; } @@ -8255,7 +8269,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; } -@@ -4282,6 +5493,7 @@ +@@ -4284,6 +5495,7 @@ const RECT *dst_rect, const struct wined3d_color *color) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8263,7 +8277,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_rendertarget_view view, *view_ptr = &view; struct wined3d_fb_state fb = {&view_ptr, NULL, 1}; struct wined3d_texture *texture = dst_surface->container; -@@ -4302,6 +5514,21 @@ +@@ -4304,6 +5516,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); @@ -8285,7 +8299,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4310,6 +5537,7 @@ +@@ -4312,6 +5539,7 @@ const RECT *dst_rect, float depth) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8293,7 +8307,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_rendertarget_view view; struct wined3d_fb_state fb = {NULL, &view}; struct wined3d_texture *texture = dst_surface->container; -@@ -4325,6 +5553,20 @@ +@@ -4327,6 +5555,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); @@ -8314,7 +8328,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4482,6 +5724,7 @@ +@@ -4484,6 +5726,7 @@ int bpp, srcheight, srcwidth, dstheight, dstwidth, width; const struct wined3d_format *src_format, *dst_format; struct wined3d_texture *src_texture = NULL; @@ -8322,7 +8336,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void *src_data = NULL, *dst_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const BYTE *sbase = NULL; -@@ -4512,6 +5755,23 @@ +@@ -4514,6 +5757,23 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -8346,7 +8360,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = dst_surface->resource.format; dst_format = src_format; } -@@ -4520,12 +5780,14 @@ +@@ -4522,12 +5782,14 @@ dst_format = dst_surface->resource.format; if (src_surface) { @@ -8361,7 +8375,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (dst_surface->resource.format->id != src_surface->resource.format->id) { if (!(src_texture = surface_convert_format(src_surface, dst_format->id))) -@@ -4536,9 +5798,13 @@ +@@ -4538,9 +5800,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -8375,7 +8389,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = src_surface->resource.format; } else -@@ -4546,8 +5812,12 @@ +@@ -4548,8 +5814,12 @@ src_format = dst_format; } @@ -8388,7 +8402,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_surface->resource.format->byte_count; -@@ -4558,12 +5828,24 @@ +@@ -4560,12 +5830,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -8413,7 +8427,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_format->flags & dst_format->flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4598,7 +5880,11 @@ +@@ -4600,7 +5882,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -8425,7 +8439,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format, flags, fx); goto release; } -@@ -4606,7 +5892,11 @@ +@@ -4608,7 +5894,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -8437,7 +8451,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c flags &= ~WINEDDBLT_COLORFILL; } -@@ -4620,12 +5910,21 @@ +@@ -4622,12 +5912,21 @@ switch (fx->dwROP) { case BLACKNESS: @@ -8459,7 +8473,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; case SRCCOPY: /* Well, we do that below? */ break; -@@ -4676,6 +5975,7 @@ +@@ -4678,6 +5977,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -8467,7 +8481,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4689,6 +5989,21 @@ +@@ -4691,6 +5991,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -8489,7 +8503,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c memcpy(dbuf, sbuf, width); } } -@@ -4698,8 +6013,13 @@ +@@ -4700,8 +6015,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -8503,7 +8517,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4708,9 +6028,15 @@ +@@ -4710,9 +6030,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8519,7 +8533,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4720,6 +6046,7 @@ +@@ -4722,6 +6048,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8527,7 +8541,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf = sbase + (sy >> 16) * src_row_pitch; if ((sy >> 16) == (last_sy >> 16)) -@@ -4727,6 +6054,15 @@ +@@ -4729,6 +6056,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -8543,7 +8557,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4773,6 +6109,7 @@ +@@ -4775,6 +6111,7 @@ } #undef STRETCH_ROW } @@ -8551,7 +8565,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dbuf += dst_row_pitch; last_sy = sy; } -@@ -4781,6 +6118,16 @@ +@@ -4783,6 +6120,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -8568,7 +8582,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff; DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff; if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE)) -@@ -4830,7 +6177,11 @@ +@@ -4832,7 +6179,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -8580,7 +8594,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4907,6 +6258,7 @@ +@@ -4909,6 +6260,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -8588,7 +8602,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4928,6 +6280,29 @@ +@@ -4930,6 +6282,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -8618,7 +8632,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c switch (bpp) { -@@ -4946,7 +6321,11 @@ +@@ -4948,7 +6323,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8630,7 +8644,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4977,10 +6356,12 @@ +@@ -4979,10 +6358,12 @@ } } @@ -8643,7 +8657,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4988,6 +6369,7 @@ +@@ -4990,6 +6371,7 @@ } release: @@ -8651,7 +8665,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (dst_data) { wined3d_resource_release_map_ptr(&dst_surface->resource, context); -@@ -5006,6 +6388,14 @@ +@@ -5008,6 +6390,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -8666,7 +8680,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -5040,6 +6430,7 @@ +@@ -5042,6 +6432,7 @@ cpu_blit_depth_fill, }; @@ -8674,7 +8688,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) -@@ -5047,6 +6438,16 @@ +@@ -5049,6 +6440,16 @@ struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_device *device = dst_surface->resource.device; DWORD src_ds_flags, dst_ds_flags; @@ -8691,7 +8705,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -5055,6 +6456,106 @@ +@@ -5057,6 +6458,106 @@ | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -8798,7 +8812,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5097,8 +6598,13 @@ +@@ -5099,8 +6600,13 @@ } scale = src_surface @@ -8812,7 +8826,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; dst_ds_flags = dst_surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); -@@ -5116,6 +6622,7 @@ +@@ -5118,6 +6624,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -8820,7 +8834,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) -@@ -5134,6 +6641,32 @@ +@@ -5136,6 +6643,32 @@ * implement those in the CPU blitter at the moment. */ if ((dst_surface->resource.locations & dst_surface->resource.map_binding) && (!src_surface || (src_surface->resource.locations & src_surface->resource.map_binding))) @@ -8853,7 +8867,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5152,6 +6685,7 @@ +@@ -5154,6 +6687,7 @@ if (!surface_convert_color_to_float(dst_surface, fx->u5.dwFillColor, &color)) goto fallback; @@ -8861,7 +8875,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) return; } -@@ -5162,6 +6696,18 @@ +@@ -5164,6 +6698,18 @@ /* Upload */ if ((src_surface->resource.locations & WINED3D_LOCATION_SYSMEM) && !(dst_surface->resource.locations & WINED3D_LOCATION_SYSMEM)) @@ -8880,7 +8894,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing upload because of scaling.\n"); -@@ -5169,6 +6715,7 @@ +@@ -5171,6 +6717,7 @@ TRACE("Not doing upload because of format conversion.\n"); else { @@ -8888,7 +8902,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c POINT dst_point = {dst_rect->left, dst_rect->top}; if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect))) -@@ -5181,6 +6728,15 @@ +@@ -5183,6 +6730,15 @@ context_release(context); } return; @@ -8904,7 +8918,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -5205,6 +6761,7 @@ +@@ -5207,6 +6763,7 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -8912,7 +8926,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; } -@@ -5401,6 +6958,50 @@ +@@ -5403,6 +6960,50 @@ wined3d_surface_location_invalidated, wined3d_surface_load_location, }; @@ -8963,7 +8977,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) -@@ -5468,7 +7069,11 @@ +@@ -5470,7 +7071,11 @@ } surface->container = container; @@ -8975,7 +8989,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5500,9 +7105,14 @@ +@@ -5502,9 +7107,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -8990,7 +9004,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } return hr; -@@ -5529,7 +7139,11 @@ +@@ -5531,7 +7141,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr);