<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ghostty.git/src/renderer/Metal.zig, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/'/>
<entry>
<title>renderer: create explicit sampler state for custom shaders</title>
<updated>2025-09-18T16:25:37+00:00</updated>
<author>
<name>Mitchell Hashimoto</name>
<email>m@mitchellh.com</email>
</author>
<published>2025-09-18T15:57:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=a45368161507343c5ce540c2e2bb9ba41bc46e91'/>
<id>a45368161507343c5ce540c2e2bb9ba41bc46e91</id>
<content type='text'>
The GLSL to MSL conversion process uses a passed-in sampler state for
the `iChannel0` parameter and we weren't providing it. This magically
worked on Apple Silicon for unknown reasons but failed on Intel GPUs.

In normal, hand-written MSL, we'd explicitly create the sampler state as
a normal variable (we do this in `shaders.metal` already!), but the
Shadertoy conversion stuff doesn't do this, probably because the exact
sampler parameters can't be safely known.

This fixes a Metal validation error when using custom shaders:

```
-[MTLDebugRenderCommandEncoder validateCommonDrawErrors:]:5970: failed 
assertion `Draw Errors Validation Fragment Function(main0): missing Sampler 
binding at index 0 for iChannel0Smplr[0].
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The GLSL to MSL conversion process uses a passed-in sampler state for
the `iChannel0` parameter and we weren't providing it. This magically
worked on Apple Silicon for unknown reasons but failed on Intel GPUs.

In normal, hand-written MSL, we'd explicitly create the sampler state as
a normal variable (we do this in `shaders.metal` already!), but the
Shadertoy conversion stuff doesn't do this, probably because the exact
sampler parameters can't be safely known.

This fixes a Metal validation error when using custom shaders:

