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.

188 lines
12 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. #include"nvapi_lite_common.h"
  37. #pragma pack(push,8)
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. #if defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
  42. //! \ingroup dx
  43. //! D3D_FEATURE_LEVEL supported - used in NvAPI_D3D11_CreateDevice() and NvAPI_D3D11_CreateDeviceAndSwapChain()
  44. typedef enum
  45. {
  46. NVAPI_DEVICE_FEATURE_LEVEL_NULL = -1,
  47. NVAPI_DEVICE_FEATURE_LEVEL_10_0 = 0,
  48. NVAPI_DEVICE_FEATURE_LEVEL_10_0_PLUS = 1,
  49. NVAPI_DEVICE_FEATURE_LEVEL_10_1 = 2,
  50. NVAPI_DEVICE_FEATURE_LEVEL_11_0 = 3,
  51. } NVAPI_DEVICE_FEATURE_LEVEL;
  52. #endif //defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
  53. #if defined(__cplusplus) && defined(__d3d11_h__)
  54. ///////////////////////////////////////////////////////////////////////////////
  55. //
  56. // FUNCTION NAME: NvAPI_D3D11_CreateDevice
  57. //
  58. //! DESCRIPTION: This function tries to create a DirectX 11 device. If the call fails (if we are running
  59. //! on pre-DirectX 11 hardware), depending on the type of hardware it will try to create a DirectX 10.1 OR DirectX 10.0+
  60. //! OR DirectX 10.0 device. The function call is the same as D3D11CreateDevice(), but with an extra
  61. //! argument (D3D_FEATURE_LEVEL supported by the device) that the function fills in. This argument
  62. //! can contain -1 (NVAPI_DEVICE_FEATURE_LEVEL_NULL), if the requested featureLevel is less than DirecX 10.0.
  63. //!
  64. //! NOTE: When NvAPI_D3D11_CreateDevice is called with 10+ feature level we have an issue on few set of
  65. //! tesla hardware (G80/G84/G86/G92/G94/G96) which does not support all feature level 10+ functionality
  66. //! e.g. calling driver with mismatch between RenderTarget and Depth Buffer. App developers should
  67. //! take into consideration such limitation when using NVAPI on such tesla hardwares.
  68. //! SUPPORTED OS: Windows Vista and higher
  69. //!
  70. //!
  71. //! \since Release: 185
  72. //!
  73. //! \param [in] pAdapter
  74. //! \param [in] DriverType
  75. //! \param [in] Software
  76. //! \param [in] Flags
  77. //! \param [in] *pFeatureLevels
  78. //! \param [in] FeatureLevels
  79. //! \param [in] SDKVersion
  80. //! \param [in] **ppDevice
  81. //! \param [in] *pFeatureLevel
  82. //! \param [in] **ppImmediateContext
  83. //! \param [in] *pSupportedLevel D3D_FEATURE_LEVEL supported
  84. //!
  85. //! \return NVAPI_OK if the createDevice call succeeded.
  86. //!
  87. //! \ingroup dx
  88. ///////////////////////////////////////////////////////////////////////////////
  89. NVAPI_INTERFACE NvAPI_D3D11_CreateDevice(IDXGIAdapter* pAdapter,
  90. D3D_DRIVER_TYPE DriverType,
  91. HMODULE Software,
  92. UINT Flags,
  93. CONST D3D_FEATURE_LEVEL *pFeatureLevels,
  94. UINT FeatureLevels,
  95. UINT SDKVersion,
  96. ID3D11Device **ppDevice,
  97. D3D_FEATURE_LEVEL *pFeatureLevel,
  98. ID3D11DeviceContext **ppImmediateContext,
  99. NVAPI_DEVICE_FEATURE_LEVEL *pSupportedLevel);
  100. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  101. #if defined(__cplusplus) && defined(__d3d11_h__)
  102. ///////////////////////////////////////////////////////////////////////////////
  103. //
  104. // FUNCTION NAME: NvAPI_D3D11_CreateDeviceAndSwapChain
  105. //
  106. //! DESCRIPTION: This function tries to create a DirectX 11 device and swap chain. If the call fails (if we are
  107. //! running on pre=DirectX 11 hardware), depending on the type of hardware it will try to create a DirectX 10.1 OR
  108. //! DirectX 10.0+ OR DirectX 10.0 device. The function call is the same as D3D11CreateDeviceAndSwapChain,
  109. //! but with an extra argument (D3D_FEATURE_LEVEL supported by the device) that the function fills
  110. //! in. This argument can contain -1 (NVAPI_DEVICE_FEATURE_LEVEL_NULL), if the requested featureLevel
  111. //! is less than DirectX 10.0.
  112. //!
  113. //! SUPPORTED OS: Windows Vista and higher
  114. //!
  115. //!
  116. //! \since Release: 185
  117. //!
  118. //! \param [in] pAdapter
  119. //! \param [in] DriverType
  120. //! \param [in] Software
  121. //! \param [in] Flags
  122. //! \param [in] *pFeatureLevels
  123. //! \param [in] FeatureLevels
  124. //! \param [in] SDKVersion
  125. //! \param [in] *pSwapChainDesc
  126. //! \param [in] **ppSwapChain
  127. //! \param [in] **ppDevice
  128. //! \param [in] *pFeatureLevel
  129. //! \param [in] **ppImmediateContext
  130. //! \param [in] *pSupportedLevel D3D_FEATURE_LEVEL supported
  131. //!
  132. //!return NVAPI_OK if the createDevice with swap chain call succeeded.
  133. //!
  134. //! \ingroup dx
  135. ///////////////////////////////////////////////////////////////////////////////
  136. NVAPI_INTERFACE NvAPI_D3D11_CreateDeviceAndSwapChain(IDXGIAdapter* pAdapter,
  137. D3D_DRIVER_TYPE DriverType,
  138. HMODULE Software,
  139. UINT Flags,
  140. CONST D3D_FEATURE_LEVEL *pFeatureLevels,
  141. UINT FeatureLevels,
  142. UINT SDKVersion,
  143. CONST DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
  144. IDXGISwapChain **ppSwapChain,
  145. ID3D11Device **ppDevice,
  146. D3D_FEATURE_LEVEL *pFeatureLevel,
  147. ID3D11DeviceContext **ppImmediateContext,
  148. NVAPI_DEVICE_FEATURE_LEVEL *pSupportedLevel);
  149. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  150. #if defined(__cplusplus) && defined(__d3d11_h__)
  151. ///////////////////////////////////////////////////////////////////////////////
  152. //
  153. // FUNCTION NAME: NvAPI_D3D11_SetDepthBoundsTest
  154. //
  155. //! DESCRIPTION: This function enables/disables the depth bounds test
  156. //!
  157. //! SUPPORTED OS: Windows Vista and higher
  158. //!
  159. //!
  160. //! \param [in] pDeviceOrContext The device or device context to set depth bounds test
  161. //! \param [in] bEnable Enable(non-zero)/disable(zero) the depth bounds test
  162. //! \param [in] fMinDepth The minimum depth for depth bounds test
  163. //! \param [in] fMaxDepth The maximum depth for depth bounds test
  164. //! The valid values for fMinDepth and fMaxDepth
  165. //! are such that 0 <= fMinDepth <= fMaxDepth <= 1
  166. //!
  167. //! \return ::NVAPI_OK if the depth bounds test was correcly enabled or disabled
  168. //!
  169. //! \ingroup dx
  170. ///////////////////////////////////////////////////////////////////////////////
  171. NVAPI_INTERFACE NvAPI_D3D11_SetDepthBoundsTest(IUnknown* pDeviceOrContext,
  172. NvU32 bEnable,
  173. float fMinDepth,
  174. float fMaxDepth);
  175. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  176. #include"nvapi_lite_salend.h"
  177. #ifdef __cplusplus
  178. }
  179. #endif
  180. #pragma pack(pop)