Mesa (master): swrast: assert _swrast_map_teximage() x, y is multiple of block size

Brian Paul brianp at kemper.freedesktop.org
Mon Dec 26 23:06:37 UTC 2011


Module: Mesa
Branch: master
Commit: 98dffd9764195be2734579a2b4ae7637b62ea7d8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=98dffd9764195be2734579a2b4ae7637b62ea7d8

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Dec 26 14:49:57 2011 -0700

swrast: assert _swrast_map_teximage() x, y is multiple of block size

---

 src/mesa/swrast/s_texture.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c
index e31cd62..ffd78a2 100644
--- a/src/mesa/swrast/s_texture.c
+++ b/src/mesa/swrast/s_texture.c
@@ -189,6 +189,9 @@ _swrast_map_teximage(struct gl_context *ctx,
    stride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width);
    _mesa_get_format_block_size(texImage->TexFormat, &bw, &bh);
 
+   assert(x % bw == 0);
+   assert(y % bh == 0);
+
    if (!swImage->Buffer) {
       /* probably ran out of memory when allocating tex mem */
       *mapOut = NULL;




More information about the mesa-commit mailing list