mirror-ghostty/src
Nathan 33560fe83e renderer/vulkan: compositor-modifier intersection unlocks NVIDIA direct mode
Target.init now picks a modifier by intersecting two channels:
- the GPU's supported modifiers for `format` with COLOR_ATTACHMENT |
  TRANSFER_SRC | SAMPLED feature bits (filtered to single plane);
- the compositor's accepted modifiers, fetched via a new
  ghostty_platform_vulkan_s.get_supported_modifiers callback.
First non-LINEAR hit wins (vendor-tiled is the perf path on every
modern GPU); LINEAR is the fallback; legacy_copy stays the floor.

NVIDIA RTX 2080 + Vulkan 1.4.329 verified: Target now picks
DRM_FORMAT_MOD_NVIDIA_* (0x300000000606015), Target.tiling=.direct,
image_backed=1, dmabuf flows through wl_subsurface without
protocol errors. Where Phase 1 left NVIDIA at legacy_copy + QImage,
this lands the full zero-copy path.

The new callback's data source is the zwp_linux_dmabuf_v1 format/
modifier events. SubsurfacePresenter.cpp's globals discovery now
listens for those events during its private-queue roundtrip (two
roundtrips: bind, then collect events) and caches them in a
process-wide (format → modifiers) table. Host::instance() eagerly
primes this on the GUI thread so the renderer-thread callback is a
lock-free read of an immutable map.

Renderer changes:
- Target.pickModifier replaces the LINEAR-only probe; intersects
  host ∩ GPU, preferring non-LINEAR single-plane modifiers.
- Target.initDirect now switches create-info variants by chosen
  modifier: EXPLICIT for LINEAR (we know rowPitch), LIST for
  vendor-tiled (driver picks opaque layout, we query back via
  vkGetImageDrmFormatModifierPropertiesEXT and vkGetImageSubresourceLayout).
- Direct-mode memory switches to DEVICE_LOCAL — image_backed=true
  means the host won't mmap, so we no longer need HOST_VISIBLE
  (and many drivers won't expose HOST_VISIBLE bits for tiled
  exportable images anyway).
- Device.zig adds vkGetImageDrmFormatModifierPropertiesEXT and
  vkGetPhysicalDeviceFormatProperties2 to the dispatch table.

Host changes:
- qt/src/vulkan/Host.cpp adds VK_EXT_image_drm_format_modifier to
  kRequiredDeviceExtensions so the device-level proc-addr lookup
  for vkGetImageDrmFormatModifierPropertiesEXT actually resolves.
- wl_compositor bound at version min(advertised, 6) so the child
  wl_surface supports set_buffer_scale (added in v3). Guarded the
  set_buffer_scale call by wl_proxy_get_version for older
  compositors.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-24 23:39:43 -05:00
