@@ -150,7 +150,8 @@ namespace sw
150150 bool force32BitFiltering = state.highPrecisionFiltering && !hasYuvFormat () && (state.textureFilter != FILTER_POINT);
151151 bool seamlessCube = (state.addressingModeU == ADDRESSING_SEAMLESS);
152152 bool use32BitFiltering = hasFloatTexture () || hasUnnormalizedIntegerTexture () || force32BitFiltering ||
153- seamlessCube || state.unnormalizedCoordinates || state.compareEnable || borderModeActive ();
153+ seamlessCube || state.unnormalizedCoordinates || state.compareEnable || state.largeTexture ||
154+ borderModeActive ();
154155
155156 if (use32BitFiltering)
156157 {
@@ -448,8 +449,8 @@ namespace sw
448449 if (!gather) // Blend
449450 {
450451 // Fractions
451- UShort4 f0u = As<UShort4>(uuuu0) * *Pointer<UShort4 >(mipmap + OFFSET (Mipmap,width));
452- UShort4 f0v = As<UShort4>(vvvv0) * *Pointer<UShort4 >(mipmap + OFFSET (Mipmap,height));
452+ UShort4 f0u = As<UShort4>(uuuu0) * UShort4 ( *Pointer<Int4 >(mipmap + OFFSET (Mipmap,width) ));
453+ UShort4 f0v = As<UShort4>(vvvv0) * UShort4 ( *Pointer<Int4 >(mipmap + OFFSET (Mipmap,height) ));
453454
454455 UShort4 f1u = ~f0u;
455456 UShort4 f1v = ~f0v;
@@ -650,9 +651,9 @@ namespace sw
650651 }
651652
652653 // Fractions
653- UShort4 f0u = As<UShort4>(u[0 ][0 ][0 ]) * *Pointer<UShort4 >(mipmap + OFFSET (Mipmap,width));
654- UShort4 f0v = As<UShort4>(v[0 ][0 ][0 ]) * *Pointer<UShort4 >(mipmap + OFFSET (Mipmap,height));
655- UShort4 f0s = As<UShort4>(s[0 ][0 ][0 ]) * *Pointer<UShort4 >(mipmap + OFFSET (Mipmap,depth));
654+ UShort4 f0u = As<UShort4>(u[0 ][0 ][0 ]) * UShort4 ( *Pointer<Int4 >(mipmap + OFFSET (Mipmap,width) ));
655+ UShort4 f0v = As<UShort4>(v[0 ][0 ][0 ]) * UShort4 ( *Pointer<Int4 >(mipmap + OFFSET (Mipmap,height) ));
656+ UShort4 f0s = As<UShort4>(s[0 ][0 ][0 ]) * UShort4 ( *Pointer<Int4 >(mipmap + OFFSET (Mipmap,depth) ));
656657
657658 UShort4 f1u = ~f0u;
658659 UShort4 f1v = ~f0v;
@@ -1203,16 +1204,16 @@ namespace sw
12031204
12041205 if (!texelFetch)
12051206 {
1206- uuuu = MulHigh (As<UShort4>(uuuu), *Pointer<UShort4 >(mipmap + OFFSET (Mipmap, width)));
1207- vvvv = MulHigh (As<UShort4>(vvvv), *Pointer<UShort4 >(mipmap + OFFSET (Mipmap, height)));
1207+ uuuu = MulHigh (As<UShort4>(uuuu), UShort4 ( *Pointer<Int4 >(mipmap + OFFSET (Mipmap, width) )));
1208+ vvvv = MulHigh (As<UShort4>(vvvv), UShort4 ( *Pointer<Int4 >(mipmap + OFFSET (Mipmap, height) )));
12081209 }
12091210
12101211 if (hasOffset)
12111212 {
1212- UShort4 w = *Pointer<UShort4 >(mipmap + OFFSET (Mipmap, width));
1213- uuuu = applyOffset (uuuu, offset. x , Int4 (w), texelFetch ? ADDRESSING_TEXELFETCH : state.addressingModeU );
1214- UShort4 h = *Pointer<UShort4 >(mipmap + OFFSET (Mipmap, height));
1215- vvvv = applyOffset (vvvv, offset. y , Int4 (h), texelFetch ? ADDRESSING_TEXELFETCH : state.addressingModeV );
1213+ uuuu = applyOffset (uuuu, offset. x , *Pointer<Int4 >(mipmap + OFFSET (Mipmap, width)),
1214+ texelFetch ? ADDRESSING_TEXELFETCH : state.addressingModeU );
1215+ vvvv = applyOffset (vvvv, offset. y , *Pointer<Int4 >(mipmap + OFFSET (Mipmap, height)),
1216+ texelFetch ? ADDRESSING_TEXELFETCH : state.addressingModeV );
12161217 }
12171218
12181219 Short4 uuu2 = uuuu;
@@ -1227,13 +1228,13 @@ namespace sw
12271228 {
12281229 if (!texelFetch)
12291230 {
1230- wwww = MulHigh (As<UShort4>(wwww), *Pointer<UShort4 >(mipmap + OFFSET (Mipmap, depth)));
1231+ wwww = MulHigh (As<UShort4>(wwww), UShort4 ( *Pointer<Int4 >(mipmap + OFFSET (Mipmap, depth) )));
12311232 }
12321233
12331234 if (hasOffset)
12341235 {
1235- UShort4 d = *Pointer<UShort4 >(mipmap + OFFSET (Mipmap, depth));
1236- wwww = applyOffset (wwww, offset. z , Int4 (d), texelFetch ? ADDRESSING_TEXELFETCH : state.addressingModeW );
1236+ wwww = applyOffset (wwww, offset. z , *Pointer<Int4 >(mipmap + OFFSET (Mipmap, depth)),
1237+ texelFetch ? ADDRESSING_TEXELFETCH : state.addressingModeW );
12371238 }
12381239 }
12391240
@@ -1255,10 +1256,10 @@ namespace sw
12551256
12561257 if (texelFetch)
12571258 {
1258- Int size = Int ( *Pointer<Int>(mipmap + OFFSET (Mipmap, sliceP) ));
1259+ Int size = *Pointer<Int>(mipmap + OFFSET (Mipmap, sliceP));
12591260 if (hasThirdCoordinate ())
12601261 {
1261- size *= Int ( *Pointer<Short >(mipmap + OFFSET (Mipmap, depth) ));
1262+ size *= *Pointer<Int >(mipmap + OFFSET (Mipmap, depth));
12621263 }
12631264 UInt min = 0 ;
12641265 UInt max = size - 1 ;
@@ -1989,7 +1990,7 @@ namespace sw
19891990 }
19901991 else if (addressingMode == ADDRESSING_LAYER)
19911992 {
1992- return Min (Max (Short4 ( RoundInt (uw)), Short4 (0 )), *Pointer<Short4 >(mipmap + OFFSET (Mipmap, depth)) - Short4 ( 1 ));
1993+ return Short4 ( Min (Max (RoundInt (uw), Int4 (0 )), *Pointer<Int4 >(mipmap + OFFSET (Mipmap, depth)) - Int4 ( 1 ) ));
19931994 }
19941995 else if (addressingMode == ADDRESSING_CLAMP || addressingMode == ADDRESSING_BORDER)
19951996 {
@@ -2030,7 +2031,7 @@ namespace sw
20302031 return ;
20312032 }
20322033
2033- Int4 dim = Int4 ( *Pointer<Short4 >(mipmap + whd, 16 ) );
2034+ Int4 dim = *Pointer<Int4 >(mipmap + whd, 16 );
20342035 Int4 maxXYZ = dim - Int4 (1 );
20352036
20362037 if (function == Fetch)
0 commit comments