Adding tracy command for ease of use

This commit is contained in:
2026-09-30 02:22:55 -07:00
parent 812d50127e
commit 9f3ad5f372
+24
View File
@@ -138,6 +138,30 @@ class DevHelper:
qrenderdoc = self._find_qrenderdoc() qrenderdoc = self._find_qrenderdoc()
self._exec_in_root(qrenderdoc, replace=True) self._exec_in_root(qrenderdoc, replace=True)
##
# Builds the Tracy profiler (viewer) from the third_party/tracy submodule,
# then runs it. Building from the submodule keeps the viewer's version in
# sync with the client compiled into the engine.
# dev tracy [--fresh] [args...]
# Configures only when there is no build yet (or --fresh), then builds
# incrementally. Other arguments are passed through to the profiler.
def tracy(self, *args, **kwargs):
fresh = "--fresh" in args
args = [arg for arg in args if arg != "--fresh"]
source_dir = os.path.join("third_party", "tracy", "profiler")
build_dir = os.path.join(source_dir, "build")
if fresh or not os.path.isfile(os.path.join(self._project_root(), build_dir, "CMakeCache.txt")):
configure = ["cmake", "-B", build_dir, "-S", source_dir, "-DCMAKE_BUILD_TYPE=Release"]
if fresh:
configure.append("--fresh")
self._run_in_root(configure)
self._run_in_root(["cmake", "--build", build_dir, "--parallel"])
binary = os.path.join(self._project_root(), build_dir, "tracy-profiler")
print(f"Running: {shlex.join([binary, *args])}")
os.execv(binary, [binary, *args])
def shaders(self, *args, **kwargs): def shaders(self, *args, **kwargs):
shaders_dir = os.path.join(self._project_root(), "engine", "src", "shaders") shaders_dir = os.path.join(self._project_root(), "engine", "src", "shaders")
if not os.path.isdir(shaders_dir): if not os.path.isdir(shaders_dir):