Commit Graph

31 Commits

Author SHA1 Message Date
Kovid Goyal
1f07fa766e Simplify API 2025-12-10 08:55:06 +05:30
Kovid Goyal
025dccf182 Micro optimization: When sending cell uniform data dont even map the color table region in memory unless the color table is dirty 2025-12-10 08:49:02 +05:30
Kovid Goyal
bfca1763f2 Function to save 24bit RGB data as PNG 2025-11-16 23:30:34 +05:30
Kovid Goyal
e46a75ca57 Fix rendering broken on ancient GPU drivers that dont support rendering to 16 bit textures
Fixes #9068
2025-10-06 08:54:53 +05:30
Kovid Goyal
43d4e757aa Properly blank bar area
Otherwise the rounded rect frame lets content from below the bar shine
through at the corners
2025-08-17 21:06:11 +05:30
Kovid Goyal
4fd84ac5ea Improve rendering of hyperlink hover popups
Now they are rendered in default bg/fg with a rounded rectangle
border.
2025-08-14 08:30:28 +05:30
Kovid Goyal
e3888b6262 ... 2025-08-11 22:01:24 +05:30
Kovid Goyal
01c3adf6e2 Make CodeQL happy 2025-08-11 21:59:29 +05:30
Kovid Goyal
9f51779750 More robust detection of support for GL_FRAMEBUFFER_SRGB
When not supported fallback to layer based rendering
2025-08-11 09:13:49 +05:30
Kovid Goyal
d52f2e7981 Rewrite rendering pipeline
This was needed to fix various corner cases when doing blending of colors
in linear space. The new architecture has the same performance as the
old in the common case of opaque rendering with no UI layers or images.

In the case of only positive z-index images there is a performance
decrease as the OS Window is now rendered to a offscreen texture and
then blitted to screen. However, in the future when we move to Vulkan or
I can figure out how to get Wayland to accept buffers with colors in
linear space, this performance penalty can be removed. The performance
penalty was not significant on my system but this is highly GPU
dependent. Modern GPUs are supposedly optimised for rendering to
offscreen buffers, so we will see. The awrit project might be a good
test case.

Now either we have 1-shot rendering for the case of opaque with only ext
or all the various pieces are rendered in successive draw calls into an
offscreen buffer that is blitted to the output buffer after all drawing
is done.

Fixes #8869
2025-08-11 00:47:02 +05:30
Kovid Goyal
1d4883f1fa Fix minimum OpenGL version reported in some error messages 2024-05-20 20:13:35 +05:30
Kovid Goyal
d89e68f5e9 Output OpenGL version in debug config 2024-04-24 08:55:56 +05:30
Kovid Goyal
f7a7765ba2 Clean up debug rendering output 2024-03-26 13:06:08 +05:30
Kovid Goyal
69c0eaaf74 Dont request sRGB surfaces on Wayland
Apparently mesa just completely broke it. Besides it being already
broken on NVIDIA. Sigh, more of my life wasted on Wayland.

See https://github.com/kovidgoyal/kitty/issues/7174#issuecomment-2000033873
2024-03-19 08:57:48 +05:30
Kovid Goyal
828f4f312a Wayland+NVIDIA: Do not request an sRGB output buffer as a bug in Wayland causes kitty to not start
Fixes #7021
2024-01-22 13:22:04 +05:30
Kovid Goyal
248301f8b3 Cleanup a bunch of shader infrastructure
1) No longer us glScissor. It's an awful API and is not available in
   Vulkan. Instead the graphics drawing code ensures the graphic is
   drawn within the current viewport

2) Use generated code to automatically get the locations of uniforms
   from shaders. Greatly simplifies adding new uniforms to a shader.

3) Dont use a VAO for loading graphics vertices. Greatly simplifies
   a bunch of book keeping code.
2023-06-22 19:38:05 +05:30
Kovid Goyal
86b4637df7 Clean up shader compilation error handling 2023-06-13 15:23:14 +05:30
Kovid Goyal
288bb034b5 Remove duplicate definitions of linear2srgb functions in shaders 2023-06-13 14:54:20 +05:30
Kovid Goyal
a09dda27dc Merge branch 'master' of https://github.com/marcan/kitty 2023-02-10 10:55:41 +05:30
Luofan Chen
130315ce8d Use strict function prototypes
Fixes clang error:
error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
2023-02-09 13:16:00 +08:00
Martin Wernstål
02d1a3c1c3 feat(srgb): swap textures and framebuffers to SRGB 2023-02-02 09:53:39 +01:00
Hector Martin
84aebae6a8 Downgrade OpenGL version requirement to 3.1
There are only a few features required from newer versions, and they
can be achieved via extensions. This significantly improves compatibility.
2022-12-20 16:22:05 +09:00
Kovid Goyal
be34af4555 Remove inline from .c files
It is ignored by compilers and hides unused static functions
2021-08-03 09:11:17 +05:30
Alexander Kobel
e6e61028b1 Rename --debug-gl to --debug-rendering 2020-04-14 19:35:40 +02:00
Fredrick Brennan
65a7b19f40 Make each OS window have its own framebuffer
This commit fixes graphics rendering when more than one OS window is
open, all OS windows are semi-transparent, and multiple windows contain
graphics.

This commit closes #2310.
2020-01-24 16:06:57 +08:00
Kovid Goyal
714bee7f45 Only use an extra draw call for the background when drawing interleaved cells if it is actually required 2020-01-12 09:37:16 +05:30
Kovid Goyal
40b9049deb Move the kitty OpenGL API into its own compilation unit 2019-07-12 15:29:48 +05:30
Kovid Goyal
7f6befe4f9 Remove the python OpenGL wrapper as it is no longer needed 2017-09-15 10:45:23 +05:30
Kovid Goyal
8ce2794a8a More work on migrating shader code 2017-09-15 10:45:20 +05:30
Kovid Goyal
d3f2620caf Migrate GL setup and error handling code 2017-09-15 10:45:20 +05:30
Kovid Goyal
457bf8c289 Move gl binding code into its own module 2017-09-15 10:45:17 +05:30