<div dir="ltr"><div>LGTM.<br><br></div>Reviewed-by: Laura Ekstrand <<a href="mailto:laura@jlekstrand.net">laura@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 16, 2015 at 6:13 AM, Martin Peres <span dir="ltr"><<a href="mailto:martin.peres@linux.intel.com" target="_blank">martin.peres@linux.intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Martin Peres <<a href="mailto:martin.peres@linux.intel.com">martin.peres@linux.intel.com</a>><br>
---<br>
 src/mesa/main/fbobject.c | 166 +++++++++++++++++++++++------------------------<br>
 1 file changed, 83 insertions(+), 83 deletions(-)<br>
<br>
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c<br>
index 3053622..09c931d 100644<br>
--- a/src/mesa/main/fbobject.c<br>
+++ b/src/mesa/main/fbobject.c<br>
@@ -212,13 +212,13 @@ get_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,<br>
        */<br>
       i = attachment - GL_COLOR_ATTACHMENT0_EXT;<br>
       if (i >= ctx->Const.MaxColorAttachments<br>
-         || (i > 0 && ctx->API == API_OPENGLES)) {<br>
-        return NULL;<br>
+          || (i > 0 && ctx->API == API_OPENGLES)) {<br>
+         return NULL;<br>
       }<br>
       return &fb->Attachment[BUFFER_COLOR0 + i];<br>
    case GL_DEPTH_STENCIL_ATTACHMENT:<br>
       if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))<br>
-        return NULL;<br>
+         return NULL;<br>
       /* fall-through */<br>
    case GL_DEPTH_ATTACHMENT_EXT:<br>
       return &fb->Attachment[BUFFER_DEPTH];<br>
@@ -1122,28 +1122,28 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,<br>
    if (_mesa_is_desktop_gl(ctx) && !ctx->Extensions.ARB_ES2_compatibility) {<br>
       /* Check that all DrawBuffers are present */<br>
       for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) {<br>
-        if (fb->ColorDrawBuffer[j] != GL_NONE) {<br>
-           const struct gl_renderbuffer_attachment *att<br>
-              = get_attachment(ctx, fb, fb->ColorDrawBuffer[j]);<br>
-           assert(att);<br>
-           if (att->Type == GL_NONE) {<br>
-              fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT;<br>
-              fbo_incomplete(ctx, "missing drawbuffer", j);<br>
-              return;<br>
-           }<br>
-        }<br>
+         if (fb->ColorDrawBuffer[j] != GL_NONE) {<br>
+            const struct gl_renderbuffer_attachment *att<br>
+               = get_attachment(ctx, fb, fb->ColorDrawBuffer[j]);<br>
+            assert(att);<br>
+            if (att->Type == GL_NONE) {<br>
+               fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT;<br>
+               fbo_incomplete(ctx, "missing drawbuffer", j);<br>
+               return;<br>
+            }<br>
+         }<br>
       }<br>
<br>
       /* Check that the ReadBuffer is present */<br>
       if (fb->ColorReadBuffer != GL_NONE) {<br>
-        const struct gl_renderbuffer_attachment *att<br>
-           = get_attachment(ctx, fb, fb->ColorReadBuffer);<br>
-        assert(att);<br>
-        if (att->Type == GL_NONE) {<br>
-           fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT;<br>
+         const struct gl_renderbuffer_attachment *att<br>
+            = get_attachment(ctx, fb, fb->ColorReadBuffer);<br>
+         assert(att);<br>
+         if (att->Type == GL_NONE) {<br>
+            fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT;<br>
             fbo_incomplete(ctx, "missing readbuffer", -1);<br>
-           return;<br>
-        }<br>
+            return;<br>
+         }<br>
       }<br>
    }<br>
<br>
@@ -1233,12 +1233,12 @@ bind_renderbuffer(GLenum target, GLuint renderbuffer, bool allow_user_names)<br>
       }<br>
