mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-21 07:55:10 +02:00
Move the text attributes out of the char type
This means that more text attributes can be added in the future (there are 8 bits available) and there is no need to keep bit twiddling when accessing the chars themselves. Also means less data needs to be sent to the GPU. Cell size does not change since there were currently 2 unused bytes because of alignment.
This commit is contained in:
@@ -591,8 +591,7 @@ create_cell_vao() {
|
||||
#define A1(name, size, dtype, offset) A(name, size, dtype, (void*)(offsetof(Cell, offset)), sizeof(Cell))
|
||||
|
||||
add_buffer_to_vao(vao_idx, GL_ARRAY_BUFFER);
|
||||
A1(text_attrs, 1, GL_UNSIGNED_INT, ch);
|
||||
A1(sprite_coords, 3, GL_UNSIGNED_SHORT, sprite_x);
|
||||
A1(sprite_coords, 4, GL_UNSIGNED_SHORT, sprite_x);
|
||||
A1(colors, 3, GL_UNSIGNED_INT, fg);
|
||||
add_buffer_to_vao(vao_idx, GL_ARRAY_BUFFER);
|
||||
A(is_selected, 1, GL_FLOAT, NULL, 0);
|
||||
|
||||
Reference in New Issue
Block a user