gl_stream_buffer: minor update

Co-Authored-By: zhang wei <zwdreams@gmail.com>
This commit is contained in:
Gamer64 2024-09-16 19:04:48 +02:00
parent 29d4c5e473
commit c3f832f87f

View File

@ -47,7 +47,12 @@ std::tuple<u8*, GLintptr, bool> OGLStreamBuffer::Map(GLsizeiptr size, GLintptr a
void OGLStreamBuffer::Unmap(GLsizeiptr size) {
if (size > 0) {
glFlushMappedBufferRange(gl_target, buffer_pos, size);
// flush is relative to the start of the currently mapped range of buffer
glFlushMappedBufferRange(gl_target, 0, size);
GLenum error = glGetError();
if (error != GL_NO_ERROR) {
LOG_DEBUG(Render_OpenGL, "flush mapped buffer range error: {:04X}, target: {:04X}, offset: {}, size: {}, total: {}", error, gl_target, buffer_pos, size, buffer_size);
}
}
glUnmapBuffer(gl_target);
buffer_pos += size;