svga: add some sanity check assertions in svga_buffer_transfer_map()
authorBrian Paul <brianp@vmware.com>
Thu, 19 Nov 2015 17:39:09 +0000 (10:39 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 20 Nov 2015 20:40:06 +0000 (13:40 -0700)
Make sure y and z values of buffers are as expected.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_resource_buffer.c

index 71f2f4f277953f163a16ef952280b8450970e2ad..449cc149a8138f2c0d8b63180f6d64bdac02c8bc 100644 (file)
@@ -80,6 +80,11 @@ svga_buffer_transfer_map(struct pipe_context *pipe,
    uint8_t *map;
    int64_t begin = os_time_get();
 
+   assert(box->y == 0);
+   assert(box->z == 0);
+   assert(box->height == 1);
+   assert(box->depth == 1);
+
    transfer = CALLOC_STRUCT(pipe_transfer);
    if (transfer == NULL) {
       return NULL;