Merge branch 'fix-named-texture-fbos' of https://github.com/koolkhel/kitty

This commit is contained in:
Kovid Goyal 2026-10-12 22:33:41 +05:30
commit b9bd3be1a8
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 9 additions and 0 deletions

View file

@ -424,6 +424,10 @@ Detailed list of changes
when the shader declares the variable over multiple lines or with a
different type
- Custom shaders: Fix the screen going blank, except for parts drawn only by
the shader, when switching from a pipeline that does not use the named
textures to one that does
0.49.2 [2026-10-01]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -643,6 +643,10 @@ init_custom_programs(void) {
// persist is per-window and freed lazily in start_os_window_rendering
for (size_t w = 0; w < global_state.num_os_windows; w++) {
OSWindow *osw = global_state.os_windows + w;
// Per window framebuffers must be attached afresh to the textures that
// replace the ones freed above, should a later pipeline declare them again
if (!(custom_shaders.end.textures & (1u << CUSTOM_SHADER_TEXTURE_A))) osw->indirect_output.fbo_a_generation = 0;
if (!(custom_shaders.end.textures & (1u << CUSTOM_SHADER_TEXTURE_B))) osw->indirect_output.fbo_b_generation = 0;
init_shader_animation_state(osw);
// Synthesize focus events for windows that already have focus so that
// animations triggered by os-window-focus-in start on the first render
@ -2631,6 +2635,7 @@ start_os_window_rendering(OSWindow *os_window, Tab *tab) {
} else {
if (os_window->persist_texture_id) free_texture(&os_window->persist_texture_id);
if (os_window->persist_fbo_id) free_framebuffer(&os_window->persist_fbo_id);
os_window->persist_texture_generation = 0;
}
set_framebuffer_to_use_for_output(os_window->indirect_output.framebuffer_id);
bind_framebuffer_for_output(0);