mesa: generate error if pbo offset is not aligned with the size of specified type
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Mon, 17 Oct 2011 01:57:36 +0000 (09:57 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 19 Oct 2011 01:25:30 +0000 (09:25 +0800)
commit9024d8af0ae832a0b4278eb6683bc0e76c69baac
treef7c58496d7bb47b65ff51c865ac3e9d651fdbea9
parent76669381c0de6a49a1edd0b88fa1ae6b86f10b30
mesa: generate error if pbo offset is not aligned with the size of specified type

v2: quote the spec; explicitly exclude the GL_BITMAP case to make code
    more readable. (comments from Ian)

v3: Cast the offset by GLintptr to remove the compile warning(comments
    from Brian).

    I also found that I should use _mesa_sizeof_packed_type() instead,
    as it includes packed pixel type, like GL_UNSIGNED_SHORT_5_6_5.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/pbo.c