[Piglit] [PATCH 1/4] fbo-blit-d24s8: avoid using textures

Marek Olšák maraeo at gmail.com
Sun Mar 16 06:58:23 PDT 2014


This patch looks good to me.

Marek

On Thu, Mar 13, 2014 at 5:07 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> There's no reason to attach the teximages to the framebuffer. Instead
> use renderbuffers so that we don't need to depend on ARB_depth_texture.
>
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  tests/fbo/fbo-blit-d24s8.c | 38 +++++++++++++++++---------------------
>  1 file changed, 17 insertions(+), 21 deletions(-)
>
> diff --git a/tests/fbo/fbo-blit-d24s8.c b/tests/fbo/fbo-blit-d24s8.c
> index 37e8470..fe8c30d 100644
> --- a/tests/fbo/fbo-blit-d24s8.c
> +++ b/tests/fbo/fbo-blit-d24s8.c
> @@ -58,33 +58,29 @@ PIGLIT_GL_TEST_CONFIG_END
>  static GLuint
>  make_fbo(int w, int h)
>  {
> -       GLuint tex;
> +       GLuint rb;
>         GLuint fb;
>         GLenum status;
>
>         glGenFramebuffersEXT(1, &fb);
>         glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
>
> -       glGenTextures(1, &tex);
> -       glBindTexture(GL_TEXTURE_2D, tex);
> -       glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8_EXT,
> -                    w, h, 0,
> -                    GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, NULL);
> -
> -       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
> -       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
> -
> -       glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
> -                                 GL_DEPTH_ATTACHMENT_EXT,
> -                                 GL_TEXTURE_2D,
> -                                 tex,
> -                                 0);
> -       glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
> -                                 GL_STENCIL_ATTACHMENT_EXT,
> -                                 GL_TEXTURE_2D,
> -                                 tex,
> -                                 0);
> -
> +       glGenRenderbuffersEXT(1, &rb);
> +       glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
> +
> +       glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,
> +                                GL_DEPTH24_STENCIL8,
> +                                w, h);
> +
> +       glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
> +                                    GL_DEPTH_ATTACHMENT_EXT,
> +                                    GL_RENDERBUFFER_EXT,
> +                                    rb);
> +       glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
> +                                    GL_STENCIL_ATTACHMENT_EXT,
> +                                    GL_RENDERBUFFER_EXT,
> +                                    rb);
> +
>         glDrawBuffer(GL_NONE);
>         glReadBuffer(GL_NONE);
>         assert(glGetError() == 0);
> --
> 1.8.3.2
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list