Difference between relativeOffset and offset in VAO with Direct Access Ext Using The DSA Ext with opengl , API calls to guide opengl to the buffer format are :

glVertexArrayAttribFormat(  GLuint vaobj,
GLuint attribindex,
GLint size,
GLenum type,
GLboolean normalized,
GLuint relativeoffset);


and another one is :

glVertexArrayVertexBuffer(  GLuint vaobj,
GLuint bindingindex,
GLuint buffer,
GLintptr offset,
GLsizei stride);


my question is what's the difference between relativeOffset and the offset in both function calls ? when i set one the results are ok but when you set both your layout will be incorrected and thus the results are wrong.
The offset in glVertexArrayVertexBuffer is the common offset for all attributes bound to that buffer. It's where the vbo data starts.

The offset in glVertexArrayAttribFormat is added to that common offset for that attribute. 

This allows you to interleave attributes using a single vbo binding point. and change the vbo binding for those attributes in a single call.

To make an example: 

struct Vertex {
    vec3 pos;
    vec3 normal;
}

glVertexAttribFormat(posAttrLoc, 3, GL_FLOAT, false, offsetof(Vertex, pos));
glVertexAttribBinding(posAttrLoc, vertexBindingPoint);
glEnableVertexAttribArray(posAttrLoc);

glVertexAttribFormat(normalAttrLoc, 3, GL_FLOAT, false, offsetof(Vertex, normal));
glVertexAttribBinding(normalAttrLoc, vertexBindingPoint);
glEnableVertexAttribArray(normalAttrLoc);


then to bind the buffer you pass the offset to where you put in where the data was uploaded to, this is 0 in the basic case.

glBindVertexBuffer(vertexBindingPoint, mesh.vbo, mesh.vboOffset, sizeof(Vertex));