radeon: update buffer map/unmap code for changes introduced in 92033a9516942d7272ce4b...
authorMaciej Cencora <m.cencora@gmail.com>
Sun, 20 Sep 2009 11:54:59 +0000 (13:54 +0200)
committerMaciej Cencora <m.cencora@gmail.com>
Mon, 21 Sep 2009 19:13:01 +0000 (21:13 +0200)
src/mesa/drivers/dri/radeon/radeon_buffer_objects.c

index a24b6dac265bda5278db00112255c89feba517ad..8fac5c6c512984ddd69fc842f63eb8d771bb0789 100644 (file)
@@ -187,7 +187,11 @@ radeonMapBuffer(GLcontext * ctx,
 
     radeon_bo_map(radeon_obj->bo, access == GL_WRITE_ONLY_ARB);
 
-    return obj->Pointer = radeon_obj->bo->ptr;
+    obj->Pointer = radeon_obj->bo->ptr;
+    obj->Length = obj->Size;
+    obj->Offset = 0;
+
+    return obj->Pointer;
 }
 
 
@@ -203,9 +207,12 @@ radeonUnmapBuffer(GLcontext * ctx,
 
     if (radeon_obj->bo != NULL) {
         radeon_bo_unmap(radeon_obj->bo);
-        obj->Pointer = NULL;
     }
 
+    obj->Pointer = NULL;
+    obj->Offset = 0;
+    obj->Length = 0;
+
     return GL_TRUE;
 }