Skip to content

Sync master with upstream (2026-09-12) - #7

Merged
pathanin merged 12 commits into
masterfrom
sync-upstream-2026-09-12
Sep 12, 2026
Merged

pathanin merged 12 commits into
masterfrom
sync-upstream-2026-09-12

Conversation

@pathanin

Copy link
Copy Markdown
Owner

Merge 11 upstream commits (6be052c..fe7851e): draw-performance work (frame elision, shader sources moved to build-embedded files via CMakeRC, BlendMode/mask-index removal, GLSL optimisation), dependency bumps, and CI changes (vs2026, manual vcpkg bootstrap, binary cache).

Conflicts and how they were resolved

libs/luautf8 (submodule) — took upstream's pin. Upstream moves bdd3d7fd65ebfa. The fork's pin was 1bb70d4 ("Explicitly include limits.h"), landed by e212cd9 to get a commit reachable from the submodule's own remote. d65ebfa is a strict descendant of 1bb70d4 and is reachable from origin/master in the submodule, so it carries the include fix and satisfies the reachability requirement. The fork no longer needs its own pin.

vcpkg.json — kept both sides. Upstream adds cmakerc (and glm/xxhash); the fork's angle + features: [metal] + platform: osx block is retained unchanged.

CMakeLists.txt — took upstream's side for the one conflicted hunk. Fork commit b4958a2 had changed the non-Windows else() branch from set(SIMPLEGRAPHIC_PLATFORM_SOURCES …) to list(APPEND …), because the set overwrote the sys_macos.mm entry added by the if (APPLE) block. Upstream has since restructured: add_library now runs before the platform blocks and each branch calls target_sources(SimpleGraphic PRIVATE …) directly, so nothing overwrites anything and the bug is gone. Upstream's form is correct and subsumes the fix.

The rest of b4958a2 is still required and survived the merge intact: $<$<PLATFORM_ID:Windows>:LUA_BUILD_AS_DLL>, the usocket.c/wsocket.c generator expression, and the Windows-gated wsock32/ws2_32 link libs.

macOS port verification

engine/render/r_main.cpp auto-merged despite upstream's 7f936d7 frame-pacing rewrite touching the same region. The fork's std::this_thread::sleep_for (2cca261) is present, and no Win32 Sleep() was reintroduced into the frame loop — the remaining Sleep( references in engine/ are the cross-platform sys_main_c::Sleep method and pre-existing memtrak3.cpp code, neither touched by this merge.

Every other fork-only commit's added lines were checked line-by-line against the post-merge tree and are present: 6b4cf07 find_c directory-entry fix, 5d5679d LuaJIT 2026-07-20_1 port fixes, 759892d launcher, b0db3cc texture transcode, aedfd7e IndexUTF8ToUTF32, 7893a27 base64 includes, 5bb13e1 FindLuaJIT macOS lib names, e528bb9 LuaJIT port fixes, 810cc19 Cmd→CTRL, e20e15f ANGLE Metal backend, plus the README macOS section.

P5 (re-versioned vendored dir): upstream added only vcpkg-ports/ports/gli/2026-09-09/, which the fork has never patched. No new luajit port directory; the live baseline is still 2026-07-20_1, the one the fork patches. No forward-port needed.

Not verified by CI

Windows build_dll cannot exercise the macOS-only patches — the _lua_getenvcopy/_lua_getenvfree macros live in the non-Windows branch of pob-wide-crt.patch, and INSTALL_TSYMNAME plus the configure exec bit are osx-triplet-only. The real gate is the local arm64 macOS rebuild and runtime smoke test, run separately.

zao and others added 12 commits September 9, 2026 08:06
lukka/run-vcpkg does a bit too much these days and as GHA caching is no
longer available on GitHub, we instead leverage actions/cache with our
own location set in an environment variable.
run-vcpkg clobbers this variable with a normalised location which leads
to mismatches in the restore and store steps.
Bumped vendored dependency versions by about three years:
* Dear ImGui to 1.92.9b from 1.89.9.
* GLM to 1.0.3 from 0.9.9.8.
* GLI to 2026-04-05 master with patches for GLM.
* luautf8 to 0.1.7 from 0.1.5.
* vcpkg to 2026.03.18 from 2026.01.16.

luautf8 has 0.2.0 available but that has breaking changes that may
affect the Lua code.
zlib recently changed the name of their DLLs on Windows to `z.dll` and
`z.dll`, adapt build scripts accordingly.
ci: cache vcpkg packages, update actions, update dependencies, use VS 2026
We always resolve the command buffer hash before drawing any layers so
there is no need for mid-draw bail logic.

Replaced MurmurHash64A with xxHash's way faster XXH3 for command buffer
hashing.

Only consider textures used for layer geometry when determining frame
completeness for elision.

Command buffer command structs are now packed on 1-byte alignment and
the command key has shrunk from int to u8. Getting rid of padding isn't
crucial as subsequent identical frames should both touch the padding
bytes in similar ways, but it's nice.
By moving the hardcoded shader sources to standalone files that can be
included at build time, we can get a better editing experience with
language servers in external editors. This without having to ship loose
shader files with the runtime as they're embedded at build time with
CMakeRC.
The blend mode and mask index have been removed from the runtime and
Lua API, and the shader now perform a much cheaper mapping from virtual
to NDC coordinates; inspired by rusty-path-of-building.

The blend mode has been modifiable via calls from Lua since the
beginning but has in modern time not been set to anything but regular
alpha blending.

Draw calls have been able to pass a mask layer as an optional parameter,
intended for blending out regions of the color texture that the app did
not want to display, like only drawing the immediate areas around
line connectors with the new style of nested connector textures.

ANGLE shaders performed a full 4x4 matrix transformation of positions
with a model-view-projection matrix, making it capable of performing
arbitrary transforms of geometry. This was costly in terms of both
uniform buffers but also added shader complexity and ALU cost. It also
did not play nice with CPU draw call culling.
…formance

feat: accurate frame elision and draw performance
…6-09-12

# Conflicts:
#	CMakeLists.txt
#	libs/luautf8
#	vcpkg.json
@pathanin
pathanin merged commit 2515295 into master Sep 12, 2026
2 checks passed
@pathanin
pathanin deleted the sync-upstream-2026-09-12 branch September 12, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants