Externals: md4c, picojson and Vulkan NanoVG as submodules #8

Merged
ilusha merged 2 commits from Externals into master 2026-10-28 00:54:34 +03:00
Collaborator

Base: master @ 865f085. Two commits, 5 files, authored by agent. Replaces the earlier version that copied ~30,000 lines of third-party sources.

Provenance of each library

Library Upstream Our copy vs upstream Submodule
md4c mity/md4c by Martin Mitáš Identical to f9e5eb2 ilusha/md4c @ f9e5eb2
picojson kazuho/picojson by Kazuho Oku Identical to 111c9be ilusha/picojson @ 111c9be
nanovg_vulkan SubiyaCryolite/nanovg_vulkan, based on danilw/nanovg_vulkan and memononen/nanovg Originally vendored from Subiya 92ac560 (9-line difference) ilusha/nanovg_vulkan branch modules-vulkan @ a6a3fc7

NanoVG-Vulkan: Subiya HEAD + our fixes

The fork's modules-vulkan branch is rebuilt on Subiya's latest 0f7110f (2026-09-07). Subiya already contains the upload command pool, safe teardown of contexts that never drew, a dummy texture, descriptor-pool retirement instead of device stalls, one descriptor set per call, separate frameCount, and a real nanovg_vk.c translation unit. On top of that, five commits:

  1. Track texture slots explicitly — stale ids resolve to nothing, slots are reused only when free, updates of unknown/borrowed ids no longer dereference NULL.

  2. Byte offset for partial texture updates — RGBA updates wrote at dx bytes instead of dx * 4.

  3. Retire replaced textures per frame slot — Subiya destroys images immediately even while a frame in flight samples them; this is the zoom crash we had fixed before.

  4. Free retired descriptor pools after a full frame cycle — Subiya only freed them with the context, leaking every superseded pool.

  5. nvgUpdateImageFromHandleVk — repoint a borrowed image at a resized render target while keeping its id.

  6. A CPU-only C test in the fork (tests/texture_slots.c) covers slot reuse, stale ids, frame-slot retirement and the RGBA update offset; it passes.

API change for consumers

Subiya's API replaces our previous wrapper: nvgCreateVk(const VKNVGCreateInfo*, flags, queue) (pointer), graphicsQueueFamilyIndex instead of queueFamilyIndex, nvgCreateImageFromHandleVk / nvgUpdateImageFromHandleVk instead of nvgCreateImageFromVkImageApi / nvgUpdateVkImageApi, and nanovg_vk.h instead of nanovg_vk_api.h. Nothing on master uses NanoVG-Vulkan yet; the Graphics PR will be written against this API.

Build changes

  • Md4c builds md4c/src/md4c.c; NanovgVk builds nanovg_vulkan/src/nanovg.c and nanovg_vk.c; Picojson is an interface target.
  • ImGui adds imgui_impl_vulkan while keeping the GLFW and OpenGL backends.
  • No MODULES_BUILD_DESKTOP / MODULES_BUILD_TESTS gates.

Verification

Full CMake configure succeeds; Md4c, NanovgVk, Nanovg and Imgui build from the submodules. No GPU runtime test was run. git submodule update --init is needed after checkout.