<br>
       if (!newRb) {<br>
-        /* create new renderbuffer object */<br>
-        newRb = ctx->Driver.NewRenderbuffer(ctx, renderbuffer);<br>
-        if (!newRb) {<br>
-           _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindRenderbufferEXT");<br>
-           return;<br>
-        }<br>
+         /* create new renderbuffer object */<br>
+         newRb = ctx->Driver.NewRenderbuffer(ctx, renderbuffer);<br>
+         if (!newRb) {<br>
+            _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindRenderbufferEXT");<br>
+            return;<br>
+         }<br>
          ASSERT(newRb->AllocStorage);<br>
          _mesa_HashInsert(ctx->Shared->RenderBuffers, renderbuffer, newRb);<br>
          newRb->RefCount = 1; /* referenced by hash table */<br>
@@ -1333,9 +1333,9 @@ _mesa_DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers)<br>
<br>
    for (i = 0; i < n; i++) {<br>
       if (renderbuffers[i] > 0) {<br>
-        struct gl_renderbuffer *rb;<br>
-        rb = _mesa_lookup_renderbuffer(ctx, renderbuffers[i]);<br>
-        if (rb) {<br>
+         struct gl_renderbuffer *rb;<br>
+         rb = _mesa_lookup_renderbuffer(ctx, renderbuffers[i]);<br>
+         if (rb) {<br>
             /* check if deleting currently bound renderbuffer object */<br>
             if (rb == ctx->CurrentRenderbuffer) {<br>
                /* bind default */<br>
@@ -1368,17 +1368,17 @@ _mesa_DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers)<br>
                _mesa_detach_renderbuffer(ctx, ctx->ReadBuffer, rb);<br>
             }<br>
<br>
-           /* Remove from hash table immediately, to free the ID.<br>
+            /* Remove from hash table immediately, to free the ID.<br>
              * But the object will not be freed until it's no longer<br>
              * referenced anywhere else.<br>
              */<br>
-           _mesa_HashRemove(ctx->Shared->RenderBuffers, renderbuffers[i]);<br>
+            _mesa_HashRemove(ctx->Shared->RenderBuffers, renderbuffers[i]);<br>
<br>
             if (rb != &DummyRenderbuffer) {<br>
                /* no longer referenced by hash table */<br>
                _mesa_reference_renderbuffer(&rb, NULL);<br>
-           }<br>
-        }<br>
+            }<br>
+         }<br>
       }<br>
    }<br>
 }<br>
@@ -1941,7 +1941,7 @@ _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,<br>
  */<br>
 void GLAPIENTRY<br>
 _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,<br>
-                          GLsizei width, GLsizei height)<br>
+                           GLsizei width, GLsizei height)<br>
 {<br>
    switch (internalFormat) {<br>
    case GL_RGB565:<br>
@@ -2116,12 +2116,12 @@ bind_framebuffer(GLenum target, GLuint framebuffer, bool allow_user_names)<br>
       }<br>
<br>
       if (!newDrawFb) {<br>
-        /* create new framebuffer object */<br>
-        newDrawFb = ctx->Driver.NewFramebuffer(ctx, framebuffer);<br>
-        if (!newDrawFb) {<br>
-           _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindFramebufferEXT");<br>
-           return;<br>
-        }<br>
+         /* create new framebuffer object */<br>
+         newDrawFb = ctx->Driver.NewFramebuffer(ctx, framebuffer);<br>
+         if (!newDrawFb) {<br>
+            _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindFramebufferEXT");<br>
+            return;<br>
+         }<br>
          _mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newDrawFb);<br>
       }<br>
       newReadFb = newDrawFb;<br>
