From patchwork Tue Jan 29 00:50:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 14317 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 23D5123E2E for ; Tue, 29 Jan 2013 00:50:16 +0000 (UTC) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by fiordland.canonical.com (Postfix) with ESMTP id C9BECA188A7 for ; Tue, 29 Jan 2013 00:50:15 +0000 (UTC) Received: by mail-vc0-f176.google.com with SMTP id fy27so2293952vcb.21 for ; Mon, 28 Jan 2013 16:50:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:dkim-signature:x-received:from:to:cc:subject:date :message-id:x-mailer:x-gm-message-state; bh=9OXqWSs2w3ExzuV4lA1y0lKhIywcG8zZSbVRIK4vgUQ=; b=STuM+EPLFF1bOrCgC8fHznkfMuuBOKb4EW408cL2Z1nF7rptUf9o44EQAj5HLm6Qhp f5s7bKqlJewv6v75XiXqzyGPkKF2l16kUFDw3MLxLh1Tng9LFk6hJjS9OJQC9bbc3TZS VVe46PK9h9KKwqcNgXCvm16Sq169hX5UqX+9AwdoTHHt6G+7Yatavrk5uQ5gsdqZBar7 +gx/j/hJddGb8QRSZYHaDqhgAqwbQWbDlvwvLcGRqRgv1v5TsG02xWVE9jjJr5nOdo7H NoqJH8hU92tGBYlDYI8m/Tx/HvA2vgl/nyZBJgvpP0Dn8HLh+IkGynSmiJvsYNfgE639 WHyA== X-Received: by 10.220.218.197 with SMTP id hr5mr16754381vcb.8.1359420615211; Mon, 28 Jan 2013 16:50:15 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp111786veb; Mon, 28 Jan 2013 16:50:14 -0800 (PST) X-Received: by 10.182.144.40 with SMTP id sj8mr468350obb.82.1359420614427; Mon, 28 Jan 2013 16:50:14 -0800 (PST) Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by mx.google.com with ESMTPS id i2si11685492oba.67.2013.01.28.16.50.14 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Jan 2013 16:50:14 -0800 (PST) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.214.180 as permitted sender) client-ip=209.85.214.180; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.214.180 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-ob0-f180.google.com with SMTP id ef5so3354009obb.39 for ; Mon, 28 Jan 2013 16:50:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=9OXqWSs2w3ExzuV4lA1y0lKhIywcG8zZSbVRIK4vgUQ=; b=dd4JBwPdYRFlrqeEqmr11b7iEifUDPysiEU69GdLo8GhwSKlVgP9PMPQ6o1EsTNkk2 2iw1qfXJ73O0RoybMNfWc5S8gK3rxdIFBsvSwzze3mSKpXdlsnl0UZ5UfZ+hYGsZa4eh 3rV1RLf6dHlMpNeK2vad+sv9g/on5faCxCKJJgpKYut1HZxPfeoyYckFlixbo2P7qHmG xn++KZFV+Nt+c0/qMQ1cxW9g8oShPbvX2L2o65akkgnLr+JQrPjfuCvPv/UTftCQLjkX 6hf3cd6mAIVVMcwqOqciqpxELsdfJ3VnCja5a06Mrzayu6jI8HVbHq7tFCx1piRsx0f0 5pJQ== X-Received: by 10.182.3.163 with SMTP id d3mr12569032obd.27.1359420614120; Mon, 28 Jan 2013 16:50:14 -0800 (PST) Received: from localhost (ppp-70-129-136-92.dsl.rcsntx.swbell.net. [70.129.136.92]) by mx.google.com with ESMTPS id a9sm9360553oee.10.2013.01.28.16.50.11 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 28 Jan 2013 16:50:12 -0800 (PST) From: Rob Clark To: apitrace@lists.freedesktop.org Cc: patches@linaro.org, Rob Clark Subject: [PATCH] image: make getDrawBufferImage() work for ES or !ARB_draw_buffers Date: Mon, 28 Jan 2013 18:50:07 -0600 Message-Id: <1359420607-2748-1-git-send-email-robdclark@gmail.com> X-Mailer: git-send-email 1.8.1 X-Gm-Message-State: ALoCoQmp2fVnw9+aEB2dtcwFMOt8dGH2nI1f4HUw7tQu2GB/abUsKkR+okIiDLDlSXwqvEDn8Blq Without this 'apitrace dump-images' was failing for me (GLES, freedreno gallium driver) because attachment would be GL_NONE. Signed-off-by: Rob Clark Reviewed-by: Carl Worth --- 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)) {