kitty/gpu/opengl
Kovid Goyal 21e84451d0
Use the coordinate conventions of Vulkan and Metal for the GPU API
Pixel coordinates of viewports, scissor rectangles and read back pixels
now have their origin at the top left of the render target, rows are
read back top to bottom, NDC y=-1 is the top of the viewport and render
targets have their top row at texture coordinate t=0, the same as
uploaded images. Vulkan and Metal drivers can then render with no flips
at all.

The OpenGL driver is now the special case. Framebuffer objects already
behave this way, so it converts only when rendering to a window: vertex
shaders negate gl_Position.y via a kitty_flip_y uniform that the GLSL
fixup adds, viewport and scissor y coordinates are converted, rows of
read back pixels are reversed and copying to a texture uses a flipping
blit.

kitty's code gets simpler: viewports and scissor rectangles no longer
need the framebuffer height, screenshots no longer need their rows
flipped and textures produced by rendering are sampled the same way as
uploaded ones. The rounded rect shader no longer uses SV_Position, whose
origin differs between backends.

User facing custom shader UV coordinates are unchanged, still with
their origin at the bottom left.

Rendering is pixel identical to before.
2026-11-19 07:35:31 +05:30
..
driver.c Use the coordinate conventions of Vulkan and Metal for the GPU API 2026-11-19 07:35:31 +05:30
egl.c
gl-wrapper.c
gl-wrapper.h
glx.c
nsgl.m fix build on macOS 2026-11-19 07:35:31 +05:30
platform.h
version.h