i915tex: Fix performance regression with new vbo code and latest drm.
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Mon, 19 Feb 2007 18:57:30 +0000 (19:57 +0100)
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Mon, 19 Feb 2007 18:57:30 +0000 (19:57 +0100)
With current memory preferences, vbos ended up in AGP space
where reading from them got a bit slow.

Make sure buffer objects are initially created in system memory.

src/mesa/drivers/dri/i915tex/intel_buffer_objects.c

index 31c41d868571f06000d84312c9ebf46db3853315..ba3c7f0c1f7d53668eaa80d40e932ed0ce4fc0db 100644 (file)
@@ -50,7 +50,10 @@ intel_bufferobj_alloc(GLcontext * ctx, GLuint name, GLenum target)
    _mesa_initialize_buffer_object(&obj->Base, name, target);
 
    driGenBuffers(intel->intelScreen->regionPool,
-                 "bufferobj", 1, &obj->buffer, 64, 0, 0);
+                 "bufferobj", 1, &obj->buffer, 64,
+                DRM_BO_FLAG_MEM_LOCAL |
+                DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE,
+                0);
 
    return &obj->Base;
 }