summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2017-01-26 09:04:49 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2017-01-26 09:04:49 +0200
commit63aeb9cafae4102fd62a0d88e6723be2eafe8a7f (patch)
treeceee1419092e41b56b1ba3c248e6624b30f8ef49
parent8bb897857a42a6c9af55704cbe1a185c9aaab929 (diff)
glFlush after glRadPixels
Tell driver we want this data soonish(tm)
-rw-r--r--glcapture.c1
-rw-r--r--glwrangle.h3
2 files changed, 4 insertions, 0 deletions
diff --git a/glcapture.c b/glcapture.c
index c9dcd91..37a0e81 100644
--- a/glcapture.c
+++ b/glcapture.c
@@ -400,6 +400,7 @@ capture_frame_pbo(struct gl *gl, const GLint view[4], const uint64_t ts)
}
glReadPixels(view[0], view[1], view[2], view[3], frame.format, GL_UNSIGNED_BYTE, NULL);
+ glFlush();
for (size_t i = 0; i < ARRAY_SIZE(map); ++i)
glPixelStorei(map[i].t, map[i].o);
diff --git a/glwrangle.h b/glwrangle.h
index d423f47..428d911 100644
--- a/glwrangle.h
+++ b/glwrangle.h
@@ -1,5 +1,6 @@
#pragma once
+static void (*_glFlush)(void);
static GLenum (*_glGetError)(void);
static void (*_glGetIntegerv)(GLenum, GLint*);
static void (*_glGetFloatv)(GLenum, GLfloat*);
@@ -33,6 +34,7 @@ struct gl_version {
static enum gl_variant OPENGL_VARIANT;
static struct gl_version OPENGL_VERSION;
+#define glFlush _glFlush
#define glGetError _glGetError
#define glGetIntegerv _glGetIntegerv
#define glGetFloatv _glGetFloatv
@@ -99,6 +101,7 @@ load_gl_function_pointers(void* (*procs[])(const char*), const size_t memb)
#define GL_REQUIRED(x) do { if (!(_##x = proc(#x))) { ERRX(EXIT_FAILURE, "Failed to load %s", #x); } } while (0)
#define GL_OPTIONAL(x) do { _##x = proc(#x); } while (0)
+ GL_REQUIRED(glFlush);
GL_REQUIRED(glGetError);
GL_REQUIRED(glGetIntegerv);
GL_REQUIRED(glGetFloatv);