[PATCH] image: make getDrawBufferImage() work for ES or !ARB_draw_buffers

Rob Clark robdclark at gmail.com
Mon Jan 28 16:50:07 PST 2013


Without this 'apitrace dump-images' was failing for me (GLES, freedreno
gallium driver) because attachment would be GL_NONE.

Signed-off-by: Rob Clark <robdclark at gmail.com>
---
 retrace/glstate_images.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/retrace/glstate_images.cpp b/retrace/glstate_images.cpp
index 7b0a424..f3949b5 100644
--- a/retrace/glstate_images.cpp
+++ b/retrace/glstate_images.cpp
@@ -745,6 +745,8 @@ getDrawBufferImage() {
             if (draw_buffer == GL_NONE) {
                 return NULL;
             }
+        } else {
+            draw_buffer = GL_COLOR_ATTACHMENT0;
         }
 
         if (!getFramebufferAttachmentDesc(context, framebuffer_target, draw_buffer, desc)) {
@@ -756,6 +758,8 @@ getDrawBufferImage() {
             if (draw_buffer == GL_NONE) {
                 return NULL;
             }
+        } else {
+            draw_buffer = GL_COLOR_ATTACHMENT0;
         }
 
         if (!getDrawableBounds(&desc.width, &desc.height)) {
-- 
1.8.1



More information about the apitrace mailing list