Create the libretro GL presets once and run frametests on arm64

The GL contexts' CreateDrawContext made the thin3d presets and ContextReset made them again,
leaking the first set on every context reset. Only ContextReset makes them now.

The software renderer draws the same frame dumps on arm64 as on x86-64, so the frametests run
on the arm64 runner too. b.sh --aarch64 and setup-cross.sh aarch64 give a headless build to run
them under qemu locally.
This commit is contained in:
libretroadmin committed 2026-10-09 09:12:45 +02:00
1 parent 3f225d06c1
commit 329f30a0c9
6 files changed
+65 -14

No files matched your search

+4 -6
View File
@@ -396,19 +396,17 @@ jobs:
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: python3 test.py -g --graphics=vulkan --known-failures=vulkan
# x86-64 only: the reference images don't match what the software renderer produces on arm64,
# 23 of the 30 dumps differ there, one of them by an MSE of 100. That's a real difference and
# worth chasing, but it predates the arm64 runner - it just never had a CI job to show up in.
# Both Linux runners: the software renderer's x86-64 and arm64 JITs have to draw the same pixels.
- name: Execute frametests
if: matrix.os == 'ubuntu-26.04'
if: runner.os == 'Linux'
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: python3 frametests.py frametests/frametests.json --out-mode=failures
- name: Upload frametest report
uses: actions/upload-artifact@v7
if: matrix.os == 'ubuntu-26.04' && always()
if: runner.os == 'Linux' && always()
with:
name: frametest-report
name: frametest-report-${{ matrix.os }}
path: frametests/out/
test-headless-alpine:
+5
View File
@@ -35,6 +35,11 @@ do
TARGET_OS=loongarch64
CROSS_STUB_CC=loongarch64-linux-gnu-gcc-14
;;
--aarch64)
CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/aarch64-linux-gnu.cmake -DHEADLESS=ON -DHEADLESS_CROSS=ON -DUSE_SYSTEM_LIBPNG=OFF -DUSE_SYSTEM_LIBSDL2=OFF ${CMAKE_ARGS}"
TARGET_OS=aarch64
CROSS_STUB_CC=aarch64-linux-gnu-gcc-14
;;
--riscv64)
CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/riscv64-linux-gnu.cmake -DHEADLESS=ON -DHEADLESS_CROSS=ON -DUSE_SYSTEM_LIBPNG=OFF -DUSE_SYSTEM_LIBSDL2=OFF ${CMAKE_ARGS}"
TARGET_OS=riscv64
+44
View File
@@ -0,0 +1,44 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc-14)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++-14)
set(CMAKE_ASM_COMPILER aarch64-linux-gnu-gcc-14)
set(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# No X11 in the sysroot; disable the X11 Vulkan path to avoid include-dir errors.
set(USING_X11_VULKAN OFF CACHE BOOL "" FORCE)
# Use legacy GL preference so find_package(OpenGL) looks for a single libGL.so
# rather than the GLVND split (libOpenGL.so + libGLX.so), which we don't have.
# A stub libGL.so + GL headers must be present in the sysroot; they are placed
# there by cmake/scripts/setup-cross.sh (run once with sudo, or automatically
# by the CI install step).
set(OpenGL_GL_PREFERENCE LEGACY CACHE STRING "" FORCE)
# b.sh also creates a stub in <build-dir>/stublibs/ as a local fallback so the
# linker can resolve GL/GLX calls from GLEW's static archive via PLT entries.
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_BINARY_DIR}/stublibs"
CACHE STRING "" FORCE)
# Allow CMake's compile-check programs to run via QEMU, if it's installed.
# Debian/Ubuntu ship the static binaries in qemu-user-static and the dynamic
# ones in qemu-user; either will do, so take whichever is present.
find_program(QEMU_AARCH64 NAMES qemu-aarch64-static qemu-aarch64)
if(QEMU_AARCH64)
# The /lib symlink is created by the setup script; without it, pass -L
# explicitly so QEMU can find the aarch64 dynamic linker.
if(EXISTS "/lib/ld-linux-aarch64.so.1")
set(CMAKE_CROSSCOMPILING_EMULATOR "${QEMU_AARCH64}" CACHE STRING "" FORCE)
else()
set(CMAKE_CROSSCOMPILING_EMULATOR
"${QEMU_AARCH64};-L;/usr/aarch64-linux-gnu"
CACHE STRING "" FORCE)
endif()
endif()
+12 -6
View File
@@ -2,13 +2,19 @@
# Sets up a cross-compilation environment for one of the headless-only targets.
# Run once with sudo. After this, ./b.sh --<target> works on a fresh checkout.
#
# Usage: sudo cmake/scripts/setup-cross.sh <loongarch64|riscv64>
# Usage: sudo cmake/scripts/setup-cross.sh <aarch64|loongarch64|riscv64>
set -e
TARGET="$1"
LD_DIR=/lib64
case "$TARGET" in
aarch64)
TRIPLE=aarch64-linux-gnu
LD_SO=ld-linux-aarch64.so.1
LD_DIR=/lib
;;
loongarch64)
TRIPLE=loongarch64-linux-gnu
LD_SO=ld-linux-loongarch-lp64d.so.1
@@ -18,7 +24,7 @@ case "$TARGET" in
LD_SO=ld-linux-riscv64-lp64d.so.1
;;
*)
echo "Usage: sudo $0 <loongarch64|riscv64>"
echo "Usage: sudo $0 <aarch64|loongarch64|riscv64>"
exit 1
;;
esac
@@ -84,13 +90,13 @@ echo " Installed to $SYSROOT/lib/libGL.so"
# Without this, binfmt_misc can't find the target's dynamic linker.
LD_LINUX=$SYSROOT/lib/$LD_SO
if [ -f "$LD_LINUX" ]; then
mkdir -p /lib64
ln -sf "$LD_LINUX" /lib64/$LD_SO
echo "Created /lib64/$LD_SO -> $LD_LINUX"
mkdir -p $LD_DIR
ln -sf "$LD_LINUX" $LD_DIR/$LD_SO
echo "Created $LD_DIR/$LD_SO -> $LD_LINUX"
fi
echo ""
echo "Setup complete."
echo "Build: ./b.sh --$TARGET"
echo "Run: qemu-$TARGET -L $SYSROOT <binary>"
echo " (after setup the /lib64 symlink lets you run $TARGET binaries directly)"
echo " (after setup the $LD_DIR symlink lets you run $TARGET binaries directly)"
-1
View File
@@ -35,7 +35,6 @@ void LibretroGLContext::CreateDrawContext() {
renderManager_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
renderManager_->SetInflightFrames(g_Config.iInflightFrames);
SetGPUBackend(GPUBackend::OPENGL);
draw_->CreatePresets();
}
void LibretroGLContext::DestroyDrawContext() {
-1
View File
@@ -37,7 +37,6 @@ void LibretroGLCoreContext::CreateDrawContext() {
renderManager_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
renderManager_->SetInflightFrames(g_Config.iInflightFrames);
SetGPUBackend(GPUBackend::OPENGL);
draw_->CreatePresets();
}
void LibretroGLCoreContext::DestroyDrawContext() {