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:
Kovid Goyal
2017-09-16 11:02:42 +05:30
parent 85ed5c1515
commit a92b3c605f
9 changed files with 75 additions and 70 deletions

View File

@@ -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);