I'm using 'attribute' in a vertex shader to define a couple of variables like so:
attribute mediump vec4 Position;
attribute lowp vec4 SourceColor;
Looking around, I found something called 'layout' which seems to do the same task.
For example I think the above could be rewritten as:
layout(location = 0) in vec4 Position;
layout(location = 1) in vec4 SourceColor;
I've never used layout before so I'm not sure if it works the same, but it looks pretty similar to me, and the wiki pages don't particularly help me tell them apart.
Could someone please explain the difference between attribute and layout?