diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-29 14:49:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 14:49:26 +0800 |
| commit | f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch) | |
| tree | ea1d61342cd29368e19135000ec2948813096205 /tools/gfx/nvapi | |
| parent | a729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff) | |
format
* format
* Minor test fixes
* enable checking cpp format in ci
Diffstat (limited to 'tools/gfx/nvapi')
| -rw-r--r-- | tools/gfx/nvapi/nvapi-include.h | 27 | ||||
| -rw-r--r-- | tools/gfx/nvapi/nvapi-util.cpp | 9 | ||||
| -rw-r--r-- | tools/gfx/nvapi/nvapi-util.h | 11 |
3 files changed, 24 insertions, 23 deletions
diff --git a/tools/gfx/nvapi/nvapi-include.h b/tools/gfx/nvapi/nvapi-include.h index 513977048..45a8ca77b 100644 --- a/tools/gfx/nvapi/nvapi-include.h +++ b/tools/gfx/nvapi/nvapi-include.h @@ -6,20 +6,19 @@ #ifdef GFX_NVAPI // On windows if we include NVAPI, we must include windows.h first -# ifdef _WIN32 -# pragma push_macro("WIN32_LEAN_AND_MEAN") -# pragma push_macro("NOMINMAX") -# undef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# undef NOMINMAX -# define NOMINMAX -# include <windows.h> -# pragma pop_macro("NOMINMAX") -# pragma pop_macro("WIN32_LEAN_AND_MEAN") -# endif +#ifdef _WIN32 +#pragma push_macro("WIN32_LEAN_AND_MEAN") +#pragma push_macro("NOMINMAX") +#undef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#undef NOMINMAX +#define NOMINMAX +#include <windows.h> +#pragma pop_macro("NOMINMAX") +#pragma pop_macro("WIN32_LEAN_AND_MEAN") +#endif -# include <nvapi.h> -# include <nvShaderExtnEnums.h> +#include <nvShaderExtnEnums.h> +#include <nvapi.h> #endif - diff --git a/tools/gfx/nvapi/nvapi-util.cpp b/tools/gfx/nvapi/nvapi-util.cpp index 63bcc65fc..efb053c07 100644 --- a/tools/gfx/nvapi/nvapi-util.cpp +++ b/tools/gfx/nvapi/nvapi-util.cpp @@ -2,11 +2,12 @@ #include "nvapi-include.h" -namespace gfx { +namespace gfx +{ static SlangResult g_initStatus = SLANG_E_UNINITIALIZED; -/* static */SlangResult NVAPIUtil::initialize() +/* static */ SlangResult NVAPIUtil::initialize() { #ifdef GFX_NVAPI if (g_initStatus == SLANG_E_UNINITIALIZED) @@ -22,9 +23,9 @@ static SlangResult g_initStatus = SLANG_E_UNINITIALIZED; return g_initStatus; } -/* static */bool NVAPIUtil::isAvailable() +/* static */ bool NVAPIUtil::isAvailable() { return SLANG_SUCCEEDED(g_initStatus); } -} // gfx +} // namespace gfx diff --git a/tools/gfx/nvapi/nvapi-util.h b/tools/gfx/nvapi/nvapi-util.h index 0bcab7d36..7715df8c6 100644 --- a/tools/gfx/nvapi/nvapi-util.h +++ b/tools/gfx/nvapi/nvapi-util.h @@ -4,16 +4,17 @@ #include "slang-com-helper.h" #include "slang-com-ptr.h" -namespace gfx { +namespace gfx +{ struct NVAPIUtil { - /// Set up NVAPI for use. Must be called before any other function is used. + /// Set up NVAPI for use. Must be called before any other function is used. static SlangResult initialize(); - /// True if the NVAPI is available, can be called even if initialize fails. - /// If initialize has not been called will return false + /// True if the NVAPI is available, can be called even if initialize fails. + /// If initialize has not been called will return false static bool isAvailable(); }; -} // gfx +} // namespace gfx |
