MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / GetGPUInfoAMDInternal_string

Function GetGPUInfoAMDInternal_string

Engine/OSGLContext_win.cpp:659–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

657}
658
659static 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
683static bool GetGPUInfoAMDInternal_int(const OSGLContext_wgl_data* wglInfo, UINT gpuID, int info, int* value)
684{

Callers 1

getGPUInfosMethod · 0.85

Calls 2

sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected