diff --git a/src/Magnum/Shaders/Generic.h b/src/Magnum/Shaders/Generic.h index 454ff279a..90be1f73f 100644 --- a/src/Magnum/Shaders/Generic.h +++ b/src/Magnum/Shaders/Generic.h @@ -45,6 +45,8 @@ See @ref shaders-generic for more information. template struct Generic; #else template struct Generic { + /* Keep consistent with generic.glsl and the real definitions below */ + /** * @brief Vertex position * diff --git a/src/Magnum/Shaders/VertexColor2D.vert b/src/Magnum/Shaders/VertexColor2D.vert index c8931979d..d67172d7f 100644 --- a/src/Magnum/Shaders/VertexColor2D.vert +++ b/src/Magnum/Shaders/VertexColor2D.vert @@ -43,7 +43,7 @@ layout(location = POSITION_ATTRIBUTE_LOCATION) in highp vec2 position; #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 3) +layout(location = COLOR_ATTRIBUTE_LOCATION) #endif in lowp vec4 color; diff --git a/src/Magnum/Shaders/VertexColor3D.vert b/src/Magnum/Shaders/VertexColor3D.vert index 5a405dcdb..51ca839c5 100644 --- a/src/Magnum/Shaders/VertexColor3D.vert +++ b/src/Magnum/Shaders/VertexColor3D.vert @@ -43,7 +43,7 @@ layout(location = POSITION_ATTRIBUTE_LOCATION) in highp vec4 position; #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 3) +layout(location = COLOR_ATTRIBUTE_LOCATION) #endif in lowp vec4 color; diff --git a/src/Magnum/Shaders/generic.glsl b/src/Magnum/Shaders/generic.glsl index 3c2955d8a..3b2f2ae6c 100644 --- a/src/Magnum/Shaders/generic.glsl +++ b/src/Magnum/Shaders/generic.glsl @@ -23,6 +23,9 @@ DEALINGS IN THE SOFTWARE. */ +/* Keep consistent with Generic.h */ + #define POSITION_ATTRIBUTE_LOCATION 0 #define TEXTURECOORDINATES_ATTRIBUTE_LOCATION 1 #define NORMAL_ATTRIBUTE_LOCATION 2 +#define COLOR_ATTRIBUTE_LOCATION 3