This is the foundation commit on the new `qt-vulkan-renderer` branch. It declares the renderer backend, defines the public C ABI the host calls into, and wires the apprt-side plumbing — but the renderer body itself is intentionally absent: `-Drenderer=vulkan` fails at compile time with a clear pointer back to this branch. What lands: - `Backend.vulkan` enum value (`src/renderer/backend.zig`). - `Renderer` switch arm in `src/renderer.zig` that `@compileError`s with the stub message — so the OpenGL build path is untouched and `-Drenderer=vulkan` fails fast with a useful diagnostic. - `GHOSTTY_PLATFORM_VULKAN` + `ghostty_platform_vulkan_s` in `include/ghostty.h`. Host owns the VkInstance / VkPhysicalDevice / VkDevice / VkQueue (same ownership model as OpenGL); frames are handed back as dmabuf fds so a compositor-side toolkit (Qt RHI via QRhiTexture) can sample them without a CPU readback. - Matching `Platform.Vulkan` / `Platform.C.vulkan` / `Platform.init` arm in `src/apprt/embedded.zig`, with `vulkan = 4` in `PlatformTag`. - Exhaustiveness arms in the two existing platform switches: `OpenGL.zig` and `Metal.zig` both return `error.UnsupportedPlatform` for `.vulkan` (each renderer is only compiled for its own backend, so this is unreachable at runtime — the arms are there to satisfy Zig's tagged-union exhaustiveness). - Placeholder `src/renderer/Vulkan.zig` with the full `GenericRenderer(impl)` contract spelled out in the header comment, and `src/renderer/vulkan/README.md` mapping each per- backend file to its OpenGL counterpart. These are scaffolding for the actual renderer to land into next session. Verified: - `zig build -Dapp-runtime=none -Doptimize=ReleaseFast` (default renderer = opengl on Linux) — clean build, no warnings introduced. - `zig build -Drenderer=vulkan …` — fails at comptime in `src/renderer.zig:42` with the stub error message as designed. Co-Authored-By: claude-flow <ruv@ruv.net> |
||
|---|---|---|
| .. | ||
| ghostty | ||
| ghostty.h | ||
| module.modulemap | ||