Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

541 lines
35 KiB

  1. /************************************************************************************************************************************\
  2. |* *|
  3. |* Copyright 2012 NVIDIA Corporation. All rights reserved. *|
  4. |* *|
  5. |* NOTICE TO USER: *|
  6. |* *|
  7. |* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *|
  8. |* *|
  9. |* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *|
  10. |* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *|
  11. |* Otherwise, you have no rights to use or access this software in any manner. *|
  12. |* *|
  13. |* If not covered by the applicable NVIDIA software license agreement: *|
  14. |* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *|
  15. |* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *|
  16. |* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *|
  17. |* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *|
  18. |* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *|
  19. |* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *|
  20. |* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
  21. |* *|
  22. |* U.S. Government End Users. *|
  23. |* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
  24. |* consisting of "commercial computer software" and "commercial computer software documentation" *|
  25. |* as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item. *|
  26. |* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
  27. |* all U.S. Government End Users acquire the software with only those rights set forth herein. *|
  28. |* *|
  29. |* Any use of this software in individual and commercial software must include, *|
  30. |* in the user documentation and internal comments to the code, *|
  31. |* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *|
  32. |* *|
  33. \************************************************************************************************************************************/
  34. #pragma once
  35. #include"nvapi_lite_salstart.h"
  36. #pragma pack(push,8)
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40. #if (defined(WIN32) || defined(_WIN32)) && defined(_MSC_VER) && (_MSC_VER > 1399) && !defined(NVAPI_INTERNAL) && !defined(NVAPI_DEPRECATED_OLD)
  41. #ifndef __nvapi_deprecated_function
  42. #define __nvapi_deprecated_function(message) __declspec(deprecated(message))
  43. #endif
  44. #ifndef __nvapi_deprecated_datatype
  45. #define __nvapi_deprecated_datatype(FirstRelease) __declspec(deprecated("Do not use this data type - it is deprecated in release " #FirstRelease "."))
  46. #endif
  47. #else
  48. #ifndef __nvapi_deprecated_function
  49. #define __nvapi_deprecated_function(message)
  50. #endif
  51. #ifndef __nvapi_deprecated_datatype
  52. #define __nvapi_deprecated_datatype(FirstRelease)
  53. #endif
  54. #endif
  55. /* 64-bit types for compilers that support them, plus some obsolete variants */
  56. #if defined(__GNUC__) || defined(__arm) || defined(__IAR_SYSTEMS_ICC__) || defined(__ghs__) || defined(_WIN64)
  57. typedef unsigned long long NvU64; /* 0 to 18446744073709551615 */
  58. typedef long long NvS64; /* -9223372036854775808 to 9223372036854775807 */
  59. #else
  60. typedef unsigned __int64 NvU64; /* 0 to 18446744073709551615 */
  61. typedef __int64 NvS64; /* -9223372036854775808 to 9223372036854775807 */
  62. #endif
  63. // mac os 32-bit still needs this
  64. #if (defined(macintosh) || defined(__APPLE__)) && !defined(__LP64__)
  65. typedef signed long NvS32; /* -2147483648 to 2147483647 */
  66. #else
  67. typedef signed int NvS32; /* -2147483648 to 2147483647 */
  68. #endif
  69. #ifndef __unix
  70. // mac os 32-bit still needs this
  71. #if ( (defined(macintosh) && defined(__LP64__) && (__NVAPI_RESERVED0__)) || \
  72. (!defined(macintosh) && defined(__NVAPI_RESERVED0__)) )
  73. typedef unsigned int NvU32; /* 0 to 4294967295 */
  74. #else
  75. typedef unsigned long NvU32; /* 0 to 4294967295 */
  76. #endif
  77. #else
  78. typedef unsigned int NvU32; /* 0 to 4294967295 */
  79. #endif
  80. typedef unsigned long temp_NvU32; /* 0 to 4294967295 */
  81. typedef signed short NvS16;
  82. typedef unsigned short NvU16;
  83. typedef unsigned char NvU8;
  84. typedef signed char NvS8;
  85. /* Boolean type */
  86. typedef NvU8 NvBool;
  87. #define NV_TRUE ((NvBool)(0 == 0))
  88. #define NV_FALSE ((NvBool)(0 != 0))
  89. typedef struct _NV_RECT
  90. {
  91. NvU32 left;
  92. NvU32 top;
  93. NvU32 right;
  94. NvU32 bottom;
  95. } NV_RECT;
  96. #define NV_DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name
  97. //! \addtogroup nvapihandles
  98. //! NVAPI Handles - These handles are retrieved from various calls and passed in to others in NvAPI
  99. //! These are meant to be opaque types. Do not assume they correspond to indices, HDCs,
  100. //! display indexes or anything else.
  101. //!
  102. //! Most handles remain valid until a display re-configuration (display mode set) or GPU
  103. //! reconfiguration (going into or out of SLI modes) occurs. If NVAPI_HANDLE_INVALIDATED
  104. //! is received by an app, it should discard all handles, and re-enumerate them.
  105. //! @{
  106. NV_DECLARE_HANDLE(NvDisplayHandle); //!< Display Device driven by NVIDIA GPU(s) (an attached display)
  107. NV_DECLARE_HANDLE(NvMonitorHandle); //!< Monitor handle
  108. NV_DECLARE_HANDLE(NvUnAttachedDisplayHandle); //!< Unattached Display Device driven by NVIDIA GPU(s)
  109. NV_DECLARE_HANDLE(NvLogicalGpuHandle); //!< One or more physical GPUs acting in concert (SLI)
  110. NV_DECLARE_HANDLE(NvPhysicalGpuHandle); //!< A single physical GPU
  111. NV_DECLARE_HANDLE(NvEventHandle); //!< A handle to an event registration instance
  112. NV_DECLARE_HANDLE(NvVisualComputingDeviceHandle); //!< A handle to a Visual Computing Device
  113. NV_DECLARE_HANDLE(NvHICHandle); //!< A handle to a Host Interface Card
  114. NV_DECLARE_HANDLE(NvGSyncDeviceHandle); //!< A handle to a Sync device
  115. NV_DECLARE_HANDLE(NvVioHandle); //!< A handle to an SDI device
  116. NV_DECLARE_HANDLE(NvTransitionHandle); //!< A handle to address a single transition request
  117. NV_DECLARE_HANDLE(NvAudioHandle); //!< NVIDIA HD Audio Device
  118. NV_DECLARE_HANDLE(Nv3DVPContextHandle); //!< A handle for a 3D Vision Pro (3DVP) context
  119. NV_DECLARE_HANDLE(Nv3DVPTransceiverHandle); //!< A handle for a 3DVP RF transceiver
  120. NV_DECLARE_HANDLE(Nv3DVPGlassesHandle); //!< A handle for a pair of 3DVP RF shutter glasses
  121. typedef void* StereoHandle; //!< A stereo handle, that corresponds to the device interface
  122. NV_DECLARE_HANDLE(NvSourceHandle); //!< Unique source handle on the system
  123. NV_DECLARE_HANDLE(NvTargetHandle); //!< Unique target handle on the system
  124. NV_DECLARE_HANDLE(NVDX_SwapChainHandle); //!< DirectX SwapChain objects
  125. static const NVDX_SwapChainHandle NVDX_SWAPCHAIN_NONE = 0;
  126. //! @}
  127. //! \ingroup nvapihandles
  128. //! @{
  129. #define NVAPI_DEFAULT_HANDLE 0
  130. #define NV_BIT(x) (1 << (x))
  131. //! @}
  132. //! \addtogroup nvapitypes
  133. //! @{
  134. #define NVAPI_GENERIC_STRING_MAX 4096
  135. #define NVAPI_LONG_STRING_MAX 256
  136. #define NVAPI_SHORT_STRING_MAX 64
  137. typedef struct
  138. {
  139. NvS32 sX;
  140. NvS32 sY;
  141. NvS32 sWidth;
  142. NvS32 sHeight;
  143. } NvSBox;
  144. #ifndef NvGUID_Defined
  145. #define NvGUID_Defined
  146. typedef struct
  147. {
  148. NvU32 data1;
  149. NvU16 data2;
  150. NvU16 data3;
  151. NvU8 data4[8];
  152. } NvGUID, NvLUID;
  153. #endif //#ifndef NvGUID_Defined
  154. #define NVAPI_MAX_PHYSICAL_GPUS 64
  155. #define NVAPI_MAX_PHYSICAL_BRIDGES 100
  156. #define NVAPI_PHYSICAL_GPUS 32
  157. #define NVAPI_MAX_LOGICAL_GPUS 64
  158. #define NVAPI_MAX_AVAILABLE_GPU_TOPOLOGIES 256
  159. #define NVAPI_MAX_AVAILABLE_SLI_GROUPS 256
  160. #define NVAPI_MAX_GPU_TOPOLOGIES NVAPI_MAX_PHYSICAL_GPUS
  161. #define NVAPI_MAX_GPU_PER_TOPOLOGY 8
  162. #define NVAPI_MAX_DISPLAY_HEADS 2
  163. #define NVAPI_ADVANCED_DISPLAY_HEADS 4
  164. #define NVAPI_MAX_DISPLAYS NVAPI_PHYSICAL_GPUS * NVAPI_ADVANCED_DISPLAY_HEADS
  165. #define NVAPI_MAX_ACPI_IDS 16
  166. #define NVAPI_MAX_VIEW_MODES 8
  167. #define NV_MAX_HEADS 4 //!< Maximum heads, each with NVAPI_DESKTOP_RES resolution
  168. #define NVAPI_MAX_HEADS_PER_GPU 32
  169. #define NV_MAX_HEADS 4 //!< Maximum number of heads, each with #NVAPI_DESKTOP_RES resolution
  170. #define NV_MAX_VID_STREAMS 4 //!< Maximum number of input video streams, each with a #NVAPI_VIDEO_SRC_INFO
  171. #define NV_MAX_VID_PROFILES 4 //!< Maximum number of output video profiles supported
  172. #define NVAPI_SYSTEM_MAX_DISPLAYS NVAPI_MAX_PHYSICAL_GPUS * NV_MAX_HEADS
  173. #define NVAPI_SYSTEM_MAX_HWBCS 128
  174. #define NVAPI_SYSTEM_HWBC_INVALID_ID 0xffffffff
  175. #define NVAPI_MAX_AUDIO_DEVICES 16
  176. typedef char NvAPI_String[NVAPI_GENERIC_STRING_MAX];
  177. typedef char NvAPI_LongString[NVAPI_LONG_STRING_MAX];
  178. typedef char NvAPI_ShortString[NVAPI_SHORT_STRING_MAX];
  179. //! @}
  180. // =========================================================================================
  181. //! NvAPI Version Definition \n
  182. //! Maintain per structure specific version define using the MAKE_NVAPI_VERSION macro. \n
  183. //! Usage: #define NV_GENLOCK_STATUS_VER MAKE_NVAPI_VERSION(NV_GENLOCK_STATUS, 1)
  184. //! \ingroup nvapitypes
  185. // =========================================================================================
  186. #define MAKE_NVAPI_VERSION(typeName,ver) (NvU32)(sizeof(typeName) | ((ver)<<16))
  187. //! \ingroup nvapitypes
  188. #define GET_NVAPI_VERSION(ver) (NvU32)((ver)>>16)
  189. //! \ingroup nvapitypes
  190. #define GET_NVAPI_SIZE(ver) (NvU32)((ver) & 0xffff)
  191. // ====================================================
  192. //! NvAPI Status Values
  193. //! All NvAPI functions return one of these codes.
  194. //! \ingroup nvapistatus
  195. // ====================================================
  196. typedef enum _NvAPI_Status
  197. {
  198. NVAPI_OK = 0, //!< Success. Request is completed.
  199. NVAPI_ERROR = -1, //!< Generic error
  200. NVAPI_LIBRARY_NOT_FOUND = -2, //!< NVAPI support library cannot be loaded.
  201. NVAPI_NO_IMPLEMENTATION = -3, //!< not implemented in current driver installation
  202. NVAPI_API_NOT_INITIALIZED = -4, //!< NvAPI_Initialize has not been called (successfully)
  203. NVAPI_INVALID_ARGUMENT = -5, //!< The argument/parameter value is not valid or NULL.
  204. NVAPI_NVIDIA_DEVICE_NOT_FOUND = -6, //!< No NVIDIA display driver, or NVIDIA GPU driving a display, was found.
  205. NVAPI_END_ENUMERATION = -7, //!< No more items to enumerate
  206. NVAPI_INVALID_HANDLE = -8, //!< Invalid handle
  207. NVAPI_INCOMPATIBLE_STRUCT_VERSION = -9, //!< An argument's structure version is not supported
  208. NVAPI_HANDLE_INVALIDATED = -10, //!< The handle is no longer valid (likely due to GPU or display re-configuration)
  209. NVAPI_OPENGL_CONTEXT_NOT_CURRENT = -11, //!< No NVIDIA OpenGL context is current (but needs to be)
  210. NVAPI_INVALID_POINTER = -14, //!< An invalid pointer, usually NULL, was passed as a parameter
  211. NVAPI_NO_GL_EXPERT = -12, //!< OpenGL Expert is not supported by the current drivers
  212. NVAPI_INSTRUMENTATION_DISABLED = -13, //!< OpenGL Expert is supported, but driver instrumentation is currently disabled
  213. NVAPI_NO_GL_NSIGHT = -15, //!< OpenGL does not support Nsight
  214. NVAPI_EXPECTED_LOGICAL_GPU_HANDLE = -100, //!< Expected a logical GPU handle for one or more parameters
  215. NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE = -101, //!< Expected a physical GPU handle for one or more parameters
  216. NVAPI_EXPECTED_DISPLAY_HANDLE = -102, //!< Expected an NV display handle for one or more parameters
  217. NVAPI_INVALID_COMBINATION = -103, //!< The combination of parameters is not valid.
  218. NVAPI_NOT_SUPPORTED = -104, //!< Requested feature is not supported in the selected GPU
  219. NVAPI_PORTID_NOT_FOUND = -105, //!< No port ID was found for the I2C transaction
  220. NVAPI_EXPECTED_UNATTACHED_DISPLAY_HANDLE = -106, //!< Expected an unattached display handle as one of the input parameters.
  221. NVAPI_INVALID_PERF_LEVEL = -107, //!< Invalid perf level
  222. NVAPI_DEVICE_BUSY = -108, //!< Device is busy; request not fulfilled
  223. NVAPI_NV_PERSIST_FILE_NOT_FOUND = -109, //!< NV persist file is not found
  224. NVAPI_PERSIST_DATA_NOT_FOUND = -110, //!< NV persist data is not found
  225. NVAPI_EXPECTED_TV_DISPLAY = -111, //!< Expected a TV output display
  226. NVAPI_EXPECTED_TV_DISPLAY_ON_DCONNECTOR = -112, //!< Expected a TV output on the D Connector - HDTV_EIAJ4120.
  227. NVAPI_NO_ACTIVE_SLI_TOPOLOGY = -113, //!< SLI is not active on this device.
  228. NVAPI_SLI_RENDERING_MODE_NOTALLOWED = -114, //!< Setup of SLI rendering mode is not possible right now.
  229. NVAPI_EXPECTED_DIGITAL_FLAT_PANEL = -115, //!< Expected a digital flat panel.
  230. NVAPI_ARGUMENT_EXCEED_MAX_SIZE = -116, //!< Argument exceeds the expected size.
  231. NVAPI_DEVICE_SWITCHING_NOT_ALLOWED = -117, //!< Inhibit is ON due to one of the flags in NV_GPU_DISPLAY_CHANGE_INHIBIT or SLI active.
  232. NVAPI_TESTING_CLOCKS_NOT_SUPPORTED = -118, //!< Testing of clocks is not supported.
  233. NVAPI_UNKNOWN_UNDERSCAN_CONFIG = -119, //!< The specified underscan config is from an unknown source (e.g. INF)
  234. NVAPI_TIMEOUT_RECONFIGURING_GPU_TOPO = -120, //!< Timeout while reconfiguring GPUs
  235. NVAPI_DATA_NOT_FOUND = -121, //!< Requested data was not found
  236. NVAPI_EXPECTED_ANALOG_DISPLAY = -122, //!< Expected an analog display
  237. NVAPI_NO_VIDLINK = -123, //!< No SLI video bridge is present
  238. NVAPI_REQUIRES_REBOOT = -124, //!< NVAPI requires a reboot for the settings to take effect
  239. NVAPI_INVALID_HYBRID_MODE = -125, //!< The function is not supported with the current Hybrid mode.
  240. NVAPI_MIXED_TARGET_TYPES = -126, //!< The target types are not all the same
  241. NVAPI_SYSWOW64_NOT_SUPPORTED = -127, //!< The function is not supported from 32-bit on a 64-bit system.
  242. NVAPI_IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED = -128, //!< There is no implicit GPU topology active. Use NVAPI_SetHybridMode to change topology.
  243. NVAPI_REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS = -129, //!< Prompt the user to close all non-migratable applications.
  244. NVAPI_OUT_OF_MEMORY = -130, //!< Could not allocate sufficient memory to complete the call.
  245. NVAPI_WAS_STILL_DRAWING = -131, //!< The previous operation that is transferring information to or from this surface is incomplete.
  246. NVAPI_FILE_NOT_FOUND = -132, //!< The file was not found.
  247. NVAPI_TOO_MANY_UNIQUE_STATE_OBJECTS = -133, //!< There are too many unique instances of a particular type of state object.
  248. NVAPI_INVALID_CALL = -134, //!< The method call is invalid. For example, a method's parameter may not be a valid pointer.
  249. NVAPI_D3D10_1_LIBRARY_NOT_FOUND = -135, //!< d3d10_1.dll cannot be loaded.
  250. NVAPI_FUNCTION_NOT_FOUND = -136, //!< Couldn't find the function in the loaded DLL.
  251. NVAPI_INVALID_USER_PRIVILEGE = -137, //!< Current User is not Admin.
  252. NVAPI_EXPECTED_NON_PRIMARY_DISPLAY_HANDLE = -138, //!< The handle corresponds to GDIPrimary.
  253. NVAPI_EXPECTED_COMPUTE_GPU_HANDLE = -139, //!< Setting Physx GPU requires that the GPU is compute-capable.
  254. NVAPI_STEREO_NOT_INITIALIZED = -140, //!< The Stereo part of NVAPI failed to initialize completely. Check if the stereo driver is installed.
  255. NVAPI_STEREO_REGISTRY_ACCESS_FAILED = -141, //!< Access to stereo-related registry keys or values has failed.
  256. NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED = -142, //!< The given registry profile type is not supported.
  257. NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED = -143, //!< The given registry value is not supported.
  258. NVAPI_STEREO_NOT_ENABLED = -144, //!< Stereo is not enabled and the function needed it to execute completely.
  259. NVAPI_STEREO_NOT_TURNED_ON = -145, //!< Stereo is not turned on and the function needed it to execute completely.
  260. NVAPI_STEREO_INVALID_DEVICE_INTERFACE = -146, //!< Invalid device interface.
  261. NVAPI_STEREO_PARAMETER_OUT_OF_RANGE = -147, //!< Separation percentage or JPEG image capture quality is out of [0-100] range.
  262. NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED = -148, //!< The given frustum adjust mode is not supported.
  263. NVAPI_TOPO_NOT_POSSIBLE = -149, //!< The mosaic topology is not possible given the current state of the hardware.
  264. NVAPI_MODE_CHANGE_FAILED = -150, //!< An attempt to do a display resolution mode change has failed.
  265. NVAPI_D3D11_LIBRARY_NOT_FOUND = -151, //!< d3d11.dll/d3d11_beta.dll cannot be loaded.
  266. NVAPI_INVALID_ADDRESS = -152, //!< Address is outside of valid range.
  267. NVAPI_STRING_TOO_SMALL = -153, //!< The pre-allocated string is too small to hold the result.
  268. NVAPI_MATCHING_DEVICE_NOT_FOUND = -154, //!< The input does not match any of the available devices.
  269. NVAPI_DRIVER_RUNNING = -155, //!< Driver is running.
  270. NVAPI_DRIVER_NOTRUNNING = -156, //!< Driver is not running.
  271. NVAPI_ERROR_DRIVER_RELOAD_REQUIRED = -157, //!< A driver reload is required to apply these settings.
  272. NVAPI_SET_NOT_ALLOWED = -158, //!< Intended setting is not allowed.
  273. NVAPI_ADVANCED_DISPLAY_TOPOLOGY_REQUIRED = -159, //!< Information can't be returned due to "advanced display topology".
  274. NVAPI_SETTING_NOT_FOUND = -160, //!< Setting is not found.
  275. NVAPI_SETTING_SIZE_TOO_LARGE = -161, //!< Setting size is too large.
  276. NVAPI_TOO_MANY_SETTINGS_IN_PROFILE = -162, //!< There are too many settings for a profile.
  277. NVAPI_PROFILE_NOT_FOUND = -163, //!< Profile is not found.
  278. NVAPI_PROFILE_NAME_IN_USE = -164, //!< Profile name is duplicated.
  279. NVAPI_PROFILE_NAME_EMPTY = -165, //!< Profile name is empty.
  280. NVAPI_EXECUTABLE_NOT_FOUND = -166, //!< Application not found in the Profile.
  281. NVAPI_EXECUTABLE_ALREADY_IN_USE = -167, //!< Application already exists in the other profile.
  282. NVAPI_DATATYPE_MISMATCH = -168, //!< Data Type mismatch
  283. NVAPI_PROFILE_REMOVED = -169, //!< The profile passed as parameter has been removed and is no longer valid.
  284. NVAPI_UNREGISTERED_RESOURCE = -170, //!< An unregistered resource was passed as a parameter.
  285. NVAPI_ID_OUT_OF_RANGE = -171, //!< The DisplayId corresponds to a display which is not within the normal outputId range.
  286. NVAPI_DISPLAYCONFIG_VALIDATION_FAILED = -172, //!< Display topology is not valid so the driver cannot do a mode set on this configuration.
  287. NVAPI_DPMST_CHANGED = -173, //!< Display Port Multi-Stream topology has been changed.
  288. NVAPI_INSUFFICIENT_BUFFER = -174, //!< Input buffer is insufficient to hold the contents.
  289. NVAPI_ACCESS_DENIED = -175, //!< No access to the caller.
  290. NVAPI_MOSAIC_NOT_ACTIVE = -176, //!< The requested action cannot be performed without Mosaic being enabled.
  291. NVAPI_SHARE_RESOURCE_RELOCATED = -177, //!< The surface is relocated away from video memory.
  292. NVAPI_REQUEST_USER_TO_DISABLE_DWM = -178, //!< The user should disable DWM before calling NvAPI.
  293. NVAPI_D3D_DEVICE_LOST = -179, //!< D3D device status is D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET - the user has to reset the device.
  294. NVAPI_INVALID_CONFIGURATION = -180, //!< The requested action cannot be performed in the current state.
  295. NVAPI_STEREO_HANDSHAKE_NOT_DONE = -181, //!< Call failed as stereo handshake not completed.
  296. NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS = -182, //!< The path provided was too short to determine the correct NVDRS_APPLICATION
  297. NVAPI_DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED = -183, //!< Default stereo profile is not currently defined
  298. NVAPI_DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST = -184, //!< Default stereo profile does not exist
  299. NVAPI_CLUSTER_ALREADY_EXISTS = -185, //!< A cluster is already defined with the given configuration.
  300. NVAPI_DPMST_DISPLAY_ID_EXPECTED = -186, //!< The input display id is not that of a multi stream enabled connector or a display device in a multi stream topology
  301. NVAPI_INVALID_DISPLAY_ID = -187, //!< The input display id is not valid or the monitor associated to it does not support the current operation
  302. NVAPI_STREAM_IS_OUT_OF_SYNC = -188, //!< While playing secure audio stream, stream goes out of sync
  303. NVAPI_INCOMPATIBLE_AUDIO_DRIVER = -189, //!< Older audio driver version than required
  304. NVAPI_VALUE_ALREADY_SET = -190, //!< Value already set, setting again not allowed.
  305. NVAPI_TIMEOUT = -191, //!< Requested operation timed out
  306. NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE = -192, //!< The requested workstation feature set has incomplete driver internal allocation resources
  307. NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE = -193, //!< Call failed because InitActivation was not called.
  308. NVAPI_SYNC_NOT_ACTIVE = -194, //!< The requested action cannot be performed without Sync being enabled.
  309. NVAPI_SYNC_MASTER_NOT_FOUND = -195, //!< The requested action cannot be performed without Sync Master being enabled.
  310. NVAPI_INVALID_SYNC_TOPOLOGY = -196, //!< Invalid displays passed in the NV_GSYNC_DISPLAY pointer.
  311. NVAPI_ECID_SIGN_ALGO_UNSUPPORTED = -197, //!< The specified signing algorithm is not supported. Either an incorrect value was entered or the current installed driver/hardware does not support the input value.
  312. NVAPI_ECID_KEY_VERIFICATION_FAILED = -198, //!< The encrypted public key verification has failed.
  313. NVAPI_FIRMWARE_OUT_OF_DATE = -199, //!< The device's firmware is out of date.
  314. NVAPI_FIRMWARE_REVISION_NOT_SUPPORTED = -200, //!< The device's firmware is not supported.
  315. NVAPI_LICENSE_CALLER_AUTHENTICATION_FAILED = -201, //!< The caller is not authorized to modify the License.
  316. NVAPI_D3D_DEVICE_NOT_REGISTERED = -202, //!< The user tried to use a deferred context without registering the device first
  317. NVAPI_RESOURCE_NOT_ACQUIRED = -203, //!< Head or SourceId was not reserved for the VR Display before doing the Modeset.
  318. NVAPI_TIMING_NOT_SUPPORTED = -204, //!< Provided timing is not supported.
  319. NVAPI_HDCP_ENCRYPTION_FAILED = -205, //!< HDCP Encryption Failed for the device. Would be applicable when the device is HDCP Capable.
  320. NVAPI_PCLK_LIMITATION_FAILED = -206, //!< Provided mode is over sink device pclk limitation.
  321. NVAPI_NO_CONNECTOR_FOUND = -207, //!< No connector on GPU found.
  322. } NvAPI_Status;
  323. ///////////////////////////////////////////////////////////////////////////////
  324. //
  325. // FUNCTION NAME: NvAPI_SYS_GetDriverAndBranchVersion
  326. //
  327. //! DESCRIPTION: This API returns display driver version and driver-branch string.
  328. //!
  329. //! SUPPORTED OS: Windows XP and higher
  330. //!
  331. //!
  332. //! \param [out] pDriverVersion Contains the driver version after successful return.
  333. //! \param [out] szBuildBranchString Contains the driver-branch string after successful return.
  334. //!
  335. //! \retval ::NVAPI_INVALID_ARGUMENT: either pDriverVersion is NULL or enum index too big
  336. //! \retval ::NVAPI_OK - completed request
  337. //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
  338. //! \retval ::NVAPI_ERROR - miscellaneous error occurred
  339. //!
  340. //! \ingroup driverapi
  341. ///////////////////////////////////////////////////////////////////////////////
  342. NVAPI_INTERFACE NvAPI_SYS_GetDriverAndBranchVersion(NvU32* pDriverVersion, NvAPI_ShortString szBuildBranchString);
  343. //! \ingroup driverapi
  344. //! Used in NvAPI_GPU_GetMemoryInfo().
  345. typedef struct
  346. {
  347. NvU32 version; //!< Version info
  348. NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer.
  349. NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces.
  350. NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time.
  351. NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations.
  352. } NV_DISPLAY_DRIVER_MEMORY_INFO_V1;
  353. //! \ingroup driverapi
  354. //! Used in NvAPI_GPU_GetMemoryInfo().
  355. typedef struct
  356. {
  357. NvU32 version; //!< Version info
  358. NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer.
  359. NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces.
  360. NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time.
  361. NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations.
  362. NvU32 curAvailableDedicatedVideoMemory; //!< Size(in kb) of the current available physical framebuffer for allocating video memory surfaces.
  363. } NV_DISPLAY_DRIVER_MEMORY_INFO_V2;
  364. //! \ingroup driverapi
  365. //! Used in NvAPI_GPU_GetMemoryInfo().
  366. typedef struct
  367. {
  368. NvU32 version; //!< Version info
  369. NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer.
  370. NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces.
  371. NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time.
  372. NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations.
  373. NvU32 curAvailableDedicatedVideoMemory; //!< Size(in kb) of the current available physical framebuffer for allocating video memory surfaces.
  374. NvU32 dedicatedVideoMemoryEvictionsSize; //!< Size(in kb) of the total size of memory released as a result of the evictions.
  375. NvU32 dedicatedVideoMemoryEvictionCount; //!< Indicates the number of eviction events that caused an allocation to be removed from dedicated video memory to free GPU
  376. //!< video memory to make room for other allocations.
  377. } NV_DISPLAY_DRIVER_MEMORY_INFO_V3;
  378. //! \ingroup driverapi
  379. typedef NV_DISPLAY_DRIVER_MEMORY_INFO_V3 NV_DISPLAY_DRIVER_MEMORY_INFO;
  380. //! \ingroup driverapi
  381. //! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V1
  382. #define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_1 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V1,1)
  383. //! \ingroup driverapi
  384. //! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V2
  385. #define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_2 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V2,2)
  386. //! \ingroup driverapi
  387. //! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V3
  388. #define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_3 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V3,3)
  389. //! \ingroup driverapi
  390. #define NV_DISPLAY_DRIVER_MEMORY_INFO_VER NV_DISPLAY_DRIVER_MEMORY_INFO_VER_3
  391. ///////////////////////////////////////////////////////////////////////////////
  392. //
  393. // FUNCTION NAME: NvAPI_GPU_GetMemoryInfo
  394. //
  395. //! DESCRIPTION: This function retrieves the available driver memory footprint for the specified GPU.
  396. //!
  397. //! SUPPORTED OS: Windows XP and higher
  398. //!
  399. //!
  400. //! TCC_SUPPORTED
  401. //!
  402. //! \since Release: 177
  403. //!
  404. //! \param [in] hPhysicalGpu Handle of the physical GPU for which the memory information is to be extracted.
  405. //! \param [out] pMemoryInfo The memory footprint available in the driver. See NV_DISPLAY_DRIVER_MEMORY_INFO.
  406. //!
  407. //! \retval NVAPI_INVALID_ARGUMENT pMemoryInfo is NULL.
  408. //! \retval NVAPI_OK Call successful.
  409. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  410. //! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_DISPLAY_DRIVER_MEMORY_INFO structure version mismatch.
  411. //!
  412. //! \ingroup driverapi
  413. ///////////////////////////////////////////////////////////////////////////////
  414. NVAPI_INTERFACE NvAPI_GPU_GetMemoryInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_DISPLAY_DRIVER_MEMORY_INFO *pMemoryInfo);
  415. ///////////////////////////////////////////////////////////////////////////////
  416. //
  417. // FUNCTION NAME: NvAPI_EnumPhysicalGPUs
  418. //
  419. //! This function returns an array of physical GPU handles.
  420. //! Each handle represents a physical GPU present in the system.
  421. //! That GPU may be part of an SLI configuration, or may not be visible to the OS directly.
  422. //!
  423. //! At least one GPU must be present in the system and running an NVIDIA display driver.
  424. //!
  425. //! The array nvGPUHandle will be filled with physical GPU handle values. The returned
  426. //! gpuCount determines how many entries in the array are valid.
  427. //!
  428. //! \note In drivers older than 105.00, all physical GPU handles get invalidated on a
  429. //! modeset. So the calling applications need to renum the handles after every modeset.\n
  430. //! With drivers 105.00 and up, all physical GPU handles are constant.
  431. //! Physical GPU handles are constant as long as the GPUs are not physically moved and
  432. //! the SBIOS VGA order is unchanged.
  433. //!
  434. //! For GPU handles in TCC MODE please use NvAPI_EnumTCCPhysicalGPUs()
  435. //!
  436. //! SUPPORTED OS: Windows XP and higher, Mac OS X
  437. //!
  438. //!
  439. //! \par Introduced in
  440. //! \since Release: 80
  441. //!
  442. //! \retval NVAPI_INVALID_ARGUMENT nvGPUHandle or pGpuCount is NULL
  443. //! \retval NVAPI_OK One or more handles were returned
  444. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  445. //! \ingroup gpu
  446. ///////////////////////////////////////////////////////////////////////////////
  447. NVAPI_INTERFACE NvAPI_EnumPhysicalGPUs(NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
  448. #if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
  449. NV_DECLARE_HANDLE(NVDX_ObjectHandle); // DX Objects
  450. static const NVDX_ObjectHandle NVDX_OBJECT_NONE = 0;
  451. #endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
  452. #if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
  453. ///////////////////////////////////////////////////////////////////////////////
  454. //
  455. // FUNCTION NAME: NvAPI_D3D_GetObjectHandleForResource
  456. //
  457. //! DESCRIPTION: This API gets a handle to a resource.
  458. //!
  459. //! \param [in] pDev The ID3D11Device, ID3D10Device or IDirect3DDevice9 to use
  460. //! \param [in] pResource The ID3D10Resource, ID3D10Resource or IDirect3DResource9 from which
  461. //! we want the NvAPI handle
  462. //! \param [out] pHandle A handle to the resource
  463. //!
  464. //! SUPPORTED OS: Windows XP and higher
  465. //!
  466. //!
  467. //! \since Release: 185
  468. //!
  469. //! \return ::NVAPI_OK if the handle was populated.
  470. //!
  471. //! \ingroup dx
  472. ///////////////////////////////////////////////////////////////////////////////
  473. NVAPI_INTERFACE NvAPI_D3D_GetObjectHandleForResource(
  474. IUnknown *pDevice,
  475. IUnknown *pResource,
  476. NVDX_ObjectHandle *pHandle);
  477. #endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
  478. #include"nvapi_lite_salend.h"
  479. #ifdef __cplusplus
  480. }
  481. #endif
  482. #pragma pack(pop)