(since the original email never made it to the list, a new one - it's not a resend though)

texrect is broken here (and I've no idea why it works for other people ;-)).
There are 2 problems in the driver which cause this:
First, if glGenTextures is called, there is no texture target yet. This will cause the r200 driver (in r200AllocTexObj) to initialize the texture min filter to GL_NEAREST_MIPMAP_LINEAR. The problem is when the texture object is now bound to a RECTANGLE_NV target, the min filter will not change, causing havoc (the also illegal clamp mode doesn't seem to hurt much).
Second problem is the r200TexParameter, it will only do anything for 1D and 2D targets - thus, even if an application explicitly sets a different texture filter, the hardware will still try to use mipmapping for rectangle targets. Removing the target condition will fix this (why is it there? Mesa already should have checked illegal combinations, or are there some OGL compliant target/param combinations which are not supported in hardware?)
Both problems are also present in the radeon driver, but texrect seems to work there nonetheless...


attached a quick patch (only for r200, and I doubt it will attach cleanly, but I guess it's too ugly anyway).

Roland
Index: r200_tex.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r200/r200_tex.c,v
retrieving revision 1.12
diff -u -r1.12 r200_tex.c
--- r200_tex.c  26 Jan 2004 23:57:19 -0000      1.12
+++ r200_tex.c  28 Jan 2004 01:47:05 -0000
@@ -297,10 +297,10 @@
 
       make_empty_list( & t->base );
 
-      r200SetTexWrap( t, texObj->WrapS, texObj->WrapT, texObj->WrapR );
+/*      r200SetTexWrap( t, texObj->WrapS, texObj->WrapT, texObj->WrapR );
       r200SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );
       r200SetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
-      r200SetTexBorderColor( t, texObj->_BorderChan );
+      r200SetTexBorderColor( t, texObj->_BorderChan );*/
    }
 
    return t;
@@ -888,9 +1070,9 @@
               _mesa_lookup_enum_by_nr( pname ) );
    }

-   if ( ( target != GL_TEXTURE_2D ) &&
+/*   if ( ( target != GL_TEXTURE_2D ) &&
        ( target != GL_TEXTURE_1D ) )
-      return;
+      return;*/

    switch ( pname ) {
    case GL_TEXTURE_MIN_FILTER:
@@ -950,6 +1132,13 @@
        || (target == GL_TEXTURE_RECTANGLE_NV) ) {
       assert( texObj->DriverData != NULL );
    }
+      r200TexObj * t = (r200TexObj *) texObj->DriverData;
+
+      r200SetTexWrap( t, texObj->WrapS, texObj->WrapT, texObj->WrapR );
+      r200SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );
+      r200SetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
+      r200SetTexBorderColor( t, texObj->_BorderChan );
+
 }
 
 

Reply via email to