1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-26 09:29:45 +00:00

Ensures the GL error flag is cleared after a potential error-raising call.

This commit is contained in:
Thomas Harte 2017-11-13 22:31:41 -05:00
parent 2a9dccff26
commit 88551607a6

View File

@ -125,7 +125,7 @@ std::size_t ArrayBuilder::Buffer::submit(bool is_input) {
} else {
glBindBuffer(GL_ARRAY_BUFFER, buffer);
uint8_t *destination = static_cast<uint8_t *>(glMapBufferRange(GL_ARRAY_BUFFER, 0, (GLsizeiptr)length, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_FLUSH_EXPLICIT_BIT));
if(destination) {
if(!glGetError() && destination) {
std::memcpy(destination, data.data(), length);
glFlushMappedBufferRange(GL_ARRAY_BUFFER, 0, (GLsizeiptr)length);
glUnmapBuffer(GL_ARRAY_BUFFER);