i965/gen7: Fix segfault in transform feedback to DYNAMIC_DRAW buffers.
authorEric Anholt <eric@anholt.net>
Mon, 2 Jan 2012 22:03:59 +0000 (14:03 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 11 Jan 2012 20:06:34 +0000 (12:06 -0800)
Fixes piglit EXT_transform_feedback/buffer-usage.

src/mesa/drivers/dri/i965/gen7_sol_state.c

index 04783ec3132ed2682406854b8c0e97363db00c22..110c1662b3d6a9ee213e8cfb0856966688c3435b 100644 (file)
@@ -53,7 +53,8 @@ upload_3dstate_so_buffers(struct brw_context *brw)
     * gl_transform_feedback_object.
     */
    for (i = 0; i < 4; i++) {
-      struct gl_buffer_object *bufferobj = xfb_obj->Buffers[i];
+      struct intel_buffer_object *bufferobj =
+        intel_buffer_object(xfb_obj->Buffers[i]);
       drm_intel_bo *bo;
       uint32_t start, end;
       uint32_t stride;
@@ -72,7 +73,7 @@ upload_3dstate_so_buffers(struct brw_context *brw)
         continue;
       }
 
-      bo = intel_buffer_object(bufferobj)->buffer;
+      bo = intel_bufferobj_buffer(intel, bufferobj, INTEL_WRITE_PART);
       stride = linked_xfb_info->BufferStride[i] * 4;
 
       start = xfb_obj->Offset[i];