| 2022 | } |
| 2023 | |
| 2024 | std::map<RDCDriver, RDCDriverStatus> RenderDoc::GetActiveDrivers() |
| 2025 | { |
| 2026 | std::map<RDCDriver, uint64_t> drivers; |
| 2027 | |
| 2028 | { |
| 2029 | SCOPED_LOCK(m_DriverLock); |
| 2030 | drivers = m_ActiveDrivers; |
| 2031 | } |
| 2032 | |
| 2033 | std::map<RDCDriver, RDCDriverStatus> ret; |
| 2034 | |
| 2035 | for(auto it = drivers.begin(); it != drivers.end(); ++it) |
| 2036 | { |
| 2037 | RDCDriverStatus &status = ret[it->first]; |
| 2038 | // driver is presenting if the timestamp is greater than 0 and less than 10 seconds ago (gives a |
| 2039 | // little leeway for loading screens or something where the presentation stops temporarily). |
| 2040 | // we also assume that during a capture if it was presenting, then it's still capturing. |
| 2041 | // Otherwise a long capture would temporarily set it as not presenting. |
| 2042 | status.presenting = it->second > 0; |
| 2043 | |
| 2044 | if(status.presenting && !IsFrameCapturing() && it->second < Timing::GetUnixTimestamp() - 10) |
| 2045 | status.presenting = false; |
| 2046 | |
| 2047 | status.supported = (HasRemoteDriver(it->first) || HasReplayDriver(it->first)) && |
| 2048 | HasActiveFrameCapturer(it->first); |
| 2049 | |
| 2050 | if(!status.supported) |
| 2051 | { |
| 2052 | SCOPED_LOCK(m_DriverLock); |
| 2053 | status.supportMessage = m_APISupportMessages[it->first]; |
| 2054 | } |
| 2055 | } |
| 2056 | |
| 2057 | return ret; |
| 2058 | } |
| 2059 | |
| 2060 | std::map<RDCDriver, rdcstr> RenderDoc::GetReplayDrivers() |
| 2061 | { |
no test coverage detected