@@ -239,7 +239,7 @@ cell_update_uniform_block(ssize_t vao_idx, Screen *screen, int uniform_buffer, G
239239
240240 // Send the uniform data
241241 rd = (struct CellRenderData * )map_vao_buffer (vao_idx , uniform_buffer , GL_WRITE_ONLY );
242- if (UNLIKELY (screen -> color_profile -> dirty )) {
242+ if (UNLIKELY (screen -> color_profile -> dirty || screen -> reload_all_gpu_data )) {
243243 copy_color_table_to_buffer (screen -> color_profile , (GLuint * )rd , cell_program_layouts [CELL_PROGRAM ].color_table .offset / sizeof (GLuint ), cell_program_layouts [CELL_PROGRAM ].color_table .stride / sizeof (GLuint ));
244244 }
245245 // Cursor position
@@ -295,7 +295,7 @@ cell_prepare_to_render(ssize_t vao_idx, ssize_t gvao_idx, Screen *screen, GLfloa
295295 || screen -> cursor -> y != screen -> last_rendered_cursor_y ;
296296 bool disable_ligatures = screen -> disable_ligatures == DISABLE_LIGATURES_CURSOR ;
297297
298- if (screen -> scroll_changed || screen -> is_dirty || (disable_ligatures && cursor_pos_changed )) {
298+ if (screen -> reload_all_gpu_data || screen -> scroll_changed || screen -> is_dirty || (disable_ligatures && cursor_pos_changed )) {
299299 sz = sizeof (GPUCell ) * screen -> lines * screen -> columns ;
300300 address = alloc_and_map_vao_buffer (vao_idx , sz , cell_data_buffer , GL_STREAM_DRAW , GL_WRITE_ONLY );
301301 screen_update_cell_data (screen , address , fonts_data , disable_ligatures && cursor_pos_changed );
@@ -308,7 +308,7 @@ cell_prepare_to_render(ssize_t vao_idx, ssize_t gvao_idx, Screen *screen, GLfloa
308308 screen -> last_rendered_cursor_y = screen -> cursor -> y ;
309309 }
310310
311- if (screen_is_selection_dirty (screen )) {
311+ if (screen -> reload_all_gpu_data || screen_is_selection_dirty (screen )) {
312312 sz = screen -> lines * screen -> columns ;
313313 address = alloc_and_map_vao_buffer (vao_idx , sz , selection_buffer , GL_STREAM_DRAW , GL_WRITE_ONLY );
314314 screen_apply_selection (screen , address , sz );
@@ -453,8 +453,8 @@ draw_cells_interleaved_premult(ssize_t vao_idx, ssize_t gvao_idx, Screen *screen
453453}
454454
455455static inline void
456- set_cell_uniforms (float current_inactive_text_alpha ) {
457- if (!cell_uniform_data .constants_set ) {
456+ set_cell_uniforms (float current_inactive_text_alpha , bool force ) {
457+ if (!cell_uniform_data .constants_set || force ) {
458458 cell_uniform_data .gploc = glGetUniformLocation (program_id (GRAPHICS_PROGRAM ), "inactive_text_alpha" );
459459 cell_uniform_data .gpploc = glGetUniformLocation (program_id (GRAPHICS_PREMULT_PROGRAM ), "inactive_text_alpha" );
460460 cell_uniform_data .cploc = glGetUniformLocation (program_id (CELL_PROGRAM ), "inactive_text_alpha" );
@@ -467,7 +467,7 @@ set_cell_uniforms(float current_inactive_text_alpha) {
467467#undef S
468468 cell_uniform_data .constants_set = true;
469469 }
470- if (current_inactive_text_alpha != cell_uniform_data .prev_inactive_text_alpha ) {
470+ if (current_inactive_text_alpha != cell_uniform_data .prev_inactive_text_alpha || force ) {
471471 cell_uniform_data .prev_inactive_text_alpha = current_inactive_text_alpha ;
472472#define S (prog , loc ) { bind_program(prog); glUniform1f(cell_uniform_data.loc, current_inactive_text_alpha); }
473473 S (CELL_PROGRAM , cploc ); S (CELL_FG_PROGRAM , cfploc ); S (GRAPHICS_PROGRAM , gploc ); S (GRAPHICS_PREMULT_PROGRAM , gpploc );
@@ -503,7 +503,8 @@ draw_cells(ssize_t vao_idx, ssize_t gvao_idx, GLfloat xstart, GLfloat ystart, GL
503503 bind_vertex_array (vao_idx );
504504
505505 float current_inactive_text_alpha = (!can_be_focused || screen -> cursor_render_info .is_focused ) && is_active_window ? 1.0f : (float )OPT (inactive_text_alpha );
506- set_cell_uniforms (current_inactive_text_alpha );
506+ set_cell_uniforms (current_inactive_text_alpha , screen -> reload_all_gpu_data );
507+ screen -> reload_all_gpu_data = false;
507508 GLfloat w = (GLfloat )screen -> columns * dx , h = (GLfloat )screen -> lines * dy ;
508509 // The scissor limits below are calculated to ensure that they do not
509510 // overlap with the pixels outside the draw area,
0 commit comments