diff --git a/kitty/cell_vertex.glsl b/kitty/cell_vertex.glsl index f772099a7..46b92c886 100644 --- a/kitty/cell_vertex.glsl +++ b/kitty/cell_vertex.glsl @@ -13,10 +13,10 @@ layout(std140) uniform CellRenderData { }; // Have to use fixed locations here as all variants of the cell program share the same VAO -// location 0 is used in the graphics program which uses the same VAO -layout(location=1) in uvec3 colors; -layout(location=2) in uvec4 sprite_coords; -layout(location=3) in float is_selected; +// location 3 is used in the graphics program which uses the same VAO +layout(location=0) in uvec3 colors; +layout(location=1) in uvec4 sprite_coords; +layout(location=2) in float is_selected; #if defined(FOREGROUND) || defined(ALL) diff --git a/kitty/graphics_vertex.glsl b/kitty/graphics_vertex.glsl index 8fe913fb3..9345339b4 100644 --- a/kitty/graphics_vertex.glsl +++ b/kitty/graphics_vertex.glsl @@ -1,6 +1,6 @@ #version GLSL_VERSION -layout(location=0) in vec4 src; +layout(location=3) in vec4 src; out vec2 texcoord; void main() { diff --git a/kitty/shaders.c b/kitty/shaders.c index d1de716ba..26711e9ef 100644 --- a/kitty/shaders.c +++ b/kitty/shaders.c @@ -194,9 +194,9 @@ init_cell_program() { // Sanity check to ensure the attribute location binding worked #define C(p, name, expected) { int aloc = attrib_location(p, #name); if (aloc != expected && aloc != -1) fatal("The attribute location for %s is %d != %d in program: %d", #name, aloc, expected, p); } for (int p = CELL_PROGRAM; p <= CELL_FOREGROUND_PROGRAM; p++) { - C(p, colors, 1); C(p, sprite_coords, 2); C(p, is_selected, 3); + C(p, colors, 0); C(p, sprite_coords, 1); C(p, is_selected, 2); } - C(GRAPHICS_PROGRAM, src, 0); + C(GRAPHICS_PROGRAM, src, 3); #undef C }