summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZou Nan hai <[email protected]>2008-02-26 17:20:12 +0800
committerZou Nan hai <[email protected]>2008-02-26 17:20:12 +0800
commit9bd2cb7f90ac434ec5be7d388f899976bf902dc1 (patch)
treef704b675e47ee3331664bdc60ff2135074539566 /src
parent32879e14610906c23b3ca874ba7234370132d76c (diff)
[i915] fix texture size exceed limit case when running celestia
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/intel/intel_mipmap_tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 941f7a697c3..3209545adcb 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -180,6 +180,7 @@ int intel_miptree_pitch_align (struct intel_context *intel,
struct intel_mipmap_tree *mt,
int pitch)
{
+ GLcontext *ctx = &intel->ctx;
if (!mt->compressed) {
int pitch_align;
@@ -201,7 +202,8 @@ int intel_miptree_pitch_align (struct intel_context *intel,
* of 1024 and sometimes 512 bytes - performance can drop by several
* times. Go to the next multiple of the required alignment for now.
*/
- if (!(pitch & 511))
+ if (!(pitch & 511) &&
+ (pitch + pitch_align) < (1 << ctx->Const.MaxTextureLevels))
pitch += pitch_align;
#endif