Commit 42afcc51 by Philipp Adolf

Update the code for copying from GPU

parent 580c2bfb
...@@ -754,17 +754,9 @@ Subdivision::Result Subdivision::runShader(Input input, Tables &tables) { ...@@ -754,17 +754,9 @@ Subdivision::Result Subdivision::runShader(Input input, Tables &tables) {
f->glBindBuffer(GL_SHADER_STORAGE_BUFFER, output_handle); f->glBindBuffer(GL_SHADER_STORAGE_BUFFER, output_handle);
Vertex *ptr; Vertex *ptr;
ptr = (Vertex *) f->glMapBuffer(GL_SHADER_STORAGE_BUFFER, GL_WRITE_ONLY); ptr = (Vertex *) f->glMapBuffer(GL_SHADER_STORAGE_BUFFER, GL_WRITE_ONLY);
for (unsigned int i = 0; i < output_size; i++) {
qCDebug(log_subdiv_trace) << "New vertices:";
for (int i = 0; i < input.vertex_buffer.size(); i++) {
qCDebug(log_subdiv_trace) << ptr[i].pos;
result.vertex_buffer.push_back(ptr[i]); result.vertex_buffer.push_back(ptr[i]);
} }
qCDebug(log_subdiv_trace) << "New edge points:";
for (int i = 0; i < tables.edge_indices.size() / 4; i++) {
qCDebug(log_subdiv_trace) << ptr[edge_offset + i].pos;
result.vertex_buffer.push_back(ptr[edge_offset + i]);
}
int bufferbildTime = timer.elapsed(); int bufferbildTime = timer.elapsed();
f->glUnmapBuffer(GL_SHADER_STORAGE_BUFFER); f->glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
......
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