feat(renderer): port the OpenGL backend, shaders and size math
Ports the terminal-independent half of ZIG/src/renderer (OpenGL only): - opengl/*: buffers, frames, pipelines, render passes, samplers, targets, textures and the OpenGL GraphicsAPI backend on top of glow; the GTK GLArea glue is replaced by a get_proc_address loader closure - the GLSL shaders, copied verbatim and embedded; uniform/vertex structs as bytemuck Pod types with std140 offsets asserted in tests - shadertoy custom shaders converted with naga (GLSL in -> validate -> GLSL 430 out) instead of glslang + spirv-cross - size (screen/grid/cell/padding math), cursor style logic, backend health, options and message types The crate opts into unsafe_code = "deny"; unsafe glow calls live only in opengl/gl.rs. A headless EGL integration test builds every pipeline and the converted shadertoy shaders on Mesa and reads back rendered pixels. Note: Zig's shadertoy Uniforms order the selection background/foreground colors opposite to the GLSL block (likely an upstream bug); kept as in Zig for parity and recorded in the notes. Deferred to the next renderer pass: generic, cell, image, link, row, State, Thread, Overlay (need terminal render state). Test Plan: - cargo test -p ghostty-renderer (33 tests incl. tests/egl_headless.rs)
This commit is contained in:
1 parent
5a5fa7893b
commit
568ce784f9
35 files changed
+5477
-5
No files matched your search
@@ -1 +1,22 @@
|
||||
//! ghostty-renderer: see docs/rewrite/ARCHITECTURE.md for the module map.
|
||||
//! ghostty-renderer: OpenGL renderer building blocks (see
|
||||
//! docs/rewrite/ARCHITECTURE.md and docs/rewrite/notes/ghostty-renderer-R1.md).
|
||||
//!
|
||||
//! Terminal-independent parts of `renderer/`: the OpenGL graphics API backend
|
||||
//! and its GPU object wrappers, shaders and their std140 data layouts,
|
||||
//! shadertoy custom-shader conversion, size math and cursor style logic.
|
||||
|
||||
#![cfg_attr(test, allow(clippy::unwrap_used))]
|
||||
|
||||
pub mod backend;
|
||||
pub mod cursor;
|
||||
pub mod math;
|
||||
pub mod message;
|
||||
pub mod opengl;
|
||||
pub mod options;
|
||||
pub mod shadertoy;
|
||||
pub mod size;
|
||||
|
||||
pub use backend::{Backend, Health};
|
||||
pub use cursor::{Style as CursorStyle, style as cursor_style};
|
||||
pub use opengl::OpenGL;
|
||||
pub use size::{CellSize, Coordinate, GridSize, Padding, ScreenSize, Size};
|
||||
Reference in new issue
Block a user