]> git.cworth.org Git - apitrace/blobdiff - retrace/glstate_images.cpp
Allow BlockingIO read of profiling results.
[apitrace] / retrace / glstate_images.cpp
index 84c6db1793b88b0581457fd39f746b2362145929..6390980966a91c8e17048718b20f01630e6aa338 100644 (file)
@@ -709,7 +709,7 @@ getFramebufferAttachmentDesc(Context &context, GLenum target, GLenum attachment,
 image::Image *
 getDrawBufferImage() {
     GLenum format = GL_RGB;
-    GLint channels = __gl_format_channels(format);
+    GLint channels = _gl_format_channels(format);
     if (channels > 4) {
         return NULL;
     }
@@ -816,7 +816,11 @@ static inline void
 dumpReadBufferImage(JSONWriter &json, GLint width, GLint height, GLenum format,
                     GLint internalFormat = GL_NONE)
 {
-    GLint channels = __gl_format_channels(format);
+    GLint channels = _gl_format_channels(format);
+
+    if (internalFormat == GL_NONE) {
+        internalFormat = format;
+    }
 
     Context context;