Rebase against 4dfd5f22f4032efdc283adf861d82e43c3b08d42

This commit is contained in:
Paul Gofman
2020-03-12 02:21:27 +03:00
parent 789f5c7c64
commit d14250ab03
5 changed files with 24 additions and 106 deletions

View File

@@ -1,16 +1,16 @@
From 5dd48cb814d0b69b43c5a57022d3beef8c2418a0 Mon Sep 17 00:00:00 2001
From deea16fd49a97aa0683ce1457c7d5ee9dd1c6f72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 27 Jun 2017 00:28:03 +0200
Subject: nvapi: Implement NvAPI_GPU_Get{Physical,Virtual}FrameBufferSize.
---
dlls/nvapi/Makefile.in | 1 +
dlls/nvapi/nvapi.c | 75 ++++++++++++++++++++++++++++++++++++++++
dlls/nvapi/nvapi.c | 76 ++++++++++++++++++++++++++++++++++++++++
dlls/nvapi64/Makefile.in | 1 +
3 files changed, 77 insertions(+)
3 files changed, 78 insertions(+)
diff --git a/dlls/nvapi/Makefile.in b/dlls/nvapi/Makefile.in
index 606177f1..6341254d 100644
index 606177f1f8..6341254d9f 100644
--- a/dlls/nvapi/Makefile.in
+++ b/dlls/nvapi/Makefile.in
@@ -1,4 +1,5 @@
@@ -20,7 +20,7 @@ index 606177f1..6341254d 100644
C_SRCS = \
nvapi.c
diff --git a/dlls/nvapi/nvapi.c b/dlls/nvapi/nvapi.c
index 598267d6..d2c88655 100644
index 598267d6c8..46d52e0984 100644
--- a/dlls/nvapi/nvapi.c
+++ b/dlls/nvapi/nvapi.c
@@ -18,9 +18,11 @@
@@ -44,26 +44,27 @@ index 598267d6..d2c88655 100644
WINE_DEFAULT_DEBUG_CHANNEL(nvapi);
#define FAKE_PHYSICAL_GPU ((NvPhysicalGpuHandle)0xdead0001)
@@ -589,6 +593,75 @@ static NvAPI_Status CDECL NvAPI_D3D9_RegisterResource(IDirect3DResource9* pResou
@@ -589,6 +593,76 @@ static NvAPI_Status CDECL NvAPI_D3D9_RegisterResource(IDirect3DResource9* pResou
return NVAPI_ERROR;
}
+static NvU32 get_video_memory(void)
+{
+ static NvU32 cache;
+ struct wined3d_adapter_identifier identifier;
+ struct wined3d_adapter *adapter;
+ struct wined3d *wined3d;
+ HRESULT hr = E_FAIL;
+ static NvU32 cache;
+
+ if (cache) return cache;
+
+ memset(&identifier, 0, sizeof(identifier));
+
+ wined3d_mutex_lock();
+ wined3d = wined3d_create(0);
+ if (wined3d)
+ if ((wined3d = wined3d_create(0)))
+ {
+ hr = wined3d_get_adapter_identifier(wined3d, 0, 0, &identifier);
+ if ((adapter = wined3d_get_adapter(wined3d, 0)))
+ hr = wined3d_adapter_get_identifier(adapter, 0, &identifier);
+ wined3d_decref(wined3d);
+ }
+ wined3d_mutex_unlock();
@@ -120,7 +121,7 @@ index 598267d6..d2c88655 100644
void* CDECL nvapi_QueryInterface(unsigned int offset)
{
static const struct
@@ -631,6 +704,8 @@ void* CDECL nvapi_QueryInterface(unsigned int offset)
@@ -631,6 +705,8 @@ void* CDECL nvapi_QueryInterface(unsigned int offset)
{0xee1370cf, NvAPI_GetLogicalGPUFromDisplay},
{0xfceac864, NvAPI_D3D_GetObjectHandleForResource},
{0xa064bdfc, NvAPI_D3D9_RegisterResource},
@@ -130,7 +131,7 @@ index 598267d6..d2c88655 100644
unsigned int i;
TRACE("(%x)\n", offset);
diff --git a/dlls/nvapi64/Makefile.in b/dlls/nvapi64/Makefile.in
index 80e2d6bf..04bd0cf1 100644
index 80e2d6bfb2..04bd0cf1c4 100644
--- a/dlls/nvapi64/Makefile.in
+++ b/dlls/nvapi64/Makefile.in
@@ -1,5 +1,6 @@
@@ -141,5 +142,5 @@ index 80e2d6bf..04bd0cf1 100644
C_SRCS = \
nvapi.c
--
2.20.1
2.24.1