mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-11-19 14:45:29 +00:00
On macOS, kitty now tries to render using Metal, falling back to OpenGL, see the gpu_driver option. The driver has not yet been compiled or run on macOS, it was written on Linux and only syntax checked against stub headers. Shader targets of the form msl-NN (for MSL N.N) compile each program to a single MSL source file containing the entry points for all stages, compiled by the driver at runtime, for the built-in and custom shaders. slangc ignores [[vk::binding]] for Metal, so the program metadata keeps the kitty binding slots and passes the argument table indices assigned by slangc as native names. The push constant block, emitted as an ordinary constant buffer, is recognized by the name of its type. As Metal has y=1 at the top in NDC, the generated code is fixed up to negate the y coordinate of the position output by vertex entry points. Layouts that would differ because bool is a single byte in MSL are rejected. The MSL is validated with the Metal compiler when available. The MSL shaders are temporarily built on all platforms, for development. The driver follows the design of the Vulkan driver: command buffers with serials and at most three in flight, copy on write of buffer storage the GPU may still use, private textures uploaded with blits from staging memory, pipeline variants created when first used and a CAMetalLayer per window. Vertex inputs whose offset or stride is not a multiple of four bytes, as Metal requires, are repacked into a cached copy. |
||
|---|---|---|
| .. | ||
| metal | ||
| opengl | ||
| vulkan | ||
| api.h | ||