intel: Fixups for 'mesa: create/destroy buffer objects via driver functions'.

Initialize all driver function hooks before calling _mesa_initialize_context(),
and handle all buffer objects in intel_buffer_object().

Fixes assertion failure when running glxinfo.
This commit is contained in:
Michel Dänzer
2009-06-19 23:55:55 +02:00
parent 4d2b392a0a
commit dd26899ca3
3 changed files with 11 additions and 16 deletions

View File

@@ -315,15 +315,13 @@ intel_bufferobj_buffer(struct intel_context *intel,
} }
void void
intel_bufferobj_init(struct intel_context *intel) intelInitBufferObjectFuncs(struct dd_function_table *functions)
{ {
GLcontext *ctx = &intel->ctx; functions->NewBufferObject = intel_bufferobj_alloc;
functions->DeleteBuffer = intel_bufferobj_free;
ctx->Driver.NewBufferObject = intel_bufferobj_alloc; functions->BufferData = intel_bufferobj_data;
ctx->Driver.DeleteBuffer = intel_bufferobj_free; functions->BufferSubData = intel_bufferobj_subdata;
ctx->Driver.BufferData = intel_bufferobj_data; functions->GetBufferSubData = intel_bufferobj_get_subdata;
ctx->Driver.BufferSubData = intel_bufferobj_subdata; functions->MapBuffer = intel_bufferobj_map;
ctx->Driver.GetBufferSubData = intel_bufferobj_get_subdata; functions->UnmapBuffer = intel_bufferobj_unmap;
ctx->Driver.MapBuffer = intel_bufferobj_map;
ctx->Driver.UnmapBuffer = intel_bufferobj_unmap;
} }

View File

@@ -60,7 +60,7 @@ dri_bo *intel_bufferobj_buffer(struct intel_context *intel,
/* Hook the bufferobject implementation into mesa: /* Hook the bufferobject implementation into mesa:
*/ */
void intel_bufferobj_init(struct intel_context *intel); void intelInitBufferObjectFuncs(struct dd_function_table *functions);
@@ -72,10 +72,7 @@ void intel_bufferobj_init(struct intel_context *intel);
static INLINE struct intel_buffer_object * static INLINE struct intel_buffer_object *
intel_buffer_object(struct gl_buffer_object *obj) intel_buffer_object(struct gl_buffer_object *obj)
{ {
if (obj->Name)
return (struct intel_buffer_object *) obj; return (struct intel_buffer_object *) obj;
else
return NULL;
} }
/* Helpers for zerocopy image uploads. See also intel_regions.h: /* Helpers for zerocopy image uploads. See also intel_regions.h:

View File

@@ -557,6 +557,7 @@ intelInitDriverFunctions(struct dd_function_table *functions)
intelInitClearFuncs(functions); intelInitClearFuncs(functions);
intelInitBufferFuncs(functions); intelInitBufferFuncs(functions);
intelInitPixelFuncs(functions); intelInitPixelFuncs(functions);
intelInitBufferObjectFuncs(functions);
} }
@@ -717,7 +718,6 @@ intelInitContext(struct intel_context *intel,
intel->batch = intel_batchbuffer_alloc(intel); intel->batch = intel_batchbuffer_alloc(intel);
intel_bufferobj_init(intel);
intel_fbo_init(intel); intel_fbo_init(intel);
if (intel->ctx.Mesa_DXTn) { if (intel->ctx.Mesa_DXTn) {