@@ -2224,9 +2224,9 @@ _mesa_DeleteFramebuffers(GLsizei n, const GLuint *framebuffers)<br>
<br>
    for (i = 0; i < n; i++) {<br>
       if (framebuffers[i] > 0) {<br>
-        struct gl_framebuffer *fb;<br>
-        fb = _mesa_lookup_framebuffer(ctx, framebuffers[i]);<br>
-        if (fb) {<br>
+         struct gl_framebuffer *fb;<br>
+         fb = _mesa_lookup_framebuffer(ctx, framebuffers[i]);<br>
+         if (fb) {<br>
             ASSERT(fb == &DummyFramebuffer || fb->Name == framebuffers[i]);<br>
<br>
             /* check if deleting currently bound framebuffer object */<br>
@@ -2241,16 +2241,16 @@ _mesa_DeleteFramebuffers(GLsizei n, const GLuint *framebuffers)<br>
                _mesa_BindFramebuffer(GL_READ_FRAMEBUFFER, 0);<br>
             }<br>
<br>
-           /* remove from hash table immediately, to free the ID */<br>
-           _mesa_HashRemove(ctx->Shared->FrameBuffers, framebuffers[i]);<br>
+            /* remove from hash table immediately, to free the ID */<br>
+            _mesa_HashRemove(ctx->Shared->FrameBuffers, framebuffers[i]);<br>
<br>
             if (fb != &DummyFramebuffer) {<br>
                /* But the object will not be freed until it's no longer<br>
                 * bound in any context.<br>
                 */<br>
                _mesa_reference_framebuffer(&fb, NULL);<br>
-           }<br>
-        }<br>
+            }<br>
+         }<br>
       }<br>
    }<br>
 }<br>
@@ -2498,34 +2498,34 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,<br>
           _mesa_tex_target_to_face(textarget) ==<br>
           fb->Attachment[BUFFER_STENCIL].CubeMapFace &&<br>
           zoffset == fb->Attachment[BUFFER_STENCIL].Zoffset) {<br>
-        /* The texture object is already attached to the stencil attachment<br>
-         * point. Don't create a new renderbuffer; just reuse the stencil<br>
-         * attachment's. This is required to prevent a GL error in<br>
-         * glGetFramebufferAttachmentParameteriv(GL_DEPTH_STENCIL).<br>
-         */<br>
-        reuse_framebuffer_texture_attachment(fb, BUFFER_DEPTH,<br>
-                                             BUFFER_STENCIL);<br>
+         /* The texture object is already attached to the stencil attachment<br>
+          * point. Don't create a new renderbuffer; just reuse the stencil<br>
+          * attachment's. This is required to prevent a GL error in<br>
+          * glGetFramebufferAttachmentParameteriv(GL_DEPTH_STENCIL).<br>
+          */<br>
+         reuse_framebuffer_texture_attachment(fb, BUFFER_DEPTH,<br>
+                                              BUFFER_STENCIL);<br>
       } else if (attachment == GL_STENCIL_ATTACHMENT &&<br>
-                texObj == fb->Attachment[BUFFER_DEPTH].Texture &&<br>
+                 texObj == fb->Attachment[BUFFER_DEPTH].Texture &&<br>
                  level == fb->Attachment[BUFFER_DEPTH].TextureLevel &&<br>
                  _mesa_tex_target_to_face(textarget) ==<br>
                  fb->Attachment[BUFFER_DEPTH].CubeMapFace &&<br>
                  zoffset == fb->Attachment[BUFFER_DEPTH].Zoffset) {<br>
-        /* As above, but with depth and stencil transposed. */<br>
-        reuse_framebuffer_texture_attachment(fb, BUFFER_STENCIL,<br>
-                                             BUFFER_DEPTH);<br>
+         /* As above, but with depth and stencil transposed. */<br>
+         reuse_framebuffer_texture_attachment(fb, BUFFER_STENCIL,<br>
+                                              BUFFER_DEPTH);<br>
       } else {<br>
-        set_texture_attachment(ctx, fb, att, texObj, textarget,<br>
-                                     level, zoffset, layered);<br>
-        if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {<br>
-           /* Above we created a new renderbuffer and attached it to the<br>
-            * depth attachment point. Now attach it to the stencil attachment<br>
-            * point too.<br>
-            */<br>
-           assert(att == &fb->Attachment[BUFFER_DEPTH]);<br>
-           reuse_framebuffer_texture_attachment(fb,BUFFER_STENCIL,<br>
-                                                BUFFER_DEPTH);<br>
-        }<br>
+         set_texture_attachment(ctx, fb, att, texObj, textarget,<br>
+                                      level, zoffset, layered);<br>
+         if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {<br>
+            /* Above we created a new renderbuffer and attached it to the<br>
+             * depth attachment point. Now attach it to the stencil attachment<br>
+             * point too.<br>
+             */<br>
+            assert(att == &fb->Attachment[BUFFER_DEPTH]);<br>
+            reuse_framebuffer_texture_attachment(fb,BUFFER_STENCIL,<br>
+                                                 BUFFER_DEPTH);<br>
+         }<br>
       }<br>
