| 657 | } |
| 658 | |
| 659 | static std::string GetGPUInfoAMDInternal_string(const OSGLContext_wgl_data* wglInfo, UINT gpuID, int info) |
| 660 | { |
| 661 | std::vector<char> data; |
| 662 | int totalSize = 0; |
| 663 | |
| 664 | INT numVals; |
| 665 | int safeCounter = 0; |
| 666 | do { |
| 667 | totalSize += 1024; |
| 668 | if ((int)data.size() < totalSize) { |
| 669 | data.resize(totalSize); |
| 670 | } |
| 671 | |
| 672 | numVals = wglInfo->GetGPUInfoAMD(gpuID, info, GL_UNSIGNED_BYTE, data.size(), &data[0]); |
| 673 | ++safeCounter; |
| 674 | } while (numVals > 0 && numVals == (INT)data.size() && safeCounter < 1000); |
| 675 | assert(numVals > 0); |
| 676 | if (numVals <= 0) { |
| 677 | return std::string(); |
| 678 | } |
| 679 | |
| 680 | return std::string(&data[0], numVals); |
| 681 | } |
| 682 | |
| 683 | static bool GetGPUInfoAMDInternal_int(const OSGLContext_wgl_data* wglInfo, UINT gpuID, int info, int* value) |
| 684 | { |
no test coverage detected