summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_texfetch_tmp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast/s_texfetch_tmp.h')
-rw-r--r--src/mesa/swrast/s_texfetch_tmp.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h
index 4cd42c06dfe..c9991cd84d9 100644
--- a/src/mesa/swrast/s_texfetch_tmp.h
+++ b/src/mesa/swrast/s_texfetch_tmp.h
@@ -52,15 +52,16 @@
#define TEXEL_ADDR( type, image, i, j, k, size ) \
((void) (k), \
- ((type *)(image)->ImageSlices[0] + ((image)->RowStride * (j) + (i)) * (size)))
+ ((type *)((image)->ImageSlices[0] + (image)->RowStride * (j)) + \
+ (i) * (size)))
#define FETCH(x) fetch_texel_2d_##x
#elif DIM == 3
#define TEXEL_ADDR( type, image, i, j, k, size ) \
- ((type *)(image)->ImageSlices[k] + \
- ((image)->RowStride * (j) + (i)) * (size))
+ ((type *)((image)->ImageSlices[k] + \
+ (image)->RowStride * (j)) + (i) * (size))
#define FETCH(x) fetch_texel_3d_##x