We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Everything is in the title, your example is good but I don't understand why you use GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT.
Solution :
`GLuint vao = GL_NONE; GLuint buffer = GL_NONE;
auto const ind_len = GLsizei(ind_count * sizeof(element_t)); auto const vrt_len = GLsizei(vrt_count * sizeof(vertex));
auto const ind_offset = vrt_len; auto const vrt_offset = 0;
glCreateBuffers(1, &buffer); glNamedBufferStorage(buffer, ind_len + vrt_len, nullptr, GL_DYNAMIC_STORAGE_BIT);
glNamedBufferSubData(buffer, ind_offset, ind_len, ind_data); glNamedBufferSubData(buffer, vrt_offset, vrt_len, vrt_data);
glCreateVertexArrays(1, &vao); glVertexArrayVertexBuffer(vao, 0, buffer, vrt_offset, sizeof(vertex)); glVertexArrayElementBuffer(vao, buffer);`
The text was updated successfully, but these errors were encountered:
Yes, I have the same question. If this is only a performance optimize option, it should be emphasized in the document.
Sorry, something went wrong.
No branches or pull requests
Everything is in the title, your example is good but I don't understand why you use GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT.
Solution :
`GLuint vao = GL_NONE;
GLuint buffer = GL_NONE;
auto const ind_len = GLsizei(ind_count * sizeof(element_t));
auto const vrt_len = GLsizei(vrt_count * sizeof(vertex));
auto const ind_offset = vrt_len;
auto const vrt_offset = 0;
glCreateBuffers(1, &buffer);
glNamedBufferStorage(buffer, ind_len + vrt_len, nullptr, GL_DYNAMIC_STORAGE_BIT);
glNamedBufferSubData(buffer, ind_offset, ind_len, ind_data);
glNamedBufferSubData(buffer, vrt_offset, vrt_len, vrt_data);
glCreateVertexArrays(1, &vao);
glVertexArrayVertexBuffer(vao, 0, buffer, vrt_offset, sizeof(vertex));
glVertexArrayElementBuffer(vao, buffer);`
The text was updated successfully, but these errors were encountered: