mirror-ghostty/pkg/opengl
Mitchell Hashimoto a453681615
renderer: create explicit sampler state for custom shaders
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].
```
2025-09-18 09:25:37 -07:00
..
Buffer.zig renderer: big rework, graphics API abstraction layers, unified logic 2025-06-20 15:18:41 -06:00
Framebuffer.zig renderer: big rework, graphics API abstraction layers, unified logic 2025-06-20 15:18:41 -06:00
Program.zig pkg/opengl: yeet usingns 2024-08-16 15:28:22 -07:00
Renderbuffer.zig renderer: big rework, graphics API abstraction layers, unified logic 2025-06-20 15:18:41 -06:00
Sampler.zig renderer: create explicit sampler state for custom shaders 2025-09-18 09:25:37 -07:00
Shader.zig pkg/opengl: yeet usingns 2024-08-16 15:28:22 -07:00
Texture.zig renderer/opengl: explicit texture options 2025-07-05 22:10:39 -06:00
VertexArray.zig renderer: big rework, graphics API abstraction layers, unified logic 2025-06-20 15:18:41 -06:00
build.zig begin 0.13 update process -- very broken 2024-06-24 15:16:22 -07:00
c.zig pkg/opengl: yeet usingns 2024-08-16 15:28:22 -07:00
draw.zig renderer: big rework, graphics API abstraction layers, unified logic 2025-06-20 15:18:41 -06:00
errors.zig pkg/opengl: yeet usingns 2024-08-16 15:28:22 -07:00
extensions.zig pkg/opengl: yeet usingns 2024-08-16 15:28:22 -07:00
glad.zig core: fixup callconv(.C) -> callconv(.c) 2025-05-07 08:41:09 -05:00
main.zig renderer: create explicit sampler state for custom shaders 2025-09-18 09:25:37 -07:00
primitives.zig renderer: big rework, graphics API abstraction layers, unified logic 2025-06-20 15:18:41 -06:00