Commit ffaac38b by Philipp Adolf

Make output buffer large enough for all vertices

parent 27fa54c9
...@@ -330,7 +330,7 @@ void Subdivision::runShader(Input input, Tables &tables) { ...@@ -330,7 +330,7 @@ void Subdivision::runShader(Input input, Tables &tables) {
GLuint output_handle; GLuint output_handle;
f->glGenBuffers(1, &output_handle); f->glGenBuffers(1, &output_handle);
f->glBindBuffer(GL_SHADER_STORAGE_BUFFER, output_handle); f->glBindBuffer(GL_SHADER_STORAGE_BUFFER, output_handle);
f->glBufferData(GL_SHADER_STORAGE_BUFFER, tables.edge_indices.size() * sizeof(Vertex) / 4, NULL, GL_DYNAMIC_DRAW); f->glBufferData(GL_SHADER_STORAGE_BUFFER, (input.vertex_buffer.size() + tables.edge_indices.size() / 4) * sizeof(Vertex), NULL, GL_DYNAMIC_DRAW);
f->glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0); f->glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment