| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
|---|---|
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
| 3 | #include "RenderAPI/BsRenderAPICapabilities.h" |
| 4 | |
| 5 | namespace bs |
| 6 | { |
| 7 | char const * const RenderAPICapabilities::GPU_VENDOR_STRINGS[GPU_VENDOR_COUNT] = |
| 8 | { |
| 9 | "unknown", |
| 10 | "nvidia" |
| 11 | "amd" |
| 12 | "intel" |
| 13 | }; |
| 14 | |
| 15 | GPUVendor RenderAPICapabilities::vendorFromString(const String& vendorString) |
| 16 | { |
| 17 | GPUVendor ret = GPU_UNKNOWN; |
| 18 | String cmpString = vendorString; |
| 19 | StringUtil::toLowerCase(cmpString); |
| 20 | for (int i = 0; i < GPU_VENDOR_COUNT; ++i) |
| 21 | { |
| 22 | if (GPU_VENDOR_STRINGS[i] == cmpString) |
| 23 | { |
| 24 | ret = static_cast<GPUVendor>(i); |
| 25 | break; |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | return ret; |
| 30 | } |
| 31 | |
| 32 | String RenderAPICapabilities::vendorToString(GPUVendor vendor) |
| 33 | { |
| 34 | return GPU_VENDOR_STRINGS[vendor]; |
| 35 | } |
| 36 | } |
| 37 |