mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-27 01:31:42 +00:00
Ensures the GL error flag is cleared after a potential error-raising call.
This commit is contained in:
parent
2a9dccff26
commit
88551607a6
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user