Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // C++ code
- glGenBuffers(1, &ProteinSphereBatchInfos);
- glBindBuffer(GL_SHADER_STORAGE_BUFFER, ProteinSphereBatchInfos);
- sz = 10000 * sizeof(QVector4D); // allocate something big enough, even if the space is wasted, this needs to be solved
- //if more than 10000 vectors are appended into the buffer
- glBufferData(GL_SHADER_STORAGE_BUFFER, sz, NULL, GL_DYNAMIC_DRAW);
- glGenBuffers(1, &IndexAtomicCounter);
- glBindBuffer(GL_ATOMIC_COUNTER_BUFFER, IndexAtomicCounter);
- glBufferData(GL_ATOMIC_COUNTER_BUFFER, sizeof(GLuint), NULL, GL_DYNAMIC_DRAW);
- glBindBuffer(GL_ATOMIC_COUNTER_BUFFER, 0);
- // binding before shader usage
- glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 5, this->ProteinSphereBatchInfos);
- glBindBufferBase(GL_ATOMIC_COUNTER_BUFFER, 6, this->IndexAtomicCounter);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement