Move initialization of default ctx->Driver.buffer-object-functions into
authorBrian Paul <brian.paul@tungstengraphics.com>
Sun, 19 Oct 2003 15:10:36 +0000 (15:10 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Sun, 19 Oct 2003 15:10:36 +0000 (15:10 +0000)
bufferobj.c so all the drivers don't have to worry about them.

src/mesa/drivers/osmesa/osmesa.c
src/mesa/drivers/x11/xm_dd.c
src/mesa/main/bufferobj.c

index 368e35a98940cb3d42f6f4df6011612a5c2d394f..67d72446b8d7d9280f91d151b70ae3374b224d38 100644 (file)
@@ -682,17 +682,6 @@ hook_in_driver_functions( GLcontext *ctx )
    ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
    ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
 
-#if FEATURE_ARB_vertex_buffer_object
-   ctx->Driver.NewBufferObject = _mesa_new_buffer_object;
-   ctx->Driver.DeleteBuffer = _mesa_delete_buffer_object;
-   ctx->Driver.BindBuffer = NULL;
-   ctx->Driver.BufferData = _mesa_buffer_data;
-   ctx->Driver.BufferSubData = _mesa_buffer_subdata;
-   ctx->Driver.GetBufferSubData = _mesa_buffer_get_subdata;
-   ctx->Driver.MapBuffer = _mesa_buffer_map;
-   ctx->Driver.UnmapBuffer = NULL;
-#endif
-
    swdd->SetBuffer = set_buffer;
 
    /* RGB(A) span/pixel functions */
index c5e59bc08304ce73783acbb12c1397cbf171604e..28e6154df4abe0cb4d091dbc7de083576e333feb 100644 (file)
@@ -1015,17 +1015,6 @@ void xmesa_init_pointers( GLcontext *ctx )
    ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
    ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
 
-#if FEATURE_ARB_vertex_buffer_object
-   ctx->Driver.NewBufferObject = _mesa_new_buffer_object;
-   ctx->Driver.DeleteBuffer = _mesa_delete_buffer_object;
-   ctx->Driver.BindBuffer = NULL;
-   ctx->Driver.BufferData = _mesa_buffer_data;
-   ctx->Driver.BufferSubData = _mesa_buffer_subdata;
-   ctx->Driver.GetBufferSubData = _mesa_buffer_get_subdata;
-   ctx->Driver.MapBuffer = _mesa_buffer_map;
-   ctx->Driver.UnmapBuffer = NULL;
-#endif
-
    /* Initialize the TNL driver interface:
     */
    tnl = TNL_CONTEXT(ctx);
index 17ea49b61feacf8bba9d0492b4a93a3f038bdd8e..04107928e383deef049eb80d7ca0b21e4b3a844e 100644 (file)
@@ -347,6 +347,18 @@ _mesa_init_buffer_objects( GLcontext *ctx )
    for (i = 0; i < VERT_ATTRIB_MAX; i++) {
       ctx->Array.VertexAttrib[i].BufferObj = ctx->Array.NullBufferObj;
    }
+
+   /* Device drivers might override these assignments after the Mesa
+    * context is initialized.
+    */
+   ctx->Driver.NewBufferObject = _mesa_new_buffer_object;
+   ctx->Driver.DeleteBuffer = _mesa_delete_buffer_object;
+   ctx->Driver.BindBuffer = NULL;
+   ctx->Driver.BufferData = _mesa_buffer_data;
+   ctx->Driver.BufferSubData = _mesa_buffer_subdata;
+   ctx->Driver.GetBufferSubData = _mesa_buffer_get_subdata;
+   ctx->Driver.MapBuffer = _mesa_buffer_map;
+   ctx->Driver.UnmapBuffer = NULL;
 }