..
apprt renderer/vulkan: compositor-modifier intersection unlocks NVIDIA direct mode 2026-05-24 23:39:43 -05:00
benchmark benchmark: isolate parser hot loop from code-layout shifts 2026-04-23 21:36:39 -07:00
build renderer/vulkan: add pkg/vulkan binding + build wiring 2026-05-24 08:53:03 -05:00
cli cli: add an ssh-wrapping +ssh action (#12582) 2026-05-22 09:04:36 -07:00
config Revert "rebrand libghostty CLI strings: Ghostty → Ghastty" 2026-05-21 13:21:51 -05:00
crash Zig 0.15: zig build test macOS 2025-10-03 07:10:43 -07:00
datastruct fix datastruct/SplitTree not calculating the correct new split ratio when resizing a split 2026-05-05 18:00:04 +02:00
extra cli: add +explain-config 2026-03-15 20:58:43 -04:00
font font: add Windows font discovery backend (#12386) 2026-04-23 10:45:50 -07:00
input Revert "rebrand libghostty CLI strings: Ghostty → Ghastty" 2026-05-21 13:21:51 -05:00
inspector terminal: make stream processing infallible 2026-03-13 13:56:14 -07:00
lib build: refactor checkGhosttyHEnum to use @hasDecl instead of nested inline for 2026-03-24 20:12:57 +01:00
os feature: add basque translation 2026-05-01 13:34:23 +02:00
renderer renderer/vulkan: compositor-modifier intersection unlocks NVIDIA direct mode 2026-05-24 23:39:43 -05:00
shell-integration nushell: replace ssh wrapper with ghostty +ssh 2026-05-05 08:30:53 -04:00
simd pkg/highway: vendor and modify to remain all libc usage 2026-04-23 20:28:43 -07:00
stb Fix typos 2025-10-03 18:52:26 +02:00
synthetic benchmark: add AGENTS, improve UTF-8 synthetic data 2026-04-15 08:28:36 -07:00
terminal terminal: clamp remaining_rows in resizeCols when cursor is past shrink 2026-05-24 16:25:37 -05:00
terminfo fix: update Se terminfo entry to reset cursor to configured default 2026-04-26 22:31:01 -05:00
termio address review: add unit tests for Windows execCommand paths 2026-04-23 23:08:58 +09:00
unicode Merge remote-tracking branch 'upstream/main' into grapheme-width-changes 2026-01-27 09:44:55 -05:00
App.zig config: use Config to check key binding instead of App 2026-04-24 18:26:56 +02:00
Command.zig Command: let CreateProcessW resolve the program via PATH 2026-04-23 14:40:13 +09:00
Surface.zig zig-fmt cleanup 2026-04-27 16:28:23 -04:00
apprt.zig Remove unused imports 2025-11-27 13:37:53 -08:00
build_config.zig Remove unused imports 2025-11-27 13:37:53 -08:00
cli.zig cli: make the action parser (+foo) generic and reusable 2025-07-09 15:06:24 -07:00
config.zig feat: add middle-click action configuration 2026-04-27 01:27:22 +10:00
fastmem.zig perf: replace `std.debug.assert` with inlined version 2025-11-17 12:13:56 -07:00
file_type.zig util: introduce helper for detecting file types 2025-06-25 16:27:23 -04:00
global.zig logging: document GHOSTTY_LOG and make it more flexible 2025-12-15 11:54:36 -08:00
helpgen.zig build: fix Windows build failures in helpgen and framegen 2026-03-24 08:07:31 +01:00
input.zig input: extract mouse encoding to a pure, testable file 2026-03-15 15:37:54 -07:00
lib_vt.zig libghostty: add _get_multi to all _get APIs 2026-04-11 12:51:36 -07:00
main.zig remove src/bench 2025-07-09 15:06:24 -07:00
main_bench.zig Remove unused imports 2025-11-27 13:37:53 -08:00
main_build_data.zig build: fix Windows build failures in helpgen and framegen 2026-03-24 08:07:31 +01:00
main_c.zig Revert "rebrand libghostty CLI strings: Ghostty → Ghastty" 2026-05-21 13:21:51 -05:00
main_gen.zig Remove unused imports 2025-11-27 13:37:53 -08:00
main_ghostty.zig Revert "rebrand libghostty CLI strings: Ghostty → Ghastty" 2026-05-21 13:21:51 -05:00
main_wasm.zig
math.zig
pty.c core: simplify pty.c macro usage 2026-03-20 10:37:42 -05:00
pty.zig core: address getProcessInfo feedback 2026-03-19 22:01:16 -05:00
quirks.zig quirks: remove type signature for inlineAssert 2025-12-08 13:19:16 +08:00
renderer.zig renderer/vulkan: -Drenderer=vulkan builds (rendering bodies stubbed) 2026-05-24 10:14:12 -05:00
surface_mouse.zig terminal: consolidate mouse types into mouse.zig 2026-03-15 15:48:36 -07:00
termio.zig search thread needs to take an allocated needle 2025-11-26 08:50:04 -08:00
tripwire.zig tripwire: change backing store from ArrayHashMap to EnumMap 2026-01-21 15:30:49 -08:00