[Mesa-dev] [PATCH] mesa/main: simplify _mesa_IsRenderbuffer()
Anuj Phogat
anuj.phogat at gmail.com
Thu Apr 6 18:04:41 UTC 2017
On Thu, Apr 6, 2017 at 9:05 AM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> _mesa_lookup_renderbuffer() already checks if 'id' is non-zero.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
> src/mesa/main/fbobject.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index 5048327e5e..3289f86803 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -1297,15 +1297,14 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
> GLboolean GLAPIENTRY
> _mesa_IsRenderbuffer(GLuint renderbuffer)
> {
> + struct gl_renderbuffer *rb;
> +
> GET_CURRENT_CONTEXT(ctx);
> +
> ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
> - if (renderbuffer) {
> - struct gl_renderbuffer *rb =
> - _mesa_lookup_renderbuffer(ctx, renderbuffer);
> - if (rb != NULL && rb != &DummyRenderbuffer)
> - return GL_TRUE;
> - }
> - return GL_FALSE;
> +
> + rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
> + return rb != NULL && rb != &DummyRenderbuffer;
> }
>
>
> --
> 2.12.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
More information about the mesa-dev
mailing list