(filename)
| 8 | rd = renderdoc |
| 9 | |
| 10 | def loadCapture(filename): |
| 11 | # Open a capture file handle |
| 12 | cap = rd.OpenCaptureFile() |
| 13 | |
| 14 | # Open a particular file - see also OpenBuffer to load from memory |
| 15 | result = cap.OpenFile(filename, '', None) |
| 16 | |
| 17 | # Make sure the file opened successfully |
| 18 | if result != rd.ResultCode.Succeeded: |
| 19 | raise RuntimeError("Couldn't open file: " + str(result)) |
| 20 | |
| 21 | # Make sure we can replay |
| 22 | if not cap.LocalReplaySupport(): |
| 23 | raise RuntimeError("Capture cannot be replayed") |
| 24 | |
| 25 | # Initialise the replay |
| 26 | result,controller = cap.OpenCapture(rd.ReplayOptions(), None) |
| 27 | |
| 28 | if result != rd.ResultCode.Succeeded: |
| 29 | raise RuntimeError("Couldn't initialise replay: " + str(result)) |
| 30 | |
| 31 | return cap,controller |
| 32 | |
| 33 | if 'pyrenderdoc' in globals(): |
| 34 | raise RuntimeError("This sample should not be run within the RenderDoc UI") |
no test coverage detected