Skip to content

refactor: swap SSBO bindings for TBOs#10994

Open
NateSmyth wants to merge 3 commits intoghostty-org:mainfrom
NateSmyth:TBO
Open

refactor: swap SSBO bindings for TBOs#10994
NateSmyth wants to merge 3 commits intoghostty-org:mainfrom
NateSmyth:TBO

Conversation

@NateSmyth
Copy link

@NateSmyth NateSmyth commented Feb 24, 2026

Purpose

Remove SSBO bindings from the opengl backend in favor of TBOs
Expand hardware compatibility to any device meeting min OpenGL 4.3 specs

Implementation

1. Replace cell_text vertex SSBO with TBO
  • Added buffer_texture option to Pipeline and TBO binding logic to RenderPass
  • cell_text.v.glsl: SSBO bg_colors[] → usamplerBuffer + texelFetch.
2. Replace cell_bg fragment SSBO with TBO
  • cell_bg.f.glsl: SSBO cells[] → usamplerBuffer + texelFetch
  • Removed the SSBO binding loop from RenderPass
  • Dropped unused .buffers from the bg_color step in generic renderer

Technically the change in generic.zig affects the metal backend but this was an unused binding.

3. Cleanup
  • Removed GL_SHADER_STORAGE_BUFFER, InstanceBufferOptions
  • Rewording comments
  • Cleaned up my own dead code that I added...

Verify

  • Build & ran on opengl (RTX 3070 + the original Radeon HD 7650A that was having issues), no issues in normal use
  • Ditto on metal
  • No regressions in tests

Rework of #10952

  • Keeps it contained to opengl
  • Split off the CellText rework because its not directly related anymore. But compatible

The vertex attribute approach feels more surgical for my specific issue (vertex SSBO), but the TBO seems cleaner if you intend to remove the fragment SSBO, and keeps things contained within opengl code.

Either way fixes my issue (and fixes #8836)

@mitchellh
Copy link
Contributor

This looks a lot better visually, I haven't run it yet. cc @qwerasd205 I'll look more deeply soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants