Possible fix for #141

Presumably on older macOS versions the Apple OpenGL drivers cannot handle both
non-sequential and non-zero based binding locations. Sigh.
This commit is contained in:
Kovid Goyal 2017-10-16 18:39:49 +05:30
parent 6f0922d5e3
commit e679fa9a1c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 7 additions and 7 deletions

View File

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

View File

@ -1,6 +1,6 @@
#version GLSL_VERSION
layout(location=0) in vec4 src;
layout(location=3) in vec4 src;
out vec2 texcoord;
void main() {

View File

@ -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
}