**Base:** `master` @ `865f085`. Two commits, 5 files, authored by `agent`. Replaces the earlier version that copied ~30,000 lines of third-party sources. ## Provenance of each library | Library | Upstream | Our copy vs upstream | Submodule | |---|---|---|---| | md4c | [mity/md4c](https://github.com/mity/md4c) by Martin Mitáš | **Identical** to `f9e5eb2` | [ilusha/md4c](https://git.ilusha-basic.online/ilusha/md4c) @ `f9e5eb2` | | picojson | [kazuho/picojson](https://github.com/kazuho/picojson) by Kazuho Oku | **Identical** to `111c9be` | [ilusha/picojson](https://git.ilusha-basic.online/ilusha/picojson) @ `111c9be` | | nanovg_vulkan | [SubiyaCryolite/nanovg_vulkan](https://github.com/SubiyaCryolite/nanovg_vulkan), based on danilw/nanovg_vulkan and memononen/nanovg | Originally vendored from Subiya `92ac560` (9-line difference) | [ilusha/nanovg_vulkan](https://git.ilusha-basic.online/ilusha/nanovg_vulkan) branch `modules-vulkan` @ `a6a3fc7` | ## NanoVG-Vulkan: Subiya HEAD + our fixes The fork's [`modules-vulkan`](https://git.ilusha-basic.online/ilusha/nanovg_vulkan/compare/master...modules-vulkan) branch is rebuilt on Subiya's latest `0f7110f` (2026-09-07). Subiya already contains the upload command pool, safe teardown of contexts that never drew, a dummy texture, descriptor-pool retirement instead of device stalls, one descriptor set per call, separate `frameCount`, and a real `nanovg_vk.c` translation unit. On top of that, five commits: 1. **Track texture slots explicitly** — stale ids resolve to nothing, slots are reused only when free, updates of unknown/borrowed ids no longer dereference NULL. 2. **Byte offset for partial texture updates** — RGBA updates wrote at `dx` bytes instead of `dx * 4`. 3. **Retire replaced textures per frame slot** — Subiya destroys images immediately even while a frame in flight samples them; this is the zoom crash we had fixed before. 4. **Free retired descriptor pools** after a full frame cycle — Subiya only freed them with the context, leaking every superseded pool. 5. **`nvgUpdateImageFromHandleVk`** — repoint a borrowed image at a resized render target while keeping its id. 6. A CPU-only C test in the fork (`tests/texture_slots.c`) covers slot reuse, stale ids, frame-slot retirement and the RGBA update offset; it passes. ## API change for consumers Subiya's API replaces our previous wrapper: `nvgCreateVk(const VKNVGCreateInfo*, flags, queue)` (pointer), `graphicsQueueFamilyIndex` instead of `queueFamilyIndex`, `nvgCreateImageFromHandleVk` / `nvgUpdateImageFromHandleVk` instead of `nvgCreateImageFromVkImageApi` / `nvgUpdateVkImageApi`, and `nanovg_vk.h` instead of `nanovg_vk_api.h`. Nothing on master uses NanoVG-Vulkan yet; the Graphics PR will be written against this API. ## Build changes - `Md4c` builds `md4c/src/md4c.c`; `NanovgVk` builds `nanovg_vulkan/src/nanovg.c` and `nanovg_vk.c`; `Picojson` is an interface target. - ImGui adds `imgui_impl_vulkan` while keeping the GLFW and OpenGL backends. - No `MODULES_BUILD_DESKTOP` / `MODULES_BUILD_TESTS` gates. ## Verification Full CMake configure succeeds; `Md4c`, `NanovgVk`, `Nanovg` and `Imgui` build from the submodules. No GPU runtime test was run. `git submodule update --init` is needed after checkout.
agent added 2 commits 2026-10-27 23:51:11 +03:00
md4c supplies Markdown parsing for the markdown widgets. picojson is the
existing single-header JSON reader moved from LibraryViewer/ext.
nanovg_vulkan carries the Vulkan NanoVG backend, its shaders and stb headers.
Externals: build the new libraries and add the ImGui Vulkan backend
Some checks are pending
Windows / build (pull_request) Waiting to run
CMake on a single platform / build (pull_request) Waiting to run
CMake / build (pull_request) Waiting to run
432e66749c
Adds the Picojson interface target, C99 Md4c and NanovgVk. ImGui now compiles
imgui_impl_vulkan alongside the existing GLFW and OpenGL backends, so current
OpenGL users keep linking. Desktop and test libraries stay enabled on master;
the port's MODULES_BUILD_DESKTOP and MODULES_BUILD_TESTS gates are not used.
requested review from ilusha 2026-10-27 23:51:12 +03:00
agent force-pushed Externals from 432e66749c to 15536ac53d 2026-10-28 00:22:22 +03:00 Compare
agent changed title from Externals: md4c, picojson and Vulkan NanoVG to Externals: md4c, picojson and Vulkan NanoVG as submodules 2026-10-28 00:22:36 +03:00
agent force-pushed Externals from 15536ac53d to 876a4eb4d9 2026-10-28 00:44:56 +03:00 Compare
agent force-pushed Externals from 876a4eb4d9 to d8acea9cc6 2026-10-28 00:46:40 +03:00 Compare
ilusha merged commit ee08249f74 into master 2026-10-28 00:54:34 +03:00
ilusha deleted branch Externals 2026-10-28 00:54:34 +03:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: ilusha/Modules#8
No description provided.