Files
chandra/scripts/test-gpu.sh
T
nandiandClaude Opus 5.5 cfb25fe699 Draw on the GPU: the desktop with OpenGL ES, apps through linux-dmabuf
The host's rasteriser has a GPU half (raster_gpu.c): the same primitives, drawn the same way, on
machines with a real GPU and OpenGL ES 3, straight into the display's buffers in a login session.
EGL and GLES are loaded at run time; without them everything is drawn on the CPU as before
(CHANDRA_GPU=0 does that too). zwp_linux_dmabuf_v1 lets apps draw on the GPU as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 16:42:22 -08:00

19 lines
870 B
Bash
Executable File

#!/usr/bin/env bash
# The GPU rasteriser (wasmhost/bin/raster_gpu.c) against the CPU one, on this machine's GPU; a few
# seconds. Skips (exit 0, saying so) on machines without one; CHANDRA_GPU=1 takes llvmpipe too.
# scripts/test-gpu.sh
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"; cd "$ROOT"
PIXI="$ROOT/.pixi/envs/default"
mkdir -p _build
# raster_gpu.c is included, not linked: the test looks inside it.
cat > _build/gpu_test_all.c <<C
#define _GNU_SOURCE
#include "$ROOT/wasmhost/bin/raster_gpu.c"
#include "$ROOT/wasmhost/test/gpu_test.c"
C
"${CC:-cc}" -O1 -Wall -Wno-unused-function -Wno-format-truncation -I"$HOME/.moon/include" -I/usr/include/libdrm -I"$PIXI/include" -I"$PIXI/include/libdrm" \
_build/gpu_test_all.c -o _build/gpu_test -L"$PIXI/lib" -ldrm -lm -lpthread -ldl
code=0; _build/gpu_test || code=$?
[ "$code" = 77 ] || exit "$code"