<br>
       /* Set the render-to-texture flag.  We'll check this flag in<br>
@@ -2541,8 +2541,8 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,<br>
    else {<br>
       remove_attachment(ctx, att);<br>
       if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {<br>
-        assert(att == &fb->Attachment[BUFFER_DEPTH]);<br>
-        remove_attachment(ctx, &fb->Attachment[BUFFER_STENCIL]);<br>
+         assert(att == &fb->Attachment[BUFFER_DEPTH]);<br>
+         remove_attachment(ctx, &fb->Attachment[BUFFER_STENCIL]);<br>
       }<br>
    }<br>
<br>
@@ -2721,16 +2721,16 @@ _mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment,<br>
    if (renderbuffer) {<br>
       rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);<br>
       if (!rb) {<br>
-        _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                    "glFramebufferRenderbuffer(non-existant"<br>
+         _mesa_error(ctx, GL_INVALID_OPERATION,<br>
+                     "glFramebufferRenderbuffer(non-existant"<br>
                      " renderbuffer %u)", renderbuffer);<br>
-        return;<br>
+         return;<br>
       }<br>
       else if (rb == &DummyRenderbuffer) {<br>
-        _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                    "glFramebufferRenderbuffer(renderbuffer %u)",<br>
+         _mesa_error(ctx, GL_INVALID_OPERATION,<br>
+                     "glFramebufferRenderbuffer(renderbuffer %u)",<br>
                      renderbuffer);<br>
-        return;<br>
+         return;<br>
       }<br>
    }<br>
    else {<br>
@@ -2795,9 +2795,9 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,<br>
       if ((!_mesa_is_desktop_gl(ctx) ||<br>
            !ctx->Extensions.ARB_framebuffer_object)<br>
           && !_mesa_is_gles3(ctx)) {<br>
-        _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                    "glGetFramebufferAttachmentParameteriv(bound FBO = 0)");<br>
-        return;<br>
+         _mesa_error(ctx, GL_INVALID_OPERATION,<br>
+                     "glGetFramebufferAttachmentParameteriv(bound FBO = 0)");<br>
+         return;<br>
       }<br>
<br>
       if (_mesa_is_gles3(ctx) && attachment != GL_BACK &&<br>
@@ -2855,10 +2855,10 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,<br>
       return;<br>
    case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT:<br>
       if (att->Type == GL_RENDERBUFFER_EXT) {<br>
-        *params = att->Renderbuffer->Name;<br>
+         *params = att->Renderbuffer->Name;<br>
       }<br>
       else if (att->Type == GL_TEXTURE) {<br>
-        *params = att->Texture->Name;<br>
+         *params = att->Texture->Name;<br>
       }<br>
       else {<br>
          assert(att->Type == GL_NONE);<br>
@@ -2871,7 +2871,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,<br>
       return;<br>
    case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT:<br>
       if (att->Type == GL_TEXTURE) {<br>
-        *params = att->TextureLevel;<br>
+         *params = att->TextureLevel;<br>
       }<br>
       else if (att->Type == GL_NONE) {<br>
          _mesa_error(ctx, err,<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.3.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>