nvapi.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
  3. * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
  4. */
  5. #ifndef BGFX_NVAPI_H_HEADER_GUARD
  6. #define BGFX_NVAPI_H_HEADER_GUARD
  7. struct ID3D11DeviceContext;
  8. struct ID3D11Buffer;
  9. struct ID3D12Device;
  10. struct ID3D12CommandList;
  11. namespace bgfx
  12. {
  13. struct NvPhysicalGpuHandle;
  14. struct NvAftermathContextHandle;
  15. typedef void (*PFN_NVAPI_MULTIDRAWINDIRECT)(ID3D11DeviceContext* _deviceCtx, uint32_t _numDrawIndirect, ID3D11Buffer* _ptr, uint32_t _offset, uint32_t _stride);
  16. ///
  17. struct NvApi
  18. {
  19. ///
  20. NvApi();
  21. ///
  22. void init();
  23. ///
  24. void shutdown();
  25. ///
  26. bool isInitialized() const { return NULL != m_nvGpu; }
  27. ///
  28. void getMemoryInfo(int64_t& _gpuMemoryUsed, int64_t& _gpuMemoryMax);
  29. ///
  30. bool initAftermath(const ID3D12Device* _device, const ID3D12CommandList* _commandList);
  31. ///
  32. void shutdownAftermath();
  33. ///
  34. void setMarker(const bx::StringView& _marker);
  35. ///
  36. void* m_nvApiDll;
  37. NvPhysicalGpuHandle* m_nvGpu;
  38. void* m_nvAftermathDll;
  39. NvAftermathContextHandle* m_aftermathHandle;
  40. PFN_NVAPI_MULTIDRAWINDIRECT nvApiD3D11MultiDrawInstancedIndirect;
  41. PFN_NVAPI_MULTIDRAWINDIRECT nvApiD3D11MultiDrawIndexedInstancedIndirect;
  42. };
  43. } // namespace bgfx
  44. #endif // BGFX_NVAPI_H_HEADER_GUARD