[Mesa-dev] [PATCH] mesa: Strip texture border for proxy texture as well

Anuj Phogat anuj.phogat at gmail.com
Wed Feb 29 17:44:27 PST 2012


Intel and Gallium drivers don't support texture borders. Border is stripped
before texture is used inside the driver. So, glGetTexLevelParameteriv()
returns the stripped values of texture dimensions. But it returns un-
stripped values for proxy textures. This patch adds strip_texture_border()
for proxy textures as well.

Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
A piglit test case for this patch will be posted on piglit mailing list
for review.

 src/mesa/main/teximage.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index b8ff67e..5a2ef70 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2543,6 +2543,15 @@ teximage(struct gl_context *ctx, GLuint dims,
       }
       else {
          /* no error, set the tex image parameters */
+
+	 /* Allow a hardware driver to just strip out the border, to provide
+	  * reliable but slightly incorrect hardware rendering instead of
+	  * rarely-tested software fallback rendering.
+	  */
+	 if (border && ctx->Const.StripTextureBorder)
+	    strip_texture_border(target, &border, &width, &height, &depth, unpack,
+				 &unpack_no_border);
+
          struct gl_texture_object *texObj =
             _mesa_get_current_tex_object(ctx, target);
          gl_format texFormat = _mesa_choose_texture_format(ctx, texObj,
-- 
1.7.7.6



More information about the mesa-dev mailing list