Here are the cleaned-up texrect fixes - last time there was still some disagreement about how some things should be fixed.
If there are no objections I'm just going to try out my newly aquired super-powers and commit it ;-).


Roland
Index: src/mesa/drivers/dri/r200/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
--- src/mesa/drivers/dri/r200/r200_tex.c        26 Jan 2004 23:57:19 -0000      1.12
+++ src/mesa/drivers/dri/r200/r200_tex.c        5 Feb 2004 00:03:37 -0000
@@ -888,10 +888,6 @@
               _mesa_lookup_enum_by_nr( pname ) );
    }
 
-   if ( ( target != GL_TEXTURE_2D ) &&
-       ( target != GL_TEXTURE_1D ) )
-      return;
-
    switch ( pname ) {
    case GL_TEXTURE_MIN_FILTER:
    case GL_TEXTURE_MAG_FILTER:
Index: src/mesa/drivers/dri/r200/r200_texmem.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r200/r200_texmem.c,v
retrieving revision 1.5
diff -u -r1.5 r200_texmem.c
--- src/mesa/drivers/dri/r200/r200_texmem.c     27 Jan 2004 16:34:46 -0000      1.5
+++ src/mesa/drivers/dri/r200/r200_texmem.c     5 Feb 2004 00:03:37 -0000
@@ -231,7 +231,7 @@
         tex = (char *)texImage->Data + done * src_pitch;
 
         memset(&region, 0, sizeof(region));
-        r200AllocDmaRegion( rmesa, &region, lines * dstPitch, 64 );
+        r200AllocDmaRegion( rmesa, &region, lines * dstPitch, 1024 );
 
         /* Copy texdata to dma:
          */
@@ -240,10 +240,10 @@
                    __FUNCTION__, src_pitch, dstPitch);
 
         if (src_pitch == dstPitch) {
-           memcpy( region.address, tex, lines * src_pitch );
+           memcpy( region.address + region.start, tex, lines * src_pitch );
         } 
         else {
-           char *buf = region.address;
+           char *buf = region.address + region.start;
            int i;
            for (i = 0 ; i < lines ; i++) {
               memcpy( buf, tex, src_pitch );
Index: src/mesa/drivers/dri/radeon/radeon_tex.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/radeon/radeon_tex.c,v
retrieving revision 1.10
diff -u -r1.10 radeon_tex.c
--- src/mesa/drivers/dri/radeon/radeon_tex.c    26 Jan 2004 23:57:19 -0000      1.10
+++ src/mesa/drivers/dri/radeon/radeon_tex.c    5 Feb 2004 00:03:37 -0000
@@ -623,10 +623,6 @@
               _mesa_lookup_enum_by_nr( pname ) );
    }
 
-   if ( ( target != GL_TEXTURE_2D ) &&
-       ( target != GL_TEXTURE_1D ) )
-      return;
-
    switch ( pname ) {
    case GL_TEXTURE_MIN_FILTER:
    case GL_TEXTURE_MAG_FILTER:
Index: src/mesa/drivers/dri/radeon/radeon_texmem.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/radeon/radeon_texmem.c,v
retrieving revision 1.4
diff -u -r1.4 radeon_texmem.c
--- src/mesa/drivers/dri/radeon/radeon_texmem.c 27 Jan 2004 16:34:46 -0000      1.4
+++ src/mesa/drivers/dri/radeon/radeon_texmem.c 5 Feb 2004 00:03:37 -0000
@@ -135,10 +135,10 @@
                    __FUNCTION__, src_pitch, dstPitch);
 
         if (src_pitch == dstPitch) {
-           memcpy( region.address, tex, lines * src_pitch );
+           memcpy( region.address + region.start, tex, lines * src_pitch );
         } 
         else {
-           char *buf = region.address;
+           char *buf = region.address + region.start;
            int i;
            for (i = 0 ; i < lines ; i++) {
               memcpy( buf, tex, src_pitch );
Index: src/mesa/main/texobj.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/main/texobj.c,v
retrieving revision 1.81
diff -u -r1.81 texobj.c
--- src/mesa/main/texobj.c      27 Jan 2004 16:34:46 -0000      1.81
+++ src/mesa/main/texobj.c      5 Feb 2004 00:03:38 -0000
@@ -818,7 +818,16 @@
             newTexObj->WrapT = GL_CLAMP_TO_EDGE;
             newTexObj->WrapR = GL_CLAMP_TO_EDGE;
             newTexObj->MinFilter = GL_LINEAR;
-         }
+            if (ctx->Driver.TexParameter) {
+               GLfloat fparam[1];
+               fparam[0] = (GLfloat) GL_CLAMP_TO_EDGE;
+               (*ctx->Driver.TexParameter)( ctx, target, newTexObj, 
GL_TEXTURE_WRAP_S, fparam );
+               (*ctx->Driver.TexParameter)( ctx, target, newTexObj, 
GL_TEXTURE_WRAP_T, fparam );
+               (*ctx->Driver.TexParameter)( ctx, target, newTexObj, 
GL_TEXTURE_WRAP_R, fparam );
+               fparam[0] = (GLfloat) GL_LINEAR;
+               (*ctx->Driver.TexParameter)( ctx, target, newTexObj, 
GL_TEXTURE_MIN_FILTER, fparam );
+            }
+          }
       }
       else {
          /* if this is a new texture id, allocate a texture object now */

Reply via email to