No description
Find a file
Andros Fenollosa d461d7da32 README: re-record the sonicboom cursor demo
The previous capture was static: cursor-only motion never presented
while Emacs idled (fixed in the previous commit).
2026-06-06 10:19:29 +02:00
.github/assets README: re-record the sonicboom cursor demo 2026-06-06 10:19:29 +02:00
admin Revert "* admin/notes/documentation: Recommend not using "it's"." 2026-05-24 11:49:50 +01:00
build-aux * build-aux/git-hooks/commit-msg: Replace Markdown-style quotation. 2026-05-23 17:25:07 +01:00
cross ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
doc ; * doc/lispref/text.texi (Mode-Specific Indent): Fix markup. 2026-06-04 09:42:56 +03:00
etc ; Update exported ChangeLog files and etc/AUTHORS 2026-06-05 10:41:22 +01:00
exec Bump Emacs version to 31.0.90 2026-06-05 10:42:43 +01:00
java Bump Emacs version to 31.0.90 2026-06-05 10:42:43 +01:00
leim ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
lib Update from Gnulib by running admin/merge-gnulib 2026-03-01 10:41:54 -08:00
lib-src emacsclient quote_argument is void 2026-05-26 19:36:00 -07:00
lisp Metal: keep cursor animations alive while Emacs idles 2026-06-06 10:19:29 +02:00
lwlib butttonTrans need not be extern 2026-02-08 17:02:55 -08:00
m4 Update from Gnulib by running admin/merge-gnulib 2026-03-01 10:41:54 -08:00
modules ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
msdos Bump Emacs version to 31.0.90 2026-06-05 10:42:43 +01:00
nextstep ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
nt Bump Emacs version to 31.0.90 2026-06-05 10:42:43 +01:00
oldXMenu ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
src Metal: keep cursor animations alive while Emacs idles 2026-06-06 10:19:29 +02:00
test Fix Tramp distrobox integration 2026-06-04 08:34:48 +02:00
.clang-format ; Configure ObjC for clang-format 2023-10-06 16:52:19 +02:00
.clangd Tweak .clangd to work with gcc-compiled Emacs (bug#78367) 2025-05-11 11:14:32 +01:00
.dir-locals.el Review some attribute macro usage 2026-03-14 15:08:15 +01:00
.gitattributes Merge branch 'main' into icalendar 2026-02-08 16:05:31 -05:00
.gitignore README: add GPU demos (inline video, animated GIF, cursor effects) 2026-06-06 10:19:29 +02:00
.gitlab-ci.yml ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
.mailmap ; * .mailmap: Add email alias 2026-01-18 21:59:38 +01:00
autogen.sh ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
BUGS * BUGS: Minor copy edit. 2024-09-21 13:29:36 +02:00
ChangeLog.1 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ChangeLog.2 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ChangeLog.3 ; Update exported ChangeLog files and etc/AUTHORS 2026-05-07 20:08:43 +01:00
ChangeLog.4 ; Spelling fixes. 2026-04-29 22:45:51 -07:00
ChangeLog.5 ; Update exported ChangeLog files and etc/AUTHORS 2026-06-05 10:41:22 +01:00
ChangeLog.android ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
config.bat ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
configure.ac Fase I: split the GPU backend into neutral policy + driver vtable 2026-06-06 10:19:29 +02:00
CONTRIBUTE ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
COPYING
GNUmakefile ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
INSTALL ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
INSTALL.REPO ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
make-dist ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
Makefile.in ; Update exported ChangeLog files and etc/AUTHORS 2026-05-07 20:08:43 +01:00
README Bump Emacs version to 31.0.90 2026-06-05 10:42:43 +01:00
README.md README: add GPU demos (inline video, animated GIF, cursor effects) 2026-06-06 10:19:29 +02:00

emacs-gpu

GNU Emacs with a GPU-accelerated display backend.

On macOS it renders with native Apple Metal: text goes through a GPU glyph atlas, images and inline video are textures, and the whole frame is composited by the GPU instead of CoreGraphics. The output is pixel-accurate against the stock Cocoa backend.

OpenGL support for GNU/Linux and Windows is planned but not implemented yet. The drawing logic is already platform-neutral (src/gfxterm.c) behind a small driver interface (src/gfxdrv.h); an OpenGL driver only needs to implement that interface (src/glterm.c is the documented skeleton). Contributions welcome.

Status: experimental, under active development.

Note: I am not answering issues for now. Feel free to open them as a public record (they will be read eventually), but do not expect a reply at this stage.

Demos

Inline video playing inside a buffer, decoded by AVFoundation straight into Metal textures (mtl-video-insert):

Inline video

An animated GIF playing next to font-locked code scrolling, all composited by the GPU:

Animated GIF and code

GPU cursor effects (mtl-animations), here the sonicboom mode:

Sonicboom cursor

Building on macOS

Requires Xcode (or the Command Line Tools) and the usual Emacs build dependencies (brew install autoconf automake gnutls texinfo pkg-config).

./autogen.sh

SDK=$(xcrun --sdk macosx --show-sdk-path)
CC="xcrun clang" OBJC="xcrun clang" \
CFLAGS="-isysroot $SDK" CPPFLAGS="-isysroot $SDK" OBJCFLAGS="-isysroot $SDK" \
./configure --with-ns --with-mtl

make -j$(sysctl -n hw.ncpu)

The binary is src/emacs (or install the app bundle from nextstep/).

Enabling the GPU backend

Emacs starts with the regular Cocoa backend; switch a frame to Metal with:

(add-to-list 'load-path "/path/to/emacs-gpu/lisp")
(require 'mtl)
(mtl-enable)

Extras once enabled:

(mtl-video-insert "video.mp4" 480 270 t)  ; inline video, follows scrolling
(mtl-animations t)                        ; GPU cursor effects (experimental)
(mtl-draw-stats)                          ; renderer counters

How it works

redisplay engine (xdisp.c, untouched)
        ↓
src/gfxterm.c   platform-neutral drawing policy
        ↓
src/gfxdrv.h    driver interface (~25 ops)
        ↓
src/mtlterm.m   Metal driver: glyph atlas (CoreText → R8 texture),
                render cycle on a persistent texture, AVFoundation
                video through CVMetalTextureCache

License

GNU General Public License v3 or later, same as GNU Emacs.