refactor: Remove vertex SSBO req, restructure CellText#10952
refactor: Remove vertex SSBO req, restructure CellText#10952NateSmyth wants to merge 3 commits intoghostty-org:mainfrom
CellText#10952Conversation
|
I haven't looked at this thoroughly, but I would feel more inclined to - if we want to remove SSBO usage to allow better compatibility with old hardware - use a buffer texture instead. The spec allows for a I've experimented in the past with replacing the BG cell buffer with a texture, and it worked fine, but I never brought it in to Ghostty main because I didn't like the increased complexity it brought with it. There's probably a nicer way to do it though that would be fine, or- alternatively- maybe something could be done to transparently (so, only as a part of the OpenGL backend, without affecting the generic code) create a buffer texture for vertex shader access to passed buffers. (Info on buffer textures: https://wikis.khronos.org/opengl/Buffer_Texture) |
187fb4e to
e06cf04
Compare
|
@qwerasd205 Yeah I think you're right. Initially thought about this but decided it added too much complexity for what I was trying to fix. But looking at it again, if you want to remove both SSBOs the TBO is cleaner, and definitely can be done transparently in the opengl backend. Although the original issue was because min vertex SSBO = 0 in opengl 4.3, so there were in-spec cards that would pass the I don't think going no SSBO entirely would expand compatibility further because min fragment SSBOs = 8 in 4.3. But if you also removed the vertex attrib bindings you could support 4.2. And from there its just I'll rework this and probably split into two scoped PRs since the TBO approach wouldn't rely on the CellText glyph narrowing. |
|
Reworked to #10994 |
Purpose
CellTextstruct by narrowingglyph_posandglyph_sizeImplementation
1. Replace vertex SSBO with per-instance vertex attribute
bg_colors[]SSBO becomesbg_colorattributebg_colordirectly to allCellTextconstruction sites2. Refactor `CellText` to compensate for the 4 added bytes
bg_color,CellTextgoes to 40 bytesglyph_sizeandglyph_posare[2]u32 align(8), but fit easily in[2]u16 align(4)shaders.zig, add intCasts to theCellTextconstruction sitesNet: No more vertex SSBO.
CellTextends up at 28 bytesVerify
glyph_posand I think its literally impossibleAI Usage Disclosure per `AI_POLICY.md`
Used AI (opencode) for:
Also...
...used AI to make some silly stress test scenarios.
Render as many unicode codepoints as possible in all 4 styles (trying to trip the u16 intcast)
unicode-spam.mp4
Side-by-side regression test (Linux)
ghostty-comparison.mp4
Smoke check nothing broke on metal (Mac)
metal-render-compressed.mp4
But at this point I had devolved to using the AI like a toy. Point being it works fine.
Fixes #8836