r300g: fix texture pitch to correct value.
authorDave Airlie <airlied@redhat.com>
Sat, 26 Sep 2009 06:39:13 +0000 (16:39 +1000)
committerDave Airlie <airlied@redhat.com>
Sat, 26 Sep 2009 06:39:13 +0000 (16:39 +1000)
pitch is pixels - 1, not bytes.

src/gallium/drivers/r300/r300_texture.c

index 7c041d17f71eee9825c423aed2a839559605246b..e8078ea9f138d18e2b244e083b795f6464c167db 100644 (file)
@@ -37,7 +37,7 @@ static void r300_setup_texture_state(struct r300_texture* tex,
     /* XXX */
     state->format1 = r300_translate_texformat(tex->tex.format);
 
-    state->format2 = r300_texture_get_stride(tex, 0);
+    state->format2 = (r300_texture_get_stride(tex, 0) / tex->tex.block.size) - 1;
 
     /* Assume (somewhat foolishly) that oversized textures will
      * not be permitted by the state tracker. */