yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f65d756bf
master
1#include "nvapi-util.h" 2 3#include "nvapi-include.h" 4 5namespace gfx 6{ 7 8static SlangResult g_initStatus = SLANG_E_UNINITIALIZED ; 9 10/* static */ SlangResult NVAPIUtil ::initialize () 11{ 12#ifdef GFX_NVAPI 13if (g_initStatus == SLANG_E_UNINITIALIZED ) 14 { 15NvAPI_Status ret = NVAPI_OK ; 16ret = NvAPI_Initialize (); 17g_initStatus = (ret == NVAPI_OK ) ?SLANG_OK :SLANG_E_NOT_AVAILABLE ; 18 } 19#else 20g_initStatus = SLANG_E_NOT_AVAILABLE ; 21#endif 22 23return g_initStatus ; 24} 25 26/* static */ bool NVAPIUtil ::isAvailable () 27{ 28return SLANG_SUCCEEDED (g_initStatus ); 29} 30 31}// namespace gfx