From 88551607a61a53855db19119d0187067559636a1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 13 Nov 2017 22:31:41 -0500 Subject: [PATCH] Ensures the GL error flag is cleared after a potential error-raising call. --- Outputs/CRT/Internals/ArrayBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Outputs/CRT/Internals/ArrayBuilder.cpp b/Outputs/CRT/Internals/ArrayBuilder.cpp index cffddb04e..6dcef65af 100644 --- a/Outputs/CRT/Internals/ArrayBuilder.cpp +++ b/Outputs/CRT/Internals/ArrayBuilder.cpp @@ -125,7 +125,7 @@ std::size_t ArrayBuilder::Buffer::submit(bool is_input) { } else { glBindBuffer(GL_ARRAY_BUFFER, buffer); uint8_t *destination = static_cast(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);