Rebase against c74508d22528548940db3c8ac6a350064ca445e9.

This commit is contained in:
Zebediah Figura 2021-05-11 21:18:28 -05:00
parent 7f18df4633
commit 234a9fe775
7 changed files with 81 additions and 581 deletions

View File

@ -4,3 +4,5 @@ Fixes: [44089] Correcly align the mapinfo buffer.
Fixes: [41636] d3d11: Implement ID3D11Device2 GetImmediateContext1
#This is pretty dumb.
Depends: nvapi-Stub_DLL
# In the process of upstreaming!
Disabled: true

View File

@ -1,40 +1,32 @@
From 61b1b94434e2aaf3565051d49f1c7ebdecd8f1a2 Mon Sep 17 00:00:00 2001
From 37da9535927a82b7faf9ea40fa2de37a5270b71b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 7 Jul 2017 23:56:16 +0200
Subject: [PATCH] nvapi: Implement NvAPI_D3D11_SetDepthBoundsTest. (v2)
---
dlls/d3d11/device.c | 11 +++++++++++
dlls/d3d11/device.c | 10 ++++++++++
dlls/nvapi/nvapi.c | 29 +++++++++++++++++++++++++++++
dlls/nvapi/tests/nvapi.c | 17 +++++++++++++++++
include/wine/wined3d.h | 2 ++
4 files changed, 59 insertions(+)
4 files changed, 58 insertions(+)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 2738ff1a5bd..3e8f90297c7 100644
index 0819918b2a1..c5a64307359 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -347,6 +347,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_QueryInterface(ID3D11De
REFIID iid, void **out)
{
struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface);
+ struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1( (ID3D11DeviceContext1*)iface);
TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
@@ -361,6 +362,11 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_QueryInterface(ID3D11De
@@ -355,6 +355,11 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_context_QueryInterface(ID3D11Devic
{
*out = &context->ID3D11Multithread_iface;
}
+ else if (IsEqualGUID(iid, &IID_IWineD3DDevice))
+ {
+ *out = device->wined3d_device;
+ *out = context->device->wined3d_device;
+ return S_OK;
+ }
else
{
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
@@ -4268,6 +4274,11 @@ static HRESULT STDMETHODCALLTYPE d3d_device_inner_QueryInterface(IUnknown *iface
@@ -4264,6 +4269,11 @@ static HRESULT STDMETHODCALLTYPE d3d_device_inner_QueryInterface(IUnknown *iface
{
*out = &device->IWineDXGIDeviceParent_iface;
}
@ -150,7 +142,7 @@ index c8b66ac2fa3..87327c0e79b 100644
/* d3d9 tests */
wc.lpfnWndProc = DefWindowProcA;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 18dab157834..188c2a3cad1 100644
index dd1c15f14ed..62895974e50 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -29,6 +29,8 @@

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "44cb53bb37d3c40ea90aec6e35a9c08326b6e848"
echo "c74508d22528548940db3c8ac6a350064ca445e9"
}
# Show version information
@ -94,7 +94,6 @@ patch_enable_all ()
enable_comdlg32_lpstrFileTitle="$1"
enable_crypt32_CMS_Certificates="$1"
enable_cryptext_CryptExtOpenCER="$1"
enable_d3d11_Deferred_Context="$1"
enable_d3drm_IDirect3D3_support="$1"
enable_d3dx9_36_BumpLuminance="$1"
enable_d3dx9_36_CloneEffect="$1"
@ -328,9 +327,6 @@ patch_enable ()
cryptext-CryptExtOpenCER)
enable_cryptext_CryptExtOpenCER="$2"
;;
d3d11-Deferred_Context)
enable_d3d11_Deferred_Context="$2"
;;
d3drm-IDirect3D3-support)
enable_d3drm_IDirect3D3_support="$2"
;;
@ -1336,6 +1332,13 @@ if test "$enable_nvcuvid_CUDA_Video_Support" -eq 1; then
enable_nvapi_Stub_DLL=1
fi
if test "$enable_nvapi_Stub_DLL" -eq 1; then
if test "$enable_nvcuda_CUDA_Support" -gt 1; then
abort "Patchset nvcuda-CUDA_Support disabled, but nvapi-Stub_DLL depends on that."
fi
enable_nvcuda_CUDA_Support=1
fi
if test "$enable_ntdll_Builtin_Prot" -eq 1; then
if test "$enable_ntdll_WRITECOPY" -gt 1; then
abort "Patchset ntdll-WRITECOPY disabled, but ntdll-Builtin_Prot depends on that."
@ -1422,20 +1425,6 @@ if test "$enable_ddraw_version_check" -eq 1; then
enable_ddraw_Device_Caps=1
fi
if test "$enable_d3d11_Deferred_Context" -eq 1; then
if test "$enable_nvapi_Stub_DLL" -gt 1; then
abort "Patchset nvapi-Stub_DLL disabled, but d3d11-Deferred_Context depends on that."
fi
enable_nvapi_Stub_DLL=1
fi
if test "$enable_nvapi_Stub_DLL" -eq 1; then
if test "$enable_nvcuda_CUDA_Support" -gt 1; then
abort "Patchset nvcuda-CUDA_Support disabled, but nvapi-Stub_DLL depends on that."
fi
enable_nvcuda_CUDA_Support=1
fi
# Patchset Compiler_Warnings
# |
@ -1597,131 +1586,6 @@ if test "$enable_cryptext_CryptExtOpenCER" -eq 1; then
patch_apply cryptext-CryptExtOpenCER/0001-cryptext-Implement-CryptExtOpenCER.patch
fi
# Patchset nvcuda-CUDA_Support
# |
# | This patchset fixes the following Wine bugs:
# | * [#37664] MediaCoder needs CUDA for video encoding
# |
# | Modified files:
# | * configure.ac, dlls/nvcuda/Makefile.in, dlls/nvcuda/internal.c, dlls/nvcuda/nvcuda.c, dlls/nvcuda/nvcuda.h,
# | dlls/nvcuda/nvcuda.rc, dlls/nvcuda/nvcuda.spec, dlls/nvcuda/tests/Makefile.in, dlls/nvcuda/tests/nvcuda.c,
# | include/Makefile.in, include/cuda.h
# |
if test "$enable_nvcuda_CUDA_Support" -eq 1; then
patch_apply nvcuda-CUDA_Support/0001-include-Add-cuda.h.h.patch
patch_apply nvcuda-CUDA_Support/0002-nvcuda-Add-stub-dll.patch
patch_apply nvcuda-CUDA_Support/0003-nvcuda-First-implementation.patch
patch_apply nvcuda-CUDA_Support/0004-nvcuda-Implement-new-functions-added-in-CUDA-6.5.patch
patch_apply nvcuda-CUDA_Support/0005-nvcuda-Properly-wrap-undocumented-ContextStorage-int.patch
patch_apply nvcuda-CUDA_Support/0006-nvcuda-Emulate-two-d3d9-initialization-functions.patch
patch_apply nvcuda-CUDA_Support/0007-nvcuda-Properly-wrap-stream-callbacks-by-forwarding-.patch
patch_apply nvcuda-CUDA_Support/0008-nvcuda-Add-support-for-CUDA-7.0.patch
patch_apply nvcuda-CUDA_Support/0009-nvcuda-Implement-cuModuleLoad-wrapper-function.patch
patch_apply nvcuda-CUDA_Support/0010-nvcuda-Search-for-dylib-library-on-Mac-OS-X.patch
patch_apply nvcuda-CUDA_Support/0011-nvcuda-Add-semi-stub-for-cuD3D10GetDevice.patch
fi
# Patchset nvapi-Stub_DLL
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * nvcuda-CUDA_Support
# |
# | This patchset fixes the following Wine bugs:
# | * [#35062] Fix graphical corruption in FarCry 3 with NVIDIA drivers
# | * [#43862] CS:GO fails to start when nvapi cannot be initialized
# |
# | Modified files:
# | * configure.ac, dlls/d3d11/device.c, dlls/nvapi/Makefile.in, dlls/nvapi/nvapi.c, dlls/nvapi/nvapi.spec,
# | dlls/nvapi/tests/Makefile.in, dlls/nvapi/tests/nvapi.c, dlls/nvapi64/Makefile.in, dlls/nvapi64/nvapi64.spec,
# | dlls/wined3d/device.c, dlls/wined3d/wined3d.spec, include/Makefile.in, include/nvapi.h, include/wine/wined3d.h
# |
if test "$enable_nvapi_Stub_DLL" -eq 1; then
patch_apply nvapi-Stub_DLL/0001-nvapi-First-implementation.patch
patch_apply nvapi-Stub_DLL/0002-nvapi-Add-stubs-for-NvAPI_EnumLogicalGPUs-and-undocu.patch
patch_apply nvapi-Stub_DLL/0003-nvapi-Add-NvAPI_GetPhysicalGPUsFromLogicalGPU.patch
patch_apply nvapi-Stub_DLL/0004-nvapi-Add-stub-for-NvAPI_EnumPhysicalGPUs.patch
patch_apply nvapi-Stub_DLL/0005-nvapi-Add-stubs-for-NvAPI_GPU_GetFullName.patch
patch_apply nvapi-Stub_DLL/0006-nvapi-Explicity-return-NULL-for-0x33c7358c-and-0x593.patch
patch_apply nvapi-Stub_DLL/0007-nvapi-Add-stub-for-NvAPI_DISP_GetGDIPrimaryDisplayId.patch
patch_apply nvapi-Stub_DLL/0008-nvapi-Add-stub-for-EnumNvidiaDisplayHandle.patch
patch_apply nvapi-Stub_DLL/0009-nvapi-Add-stub-for-NvAPI_SYS_GetDriverAndBranchVersi.patch
patch_apply nvapi-Stub_DLL/0010-nvapi-Add-stub-for-NvAPI_Unload.patch
patch_apply nvapi-Stub_DLL/0011-nvapi-Add-stub-for-NvAPI_D3D_GetCurrentSLIState.patch
patch_apply nvapi-Stub_DLL/0012-nvapi-tests-Use-structure-to-list-imports.patch
patch_apply nvapi-Stub_DLL/0013-nvapi-Add-stub-for-NvAPI_GetLogicalGPUFromDisplay.patch
patch_apply nvapi-Stub_DLL/0014-nvapi-Add-stub-for-NvAPI_D3D_GetObjectHandleForResou.patch
patch_apply nvapi-Stub_DLL/0015-nvapi-Add-stub-for-NvAPI_D3D9_RegisterResource.patch
patch_apply nvapi-Stub_DLL/0016-nvapi-Improve-NvAPI_D3D_GetCurrentSLIState.patch
patch_apply nvapi-Stub_DLL/0017-nvapi-Implement-NvAPI_GPU_Get-Physical-Virtual-Frame.patch
patch_apply nvapi-Stub_DLL/0018-nvapi-Add-stub-for-NvAPI_GPU_GetGpuCoreCount.patch
patch_apply nvapi-Stub_DLL/0019-nvapi-Implement-NvAPI_D3D11_SetDepthBoundsTest.patch
patch_apply nvapi-Stub_DLL/0020-nvapi-Implement-NvAPI_D3D11_CreateDevice-and-NvAPI_D.patch
patch_apply nvapi-Stub_DLL/0021-Revert-wined3d-No-longer-export-wined3d_device_set_r.patch
fi
# Patchset d3d11-Deferred_Context
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * nvcuda-CUDA_Support, nvapi-Stub_DLL
# |
# | This patchset fixes the following Wine bugs:
# | * [#42191] Add semi-stub for D3D11 deferred context implementation
# | * [#43743] No 3D graphics in Wolcen: Lords of Mayhem
# | * [#44089] Correcly align the mapinfo buffer.
# | * [#41636] d3d11: Implement ID3D11Device2 GetImmediateContext1
# |
# | Modified files:
# | * dlls/d3d11/device.c, dlls/d3d11/tests/d3d11.c, dlls/wined3d/buffer.c, dlls/wined3d/resource.c, dlls/wined3d/texture.c,
# | dlls/wined3d/wined3d.spec, dlls/wined3d/wined3d_private.h, include/wine/wined3d.h
# |
if test "$enable_d3d11_Deferred_Context" -eq 1; then
patch_apply d3d11-Deferred_Context/0001-d3d11-Add-stub-deferred-rendering-context.patch
patch_apply d3d11-Deferred_Context/0002-wined3d-Add-wined3d_resource_map_info-function.patch
patch_apply d3d11-Deferred_Context/0003-d3d11-Initial-implementation-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0004-d3d11-Implement-CSSetShader-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0005-d3d11-Implement-CSSetConstantBuffers-for-deferred-co.patch
patch_apply d3d11-Deferred_Context/0006-d3d11-Implement-Dispatch-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0007-d3d11-Implement-CSSetUnorderedAccessViews-for-deferr.patch
patch_apply d3d11-Deferred_Context/0008-d3d11-Implement-ClearRenderTargetView-for-deferred-c.patch
patch_apply d3d11-Deferred_Context/0009-d3d11-Implement-Draw-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0010-d3d11-Implement-ClearDepthStencilView-for-deferred-c.patch
patch_apply d3d11-Deferred_Context/0011-d3d11-Implement-GSSetShader-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0012-d3d11-Implement-GSSetConstantBuffers-for-deferred-co.patch
patch_apply d3d11-Deferred_Context/0013-d3d11-Implement-CSSetShaderResources-for-deferred-co.patch
patch_apply d3d11-Deferred_Context/0014-d3d11-Implement-GSSetShaderResources-for-deferred-co.patch
patch_apply d3d11-Deferred_Context/0015-d3d11-Implement-HSSetShaderResources-for-deferred-co.patch
patch_apply d3d11-Deferred_Context/0016-d3d11-Implement-VSSetShaderResources-for-deferred-co.patch
patch_apply d3d11-Deferred_Context/0017-d3d11-Implement-CSSetSamplers-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0018-d3d11-Implement-GSSetSamplers-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0019-d3d11-Implement-HSSetSamplers-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0020-d3d11-Implement-VSSetSamplers-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0021-d3d11-Implement-Begin-and-End-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0022-d3d11-Implement-CopyResource-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0023-d3d11-Implement-SetResourceMinLOD-for-deferred-conte.patch
patch_apply d3d11-Deferred_Context/0024-d3d11-Implement-CopySubresourceRegion-for-deferred-c.patch
patch_apply d3d11-Deferred_Context/0025-d3d11-Implement-ResolveSubresource-for-deferred-cont.patch
patch_apply d3d11-Deferred_Context/0026-d3d11-Implement-CopyStructureCount-for-deferred-cont.patch
patch_apply d3d11-Deferred_Context/0027-d3d11-Implement-DrawAuto-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0028-d3d11-Implement-DrawInstanced-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0029-d3d11-Implement-DrawInstancedIndirect-for-deferred-c.patch
patch_apply d3d11-Deferred_Context/0030-d3d11-Implement-DrawIndexedInstancedIndirect-for-def.patch
patch_apply d3d11-Deferred_Context/0031-d3d11-Implement-ClearUnorderedAccessViewUint-for-def.patch
patch_apply d3d11-Deferred_Context/0032-d3d11-Implement-ClearUnorderedAccessViewFloat-for-de.patch
patch_apply d3d11-Deferred_Context/0033-d3d11-Implement-RsSetScissorRects-for-deferred-conte.patch
patch_apply d3d11-Deferred_Context/0034-d3d11-Implement-OMSetRenderTargetsAndUnorderedAccess.patch
patch_apply d3d11-Deferred_Context/0035-d3d11-Implement-SOSetTargets-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0036-d3d11-Implement-GenerateMips-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0037-d3d11-Implement-DispatchIndirect-for-deferred-contex.patch
patch_apply d3d11-Deferred_Context/0038-d3d11-Implement-SetPredication-for-deferred-contexts.patch
patch_apply d3d11-Deferred_Context/0039-d3d11-Implement-d3d11_deferred_context_UpdateSubreso.patch
patch_apply d3d11-Deferred_Context/0040-d3d11-Implement-restoring-of-state-after-executing-a.patch
patch_apply d3d11-Deferred_Context/0041-d3d11-Allow-NULL-pointer-for-initial-count-in-d3d11_.patch
patch_apply d3d11-Deferred_Context/0042-d3d11-Correctly-align-map-info-buffer.patch
patch_apply d3d11-Deferred_Context/0043-d3d11-tests-Add-a-basic-test-for-drawing-with-deferr.patch
patch_apply d3d11-Deferred_Context/0044-d3d11-Support-ID3D11DeviceContext1-for-deferred-cont.patch
patch_apply d3d11-Deferred_Context/0045-d3d11-Implement-ID3D11Device2-GetImmediateContext1.patch
fi
# Patchset d3drm-IDirect3D3-support
# |
# | This patchset fixes the following Wine bugs:
@ -2923,6 +2787,68 @@ if test "$enable_ntoskrnl_Stubs" -eq 1; then
patch_apply ntoskrnl-Stubs/0011-ntoskrnl.exe-Add-IoGetDeviceAttachmentBaseRef-stub.patch
fi
# Patchset nvcuda-CUDA_Support
# |
# | This patchset fixes the following Wine bugs:
# | * [#37664] MediaCoder needs CUDA for video encoding
# |
# | Modified files:
# | * configure.ac, dlls/nvcuda/Makefile.in, dlls/nvcuda/internal.c, dlls/nvcuda/nvcuda.c, dlls/nvcuda/nvcuda.h,
# | dlls/nvcuda/nvcuda.rc, dlls/nvcuda/nvcuda.spec, dlls/nvcuda/tests/Makefile.in, dlls/nvcuda/tests/nvcuda.c,
# | include/Makefile.in, include/cuda.h
# |
if test "$enable_nvcuda_CUDA_Support" -eq 1; then
patch_apply nvcuda-CUDA_Support/0001-include-Add-cuda.h.h.patch
patch_apply nvcuda-CUDA_Support/0002-nvcuda-Add-stub-dll.patch
patch_apply nvcuda-CUDA_Support/0003-nvcuda-First-implementation.patch
patch_apply nvcuda-CUDA_Support/0004-nvcuda-Implement-new-functions-added-in-CUDA-6.5.patch
patch_apply nvcuda-CUDA_Support/0005-nvcuda-Properly-wrap-undocumented-ContextStorage-int.patch
patch_apply nvcuda-CUDA_Support/0006-nvcuda-Emulate-two-d3d9-initialization-functions.patch
patch_apply nvcuda-CUDA_Support/0007-nvcuda-Properly-wrap-stream-callbacks-by-forwarding-.patch
patch_apply nvcuda-CUDA_Support/0008-nvcuda-Add-support-for-CUDA-7.0.patch
patch_apply nvcuda-CUDA_Support/0009-nvcuda-Implement-cuModuleLoad-wrapper-function.patch
patch_apply nvcuda-CUDA_Support/0010-nvcuda-Search-for-dylib-library-on-Mac-OS-X.patch
patch_apply nvcuda-CUDA_Support/0011-nvcuda-Add-semi-stub-for-cuD3D10GetDevice.patch
fi
# Patchset nvapi-Stub_DLL
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * nvcuda-CUDA_Support
# |
# | This patchset fixes the following Wine bugs:
# | * [#35062] Fix graphical corruption in FarCry 3 with NVIDIA drivers
# | * [#43862] CS:GO fails to start when nvapi cannot be initialized
# |
# | Modified files:
# | * configure.ac, dlls/d3d11/device.c, dlls/nvapi/Makefile.in, dlls/nvapi/nvapi.c, dlls/nvapi/nvapi.spec,
# | dlls/nvapi/tests/Makefile.in, dlls/nvapi/tests/nvapi.c, dlls/nvapi64/Makefile.in, dlls/nvapi64/nvapi64.spec,
# | dlls/wined3d/device.c, dlls/wined3d/wined3d.spec, include/Makefile.in, include/nvapi.h, include/wine/wined3d.h
# |
if test "$enable_nvapi_Stub_DLL" -eq 1; then
patch_apply nvapi-Stub_DLL/0001-nvapi-First-implementation.patch
patch_apply nvapi-Stub_DLL/0002-nvapi-Add-stubs-for-NvAPI_EnumLogicalGPUs-and-undocu.patch
patch_apply nvapi-Stub_DLL/0003-nvapi-Add-NvAPI_GetPhysicalGPUsFromLogicalGPU.patch
patch_apply nvapi-Stub_DLL/0004-nvapi-Add-stub-for-NvAPI_EnumPhysicalGPUs.patch
patch_apply nvapi-Stub_DLL/0005-nvapi-Add-stubs-for-NvAPI_GPU_GetFullName.patch
patch_apply nvapi-Stub_DLL/0006-nvapi-Explicity-return-NULL-for-0x33c7358c-and-0x593.patch
patch_apply nvapi-Stub_DLL/0007-nvapi-Add-stub-for-NvAPI_DISP_GetGDIPrimaryDisplayId.patch
patch_apply nvapi-Stub_DLL/0008-nvapi-Add-stub-for-EnumNvidiaDisplayHandle.patch
patch_apply nvapi-Stub_DLL/0009-nvapi-Add-stub-for-NvAPI_SYS_GetDriverAndBranchVersi.patch
patch_apply nvapi-Stub_DLL/0010-nvapi-Add-stub-for-NvAPI_Unload.patch
patch_apply nvapi-Stub_DLL/0011-nvapi-Add-stub-for-NvAPI_D3D_GetCurrentSLIState.patch
patch_apply nvapi-Stub_DLL/0012-nvapi-tests-Use-structure-to-list-imports.patch
patch_apply nvapi-Stub_DLL/0013-nvapi-Add-stub-for-NvAPI_GetLogicalGPUFromDisplay.patch
patch_apply nvapi-Stub_DLL/0014-nvapi-Add-stub-for-NvAPI_D3D_GetObjectHandleForResou.patch
patch_apply nvapi-Stub_DLL/0015-nvapi-Add-stub-for-NvAPI_D3D9_RegisterResource.patch
patch_apply nvapi-Stub_DLL/0016-nvapi-Improve-NvAPI_D3D_GetCurrentSLIState.patch
patch_apply nvapi-Stub_DLL/0017-nvapi-Implement-NvAPI_GPU_Get-Physical-Virtual-Frame.patch
patch_apply nvapi-Stub_DLL/0018-nvapi-Add-stub-for-NvAPI_GPU_GetGpuCoreCount.patch
patch_apply nvapi-Stub_DLL/0019-nvapi-Implement-NvAPI_D3D11_SetDepthBoundsTest.patch
patch_apply nvapi-Stub_DLL/0020-nvapi-Implement-NvAPI_D3D11_CreateDevice-and-NvAPI_D.patch
patch_apply nvapi-Stub_DLL/0021-Revert-wined3d-No-longer-export-wined3d_device_set_r.patch
fi
# Patchset nvcuvid-CUDA_Video_Support
# |
# | This patchset has the following (direct or indirect) dependencies:

View File

@ -1,140 +0,0 @@
From 84aab96026febc4d222733b5ecc2919047ac549b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Mon, 22 Mar 2021 22:46:36 +0100
Subject: [PATCH] server: Implement desktop broadcast in
queue_rawinput_message.
HID rawinput hardware messages will be sent from winedevice.exe, which
is not attached to any desktop. We need to broadcast the messages to all
desktops in that case.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
---
server/queue.c | 45 +++++++++++++++++++++++++++++++--------------
1 file changed, 31 insertions(+), 14 deletions(-)
diff --git a/server/queue.c b/server/queue.c
index b026c03e13d..ca2f898492b 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1670,8 +1670,8 @@ static int queue_rawinput_message( struct process* process, void *arg )
{
const struct rawinput_message* raw_msg = arg;
const struct rawinput_device *device = NULL;
- struct desktop *target_desktop = NULL;
- struct thread *target_thread = NULL;
+ struct desktop *target_desktop = NULL, *desktop = NULL;
+ struct thread *target_thread = NULL, *foreground = NULL;
struct message *msg;
int wparam = RIM_INPUT;
@@ -1681,12 +1681,18 @@ static int queue_rawinput_message( struct process* process, void *arg )
device = process->rawinput_kbd;
if (!device) return 0;
- if (process != raw_msg->foreground->process)
+ if (raw_msg->desktop) desktop = (struct desktop *)grab_object( raw_msg->desktop );
+ else if (!(desktop = get_desktop_obj( process, process->desktop, 0 ))) goto done;
+
+ if (raw_msg->foreground) foreground = (struct thread *)grab_object( raw_msg->foreground );
+ else if (!(foreground = get_foreground_thread( desktop, 0 ))) goto done;
+
+ if (process != foreground->process)
{
if (!(device->flags & RIDEV_INPUTSINK)) goto done;
if (!(target_thread = get_window_thread( device->target ))) goto done;
if (!(target_desktop = get_thread_desktop( target_thread, 0 ))) goto done;
- if (target_desktop != raw_msg->desktop) goto done;
+ if (target_desktop != desktop) goto done;
wparam = RIM_INPUTSINK;
}
@@ -1699,11 +1705,13 @@ static int queue_rawinput_message( struct process* process, void *arg )
msg->lparam = 0;
memcpy( msg->data, &raw_msg->data, sizeof(raw_msg->data) );
- queue_hardware_message( raw_msg->desktop, msg, 1 );
+ queue_hardware_message( desktop, msg, 1 );
done:
if (target_thread) release_object( target_thread );
if (target_desktop) release_object( target_desktop );
+ if (foreground) release_object( foreground );
+ if (desktop) release_object( desktop );
return 0;
}
@@ -1961,6 +1969,7 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_
struct hw_msg_source source = { IMDT_UNAVAILABLE, origin };
struct message *msg;
+ if (!desktop) return;
if (!(msg = alloc_hardware_message( 0, source, get_tick_count() ))) return;
msg->win = get_user_full_handle( win );
@@ -2455,15 +2464,14 @@ DECL_HANDLER(send_message)
DECL_HANDLER(send_hardware_message)
{
struct thread *thread = NULL;
- struct desktop *desktop;
+ struct desktop *desktop = get_thread_desktop( current, 0 );
unsigned int origin = (req->flags & SEND_HWMSG_INJECTED ? IMO_INJECTED : IMO_HARDWARE);
struct msg_queue *sender = get_current_queue();
data_size_t size = min( 256, get_reply_max_size() );
- if (!(desktop = get_thread_desktop( current, 0 ))) return;
-
if (req->win)
{
+ if (!desktop) return;
if (!(thread = get_window_thread( req->win ))) return;
if (desktop != thread->queue->input->desktop)
{
@@ -2473,18 +2481,24 @@ DECL_HANDLER(send_hardware_message)
}
}
- reply->prev_x = desktop->cursor.x;
- reply->prev_y = desktop->cursor.y;
+ if (desktop)
+ {
+ reply->prev_x = desktop->cursor.x;
+ reply->prev_y = desktop->cursor.y;
+ }
switch (req->input.type)
{
case INPUT_MOUSE:
+ if (!desktop) return;
reply->wait = queue_mouse_message( desktop, req->win, &req->input, origin, sender );
break;
case INPUT_KEYBOARD:
+ if (!desktop) return;
reply->wait = queue_keyboard_message( desktop, req->win, &req->input, origin, sender );
break;
case INPUT_HARDWARE:
+ if (!desktop) set_error( STATUS_SUCCESS );
queue_custom_hardware_message( desktop, req->win, origin, &req->input );
break;
default:
@@ -2492,10 +2506,13 @@ DECL_HANDLER(send_hardware_message)
}
if (thread) release_object( thread );
- reply->new_x = desktop->cursor.x;
- reply->new_y = desktop->cursor.y;
- set_reply_data( desktop->keystate, size );
- release_object( desktop );
+ if (desktop)
+ {
+ reply->new_x = desktop->cursor.x;
+ reply->new_y = desktop->cursor.y;
+ set_reply_data( desktop->keystate, size );
+ release_object( desktop );
+ }
}
/* post a quit message to the current queue */
--
2.30.2

View File

@ -1,55 +0,0 @@
From 3c71ae18955c39a1e85532175de76068597010d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Wed, 10 Feb 2021 13:23:31 +0100
Subject: [PATCH] server: Add process argument to find_rawinput_device.
We need to be able to iterate all registered rawinput devices for
foreign processes, not only the current one.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
---
server/queue.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/server/queue.c b/server/queue.c
index 033e4e30b66..e71d9207e1a 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1489,11 +1489,11 @@ static user_handle_t find_hardware_message_window( struct desktop *desktop, stru
return win;
}
-static struct rawinput_device_entry *find_rawinput_device( unsigned short usage_page, unsigned short usage )
+static struct rawinput_device_entry *find_rawinput_device( struct process *process, unsigned short usage_page, unsigned short usage )
{
struct rawinput_device_entry *e;
- LIST_FOR_EACH_ENTRY( e, &current->process->rawinput_devices, struct rawinput_device_entry, entry )
+ LIST_FOR_EACH_ENTRY( e, &process->rawinput_devices, struct rawinput_device_entry, entry )
{
if (e->device.usage_page != usage_page || e->device.usage != usage) continue;
return e;
@@ -1506,7 +1506,7 @@ static void update_rawinput_device(const struct rawinput_device *device)
{
struct rawinput_device_entry *e;
- if (!(e = find_rawinput_device( device->usage_page, device->usage )))
+ if (!(e = find_rawinput_device( current->process, device->usage_page, device->usage )))
{
if (!(e = mem_alloc( sizeof(*e) ))) return;
list_add_tail( &current->process->rawinput_devices, &e->entry );
@@ -3362,9 +3362,9 @@ DECL_HANDLER(update_rawinput_devices)
update_rawinput_device(&devices[i]);
}
- e = find_rawinput_device( 1, 2 );
+ e = find_rawinput_device( current->process, 1, 2 );
current->process->rawinput_mouse = e ? &e->device : NULL;
- e = find_rawinput_device( 1, 6 );
+ e = find_rawinput_device( current->process, 1, 6 );
current->process->rawinput_kbd = e ? &e->device : NULL;
}
--
2.30.2

View File

@ -1,225 +0,0 @@
From 3f576ac591f515a621da1d706c85030c94fc39b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Wed, 7 Apr 2021 12:17:40 +0200
Subject: [PATCH] server: Implement WM_INPUT_DEVICE_CHANGE message dispatch.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
---
dlls/user32/message.c | 13 +++++++----
dlls/user32/rawinput.c | 2 +-
server/queue.c | 53 +++++++++++++++++++++++++++++++++++++-----
3 files changed, 56 insertions(+), 12 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index 148b35f8caf..9af33c3291e 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -2289,11 +2289,14 @@ static void accept_hardware_message( UINT hw_id )
static BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data )
{
struct rawinput_thread_data *thread_data = rawinput_thread_data();
- if (!rawinput_from_hardware_message( thread_data->buffer, msg_data ))
- return FALSE;
- thread_data->hw_id = hw_id;
- msg->lParam = (LPARAM)hw_id;
+ if (msg->message == WM_INPUT)
+ {
+ if (!rawinput_from_hardware_message( thread_data->buffer, msg_data )) return FALSE;
+ thread_data->hw_id = hw_id;
+ msg->lParam = (LPARAM)hw_id;
+ }
+
msg->pt = point_phys_to_win_dpi( msg->hwnd, msg->pt );
return TRUE;
}
@@ -2613,7 +2616,7 @@ static BOOL process_hardware_message( MSG *msg, UINT hw_id, const struct hardwar
/* hardware messages are always in physical coords */
context = SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
- if (msg->message == WM_INPUT)
+ if (msg->message == WM_INPUT || msg->message == WM_INPUT_DEVICE_CHANGE)
ret = process_rawinput_message( msg, hw_id, msg_data );
else if (is_keyboard_message( msg->message ))
ret = process_keyboard_message( msg, hw_id, hwnd_filter, first, last, remove );
diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c
index f2d64ccc23b..d95d29d7656 100644
--- a/dlls/user32/rawinput.c
+++ b/dlls/user32/rawinput.c
@@ -468,7 +468,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(RAWINPUTDEVICE *devices, U
TRACE("device %u: page %#x, usage %#x, flags %#x, target %p.\n",
i, devices[i].usUsagePage, devices[i].usUsage,
devices[i].dwFlags, devices[i].hwndTarget);
- if (devices[i].dwFlags & ~(RIDEV_REMOVE|RIDEV_NOLEGACY|RIDEV_INPUTSINK))
+ if (devices[i].dwFlags & ~(RIDEV_REMOVE|RIDEV_NOLEGACY|RIDEV_INPUTSINK|RIDEV_DEVNOTIFY))
FIXME("Unhandled flags %#x for device %u.\n", devices[i].dwFlags, i);
d[i].usage_page = devices[i].usUsagePage;
diff --git a/server/queue.c b/server/queue.c
index 3712f79df3e..3f48e0aabdc 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1464,7 +1464,7 @@ static user_handle_t find_hardware_message_window( struct desktop *desktop, stru
*thread = NULL;
*msg_code = msg->msg;
- if (msg->msg == WM_INPUT)
+ if (msg->msg == WM_INPUT || msg->msg == WM_INPUT_DEVICE_CHANGE)
{
if (!(win = msg->win) && input) win = input->focus;
}
@@ -1553,7 +1553,7 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg
if (msg->wparam == VK_SHIFT || msg->wparam == VK_LSHIFT || msg->wparam == VK_RSHIFT)
msg->lparam &= ~(KF_EXTENDED << 16);
}
- else if (msg->msg != WM_INPUT)
+ else if (msg->msg != WM_INPUT && msg->msg != WM_INPUT_DEVICE_CHANGE)
{
if (msg->msg == WM_MOUSEMOVE)
{
@@ -1651,7 +1651,7 @@ static int send_hook_ll_message( struct desktop *desktop, struct message *hardwa
static struct thread *get_foreground_thread( struct desktop *desktop, user_handle_t window )
{
/* if desktop has no foreground process, assume the receiving window is */
- if (desktop->foreground_input) return get_window_thread( desktop->foreground_input->focus );
+ if (desktop && desktop->foreground_input) return get_window_thread( desktop->foreground_input->focus );
if (window) return get_window_thread( window );
return NULL;
}
@@ -1692,12 +1692,23 @@ static void remove_hid_rawinput_device( unsigned int index )
hid_rawinput_devices[index].usage = 0;
}
+static struct rawinput_device_entry *find_hid_rawinput_device( struct process *process, const union rawinput *rawinput )
+{
+ unsigned int index;
+ if (rawinput->type != RIM_TYPEHID) return NULL;
+ if (!(index = rawinput->hid.device)) return NULL;
+ if (hid_rawinput_device_count < index) return NULL;
+ if (!hid_rawinput_devices[index].usage_page) return NULL;
+ return find_rawinput_device( process, hid_rawinput_devices[index].usage_page, hid_rawinput_devices[index].usage );
+}
+
struct rawinput_message
{
struct thread *foreground;
struct desktop *desktop;
struct hw_msg_source source;
unsigned int time;
+ unsigned int message;
struct hardware_msg_data data;
};
@@ -1705,6 +1716,7 @@ struct rawinput_message
static int queue_rawinput_message( struct process* process, void *arg )
{
const struct rawinput_message* raw_msg = arg;
+ const struct rawinput_device_entry *entry;
const struct rawinput_device *device = NULL;
struct desktop *target_desktop = NULL, *desktop = NULL;
struct thread *target_thread = NULL, *foreground = NULL;
@@ -1715,8 +1727,12 @@ static int queue_rawinput_message( struct process* process, void *arg )
device = process->rawinput_mouse;
else if (raw_msg->data.rawinput.type == RIM_TYPEKEYBOARD)
device = process->rawinput_kbd;
+ else if ((entry = find_hid_rawinput_device( process, &raw_msg->data.rawinput )))
+ device = &entry->device;
if (!device) return 0;
+ if (raw_msg->message == WM_INPUT_DEVICE_CHANGE && !(device->flags & RIDEV_DEVNOTIFY)) return 0;
+
if (raw_msg->desktop) desktop = (struct desktop *)grab_object( raw_msg->desktop );
else if (!(desktop = get_desktop_obj( process, process->desktop, 0 ))) goto done;
@@ -1725,7 +1741,7 @@ static int queue_rawinput_message( struct process* process, void *arg )
if (process != foreground->process)
{
- if (!(device->flags & RIDEV_INPUTSINK)) goto done;
+ if (raw_msg->message == WM_INPUT && !(device->flags & RIDEV_INPUTSINK)) goto done;
if (!(target_thread = get_window_thread( device->target ))) goto done;
if (!(target_desktop = get_thread_desktop( target_thread, 0 ))) goto done;
if (target_desktop != desktop) goto done;
@@ -1736,11 +1752,17 @@ static int queue_rawinput_message( struct process* process, void *arg )
goto done;
msg->win = device->target;
- msg->msg = WM_INPUT;
+ msg->msg = raw_msg->message;
msg->wparam = wparam;
msg->lparam = 0;
memcpy( msg->data, &raw_msg->data, sizeof(raw_msg->data) );
+ if (raw_msg->message == WM_INPUT_DEVICE_CHANGE && raw_msg->data.rawinput.type == RIM_TYPEHID)
+ {
+ msg->wparam = raw_msg->data.rawinput.hid.param;
+ msg->lparam = raw_msg->data.rawinput.hid.device;
+ }
+
queue_hardware_message( desktop, msg, 1 );
done:
@@ -1814,6 +1836,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
raw_msg.desktop = desktop;
raw_msg.source = source;
raw_msg.time = time;
+ raw_msg.message = WM_INPUT;
msg_data = &raw_msg.data;
msg_data->info = input->mouse.info;
@@ -1948,6 +1971,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c
raw_msg.desktop = desktop;
raw_msg.source = source;
raw_msg.time = time;
+ raw_msg.message = WM_INPUT;
msg_data = &raw_msg.data;
msg_data->info = input->kbd.info;
@@ -2003,18 +2027,35 @@ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_
unsigned int origin, const hw_input_t *input )
{
struct hw_msg_source source = { IMDT_UNAVAILABLE, origin };
+ struct hardware_msg_data *msg_data;
+ struct rawinput_message raw_msg;
struct message *msg;
switch (input->hw.msg)
{
case WM_INPUT_DEVICE_CHANGE:
+ raw_msg.foreground = get_foreground_thread( desktop, win );
+ raw_msg.desktop = desktop;
+ raw_msg.source = source;
+ raw_msg.time = get_tick_count();
+ raw_msg.message = input->hw.msg;
+
+ msg_data = &raw_msg.data;
+ msg_data->info = 0;
+ msg_data->flags = 0;
+ msg_data->rawinput = input->hw.rawinput;
+
if (input->hw.rawinput.type == RIM_TYPEHID &&
input->hw.rawinput.hid.param == GIDC_ARRIVAL)
insert_hid_rawinput_device( input->hw.rawinput.hid.device, get_req_data(), get_req_data_size() );
+ enum_processes( queue_rawinput_message, &raw_msg );
+
if (input->hw.rawinput.type == RIM_TYPEHID &&
input->hw.rawinput.hid.param == GIDC_REMOVAL)
remove_hid_rawinput_device( input->hw.rawinput.hid.device );
+
+ if (raw_msg.foreground) release_object( raw_msg.foreground );
return;
}
@@ -2151,7 +2192,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user
data->hw_id = msg->unique_id;
set_reply_data( msg->data, msg->data_size );
- if (msg->msg == WM_INPUT && (flags & PM_REMOVE))
+ if ((msg->msg == WM_INPUT || msg->msg == WM_INPUT_DEVICE_CHANGE) && (flags & PM_REMOVE))
release_hardware_message( current->queue, data->hw_id );
return 1;
}
--
2.30.2

View File

@ -1 +1 @@
44cb53bb37d3c40ea90aec6e35a9c08326b6e848
c74508d22528548940db3c8ac6a350064ca445e9