summaryrefslogtreecommitdiffstats
path: root/.gitlab-ci/tracie/renderdoc_dump_images.py
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci/tracie/renderdoc_dump_images.py')
-rwxr-xr-x.gitlab-ci/tracie/renderdoc_dump_images.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/.gitlab-ci/tracie/renderdoc_dump_images.py b/.gitlab-ci/tracie/renderdoc_dump_images.py
index 689ee2d0a87..93e24b9ca25 100755
--- a/.gitlab-ci/tracie/renderdoc_dump_images.py
+++ b/.gitlab-ci/tracie/renderdoc_dump_images.py
@@ -22,9 +22,22 @@
#
# SPDX-License-Identifier: MIT
+import atexit
+import os
+import shutil
import sys
+import tempfile
from pathlib import Path
+def cleanup(dirpath):
+ shutil.rmtree(dirpath)
+
+dirpath = tempfile.mkdtemp()
+atexit.register(cleanup, dirpath)
+RENDERDOC_DEBUG_FILE = dirpath + "/renderdoc.log"
+
+# Needs to be in the environment before importing the module
+os.environ['RENDERDOC_DEBUG_LOG_FILE'] = RENDERDOC_DEBUG_FILE
import renderdoc as rd
def findDrawWithEventId(controller, eventId):
@@ -75,11 +88,16 @@ def loadCapture(filename):
if not cap.LocalReplaySupport():
raise RuntimeError("Capture cannot be replayed")
- status,controller = cap.OpenCapture(rd.ReplayOptions(), None)
+ status, controller = cap.OpenCapture(rd.ReplayOptions(), None)
if status != rd.ReplayStatus.Succeeded:
+ if os.path.exists(RENDERDOC_DEBUG_FILE):
+ print(open(RENDERDOC_DEBUG_FILE, "r").read())
raise RuntimeError("Couldn't initialise replay: " + str(status))
+ if os.path.exists(RENDERDOC_DEBUG_FILE):
+ open(RENDERDOC_DEBUG_FILE, "w").write("")
+
return (cap, controller)
def renderdoc_dump_images(filename, eventIds, outputDir):