if (!psp)
return NULL;
+ psp->driver = &driDriverAPI;
+
setupLoaderExtensions(psp, extensions);
#ifndef __NOT_HAVE_DRM_H
psp->fd = fd;
psp->myNum = scrn;
- *driver_configs = driDriverAPI.InitScreen(psp);
+ *driver_configs = psp->driver->InitScreen(psp);
if (*driver_configs == NULL) {
free(psp);
return NULL;
_mesa_destroy_shader_compiler();
- driDriverAPI.DestroyScreen(psp);
+ psp->driver->DestroyScreen(psp);
driDestroyOptionCache(&psp->optionCache);
driDestroyOptionInfo(&psp->optionInfo);
context->driDrawablePriv = NULL;
context->driReadablePriv = NULL;
- if (!driDriverAPI.CreateContext(mesa_api, modes, context,
- major_version, minor_version,
- flags, error, shareCtx) ) {
+ if (!screen->driver->CreateContext(mesa_api, modes, context,
+ major_version, minor_version,
+ flags, error, shareCtx) ) {
free(context);
return NULL;
}
driDestroyContext(__DRIcontext *pcp)
{
if (pcp) {
- driDriverAPI.DestroyContext(pcp);
+ pcp->driScreenPriv->driver->DestroyContext(pcp);
free(pcp);
}
}
dri_get_drawable(prp);
}
- return driDriverAPI.MakeCurrent(pcp, pdp, prp);
+ return pcp->driScreenPriv->driver->MakeCurrent(pcp, pdp, prp);
}
/**
if (!pdp && !prp)
return GL_TRUE;
- driDriverAPI.UnbindContext(pcp);
+ pcp->driScreenPriv->driver->UnbindContext(pcp);
assert(pdp);
if (pdp->refcount == 0) {
if (pdp->refcount)
return;
- driDriverAPI.DestroyBuffer(pdp);
+ pdp->driScreenPriv->driver->DestroyBuffer(pdp);
free(pdp);
}
}
dri_get_drawable(pdraw);
- if (!driDriverAPI.CreateBuffer(screen, pdraw, &config->modes, GL_FALSE)) {
+ if (!screen->driver->CreateBuffer(screen, pdraw, &config->modes,
+ GL_FALSE)) {
free(pdraw);
return NULL;
}
unsigned int attachment, unsigned int format,
int width, int height)
{
- return driDriverAPI.AllocateBuffer(screen, attachment, format,
- width, height);
+ return screen->driver->AllocateBuffer(screen, attachment, format,
+ width, height);
}
static void
dri2ReleaseBuffer(__DRIscreen *screen, __DRIbuffer *buffer)
{
- driDriverAPI.ReleaseBuffer(screen, buffer);
+ screen->driver->ReleaseBuffer(screen, buffer);
}
{
assert(pdp->driScreenPriv->swrast_loader);
- driDriverAPI.SwapBuffers(pdp);
+ pdp->driScreenPriv->driver->SwapBuffers(pdp);
}
/** Core interface */