```
-[MTLDebugRenderCommandEncoder validateCommonDrawErrors:]:5970: failed 
assertion `Draw Errors Validation Fragment Function(main0): missing Sampler 
binding at index 0 for iChannel0Smplr[0].
```
</pre>
</div>
</content>
</entry>
<entry>
<title>renderer/metal: provide MTLTextureUsage render target for custom shaders</title>
<updated>2025-09-18T14:29:26+00:00</updated>
<author>
<name>Mitchell Hashimoto</name>
<email>m@mitchellh.com</email>
</author>
<published>2025-09-18T14:20:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=cb0e60c3e5d3c966884859a4b35a575572c33e48'/>
<id>cb0e60c3e5d3c966884859a4b35a575572c33e48</id>
<content type='text'>
This fixes a Metal validation error in Xcode when using custom shaders. 
I suspect this is one part of custom shaders not working properly on
Intel macs (probably anything with a discrete GPU).

This happens to work on Apple Silicon but this is undefined behavior and
we're just getting lucky.

There is one more issue I'm chasing down that I think is also still
blocking custom shaders working on Intel macs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes a Metal validation error in Xcode when using custom shaders. 
I suspect this is one part of custom shaders not working properly on
Intel macs (probably anything with a discrete GPU).

This happens to work on Apple Silicon but this is undefined behavior and
we're just getting lucky.

There is one more issue I'm chasing down that I think is also still
blocking custom shaders working on Intel macs.
</pre>
</div>
</content>
</entry>
<entry>
<title>Nuke GLFW from Orbit</title>
<updated>2025-07-04T21:12:18+00:00</updated>
<author>
<name>Mitchell Hashimoto</name>
<email>m@mitchellh.com</email>
</author>
<published>2025-07-04T20:43:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=fb9c52ecf44ee1004de16a4b02a67d4258e66c14'/>
<id>fb9c52ecf44ee1004de16a4b02a67d4258e66c14</id>
<content type='text'>
This deletes the GLFW apprt from the Ghostty codebase.

The GLFW apprt was the original apprt used by Ghostty (well, before
Ghostty even had the concept of an "apprt" -- it was all just a single
application then). It let me iterate on the core terminal features,
rendering, etc. without bothering about the UI. It was a good way to get
started. But it has long since outlived its usefulness.

We've had a stable GTK apprt for Linux (and Windows via WSL) and a
native macOS app via libghostty for awhile now. The GLFW apprt only
remained within the tree for a few reasons:

  1. Primarily, it provided a faster feedback loop on macOS because
     building the macOS app historically required us to hop out of the
     zig build system and into Xcode, which is slow and cumbersome.

  2. It was a convenient way to narrow whether a bug was in the
     core Ghostty codebase or in the apprt itself. If a bug was in both
     the glfw and macOS app then it was likely in the core.

  3. It provided us a way on macOS to test OpenGL.

All of these reasons are no longer valid. Respectively:

  1. Our Zig build scripts now execute the `xcodebuild` CLI directly and
     can open the resulting app, stream logs, etc. This is the same
     experience we have on Linux. (Xcode has always been a dependency of
     building on macOS in general, so this is not cumbersome.)

  2. We have a healthy group of maintainers, many of which have access
     to both macOS and Linux, so we can quickly narrow down bugs
     regardless of the apprt.

  3. Our OpenGL renderer hasn't been compatible with macOS for some time
     now, so this is no longer a useful feature.

At this point, the GLFW apprt is just a burden. It adds complexity
across the board, and some people try to run Ghostty with it in the real
world and get confused when it doesn't work (it's always been lacking in
features and buggy compared to the other apprts).

So, it's time to say goodbye. Its bittersweet because it is a big part
of Ghostty's history, but we've grown up now and it's time to move on.
Thank you, goodbye.

(NOTE: If you are a user of the GLFW apprt, then please fork the project
prior to this commit or start a new project based on it. We've warned
against using it for a very, very long time now.)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This deletes the GLFW apprt from the Ghostty codebase.

The GLFW apprt was the original apprt used by Ghostty (well, before
Ghostty even had the concept of an "apprt" -- it was all just a single
application then). It let me iterate on the core terminal features,
rendering, etc. without bothering about the UI. It was a good way to get
started. But it has long since outlived its usefulness.

We've had a stable GTK apprt for Linux (and Windows via WSL) and a
native macOS app via libghostty for awhile now. The GLFW apprt only
remained within the tree for a few reasons:

  1. Primarily, it provided a faster feedback loop on macOS because
     building the macOS app historically required us to hop out of the
     zig build system and into Xcode, which is slow and cumbersome.

  2. It was a convenient way to narrow whether a bug was in the
     core Ghostty codebase or in the apprt itself. If a bug was in both
     the glfw and macOS app then it was likely in the core.

  3. It provided us a way on macOS to test OpenGL.

All of these reasons are no longer valid. Respectively:

  1. Our Zig build scripts now execute the `xcodebuild` CLI directly and
     can open the resulting app, stream logs, etc. This is the same
     experience we have on Linux. (Xcode has always been a dependency of
     building on macOS in general, so this is not cumbersome.)

  2. We have a healthy group of maintainers, many of which have access
     to both macOS and Linux, so we can quickly narrow down bugs
     regardless of the apprt.

  3. Our OpenGL renderer hasn't been compatible with macOS for some time
     now, so this is no longer a useful feature.

At this point, the GLFW apprt is just a burden. It adds complexity
across the board, and some people try to run Ghostty with it in the real
world and get confused when it doesn't work (it's always been lacking in
features and buggy compared to the other apprts).

So, it's time to say goodbye. Its bittersweet because it is a big part
of Ghostty's history, but we've grown up now and it's time to move on.
Thank you, goodbye.

(NOTE: If you are a user of the GLFW apprt, then please fork the project
prior to this commit or start a new project based on it. We've warned
against using it for a very, very long time now.)
</pre>
</div>
</content>
</entry>
<entry>
<title>renderer: add support for background images</title>
<updated>2025-06-25T20:27:23+00:00</updated>
<author>
<name>Qwerasd</name>
<email>qwerasd205@users.noreply.github.com</email>
</author>
<published>2025-06-25T15:28:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=da46a47726f39b5ca564d49ec397d76d4f1725ff'/>
<id>da46a47726f39b5ca564d49ec397d76d4f1725ff</id>
<content type='text'>
Adds support for background images via the `background-image` config.

Resolves #3645, supersedes PRs #4226 and #5233.

See docs of added config keys for usage details.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds support for background images via the `background-image` config.

Resolves #3645, supersedes PRs #4226 and #5233.

See docs of added config keys for usage details.
</pre>
</div>
</content>
</entry>
<entry>
<title>renderer: fix color glyph rendering under OpenGL</title>
<updated>2025-06-24T00:01:34+00:00</updated>
<author>
<name>Qwerasd</name>
<email>qwerasd205@users.noreply.github.com</email>
</author>
<published>2025-06-23T23:31:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=41ae32814fd988cb729bc5c9ba83937ceb7dee5a'/>
<id>41ae32814fd988cb729bc5c9ba83937ceb7dee5a</id>
<content type='text'>
Also changes color atlas to always use an sRGB internal format so that
the texture reads automatically linearize the colors.

Renames the misleading `rgba` atlas format to `bgra`, since both
FreeType and CoreText are set up to draw color glyphs in bgra.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also changes color atlas to always use an sRGB internal format so that
the texture reads automatically linearize the colors.

Renames the misleading `rgba` atlas format to `bgra`, since both
FreeType and CoreText are set up to draw color glyphs in bgra.
</pre>
</div>
</content>
</entry>
<entry>
<title>renderer: unify `image.zig`</title>
<updated>2025-06-23T19:12:17+00:00</updated>
<author>
<name>Qwerasd</name>
<email>qwerasd205@users.noreply.github.com</email>
</author>
<published>2025-06-23T19:12:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=df8dc33ab65731165fba91afc48367bad6c8ced0'/>
<id>df8dc33ab65731165fba91afc48367bad6c8ced0</id>
<content type='text'>
The code in metal/image.zig and opengl/image.zig was virtually identical
save for the texture options, so I've moved that to the GraphicsAPI and
unified them in to renderer/image.zig
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code in metal/image.zig and opengl/image.zig was virtually identical
save for the texture options, so I've moved that to the GraphicsAPI and
unified them in to renderer/image.zig
</pre>
</div>
</content>
</entry>
<entry>
<title>renderer: unify `cell.zig`</title>
<updated>2025-06-23T18:21:30+00:00</updated>
<author>
<name>Qwerasd</name>
<email>qwerasd205@users.noreply.github.com</email>
</author>
<published>2025-06-23T18:21:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=4b01cc1d8880c69cd9db06568be5c5fa55893660'/>
<id>4b01cc1d8880c69cd9db06568be5c5fa55893660</id>
<content type='text'>
The code in metal/cell.zig and opengl/cell.zig was virtually identical
aside from the types for the cell data, moved it to renderer/cell.zig
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code in metal/cell.zig and opengl/cell.zig was virtually identical
aside from the types for the cell data, moved it to renderer/cell.zig
</pre>
</div>
</content>
</entry>
<entry>
<title>renderer: add custom shader cursor uniforms</title>
<updated>2025-06-22T17:05:16+00:00</updated>
<author>
<name>Qwerasd</name>
<email>qwerasd205@users.noreply.github.com</email>
</author>
<published>2025-06-22T16:28:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=bb576d1340c07832ccb39d460a1dfd3580eb0f22'/>
<id>bb576d1340c07832ccb39d460a1dfd3580eb0f22</id>
<content type='text'>
Based on / supersedes PR #6912, implements discussion #6901

Co-authored-by: Krone Corylus &lt;ahustinkrone@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Based on / supersedes PR #6912, implements discussion #6901

Co-authored-by: Krone Corylus &lt;ahustinkrone@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>renderer: move drawFrame AutoreleasePool handling to GraphicsAPI</title>
<updated>2025-06-20T22:21:44+00:00</updated>
<author>
<name>Qwerasd</name>
<email>qwerasd205@users.noreply.github.com</email>
</author>
<published>2025-06-20T22:16:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=ddf1a5b23d2447b1d55656f95c2faad12570a84e'/>
<id>ddf1a5b23d2447b1d55656f95c2faad12570a84e</id>
<content type='text'>
Introduces `drawFrameStart`/`drawFrameEnd` for this purpose.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduces `drawFrameStart`/`drawFrameEnd` for this purpose.
</pre>
</div>
</content>
</entry>
<entry>
<title>naming(GraphicsAPI): repeat -&gt; presentLastTarget</title>
<updated>2025-06-20T21:51:48+00:00</updated>
<author>
<name>Qwerasd</name>
<email>qwerasd205@users.noreply.github.com</email>
</author>
<published>2025-06-20T21:51:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=ab926fc842da4765148295b7a12f42cb28b86d25'/>
<id>ab926fc842da4765148295b7a12f42cb28b86d25</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
