Added ability to disable discrete GPU selection.

This commit is contained in:
Бранимир Караџић
2020-07-06 12:29:05 -07:00
parent a84b13a77c
commit 7479651dc8
2 changed files with 8 additions and 2 deletions

View File

@@ -5078,7 +5078,7 @@ namespace bgfx
}
} // namespace bgfx
#if BX_PLATFORM_WINDOWS
#if BGFX_CONFIG_PREFER_DISCRETE_GPU
extern "C"
{
// When laptop setup has integrated and discrete GPU, following driver workarounds will
@@ -5094,7 +5094,7 @@ extern "C"
//
__declspec(dllexport) uint32_t AmdPowerXpressRequestHighPerformance = UINT32_C(1);
}
#endif // BX_PLATFORM_WINDOWS
#endif // BGFX_CONFIG_PREFER_DISCRETE_GPU
#define BGFX_TEXTURE_FORMAT_BIMG(_fmt) \
BX_STATIC_ASSERT(uint32_t(bgfx::TextureFormat::_fmt) == uint32_t(bimg::TextureFormat::_fmt) )

View File

@@ -361,4 +361,10 @@ BX_STATIC_ASSERT(bx::isPowerOf2(BGFX_CONFIG_MAX_VIEWS), "BGFX_CONFIG_MAX_VIEWS m
# define BGFX_CONFIG_MAX_BACK_BUFFERS 4
#endif // BGFX_CONFIG_MAX_BACK_BUFFERS
#ifndef BGFX_CONFIG_PREFER_DISCRETE_GPU
// On laptops with integrated and discrete GPU, prefer selection of discrete GPU.
// nVidia and AMD, on Windows only.
# define BGFX_CONFIG_PREFER_DISCRETE_GPU BX_PLATFORM_WINDOWS
#endif // BGFX_CONFIG_PREFER_DISCRETE_GPU
#endif // BGFX_CONFIG_H_HEADER_GUARD