Module: Mesa
Branch: master
Commit: 2073006c9566b08888b4338748a843c645bd0db1
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2073006c9566b08888b4338748a843c645bd0db1

Author: Eric Anholt <[email protected]>
Date:   Fri Oct 30 12:26:54 2009 -0700

intel: Set the texture format in the TFP path.

This fixes a regression in piglit's tfp test as of
11caea687e3f10ae12d33e44edf84635f73047dd.  Additionally, set the texture
format for the RGB textures to MESA_FORMAT_XRGB8888 and support it in the
hw paths so that hopefully sw fallbacks involving TFP get better alpha
behavior.

The radeon drivers appear to need the same fix.

Bug #24803

---

 src/mesa/drivers/dri/intel/intel_tex_image.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c 
b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 3dce1b0..3412e76 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -6,6 +6,7 @@
 #include "main/bufferobj.h"
 #include "main/convolve.h"
 #include "main/context.h"
+#include "main/formats.h"
 #include "main/image.h"
 #include "main/texcompress.h"
 #include "main/texstore.h"
@@ -741,7 +742,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
    struct gl_texture_unit *texUnit;
    struct gl_texture_object *texObj;
    struct gl_texture_image *texImage;
-   int level = 0, type, format, internalFormat;
+   int level = 0, internalFormat;
 
    texUnit = &intel->ctx.Texture.Unit[intel->ctx.Texture.CurrentUnit];
    texObj = _mesa_select_tex_object(&intel->ctx, texUnit, target);
@@ -759,8 +760,6 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
    if (rb->region == NULL)
       return;
 
-   type = GL_BGRA;
-   format = GL_UNSIGNED_BYTE;
    if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT)
       internalFormat = GL_RGB;
    else
@@ -791,6 +790,10 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
 
    intelImage->face = target_to_face(target);
    intelImage->level = level;
+   if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT)
+      texImage->TexFormat = MESA_FORMAT_XRGB8888;
+   else
+      texImage->TexFormat = MESA_FORMAT_ARGB8888;
    texImage->RowStride = rb->region->pitch;
    intel_miptree_reference(&intelImage->mt, intelObj->mt);
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to