mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Added patch to implement NvAPI_D3D11_SetDepthBoundsTest.
This commit is contained in:
parent
0211a4935e
commit
5e62fbb2d0
@ -0,0 +1,118 @@
|
||||
From 36eb9f37f10dd92dd173f322fd82d52806a6e8ec 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: nvapi: Implement NvAPI_D3D11_SetDepthBoundsTest.
|
||||
|
||||
---
|
||||
dlls/d3d11/device.c | 12 ++++++++++++
|
||||
dlls/nvapi/nvapi.c | 26 ++++++++++++++++++++++++++
|
||||
include/wine/wined3d.h | 2 ++
|
||||
3 files changed, 40 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index 8642bf50fb1..c774df60df6 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -866,16 +866,23 @@ static inline struct d3d_device *device_from_immediate_ID3D11DeviceContext(ID3D1
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_QueryInterface(ID3D11DeviceContext *iface,
|
||||
REFIID riid, void **out)
|
||||
{
|
||||
+ struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface);
|
||||
+
|
||||
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
|
||||
|
||||
if (IsEqualGUID(riid, &IID_ID3D11DeviceContext)
|
||||
|| IsEqualGUID(riid, &IID_ID3D11DeviceChild)
|
||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||
{
|
||||
ID3D11DeviceContext_AddRef(iface);
|
||||
*out = iface;
|
||||
return S_OK;
|
||||
}
|
||||
+ else if (IsEqualGUID(riid, &IID_IWineD3DDevice))
|
||||
+ {
|
||||
+ *out = device->wined3d_device;
|
||||
+ return S_OK;
|
||||
+ }
|
||||
|
||||
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
|
||||
*out = NULL;
|
||||
@@ -5902,6 +5909,11 @@ static HRESULT STDMETHODCALLTYPE d3d_device_inner_QueryInterface(IUnknown *iface
|
||||
{
|
||||
*out = &device->IWineDXGIDeviceParent_iface;
|
||||
}
|
||||
+ else if (IsEqualGUID(riid, &IID_IWineD3DDevice))
|
||||
+ {
|
||||
+ *out = device->wined3d_device;
|
||||
+ return S_OK;
|
||||
+ }
|
||||
else
|
||||
{
|
||||
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
|
||||
diff --git a/dlls/nvapi/nvapi.c b/dlls/nvapi/nvapi.c
|
||||
index 12ddb0d871f..70f7b3e9f34 100644
|
||||
--- a/dlls/nvapi/nvapi.c
|
||||
+++ b/dlls/nvapi/nvapi.c
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <stdarg.h>
|
||||
|
||||
#define COBJMACROS
|
||||
+#include "initguid.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winternl.h"
|
||||
@@ -681,6 +682,30 @@ static NvAPI_Status CDECL NvAPI_GPU_GetGpuCoreCount(NvPhysicalGpuHandle hPhysica
|
||||
return NVAPI_OK;
|
||||
}
|
||||
|
||||
+static NvAPI_Status CDECL NvAPI_D3D11_SetDepthBoundsTest(IUnknown *pDeviceOrContext, NvU32 bEnable, float fMinDepth, float fMaxDepth)
|
||||
+{
|
||||
+ struct wined3d_device *device;
|
||||
+ union { DWORD d; float f; } z;
|
||||
+
|
||||
+ TRACE("(%p, %u, %f, %f)\n", pDeviceOrContext, bEnable, fMinDepth, fMaxDepth);
|
||||
+
|
||||
+ if (FAILED(IUnknown_QueryInterface(pDeviceOrContext, &IID_IWineD3DDevice, (void **)&device)))
|
||||
+ {
|
||||
+ ERR("Failed to get wined3d device handle!\n");
|
||||
+ return NVAPI_ERROR;
|
||||
+ }
|
||||
+
|
||||
+ wined3d_mutex_lock();
|
||||
+ wined3d_device_set_render_state(device, WINED3D_RS_ADAPTIVETESS_X, bEnable ? WINED3DFMT_NVDB : 0);
|
||||
+ z.f = fMinDepth;
|
||||
+ wined3d_device_set_render_state(device, WINED3D_RS_ADAPTIVETESS_Z, z.d);
|
||||
+ z.f = fMaxDepth;
|
||||
+ wined3d_device_set_render_state(device, WINED3D_RS_ADAPTIVETESS_W, z.d);
|
||||
+ wined3d_mutex_unlock();
|
||||
+
|
||||
+ return NVAPI_OK;
|
||||
+}
|
||||
+
|
||||
void* CDECL nvapi_QueryInterface(unsigned int offset)
|
||||
{
|
||||
static const struct
|
||||
@@ -726,6 +751,7 @@ void* CDECL nvapi_QueryInterface(unsigned int offset)
|
||||
{0x46fbeb03, NvAPI_GPU_GetPhysicalFrameBufferSize},
|
||||
{0x5a04b644, NvAPI_GPU_GetVirtualFrameBufferSize},
|
||||
{0xc7026a87, NvAPI_GPU_GetGpuCoreCount},
|
||||
+ {0x7aaf7a04, NvAPI_D3D11_SetDepthBoundsTest},
|
||||
};
|
||||
unsigned int i;
|
||||
TRACE("(%x)\n", offset);
|
||||
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
|
||||
index 7a72b0ef15b..653c6a5a904 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -32,6 +32,8 @@
|
||||
|
||||
#include "wine/list.h"
|
||||
|
||||
+DEFINE_GUID(IID_IWineD3DDevice, 0xd56e2a4c, 0x5127, 0x8437, 0x65, 0x8a, 0x98, 0xc5, 0xbb, 0x78, 0x94, 0x98);
|
||||
+
|
||||
#define WINED3D_OK S_OK
|
||||
|
||||
#define _FACWINED3D 0x876
|
||||
--
|
||||
2.13.1
|
||||
|
@ -6584,8 +6584,9 @@ fi
|
||||
# | * [#35062] Fix graphical corruption in FarCry 3 with NVIDIA drivers
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * configure.ac, 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, include/Makefile.in, include/nvapi.h
|
||||
# | * 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,
|
||||
# | 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
|
||||
@ -6607,6 +6608,7 @@ if test "$enable_nvapi_Stub_DLL" -eq 1; then
|
||||
patch_apply nvapi-Stub_DLL/0017-nvapi-Improve-NvAPI_D3D_GetCurrentSLIState.patch
|
||||
patch_apply nvapi-Stub_DLL/0018-nvapi-Implement-NvAPI_GPU_Get-Physical-Virtual-Frame.patch
|
||||
patch_apply nvapi-Stub_DLL/0019-nvapi-Add-stub-for-NvAPI_GPU_GetGpuCoreCount.patch
|
||||
patch_apply nvapi-Stub_DLL/0020-nvapi-Implement-NvAPI_D3D11_SetDepthBoundsTest.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Michael Müller", "nvapi: First implementation.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "nvapi: Add stubs for NvAPI_EnumLogicalGPUs and undocumented equivalent.", 1 },';
|
||||
@ -6627,6 +6629,7 @@ if test "$enable_nvapi_Stub_DLL" -eq 1; then
|
||||
printf '%s\n' '+ { "Michael Müller", "nvapi: Improve NvAPI_D3D_GetCurrentSLIState.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "nvapi: Implement NvAPI_GPU_Get{Physical,Virtual}FrameBufferSize.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "nvapi: Add stub for NvAPI_GPU_GetGpuCoreCount.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "nvapi: Implement NvAPI_D3D11_SetDepthBoundsTest.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user