diff options
-rw-r--r-- | helpers/glfeatures.cpp | 5 | ||||
-rw-r--r-- | helpers/glfeatures.hpp | 1 | ||||
-rw-r--r-- | retrace/glstate_images.cpp | 10 |
3 files changed, 13 insertions, 3 deletions
diff --git a/helpers/glfeatures.cpp b/helpers/glfeatures.cpp index 0f4945dd..2a5b1aae 100644 --- a/helpers/glfeatures.cpp +++ b/helpers/glfeatures.cpp @@ -353,6 +353,8 @@ Features::load(const Profile & profile, const Extensions & ext) ext.has("GL_ARB_pixel_buffer_object") || ext.has("GL_EXT_pixel_buffer_object"); + read_buffer = 1; + framebuffer_object = profile.versionGreaterOrEqual(3, 0) || ext.has("GL_ARB_framebuffer_object") || ext.has("GL_EXT_framebuffer_object"); @@ -365,6 +367,9 @@ Features::load(const Profile & profile, const Extensions & ext) pixel_buffer_object = profile.versionGreaterOrEqual(3, 1) || ext.has("GL_NV_pixel_buffer_object"); + read_buffer = ext.has("GL_EXT_multiview_draw_buffers") || + ext.has("GL_NV_read_buffer"); + framebuffer_object = profile.versionGreaterOrEqual(2, 0) || ext.has("GL_OES_framebuffer_object"); diff --git a/helpers/glfeatures.hpp b/helpers/glfeatures.hpp index e8f9b9c9..5c7bb193 100644 --- a/helpers/glfeatures.hpp +++ b/helpers/glfeatures.hpp @@ -156,6 +156,7 @@ struct Features unsigned ARB_program_interface_query:1; unsigned pixel_buffer_object:1; + unsigned read_buffer:1; unsigned framebuffer_object:1; unsigned read_framebuffer_object:1; unsigned query_buffer_object:1; diff --git a/retrace/glstate_images.cpp b/retrace/glstate_images.cpp index ef5b0ed1..179e00d0 100644 --- a/retrace/glstate_images.cpp +++ b/retrace/glstate_images.cpp @@ -1047,7 +1047,9 @@ getDrawBufferImage() if (context.read_framebuffer_object) { glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &read_framebuffer); glBindFramebuffer(GL_READ_FRAMEBUFFER, draw_framebuffer); + } + if (context.read_buffer) { glGetIntegerv(GL_READ_BUFFER, &read_buffer); glReadBuffer(draw_buffer); } @@ -1059,8 +1061,10 @@ getDrawBufferImage() } - if (context.read_framebuffer_object) { + if (context.read_buffer) { glReadBuffer(read_buffer); + } + if (context.read_framebuffer_object) { glBindFramebuffer(GL_READ_FRAMEBUFFER, read_framebuffer); } @@ -1299,7 +1303,7 @@ dumpDrawableImages(StateWriter &writer, Context &context) if (draw_buffer != GL_NONE) { // Read from current draw buffer GLint read_buffer = GL_NONE; - if (!context.ES) { + if (context.read_buffer) { glGetIntegerv(GL_READ_BUFFER, &read_buffer); glReadBuffer(draw_buffer); } @@ -1315,7 +1319,7 @@ dumpDrawableImages(StateWriter &writer, Context &context) dumpReadBufferImage(writer, context, enumToString(draw_buffer), NULL, width, height, format, type); // Restore original read buffer - if (!context.ES) { + if (context.read_buffer) { glReadBuffer(read_buffer); } } |