summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-11-24 10:24:17 -0700
committerBrian Paul <[email protected]>2010-11-24 12:11:23 -0700
commit7bfbd88d2cc4c7e7c1c2fe02b0d223f4a3ea8db2 (patch)
tree3f8b19cfb412864f0ce637083cd78bccdbc611ae /src/mesa/main
parenta889f9ee5cccee031c1090a6ef92cba894b1d77c (diff)
mesa: add assertion and update comment in _mesa_format_image_size()
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/formats.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 88a04e888e4..f689d99df8e 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -1057,11 +1057,12 @@ _mesa_format_image_size(gl_format format, GLsizei width,
const struct gl_format_info *info = _mesa_get_format_info(format);
/* Strictly speaking, a conditional isn't needed here */
if (info->BlockWidth > 1 || info->BlockHeight > 1) {
- /* compressed format */
+ /* compressed format (2D only for now) */
const GLuint bw = info->BlockWidth, bh = info->BlockHeight;
const GLuint wblocks = (width + bw - 1) / bw;
const GLuint hblocks = (height + bh - 1) / bh;
const GLuint sz = wblocks * hblocks * info->BytesPerBlock;
+ assert(depth == 1);
return sz;
}
else {