#pragma once #include "Context.h" // For NvFlexErrorCallback #include "../../include/NvFlex.h" #include #include #if ENABLE_D3D12 #include #endif #include #include #include #include #define ENABLE_LIVE_DEVICE_OBJECTS_REPORTING 0 // Provides detailed report of D3D object reference counts #define USE_NVAPI_DEVICE 1 // Enable this for D3D11 SCG struct FlexDeviceDesc { FlexDeviceDesc() : mDeviceNumber(-1), mDevice(nullptr), mComputeCommandQueue(nullptr), mRenderCommandQueue(nullptr), useComputeQueue(false), enablePresent(false) {} virtual ~FlexDeviceDesc() {} unsigned int mDeviceNumber; //!< Compute device number void * mDevice; //!< pointer to existing device void * mComputeCommandQueue; //!< pointer to existing command queue for DX12 void * mRenderCommandQueue; //!< pointer to existing command queue for DX12 bool useComputeQueue; //!< Use the compute queue instead of the graphics queue for DX12 bool enablePresent; //!< Present after each frame to that APIC and PB dump work NvFlexErrorCallback mErrorFunc; }; namespace NvFlex { struct Device : public NvFlexObject { Device(); virtual ~Device(); virtual Context* createContext() = 0; virtual NvAPI_Status NvAPI_IsNvShaderExtnOpCodeSupported(NvU32 opCode, bool * pSupported) = 0; #if ENABLE_AMD_AGS virtual AGSReturnCode AGS_DriverExtensions_Init(AGSContext* agsContext, unsigned int agsApiSlot, unsigned int *extensionsSupported) = 0; virtual void AGS_DeInit(AGSContext* agsContext) = 0; #endif virtual DXGI_ADAPTER_DESC1 getDXGIAdapter(void* d3ddevice, int & deviceNumber) = 0; virtual DXGI_ADAPTER_DESC1 getDeviceNumber(const LUID adapterID, int & deviceNumber); virtual std::vector enumerateDXGIAdapters(); virtual void queryDeviceCapabilities(void* d3ddevice); virtual void reportLiveDeviceObjects() {} //#if APIC_CAPTURE virtual void createWindow(); virtual void present() = 0; WNDCLASSEX mWindowDesc; RECT mWinRect; HWND m_hWnd; IDXGISwapChain* m_swapChain; //#endif IDXGIFactory1* m_pFactory; NvFlexUint mSMCount; std::string mDeviceName; // Gpu Vendor Id GpuVendorId mGpuVendorId; bool mD3D12Device; Context* m_context; }; }