OSDN Git Service

intel: Align cubemap texture height to its padding requirements.
authorEric Anholt <eric@anholt.net>
Wed, 19 Aug 2009 01:48:54 +0000 (18:48 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 19 Aug 2009 16:19:06 +0000 (09:19 -0700)
src/mesa/drivers/dri/i965/brw_tex_layout.c

index 1d2e953..5e4f7fd 100644 (file)
@@ -194,6 +194,16 @@ GLboolean brw_miptree_layout(struct intel_context *intel,
         }
 
       }
+      /* The 965's sampler lays cachelines out according to how accesses
+       * in the texture surfaces run, so they may be "vertical" through
+       * memory.  As a result, the docs say in Surface Padding Requirements:
+       * Sampling Engine Surfaces that two extra rows of padding are required.
+       * We don't know of similar requirements for pre-965, but given that
+       * those docs are silent on padding requirements in general, let's play
+       * it safe.
+       */
+      if (mt->target == GL_TEXTURE_CUBE_MAP)
+        total_height += 2;
       break;
    }