mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-11-19 14:45:29 +00:00
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. |
||
|---|---|---|
| .. | ||
| driver.c | ||
| egl.c | ||
| gl-wrapper.c | ||
| gl-wrapper.h | ||
| glx.c | ||
| nsgl.m | ||
| platform.h | ||
| version.h | ||