Changeset View
Changeset View
Standalone View
Standalone View
files/wine-d3d9.patch
| From bdda3f3bc4f3840ffcbb6dcaf6d0cf452ea5421d Mon Sep 17 00:00:00 2001 | From f8574ff8a8c64fe6ab7a4399eb0d693e926f45d1 Mon Sep 17 00:00:00 2001 | ||||
| From: Nick Sarnie <commendsarnex@gmail.com> | From: Nick Sarnie <commendsarnex@gmail.com> | ||||
| Date: Wed, 20 Sep 2017 20:49:35 -0400 | Date: Sun, 5 Nov 2017 22:31:07 -0500 | ||||
| Subject: [PATCH] Wine D3D9 | Subject: [PATCH 2/2] Wine D3D9 | ||||
| Signed-off-by: Nick Sarnie <commendsarnex@gmail.com> | Signed-off-by: Nick Sarnie <commendsarnex@gmail.com> | ||||
| --- | --- | ||||
| configure.ac | 188 ++++ | configure.ac | 188 ++++ | ||||
| dlls/d3d9-nine/Makefile.in | 15 + | dlls/d3d9-nine/Makefile.in | 15 + | ||||
| dlls/d3d9-nine/d3d9-nine.spec | 14 + | dlls/d3d9-nine/d3d9-nine.spec | 14 + | ||||
| dlls/d3d9-nine/d3d9_main.c | 173 ++++ | dlls/d3d9-nine/d3d9_main.c | 173 ++++ | ||||
| dlls/d3d9-nine/d3dadapter9.c | 853 ++++++++++++++++++ | dlls/d3d9-nine/d3dadapter9.c | 898 +++++++++++++++++++ | ||||
| dlls/d3d9-nine/d3dadapter9.h | 32 + | dlls/d3d9-nine/d3dadapter9.h | 32 + | ||||
| dlls/d3d9-nine/device_wrap.c | 500 +++++++++++ | dlls/d3d9-nine/device_wrap.c | 500 +++++++++++ | ||||
| dlls/d3d9-nine/device_wrap.h | 26 + | dlls/d3d9-nine/device_wrap.h | 26 + | ||||
| dlls/d3d9-nine/dri3.c | 1426 ++++++++++++++++++++++++++++++ | dlls/d3d9-nine/dri3.c | 1426 ++++++++++++++++++++++++++++++ | ||||
| dlls/d3d9-nine/dri3.h | 91 ++ | dlls/d3d9-nine/dri3.h | 91 ++ | ||||
| dlls/d3d9-nine/present.c | 1748 +++++++++++++++++++++++++++++++++++++ | dlls/d3d9-nine/present.c | 1748 +++++++++++++++++++++++++++++++++++++ | ||||
| dlls/d3d9-nine/present.h | 40 + | dlls/d3d9-nine/present.h | 40 + | ||||
| dlls/d3d9-nine/shader_validator.c | 88 ++ | dlls/d3d9-nine/shader_validator.c | 88 ++ | ||||
| dlls/d3d9-nine/shader_validator.h | 29 + | dlls/d3d9-nine/shader_validator.h | 29 + | ||||
| dlls/d3d9-nine/version.rc | 26 + | dlls/d3d9-nine/version.rc | 26 + | ||||
| dlls/d3d9-nine/wndproc.c | 277 ++++++ | dlls/d3d9-nine/wndproc.c | 277 ++++++ | ||||
| dlls/d3d9-nine/wndproc.h | 41 + | dlls/d3d9-nine/wndproc.h | 41 + | ||||
| 17 files changed, 5567 insertions(+) | 17 files changed, 5612 insertions(+) | ||||
| create mode 100644 dlls/d3d9-nine/Makefile.in | create mode 100644 dlls/d3d9-nine/Makefile.in | ||||
| create mode 100644 dlls/d3d9-nine/d3d9-nine.spec | create mode 100644 dlls/d3d9-nine/d3d9-nine.spec | ||||
| create mode 100644 dlls/d3d9-nine/d3d9_main.c | create mode 100644 dlls/d3d9-nine/d3d9_main.c | ||||
| create mode 100644 dlls/d3d9-nine/d3dadapter9.c | create mode 100644 dlls/d3d9-nine/d3dadapter9.c | ||||
| create mode 100644 dlls/d3d9-nine/d3dadapter9.h | create mode 100644 dlls/d3d9-nine/d3dadapter9.h | ||||
| create mode 100644 dlls/d3d9-nine/device_wrap.c | create mode 100644 dlls/d3d9-nine/device_wrap.c | ||||
| create mode 100644 dlls/d3d9-nine/device_wrap.h | create mode 100644 dlls/d3d9-nine/device_wrap.h | ||||
| create mode 100644 dlls/d3d9-nine/dri3.c | create mode 100644 dlls/d3d9-nine/dri3.c | ||||
| create mode 100644 dlls/d3d9-nine/dri3.h | create mode 100644 dlls/d3d9-nine/dri3.h | ||||
| create mode 100644 dlls/d3d9-nine/present.c | create mode 100644 dlls/d3d9-nine/present.c | ||||
| create mode 100644 dlls/d3d9-nine/present.h | create mode 100644 dlls/d3d9-nine/present.h | ||||
| create mode 100644 dlls/d3d9-nine/shader_validator.c | create mode 100644 dlls/d3d9-nine/shader_validator.c | ||||
| create mode 100644 dlls/d3d9-nine/shader_validator.h | create mode 100644 dlls/d3d9-nine/shader_validator.h | ||||
| create mode 100644 dlls/d3d9-nine/version.rc | create mode 100644 dlls/d3d9-nine/version.rc | ||||
| create mode 100644 dlls/d3d9-nine/wndproc.c | create mode 100644 dlls/d3d9-nine/wndproc.c | ||||
| create mode 100644 dlls/d3d9-nine/wndproc.h | create mode 100644 dlls/d3d9-nine/wndproc.h | ||||
| diff --git a/configure.ac b/configure.ac | diff --git a/configure.ac b/configure.ac | ||||
| index 8f2885b2bc..88902214de 100644 | index 7a8fcc4987..0f2a45f336 100644 | ||||
| --- a/configure.ac | --- a/configure.ac | ||||
| +++ b/configure.ac | +++ b/configure.ac | ||||
| @@ -66,6 +66,14 @@ AC_ARG_WITH(openal, AS_HELP_STRING([--without-openal],[do not use OpenAL]), | @@ -67,6 +67,14 @@ AC_ARG_WITH(openal, AS_HELP_STRING([--without-openal],[do not use OpenAL]), | ||||
| AC_ARG_WITH(opencl, AS_HELP_STRING([--without-opencl],[do not use OpenCL]), | AC_ARG_WITH(opencl, AS_HELP_STRING([--without-opencl],[do not use OpenCL]), | ||||
| [if test "x$withval" = "xno"; then ac_cv_header_CL_cl_h=no; ac_cv_header_OpenCL_opencl_h=no; fi]) | [if test "x$withval" = "xno"; then ac_cv_header_CL_cl_h=no; ac_cv_header_OpenCL_opencl_h=no; fi]) | ||||
| AC_ARG_WITH(opengl, AS_HELP_STRING([--without-opengl],[do not use OpenGL])) | AC_ARG_WITH(opengl, AS_HELP_STRING([--without-opengl],[do not use OpenGL])) | ||||
| +AC_ARG_WITH(d3d9-nine, AS_HELP_STRING([--without-d3d9-nine],[do not build d3d9-nine.dll (Gallium Nine support)]), | +AC_ARG_WITH(d3d9-nine, AS_HELP_STRING([--without-d3d9-nine],[do not build d3d9-nine.dll (Gallium Nine support)]), | ||||
| + [], [with_d3d9_nine=auto]) | + [], [with_d3d9_nine=auto]) | ||||
| +AC_ARG_WITH(d3d9-nine-module, AS_HELP_STRING([--with-d3d9-nine-module], | +AC_ARG_WITH(d3d9-nine-module, AS_HELP_STRING([--with-d3d9-nine-module], | ||||
| + [Gallium Nine module location. Can be 'manual' (path to be filled in a register), 'auto' (default. use pkgconfig to detect the location) or a path]), | + [Gallium Nine module location. Can be 'manual' (path to be filled in a register), 'auto' (default. use pkgconfig to detect the location) or a path]), | ||||
| + [], [with_d3d9_nine_module=auto]) | + [], [with_d3d9_nine_module=auto]) | ||||
| +AC_ARG_WITH(d3d9-nine-headers-path, AS_HELP_STRING([--with-d3d9-nine-headers-path], | +AC_ARG_WITH(d3d9-nine-headers-path, AS_HELP_STRING([--with-d3d9-nine-headers-path], | ||||
| + [Gallium Nine headers location. Can be 'auto' (default. use pkgconfig to detect the location) or a path]), | + [Gallium Nine headers location. Can be 'auto' (default. use pkgconfig to detect the location) or a path]), | ||||
| + [], [with_d3d9_nine_headers_path=auto]) | + [], [with_d3d9_nine_headers_path=auto]) | ||||
| AC_ARG_WITH(osmesa, AS_HELP_STRING([--without-osmesa],[do not use the OSMesa library])) | AC_ARG_WITH(osmesa, AS_HELP_STRING([--without-osmesa],[do not use the OSMesa library])) | ||||
| AC_ARG_WITH(oss, AS_HELP_STRING([--without-oss],[do not use the OSS sound support])) | AC_ARG_WITH(oss, AS_HELP_STRING([--without-oss],[do not use the OSS sound support])) | ||||
| AC_ARG_WITH(pcap, AS_HELP_STRING([--without-pcap],[do not use the Packet Capture library]), | AC_ARG_WITH(pcap, AS_HELP_STRING([--without-pcap],[do not use the Packet Capture library]), | ||||
| @@ -390,6 +398,8 @@ AC_CHECK_LIB(ossaudio,_oss_ioctl) | @@ -391,6 +399,8 @@ AC_CHECK_LIB(ossaudio,_oss_ioctl) | ||||
| AC_SUBST(OPENGL_LIBS,"") | AC_SUBST(OPENGL_LIBS,"") | ||||
| +AC_SUBST(D3D9NINE_LIBS,"") | +AC_SUBST(D3D9NINE_LIBS,"") | ||||
| + | + | ||||
| dnl **** Check for header files **** | dnl **** Check for header files **** | ||||
| AC_SYS_LARGEFILE() | AC_SYS_LARGEFILE() | ||||
| @@ -1247,6 +1257,183 @@ OpenGL and Direct3D won't be supported.]) | @@ -1248,6 +1258,183 @@ OpenGL and Direct3D won't be supported.]) | ||||
| WINE_NOTICE_WITH(va,[test "x$ac_cv_lib_soname_va" = "x" -o "x$ac_cv_lib_soname_va_x11" = "x" -o "x$ac_cv_lib_soname_va_drm" = "x"], | WINE_NOTICE_WITH(va,[test "x$ac_cv_lib_soname_va" = "x" -o "x$ac_cv_lib_soname_va_x11" = "x" -o "x$ac_cv_lib_soname_va_drm" = "x"], | ||||
| [libva ${notice_platform}development files not found, GPU video acceleration won't be supported.]) | [libva ${notice_platform}development files not found, GPU video acceleration won't be supported.]) | ||||
| + dnl Check for d3d9-nine support | + dnl Check for d3d9-nine support | ||||
| + if test "x$with_d3d9_nine" = "xauto" && (test "x$with_d3d9_nine_module" = "xauto" || test "x$with_d3d9_nine_headers_path" = "xauto") | + if test "x$with_d3d9_nine" = "xauto" && (test "x$with_d3d9_nine_module" = "xauto" || test "x$with_d3d9_nine_headers_path" = "xauto") | ||||
| + then | + then | ||||
| + AC_MSG_CHECKING([whether d3dadapter9 package (Gallium Nine) is present]) | + AC_MSG_CHECKING([whether d3dadapter9 package (Gallium Nine) is present]) | ||||
| + D3DADAPTER9_MODULEDIR=`$PKG_CONFIG --variable=moduledir d3dadapter9 2>/dev/null` | + D3DADAPTER9_MODULEDIR=`$PKG_CONFIG --variable=moduledir d3dadapter9 2>/dev/null` | ||||
| ▲ Show 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | |||||
| + AC_DEFINE(D3D9NINE_DRI2, 1, [Whether d3d9-nine DRI2 fallback is compiled]) | + AC_DEFINE(D3D9NINE_DRI2, 1, [Whether d3d9-nine DRI2 fallback is compiled]) | ||||
| + else | + else | ||||
| + enable_d3d9_nine=${enable_d3d9_nine:-no} | + enable_d3d9_nine=${enable_d3d9_nine:-no} | ||||
| + fi | + fi | ||||
| + | + | ||||
| CPPFLAGS="$ac_save_CPPFLAGS" | CPPFLAGS="$ac_save_CPPFLAGS" | ||||
| else | else | ||||
| X_CFLAGS="" | X_CFLAGS="" | ||||
| @@ -3097,6 +3284,7 @@ WINE_CONFIG_DLL(d3d8,,[implib]) | @@ -3127,6 +3314,7 @@ WINE_CONFIG_DLL(d3d8,,[implib]) | ||||
| WINE_CONFIG_TEST(dlls/d3d8/tests) | WINE_CONFIG_TEST(dlls/d3d8/tests) | ||||
| WINE_CONFIG_DLL(d3d9,,[implib]) | WINE_CONFIG_DLL(d3d9,,[implib]) | ||||
| WINE_CONFIG_TEST(dlls/d3d9/tests) | WINE_CONFIG_TEST(dlls/d3d9/tests) | ||||
| +WINE_CONFIG_DLL(d3d9-nine,,[implib]) | +WINE_CONFIG_DLL(d3d9-nine,,[implib]) | ||||
| WINE_CONFIG_DLL(d3dcompiler_33) | WINE_CONFIG_DLL(d3dcompiler_33) | ||||
| WINE_CONFIG_DLL(d3dcompiler_34) | WINE_CONFIG_DLL(d3dcompiler_34) | ||||
| WINE_CONFIG_DLL(d3dcompiler_35) | WINE_CONFIG_DLL(d3dcompiler_35) | ||||
| diff --git a/dlls/d3d9-nine/Makefile.in b/dlls/d3d9-nine/Makefile.in | diff --git a/dlls/d3d9-nine/Makefile.in b/dlls/d3d9-nine/Makefile.in | ||||
| ▲ Show 20 Lines • Show All 213 Lines • ▼ Show 20 Lines | |||||
| + * D3DPERF_SetRegion (D3D9.@) | + * D3DPERF_SetRegion (D3D9.@) | ||||
| + */ | + */ | ||||
| +void WINAPI D3DPERF_SetRegion(D3DCOLOR color, const WCHAR *name) | +void WINAPI D3DPERF_SetRegion(D3DCOLOR color, const WCHAR *name) | ||||
| +{ | +{ | ||||
| + FIXME("color 0x%08x, name %s stub!\n", color, debugstr_w(name)); | + FIXME("color 0x%08x, name %s stub!\n", color, debugstr_w(name)); | ||||
| +} | +} | ||||
| diff --git a/dlls/d3d9-nine/d3dadapter9.c b/dlls/d3d9-nine/d3dadapter9.c | diff --git a/dlls/d3d9-nine/d3dadapter9.c b/dlls/d3d9-nine/d3dadapter9.c | ||||
| new file mode 100644 | new file mode 100644 | ||||
| index 0000000000..daa9524361 | index 0000000000..188eebf763 | ||||
| --- /dev/null | --- /dev/null | ||||
| +++ b/dlls/d3d9-nine/d3dadapter9.c | +++ b/dlls/d3d9-nine/d3dadapter9.c | ||||
| @@ -0,0 +1,853 @@ | @@ -0,0 +1,898 @@ | ||||
| +/* | +/* | ||||
| + * Wine IDirect3D9 interface using ID3DAdapter9 | + * Wine IDirect3D9 interface using ID3DAdapter9 | ||||
| + * | + * | ||||
| + * Copyright 2013 Joakim Sindholt | + * Copyright 2013 Joakim Sindholt | ||||
| + * Christoph Bumiller | + * Christoph Bumiller | ||||
| + * Copyright 2014 David Heidelberger | + * Copyright 2014 David Heidelberger | ||||
| + * Copyright 2014-2015 Axel Davy | + * Copyright 2014-2015 Axel Davy | ||||
| + * Copyright 2015 Nick Sarnie | + * Copyright 2015 Nick Sarnie | ||||
| ▲ Show 20 Lines • Show All 382 Lines • ▼ Show 20 Lines | |||||
| + return hr; | + return hr; | ||||
| + | + | ||||
| + return D3D_OK; | + return D3D_OK; | ||||
| +} | +} | ||||
| + | + | ||||
| +static UINT WINAPI d3dadapter9_GetAdapterModeCountEx(struct d3dadapter9 *This, | +static UINT WINAPI d3dadapter9_GetAdapterModeCountEx(struct d3dadapter9 *This, | ||||
| + UINT Adapter, const D3DDISPLAYMODEFILTER *pFilter) | + UINT Adapter, const D3DDISPLAYMODEFILTER *pFilter) | ||||
| +{ | +{ | ||||
| + FIXME("(%p, %u, %p), stub!\n", This, Adapter, pFilter); | + FIXME("(%p, %u, %p), half stub!\n", This, Adapter, pFilter); | ||||
| + return 1; | + return d3dadapter9_GetAdapterModeCount(This, Adapter, pFilter->Format); | ||||
| +} | +} | ||||
| + | + | ||||
| +static HRESULT WINAPI d3dadapter9_EnumAdapterModesEx(struct d3dadapter9 *This, | +static HRESULT WINAPI d3dadapter9_EnumAdapterModesEx(struct d3dadapter9 *This, | ||||
| + UINT Adapter, const D3DDISPLAYMODEFILTER *pFilter, UINT Mode, | + UINT Adapter, const D3DDISPLAYMODEFILTER *pFilter, UINT Mode, | ||||
| + D3DDISPLAYMODEEX *pMode) | + D3DDISPLAYMODEEX *pMode) | ||||
| +{ | +{ | ||||
| + FIXME("(%p, %u, %p, %u, %p), stub!\n", This, Adapter, pFilter, Mode, pMode); | + HRESULT hr; | ||||
| + | |||||
| + FIXME("(%p, %u, %p, %u, %p), half stub!\n", This, Adapter, pFilter, Mode, pMode); | |||||
| + | |||||
| + if (Adapter >= d3dadapter9_GetAdapterCount(This)) | |||||
| + return D3DERR_INVALIDCALL; | |||||
| + | |||||
| + hr = d3dadapter9_CheckDeviceFormat(This, Adapter, D3DDEVTYPE_HAL, | |||||
| + pFilter->Format, D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE, pFilter->Format); | |||||
| + | |||||
| + if (FAILED(hr)) | |||||
| + { | |||||
| + TRACE("DeviceFormat not available.\n"); | |||||
| + return hr; | |||||
| + } | |||||
| + | |||||
| + if (Mode >= ADAPTER_OUTPUT.nmodes) | |||||
| + { | |||||
| + WARN("Mode %u does not exist.\n", Mode); | |||||
| + return D3DERR_INVALIDCALL; | + return D3DERR_INVALIDCALL; | ||||
| +} | + } | ||||
| + | + | ||||
| + pMode->Size = ADAPTER_OUTPUT.modes[Mode].Size; | |||||
| + pMode->Width = ADAPTER_OUTPUT.modes[Mode].Width; | |||||
| + pMode->Height = ADAPTER_OUTPUT.modes[Mode].Height; | |||||
| + pMode->RefreshRate = ADAPTER_OUTPUT.modes[Mode].RefreshRate; | |||||
| + pMode->Format = ADAPTER_OUTPUT.modes[Mode].Format; | |||||
| + pMode->ScanLineOrdering = ADAPTER_OUTPUT.modes[Mode].ScanLineOrdering; | |||||
| + | |||||
| + return D3D_OK; | |||||
| +} | |||||
| + | |||||
| +static HRESULT WINAPI d3dadapter9_GetAdapterDisplayModeEx(struct d3dadapter9 *This, | +static HRESULT WINAPI d3dadapter9_GetAdapterDisplayModeEx(struct d3dadapter9 *This, | ||||
| + UINT Adapter, D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation) | + UINT Adapter, D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation) | ||||
| +{ | +{ | ||||
| + FIXME("(%p, %u, %p, %p), stub!\n", This, Adapter, pMode, pRotation); | + UINT Mode; | ||||
| + | |||||
| + if (Adapter >= d3dadapter9_GetAdapterCount(This)) | |||||
| + return D3DERR_INVALIDCALL; | + return D3DERR_INVALIDCALL; | ||||
| + | |||||
| + if (pMode) | |||||
| + { | |||||
| + Mode = ADAPTER_OUTPUT.current; | |||||
| + pMode->Size = sizeof(D3DDISPLAYMODEEX); | |||||
| + pMode->Width = ADAPTER_OUTPUT.modes[Mode].Width; | |||||
| + pMode->Height = ADAPTER_OUTPUT.modes[Mode].Height; | |||||
| + pMode->RefreshRate = ADAPTER_OUTPUT.modes[Mode].RefreshRate; | |||||
| + pMode->Format = ADAPTER_OUTPUT.modes[Mode].Format; | |||||
| + pMode->ScanLineOrdering = ADAPTER_OUTPUT.modes[Mode].ScanLineOrdering; | |||||
| + } | |||||
| + if (pRotation) | |||||
| + *pRotation = ADAPTER_OUTPUT.rotation; | |||||
| + | |||||
| + return D3D_OK; | |||||
| +} | +} | ||||
| + | + | ||||
| +static HRESULT WINAPI DECLSPEC_HOTPATCH d3dadapter9_CreateDeviceEx(struct d3dadapter9 *This, | +static HRESULT WINAPI DECLSPEC_HOTPATCH d3dadapter9_CreateDeviceEx(struct d3dadapter9 *This, | ||||
| + UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, | + UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, | ||||
| + D3DPRESENT_PARAMETERS *pPresentationParameters, | + D3DPRESENT_PARAMETERS *pPresentationParameters, | ||||
| + D3DDISPLAYMODEEX *pFullscreenDisplayMode, | + D3DDISPLAYMODEEX *pFullscreenDisplayMode, | ||||
| + IDirect3DDevice9Ex **ppReturnedDeviceInterface) | + IDirect3DDevice9Ex **ppReturnedDeviceInterface) | ||||
| +{ | +{ | ||||
| ▲ Show 20 Lines • Show All 4,819 Lines • ▼ Show 20 Lines | |||||
| + | + | ||||
| +LRESULT device_process_message(struct DRI3Present *present, HWND window, BOOL unicode, | +LRESULT device_process_message(struct DRI3Present *present, HWND window, BOOL unicode, | ||||
| + UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc); | + UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc); | ||||
| + | + | ||||
| +#define NINE_WINDOW_CLASS_NAME "Gallium_Nine_Window" | +#define NINE_WINDOW_CLASS_NAME "Gallium_Nine_Window" | ||||
| + | + | ||||
| +#endif | +#endif | ||||
| -- | -- | ||||
| 2.14.1 | 2.15.0 | ||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.