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:
@@ -315,15 +315,13 @@ intel_bufferobj_buffer(struct intel_context *intel,
|
||||
}
|
||||
|
||||
void
|
||||
intel_bufferobj_init(struct intel_context *intel)
|
||||
intelInitBufferObjectFuncs(struct dd_function_table *functions)
|
||||
{
|
||||
GLcontext *ctx = &intel->ctx;
|
||||
|
||||
ctx->Driver.NewBufferObject = intel_bufferobj_alloc;
|
||||
ctx->Driver.DeleteBuffer = intel_bufferobj_free;
|
||||
ctx->Driver.BufferData = intel_bufferobj_data;
|
||||
ctx->Driver.BufferSubData = intel_bufferobj_subdata;
|
||||
ctx->Driver.GetBufferSubData = intel_bufferobj_get_subdata;
|
||||
ctx->Driver.MapBuffer = intel_bufferobj_map;
|
||||
ctx->Driver.UnmapBuffer = intel_bufferobj_unmap;
|
||||
functions->NewBufferObject = intel_bufferobj_alloc;
|
||||
functions->DeleteBuffer = intel_bufferobj_free;
|
||||
functions->BufferData = intel_bufferobj_data;
|
||||
functions->BufferSubData = intel_bufferobj_subdata;
|
||||
functions->GetBufferSubData = intel_bufferobj_get_subdata;
|
||||
functions->MapBuffer = intel_bufferobj_map;
|
||||
functions->UnmapBuffer = intel_bufferobj_unmap;
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ dri_bo *intel_bufferobj_buffer(struct intel_context *intel,
|
||||
|
||||
/* 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 *
|
||||
intel_buffer_object(struct gl_buffer_object *obj)
|
||||
{
|
||||
if (obj->Name)
|
||||
return (struct intel_buffer_object *) obj;
|
||||
else
|
||||
return NULL;
|
||||
return (struct intel_buffer_object *) obj;
|
||||
}
|
||||
|
||||
/* Helpers for zerocopy image uploads. See also intel_regions.h:
|
||||
|
@@ -557,6 +557,7 @@ intelInitDriverFunctions(struct dd_function_table *functions)
|
||||
intelInitClearFuncs(functions);
|
||||
intelInitBufferFuncs(functions);
|
||||
intelInitPixelFuncs(functions);
|
||||
intelInitBufferObjectFuncs(functions);
|
||||
}
|
||||
|
||||
|
||||
@@ -717,7 +718,6 @@ intelInitContext(struct intel_context *intel,
|
||||
|
||||
intel->batch = intel_batchbuffer_alloc(intel);
|
||||
|
||||
intel_bufferobj_init(intel);
|
||||
intel_fbo_init(intel);
|
||||
|
||||
if (intel->ctx.Mesa_DXTn) {
|
||||
|
Reference in New Issue
Block a user