[Piglit] [PATCH] framework: specify GL_NEAREST filter for FBO textures

Charmaine Lee charmainel at vmware.com
Fri Nov 10 19:16:28 UTC 2017


Reviewed-by: Charmaine Lee <charmainel at vmware.com>

________________________________________
From: Brian Paul <brianp at vmware.com>
Sent: Thursday, November 9, 2017 12:52:42 PM
To: piglit at lists.freedesktop.org
Cc: Charmaine Lee; Brian Paul
Subject: [PATCH] framework: specify GL_NEAREST filter for FBO textures

By setting the min/mag filters, we give a hint to the OpenGL driver
that we probaby don't want mipmapped textures.  This results in the
Mesa state tracker allocating single-level textures here instead of
full mipmaps.
---
 tests/util/piglit-framework-gl/piglit_fbo_framework.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/util/piglit-framework-gl/piglit_fbo_framework.c b/tests/util/piglit-framework-gl/piglit_fbo_framework.c
index 77e717b..7064753 100644
--- a/tests/util/piglit-framework-gl/piglit_fbo_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_fbo_framework.c
@@ -77,6 +77,8 @@ init_gl(struct piglit_wfl_framework *wfl_fw)

        glGenTextures(1, &tex);
        glBindTexture(GL_TEXTURE_2D, tex);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
                     piglit_width, piglit_height, 0,
                     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
@@ -93,6 +95,8 @@ init_gl(struct piglit_wfl_framework *wfl_fw)
                 */
                glGenTextures(1, &depth);
                glBindTexture(GL_TEXTURE_2D, depth);
+               glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+               glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
                glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL,
                             piglit_width, piglit_height, 0,
                             GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, NULL);
--
1.9.1



More information about the Piglit mailing list