| 1752 | } |
| 1753 | |
| 1754 | rdcpair<ResultDetails, IReplayController *> RemoteServer::OpenCapture( |
| 1755 | uint32_t proxyid, const rdcstr &filename, const ReplayOptions &opts, |
| 1756 | RENDERDOC_ProgressCallback progress) |
| 1757 | { |
| 1758 | rdcpair<ResultDetails, IReplayController *> ret; |
| 1759 | ret.first = ResultCode::InternalError; |
| 1760 | ret.second = NULL; |
| 1761 | |
| 1762 | if(proxyid != ~0U && proxyid >= m_Proxies.size()) |
| 1763 | { |
| 1764 | RDCERR("Invalid proxy driver id %d specified for remote renderer", proxyid); |
| 1765 | return ret; |
| 1766 | } |
| 1767 | |
| 1768 | RDCLOG("Opening capture remotely"); |
| 1769 | |
| 1770 | LogReplayOptions(opts); |
| 1771 | |
| 1772 | // if the proxy id is ~0U, then we just don't care so let RenderDoc pick the most |
| 1773 | // appropriate supported proxy for the current platform. |
| 1774 | RDCDriver proxydrivertype = proxyid == ~0U ? RDCDriver::Unknown : m_Proxies[proxyid].first; |
| 1775 | |
| 1776 | { |
| 1777 | WRITE_DATA_SCOPE(); |
| 1778 | SCOPED_SERIALISE_CHUNK(RemoteServerPacket::OpenLog); |
| 1779 | SERIALISE_ELEMENT(filename); |
| 1780 | SERIALISE_ELEMENT(opts); |
| 1781 | } |
| 1782 | |
| 1783 | RemoteServerPacket type = RemoteServerPacket::Noop; |
| 1784 | while(!reader->IsErrored()) |
| 1785 | { |
| 1786 | READ_DATA_SCOPE(); |
| 1787 | type = ser.ReadChunk<RemoteServerPacket>(); |
| 1788 | |
| 1789 | if(reader->IsErrored() || type != RemoteServerPacket::LogOpenProgress) |
| 1790 | break; |
| 1791 | |
| 1792 | float progressValue = 0.0f; |
| 1793 | |
| 1794 | SERIALISE_ELEMENT(progressValue); |
| 1795 | |
| 1796 | ser.EndChunk(); |
| 1797 | |
| 1798 | if(progress) |
| 1799 | progress(progressValue); |
| 1800 | } |
| 1801 | |
| 1802 | RDCLOG("Capture open complete"); |
| 1803 | |
| 1804 | if(reader->IsErrored() || type != RemoteServerPacket::LogOpened) |
| 1805 | { |
| 1806 | RDCERR("Error opening capture"); |
| 1807 | ret.first = ResultCode::NetworkIOFailed; |
| 1808 | return ret; |
| 1809 | } |
| 1810 | |
| 1811 | RDResult result = ResultCode::Succeeded; |
no test coverage detected