[Piglit] [PATCH 1/4] fbo-blit-d24s8: avoid using textures
Anuj Phogat
anuj.phogat at gmail.com
Fri Mar 14 17:24:06 PDT 2014
On Thu, Mar 13, 2014 at 9:07 AM, 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.
>
OpenGL driver may choose different blitting paths internally based on if the
attachment is a renderbuffer or a texture. e. g. take a look at function
_mesa_meta_BlitFramebuffer() in mesa:
http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/drivers/common/meta_blit.c
I think the better idea would be to keep the code for testing with texture
attachments and add renderbuffer testing as well.
> 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