Skip to content

Commit

Permalink
Added ability to disable discrete GPU selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
bkaradzic committed Jul 6, 2020
1 parent a84b13a commit 7479651
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bgfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) )
Expand Down
6 changes: 6 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7479651

Please sign in to comment.