Files
reims-vgpu/guest/bundle/tools/gameload/Makefile
T
Anees Iqbal f2d3443a05 🆕 Add gameload, a game-shaped Metal load beside the oracles
The perf ledger's AAA rows (heap shadows, format views, chunk imports, heap
compression, per-draw cost) each wait on a run that makes the load an AAA
Metal port makes, and none of our walks makes it. gameload is that load, our
own code: offscreen, a fixed number of frames, each frame's CPU, wait,
frame-to-frame and GPU times printed with their p50, p90 and mean, and the
measured window's start and end on the wall clock so a host's logs of the same
span can be cut to it.

A frame holds placement-heap streaming (slots made again at their offsets and
uploaded, BC7 where the device has it, a placed vertex buffer, transient
textures from an automatic heap made aliasable), render targets placed in a
heap, a 4x MSAA scene with depth resolved, composited through an sRGB view and
with a UI pass into a BGRA view, a GPU-encoded indirect command buffer, 4000
CPU draws and 1000 shadow draws over argument buffers, compute
post-processing and a blit stream with a read-back. Each of the eight shapes
turns off by name, so a run with one off measures its share; -b makes the
indirect command buffer inherit no buffers.

make -C guest/bundle/tools/gameload builds one universal binary (arm64 and
x86_64) for an Apple-silicon Mac, the Intel oracle and both guests. It has a
Makefile of its own because guest/bundle/Makefile is a source the prebuilt
guest sets record, and a target there would mean rebuilding both sets. The
tools' README gives the command lines the measured runs used.
2026-11-13 17:47:40 -08:00

33 lines
1.4 KiB
Makefile

# gameload, a game-shaped Metal load (gameload.m's header says what each shape is, and every
# option and output line).
#
# make -C guest/bundle/tools/gameload one universal binary (arm64 and x86_64: an
# Apple-silicon Mac, an Intel Mac, and an arm64 or
# x86-64 guest), guest/bundle/build/gameload
# make -C guest/bundle/tools/gameload clean
#
# It runs on a real device, never in the bundle's `make test`. Its shaders compile from source at
# run time (gameload_source.h, from gameload.metal, for newLibraryWithSource:). It has a Makefile
# of its own because guest/bundle/Makefile is one of the sources the prebuilt guest sets record
# (guest/prebuilt*/sources.toml): a target there would mean rebuilding both sets.
SDK ?= $(shell xcrun --sdk macosx --show-sdk-path)
BUILD = ../../build
all: $(BUILD)/gameload
$(BUILD)/gameload_source.h: gameload.metal Makefile
@mkdir -p $(@D)
xxd -i -n gameload_metal gameload.metal > $@
$(BUILD)/gameload: gameload.m $(BUILD)/gameload_source.h Makefile
@mkdir -p $(@D)
xcrun clang -arch arm64 -arch x86_64 -isysroot $(SDK) -mmacosx-version-min=13.0 -fobjc-arc -O2 \
-Wall -Wextra -Werror -Wno-unused-parameter -I $(BUILD) gameload.m \
-framework Foundation -framework Metal -o $@
clean:
rm -f $(BUILD)/gameload $(BUILD)/gameload_source.h
.PHONY: all clean