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

José Fonseca jose.r.fonseca at gmail.com
Fri Feb 1 08:59:36 PST 2013


On Tue, Jan 29, 2013 at 12:50 AM, Rob Clark <robdclark at gmail.com> wrote:
> Without this 'apitrace dump-images' was failing for me (GLES, freedreno
> gallium driver) because attachment would be GL_NONE.

Thanks Rob.

>
> 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;

I believe here it should be GL_BACK/GL_FRONT, as there is no bound
framebuffer in this path.

I looked at the code for dumping FBOs and there are many other places
were we use non GLES calls/state (glReadBuffer, READ_BUFFER,
DRAW_BUFFER, etc).

Jose


More information about the apitrace mailing list